hypothesis 1.1070.0 → 1.1071.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/boot.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";function t(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function e(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return n.every((function(e){return"function"==typeof t[e]}))}var n={es2017:function(){return!e(Object,"entries","values")},es2018:function(){return"function"!=typeof Promise||!e(Promise.prototype,"finally")}};function r(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=o(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,s=function(){};return{s:s,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return i=t.done,t},e:function(t){l=!0,a=t},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw a}}}}function s(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||o(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){if(t){if("string"==typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var i=["es2017","es2018"];function l(t){t.setAttribute("data-hypothesis-asset","")}function c(t,e){var n=t.createElement("link");n.rel="stylesheet",n.type="text/css",n.href=e,l(n),t.head.appendChild(n)}function u(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.esModule,s=void 0===r||r,o=n.forceReload,a=void 0!==o&&o,i=t.createElement("script");s&&(i.type="module"),a&&(e+="#ts=".concat(Date.now())),i.src=e,i.async=!1,l(i),t.head.appendChild(i)}function p(t,e,n,r){var s=t.createElement("link");s.rel=e,s.href=r,s.type="application/annotator+".concat(n),l(s),t.head.appendChild(s)}function d(t,e,n){var r=t.createElement("link");r.rel="preload",r.as=e,r.href=n,"fetch"===e&&(r.crossOrigin="anonymous"),l(r),t.head.appendChild(r)}function f(t,e){return t.assetRoot+"build/"+t.manifest[e]}function h(t){return function(t){return t.filter((function(t){var e=n[t];if(!e)throw new Error('Unknown polyfill set "'.concat(t,'"'));return e()}))}(t).map((function(t){return"scripts/polyfills-".concat(t,".bundle.js")}))}function y(t){var e=t.match(/(https?):\/\/([^:/]+)/);return e?{protocol:e[1],hostname:e[2]}:null}function m(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,e=t.currentScript;return e?y(e.src):null}function b(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(-1===t.indexOf("{"))return t;var n=m(e);if(!n)throw new Error("Could not process URL template because script origin is unknown");return t=(t=t.replace("{current_host}",n.hostname)).replace("{current_scheme}",n.protocol)}var v={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?
|
|
1
|
+
!function(){"use strict";function t(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function e(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return n.every((function(e){return"function"==typeof t[e]}))}var n={es2017:function(){return!e(Object,"entries","values")},es2018:function(){return"function"!=typeof Promise||!e(Promise.prototype,"finally")}};function r(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=o(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,s=function(){};return{s:s,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return i=t.done,t},e:function(t){l=!0,a=t},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw a}}}}function s(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||o(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){if(t){if("string"==typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var i=["es2017","es2018"];function l(t){t.setAttribute("data-hypothesis-asset","")}function c(t,e){var n=t.createElement("link");n.rel="stylesheet",n.type="text/css",n.href=e,l(n),t.head.appendChild(n)}function u(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.esModule,s=void 0===r||r,o=n.forceReload,a=void 0!==o&&o,i=t.createElement("script");s&&(i.type="module"),a&&(e+="#ts=".concat(Date.now())),i.src=e,i.async=!1,l(i),t.head.appendChild(i)}function p(t,e,n,r){var s=t.createElement("link");s.rel=e,s.href=r,s.type="application/annotator+".concat(n),l(s),t.head.appendChild(s)}function d(t,e,n){var r=t.createElement("link");r.rel="preload",r.as=e,r.href=n,"fetch"===e&&(r.crossOrigin="anonymous"),l(r),t.head.appendChild(r)}function f(t,e){return t.assetRoot+"build/"+t.manifest[e]}function h(t){return function(t){return t.filter((function(t){var e=n[t];if(!e)throw new Error('Unknown polyfill set "'.concat(t,'"'));return e()}))}(t).map((function(t){return"scripts/polyfills-".concat(t,".bundle.js")}))}function y(t){var e=t.match(/(https?):\/\/([^:/]+)/);return e?{protocol:e[1],hostname:e[2]}:null}function m(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,e=t.currentScript;return e?y(e.src):null}function b(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(-1===t.indexOf("{"))return t;var n=m(e);if(!n)throw new Error("Could not process URL template because script origin is unknown");return t=(t=t.replace("{current_host}",n.hostname)).replace("{current_scheme}",n.protocol)}var v={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?6698ab","styles/annotator.css":"styles/annotator.css?31adb4","styles/annotator.css.map":"styles/annotator.css.map?203fff","styles/highlights.css":"styles/highlights.css?5dd56a","styles/highlights.css.map":"styles/highlights.css.map?34b9c1","styles/katex.min.css":"styles/katex.min.css?d477ff","styles/katex.min.css.map":"styles/katex.min.css.map?010d5b","styles/pdfjs-overrides.css":"styles/pdfjs-overrides.css?c95edf","styles/pdfjs-overrides.css.map":"styles/pdfjs-overrides.css.map?2eeb58","styles/sidebar.css":"styles/sidebar.css?1fa510","styles/sidebar.css.map":"styles/sidebar.css.map?681f45","styles/ui-playground.css":"styles/ui-playground.css?ecff69","styles/ui-playground.css.map":"styles/ui-playground.css.map?aeccb7","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?0ec946","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?44387a","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?db48c2","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?cb10ed","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?e1f911"};if(function(){var t=[function(){return Promise.resolve()},function(){return new Map},function(){return new URL(document.location.href)},function(){return new Request("https://hypothes.is")},function(){return Element.prototype.attachShadow},function(){return CSS.supports("display: grid")},function(){return document.evaluate("/html/body",document,null,XPathResult.ANY_TYPE,null),!0}];try{return t.every((function(t){return t()}))}catch(t){return!1}}()){var g=function(e){for(var n={},r=e.querySelectorAll("script.js-hypothesis-config"),s=0;s<r.length;s++){var o=void 0;try{o=JSON.parse(r[s].textContent||"")}catch(t){console.warn("Could not parse settings from js-hypothesis-config tags",t),o={}}t(n,o)}return n}(document),j=b(g.assetRoot||"https://cdn.hypothes.is/hypothesis/1.1071.0/");if(document.querySelector("hypothesis-app")){!function(t,e){d(t,"fetch",e.apiUrl),d(t,"fetch",e.apiUrl+"links");var n,o=h(i),a=r([].concat(s(o),["scripts/sidebar.bundle.js"]));try{for(a.s();!(n=a.n()).done;)u(t,f(e,n.value),{esModule:!0})}catch(t){a.e(t)}finally{a.f()}for(var l=0,p=["styles/katex.min.css","styles/sidebar.css"];l<p.length;l++)c(t,f(e,p[l]))}(document,{assetRoot:j,manifest:v,apiUrl:g.apiUrl})}else{var w=g,A=b(w.notebookAppUrl||"https://hypothes.is/notebook"),k=b(w.sidebarAppUrl||"https://hypothes.is/app.html");!function(t,e){if(!t.querySelector('link[type="application/annotator+html"]')){p(t,"sidebar","html",e.sidebarAppUrl),p(t,"notebook","html",e.notebookAppUrl),d(t,"style",f(e,"styles/annotator.css")),p(t,"hypothesis-client","javascript",e.assetRoot+"build/boot.js");var n,o=h(i),a=r([].concat(s(o),["scripts/annotator.bundle.js"]));try{for(a.s();!(n=a.n()).done;)u(t,f(e,n.value),{esModule:!1})}catch(t){a.e(t)}finally{a.f()}var l=[];void 0!==window.PDFViewerApplication&&l.push("styles/pdfjs-overrides.css"),l.push("styles/highlights.css");for(var y=0,m=l;y<m.length;y++)c(t,f(e,m[y]))}}(document,{assetRoot:j,manifest:v,notebookAppUrl:A,sidebarAppUrl:k})}}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,7 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"scripts/annotator.bundle.js": "scripts/annotator.bundle.js?
|
|
3
|
-
"scripts/ui-playground.bundle.js": "scripts/ui-playground.bundle.js?db48c2",
|
|
4
|
-
"scripts/ui-playground.bundle.js.map": "scripts/ui-playground.bundle.js.map?44387a",
|
|
2
|
+
"scripts/annotator.bundle.js": "scripts/annotator.bundle.js?6698ab",
|
|
5
3
|
"styles/annotator.css": "styles/annotator.css?31adb4",
|
|
6
4
|
"styles/annotator.css.map": "styles/annotator.css.map?203fff",
|
|
7
5
|
"styles/highlights.css": "styles/highlights.css?5dd56a",
|
|
@@ -14,7 +12,9 @@
|
|
|
14
12
|
"styles/sidebar.css.map": "styles/sidebar.css.map?681f45",
|
|
15
13
|
"styles/ui-playground.css": "styles/ui-playground.css?ecff69",
|
|
16
14
|
"styles/ui-playground.css.map": "styles/ui-playground.css.map?aeccb7",
|
|
15
|
+
"scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?0ec946",
|
|
16
|
+
"scripts/ui-playground.bundle.js.map": "scripts/ui-playground.bundle.js.map?44387a",
|
|
17
|
+
"scripts/ui-playground.bundle.js": "scripts/ui-playground.bundle.js?db48c2",
|
|
17
18
|
"scripts/annotator.bundle.js.map": "scripts/annotator.bundle.js.map?cb10ed",
|
|
18
|
-
"scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?
|
|
19
|
-
"scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?3ad995"
|
|
19
|
+
"scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?e1f911"
|
|
20
20
|
}
|
|
@@ -105,7 +105,7 @@ async getDocumentInfo(){const[t,e]=await Promise.all([this._integration.uri(),th
|
|
|
105
105
|
this._listeners.removeAll(),this._selectionObserver.disconnect(),this._adder.destroy(),this._bucketBarClient.destroy(),function(t){ke(Array.from(t.querySelectorAll("hypothesis-highlight")))}(this.element),this._integration.destroy()}async anchor(t){const e=t=>{const e=Bo(t);if(!e)return;const n=Te(e);n.forEach((e=>{e._annotation=t.annotation})),t.highlights=n,this._focusedAnnotations.has(t.annotation.$tag)&&Re(n,!0)};this.detach(t.$tag,!1),this._annotations.add(t.$tag),t.target||(t.target=[]);const n=await Promise.all(t.target.map((async e=>{if(!e.selector||!e.selector.some((t=>"TextQuoteSelector"===t.type)))return{annotation:t,target:e};let n;try{const o=await this._integration.anchor(this.element,e.selector),i=ve.fromRange(o);n={annotation:t,target:e,range:i}}catch(o){n={annotation:t,target:e}}return n})));if(!this._annotations.has(t.$tag))return[];for(let 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),
|
|
106
106
|
this._sidebarRPC.call("syncAnchoringStatus",t),n}detach(t,e=!0){this._annotations.delete(t);const n=[];for(let e of this.anchors)e.annotation.$tag!==t?n.push(e):e.highlights&&ke(e.highlights);this._updateAnchors(n,e)}_updateAnchors(t,e){this.anchors=t,e&&this._bucketBarClient.update(this.anchors)}async createAnnotation({highlight:t=!1}={}){const e=this.selectedRanges;this.selectedRanges=[];const n=await this.getDocumentInfo(),o=this.element,i=(await Promise.all(e.map((t=>this._integration.describe(o,t))))).map((t=>({source:n.uri,selector:t}))),r={uri:n.uri,document:n.metadata,target:i,$highlight:t,$tag:"a:"+Pt(8)};return this._sidebarRPC.call("createAnnotation",r),this.anchor(r),Fo(),r}_focusAnnotations(t){this._focusedAnnotations.clear(),t.forEach((t=>this._focusedAnnotations.add(t)));for(let e of this.anchors)if(e.highlights){const n=t.includes(e.annotation.$tag);Re(e.highlights,n)}this._sidebarRPC.call("focusAnnotations",t)}_scrollToClosestOffScreenAnchor(t,e){const n=function(t,e){let n=null,o=0
|
|
107
107
|
;for(let r of t){var i;if(null===(i=r.highlights)||void 0===i||!i.length)continue;const t=Le(r.highlights).top;"up"===e&&t>=137||"down"===e&&t<=window.innerHeight-22||(!n||"up"===e&&t>o||"down"===e&&t<o)&&(n=r,o=t)}return n}(this.anchors.filter((({annotation:e})=>t.includes(e.$tag))),e);n&&this._integration.scrollToAnchor(n)}_onSelection(t){if(!this._integration.canAnnotate(t))return void this._onClearSelection();const e=document.getSelection(),n=be(e),o=Se(e);o?(this.selectedRanges=[t],this._hostRPC.call("textSelected"),this._adder.annotationsForSelection=Io(),this._isAdderVisible=!0,this._adder.show(o,n)):this._onClearSelection()}_onClearSelection(){this._isAdderVisible=!1,this._adder.hide(),this.selectedRanges=[],this._informHostOnNextSelectionClear&&this._hostRPC.call("textUnselected"),this._informHostOnNextSelectionClear=!0}selectAnnotations(t,e=!1){e?this._sidebarRPC.call("toggleAnnotationSelection",t):this._sidebarRPC.call("showAnnotations",t),this._sidebarRPC.call("openSidebar")}
|
|
108
|
-
setHighlightsVisible(t){!function(t,e){t.classList.toggle("hypothesis-highlights-always-on",e)}(this.element,t),this._highlightsVisible=t}fitSideBySide(t){this._sideBySideActive=this._integration.fitSideBySide(t)}get sideBySideActive(){return this._sideBySideActive}get focusedAnnotationTags(){return this._focusedAnnotations}}function Vo(t,e){const n=new URL(t),o=new URLSearchParams;return o.append("config",JSON.stringify(e)),n.hash=o.toString(),n.toString()}function qo(t,e){var n;const o={};for(let[t,n]of Object.entries(e))"notebookAppUrl"!==t&&"sidebarAppUrl"!==t&&null!=n&&(o[t]=n);o.origin=new URL(t).origin,o.version="1.
|
|
108
|
+
setHighlightsVisible(t){!function(t,e){t.classList.toggle("hypothesis-highlights-always-on",e)}(this.element,t),this._highlightsVisible=t}fitSideBySide(t){this._sideBySideActive=this._integration.fitSideBySide(t)}get sideBySideActive(){return this._sideBySideActive}get focusedAnnotationTags(){return this._focusedAnnotations}}function Vo(t,e){const n=new URL(t),o=new URLSearchParams;return o.append("config",JSON.stringify(e)),n.hash=o.toString(),n.toString()}function qo(t,e){var n;const o={};for(let[t,n]of Object.entries(e))"notebookAppUrl"!==t&&"sidebarAppUrl"!==t&&null!=n&&(o[t]=n);o.origin=new URL(t).origin,o.version="1.1071.0";const i=new URL(window.location.href);if(i.hash="",o.hostURL=i.toString(),Array.isArray(o.services)&&(null===(n=o.services)||void 0===n?void 0:n.length)>0){const t=o.services[0];t.onLoginRequest&&(t.onLoginRequestProvided=!0),t.onLogoutRequest&&(t.onLogoutRequestProvided=!0),t.onSignupRequest&&(t.onSignupRequestProvided=!0),t.onProfileRequest&&(t.onProfileRequestProvided=!0),
|
|
109
109
|
t.onHelpRequest&&(t.onHelpRequestProvided=!0)}return o}function Uo({config:t,groupId:e}){return _t("iframe",{title:"Hypothesis annotation notebook",className:"h-full w-full border-0",allowFullScreen:!0,src:Vo(t.notebookAppUrl,{...qo(t.notebookAppUrl,t),group:e})})}function Wo({eventBus:t,config:e}){const[n,o]=st(0),[i,r]=st(!0),[s,a]=st(null),c=lt(""),l=lt(null);at((()=>(c.current=document.body.style.overflow,()=>{document.body.style.overflow=c.current})),[]),at((()=>{document.body.style.overflow=i?c.current:"hidden"}),[i]),at((()=>{const e=t.createEmitter();return e.subscribe("openNotebook",(t=>{r(!1),o((t=>t+1)),a(t)})),l.current=e,()=>{e.destroy()}}),[t]);return null===s?null:_t("div",{className:K("fixed z-max top-0 left-0 right-0 bottom-0 p-3 bg-black/50",{hidden:i}),"data-testid":"notebook-outer",children:_t("div",{className:"relative w-full h-full","data-testid":"notebook-inner",children:[_t("div",{className:"absolute right-0 text-xl m-3",children:_t(xt,{icon:"cancel",title:"Close the Notebook",
|
|
110
110
|
onClick:()=>{var t;r(!0),null===(t=l.current)||void 0===t||t.publish("closeNotebook")},variant:"dark"})}),_t(Uo,{config:e,groupId:s},n)]})})}class zo{constructor(t,e,n){this._outerContainer=document.createElement("hypothesis-notebook"),t.appendChild(this._outerContainer),this.shadowRoot=ue(this._outerContainer),M(_t(Wo,{eventBus:e,config:n}),this.shadowRoot)}destroy(){M(null,this.shadowRoot),this._outerContainer.remove()}}var $o={exports:{}};!function(t){!function(e,n,o,i){var r,s=["","webkit","Moz","MS","ms","o"],a=n.createElement("div"),c=Math.round,l=Math.abs,h=Date.now;function u(t,e,n){return setTimeout(v(t,n),e)}function d(t,e,n){return!!Array.isArray(t)&&(f(t,n[e],n),!0)}function f(t,e,n){var o;if(t)if(t.forEach)t.forEach(e,n);else if(t.length!==i)for(o=0;o<t.length;)e.call(n,t[o],o,t),o++;else for(o in t)t.hasOwnProperty(o)&&e.call(n,t[o],o,t)}function p(t,n,o){var i="DEPRECATED METHOD: "+n+"\n"+o+" AT \n";return function(){
|
|
111
111
|
var n=new Error("get-stack-trace"),o=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",r=e.console&&(e.console.warn||e.console.log);return r&&r.call(e.console,i,o),t.apply(this,arguments)}}r="function"!=typeof Object.assign?function(t){if(t===i||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var o=arguments[n];if(o!==i&&null!==o)for(var r in o)o.hasOwnProperty(r)&&(e[r]=o[r])}return e}:Object.assign;var g=p((function(t,e,n){for(var o=Object.keys(e),r=0;r<o.length;)(!n||n&&t[o[r]]===i)&&(t[o[r]]=e[o[r]]),r++;return t}),"extend","Use `assign`."),m=p((function(t,e){return g(t,e,!0)}),"merge","Use `assign`.");function _(t,e,n){var o,i=e.prototype;(o=t.prototype=Object.create(i)).constructor=t,o._super=i,n&&r(o,n)}function v(t,e){return function(){return t.apply(e,arguments)}}function y(t,e){
|
|
@@ -16,62 +16,62 @@ return e instanceof t}catch(e){return!1}}function me(e,t){try{let o=e;var n=[];l
|
|
|
16
16
|
;function _e(e,t=!1){const{host:n,path:r,pass:o,port:i,projectId:a,protocol:s,publicKey:l}=e;return`${s}://${l}${t&&o?`:${o}`:""}@${n}${i?`:${i}`:""}/${r?`${r}/`:r}${a}`}function be(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function ye(e){var t="string"==typeof e?function(e){var t=ve.exec(e);if(!t)throw new ge(`Invalid Sentry Dsn: ${e}`);const[n,r,o="",i,a="",s]=t.slice(1);let l="",c=s;var u=c.split("/");if(u.length>1&&(l=u.slice(0,-1).join("/"),c=u.pop()),c){var h=c.match(/^\d+/);h&&(c=h[0])}return be({host:i,pass:o,path:l,projectId:c,port:a,protocol:n,publicKey:r})}(e):be(e);return function(e){if("undefined"!=typeof __SENTRY_DEBUG__&&!__SENTRY_DEBUG__)return;const{port:t,projectId:n,protocol:r}=e;if(["protocol","publicKey","host","projectId"].forEach((t=>{if(!e[t])throw new ge(`Invalid Sentry Dsn: ${t} missing`)})),!n.match(/^\d+$/))throw new ge(`Invalid Sentry Dsn: Invalid projectId ${n}`);if(!function(e){
|
|
17
17
|
return"http"===e||"https"===e}(r))throw new ge(`Invalid Sentry Dsn: Invalid protocol ${r}`);if(t&&isNaN(parseInt(t,10)))throw new ge(`Invalid Sentry Dsn: Invalid port ${t}`)}(t),t}var we=te(),xe=["debug","info","warn","error","log","assert","trace"];function ke(e){var t=te();if(!("console"in t))return e();var n=t.console,r={};xe.forEach((e=>{var o=n[e]&&n[e].__sentry_original__;e in t.console&&o&&(r[e]=n[e],n[e]=o)}));try{return e()}finally{Object.keys(r).forEach((e=>{n[e]=r[e]}))}}function Se(){let e=!1;var t={enable:()=>{e=!0},disable:()=>{e=!1}};return"undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?xe.forEach((n=>{t[n]=(...t)=>{e&&ke((()=>{we.console[n](`Sentry Logger [${n}]:`,...t)}))}})):xe.forEach((e=>{t[e]=()=>{}})),t}let Ce;function Ee(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.substr(0,t)}...`}function Ae(e,t){if(!Array.isArray(e))return"";var n=[];for(let t=0;t<e.length;t++){var r=e[t];try{n.push(String(r))}catch(e){n.push("[value cannot be serialized]")}}return n.join(t)}
|
|
18
18
|
function Te(e,t){return!!le(e)&&(ie(t,"RegExp")?t.test(e):"string"==typeof t&&-1!==e.indexOf(t))}function Ne(e,t,n){if(t in e){var r=e[t],o=n(r);if("function"==typeof o)try{Le(o,r)}catch(e){}e[t]=o}}function Me(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}function Le(e,t){var n=t.prototype||{};e.prototype=t.prototype=n,Me(e,"__sentry_original__",t)}function ze(e){return e.__sentry_original__}function Oe(e){if(oe(e))return{message:e.message,name:e.name,stack:e.stack,...De(e)};if(he(e)){var t={type:e.type,target:Re(e.target),currentTarget:Re(e.currentTarget),...De(e)};return"undefined"!=typeof CustomEvent&&pe(e,CustomEvent)&&(t.detail=e.detail),t}return e}function Re(e){try{return t=e,"undefined"!=typeof Element&&pe(t,Element)?me(e):Object.prototype.toString.call(e)}catch(e){return"<unknown>"}var t}function De(e){if("object"==typeof e&&null!==e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}return{}}function Ie(e,t=40){var n=Object.keys(Oe(e))
|
|
19
|
-
;if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return Ee(n[0],t);for(let e=n.length;e>0;e--){var r=n.slice(0,e).join(", ");if(!(r.length>t))return e===n.length?r:Ee(r,t)}return""}function Pe(e){return Be(e,new Map)}function Be(e,t){if(ue(e)){if(void 0!==(o=t.get(e)))return o;var n={};for(var r of(t.set(e,n),Object.keys(e)))void 0!==e[r]&&(n[r]=Be(e[r],t));return n}if(Array.isArray(e)){var o;if(void 0!==(o=t.get(e)))return o;n=[];return t.set(e,n),e.forEach((e=>{n.push(Be(e,t))})),n}return e}Ce="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?ne("logger",Se):Se();function
|
|
20
|
-
;return t.slice(0,50).map((e=>({...e,filename:e.filename||t[0].filename,function:e.function||"?"}))).reverse()}(r)}}function
|
|
21
|
-
;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(Ne(n,"addEventListener",(function(t){return function(n,r,o){if("click"===n||"keypress"==n)try{var i=this,a=i.__sentry_instrumentation_handlers__=i.__sentry_instrumentation_handlers__||{},s=a[n]=a[n]||{refCount:0};if(!s.handler){var l=
|
|
22
|
-
;le(r)&&"POST"===o.method&&r.match(/sentry_key/)&&(n.__sentry_own_request__=!0);var i=function(){if(4===n.readyState){try{o.status_code=n.status}catch(e){}
|
|
23
|
-
("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return t}())return;Ne(
|
|
24
|
-
}();break;case"error":
|
|
25
|
-
;function
|
|
26
|
-
;var t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};var n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],relative:t[5]+n+r}}function
|
|
27
|
-
function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(r))>n?
|
|
28
|
-
}(t)?"[SyntheticEvent]":"number"==typeof t&&t!=t?"[NaN]":void 0===t?"[undefined]":"function"==typeof t?`[Function: ${
|
|
29
|
-
gt.prototype.__init3.call(this),
|
|
30
|
-
this._state===
|
|
31
|
-
var e,t}():function(){const{performance:e}=te();if(e&&e.now)return{now:()=>e.now(),timeOrigin:Date.now()-e.now()}}(),xt=void 0===wt?yt:{nowSeconds:()=>(wt.timeOrigin+wt.now())/1e3},kt=yt.nowSeconds.bind(yt),St=xt.nowSeconds.bind(xt);function Ct(e,t=[]){return[e,t]}function Et(e,t){const[n,r]=e;return[n,[...r,t]]}function At(e,t){e[1].forEach((e=>{var n=e[0].type;t(e,n)}))}function Tt(e,t){return(t||new TextEncoder).encode(e)}function Nt(e,t){const[n,r]=e;let o=JSON.stringify(n);function i(e){"string"==typeof o?o="string"==typeof e?o+e:[Tt(o,t),e]:o.push("string"==typeof e?Tt(e,t):e)}for(var a of r){const[e,t]=a;i(`\n${JSON.stringify(e)}\n`),i("string"==typeof t||t instanceof Uint8Array?t:JSON.stringify(t))}return"string"==typeof o?o:function(e){var t=e.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(t);let r=0;for(var o of e)n.set(o,r),r+=o.length;return n}(o)}function Mt(e,t){var n="string"==typeof e.data?Tt(e.data,t):e.data;return[Pe({
|
|
32
|
-
content_type:e.contentType,attachment_type:e.attachmentType}),n]}(()=>{const{performance:e}=te();if(e&&e.now){var t=36e5,n=e.now(),r=Date.now(),o=e.timeOrigin?Math.abs(e.timeOrigin+n-r):t,i=o<t,a=e.timing&&e.timing.navigationStart,s="number"==typeof a?Math.abs(a+n-r):t;(i||s<t)&&(o<=s&&e.timeOrigin)}})();var Lt={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default"};function zt(e){return Lt[e]}function Ot(e,{statusCode:t,headers:n},r=Date.now()){var o={...e},i=n&&n["x-sentry-rate-limits"],a=n&&n["retry-after"];if(i)for(var s of i.trim().split(",")){const[e,t]=s.split(":",2);var l=parseInt(e,10),c=1e3*(isNaN(l)?60:l);if(t)for(var u of t.split(";"))o[u]=r+c;else o.all=r+c}else a?o.all=r+function(e,t=Date.now()){var n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;var r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}(a,r):429===t&&(o.all=r+6e4);return o}function Rt(e){
|
|
33
|
-
duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return Pe({sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}(n)};return e&&Dt(n,e),n}function Dt(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||St(),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:
|
|
34
|
-
t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}class It{constructor(){It.prototype.__init.call(this),It.prototype.__init2.call(this),It.prototype.__init3.call(this),It.prototype.__init4.call(this),It.prototype.__init5.call(this),It.prototype.__init6.call(this),It.prototype.__init7.call(this),It.prototype.__init8.call(this),It.prototype.__init9.call(this),It.prototype.__init10.call(this)}__init(){this._notifyingListeners=!1}__init2(){this._scopeListeners=[]}__init3(){this._eventProcessors=[]}__init4(){this._breadcrumbs=[]}__init5(){this._user={}}__init6(){this._tags={}}__init7(){this._extra={}}__init8(){this._contexts={}}__init9(){this._attachments=[]}__init10(){this._sdkProcessingMetadata={}}static clone(e){var t=new It
|
|
35
|
-
...e._extra},t._contexts={...e._contexts},t._user=e._user,t._level=e._level,t._span=e._span,t._session=e._session,t._transactionName=e._transactionName,t._fingerprint=e._fingerprint,t._eventProcessors=[...e._eventProcessors],t._requestSession=e._requestSession,t._attachments=[...e._attachments]),t}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&Dt(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={
|
|
36
|
-
return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts={...this._contexts,[e]:t},this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){var e=this.getSpan();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){var t=e(this);return t instanceof It?t:this}return e instanceof It?(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),
|
|
37
|
-
e._requestSession&&(this._requestSession=e._requestSession)):ue(e)&&(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)),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}addBreadcrumb(e,t){var n="number"==typeof t?Math.min(t,100):100;if(n<=0)return this;var r={timestamp:kt(),...e};return this._breadcrumbs=[...this._breadcrumbs,r].slice(-n),this._notifyScopeListeners(),this}clearBreadcrumbs(){return this._breadcrumbs=[],
|
|
38
|
-
return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(e,t={}){if(this._extra&&Object.keys(this._extra).length&&(e.extra={...this._extra,...e.extra}),this._tags&&Object.keys(this._tags).length&&(e.tags={...this._tags,...e.tags}),this._user&&Object.keys(this._user).length&&(e.user={...this._user,...e.user}),this._contexts&&Object.keys(this._contexts).length&&(e.contexts={...this._contexts,...e.contexts}),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts={trace:this._span.getTraceContext(),...e.contexts};var n=this._span.transaction&&this._span.transaction.name;n&&(e.tags={transaction:n,...e.tags})}return this._applyFingerprint(e),e.breadcrumbs=[...e.breadcrumbs||[],...this._breadcrumbs],e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,e.sdkProcessingMetadata=
|
|
39
|
-
return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}_notifyEventProcessors(e,t,n,r=0){return new
|
|
40
|
-
constructor(e,t=new It,n=4){this._version=n,jt.prototype.__init.call(this),this.getStackTop().scope=t,e&&this.bindClient(e)}isOlderThan(e){return this._version<e}bindClient(e){this.getStackTop().client=e,e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){var e=It.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return!(this.getStack().length<=1)&&!!this.getStack().pop()}withScope(e){var t=this.pushScope();try{e(t)}finally{this.popScope()}}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){var n=this._lastEventId=t&&t.event_id?t.event_id:
|
|
41
|
-
;return this._withClient(((i,a)=>{i.captureMessage(e,t,{originalException:e,syntheticException:o,...n,event_id:r},a)})),r}captureEvent(e,t){var n=t&&t.event_id?t.event_id:
|
|
42
|
-
Ht(t)}}getIntegration(e){var t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){return this._callExtensionMethod("startTransaction",e,t)}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){var e=this.getStackTop(),t=e&&e.scope,n=t&&t.getSession();n&&function(e,t){let n={};t?n={status:t}:"ok"===e.status&&(n={status:"exited"}),Dt(e,n)}(n),this._sendSessionUpdate(),t&&t.setSession()}startSession(e){const{scope:t,client:n}=this.getStackTop(),{release:r,environment:o}=n&&n.getOptions()||{};var i=te();const{userAgent:a}=i.navigator||{};var s=Rt({release:r,environment:o,...t&&{user:t.getUser()},...a&&{userAgent:a},...e});if(t){
|
|
43
|
-
t.setSession(s)}return s}_sendSessionUpdate(){const{scope:e,client:t}=this.getStackTop();if(e){var n=e.getSession();n&&t&&t.captureSession&&t.captureSession(n)}}_withClient(e){const{scope:t,client:n}=this.getStackTop();n&&e(n,t)}_callExtensionMethod(e,...t){var n=Ut().__SENTRY__;if(n&&n.extensions&&"function"==typeof n.extensions[e])return n.extensions[e].apply(this,t);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function Ut(){var e=te();return e.__SENTRY__=e.__SENTRY__||{extensions:{},hub:void 0},e}function Ht(e){var t=Ut(),n=Gt(t);return Vt(t,e),n}function qt(){var e=Ut();return $t(e)&&!Gt(e).isOlderThan(4)||Vt(e,new jt),Q()?function(e){try{var t=Ut().__SENTRY__,n=t&&t.extensions&&t.extensions.domain&&t.extensions.domain.active;if(!n)return Gt(e);if(!$t(n)||Gt(n).isOlderThan(4)){var r=Gt(e).getStackTop()
|
|
44
|
-
return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function Gt(e){return ne("hub",(()=>new jt),e)}function Vt(e,t){return!!e&&((e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0)}function Yt(e,t){return qt().captureException(e,{captureContext:t})}function Wt(e,t){qt().setExtra(e,t)}function Kt(e){qt().withScope(e)}function Xt(e){return t={sentry_key:e.publicKey,sentry_version:"7"},Object.keys(t).map((e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`)).join("&");var t}function Zt(e,t){return t||`${function(e){return`${function(e){var 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)}?${Xt(e)}`}function Jt(e){if(!e||!e.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function Qt(e,t,n,r){var o=Jt(n),i=e.type||"event";const{transactionSampling:a}=e.sdkProcessingMetadata||{},{method:s,rate:l}=a||{}
|
|
45
|
-
e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]])}(e,n&&n.sdk)
|
|
46
|
-
;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
;
|
|
52
|
-
|
|
53
|
-
new ge(`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+=1,e.then((e=>(this._numProcessing-=1,e)),(e=>(this._numProcessing-=1,e)))}_sendEnvelope(e){this._transport&&this._dsn?this._transport.send(e).then(null,(e=>{("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.error("Error while sending event:",e)})):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.error("Transport disabled")}_clearOutcomes(){var 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 an(e,t,n=
|
|
54
|
-
}))};return n.add((()=>t({body:Nt(a,e.textEncoder)}).then((e=>{void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=Ot(r,e)}),(e=>{("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.error("Failed while sending event:",e),s("network_error")})))).then((e=>e),(e=>{if(e instanceof ge)return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.error("Skipped sending event due to full buffer"),s("queue_overflow"),
|
|
55
|
-
this.id="InboundFilters"}__init(){this.name=un.id}constructor(e={}){this._options=e,un.prototype.__init.call(this)}setupOnce(e,t){var n=e=>{var n=t();if(n){var r=n.getIntegration(un);if(r){var o=n.getClient(),i=o?o.getOptions():{},a=function(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...cn],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(r._options,i);return function(e,t){if(t.ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch(e){}return!1}(e))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${
|
|
56
|
-
return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.error(`Cannot extract message for event ${
|
|
57
|
-
}catch(e){}return t?function(e=[]){for(let n=e.length-1;n>=0;n--){var t=e[n];if(t&&"<anonymous>"!==t.filename&&"[native code]"!==t.filename)return t.filename||null}return null}(t):null}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.error(`Cannot extract url for event ${
|
|
58
|
-
;if(se(t)||ie(t,"DOMException")){var a=t;if("stack"in t)i=pn(e,t);else{var s=a.name||(se(a)?"DOMError":"DOMException"),l=a.message?`${s}: ${a.message}`:s;i=_n(e,l,n,r),
|
|
59
|
-
setupOnce(){this.options.console&&
|
|
60
|
-
;const{method:t,url:n,status_code:r,body:o}=e.xhr.__sentry_xhr__||{};qt().addBreadcrumb({category:"xhr",data:{method:t,url:n,status_code:r},type:"http"},{xhr:e.xhr,input:o})}else;}function xn(e){e.endTimestamp&&(e.fetchData.url.match(/sentry_key/)&&"POST"===e.fetchData.method||(e.error?qt().addBreadcrumb({category:"fetch",data:e.fetchData,level:"error",type:"http"},{data:e.error,input:e.args}):qt().addBreadcrumb({category:"fetch",data:{...e.fetchData,status_code:e.response.status},type:"http"},{input:e.args,response:e.response})))}function kn(e){var t=te();let n=e.from,r=e.to;var o=
|
|
61
|
-
var n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n);var r=n.contentWindow;r&&r.fetch&&(t=r.fetch),e.head.removeChild(n)}catch(e){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return Cn=t.bind(Sn)}var An=te();class Tn extends on{constructor(e){e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:"npm:@sentry/browser",version:"7.
|
|
62
|
-
var i=_n(e,t,r&&r.syntheticException||void 0,o);return i.level=n,r&&r.event_id&&(i.event_id=r.event_id),
|
|
63
|
-
"[object Navigator]"===Object.prototype.toString.call(Sn&&Sn.navigator)&&"function"==typeof Sn.navigator.sendBeacon?Sn.navigator.sendBeacon.bind(Sn.navigator)(e,t):
|
|
19
|
+
;if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return Ee(n[0],t);for(let e=n.length;e>0;e--){var r=n.slice(0,e).join(", ");if(!(r.length>t))return e===n.length?r:Ee(r,t)}return""}function Pe(e){return Be(e,new Map)}function Be(e,t){if(ue(e)){if(void 0!==(o=t.get(e)))return o;var n={};for(var r of(t.set(e,n),Object.keys(e)))void 0!==e[r]&&(n[r]=Be(e[r],t));return n}if(Array.isArray(e)){var o;if(void 0!==(o=t.get(e)))return o;n=[];return t.set(e,n),e.forEach((e=>{n.push(Be(e,t))})),n}return e}function Fe(e){let t,n=e[0],r=1;for(;r<e.length;){var o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i(((...e)=>n.call(t,...e))),t=void 0)}return n}Ce="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?ne("logger",Se):Se();function je(...e){var t=e.sort(((e,t)=>e[0]-t[0])).map((e=>e[1]));return(e,n=0)=>{var r=[];for(var o of e.split("\n").slice(n))for(var i of t){var a=i(o)
|
|
20
|
+
;if(a){r.push(a);break}}return function(e){if(!e.length)return[];let t=e;var n=t[0].function||"",r=t[t.length-1].function||"";-1===n.indexOf("captureMessage")&&-1===n.indexOf("captureException")||(t=t.slice(1));-1!==r.indexOf("sentryWrapped")&&(t=t.slice(0,-1));return t.slice(0,50).map((e=>({...e,filename:e.filename||t[0].filename,function:e.function||"?"}))).reverse()}(r)}}function Ue(e){try{return e&&"function"==typeof e&&e.name||"<anonymous>"}catch(e){return"<anonymous>"}}function He(){if(!("fetch"in te()))return!1;try{return new Headers,new Request(""),new Response,!0}catch(e){return!1}}function qe(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}var $e=te(),Ge={},Ve={};function Ye(e){if(!Ve[e])switch(Ve[e]=!0,e){case"console":!function(){if(!("console"in $e))return;xe.forEach((function(e){e in $e.console&&Ne($e.console,e,(function(t){return function(...n){Ke("console",{args:n,level:e}),t&&t.apply($e.console,n)}}))}))}();break;case"dom":!function(){
|
|
21
|
+
if(!("document"in $e))return;var e=Ke.bind(null,"dom"),t=tt(e,!0);$e.document.addEventListener("click",t,!1),$e.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach((t=>{var n=$e[t]&&$e[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(Ne(n,"addEventListener",(function(t){return function(n,r,o){if("click"===n||"keypress"==n)try{var i=this,a=i.__sentry_instrumentation_handlers__=i.__sentry_instrumentation_handlers__||{},s=a[n]=a[n]||{refCount:0};if(!s.handler){var l=tt(e);s.handler=l,t.call(this,n,l,o)}s.refCount+=1}catch(e){}return t.call(this,n,r,o)}})),Ne(n,"removeEventListener",(function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{var o=this,i=o.__sentry_instrumentation_handlers__||{},a=i[t];a&&(a.refCount-=1,a.refCount<=0&&(e.call(this,t,a.handler,r),a.handler=void 0,delete i[t]),0===Object.keys(i).length&&delete o.__sentry_instrumentation_handlers__)}catch(e){}return e.call(this,t,n,r)}})))}))}();break;case"xhr":!function(){
|
|
22
|
+
if(!("XMLHttpRequest"in $e))return;var e=XMLHttpRequest.prototype;Ne(e,"open",(function(e){return function(...t){var n=this,r=t[1],o=n.__sentry_xhr__={method:le(t[0])?t[0].toUpperCase():t[0],url:t[1]};le(r)&&"POST"===o.method&&r.match(/sentry_key/)&&(n.__sentry_own_request__=!0);var i=function(){if(4===n.readyState){try{o.status_code=n.status}catch(e){}Ke("xhr",{args:t,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:n})}};return"onreadystatechange"in n&&"function"==typeof n.onreadystatechange?Ne(n,"onreadystatechange",(function(e){return function(...t){return i(),e.apply(n,t)}})):n.addEventListener("readystatechange",i),e.apply(n,t)}})),Ne(e,"send",(function(e){return function(...t){return this.__sentry_xhr__&&void 0!==t[0]&&(this.__sentry_xhr__.body=t[0]),Ke("xhr",{args:t,startTimestamp:Date.now(),xhr:this}),e.apply(this,t)}}))}();break;case"fetch":!function(){if(!function(){if(!He())return!1;var e=te();if(qe(e.fetch))return!0;let t=!1;var n=e.document;if(n&&"function"==typeof n.createElement)try{
|
|
23
|
+
var r=n.createElement("iframe");r.hidden=!0,n.head.appendChild(r),r.contentWindow&&r.contentWindow.fetch&&(t=qe(r.contentWindow.fetch)),n.head.removeChild(r)}catch(e){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return t}())return;Ne($e,"fetch",(function(e){return function(...t){var n={args:t,fetchData:{method:Xe(t),url:Ze(t)},startTimestamp:Date.now()};return Ke("fetch",{...n}),e.apply($e,t).then((e=>(Ke("fetch",{...n,endTimestamp:Date.now(),response:e}),e)),(e=>{throw Ke("fetch",{...n,endTimestamp:Date.now(),error:e}),e}))}}))}();break;case"history":!function(){if(!function(){var e=te(),t=e.chrome,n=t&&t.app&&t.app.runtime,r="history"in e&&!!e.history.pushState&&!!e.history.replaceState;return!n&&r}())return;var e=$e.onpopstate;function t(e){return function(...t){var n=t.length>2?t[2]:void 0;if(n){var r=Je,o=String(n);Je=o,Ke("history",{from:r,to:o})}return e.apply(this,t)}}$e.onpopstate=function(...t){
|
|
24
|
+
var n=$e.location.href,r=Je;if(Je=n,Ke("history",{from:r,to:n}),e)try{return e.apply(this,t)}catch(e){}},Ne($e.history,"pushState",t),Ne($e.history,"replaceState",t)}();break;case"error":nt=$e.onerror,$e.onerror=function(e,t,n,r,o){return Ke("error",{column:r,error:o,line:n,msg:e,url:t}),!!nt&&nt.apply(this,arguments)};break;case"unhandledrejection":rt=$e.onunhandledrejection,$e.onunhandledrejection=function(e){return Ke("unhandledrejection",e),!rt||rt.apply(this,arguments)};break;default:return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn("unknown instrumentation type:",e))}}function We(e,t){Ge[e]=Ge[e]||[],Ge[e].push(t),Ye(e)}function Ke(e,t){if(e&&Ge[e])for(var n of Ge[e]||[])try{n(t)}catch(t){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${Ue(n)}\nError:`,t)}}function Xe(e=[]){
|
|
25
|
+
return"Request"in $e&&pe(e[0],Request)&&e[0].method?String(e[0].method).toUpperCase():e[1]&&e[1].method?String(e[1].method).toUpperCase():"GET"}function Ze(e=[]){return"string"==typeof e[0]?e[0]:"Request"in $e&&pe(e[0],Request)?e[0].url:String(e[0])}let Je;let Qe,et;function tt(e,t=!1){return n=>{if(n&&et!==n&&!function(e){if("keypress"!==e.type)return!1;try{var t=e.target;if(!t||!t.tagName)return!0;if("INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable)return!1}catch(e){}return!0}(n)){var r="keypress"===n.type?"input":n.type;(void 0===Qe||function(e,t){if(!e)return!0;if(e.type!==t.type)return!0;try{if(e.target!==t.target)return!0}catch(e){}return!1}(et,n))&&(e({event:n,name:r,global:t}),et=n),clearTimeout(Qe),Qe=$e.setTimeout((()=>{Qe=void 0}),1e3)}}}let nt=null;let rt=null;function ot(){var e=te(),t=e.crypto||e.msCrypto;if(void 0!==t&&t.getRandomValues){var n=new Uint16Array(8);t.getRandomValues(n),n[3]=4095&n[3]|16384,n[4]=16383&n[4]|32768;var r=e=>{let t=e.toString(16)
|
|
26
|
+
;for(;t.length<4;)t=`0${t}`;return t};return r(n[0])+r(n[1])+r(n[2])+r(n[3])+r(n[4])+r(n[5])+r(n[6])+r(n[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(e=>{var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function it(e){if(!e)return{};var t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};var n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],relative:t[5]+n+r}}function at(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function st(e){const{message:t,event_id:n}=e;if(t)return t;var r=at(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function lt(e,t,n){var r=e.exception=e.exception||{},o=r.values=r.values||[],i=o[0]=o[0]||{};i.value||(i.value=t||""),i.type||(i.type=n||"Error")}function ct(e,t){var n=at(e);if(n){var r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...t},t&&"data"in t){var o={...r&&r.data,...t.data};n.mechanism.data=o}}}
|
|
27
|
+
function ut(e){if(e&&e.__sentry_captured__)return!0;try{Me(e,"__sentry_captured__",!0)}catch(e){}return!1}function ht(e,t=1/0,n=1/0){try{return pt("",e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function dt(e,t=3,n=102400){var r,o=ht(e,t);return r=o,function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(r))>n?dt(e,t-1,n):o}function pt(e,t,n=1/0,r=1/0,o=function(){var e="function"==typeof WeakSet,t=e?new WeakSet:[];return[function(n){if(e)return!!t.has(n)||(t.add(n),!1);for(let e=0;e<t.length;e++){var r=t[e];if(r===n)return!0}return t.push(n),!1},function(n){if(e)t.delete(n);else for(let e=0;e<t.length;e++)if(t[e]===n){t.splice(e,1);break}}]}()){const[i,a]=o;var s,l=t;if(l&&"function"==typeof l.toJSON)try{return l.toJSON()}catch(e){}if(null===t||["number","boolean","string"].includes(typeof t)&&("number"!=typeof(s=t)||s==s))return t;var c=function(e,t){try{
|
|
28
|
+
return"domain"===e&&t&&"object"==typeof t&&t._events?"[Domain]":"domainEmitter"===e?"[DomainEmitter]":"undefined"!=typeof global&&t===global?"[Global]":"undefined"!=typeof window&&t===window?"[Window]":"undefined"!=typeof document&&t===document?"[Document]":function(e){return ue(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}(t)?"[SyntheticEvent]":"number"==typeof t&&t!=t?"[NaN]":void 0===t?"[undefined]":"function"==typeof t?`[Function: ${Ue(t)}]`:"symbol"==typeof t?`[${String(t)}]`:"bigint"==typeof t?`[BigInt: ${String(t)}]`:`[object ${Object.getPrototypeOf(t).constructor.name}]`}catch(e){return`**non-serializable** (${e})`}}(e,t);if(!c.startsWith("[object "))return c;if(t.__sentry_skip_normalization__)return t;if(0===n)return c.replace("object ","");if(i(t))return"[Circular ~]";var u=Array.isArray(t)?[]:{};let h=0;var d=Oe(t);for(var p in d)if(Object.prototype.hasOwnProperty.call(d,p)){if(h>=r){u[p]="[MaxProperties ~]";break}var m=d[p];u[p]=pt(p,m,n-1,r,o),h+=1}return a(t),u}var mt
|
|
29
|
+
;function ft(e){return new vt((t=>{t(e)}))}function gt(e){return new vt(((t,n)=>{n(e)}))}!function(e){e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(mt||(mt={}));class vt{__init(){this._state=mt.PENDING}__init2(){this._handlers=[]}constructor(e){vt.prototype.__init.call(this),vt.prototype.__init2.call(this),vt.prototype.__init3.call(this),vt.prototype.__init4.call(this),vt.prototype.__init5.call(this),vt.prototype.__init6.call(this);try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}then(e,t){return new vt(((n,r)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(e){r(e)}else n(t)},e=>{if(t)try{n(t(e))}catch(e){r(e)}else r(e)}]),this._executeHandlers()}))}catch(e){return this.then((e=>e),e)}finally(e){return new vt(((t,n)=>{let r,o;return this.then((t=>{o=!1,r=t,e&&e()}),(t=>{o=!0,r=t,e&&e()})).then((()=>{o?n(r):t(r)}))}))}__init3(){this._resolve=e=>{this._setResult(mt.RESOLVED,e)}}__init4(){this._reject=e=>{this._setResult(mt.REJECTED,e)}}__init5(){
|
|
30
|
+
this._setResult=(e,t)=>{this._state===mt.PENDING&&(de(t)?t.then(this._resolve,this._reject):(this._state=e,this._value=t,this._executeHandlers()))}}__init6(){this._executeHandlers=()=>{if(this._state!==mt.PENDING){var e=this._handlers.slice();this._handlers=[],e.forEach((e=>{e[0]||(this._state===mt.RESOLVED&&e[1](this._value),this._state===mt.REJECTED&&e[2](this._value),e[0]=!0)}))}}}}function _t(e){var t=[];function n(e){return t.splice(t.indexOf(e),1)[0]}return{$:t,add:function(r){if(!(void 0===e||t.length<e))return gt(new ge("Not adding Promise due to buffer limit reached."));var o=r();return-1===t.indexOf(o)&&t.push(o),o.then((()=>n(o))).then(null,(()=>n(o).then(null,(()=>{})))),o},drain:function(e){return new vt(((n,r)=>{let o=t.length;if(!o)return n(!0);var i=setTimeout((()=>{e&&e>0&&n(!1)}),e);t.forEach((e=>{ft(e).then((()=>{--o||(clearTimeout(i),n(!0))}),r)}))}))}}}var bt=["fatal","error","warning","log","info","debug"];var yt={nowSeconds:()=>Date.now()/1e3};var wt=Q()?function(){try{return(e=module,
|
|
31
|
+
t="perf_hooks",e.require(t)).performance}catch(e){return}var e,t}():function(){const{performance:e}=te();if(e&&e.now)return{now:()=>e.now(),timeOrigin:Date.now()-e.now()}}(),xt=void 0===wt?yt:{nowSeconds:()=>(wt.timeOrigin+wt.now())/1e3},kt=yt.nowSeconds.bind(yt),St=xt.nowSeconds.bind(xt);function Ct(e,t=[]){return[e,t]}function Et(e,t){const[n,r]=e;return[n,[...r,t]]}function At(e,t){e[1].forEach((e=>{var n=e[0].type;t(e,n)}))}function Tt(e,t){return(t||new TextEncoder).encode(e)}function Nt(e,t){const[n,r]=e;let o=JSON.stringify(n);function i(e){"string"==typeof o?o="string"==typeof e?o+e:[Tt(o,t),e]:o.push("string"==typeof e?Tt(e,t):e)}for(var a of r){const[e,t]=a;i(`\n${JSON.stringify(e)}\n`),i("string"==typeof t||t instanceof Uint8Array?t:JSON.stringify(t))}return"string"==typeof o?o:function(e){var t=e.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(t);let r=0;for(var o of e)n.set(o,r),r+=o.length;return n}(o)}function Mt(e,t){var n="string"==typeof e.data?Tt(e.data,t):e.data;return[Pe({
|
|
32
|
+
type:"attachment",length:n.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),n]}(()=>{const{performance:e}=te();if(e&&e.now){var t=36e5,n=e.now(),r=Date.now(),o=e.timeOrigin?Math.abs(e.timeOrigin+n-r):t,i=o<t,a=e.timing&&e.timing.navigationStart,s="number"==typeof a?Math.abs(a+n-r):t;(i||s<t)&&(o<=s&&e.timeOrigin)}})();var Lt={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default"};function zt(e){return Lt[e]}function Ot(e,{statusCode:t,headers:n},r=Date.now()){var o={...e},i=n&&n["x-sentry-rate-limits"],a=n&&n["retry-after"];if(i)for(var s of i.trim().split(",")){const[e,t]=s.split(":",2);var l=parseInt(e,10),c=1e3*(isNaN(l)?60:l);if(t)for(var u of t.split(";"))o[u]=r+c;else o.all=r+c}else a?o.all=r+function(e,t=Date.now()){var n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;var r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}(a,r):429===t&&(o.all=r+6e4);return o}function Rt(e){
|
|
33
|
+
var t=St(),n={sid:ot(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return Pe({sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}(n)};return e&&Dt(n,e),n}function Dt(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||St(),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:ot()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{
|
|
34
|
+
var n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}class It{constructor(){It.prototype.__init.call(this),It.prototype.__init2.call(this),It.prototype.__init3.call(this),It.prototype.__init4.call(this),It.prototype.__init5.call(this),It.prototype.__init6.call(this),It.prototype.__init7.call(this),It.prototype.__init8.call(this),It.prototype.__init9.call(this),It.prototype.__init10.call(this)}__init(){this._notifyingListeners=!1}__init2(){this._scopeListeners=[]}__init3(){this._eventProcessors=[]}__init4(){this._breadcrumbs=[]}__init5(){this._user={}}__init6(){this._tags={}}__init7(){this._extra={}}__init8(){this._contexts={}}__init9(){this._attachments=[]}__init10(){this._sdkProcessingMetadata={}}static clone(e){var t=new It
|
|
35
|
+
;return e&&(t._breadcrumbs=[...e._breadcrumbs],t._tags={...e._tags},t._extra={...e._extra},t._contexts={...e._contexts},t._user=e._user,t._level=e._level,t._span=e._span,t._session=e._session,t._transactionName=e._transactionName,t._fingerprint=e._fingerprint,t._eventProcessors=[...e._eventProcessors],t._requestSession=e._requestSession,t._attachments=[...e._attachments]),t}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&Dt(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={
|
|
36
|
+
...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts={...this._contexts,[e]:t},this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){var e=this.getSpan();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){var t=e(this);return t instanceof It?t:this}return e instanceof It?(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),
|
|
37
|
+
e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession)):ue(e)&&(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)),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}addBreadcrumb(e,t){var n="number"==typeof t?Math.min(t,100):100;if(n<=0)return this;var r={timestamp:kt(),...e};return this._breadcrumbs=[...this._breadcrumbs,r].slice(-n),this._notifyScopeListeners(),this}clearBreadcrumbs(){return this._breadcrumbs=[],
|
|
38
|
+
this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(e,t={}){if(this._extra&&Object.keys(this._extra).length&&(e.extra={...this._extra,...e.extra}),this._tags&&Object.keys(this._tags).length&&(e.tags={...this._tags,...e.tags}),this._user&&Object.keys(this._user).length&&(e.user={...this._user,...e.user}),this._contexts&&Object.keys(this._contexts).length&&(e.contexts={...this._contexts,...e.contexts}),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts={trace:this._span.getTraceContext(),...e.contexts};var n=this._span.transaction&&this._span.transaction.name;n&&(e.tags={transaction:n,...e.tags})}return this._applyFingerprint(e),e.breadcrumbs=[...e.breadcrumbs||[],...this._breadcrumbs],e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,e.sdkProcessingMetadata={...e.sdkProcessingMetadata,
|
|
39
|
+
...this._sdkProcessingMetadata},this._notifyEventProcessors([...Pt(),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}_notifyEventProcessors(e,t,n,r=0){return new vt(((o,i)=>{var a=e[r];if(null===t||"function"!=typeof a)o(t);else{var s=a({...t},n);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.id&&null===s&&Ce.log(`Event processor "${a.id}" dropped event`),de(s)?s.then((t=>this._notifyEventProcessors(e,t,n,r+1).then(o))).then(null,i):this._notifyEventProcessors(e,s,n,r+1).then(o).then(null,i)}}))}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{e(this)})),this._notifyingListeners=!1)}_applyFingerprint(e){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}}function Pt(){
|
|
40
|
+
return ne("globalEventProcessors",(()=>[]))}function Bt(e){Pt().push(e)}var Ft=100;class jt{__init(){this._stack=[{}]}constructor(e,t=new It,n=4){this._version=n,jt.prototype.__init.call(this),this.getStackTop().scope=t,e&&this.bindClient(e)}isOlderThan(e){return this._version<e}bindClient(e){this.getStackTop().client=e,e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){var e=It.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return!(this.getStack().length<=1)&&!!this.getStack().pop()}withScope(e){var t=this.pushScope();try{e(t)}finally{this.popScope()}}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){var n=this._lastEventId=t&&t.event_id?t.event_id:ot(),r=new Error("Sentry syntheticException");return this._withClient(((o,i)=>{o.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},i)
|
|
41
|
+
})),n}captureMessage(e,t,n){var r=this._lastEventId=n&&n.event_id?n.event_id:ot(),o=new Error(e);return this._withClient(((i,a)=>{i.captureMessage(e,t,{originalException:e,syntheticException:o,...n,event_id:r},a)})),r}captureEvent(e,t){var n=t&&t.event_id?t.event_id:ot();return"transaction"!==e.type&&(this._lastEventId=n),this._withClient(((r,o)=>{r.captureEvent(e,{...t,event_id:n},o)})),n}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){const{scope:n,client:r}=this.getStackTop();if(!n||!r)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:i=Ft}=r.getOptions&&r.getOptions()||{};if(!(i<=0)){var a={timestamp:kt(),...e},s=o?ke((()=>o(a,t))):a;null!==s&&n.addBreadcrumb(s,i)}}setUser(e){var t=this.getScope();t&&t.setUser(e)}setTags(e){var t=this.getScope();t&&t.setTags(e)}setExtras(e){var t=this.getScope();t&&t.setExtras(e)}setTag(e,t){var n=this.getScope();n&&n.setTag(e,t)}setExtra(e,t){var n=this.getScope();n&&n.setExtra(e,t)}setContext(e,t){var n=this.getScope();n&&n.setContext(e,t)}configureScope(e){
|
|
42
|
+
const{scope:t,client:n}=this.getStackTop();t&&n&&e(t)}run(e){var t=Ht(this);try{e(this)}finally{Ht(t)}}getIntegration(e){var t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){return this._callExtensionMethod("startTransaction",e,t)}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){var e=this.getStackTop(),t=e&&e.scope,n=t&&t.getSession();n&&function(e,t){let n={};t?n={status:t}:"ok"===e.status&&(n={status:"exited"}),Dt(e,n)}(n),this._sendSessionUpdate(),t&&t.setSession()}startSession(e){const{scope:t,client:n}=this.getStackTop(),{release:r,environment:o}=n&&n.getOptions()||{};var i=te();const{userAgent:a}=i.navigator||{};var s=Rt({release:r,environment:o,...t&&{user:t.getUser()},...a&&{userAgent:a},...e});if(t){
|
|
43
|
+
var l=t.getSession&&t.getSession();l&&"ok"===l.status&&Dt(l,{status:"exited"}),this.endSession(),t.setSession(s)}return s}_sendSessionUpdate(){const{scope:e,client:t}=this.getStackTop();if(e){var n=e.getSession();n&&t&&t.captureSession&&t.captureSession(n)}}_withClient(e){const{scope:t,client:n}=this.getStackTop();n&&e(n,t)}_callExtensionMethod(e,...t){var n=Ut().__SENTRY__;if(n&&n.extensions&&"function"==typeof n.extensions[e])return n.extensions[e].apply(this,t);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function Ut(){var e=te();return e.__SENTRY__=e.__SENTRY__||{extensions:{},hub:void 0},e}function Ht(e){var t=Ut(),n=Gt(t);return Vt(t,e),n}function qt(){var e=Ut();return $t(e)&&!Gt(e).isOlderThan(4)||Vt(e,new jt),Q()?function(e){try{var t=Ut().__SENTRY__,n=t&&t.extensions&&t.extensions.domain&&t.extensions.domain.active;if(!n)return Gt(e);if(!$t(n)||Gt(n).isOlderThan(4)){var r=Gt(e).getStackTop()
|
|
44
|
+
;Vt(n,new jt(r.client,It.clone(r.scope)))}return Gt(n)}catch(t){return Gt(e)}}(e):Gt(e)}function $t(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function Gt(e){return ne("hub",(()=>new jt),e)}function Vt(e,t){return!!e&&((e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0)}function Yt(e,t){return qt().captureException(e,{captureContext:t})}function Wt(e,t){qt().setExtra(e,t)}function Kt(e){qt().withScope(e)}function Xt(e){return t={sentry_key:e.publicKey,sentry_version:"7"},Object.keys(t).map((e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`)).join("&");var t}function Zt(e,t){return t||`${function(e){return`${function(e){var 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)}?${Xt(e)}`}function Jt(e){if(!e||!e.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function Qt(e,t,n,r){var o=Jt(n),i=e.type||"event";const{transactionSampling:a}=e.sdkProcessingMetadata||{},{method:s,rate:l}=a||{}
|
|
45
|
+
;!function(e,t){t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]])}(e,n&&n.sdk);var c=function(e,t,n,r){var o=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.baggage,i=o&&function(e){return e[0]}(o);return{event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&{sdk:t},...!!n&&{dsn:_e(r)},..."transaction"===e.type&&i&&{trace:Pe({...i})}}}(e,o,r,t);return delete e.sdkProcessingMetadata,Ct(c,[[{type:i,sample_rates:[{id:s,rate:l}]},e]])}var en=[];function tn(e){return e.reduce(((e,t)=>(e.every((e=>t.name!==e.name))&&e.push(t),e)),[])}function nn(e){var t=e.defaultIntegrations&&[...e.defaultIntegrations]||[],n=e.integrations;let r=[...tn(t)];Array.isArray(n)?r=[...r.filter((e=>n.every((t=>t.name!==e.name)))),...tn(n)]:"function"==typeof n&&(r=n(r),r=Array.isArray(r)?r:[r]);var o=r.map((e=>e.name)),i="Debug"
|
|
46
|
+
;return-1!==o.indexOf(i)&&r.push(...r.splice(o.indexOf(i),1)),r}var rn="Not capturing exception because it's already been captured.";class on{__init(){this._integrations={}}__init2(){this._integrationsInitialized=!1}__init3(){this._numProcessing=0}__init4(){this._outcomes={}}constructor(e){if(on.prototype.__init.call(this),on.prototype.__init2.call(this),on.prototype.__init3.call(this),on.prototype.__init4.call(this),this._options=e,e.dsn){this._dsn=ye(e.dsn);var t=Zt(this._dsn,e.tunnel);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}else("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn("No DSN provided, client will not do anything.")}captureException(e,t,n){if(ut(e))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.log(rn));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
|
|
47
|
+
;var i=ce(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&&ut(t.originalException))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.log(rn));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__)&&Ce.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),Dt(e,{init:!1})):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn("SDK not enabled, will not capture session.")}getDsn(){return this._dsn}getOptions(){return this._options}getTransport(){return this._transport}flush(e){var t=this._transport;return t?this._isClientDoneProcessing(e).then((n=>t.flush(e).then((e=>n&&e)))):ft(!0)}close(e){return this.flush(e).then((e=>(this.getOptions().enabled=!1,
|
|
48
|
+
e)))}setupIntegrations(){var e,t;this._isEnabled()&&!this._integrationsInitialized&&(this._integrations=(e=this._options.integrations,t={},e.forEach((e=>{t[e.name]=e,-1===en.indexOf(e.name)&&(e.setupOnce(Bt,qt),en.push(e.name),("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.log(`Integration installed: ${e.name}`))})),t),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__)&&Ce.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}sendEvent(e,t={}){if(this._dsn){let r=Qt(e,this._dsn,this._options._metadata,this._options.tunnel);for(var n of t.attachments||[])r=Et(r,Mt(n,Fe([this,"access",e=>e._options,"access",e=>e.transportOptions,"optionalAccess",e=>e.textEncoder])));this._sendEnvelope(r)}}sendSession(e){if(this._dsn){var t=function(e,t,n,r){var o=Jt(n);return Ct({sent_at:(new Date).toISOString(),...o&&{sdk:o},
|
|
49
|
+
...!!r&&{dsn:_e(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}}recordDroppedEvent(e,t){if(this._options.sendClientReports){var n=`${e}:${t}`;("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.log(`Adding outcome: "${n}"`),this._outcomes[n]=this._outcomes[n]+1||1}}_updateSessionFromEvent(e,t){let n=!1,r=!1;var o=t.exception&&t.exception.values;if(o)for(var i of(r=!0,o)){var a=i.mechanism;if(a&&!1===a.handled){n=!0;break}}var s="ok"===e.status;(s&&0===e.errors||s&&n)&&(Dt(e,{...n&&{status:"crashed"},errors:e.errors||Number(r||n)}),this.captureSession(e))}_isClientDoneProcessing(e){return new vt((t=>{let n=0;var 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{normalizeDepth:r=3,normalizeMaxBreadth:o=1e3}=this.getOptions();var i={...e,
|
|
50
|
+
event_id:e.event_id||t.event_id||ot(),timestamp:e.timestamp||kt()};this._applyClientOptions(i),this._applyIntegrationsMetadata(i);let a=n;t.captureContext&&(a=It.clone(a).update(t.captureContext));let s=ft(i);if(a){var l=[...t.attachments||[],...a.getAttachments()];l.length&&(t.attachments=l),s=a.applyToEvent(i,t)}return s.then((e=>"number"==typeof r&&r>0?this._normalizeEvent(e,r,o):e))}_normalizeEvent(e,t,n){if(!e)return null;var r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map((e=>({...e,...e.data&&{data:ht(e.data,t,n)}})))},...e.user&&{user:ht(e.user,t,n)},...e.contexts&&{contexts:ht(e.contexts,t,n)},...e.extra&&{extra:ht(e.extra,t,n)}};return e.contexts&&e.contexts.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=ht(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map((e=>(e.data&&(e.data=ht(e.data,t,n)),e)))),r}_applyClientOptions(e){var t=this.getOptions();const{environment:n,release:r,dist:o,maxValueLength:i=250}=t
|
|
51
|
+
;"environment"in e||(e.environment="environment"in t?n:"production"),void 0===e.release&&void 0!==r&&(e.release=r),void 0===e.dist&&void 0!==o&&(e.dist=o),e.message&&(e.message=Ee(e.message,i));var a=e.exception&&e.exception.values&&e.exception.values[0];a&&a.value&&(a.value=Ee(a.value,i));var s=e.request;s&&s.url&&(s.url=Ee(s.url,i))}_applyIntegrationsMetadata(e){var t=Object.keys(this._integrations);t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}_captureEvent(e,t={},n){return this._processEvent(e,t,n).then((e=>e.event_id),(e=>{("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn(e)}))}_processEvent(e,t,n){const{beforeSend:r,sampleRate:o}=this.getOptions();if(!this._isEnabled())return gt(new ge("SDK not enabled, will not capture event."));var i="transaction"===e.type;return!i&&"number"==typeof o&&Math.random()>o?(this.recordDroppedEvent("sample_rate","error"),
|
|
52
|
+
gt(new ge(`Discarding event because it's not included in the random sample (sampling rate = ${o})`))):this._prepareEvent(e,t,n).then((n=>{if(null===n)throw this.recordDroppedEvent("event_processor",e.type||"error"),new ge("An event processor returned null, will not send event.");return t.data&&!0===t.data.__sentry__||i||!r?n:function(e){var t="`beforeSend` method has to return `null` or a valid event.";if(de(e))return e.then((e=>{if(!ue(e)&&null!==e)throw new ge(t);return e}),(e=>{throw new ge(`beforeSend rejected with ${e}`)}));if(!ue(e)&&null!==e)throw new ge(t);return e}(r(n,t))})).then((r=>{if(null===r)throw this.recordDroppedEvent("before_send",e.type||"error"),new ge("`beforeSend` returned `null`, will not send event.");var o=n&&n.getSession();return!i&&o&&this._updateSessionFromEvent(o,r),this.sendEvent(r,t),r})).then(null,(e=>{if(e instanceof ge)throw e;throw this.captureException(e,{data:{__sentry__:!0},originalException:e}),
|
|
53
|
+
new ge(`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+=1,e.then((e=>(this._numProcessing-=1,e)),(e=>(this._numProcessing-=1,e)))}_sendEnvelope(e){this._transport&&this._dsn?this._transport.send(e).then(null,(e=>{("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.error("Error while sending event:",e)})):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.error("Transport disabled")}_clearOutcomes(){var 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 an(e,t,n=_t(e.bufferSize||30)){let r={};return{send:function(o){var i=[];if(At(o,((t,n)=>{var o=zt(n);!function(e,t,n=Date.now()){return function(e,t){return e[t]||e.all||0}(e,t)>n}(r,o)?i.push(t):e.recordDroppedEvent("ratelimit_backoff",o)})),0===i.length)return ft();var a=Ct(o[0],i),s=t=>{At(a,((n,r)=>{e.recordDroppedEvent(t,zt(r))
|
|
54
|
+
}))};return n.add((()=>t({body:Nt(a,e.textEncoder)}).then((e=>{void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=Ot(r,e)}),(e=>{("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.error("Failed while sending event:",e),s("network_error")})))).then((e=>e),(e=>{if(e instanceof ge)return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.error("Skipped sending event due to full buffer"),s("queue_overflow"),ft();throw e}))},flush:e=>n.drain(e)}}let sn;class ln{constructor(){ln.prototype.__init.call(this)}static __initStatic(){this.id="FunctionToString"}__init(){this.name=ln.id}setupOnce(){sn=Function.prototype.toString,Function.prototype.toString=function(...e){var t=ze(this)||this;return sn.apply(t,e)}}}ln.__initStatic();var cn=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/];class un{static __initStatic(){
|
|
55
|
+
this.id="InboundFilters"}__init(){this.name=un.id}constructor(e={}){this._options=e,un.prototype.__init.call(this)}setupOnce(e,t){var n=e=>{var n=t();if(n){var r=n.getIntegration(un);if(r){var o=n.getClient(),i=o?o.getOptions():{},a=function(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...cn],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(r._options,i);return function(e,t){if(t.ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch(e){}return!1}(e))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${st(e)}`),!0;if(function(e,t){if(!t||!t.length)return!1;return function(e){if(e.message)return[e.message];if(e.exception)try{const{type:t="",value:n=""}=e.exception.values&&e.exception.values[0]||{};return[`${n}`,`${t}: ${n}`]}catch(t){
|
|
56
|
+
return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.error(`Cannot extract message for event ${st(e)}`),[]}return[]}(e).some((e=>t.some((t=>Te(e,t)))))}(e,t.ignoreErrors))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${st(e)}`),!0;if(function(e,t){if(!t||!t.length)return!1;var n=hn(e);return!!n&&t.some((e=>Te(n,e)))}(e,t.denyUrls))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${st(e)}.\nUrl: ${hn(e)}`),!0;if(!function(e,t){if(!t||!t.length)return!0;var n=hn(e);return!n||t.some((e=>Te(n,e)))}(e,t.allowUrls))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${st(e)}.\nUrl: ${hn(e)}`),!0;return!1}(e,a)?null:e}}return e};n.id=this.name,e(n)}}function hn(e){try{let t;try{t=e.exception.values[0].stacktrace.frames
|
|
57
|
+
}catch(e){}return t?function(e=[]){for(let n=e.length-1;n>=0;n--){var t=e[n];if(t&&"<anonymous>"!==t.filename&&"[native code]"!==t.filename)return t.filename||null}return null}(t):null}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.error(`Cannot extract url for event ${st(e)}`),null}}un.__initStatic();function dn(e,t){var n=mn(e,t),r={type:t&&t.name,value:gn(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function pn(e,t){return{exception:{values:[dn(e,t)]}}}function mn(e,t){var n=t.stacktrace||t.stack||"",r=function(e){if(e){if("number"==typeof e.framesToPop)return e.framesToPop;if(fn.test(e.message))return 1}return 0}(t);try{return e(n,r)}catch(e){}return[]}var fn=/Minified React error #\d+;/i;function gn(e){var t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function vn(e,t,n,r,o){let i;if(ae(t)&&t.error)return pn(e,t.error)
|
|
58
|
+
;if(se(t)||ie(t,"DOMException")){var a=t;if("stack"in t)i=pn(e,t);else{var s=a.name||(se(a)?"DOMError":"DOMException"),l=a.message?`${s}: ${a.message}`:s;i=_n(e,l,n,r),lt(i,l)}return"code"in a&&(i.tags={...i.tags,"DOMException.code":`${a.code}`}),i}return oe(t)?pn(e,t):ue(t)||he(t)?(i=function(e,t,n,r){var o={exception:{values:[{type:he(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:`Non-Error ${r?"promise rejection":"exception"} captured with keys: ${Ie(t)}`}]},extra:{__serialized__:dt(t)}};if(n){var i=mn(e,n);i.length&&(o.exception.values[0].stacktrace={frames:i})}return o}(e,t,n,o),ct(i,{synthetic:!0}),i):(i=_n(e,t,n,r),lt(i,`${t}`,void 0),ct(i,{synthetic:!0}),i)}function _n(e,t,n,r){var o={message:t};if(r&&n){var i=mn(e,n);i.length&&(o.exception={values:[{value:t,stacktrace:{frames:i}}]})}return o}class bn{static __initStatic(){this.id="Breadcrumbs"}__init(){this.name=bn.id}constructor(e){bn.prototype.__init.call(this),this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e}}
|
|
59
|
+
setupOnce(){this.options.console&&We("console",yn),this.options.dom&&We("dom",function(e){function t(t){let n,r="object"==typeof e?e.serializeAttribute:void 0;"string"==typeof r&&(r=[r]);try{n=t.event.target?me(t.event.target,r):me(t.event,r)}catch(e){n="<unknown>"}0!==n.length&&qt().addBreadcrumb({category:`ui.${t.name}`,message:n},{event:t.event,name:t.name,global:t.global})}return t}(this.options.dom)),this.options.xhr&&We("xhr",wn),this.options.fetch&&We("fetch",xn),this.options.history&&We("history",kn)}}function yn(e){var t,n={category:"console",data:{arguments:e.args,logger:"console"},level:(t=e.level,"warn"===t?"warning":bt.includes(t)?t:"log"),message:Ae(e.args," ")};if("assert"===e.level){if(!1!==e.args[0])return;n.message=`Assertion failed: ${Ae(e.args.slice(1)," ")||"console.assert"}`,n.data.arguments=e.args.slice(1)}qt().addBreadcrumb(n,{input:e.args,level:e.level})}function wn(e){if(e.endTimestamp){if(e.xhr.__sentry_own_request__)return
|
|
60
|
+
;const{method:t,url:n,status_code:r,body:o}=e.xhr.__sentry_xhr__||{};qt().addBreadcrumb({category:"xhr",data:{method:t,url:n,status_code:r},type:"http"},{xhr:e.xhr,input:o})}else;}function xn(e){e.endTimestamp&&(e.fetchData.url.match(/sentry_key/)&&"POST"===e.fetchData.method||(e.error?qt().addBreadcrumb({category:"fetch",data:e.fetchData,level:"error",type:"http"},{data:e.error,input:e.args}):qt().addBreadcrumb({category:"fetch",data:{...e.fetchData,status_code:e.response.status},type:"http"},{input:e.args,response:e.response})))}function kn(e){var t=te();let n=e.from,r=e.to;var o=it(t.location.href);let i=it(n);var a=it(r);i.path||(i=o),o.protocol===a.protocol&&o.host===a.host&&(r=a.relative),o.protocol===i.protocol&&o.host===i.host&&(n=i.relative),qt().addBreadcrumb({category:"navigation",data:{from:n,to:r}})}bn.__initStatic();var Sn=te();let Cn;function En(){if(Cn)return Cn;if(qe(Sn.fetch))return Cn=Sn.fetch.bind(Sn);var e=Sn.document;let t=Sn.fetch;if(e&&"function"==typeof e.createElement)try{
|
|
61
|
+
var n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n);var r=n.contentWindow;r&&r.fetch&&(t=r.fetch),e.head.removeChild(n)}catch(e){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return Cn=t.bind(Sn)}var An=te();class Tn extends on{constructor(e){e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:"npm:@sentry/browser",version:"7.3.0"}],version:"7.3.0"},super(e),e.sendClientReports&&An.document&&An.document.addEventListener("visibilitychange",(()=>{"hidden"===An.document.visibilityState&&this._flushOutcomes()}))}eventFromException(e,t){return function(e,t,n,r){var o=vn(e,t,n&&n.syntheticException||void 0,r);return ct(o),o.level="error",n&&n.event_id&&(o.event_id=n.event_id),ft(o)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",r,o){
|
|
62
|
+
var i=_n(e,t,r&&r.syntheticException||void 0,o);return i.level=n,r&&r.event_id&&(i.event_id=r.event_id),ft(i)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}sendEvent(e,t){var n=this.getIntegrationById("Breadcrumbs");n&&n.options&&n.options.sentry&&qt().addBreadcrumb({category:"sentry."+("transaction"===e.type?"transaction":"event"),event_id:e.event_id,level:e.level,message:st(e)},{event:e}),super.sendEvent(e,t)}_prepareEvent(e,t,n){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n)}_flushOutcomes(){var e=this._clearOutcomes();if(0!==e.length)if(this._dsn){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.log("Sending outcomes:",e);var t,n,r,o=Zt(this._dsn,this._options.tunnel),i=(t=e,Ct((n=this._options.tunnel&&_e(this._dsn))?{dsn:n}:{},[[{type:"client_report"},{timestamp:r||kt(),discarded_events:t}]]));try{!function(e,t){
|
|
63
|
+
"[object Navigator]"===Object.prototype.toString.call(Sn&&Sn.navigator)&&"function"==typeof Sn.navigator.sendBeacon?Sn.navigator.sendBeacon.bind(Sn.navigator)(e,t):He()&&En()(e,{body:t,method:"POST",credentials:"omit",keepalive:!0}).then(null,(e=>{("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.error(e)}))}(o,Nt(i))}catch(e){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.error(e)}}else("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.log("No dsn provided, will not send outcomes");else("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.log("No outcomes to send")}}function Nn(e,t=En()){return an(e,(function(n){var r={body:n.body,method:"POST",referrerPolicy:"origin",headers:e.headers,...e.fetchOptions};return t(e.url,r).then((e=>({statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}})))}))}function Mn(e){return an(e,(function(t){return new vt(((n,r)=>{var o=new XMLHttpRequest
|
|
64
64
|
;for(var i in o.onerror=r,o.onreadystatechange=()=>{4===o.readyState&&n({statusCode:o.status,headers:{"x-sentry-rate-limits":o.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":o.getResponseHeader("Retry-After")}})},o.open("POST",e.url),e.headers)Object.prototype.hasOwnProperty.call(e.headers,i)&&o.setRequestHeader(i,e.headers[i]);o.send(t.body)}))}))}function Ln(e,t,n,r){var o={filename:e,function:t,in_app:!0};return void 0!==n&&(o.lineno=n),void 0!==r&&(o.colno=r),o}var zn=/^\s*at (?:(.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,On=/\((\S*)(?::(\d+))(?::(\d+))\)/,Rn=[30,e=>{var t=zn.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){var n=On.exec(t[2]);n&&(t[2]=n[1],t[3]=n[2],t[4]=n[3])}const[e,r]=jn(t[1]||"?",t[2]);return Ln(r,e,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}
|
|
65
|
-
}],Dn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,In=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Pn=[50,e=>{var t=Dn.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var n=In.exec(t[3]);n&&(t[1]=t[1]||"eval",t[3]=n[1],t[4]=n[2],t[5]="")}let e=t[3],r=t[1]||"?";return[r,e]=jn(r,e),Ln(e,r,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],Bn=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Fn=
|
|
66
|
-
if("function"!=typeof e)return e;try{var r=e.__sentry_wrapped__;if(r)return r;if(ze(e))return e}catch(t){return e}var o=function(){var r=Array.prototype.slice.call(arguments);try{n&&"function"==typeof n&&n.apply(this,arguments);var o=r.map((e=>$n(e,t)));return e.apply(this,o)}catch(e){throw qn(),Kt((n=>{n.addEventProcessor((e=>(t.mechanism&&(
|
|
67
|
-
;for(var n in t){var r=this._installFunc[n];r&&t[n]&&(e=n,("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.log(`Global Handler attached: ${e}`),r(),this._installFunc[n]=void 0)}}}function Vn(){
|
|
68
|
-
value:`Non-Error promise rejection captured with value: ${String(o)}`}]}}:vn(n,o,void 0,r,!0);i.level="error",Kn(t,o,i,"onunhandledrejection")}))}function Wn(e,t,n,r){var o=e.exception=e.exception||{},i=o.values=o.values||[],a=i[0]=i[0]||{},s=a.stacktrace=a.stacktrace||{},l=s.frames=s.frames||[],c=isNaN(parseInt(r,10))?void 0:r,u=isNaN(parseInt(n,10))?void 0:n,h=le(t)&&t.length>0?t:function(){var e=te();try{return e.document.location.href}catch(e){return""}}();return 0===l.length&&l.push({colno:c,filename:h,function:"?",in_app:!0,lineno:u}),e}function Kn(e,t,n,r){
|
|
65
|
+
}],Dn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,In=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Pn=[50,e=>{var t=Dn.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var n=In.exec(t[3]);n&&(t[1]=t[1]||"eval",t[3]=n[1],t[4]=n[2],t[5]="")}let e=t[3],r=t[1]||"?";return[r,e]=jn(r,e),Ln(e,r,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],Bn=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Fn=je(...[Rn,Pn,[40,e=>{var t=Bn.exec(e);return t?Ln(t[2],t[1]||"?",+t[3],t[4]?+t[4]:void 0):void 0}]]),jn=(e,t)=>{var n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:"?",n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};let Un=0;function Hn(){return Un>0}function qn(){Un+=1,setTimeout((()=>{Un-=1}))}function $n(e,t={},n){
|
|
66
|
+
if("function"!=typeof e)return e;try{var r=e.__sentry_wrapped__;if(r)return r;if(ze(e))return e}catch(t){return e}var o=function(){var r=Array.prototype.slice.call(arguments);try{n&&"function"==typeof n&&n.apply(this,arguments);var o=r.map((e=>$n(e,t)));return e.apply(this,o)}catch(e){throw qn(),Kt((n=>{n.addEventProcessor((e=>(t.mechanism&&(lt(e,void 0,void 0),ct(e,t.mechanism)),e.extra={...e.extra,arguments:r},e))),Yt(e)})),e}};try{for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=e[i])}catch(e){}Le(o,e),Me(e,"__sentry_wrapped__",o);try{Object.getOwnPropertyDescriptor(o,"name").configurable&&Object.defineProperty(o,"name",{get:()=>e.name})}catch(e){}return o}class Gn{static __initStatic(){this.id="GlobalHandlers"}__init(){this.name=Gn.id}__init2(){this._installFunc={onerror:Vn,onunhandledrejection:Yn}}constructor(e){Gn.prototype.__init.call(this),Gn.prototype.__init2.call(this),this._options={onerror:!0,onunhandledrejection:!0,...e}}setupOnce(){Error.stackTraceLimit=50;var e,t=this._options
|
|
67
|
+
;for(var n in t){var r=this._installFunc[n];r&&t[n]&&(e=n,("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.log(`Global Handler attached: ${e}`),r(),this._installFunc[n]=void 0)}}}function Vn(){We("error",(e=>{const[t,n,r]=Xn();if(!t.getIntegration(Gn))return;const{msg:o,url:i,line:a,column:s,error:l}=e;if(!(Hn()||l&&l.__sentry_own_request__)){var c=void 0===l&&le(o)?function(e,t,n,r){var o=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let i=ae(e)?e.message:e,a="Error";var s=i.match(o);s&&(a=s[1],i=s[2]);return Wn({exception:{values:[{type:a,value:i}]}},t,n,r)}(o,i,a,s):Wn(vn(n,l||o,void 0,r,!1),i,a,s);c.level="error",Kn(t,l,c,"onerror")}}))}function Yn(){We("unhandledrejection",(e=>{const[t,n,r]=Xn();if(!t.getIntegration(Gn))return;let o=e;try{"reason"in e?o=e.reason:"detail"in e&&"reason"in e.detail&&(o=e.detail.reason)}catch(e){}if(Hn()||o&&o.__sentry_own_request__)return!0;var i=ce(o)?{exception:{values:[{type:"UnhandledRejection",
|
|
68
|
+
value:`Non-Error promise rejection captured with value: ${String(o)}`}]}}:vn(n,o,void 0,r,!0);i.level="error",Kn(t,o,i,"onunhandledrejection")}))}function Wn(e,t,n,r){var o=e.exception=e.exception||{},i=o.values=o.values||[],a=i[0]=i[0]||{},s=a.stacktrace=a.stacktrace||{},l=s.frames=s.frames||[],c=isNaN(parseInt(r,10))?void 0:r,u=isNaN(parseInt(n,10))?void 0:n,h=le(t)&&t.length>0?t:function(){var e=te();try{return e.document.location.href}catch(e){return""}}();return 0===l.length&&l.push({colno:c,filename:h,function:"?",in_app:!0,lineno:u}),e}function Kn(e,t,n,r){ct(n,{handled:!1,type:r}),e.captureEvent(n,{originalException:t})}function Xn(){var e=qt(),t=e.getClient(),n=t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[e,n.stackParser,n.attachStacktrace]}Gn.__initStatic()
|
|
69
69
|
;var Zn=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"];class Jn{static __initStatic(){this.id="TryCatch"}__init(){this.name=Jn.id}constructor(e){Jn.prototype.__init.call(this),this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e}}setupOnce(){var e=te();this._options.setTimeout&&Ne(e,"setTimeout",Qn),this._options.setInterval&&Ne(e,"setInterval",Qn),this._options.requestAnimationFrame&&Ne(e,"requestAnimationFrame",er),this._options.XMLHttpRequest&&"XMLHttpRequest"in e&&Ne(XMLHttpRequest.prototype,"send",tr);var t=this._options.eventTarget
|
|
70
|
-
;t&&(Array.isArray(t)?t:Zn).forEach(nr)}}function Qn(e){return function(...t){var n=t[0];return t[0]=$n(n,{mechanism:{data:{function:
|
|
71
|
-
}catch(e){}return t.apply(this,[n,$n(r,{mechanism:{data:{function:"addEventListener",handler:
|
|
70
|
+
;t&&(Array.isArray(t)?t:Zn).forEach(nr)}}function Qn(e){return function(...t){var n=t[0];return t[0]=$n(n,{mechanism:{data:{function:Ue(e)},handled:!0,type:"instrument"}}),e.apply(this,t)}}function er(e){return function(t){return e.apply(this,[$n(t,{mechanism:{data:{function:"requestAnimationFrame",handler:Ue(e)},handled:!0,type:"instrument"}})])}}function tr(e){return function(...t){var n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach((e=>{e in n&&"function"==typeof n[e]&&Ne(n,e,(function(t){var n={mechanism:{data:{function:e,handler:Ue(t)},handled:!0,type:"instrument"}},r=ze(t);return r&&(n.mechanism.data.handler=Ue(r)),$n(t,n)}))})),e.apply(this,t)}}function nr(e){var t=te(),n=t[e]&&t[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(Ne(n,"addEventListener",(function(t){return function(n,r,o){try{"function"==typeof r.handleEvent&&(r.handleEvent=$n(r.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Ue(r),target:e},handled:!0,type:"instrument"}}))
|
|
71
|
+
}catch(e){}return t.apply(this,[n,$n(r,{mechanism:{data:{function:"addEventListener",handler:Ue(r),target:e},handled:!0,type:"instrument"}}),o])}})),Ne(n,"removeEventListener",(function(e){return function(t,n,r){var o=n;try{var i=o&&o.__sentry_wrapped__;i&&e.call(this,t,i,r)}catch(e){}return e.call(this,t,o,r)}})))}Jn.__initStatic();class rr{static __initStatic(){this.id="LinkedErrors"}__init(){this.name=rr.id}constructor(e={}){rr.prototype.__init.call(this),this._key=e.key||"cause",this._limit=e.limit||5}setupOnce(){var e=qt().getClient();e&&Bt(((t,n)=>{var r=qt().getIntegration(rr);return r?function(e,t,n,r,o){if(!(r.exception&&r.exception.values&&o&&pe(o.originalException,Error)))return r;var i=or(e,n,o.originalException,t);return r.exception.values=[...i,...r.exception.values],r}(e.getOptions().stackParser,r._key,r._limit,t,n):t}))}}function or(e,t,n,r,o=[]){if(!pe(n[r],Error)||o.length+1>=t)return o;var i=dn(e,n[r]);return or(e,t,n[r],r,[i,...o])}rr.__initStatic();var ir=te();class ar{constructor(){
|
|
72
72
|
ar.prototype.__init.call(this)}static __initStatic(){this.id="HttpContext"}__init(){this.name=ar.id}setupOnce(){Bt((e=>{if(qt().getIntegration(ar)){if(!ir.navigator&&!ir.location&&!ir.document)return e;var t=e.request&&e.request.url||ir.location&&ir.location.href;const{referrer:r}=ir.document||{},{userAgent:o}=ir.navigator||{};var n={...t&&{url:t},headers:{...e.request&&e.request.headers,...r&&{Referer:r},...o&&{"User-Agent":o}}};return{...e,request:n}}return e}))}}ar.__initStatic();class sr{constructor(){sr.prototype.__init.call(this)}static __initStatic(){this.id="Dedupe"}__init(){this.name=sr.id}setupOnce(e,t){var n=e=>{var n=t().getIntegration(sr);if(n){try{if(function(e,t){if(!t)return!1;if(function(e,t){var n=e.message,r=t.message;if(!n&&!r)return!1;if(n&&!r||!n&&r)return!1;if(n!==r)return!1;if(!cr(e,t))return!1;if(!lr(e,t))return!1;return!0}(e,t))return!0;if(function(e,t){var n=ur(t),r=ur(e);if(!n||!r)return!1;if(n.type!==r.type||n.value!==r.value)return!1;if(!cr(e,t))return!1;if(!lr(e,t))return!1
|
|
73
73
|
;return!0}(e,t))return!0;return!1}(e,n._previousEvent))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(t){return n._previousEvent=e}return n._previousEvent=e}return e};n.id=this.name,e(n)}}function lr(e,t){let n=hr(e),r=hr(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(n=n,r=r,r.length!==n.length)return!1;for(let e=0;e<r.length;e++){var o=r[e],i=n[e];if(o.filename!==i.filename||o.lineno!==i.lineno||o.colno!==i.colno||o.function!==i.function)return!1}return!0}function cr(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return!(n.join("")!==r.join(""))}catch(e){return!1}}function ur(e){return e.exception&&e.exception.values&&e.exception.values[0]}function hr(e){var t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch(e){return}}sr.__initStatic();var dr=[new un,new ln,new Jn,new bn,new Gn,new rr,new sr,new ar];function pr(e={}){
|
|
74
|
-
if(void 0===e.defaultIntegrations&&(e.defaultIntegrations=dr),void 0===e.release){var t=te();t.SENTRY_RELEASE&&t.SENTRY_RELEASE.id&&(e.release=t.SENTRY_RELEASE.id)}void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),void 0===e.sendClientReports&&(e.sendClientReports=!0);var n,r={...e,stackParser:(n=e.stackParser||Fn,Array.isArray(n)?
|
|
74
|
+
if(void 0===e.defaultIntegrations&&(e.defaultIntegrations=dr),void 0===e.release){var t=te();t.SENTRY_RELEASE&&t.SENTRY_RELEASE.id&&(e.release=t.SENTRY_RELEASE.id)}void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),void 0===e.sendClientReports&&(e.sendClientReports=!0);var n,r={...e,stackParser:(n=e.stackParser||Fn,Array.isArray(n)?je(...n):n),integrations:nn(e),transport:e.transport||(He()?Nn:Mn)};!function(e,t){!0===t.debug&&("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?Ce.enable():console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."));var n=qt(),r=n.getScope();r&&r.update(t.initialScope);var o=new e(t);n.bindClient(o)}(Tn,r),e.autoSessionTracking&&function(){if(void 0===te().document)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn("Session tracking in non-browser environment with @sentry/browser is not supported."));var e=qt();if(!e.captureSession)return;mr(e),We("history",(({from:e,to:t})=>{void 0!==e&&e!==t&&mr(qt())
|
|
75
75
|
}))}()}function mr(e){e.startSession({ignoreDuration:!0}),e.captureSession()}let fr={};var gr=te();function vr(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);return t.stack=e.stack,t}(r),t)}};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)}gr.Sentry&&gr.Sentry.Integrations&&(fr=gr.Sentry.Integrations);let _r=0;function br(e){!function(e){qt().setUser(e)}(e)}!function(){function e(e){var t=!0,n=!1,r=null,o={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function i(e){return!!(e&&e!==document&&"HTML"!==e.nodeName&&"BODY"!==e.nodeName&&"classList"in e&&"contains"in e.classList)}function a(e){var t=e.type,n=e.tagName;return!("INPUT"!==n||!o[t]||e.readOnly)||"TEXTAREA"===n&&!e.readOnly||!!e.isContentEditable}function s(e){
|
|
76
76
|
e.classList.contains("focus-visible")||(e.classList.add("focus-visible"),e.setAttribute("data-focus-visible-added",""))}function l(e){e.hasAttribute("data-focus-visible-added")&&(e.classList.remove("focus-visible"),e.removeAttribute("data-focus-visible-added"))}function c(n){n.metaKey||n.altKey||n.ctrlKey||(i(e.activeElement)&&s(e.activeElement),t=!0)}function u(e){t=!1}function h(e){i(e.target)&&(t||a(e.target))&&s(e.target)}function d(e){i(e.target)&&(e.target.classList.contains("focus-visible")||e.target.hasAttribute("data-focus-visible-added"))&&(n=!0,window.clearTimeout(r),r=window.setTimeout((function(){n=!1}),100),l(e.target))}function p(e){"hidden"===document.visibilityState&&(n&&(t=!0),m())}function m(){document.addEventListener("mousemove",g),document.addEventListener("mousedown",g),document.addEventListener("mouseup",g),document.addEventListener("pointermove",g),document.addEventListener("pointerdown",g),document.addEventListener("pointerup",g),document.addEventListener("touchmove",g),
|
|
77
77
|
document.addEventListener("touchstart",g),document.addEventListener("touchend",g)}function f(){document.removeEventListener("mousemove",g),document.removeEventListener("mousedown",g),document.removeEventListener("mouseup",g),document.removeEventListener("pointermove",g),document.removeEventListener("pointerdown",g),document.removeEventListener("pointerup",g),document.removeEventListener("touchmove",g),document.removeEventListener("touchstart",g),document.removeEventListener("touchend",g)}function g(e){e.target.nodeName&&"html"===e.target.nodeName.toLowerCase()||(t=!1,f())}document.addEventListener("keydown",c,!0),document.addEventListener("mousedown",u,!0),document.addEventListener("pointerdown",u,!0),document.addEventListener("touchstart",u,!0),document.addEventListener("visibilitychange",p,!0),m(),e.addEventListener("focus",h,!0),e.addEventListener("blur",d,!0),
|
|
@@ -585,7 +585,7 @@ function Jf({onLogin:e,onSignUp:t}){return ys().isLoggedIn()?null:so(Zf,{icon:"r
|
|
|
585
585
|
r.selectTab(e)},u="annotation"===o&&0===a&&!l,h="note"===o&&0===i;return so("div",{className:Pr("space-y-3 pb-[9px]"),children:[so("div",{className:"flex gap-x-6 theme-clean:ml-[15px]",role:"tablist",children:[so(Qf,{count:a,isWaitingToAnchor:l,isSelected:"annotation"===o,label:"Annotations",onSelect:()=>c("annotation"),children:"Annotations"}),so(Qf,{count:i,isWaitingToAnchor:l,isSelected:"note"===o,label:"Page notes",onSelect:()=>c("note"),children:"Page Notes"}),s>0&&so(Qf,{count:s,isWaitingToAnchor:l,isSelected:"orphan"===o,label:"Orphans",onSelect:()=>c("orphan"),children:"Orphans"})]}),"note"===o&&n.enableExperimentalNewNoteButton&&so("div",{className:"flex justify-end",children:so(fo,{"data-testid":"new-note-button",icon:"add",onClick:()=>e.createPageNote(),variant:"primary",style:Xo(["ctaBackgroundColor"],n),children:"New note"})}),!t&&h&&so(_o,{classes:"text-center",children:so("span",{"data-testid":"notes-unavailable-message",children:"There are no page notes in this group."})}),!t&&u&&so(_o,{
|
|
586
586
|
classes:"text-center",children:so("span",{"data-testid":"annotations-unavailable-message",children:["There are no annotations in this group.",so("br",{}),"Create one by selecting some text and clicking the"," ",so(Ao,{classes:"inline m-0.5 -mt-0.5",name:"annotate",title:"Annotate"})," ","button."]})})]})}),["annotationsService","settings"]);var tg=Jo((function({frameSync:e,onLogin:t,onSignUp:n,loadAnnotationsService:r,streamer:o}){const i=Ks(),a=ys(),s=a.focusedGroupId(),l=a.hasAppliedFilter()||a.hasSelectedAnnotations(),c=a.isLoading(),u=a.isLoggedIn(),h=a.directLinkedAnnotationId(),d=h?a.findAnnotationByID(h):void 0,p=d?js(d):"annotation",m=a.searchUris(),f=a.hasSidebarOpened(),g=a.profile().userid,v=d&&!1===d.$orphan?d.$tag:null,_=!(c||!h)&&!d,b=a.directLinkedGroupFetchFailed(),y=_||b,w=!y,x=!y&&!l,k=h&&!u&&!_&&!c,S=Xr(s);Wr((()=>{if(!S.current||S.current!==s){if(S.current){let e=a.focusState().active;a.clearSelection(),e&&a.toggleFocusMode(!0)}S.current=s}s&&m.length&&r.load({groupId:s,uris:m})
|
|
587
587
|
}),[a,r,s,g,m]),Wr((()=>{v?(e.focusAnnotations([v]),e.scrollToAnnotation(v),a.selectTab(p)):d&&a.selectTab(p)}),[p,e,d,v,a]);const C=a.hasFetchedProfile();return Wr((()=>{C&&(f||u)&&o.connect({applyUpdatesImmediately:!1})}),[C,u,f,o]),so("div",{children:[so("h2",{className:"sr-only",children:"Annotations"}),w&&so(Hf,{}),so(Jf,{onLogin:t,onSignUp:n}),_&&so(Ff,{errorType:"annotation",onLoginRequest:t,showClearSelection:!0}),b&&so(Ff,{errorType:"group",onLoginRequest:t}),x&&so(eg,{isLoading:c}),so(Bf,{threads:i.children}),k&&so(qf,{onLogin:t})]})}),["frameSync","loadAnnotationsService","streamer"]);var ng=Jo((function({api:e,toastMessenger:t}){const n=ys(),r=n.routeParams().q,o=Jr((async t=>{const r={_separate_replies:!0,offset:0,limit:20,...Os(t)};try{n.annotationFetchStarted();const t=await e.search(r);n.addAnnotations([...t.rows,...t.replies])}finally{n.annotationFetchFinished()}}),[e,n]);return Wr((()=>{n.setSortKey("Newest"),n.clearAnnotations(),o(r).catch((e=>{
|
|
588
|
-
t.error(`Unable to fetch annotations: ${e.message}`)}))}),[r,o,n,t]),so(Bf,{threads:Ks().children})}),["api","toastMessenger"]);class rg{constructor(e,t,n=window){var r,o,i;const a="N/A";let s=a;e.userid&&(s=e.userid,e.displayName&&(s=`${e.displayName} (${s})`)),this.version="1.
|
|
588
|
+
t.error(`Unable to fetch annotations: ${e.message}`)}))}),[r,o,n,t]),so(Bf,{threads:Ks().children})}),["api","toastMessenger"]);class rg{constructor(e,t,n=window){var r,o,i;const a="N/A";let s=a;e.userid&&(s=e.userid,e.displayName&&(s=`${e.displayName} (${s})`)),this.version="1.1071.0",this.userAgent=n.navigator.userAgent,this.urls=t.map((e=>e.uri)).join(", ")||a,this.fingerprint=null!==(r=null===(o=t[0])||void 0===o||null===(i=o.metadata)||void 0===i?void 0:i.documentFingerprint)&&void 0!==r?r:a,this.account=s,this.timestamp=(new Date).toString()}asFormattedString(){return`Version: ${this.version}\nUser Agent: ${this.userAgent}\nURL: ${this.urls}\nFingerprint: ${this.fingerprint}\nAccount: ${this.account}\nDate: ${this.timestamp}\n`}asEncodedURLString(){return encodeURIComponent(this.asFormattedString())}}function og(e){const t=I(e);return!(null==t||!t.authority)&&t.authority!==e.authDomain}function ig({commandName:e,iconName:t}){return so("span",{className:"whitespace-nowrap",children:[so(Ao,{name:t,
|
|
589
589
|
classes:Pr("mx-1 -mt-1","text-color-text-light inline")}),so("em",{children:e})]})}var ag=Jo((function({settings:e}){const t=!og(e);return so("ol",{className:"list-decimal pl-10 space-y-2",children:[so("li",{children:["To create an annotation, select text and then select the"," ",so(ig,{iconName:"annotate",commandName:"Annotate"})," ","button."]}),so("li",{children:["To create a highlight (",so(To,{classes:"underline hover:underline",href:"https://web.hypothes.is/help/why-are-highlights-private-by-default/",target:"_blank",children:"visible only to you"}),"), select text and then select the"," ",so(ig,{iconName:"highlight",commandName:"Highlight"})," ","button."]}),t&&so("li",{children:["To annotate in a private group, select the group from the groups dropdown. Don't see your group? Ask the group creator to send a"," ",so(To,{classes:"underline hover:underline",href:"https://web.hypothes.is/help/how-to-join-a-private-group/",target:"_blank",children:"join link"}),")."]}),so("li",{
|
|
590
590
|
children:["To reply to an annotation, select the"," ",so(ig,{iconName:"reply",commandName:"Reply"})," button."]})]})}),["settings"]);function sg({label:e,children:t,classes:n}){return so(m,{children:[so("dt",{className:"col-span-1 sm:text-right font-medium",children:e}),so("dd",{className:Pr("col-span-1 sm:col-span-3 text-color-text-light break-words",n),children:t})]})}var lg=Jo((function({toastMessenger:e,versionData:t}){return so("div",{className:"space-y-4",children:[so("dl",{className:"grid grid-cols-1 sm:grid-cols-4 sm:gap-x-2",children:[so(sg,{label:"Version",children:t.version}),so(sg,{label:"User Agent",children:t.userAgent}),so(sg,{classes:Pr("break-all"),label:"URL",children:t.urls}),so(sg,{label:"Fingerprint",children:t.fingerprint}),so(sg,{label:"Account",children:t.account}),so(sg,{label:"Date",children:t.timestamp})]}),so("div",{className:"flex items-center justify-center",children:so(fo,{onClick:()=>{try{wl(t.asFormattedString()),e.success("Copied version info to clipboard")}catch(t){
|
|
591
591
|
e.error("Unable to copy version info")}},icon:"copy",children:"Copy version details"})})]})}),["toastMessenger"]);function cg({children:e,onClick:t}){return so(go,{classes:"leading-none text-brand",onClick:t,children:[e,so(Ao,{classes:"ml-1",name:"arrow-right"})]})}function ug({linkText:e,url:t}){return so("div",{className:"flex-1 border-r last-of-type:border-r-0",children:so(To,{href:t,classes:"flex items-center justify-center space-x-2 text-color-text-light text-lg font-medium",target:"_blank",children:[so("span",{children:e})," ",so(Ao,{name:"external",classes:"w-3 h-3"})]})})}var hg=Jo((function({auth:e,session:t}){const n=ys(),r=n.frames(),o=n.mainFrame(),i=!!n.profile().preferences.show_sidebar_tutorial,[a,s]=Vr("tutorial"),l=Zr((()=>{const t=e||{status:"logged-out"},n=[...r].sort(((e,t)=>e===o?-1:t===o?1:0));return new rg(t,n)}),[e,r,o]),c=`https://web.hypothes.is/get-help/?sys_info=${l.asEncodedURLString()}`,u=(e,t)=>{e.preventDefault(),s(t)};return so(Zf,{title:"Help",panelName:"help",
|
|
@@ -614,7 +614,7 @@ children:["annotation"===l&&so(jf,{onLogin:p}),"notebook"===l&&so(kg,{}),"stream
|
|
|
614
614
|
user_info:a,$tag:s,hidden:!1,links:{},document:{title:""}},e);return Bi(l)&&(l.permissions=gl(i)),l}create(e,t=new Date){const n=this._initialize(e,t);this._store.addAnnotations([n]),this._store.deleteNewAndEmptyDrafts(),Bi(n)||this._store.createDraft(n,{tags:n.tags,text:n.text,isPrivate:!Ri(n)}),ji(n)?this._store.selectTab("note"):Ui(n)&&this._store.selectTab("annotation"),(n.references||[]).forEach((e=>{this._store.setExpanded(e,!0)}))}createPageNote(){const e=this._store.mainFrame();if(!this._store.isLoggedIn())return void this._store.openSidebarPanel("loginPrompt");if(!e)return;const t={target:[],uri:e.uri};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:Ri(e)?vl(t,e.group):gl(t),references:(e.references||[]).concat(e.id),
|
|
615
615
|
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;zi(e)?(t=this._api.annotation.update({id:e.id},r),n="update"):(t=this._api.annotation.create({},r),n="create"),this._store.annotationSaveStarted(e);try{o=await t,this._activity.reportActivity(n,o)}finally{this._store.annotationSaveFinished(e)}for(let[t,n]of Object.entries(e))if(t.startsWith("$")){o[t]=n}return this._store.removeDraft(e),this._store.addAnnotations([o]),o}}Ug.$inject=["annotationActivity","api","store"];class Hg{constructor(e){this._rpc=e.rpc,this._reportConfig=e.reportActivity}reportActivity(e,t){if(!this._rpc||!this._reportConfig)return;let n;switch(e){case"create":n=new Date(t.created).toISOString();break;case"update":n=new Date(t.updated).toISOString();break;default:n=(new Date).toISOString()}const r={date:n,annotation:{id:t.id,isShared:bl(t.permissions)}};this._reportConfig.events.includes(e)&&function(e,t,n,r=[]){const o={jsonrpc:"2.0",method:n,params:r}
|
|
616
616
|
;e.postMessage(o,t)}(this._rpc.targetFrame,this._rpc.origin,this._reportConfig.method,[e,r])}}Hg.$inject=["settings"];class qg extends Error{constructor(e,t,n=""){let r="Network request failed";t&&(r+=` (${t.status})`),n&&(r+=`: ${n}`),super(r),this.url=e,this.response=t,this.reason=n}}async function $g(e,t){let n,r;try{n=await fetch(e,t)}catch(t){throw new qg(e,null,t.message)}if(204===n.status)return null;try{r=await n.json()}catch(t){throw new qg(e,n,"Failed to parse response")}var o;if(!n.ok)throw new qg(e,n,null===(o=r)||void 0===o?void 0:o.reason);return r}function Gg(e){const t={};for(let[n,r]of Object.entries(e))n.startsWith("$")||(t[n]=r);return t}function Vg(e){return"url"in e}function Yg(e,t,{getAccessToken:n,getClientId:r,onRequestStarted:o,onRequestFinished:i}){return async(a,s)=>{o();try{const[o,l]=await Promise.all([e,n()]),c=function(e,t){let n=e;const r=t.split(".");for(let[e,t]of r.entries()){const o=n[t];if(!o||Vg(o)){if(o&&e===r.length-1)return o;break}n=o}return null}(o,t)
|
|
617
|
-
;if(!c)throw new Error(`Missing API route: ${t}`);const u={"Content-Type":"application/json","Hypothesis-Client-Version":"1.
|
|
617
|
+
;if(!c)throw new Error(`Missing API route: ${t}`);const u={"Content-Type":"application/json","Hypothesis-Client-Version":"1.1071.0"};l&&(u.Authorization="Bearer "+l);const h=r();h&&(u["X-Client-Id"]=h);const{url:d,unusedParams:p}=Va(c.url,a),m=new URL(d);for(let[e,t]of Object.entries(p)){Array.isArray(t)||(t=[t]);for(let n of t)null!=n&&m.searchParams.append(e,n.toString())}return await $g(m.toString(),{body:s?JSON.stringify(Gg(s)):null,headers:u,method:c.method})}finally{i()}}}class Wg{constructor(e,t,n){const r=e.routes();this._clientId=null;const o=()=>this._clientId,i=e=>Yg(r,e,{getAccessToken:t.getAccessToken,getClientId:o,onRequestStarted:n.apiRequestStarted,onRequestFinished:n.apiRequestFinished});this.search=i("search"),this.annotation={create:i("annotation.create"),delete:i("annotation.delete"),get:i("annotation.read"),update:i("annotation.update"),flag:i("annotation.flag"),hide:i("annotation.hide"),unhide:i("annotation.unhide")},this.group={member:{delete:i("group.member.delete")},
|
|
618
618
|
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}}Wg.$inject=["apiRoutes","auth","store"];var Kg={exports:{}},Xg={};function Zg(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 Jg=Zg;Zg.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},Zg.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},Zg.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),
|
|
619
619
|
!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},Zg.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout((function(){n._operationTimeoutCb()}),n._operationTimeout)),this._operationStart=(new Date).getTime(),this._fn(this._attempts)},Zg.prototype.try=function(e){
|
|
620
620
|
console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},Zg.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},Zg.prototype.start=Zg.prototype.try,Zg.prototype.errors=function(){return this._errors},Zg.prototype.attempts=function(){return this._attempts},Zg.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=Jg;e.operation=function(n){var r=e.timeouts(n);return new t(r,{forever:n&&(n.forever||n.retries===1/0),unref:n&&n.unref,maxRetryTime:n&&n.maxRetryTime})},e.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};for(var n in e)t[n]=e[n];if(t.minTimeout>t.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],o=0;o<t.retries;o++)r.push(this.createTimeout(o,t))
|
|
@@ -647,8 +647,8 @@ null!==(n=this._socket)&&void 0!==n&&n.isConnected()&&this._socket.send(t)}async
|
|
|
647
647
|
var t;this._updateImmediately=null===(t=e.applyUpdatesImmediately)||void 0===t||t,this._reconnectSetUp||(this._reconnectSetUp=!0,hv(this._store.subscribe,(()=>this._store.profile().userid),(()=>this._reconnect()))),this._socket||await this._reconnect()}}Tv.$inject=["store","apiRoutes","auth","groups","session"];class Nv{constructor(e){this._storage=e}filter(e,t=null){const n=this._storage.getObject("hypothesis.user.tags.list")||[];let r=0;return n.filter((n=>{if(null!==t&&r>=t)return!1;const o=n.split(/\W+/),i=new RegExp(`^${W(e)}`,"i");return!(!o.some((e=>e.match(i)))&&!n.match(i))&&(++r,!0)}))}store(e){const t=this._storage.getObject("hypothesis.user.tags.map")||{};e.forEach((e=>{t[e]?(t[e].count+=1,t[e].updated=Date.now()):t[e]={text:e,count:1,updated:Date.now()}})),this._storage.setObject("hypothesis.user.tags.map",t);const n=Object.keys(t).sort(((e,n)=>t[e].count!==t[n].count?t[n].count-t[e].count:e.localeCompare(n)));this._storage.setObject("hypothesis.user.tags.list",n)}}Nv.$inject=["localStorage"]
|
|
648
648
|
;class Mv{constructor(e){this._store=e}forceVisible(e){e.children.forEach((e=>{this.forceVisible(e)})),e.visible||this._store.setForcedVisible(e.id,!0)}}Mv.$inject=["store"];class Lv{constructor(e){this._store=e}dismiss(e){const t=this._store.getToastMessage(e);t&&!t.isDismissed&&(this._store.updateToastMessage({...t,isDismissed:!0}),setTimeout((()=>{this._store.removeToastMessage(e)}),500))}_addMessage(e,t,{autoDismiss:n=!0,moreInfoURL:r="",visuallyHidden:o=!1}={}){if(this._store.hasToastMessage(e,t))return;const i=U(10),a={type:e,id:i,message:t,moreInfoURL:r,visuallyHidden:o};this._store.addToastMessage({isDismissed:!1,...a}),n&&setTimeout((()=>{this.dismiss(i)}),5e3)}error(e,t){this._addMessage("error",e,t)}success(e,t){this._addMessage("success",e,t)}notice(e,t){this._addMessage("notice",e,t)}}Lv.$inject=["store"];class zv{constructor(){this._providers=new Map,this._instances=new Map,this._constructing=new Set}get(e){if(this._instances.has(e))return this._instances.get(e);const t=this._providers.get(e)
|
|
649
649
|
;if(!t)throw new Error(`"${e}" is not registered`);if("value"in t)return this._instances.set(e,t.value),t.value;if(this._constructing.has(e))throw new Error(`Encountered a circular dependency when constructing "${e}"`);this._constructing.add(e);try{const n=[],r="class"in t&&t.class.$inject||"factory"in t&&t.factory.$inject||[];for(const t of r)try{n.push(this.get(t))}catch(n){const r=new Error(`Failed to construct dependency "${t}" of "${e}": ${n.message}`);throw r.cause=n,r}let o;if(t.class)o=new t.class(...n);else{o=(0,t.factory)(...n)}return this._instances.set(e,o),o}finally{this._constructing.delete(e)}}register(e,t){if("function"==typeof t)t={class:t};else if(!function(e){return"object"==typeof e&&null!==e&&("value"in e||"function"==typeof e.class||"function"==typeof e.factory)}(t))throw new Error(`Invalid provider for "${e}"`);return this._providers.set(e,t),this}run(e){const t="Injector.run";this.register(t,{factory:e});try{return this.get(t)}finally{this._instances.delete(t),this._providers.delete(t)
|
|
650
|
-
}}}const Ov=function(t){for(var n={},r=t.querySelectorAll("script.js-hypothesis-config"),o=0;o<r.length;o++){var i=void 0;try{i=JSON.parse(r[o].textContent||"")}catch(e){console.warn("Could not parse settings from js-hypothesis-config tags",e),i={}}e(n,i)}return n}(document),Rv=function(e){const{version:t,origin:n}=D(e.location.href);return"1.
|
|
651
|
-
;return e?new URL(e).origin:null}(),n=t?[t]:void 0;pr({dsn:e.dsn,environment:e.environment,allowUrls:n,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.
|
|
650
|
+
}}}const Ov=function(t){for(var n={},r=t.querySelectorAll("script.js-hypothesis-config"),o=0;o<r.length;o++){var i=void 0;try{i=JSON.parse(r[o].textContent||"")}catch(e){console.warn("Could not parse settings from js-hypothesis-config tags",e),i={}}e(n,i)}return n}(document),Rv=function(e){const{version:t,origin:n}=D(e.location.href);return"1.1071.0"!==t?(console.warn(`The Hypothesis sidebar is using a different version (1.1071.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 Dv(e,t){e.setClientId(t.clientId)}function Iv(e,t,n){e.load(),t.load(),n.sync()}function Pv(e,t,n){e.init(),t.init(),n.init()}function Bv(e,t){"sidebar"===t.route()&&e.connect()}Ov.sentry&&Rv&&function(e){const t=function(){let e=import.meta.url
|
|
651
|
+
;return e?new URL(e).origin:null}(),n=t?[t]:void 0;pr({dsn:e.dsn,environment:e.environment,allowUrls:n,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.1071.0",beforeSend:(e,t)=>{if(_r>=5)return G("Client-side Sentry quota reached. No further Sentry events will be sent"),null;++_r;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{Wt("host_config",D(window.location.href))}catch(e){}Wt("loaded_scripts",Array.from(document.querySelectorAll("script")).filter((e=>!e.type||e.type.match(/javascript|module/))).map((e=>e.src||"<inline>"))),vr(((e,t)=>{Yt(e,{tags:{context:t}})}))}(Ov.sentry),function(e){e.addEventListener("click",(e=>{const t=e.target;if("A"===t.tagName){const e=t;"_blank"===e.target&&(e.rel="noopener")}}))}(document.body),function(e=n){let t=!1;try{document.createElement("div").dir="auto"}catch(e){t=!0}if(t){const t=e.vnode;e.vnode=e=>{
|
|
652
652
|
if("string"==typeof e.type){const t=e.props;"dir"in t&&"auto"===t.dir&&(t.dir="")}t&&t(e)}}}(),Dv.$inject=["api","streamer"],Iv.$inject=["groups","session","router"],Pv.$inject=["autosaveService","persistedDefaults","serviceURL"],Bv.$inject=["frameSync","store"],function(e,{reset:t=!1}={}){t&&lo.clear();for(let[t,n]of Object.entries(e))lo.set(t,n)}($o);const Fv=document.querySelector("hypothesis-app");!function(e=window){e.addEventListener("message",J)}(),async function(e,t=window){const n=function(e){const t=D(e.location.href),n=["annotations","group","query","appType","openSidebar","showHighlights","services","branding","enableExperimentalNewNoteButton","focus","requestConfigFromFrame","theme","usernameUrl"],r={openSidebar:P,requestConfigFromFrame:e=>{if("string"==typeof e)return e;const t=function(e){return"object"==typeof e&&null!==e?e:{}}(e);return{origin:F(t.origin),ancestorLevel:B(t.ancestorLevel)}}},o={};for(let[e,i]of Object.entries(t))n.includes(e)&&null!==i&&(r[e]?o[e]=r[e](i):o[e]=i);return o
|
|
653
653
|
}(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:q(n.ancestorLevel,t),origin:n.origin}}(n,t);let o;if(r){const e=await async function(e,t){return{...await H(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=H(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=I(e);if(t){if(t.apiUrl)return t.apiUrl;throw new Error("Service should contain an apiUrl value.")}return e.apiUrl}(i),i}(Ov).then((e=>{!function(e,t){const n=new zv
|
|
654
654
|
;n.register("annotationsService",Ug).register("annotationActivity",Hg).register("api",Wg).register("apiRoutes",nv).register("auth",iv).register("autosaveService",av).register("frameSync",mv).register("groups",vv).register("loadAnnotationsService",_v).register("localStorage",yv).register("persistedDefaults",xv).register("router",kv).register("serviceURL",Sv).register("session",Cv).register("streamer",Tv).register("streamFilter",Ev).register("tags",Nv).register("threadsService",Mv).register("toastMessenger",Lv).register("store",{factory:bs}),n.register("$window",{value:window}).register("settings",{value:e}),n.run(Pv),n.run(Dv),n.run(Iv),n.run(Z),n.run(Bv),R(so(Zo.Provider,{value:n,children:so(Fg,{})}),t)}(e,Fv)})).catch((e=>function(e,t){console.error("Failed to start Hypothesis client: ",e),R(so(jg,{error:e}),t)}(e,Fv)));
|