hypothesis 1.1722.0 → 1.1724.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-template.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";var s={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?
|
|
1
|
+
!function(){"use strict";var s={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?dbf181","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?a8ba5d","styles/annotator.css":"styles/annotator.css?62a3c0","styles/highlights.css":"styles/highlights.css?ef86d1","styles/annotator.css.map":"styles/annotator.css.map?2a66f1","styles/highlights.css.map":"styles/highlights.css.map?6ce8dd","styles/katex.min.css":"styles/katex.min.css?e31f39","styles/katex.min.css.map":"styles/katex.min.css.map?0511b4","styles/pdfjs-overrides.css":"styles/pdfjs-overrides.css?d58df4","styles/pdfjs-overrides.css.map":"styles/pdfjs-overrides.css.map?5a12c5","styles/sidebar.css":"styles/sidebar.css?aac3b6","styles/sidebar.css.map":"styles/sidebar.css.map?fdf923","styles/ui-playground.css":"styles/ui-playground.css?e93149","styles/ui-playground.css.map":"styles/ui-playground.css.map?c01a36","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?ea08c1","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?5713b6","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?a9e548","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?d2efbc"};function e(s){s.setAttribute("data-hypothesis-asset","")}function t(s,t){var r=s.createElement("link");r.rel="stylesheet",r.type="text/css",r.href=t,e(r),s.head.appendChild(r)}function r(s,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=r.esModule,n=void 0===o||o,i=r.forceReload,a=void 0!==i&&i,l=s.createElement("script");n&&(l.type="module"),a&&(t+="#ts=".concat(Date.now())),l.src=t,l.async=!1,e(l),s.head.appendChild(l)}function o(s,t,r,o){var n=s.createElement("link");n.rel=t,n.href=o,n.type="application/annotator+".concat(r),e(n),s.head.appendChild(n)}function n(s,t,r){var o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).crossOrigin,n=s.createElement("link");n.rel="preload",n.as=t,n.href=r,(o||"fetch"===t)&&(n.crossOrigin="anonymous",n.removeAttribute=()=>{}),e(n),s.head.appendChild(n)}function i(s,e){return s.assetRoot+"build/"+s.manifest[e]}function a(s){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(-1===s.indexOf("{"))return s;var t=function(){var s,e,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:document).currentScript;return t?(s=t.src,(e=s.match(/(https?):\/\/([^:/]+)/))?{protocol:e[1],hostname:e[2]}:null):null}(e);if(!t)throw new Error("Could not process URL template because script origin is unknown");return s=(s=s.replace("{current_host}",t.hostname)).replace("{current_scheme}",t.protocol)}if(function(){var s=[()=>Object.fromEntries([]),()=>new URL(document.location.href),()=>new Request("https://hypothes.is"),()=>Element.prototype.attachShadow,()=>CSS.supports("display: grid"),()=>(document.evaluate("/html/body",document,null,XPathResult.ANY_TYPE,null),!0)];try{return s.every((s=>s()))}catch(s){return!1}}()){var l=function(s){for(var e={},t=s.querySelectorAll("script.js-hypothesis-config"),r=0;r<t.length;r++){var o=void 0;try{o=JSON.parse(t[r].textContent||"")}catch(s){console.warn("Could not parse settings from js-hypothesis-config tags",s),o={}}Object.assign(e,o)}return e}(document),c=a(l.assetRoot||"__ASSET_ROOT__");if(document.querySelector("hypothesis-app")){!function(s,e){n(s,"fetch",e.apiUrl),n(s,"fetch",e.apiUrl+"links");for(var o=0,a=["scripts/sidebar.bundle.js"];o<a.length;o++)r(s,i(e,a[o]),{esModule:!0});for(var l=0,c=["styles/katex.min.css","styles/sidebar.css"];l<c.length;l++)t(s,i(e,c[l]))}(document,{assetRoot:c,manifest:s,apiUrl:l.apiUrl})}else{var p=function(){var s;return null===(s=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).chrome)||void 0===s||null===(s=s.runtime)||void 0===s?void 0:s.id}();if(p&&!function(s){return!!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:document).querySelector("script.js-hypothesis-config[data-extension-id=".concat(s,"]"))}(p))throw new Error("Could not start Hypothesis extension as configuration is missing");var d=l,u=a(d.notebookAppUrl||"__NOTEBOOK_APP_URL__"),h=a(d.profileAppUrl||"__PROFILE_APP_URL__"),y=a(d.sidebarAppUrl||"__SIDEBAR_APP_URL__");!function(s,e){if(!s.querySelector('link[type="application/annotator+html"]')){o(s,"sidebar","html",e.sidebarAppUrl),o(s,"notebook","html",e.notebookAppUrl),o(s,"profile","html",e.profileAppUrl),n(s,"style",i(e,"styles/annotator.css"),{crossOrigin:!0}),o(s,"hypothesis-client","javascript",e.assetRoot+"build/boot.js");for(var a=0,l=["scripts/annotator.bundle.js"];a<l.length;a++)r(s,i(e,l[a]),{esModule:!1});var c=[];void 0!==window.PDFViewerApplication&&c.push("styles/pdfjs-overrides.css"),c.push("styles/highlights.css");for(var p=0,d=c;p<d.length;p++)t(s,i(e,d[p]))}}(document,{assetRoot:c,manifest:s,notebookAppUrl:u,profileAppUrl:h,sidebarAppUrl:y})}}else console.warn("The Hypothesis annotation tool is not supported in this browser. See https://web.hypothes.is/help/which-browsers-are-supported-by-hypothesis/.")}();
|
package/build/boot.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";var s={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?
|
|
1
|
+
!function(){"use strict";var s={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?dbf181","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?a8ba5d","styles/annotator.css":"styles/annotator.css?62a3c0","styles/highlights.css":"styles/highlights.css?ef86d1","styles/annotator.css.map":"styles/annotator.css.map?2a66f1","styles/highlights.css.map":"styles/highlights.css.map?6ce8dd","styles/katex.min.css":"styles/katex.min.css?e31f39","styles/katex.min.css.map":"styles/katex.min.css.map?0511b4","styles/pdfjs-overrides.css":"styles/pdfjs-overrides.css?d58df4","styles/pdfjs-overrides.css.map":"styles/pdfjs-overrides.css.map?5a12c5","styles/sidebar.css":"styles/sidebar.css?aac3b6","styles/sidebar.css.map":"styles/sidebar.css.map?fdf923","styles/ui-playground.css":"styles/ui-playground.css?e93149","styles/ui-playground.css.map":"styles/ui-playground.css.map?c01a36","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?ea08c1","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?5713b6","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?a9e548","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?d2efbc"};function e(s){s.setAttribute("data-hypothesis-asset","")}function t(s,t){var r=s.createElement("link");r.rel="stylesheet",r.type="text/css",r.href=t,e(r),s.head.appendChild(r)}function r(s,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=r.esModule,n=void 0===o||o,i=r.forceReload,a=void 0!==i&&i,l=s.createElement("script");n&&(l.type="module"),a&&(t+="#ts=".concat(Date.now())),l.src=t,l.async=!1,e(l),s.head.appendChild(l)}function o(s,t,r,o){var n=s.createElement("link");n.rel=t,n.href=o,n.type="application/annotator+".concat(r),e(n),s.head.appendChild(n)}function n(s,t,r){var o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).crossOrigin,n=s.createElement("link");n.rel="preload",n.as=t,n.href=r,(o||"fetch"===t)&&(n.crossOrigin="anonymous",n.removeAttribute=()=>{}),e(n),s.head.appendChild(n)}function i(s,e){return s.assetRoot+"build/"+s.manifest[e]}function a(s){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(-1===s.indexOf("{"))return s;var t=function(){var s,e,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:document).currentScript;return t?(s=t.src,(e=s.match(/(https?):\/\/([^:/]+)/))?{protocol:e[1],hostname:e[2]}:null):null}(e);if(!t)throw new Error("Could not process URL template because script origin is unknown");return s=(s=s.replace("{current_host}",t.hostname)).replace("{current_scheme}",t.protocol)}if(function(){var s=[()=>Object.fromEntries([]),()=>new URL(document.location.href),()=>new Request("https://hypothes.is"),()=>Element.prototype.attachShadow,()=>CSS.supports("display: grid"),()=>(document.evaluate("/html/body",document,null,XPathResult.ANY_TYPE,null),!0)];try{return s.every((s=>s()))}catch(s){return!1}}()){var l=function(s){for(var e={},t=s.querySelectorAll("script.js-hypothesis-config"),r=0;r<t.length;r++){var o=void 0;try{o=JSON.parse(t[r].textContent||"")}catch(s){console.warn("Could not parse settings from js-hypothesis-config tags",s),o={}}Object.assign(e,o)}return e}(document),c=a(l.assetRoot||"https://cdn.hypothes.is/hypothesis/1.1724.0/");if(document.querySelector("hypothesis-app")){!function(s,e){n(s,"fetch",e.apiUrl),n(s,"fetch",e.apiUrl+"links");for(var o=0,a=["scripts/sidebar.bundle.js"];o<a.length;o++)r(s,i(e,a[o]),{esModule:!0});for(var l=0,c=["styles/katex.min.css","styles/sidebar.css"];l<c.length;l++)t(s,i(e,c[l]))}(document,{assetRoot:c,manifest:s,apiUrl:l.apiUrl})}else{var p=function(){var s;return null===(s=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).chrome)||void 0===s||null===(s=s.runtime)||void 0===s?void 0:s.id}();if(p&&!function(s){return!!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:document).querySelector("script.js-hypothesis-config[data-extension-id=".concat(s,"]"))}(p))throw new Error("Could not start Hypothesis extension as configuration is missing");var d=l,u=a(d.notebookAppUrl||"https://hypothes.is/notebook"),h=a(d.profileAppUrl||"https://hypothes.is/user-profile"),y=a(d.sidebarAppUrl||"https://hypothes.is/app.html");!function(s,e){if(!s.querySelector('link[type="application/annotator+html"]')){o(s,"sidebar","html",e.sidebarAppUrl),o(s,"notebook","html",e.notebookAppUrl),o(s,"profile","html",e.profileAppUrl),n(s,"style",i(e,"styles/annotator.css"),{crossOrigin:!0}),o(s,"hypothesis-client","javascript",e.assetRoot+"build/boot.js");for(var a=0,l=["scripts/annotator.bundle.js"];a<l.length;a++)r(s,i(e,l[a]),{esModule:!1});var c=[];void 0!==window.PDFViewerApplication&&c.push("styles/pdfjs-overrides.css"),c.push("styles/highlights.css");for(var p=0,d=c;p<d.length;p++)t(s,i(e,d[p]))}}(document,{assetRoot:c,manifest:s,notebookAppUrl:u,profileAppUrl:h,sidebarAppUrl:y})}}else console.warn("The Hypothesis annotation tool is not supported in this browser. See https://web.hypothes.is/help/which-browsers-are-supported-by-hypothesis/.")}();
|
package/build/manifest.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"scripts/annotator.bundle.js": "scripts/annotator.bundle.js?
|
|
2
|
+
"scripts/annotator.bundle.js": "scripts/annotator.bundle.js?dbf181",
|
|
3
3
|
"scripts/ui-playground.bundle.js": "scripts/ui-playground.bundle.js?a8ba5d",
|
|
4
4
|
"styles/annotator.css": "styles/annotator.css?62a3c0",
|
|
5
|
-
"styles/annotator.css.map": "styles/annotator.css.map?2a66f1",
|
|
6
5
|
"styles/highlights.css": "styles/highlights.css?ef86d1",
|
|
6
|
+
"styles/annotator.css.map": "styles/annotator.css.map?2a66f1",
|
|
7
7
|
"styles/highlights.css.map": "styles/highlights.css.map?6ce8dd",
|
|
8
8
|
"styles/katex.min.css": "styles/katex.min.css?e31f39",
|
|
9
9
|
"styles/katex.min.css.map": "styles/katex.min.css.map?0511b4",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"styles/ui-playground.css": "styles/ui-playground.css?e93149",
|
|
15
15
|
"styles/ui-playground.css.map": "styles/ui-playground.css.map?c01a36",
|
|
16
16
|
"scripts/annotator.bundle.js.map": "scripts/annotator.bundle.js.map?ea08c1",
|
|
17
|
-
"scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?
|
|
17
|
+
"scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?5713b6",
|
|
18
18
|
"scripts/ui-playground.bundle.js.map": "scripts/ui-playground.bundle.js.map?a9e548",
|
|
19
|
-
"scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?
|
|
19
|
+
"scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?d2efbc"
|
|
20
20
|
}
|
|
@@ -149,7 +149,7 @@ this._contentReady&&(await this._contentReady,this._contentReady=void 0);const t
|
|
|
149
149
|
this._updateAnchors(this.anchors.concat(n),!0),this._sidebarRPC.call("syncAnchoringStatus",e),n}detach(e,t=!0){this._annotations.delete(e);const n=[];for(const t of this.anchors)t.annotation.$tag!==e?n.push(t):t.highlights&&this._highlighter.removeHighlights(t.highlights);this._updateAnchors(n,t)}_updateAnchors(e,t){this.anchors=e,this._clusterToolbar?.scheduleClusterUpdates(),t&&this._bucketBarClient.update(this.anchors)}async createAnnotation(e){if("selection"===e)return this.createAnnotationFromSelection();if(!["rect","point"].includes(e))throw new Error("Unsupported annotation tool");{let t=!1;try{this._hostRPC.call("activeToolChanged",e);const t=await this._drawTool.draw(e),n=await this.getDocumentInfo(),o=[{source:n.uri,selector:await this._integration.describe(this.element,t)}],i={uri:n.uri,document:n.metadata,target:o,$tag:"a:"+Ct(8)};return this._sidebarRPC.call("createAnnotation",i),this.anchor(i),i}catch(e){if(e instanceof oo&&["canceled","restarted"].includes(e.kind))return t="restarted"===e.kind,
|
|
150
150
|
null;throw e}finally{t||this._hostRPC.call("activeToolChanged",null)}}}async createAnnotationFromSelection({highlight:e=!1}={}){const t=this.selectedRanges;this.selectedRanges=[];const n=await this.getDocumentInfo(),o=this.element,i=(await Promise.all(t.map((e=>this._integration.describe(o,e))))).map((e=>({source:n.uri,selector:e}))),r={uri:n.uri,document:n.metadata,target:i,$highlight:e,$cluster:e?"user-highlights":"user-annotations",$tag:"a:"+Ct(8)};return this._sidebarRPC.call("createAnnotation",r),this.anchor(r),ir(),r}_hoverAnnotations(e){this._hoveredAnnotations.clear(),e.forEach((e=>this._hoveredAnnotations.add(e)));for(const t of this.anchors)if(t.highlights){const n=e.includes(t.annotation.$tag);this._highlighter.setHighlightsFocused(t.highlights,n)}this._sidebarRPC.call("hoverAnnotations",e)}_onSelection(e){const t=this._integration.getAnnotatableRange(e);if(!t)return void this._onClearSelection();const n=document.getSelection(),o=Hn(n),i=Un(n);i?(this.selectedRanges=[t],
|
|
151
151
|
this._hostRPC.call("textSelected"),this._commentsMode||(this._adder.annotationsForSelection=tr(),this._isAdderVisible=!0,this._adder.show(i,o))):this._onClearSelection()}_onClearSelection(){this._isAdderVisible=!1,this._adder.hide(),this.selectedRanges=[],this._informHostOnNextSelectionClear&&this._hostRPC.call("textUnselected"),this._informHostOnNextSelectionClear=!0}selectAnnotations(e,{toggle:t=!1,focusInSidebar:n=!1}={}){t?this._sidebarRPC.call("toggleAnnotationSelection",e):this._sidebarRPC.call("showAnnotations",e,n),this._sidebarRPC.call("openSidebar")}setHighlightsVisible(e,t=!0){this._highlighter.setHighlightsVisible(e),this._highlightsVisible=e,t&&this._hostRPC.call("highlightsVisibleChanged",e)}get highlightsVisible(){return this._highlightsVisible}fitSideBySide(e){this._sidebarLayout=e,this._integration.fitSideBySide(e)}get hoveredAnnotationTags(){return this._hoveredAnnotations}_handleShortcut(e){dn(e,"Ctrl+Shift+H")&&this.setHighlightsVisible(!this._highlightsVisible&&!this._commentsMode)}
|
|
152
|
-
_setOutsideAssignmentNoticeVisible(e){this._outsideAssignmentNotice||(this._outsideAssignmentNotice=new Ji(this.element)),this._outsideAssignmentNotice.setVisible(e)}}function ar(e,t){const n=new URL(e),o=new URLSearchParams;return o.append("config",JSON.stringify(t)),n.hash=o.toString(),n.toString()}function lr(e,t){const n={};for(const[e,o]of Object.entries(t))"notebookAppUrl"!==e&&"sidebarAppUrl"!==e&&null!=o&&(n[e]=o);n.origin=new URL(e).origin,n.version="1.
|
|
152
|
+
_setOutsideAssignmentNoticeVisible(e){this._outsideAssignmentNotice||(this._outsideAssignmentNotice=new Ji(this.element)),this._outsideAssignmentNotice.setVisible(e)}}function ar(e,t){const n=new URL(e),o=new URLSearchParams;return o.append("config",JSON.stringify(t)),n.hash=o.toString(),n.toString()}function lr(e,t){const n={};for(const[e,o]of Object.entries(t))"notebookAppUrl"!==e&&"sidebarAppUrl"!==e&&null!=o&&(n[e]=o);n.origin=new URL(e).origin,n.version="1.1724.0";const o=new URL(window.location.href);if(o.hash="",n.hostURL=o.toString(),Array.isArray(n.services)&&n.services?.length>0){const e=n.services[0];e.onLoginRequest&&(e.onLoginRequestProvided=!0),e.onLogoutRequest&&(e.onLogoutRequestProvided=!0),e.onSignupRequest&&(e.onSignupRequestProvided=!0),e.onProfileRequest&&(e.onProfileRequestProvided=!0),e.onHelpRequest&&(e.onHelpRequestProvided=!0)}return n}function cr({closed:e,onClose:t,children:n,"data-testid":o,"aria-label":i}){const r=ie(null);return ne((()=>{
|
|
153
153
|
e?r.current?.close():r.current?.showModal()}),[e]),ne((()=>{const e=r.current;return e?.addEventListener("cancel",t),()=>{e?.removeEventListener("cancel",t)}}),[t]),Se("dialog",{ref:r,className:"relative m-5 w-full h-full backdrop:bg-black/50","data-testid":o,"aria-label":i,children:n})}function hr({closed:e,children:t,...n}){return Se("div",{...n,className:Ne("fixed z-max top-0 left-0 right-0 bottom-0 p-3 bg-black/50",{hidden:e}),children:Se("div",{className:"relative w-full h-full",children:t})})}function dr({document_:e=document,...t}){return Se(re((()=>function(e){return"function"==typeof e.createElement("dialog").showModal}(e)?cr:hr),[e]),{...t})}function ur({config:e,groupId:t}){return Se("iframe",{title:"Hypothesis annotation notebook",className:"h-full w-full border-0",allow:"fullscreen; clipboard-write",src:ar(e.notebookAppUrl,{...lr(e.notebookAppUrl,e),group:t})})}function fr({eventBus:e,config:t}){const[n,o]=te(0),[i,r]=te(!0),[s,a]=te(null),l=ie(""),c=ie(null)
|
|
154
154
|
;ne((()=>(l.current=document.body.style.overflow,()=>{document.body.style.overflow=l.current})),[]),ne((()=>{document.body.style.overflow=i?l.current:"hidden"}),[i]),ne((()=>{const t=e.createEmitter();return t.subscribe("openNotebook",(e=>{r(!1),o((e=>e+1)),a(e)})),c.current=t,()=>{t.destroy()}}),[e]);const h=se((()=>{r(!0),c.current?.publish("closeNotebook")}),[]);return null===s?null:Se(dr,{closed:i,onClose:h,"data-testid":"notebook-outer","aria-label":"Hypothesis notebook",children:[Se("div",{className:"absolute right-0 m-3",children:Se(ot,{title:"Close notebook",onClick:h,variant:"dark",classes:Ne("!bg-transparent enabled:hover:!bg-grey-3"),"data-testid":"close-button",children:Se(Le,{className:"w-4 h-4"})})}),Se(ur,{config:t,groupId:s},n)]})}class pr{constructor(e,t,n){this._container=new vn("notebook",(()=>Se(fr,{eventBus:t,config:n}))),e.append(this._container.element),this._container.render()}destroy(){this._container.destroy()}}function gr({eventBus:e,config:t}){const[n,o]=te(!0),i=ie(null);ne((()=>{
|
|
155
155
|
const t=e.createEmitter();return t.subscribe("openProfile",(()=>{o(!1)})),i.current=t,()=>{t.destroy()}}),[e]);const r=()=>{o(!0),i.current?.publish("closeProfile")};return n?null:Se(dr,{closed:n,onClose:r,"data-testid":"profile-outer","aria-label":"Hypothesis profile",children:[Se("div",{className:"absolute right-0 m-3",children:Se(ot,{title:"Close profile dialog",onClick:r,variant:"dark",classes:Ne("!bg-transparent enabled:hover:!bg-grey-3"),children:Se(Le,{className:"w-4 h-4"})})}),Se("iframe",{title:"Hypothesis profile",className:"h-full w-full border-0",src:t.profileAppUrl})]})}class _r{constructor(e,t,n){this._container=new vn("profile",(()=>Se(gr,{eventBus:t,config:n}))),e.append(this._container.element),this._container.render()}destroy(){this._container.destroy()}}function mr({above:e,below:t,buckets:n,onFocusAnnotations:o,onScrollToAnnotation:i,onSelectAnnotations:r}){const s=e.anchors.length>0,a=t.anchors.length>0,l=e=>e.anchors.map((e=>e.tag));return Se("ul",{className:"relative",
|
|
@@ -160,21 +160,21 @@ d:"M6.956.068a8 8 0 0 1 2.088 0 .889.889 0 1 1-.23 1.762 6.3 6.3 0 0 0-1.628 0 .
|
|
|
160
160
|
},APPROVED:{label:"Approved",icon:function(e){return Ve("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16","aria-hidden":"true",viewBox:"0 0 16 16","data-component":"CheckAllIcon",...e,children:Ve("g",{"fill-rule":"evenodd",children:[Ve("path",{fill:"none",d:"M0 0h16v16H0z"}),Ve("path",{fill:"currentColor",d:"M15.58 2.332a1 1 0 0 1 .235 1.394l-7 9.853a1 1 0 0 1-1.672-.065l-3-5a1 1 0 1 1 1.714-1.028l2.214 3.688 6.114-8.606a1 1 0 0 1 1.394-.236M.486 7.143a1 1 0 0 1 1.371.343l3 5a1 1 0 1 1-1.715 1.028l-3-5a1 1 0 0 1 .344-1.371"}),Ve("path",{fill:"currentColor",d:"M11.6 2.2a1 1 0 0 1 .2 1.4l-3 4a1 1 0 1 1-1.6-1.2l3-4a1 1 0 0 1 1.4-.2"})]})})}},DENIED:{label:"Declined",icon:on},SPAM:{label:"Spam",icon:pt}};Object.freeze(Da);const{entries:ja,setPrototypeOf:Ha,isFrozen:Fa,getPrototypeOf:$a,getOwnPropertyDescriptor:Ba}=Object;let{freeze:qa,seal:Ua,create:Ga}=Object,{apply:Va,construct:Wa}="undefined"!=typeof Reflect&&Reflect;qa||(qa=function(e){return e}),Ua||(Ua=function(e){return e}),
|
|
161
161
|
Va||(Va=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return e.apply(t,r)}),Wa||(Wa=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)});const Ka=cs(Array.prototype.forEach),Ya=cs(Array.prototype.lastIndexOf),Xa=cs(Array.prototype.pop),Za=cs(Array.prototype.push),Qa=cs(Array.prototype.splice),Ja=cs(String.prototype.toLowerCase),es=cs(String.prototype.toString),ts=cs(String.prototype.match),ns=cs(String.prototype.replace),rs=cs(String.prototype.indexOf),os=cs(String.prototype.trim),is=cs(Object.prototype.hasOwnProperty),as=cs(RegExp.prototype.test),ss=(ls=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Wa(ls,t)});var ls;function cs(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return Va(e,t,r)}}function us(e,t){
|
|
162
162
|
let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ja;Ha&&Ha(e,null);let r=t.length;for(;r--;){let o=t[r];if("string"==typeof o){const e=n(o);e!==o&&(Fa(t)||(t[r]=e),o=e)}e[o]=!0}return e}function ds(e){for(let t=0;t<e.length;t++){is(e,t)||(e[t]=null)}return e}function hs(e){const t=Ga(null);for(const[n,r]of ja(e)){is(e,n)&&(Array.isArray(r)?t[n]=ds(r):r&&"object"==typeof r&&r.constructor===Object?t[n]=hs(r):t[n]=r)}return t}function ps(e,t){for(;null!==e;){const n=Ba(e,t);if(n){if(n.get)return cs(n.get);if("function"==typeof n.value)return cs(n.value)}e=$a(e)}return function(){return null}}
|
|
163
|
-
const ms=qa(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),fs=qa(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","
|
|
164
|
-
;var Ps=Object.freeze({__proto__:null,ARIA_ATTR:Ms,ATTR_WHITESPACE:Os,CUSTOM_ELEMENT:Ls,DATA_ATTR:Cs,DOCTYPE_NAME:zs,ERB_EXPR:Ts,IS_ALLOWED_URI:Ns,IS_SCRIPT_OR_DATA:Is,MUSTACHE_EXPR:As,TMPLIT_EXPR:Es});const Rs=1,Ds=3,js=7,Hs=8,Fs=9,$s=function(){return"undefined"==typeof window?null:window};var Bs,qs,Us=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$s();const n=t=>e(t);if(n.version="3.
|
|
165
|
-
;const{implementation:k,createNodeIterator:S,createDocumentFragment:A,getElementsByTagName:T}=r,{importNode:E}=o;let C={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof ja&&"function"==typeof _&&k&&void 0!==k.createHTMLDocument;const{MUSTACHE_EXPR:M,ERB_EXPR:N,TMPLIT_EXPR:I,DATA_ATTR:O,ARIA_ATTR:z,IS_SCRIPT_OR_DATA:L,ATTR_WHITESPACE:P,CUSTOM_ELEMENT:R}=Ps;let{IS_ALLOWED_URI:D}=Ps,j=null;const H=us({},[...ms,...fs,...gs,...bs,..._s]);let F=null;const $=us({},[...ws,...xs,...ks,...Ss]);let B=Object.seal(Ga(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}
|
|
166
|
-
|
|
167
|
-
return e instanceof RegExp||e instanceof Function},
|
|
168
|
-
te=e.
|
|
169
|
-
e.ADD_TAGS&&(j===H&&(j=hs(j)),us(j,e.ADD_TAGS,
|
|
170
|
-
return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(m,i)),null!==w&&"string"==typeof x&&(x=w.createHTML(""));qa&&qa(e),
|
|
171
|
-
;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),ve
|
|
172
|
-
!0;if(e.nodeType===js)return
|
|
173
|
-
;return!!
|
|
174
|
-
if(!(
|
|
175
|
-
r.forceKeepAttr=void 0,
|
|
176
|
-
let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,s=null,c=null;if(
|
|
177
|
-
;return(F.shadowroot||F.shadowrootmode)&&(c=E.call(o,c,!0)),c}let d=
|
|
163
|
+
const ms=qa(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),fs=qa(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),gs=qa(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),vs=qa(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),bs=qa(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),ys=qa(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),_s=qa(["#text"]),ws=qa(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),xs=qa(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ks=qa(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ss=qa(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),As=Ua(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ts=Ua(/<%[\w\W]*|[\w\W]*%>/gm),Es=Ua(/\$\{[\w\W]*/gm),Cs=Ua(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ms=Ua(/^aria-[\-\w]+$/),Ns=Ua(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Is=Ua(/^(?:\w+script|data):/i),Os=Ua(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),zs=Ua(/^html$/i),Ls=Ua(/^[a-z][.\w]*(-[.\w]+)+$/i)
|
|
164
|
+
;var Ps=Object.freeze({__proto__:null,ARIA_ATTR:Ms,ATTR_WHITESPACE:Os,CUSTOM_ELEMENT:Ls,DATA_ATTR:Cs,DOCTYPE_NAME:zs,ERB_EXPR:Ts,IS_ALLOWED_URI:Ns,IS_SCRIPT_OR_DATA:Is,MUSTACHE_EXPR:As,TMPLIT_EXPR:Es});const Rs=1,Ds=3,js=7,Hs=8,Fs=9,$s=function(){return"undefined"==typeof window?null:window};var Bs,qs,Us=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$s();const n=t=>e(t);if(n.version="3.3.0",n.removed=[],!t||!t.document||t.document.nodeType!==Fs||!t.Element)return n.isSupported=!1,n;let{document:r}=t;const o=r,i=o.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:l,Element:c,NodeFilter:u,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:h,DOMParser:p,trustedTypes:m}=t,f=c.prototype,g=ps(f,"cloneNode"),v=ps(f,"remove"),b=ps(f,"nextSibling"),y=ps(f,"childNodes"),_=ps(f,"parentNode");if("function"==typeof s){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let w,x=""
|
|
165
|
+
;const{implementation:k,createNodeIterator:S,createDocumentFragment:A,getElementsByTagName:T}=r,{importNode:E}=o;let C={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof ja&&"function"==typeof _&&k&&void 0!==k.createHTMLDocument;const{MUSTACHE_EXPR:M,ERB_EXPR:N,TMPLIT_EXPR:I,DATA_ATTR:O,ARIA_ATTR:z,IS_SCRIPT_OR_DATA:L,ATTR_WHITESPACE:P,CUSTOM_ELEMENT:R}=Ps;let{IS_ALLOWED_URI:D}=Ps,j=null;const H=us({},[...ms,...fs,...gs,...bs,..._s]);let F=null;const $=us({},[...ws,...xs,...ks,...Ss]);let B=Object.seal(Ga(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),q=null,U=null;const G=Object.seal(Ga(null,{tagCheck:{
|
|
166
|
+
writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let V=!0,W=!0,K=!1,Y=!0,X=!1,Z=!0,Q=!1,J=!1,ee=!1,te=!1,ne=!1,re=!1,oe=!0,ie=!1,ae=!0,se=!1,le={},ce=null;const ue=us({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let de=null;const he=us({},["audio","video","img","source","image","track"]);let pe=null;const me=us({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),fe="http://www.w3.org/1998/Math/MathML",ge="http://www.w3.org/2000/svg",ve="http://www.w3.org/1999/xhtml";let be=ve,ye=!1,_e=null;const we=us({},[fe,ge,ve],es);let xe=us({},["mi","mo","mn","ms","mtext"]),ke=us({},["annotation-xml"]);const Se=us({},["title","style","font","a","script"]);let Ae=null
|
|
167
|
+
;const Te=["application/xhtml+xml","text/html"];let Ee=null,Ce=null;const Me=r.createElement("form"),Ne=function(e){return e instanceof RegExp||e instanceof Function},Ie=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Ce||Ce!==e){if(e&&"object"==typeof e||(e={}),e=hs(e),Ae=-1===Te.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Ee="application/xhtml+xml"===Ae?es:Ja,j=is(e,"ALLOWED_TAGS")?us({},e.ALLOWED_TAGS,Ee):H,F=is(e,"ALLOWED_ATTR")?us({},e.ALLOWED_ATTR,Ee):$,_e=is(e,"ALLOWED_NAMESPACES")?us({},e.ALLOWED_NAMESPACES,es):we,pe=is(e,"ADD_URI_SAFE_ATTR")?us(hs(me),e.ADD_URI_SAFE_ATTR,Ee):me,de=is(e,"ADD_DATA_URI_TAGS")?us(hs(he),e.ADD_DATA_URI_TAGS,Ee):he,ce=is(e,"FORBID_CONTENTS")?us({},e.FORBID_CONTENTS,Ee):ue,q=is(e,"FORBID_TAGS")?us({},e.FORBID_TAGS,Ee):hs({}),U=is(e,"FORBID_ATTR")?us({},e.FORBID_ATTR,Ee):hs({}),le=!!is(e,"USE_PROFILES")&&e.USE_PROFILES,V=!1!==e.ALLOW_ARIA_ATTR,W=!1!==e.ALLOW_DATA_ATTR,K=e.ALLOW_UNKNOWN_PROTOCOLS||!1,
|
|
168
|
+
Y=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,X=e.SAFE_FOR_TEMPLATES||!1,Z=!1!==e.SAFE_FOR_XML,Q=e.WHOLE_DOCUMENT||!1,te=e.RETURN_DOM||!1,ne=e.RETURN_DOM_FRAGMENT||!1,re=e.RETURN_TRUSTED_TYPE||!1,ee=e.FORCE_BODY||!1,oe=!1!==e.SANITIZE_DOM,ie=e.SANITIZE_NAMED_PROPS||!1,ae=!1!==e.KEEP_CONTENT,se=e.IN_PLACE||!1,D=e.ALLOWED_URI_REGEXP||Ns,be=e.NAMESPACE||ve,xe=e.MATHML_TEXT_INTEGRATION_POINTS||xe,ke=e.HTML_INTEGRATION_POINTS||ke,B=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Ne(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(B.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Ne(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(B.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(B.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),X&&(W=!1),ne&&(te=!0),le&&(j=us({},_s),F=[],!0===le.html&&(us(j,ms),us(F,ws)),!0===le.svg&&(us(j,fs),
|
|
169
|
+
us(F,xs),us(F,Ss)),!0===le.svgFilters&&(us(j,gs),us(F,xs),us(F,Ss)),!0===le.mathMl&&(us(j,bs),us(F,ks),us(F,Ss))),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?G.tagCheck=e.ADD_TAGS:(j===H&&(j=hs(j)),us(j,e.ADD_TAGS,Ee))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?G.attributeCheck=e.ADD_ATTR:(F===$&&(F=hs(F)),us(F,e.ADD_ATTR,Ee))),e.ADD_URI_SAFE_ATTR&&us(pe,e.ADD_URI_SAFE_ATTR,Ee),e.FORBID_CONTENTS&&(ce===ue&&(ce=hs(ce)),us(ce,e.FORBID_CONTENTS,Ee)),ae&&(j["#text"]=!0),Q&&us(j,["html","head","body"]),j.table&&(us(j,["tbody"]),delete q.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw ss('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw ss('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=e.TRUSTED_TYPES_POLICY,x=w.createHTML("")}else void 0===w&&(w=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null
|
|
170
|
+
;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(m,i)),null!==w&&"string"==typeof x&&(x=w.createHTML(""));qa&&qa(e),Ce=e}},Oe=us({},[...fs,...gs,...vs]),ze=us({},[...bs,...ys]),Le=function(e){Za(n.removed,{element:e});try{_(e).removeChild(e)}catch(t){v(e)}},Pe=function(e,t){try{Za(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){Za(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(te||ne)try{Le(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Re=function(e){let t=null,n=null;if(ee)e="<remove></remove>"+e;else{const t=ts(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Ae&&be===ve&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=w?w.createHTML(e):e;if(be===ve)try{t=(new p).parseFromString(o,Ae)}catch(e){}
|
|
171
|
+
if(!t||!t.documentElement){t=k.createDocument(be,"template",null);try{t.documentElement.innerHTML=ye?x:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),be===ve?T.call(t,Q?"html":"body")[0]:Q?t.documentElement:i},De=function(e){return S.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},je=function(e){return e instanceof h&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof d)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},He=function(e){return"function"==typeof l&&e instanceof l};function Fe(e,t,r){Ka(e,(e=>{e.call(n,t,r,Ce)}))}const $e=function(e){let t=null;if(Fe(C.beforeSanitizeElements,e,null),je(e))return Le(e),!0;const r=Ee(e.nodeName)
|
|
172
|
+
;if(Fe(C.uponSanitizeElement,e,{tagName:r,allowedTags:j}),Z&&e.hasChildNodes()&&!He(e.firstElementChild)&&as(/<[/\w!]/g,e.innerHTML)&&as(/<[/\w!]/g,e.textContent))return Le(e),!0;if(e.nodeType===js)return Le(e),!0;if(Z&&e.nodeType===Hs&&as(/<[/\w]/g,e.data))return Le(e),!0;if(!(G.tagCheck instanceof Function&&G.tagCheck(r))&&(!j[r]||q[r])){if(!q[r]&&qe(r)){if(B.tagNameCheck instanceof RegExp&&as(B.tagNameCheck,r))return!1;if(B.tagNameCheck instanceof Function&&B.tagNameCheck(r))return!1}if(ae&&!ce[r]){const t=_(e)||e.parentNode,n=y(e)||e.childNodes;if(n&&t){for(let r=n.length-1;r>=0;--r){const o=g(n[r],!0);o.__removalCount=(e.__removalCount||0)+1,t.insertBefore(o,b(e))}}}return Le(e),!0}return e instanceof c&&!function(e){let t=_(e);t&&t.tagName||(t={namespaceURI:be,tagName:"template"});const n=Ja(e.tagName),r=Ja(t.tagName)
|
|
173
|
+
;return!!_e[e.namespaceURI]&&(e.namespaceURI===ge?t.namespaceURI===ve?"svg"===n:t.namespaceURI===fe?"svg"===n&&("annotation-xml"===r||xe[r]):Boolean(Oe[n]):e.namespaceURI===fe?t.namespaceURI===ve?"math"===n:t.namespaceURI===ge?"math"===n&&ke[r]:Boolean(ze[n]):e.namespaceURI===ve?!(t.namespaceURI===ge&&!ke[r])&&!(t.namespaceURI===fe&&!xe[r])&&!ze[n]&&(Se[n]||!Oe[n]):!("application/xhtml+xml"!==Ae||!_e[e.namespaceURI]))}(e)?(Le(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!as(/<\/no(script|embed|frames)/i,e.innerHTML)?(X&&e.nodeType===Ds&&(t=e.textContent,Ka([M,N,I],(e=>{t=ns(t,e," ")})),e.textContent!==t&&(Za(n.removed,{element:e.cloneNode()}),e.textContent=t)),Fe(C.afterSanitizeElements,e,null),!1):(Le(e),!0)},Be=function(e,t,n){if(oe&&("id"===t||"name"===t)&&(n in r||n in Me))return!1;if(W&&!U[t]&&as(O,t));else if(V&&as(z,t));else if(G.attributeCheck instanceof Function&&G.attributeCheck(t,e));else if(!F[t]||U[t]){
|
|
174
|
+
if(!(qe(e)&&(B.tagNameCheck instanceof RegExp&&as(B.tagNameCheck,e)||B.tagNameCheck instanceof Function&&B.tagNameCheck(e))&&(B.attributeNameCheck instanceof RegExp&&as(B.attributeNameCheck,t)||B.attributeNameCheck instanceof Function&&B.attributeNameCheck(t,e))||"is"===t&&B.allowCustomizedBuiltInElements&&(B.tagNameCheck instanceof RegExp&&as(B.tagNameCheck,n)||B.tagNameCheck instanceof Function&&B.tagNameCheck(n))))return!1}else if(pe[t]);else if(as(D,ns(n,P,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==rs(n,"data:")||!de[e]){if(K&&!as(L,ns(n,P,"")));else if(n)return!1}else;return!0},qe=function(e){return"annotation-xml"!==e&&ts(e,R)},Ue=function(e){Fe(C.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||je(e))return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:F,forceKeepAttr:void 0};let o=t.length;for(;o--;){const i=t[o],{name:a,namespaceURI:s,value:l}=i,c=Ee(a),u=l;let d="value"===a?u:os(u);if(r.attrName=c,r.attrValue=d,r.keepAttr=!0,
|
|
175
|
+
r.forceKeepAttr=void 0,Fe(C.uponSanitizeAttribute,e,r),d=r.attrValue,!ie||"id"!==c&&"name"!==c||(Pe(a,e),d="user-content-"+d),Z&&as(/((--!?|])>)|<\/(style|title|textarea)/i,d)){Pe(a,e);continue}if("attributename"===c&&ts(d,"href")){Pe(a,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){Pe(a,e);continue}if(!Y&&as(/\/>/i,d)){Pe(a,e);continue}X&&Ka([M,N,I],(e=>{d=ns(d,e," ")}));const h=Ee(e.nodeName);if(Be(h,c,d)){if(w&&"object"==typeof m&&"function"==typeof m.getAttributeType)if(s);else switch(m.getAttributeType(h,c)){case"TrustedHTML":d=w.createHTML(d);break;case"TrustedScriptURL":d=w.createScriptURL(d)}if(d!==u)try{s?e.setAttributeNS(s,a,d):e.setAttribute(a,d),je(e)?Le(e):Xa(n.removed)}catch(t){Pe(a,e)}}else Pe(a,e)}Fe(C.afterSanitizeAttributes,e,null)},Ge=function e(t){let n=null;const r=De(t);for(Fe(C.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)Fe(C.uponSanitizeShadowNode,n,null),$e(n),Ue(n),n.content instanceof a&&e(n.content);Fe(C.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){
|
|
176
|
+
let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,s=null,c=null;if(ye=!e,ye&&(e="\x3c!--\x3e"),"string"!=typeof e&&!He(e)){if("function"!=typeof e.toString)throw ss("toString is not a function");if("string"!=typeof(e=e.toString()))throw ss("dirty is not a string, aborting")}if(!n.isSupported)return e;if(J||Ie(t),n.removed=[],"string"==typeof e&&(se=!1),se){if(e.nodeName){const t=Ee(e.nodeName);if(!j[t]||q[t])throw ss("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)r=Re("\x3c!----\x3e"),i=r.ownerDocument.importNode(e,!0),i.nodeType===Rs&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i);else{if(!te&&!X&&!Q&&-1===e.indexOf("<"))return w&&re?w.createHTML(e):e;if(r=Re(e),!r)return te?null:re?x:""}r&&ee&&Le(r.firstChild);const u=De(se?e:r);for(;s=u.nextNode();)$e(s),Ue(s),s.content instanceof a&&Ge(s.content);if(se)return e;if(te){if(ne)for(c=A.call(r.ownerDocument);r.firstChild;)c.appendChild(r.firstChild);else c=r
|
|
177
|
+
;return(F.shadowroot||F.shadowrootmode)&&(c=E.call(o,c,!0)),c}let d=Q?r.outerHTML:r.innerHTML;return Q&&j["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&as(zs,r.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+d),X&&Ka([M,N,I],(e=>{d=ns(d,e," ")})),w&&re?w.createHTML(d):d},n.setConfig=function(){Ie(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),J=!0},n.clearConfig=function(){Ce=null,J=!1},n.isValidAttribute=function(e,t,n){Ce||Ie({});const r=Ee(e),o=Ee(t);return Be(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&Za(C[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=Ya(C[e],t);return-1===n?void 0:Qa(C[e],n,1)[0]}return Xa(C[e])},n.removeHooks=function(e){C[e]=[]},n.removeAllHooks=function(){C={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],
|
|
178
178
|
uponSanitizeShadowNode:[]}},n}();var Gs=function(){if(qs)return Bs;qs=1;var e=/["'&<>]/;return Bs=function(t){var n,r=""+t,o=e.exec(r);if(!o)return r;var i="",a=0,s=0;for(a=o.index;a<r.length;a++){switch(r.charCodeAt(a)){case 34:n=""";break;case 38:n="&";break;case 39:n="'";break;case 60:n="<";break;case 62:n=">";break;default:continue}s!==a&&(i+=r.substring(s,a)),s=a+1,i+=n}return s!==a?i+r.substring(s,a):i},Bs}(),Vs=Ke(Gs);class Ws{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(e,t){return t?e&&e.loc&&t.loc&&e.loc.lexer===t.loc.lexer?new Ws(e.loc.lexer,e.loc.start,t.loc.end):null:e&&e.loc}}class Ks{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(e,t){return new Ks(t,Ws.range(this,e))}}class Ys{constructor(e,t){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var n,r,o="KaTeX parse error: "+e,i=t&&t.loc
|
|
179
179
|
;if(i&&i.start<=i.end){var a=i.lexer.input;n=i.start,r=i.end,n===a.length?o+=" at end of input: ":o+=" at position "+(n+1)+": ";var s=a.slice(n,r).replace(/[^]/g,"$&̲");o+=(n>15?"…"+a.slice(n-15,n):a.slice(0,n))+s+(r+15<a.length?a.slice(r,r+15)+"…":a.slice(r))}var l=new Error(o);return l.name="ParseError",l.__proto__=Ys.prototype,l.position=n,null!=n&&null!=r&&(l.length=r-n),l.rawMessage=e,l}}Ys.prototype.__proto__=Error.prototype;var Xs=/([A-Z])/g,Zs={"&":"&",">":">","<":"<",'"':""","'":"'"},Qs=/[&><"']/g;var Js=function e(t){return"ordgroup"===t.type||"color"===t.type?1===t.body.length?e(t.body[0]):t:"font"===t.type?e(t.body):t},el={deflt:function(e,t){return void 0===e?t:e},escape:function(e){return String(e).replace(Qs,(e=>Zs[e]))},hyphenate:function(e){return e.replace(Xs,"-$1").toLowerCase()},getBaseElem:Js,isCharacterBox:function(e){var t=Js(e);return"mathord"===t.type||"textord"===t.type||"atom"===t.type},protocolFromUrl:function(e){
|
|
180
180
|
var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?":"!==t[2]?null:/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?t[1].toLowerCase():null:"_relative"}},tl={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",
|
|
@@ -537,7 +537,7 @@ var Ep=Jn((function({annotation:e,toastMessenger:t}){return Ve(ha,{annotation:e,
|
|
|
537
537
|
target:"_blank","aria-label":`Tag: ${n}`,title:`View annotations with tag: ${n}`,underline:"none",children:n}):Ve("span",{className:"text-color-text-light cursor-default","aria-label":`Tag: ${n}`,lang:"",children:n})}),t&&Ve("button",{className:Je("px-1.5 py-1 touch:p-2","border-l rounded rounded-l-none","text-grey-6 hover:text-color-text hover:bg-grey-2","transition-colors duration-200","focus-visible-ring ring-inset"),onClick:()=>{t(n)},title:`Remove tag: ${n}`,children:Ve(dt,{className:"font-base w-em h-em",title:`Remove ${n}`})})]})}function Ip({classes:e,setCollapsed:t,collapsed:n}){const r=n?"More":"Less";return Ve(dn,{classes:Je("text-grey-7 font-normal",e),expanded:!n,onClick:()=>t(!n),title:`Toggle visibility of full annotation text: Show ${r}`,children:Ve("div",{className:"flex items-center gap-x-2",children:[Ve(n?Et:yt,{className:"w-3 h-3"}),Ve("div",{children:r})]})})}var Op=Jn((function({annotation:e,settings:t}){
|
|
538
538
|
const[n,r]=ie(!0),[o,i]=ie(!1),a=Hi(),s=a.defaultAuthority(),l=a.getDraft(e),c=a.isFeatureEnabled("at_mentions"),u=l?.tags??e.tags,d=l?.text??e.text,h=d.length>0,p=u.length>0,m=Zn(["annotationFontFamily"],t),f=ue((()=>Lr(e.user,s)),[e,s]),g=f?"display-name":"username",v=e=>a.getLink("search.tag",{tag:e});return Ve("div",{className:"space-y-4",children:[h&&Ve(Aa,{inlineControl:!1,collapsed:n,collapsedHeight:400,onCollapsibleChanged:i,onToggleCollapsed:r,overflowThreshold:20,children:Ve(mp,{markdown:d,style:m,mentions:e.mentions,mentionsEnabled:c,mentionMode:g})}),(o||p)&&Ve("div",{className:"flex flex-row gap-x-2",children:[Ve("div",{className:"grow",children:p&&Ve(Mp,{children:u.map((e=>Ve(Np,{tag:e,href:f?void 0:v(e)},e)))})}),o&&Ve("div",{children:Ve(Ip,{classes:Je("-mt-3"),collapsed:n,setCollapsed:r})})]})]})}),["settings"])
|
|
539
539
|
;const zp=(e=window.navigator.userAgent)=>e.indexOf("Mac OS")>=0,Lp=String.raw`[\s,.;:|?!'"\-()[\]{}]`,Pp=new RegExp(`(^|${Lp})@([A-Za-z0-9_][A-Za-z0-9._]+[A-Za-z0-9_])(?=${Lp}|$)`,"g"),Rp=String.raw`[^\]^[]*`,Dp=new RegExp(`@\\[(${Rp})]`,"g");function jp(e,t){const n=document.createElement("a");return n.setAttribute("data-hyp-mention",""),n.setAttribute("data-userid",e),n.textContent=t,n.outerHTML}const Hp=/<a[^>]\bdata-hyp-mention\b[^>]*>@([^<]+)<\/a>/g;function Fp(e,t){const n=[...e.slice(0,t).matchAll(new RegExp(Lp,"g"))],r=n.length>0?Math.max(...n.map((e=>e.index))):-1,o=e.slice(t).search(new RegExp(Lp));return{start:r+1,end:-1===o?e.length:t+o}}function $p(e){return`@[${e.replace(/[[\]]/g,"")}]`}let Bp,qp=function(e){return e.ANCHOR_LINK="ANCHOR_LINK",e.IMAGE_LINK="IMAGE_LINK",e}({});function Up(e,t,n,r){let o=e.selectionStart,i=e.selectionEnd;return o>=t+n?(o+=r.length-n,i+=r.length-n):i<=t||(o<=t&&i>=t+n?i+=r.length-n:o<t&&i<t+n?o=t:o<t+n&&i>t+n?i+=r.length-n:t<o&&t+n>i&&(o=t,i=t+n)),{
|
|
540
|
-
text:e.text.slice(0,t)+r+e.text.slice(t+n),selectionStart:o,selectionEnd:i}}function Gp(e,t=qp.ANCHOR_LINK){const n=e.text.slice(e.selectionStart,e.selectionEnd);let r,o="";if(t===qp.IMAGE_LINK&&(o="!"),n.match(/[a-z]+:\/\/.*/)){const t="Description";return r=Up(e,e.selectionStart,n.length,o+"["+t+"]("+n+")"),r.selectionStart=e.selectionStart+o.length+1,r.selectionEnd=r.selectionStart+t.length,r}{const t=o+"["+n+"](",i="http://insert-your-link-here
|
|
540
|
+
text:e.text.slice(0,t)+r+e.text.slice(t+n),selectionStart:o,selectionEnd:i}}function Gp(e,t=qp.ANCHOR_LINK){const n=e.text.slice(e.selectionStart,e.selectionEnd);let r,o="";if(t===qp.IMAGE_LINK&&(o="!"),n.match(/[a-z]+:\/\/.*/)){const t="Description";return r=Up(e,e.selectionStart,n.length,o+"["+t+"]("+n+")"),r.selectionStart=e.selectionStart+o.length+1,r.selectionEnd=r.selectionStart+t.length,r}{const t=o+"["+n+"](",i="http://example.com/insert-your-link-here";return r=Up(e,e.selectionStart,n.length,t+i+")"),r.selectionStart=e.selectionStart+t.length,r.selectionEnd=r.selectionStart+i.length,r}}function Vp(e,t,n,r){void 0===n&&(n=t);const o=e.text.slice(e.selectionStart-t.length,e.selectionStart),i=e.text.slice(e.selectionEnd,e.selectionEnd+t.length);let a=e;return e.selectionStart===e.selectionEnd&&r&&(a=Up(e,e.selectionStart,0,r),a.selectionStart=a.selectionEnd-r.length),o===t&&i===n?(a=Up(a,a.selectionStart-t.length,t.length,""),a=Up(a,a.selectionEnd,n.length,"")):(a=Up(a,a.selectionStart,0,t),
|
|
541
541
|
a=Up(a,a.selectionEnd,0,n)),a}function Wp(e,t){const n=e.indexOf("\n",t);return n<0?e.length:n}function Kp(e,t,n,r){let o=function(e,t){const n=e.lastIndexOf("\n",t);return n<0?0:n+1}(e.text,t),i=Wp(e.text,t),a=0;for(;i<=Wp(e.text,n);){const t=i===e.text.length,s=i-o,l=Wp((e=r(e,o,i,a)).text,o)-o;if(n+=l-s,t)break;o=o+l+1,i=Wp(e.text,o),a+=1}return e}function Yp(e,t){const n=e.selectionStart,r=e.selectionEnd,o=e=>"function"==typeof t?t(e):t;let i=!0;return Kp(e,n,r,((e,t,n,r)=>{const a=o(r);return e.text.slice(t,t+a.length)!==a&&(i=!1),e})),Kp(e,n,r,i?(e,t,n,r)=>Up(e,t,o(r).length,""):(e,t,n,r)=>{const i=o(r);return e.text.slice(t,t+i.length)===i?e:Up(e,t,0,i)})}const Xp=!1;function Zp({user:e,usersListboxId:t,highlighted:n,mentionMode:r,onSelect:o,onHighlight:i}){const a="username"===r;return Ve("li",{id:`${t}-${e.username}`,className:Je("flex justify-between items-center gap-x-2 rounded p-2","leading-tight",{"bg-grey-2":n}),onClick:e=>{e.stopPropagation(),o()},onMouseMove:i,role:"option","aria-selected":n,
|
|
542
542
|
children:[a&&Ve("span",{className:"truncate","data-testid":`username-${e.username}`,children:e.username}),Ve("span",{className:Je({"text-color-text-light":a}),children:e.displayName})]},e.username)}function Qp({loadingUsers:e,users:t,onSelectUser:n,highlightedSuggestion:r,onHighlightSuggestion:o,usersListboxId:i,mentionMode:a,...s}){return Ve(Nn,{...s,classes:Je("p-1",["!max-h-96"]),children:Ve("ul",{className:"flex-col gap-y-0.5",role:"listbox","aria-orientation":"vertical",id:i,children:e?Ve("li",{className:"italic p-2","data-testid":"suggestions-loading-indicator",children:"Loading suggestions…"}):Ve(y,{children:[t.map(((e,t)=>Ve(Zp,{user:e,highlighted:r===t,mentionMode:a,usersListboxId:i,onSelect:()=>n(e),onHighlight:()=>o(t)},e.username))),0===t.length&&Ve("li",{className:"italic p-2","data-testid":"suggestions-fallback",children:"No matches. You can still write the username"})]})})})}const Jp={bold:"b",image:"g",italic:"i",link:"l",list:"u",math:"m",numlist:"o",quote:"q"}
|
|
543
543
|
;function em({disabled:e=!1,icon:t,label:n,onClick:r,shortcutKey:o,title:i="",classes:a}){const s=ue((()=>zp()?"Cmd":"Ctrl"),[]);let l=i;o&&(l+=` (${s}-${o.toUpperCase()})`);const c={disabled:e,onClick:r,title:l};return n?Ve(dn,{classes:Je("p-1.5 text-grey-7 hover:text-grey-9",a),...c,size:"custom",variant:"custom",children:n}):Ve(mn,{classes:Je("px-2 py-2.5",a),...c,children:t&&Ve(t,{className:"w-[10px] h-[10px] touch:w-[13px] touch:h-[13px]"})})}function tm({classes:e,containerRef:t,mentionsEnabled:n,usersForMentions:r,onEditText:o,onKeyDown:i,mentionMode:a,onInsertMentionSuggestion:s,...l}){const[c,u]=ie(!1),[d,h]=ie(),p=Ie(t),[m,f]=ie(0),g=ce(null),v=ue((()=>n?function(e,t,{mentionMode:n,maxUsers:r=10}){return void 0===e||"loading"===t.status?[]:t.users.filter((t=>{if(!e)return!0;const r=t.displayName??"";return("username"===n?`${t.username} ${r}`:r).toLowerCase().includes(e.toLowerCase())})).slice(0,r)}(d,r,{mentionMode:a}):[]),[d,a,n,r]),b=de((e=>{if(!n)return;const{x:t,y:r}=function(e){
|
|
@@ -582,7 +582,7 @@ const n=e.slice(0,e.indexOf(":"));if(!n)return[null,e];if(t.includes(n)){return[
|
|
|
582
582
|
case"oldest":return wf(yf(e),yf(t));case"location":return function(e,t){if(!e.annotation||!t.annotation)return function(e,t){return e.annotation||t.annotation?e.annotation?1:-1:0}(e,t);const n=Gr(e.annotation),r=Gr(t.annotation);if(n.cfi||r.cfi){const e="/0",t=Qm(n.cfi??e,r.cfi??e);if(0!==t)return Math.sign(t)}const o=_f(n.pageIndex,r.pageIndex);if(0!==o)return o;const i=_f(n.top,r.top);if(0!==i)return i;const a=_f(n.charOffset,r.charOffset);if(0!==a)return a;return wf(e.annotation.created,t.annotation.created)}(e,t);default:return 0}}const kf=function(e){if(1!==e.length)throw new Error("Memoize input must be a function of one argument");let t,n;return function(r){return r===t||(t=r,n=e(r)),n}}((function(e){const t=e.selection,n={expanded:t.expanded,forcedVisible:t.forcedVisible,selected:t.selected,sortCompareFn:(e,n)=>xf(e,n,{sortBy:t.sortKey})};if(!!t.filterQuery||Object.keys(t.filters).length>0){const e=function(e,t={}){const n=e=>{const n=t[e];return"string"==typeof n?[n]:[]
|
|
583
583
|
},r=n("cfi"),o=n("page"),i=n("quote"),a=n("tag"),s=n("text"),l=n("uri"),c=n("user"),u=[],d=[],h=ff(e,df);for(const e of h){const t=e.slice(0,e.indexOf(":")),n=e.slice(t.length+1);switch(t){case"cfi":r.push(n);break;case"quote":i.push(n);break;case"page":o.push(n);break;case"since":{const t=86400,n={sec:1,min:60,hour:3600,day:t,week:7*t,month:30*t,year:365*t},r=e.slice(6).toLowerCase().match(/^(\d+)(sec|min|hour|day|week|month|year)?$/);if(r){const e=parseFloat(r[1]),t=r[2]||"sec";d.push(e*n[t])}}break;case"tag":a.push(n);break;case"text":s.push(n);break;case"uri":l.push(n);break;case"user":c.push(n);break;default:u.push(e)}}return{any:{terms:u,operator:"and",filterReplies:!0},cfi:{terms:r,operator:"or",filterReplies:!1},quote:{terms:i,operator:"and",filterReplies:!1},page:{terms:o,operator:"or",filterReplies:!1},since:{terms:d,operator:"and",filterReplies:!0},tag:{terms:a,operator:"and",filterReplies:!0},text:{terms:s,operator:"and",filterReplies:!0},uri:{terms:l,operator:"or",filterReplies:!1},user:{terms:c,
|
|
584
584
|
operator:"or",filterReplies:!0}}}(t.filterQuery||"",t.filters),r={},o={};for(const[t,n]of Object.entries(e))n.filterReplies?r[t]=n:o[t]=n;n.filterFn=e=>uf([e],r).length>0,Object.values(o).some((e=>e.terms.length>0))&&(n.threadFilterFn=e=>!!e.annotation&&uf([e.annotation],o).length>0)}const r=Ym(e.annotations,n),o={annotation:0,note:0,orphan:0};return e.showTabs&&(r.children=r.children.filter((n=>{if(!n.annotation&&!e.topAnnotationsPlaceholder)return!1;if(n.annotation&&Hr(n.annotation))return!1;const r=n.annotation?vf(n.annotation):"orphan";return o[r]+=1,r===t.selectedTab}))),{tabCounts:o,rootThread:r}}));function Sf(){const e=Hi(),t=e.allAnnotations(),n=e.filterQuery(),r=e.route(),o=e.selectionState(),i=e.getFilterValues(),a="sidebar"===r,s=e.isFeatureEnabled("top_annos_placeholder"),l=ue((()=>{const e={...o,filterQuery:n,filters:i};return{annotations:t,selection:e,showTabs:a,topAnnotationsPlaceholder:s}}),[o,n,i,t,a,s]);return kf(l)}var Af,Tf,Ef=Jn((function({loadAnnotationsService:e,onLogin:t}){
|
|
585
|
-
const n=Hi(),r=n.routeParams().id??"",{rootThread:o}=Sf(),i=n.profile().userid,[a,s]=ie(!1);return se((()=>{s(!1),n.clearAnnotations(),e.loadThread(r).then((e=>{const t=e.filter((e=>0===(e.references||[]).length))[0];t&&(e.forEach((e=>e.id&&n.setExpanded(e.id,!0))),t.id!==r&&n.highlightAnnotations([r]))})).catch((()=>{s(!0)}))}),[r,i,e,n]),Ve(y,{children:[a&&Ve(Fi,{errorType:"annotation",onLoginRequest:t}),Ve(Hm,{threads:o.children})]})}),["loadAnnotationsService"]);class Cf{constructor(e,t,n=window){const r="N/A";let o=r;e.userid&&(o=e.userid,e.displayName&&(o=`${e.displayName} (${o})`)),this.version="1.
|
|
585
|
+
const n=Hi(),r=n.routeParams().id??"",{rootThread:o}=Sf(),i=n.profile().userid,[a,s]=ie(!1);return se((()=>{s(!1),n.clearAnnotations(),e.loadThread(r).then((e=>{const t=e.filter((e=>0===(e.references||[]).length))[0];t&&(e.forEach((e=>e.id&&n.setExpanded(e.id,!0))),t.id!==r&&n.highlightAnnotations([r]))})).catch((()=>{s(!0)}))}),[r,i,e,n]),Ve(y,{children:[a&&Ve(Fi,{errorType:"annotation",onLoginRequest:t}),Ve(Hm,{threads:o.children})]})}),["loadAnnotationsService"]);class Cf{constructor(e,t,n=window){const r="N/A";let o=r;e.userid&&(o=e.userid,e.displayName&&(o=`${e.displayName} (${o})`)),this.version="1.1724.0",this.userAgent=n.navigator.userAgent,this.urls=t.map((e=>e.uri)).join(", ")||r,this.fingerprint=t[0]?.metadata?.documentFingerprint??r,this.account=o,this.timestamp=(new Date).toString();const i=t[0]?.segment;if(i){const e=[];if(i.cfi&&e.push(["CFI",i.cfi]),i.pages){const t=`${i.pages.start}-${i.pages.end}`;e.push(["Pages",t])}i.url&&e.push(["URL",i.url]),
|
|
586
586
|
this.segment=e.map((([e,t])=>`${e}: ${t}`)).join(", ")}}asFormattedString(){return`Version: ${this.version}\nUser Agent: ${this.userAgent}\nURL: ${this.urls}\nFingerprint: ${this.fingerprint}\nAccount: ${this.account}\nDate: ${this.timestamp}\n`}asEncodedURLString(){return encodeURIComponent(this.asFormattedString())}}var Mf=function(){if(Tf)return Af;Tf=1;var e="complete",t="canceled";function n(e,t,n){e.self===e?e.scrollTo(t,n):(e.scrollLeft=t,e.scrollTop=n)}function r(t){var o=t._scrollSettings;if(o){var i=o.maxSynchronousAlignments,a=function(e,t){var n,r,o,i,a,s,l,c=e.align,u=e.target.getBoundingClientRect(),d=c&&null!=c.left?c.left:.5,h=c&&null!=c.top?c.top:.5,p=c&&null!=c.leftOffset?c.leftOffset:0,m=c&&null!=c.topOffset?c.topOffset:0,f=d,g=h;if(e.isWindow(t))s=Math.min(u.width,t.innerWidth),l=Math.min(u.height,t.innerHeight),r=u.left+t.pageXOffset-t.innerWidth*f+s*f,o=u.top+t.pageYOffset-t.innerHeight*g+l*g,r-=p,o-=m,r=e.align.lockX?t.pageXOffset:r,o=e.align.lockY?t.pageYOffset:o,i=r-t.pageXOffset,
|
|
587
587
|
a=o-t.pageYOffset;else{s=u.width,l=u.height,n=t.getBoundingClientRect();var v=u.left-(n.left-t.scrollLeft),b=u.top-(n.top-t.scrollTop);r=v+s*f-t.clientWidth*f,o=b+l*g-t.clientHeight*g,r-=p,o-=m,r=Math.max(Math.min(r,t.scrollWidth-t.clientWidth),0),o=Math.max(Math.min(o,t.scrollHeight-t.clientHeight),0),r=e.align.lockX?t.scrollLeft:r,o=e.align.lockY?t.scrollTop:o,i=r-t.scrollLeft,a=o-t.scrollTop}return{x:r,y:o,differenceX:i,differenceY:a}}(o,t),s=Date.now()-o.startTime,l=Math.min(1/o.time*s,1);if(o.endIterations>=i)return n(t,a.x,a.y),t._scrollSettings=null,o.end(e);var c=1-o.ease(l);if(n(t,a.x-a.differenceX*c,a.y-a.differenceY*c),s>=o.time)return o.endIterations++,o.scrollAncestor&&r(o.scrollAncestor),void r(t);!function(e){if("requestAnimationFrame"in window)return window.requestAnimationFrame(e);setTimeout(e,16)}(r.bind(null,t))}}function o(e){return e.self===e}function i(e){return"pageXOffset"in e||(e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth)&&"hidden"!==getComputedStyle(e).overflow}
|
|
588
588
|
function a(){return!0}function s(e){if(e.assignedSlot)return s(e.assignedSlot);if(e.parentElement)return"body"===e.parentElement.tagName.toLowerCase()?e.parentElement.ownerDocument.defaultView||e.parentElement.ownerDocument.ownerWindow:e.parentElement;if(e.getRootNode){var t=e.getRootNode();if(11===t.nodeType)return t.host}}return Af=function(n,l,c){if(n){"function"==typeof l&&(c=l,l=null),l||(l={}),l.time=isNaN(l.time)?1e3:l.time,l.ease=l.ease||function(e){return 1-Math.pow(1-e,e/2)},l.align=l.align||{};var u=s(n),d=1,h=l.validTarget||a,p=l.isScrollable;l.debug&&(console.log("About to scroll to",n),u||console.error("Target did not have a parent, is it mounted in the DOM?"));for(var m=[];u;)if(l.debug&&console.log("Scrolling parent node",u),h(u,d)&&(p?p(u,i):i(u))&&(d++,m.push(u)),!(u=s(u))){f(e);break}return m.reduce(((e,i,a)=>function(e,n,i,a,s){var l,c=!n._scrollSettings,u=n._scrollSettings,d=Date.now(),h={passive:!0};function p(e){n._scrollSettings=null,
|
|
@@ -670,7 +670,7 @@ client_version:r.version,annotations:e.map(Eb)}}buildTextExportContent(e,{groupN
|
|
|
670
670
|
${u.join("\n\n")}`}buildCSVExportContent(e,{groupName:t="",defaultAuthority:n="",displayNamesEnabled:r=!1,separator:o=","}={}){const{uri:i,extractUsername:a}=this._exportCommon(e,{displayNamesEnabled:r,defaultAuthority:n}),s=e=>[Cb(new Date(e.created)),a(e),Qr(e)??"",i,t,Ur(e,this._settings),Kr(e)??Yr(e)??"",e.text,e.tags.join(",")].map((e=>function(e,t){return new RegExp(`["\n\r${t}]`).test(e)?`"${e.replace(/"/g,'""')}"`:e}(e,o))).join(o);return`${["Created at","Author","Page","URL","Group","Type","Quote/description","Comment","Tags"].join(o)}\n${e.map((e=>s(e))).join("\n")}`}buildHTMLExportContent(e,{groupName:t="",displayNamesEnabled:n=!1,defaultAuthority:r="",now:o=new Date}={}){const{uri:i,title:a,uniqueUsers:s,replies:l,extractUsername:c}=this._exportCommon(e,{displayNamesEnabled:n,defaultAuthority:r});return function(e,t,n){var r=Object.assign({},Sb,n||{});return r.jsx||(r.attributeHook=null),Zv(e,t,r)}(Ve("html",{lang:"en",children:[Ve("head",{children:[Ve("title",{
|
|
671
671
|
children:`Annotations on "${a}"`}),Ve("meta",{charSet:"UTF-8"})]}),Ve("body",{children:[Ve("section",{children:[Ve("h1",{children:"Summary"}),Ve("p",{children:Ve("time",{dateTime:o.toISOString(),children:Cb(o)})}),Ve("p",{children:Ve("strong",{children:a})}),Ve("p",{children:Ve("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:i})}),Ve("table",{children:Ve("tbody",{style:{verticalAlign:"top"},children:[Ve("tr",{children:[Ve("td",{children:"Group:"}),Ve("td",{children:t})]}),Ve("tr",{children:[Ve("td",{children:"Total users:"}),Ve("td",{children:s.length})]}),Ve("tr",{children:[Ve("td",{children:"Users:"}),Ve("td",{children:s.join(", ")})]}),Ve("tr",{children:[Ve("td",{children:"Total annotations:"}),Ve("td",{children:e.length})]}),Ve("tr",{children:[Ve("td",{children:"Total replies:"}),Ve("td",{children:l.length})]})]})})]}),Ve("hr",{}),Ve("section",{children:[Ve("h1",{children:"Annotations"}),e.map(((e,t)=>{const n=Qr(e),r=Kr(e),o=Yr(e),i=ep(e.text),a=i===`<p>${e.text}</p>`?e.text:i
|
|
672
672
|
;return Ve("article",{children:[Ve("h2",{children:["Annotation ",t+1,":"]}),Ve("table",{children:Ve("tbody",{style:{verticalAlign:"top"},children:[Ve("tr",{children:[Ve("td",{children:"Created at:"}),Ve("td",{children:Ve("time",{dateTime:e.created,children:Cb(new Date(e.created))})})]}),Ve("tr",{children:[Ve("td",{children:"Author:"}),Ve("td",{children:c(e)})]}),n&&Ve("tr",{children:[Ve("td",{children:"Page:"}),Ve("td",{children:n})]}),Ve("tr",{children:[Ve("td",{children:"Type:"}),Ve("td",{children:Ur(e,this._settings)})]}),r&&Ve("tr",{children:[Ve("td",{children:"Quote:"}),Ve("td",{children:Ve("blockquote",{style:{margin:0},children:r})})]}),o&&Ve("tr",{children:[Ve("td",{children:"Description:"}),Ve("td",{children:o})]}),Ve("tr",{children:[Ve("td",{children:"Comment:"}),Ve("td",{dangerouslySetInnerHTML:{__html:a}})]}),e.tags.length>0&&Ve("tr",{children:[Ve("td",{children:"Tags:"}),Ve("td",{children:e.tags.join(", ")})]})]})})]},e.id)}))]})]})]}),{},{pretty:!0}).replace(/\t/g," ")}
|
|
673
|
-
_exportCommon(e,{displayNamesEnabled:t,defaultAuthority:n}){const[r]=e;if(!r)throw new Error("No annotations to export");const o=e=>Zi(e,n,t),{uri:i,title:a}=Qi(r);return{uri:i,title:a,uniqueUsers:[...new Set(e.map((e=>o(e))).filter(Boolean))],replies:e.filter((e=>Pr(e))),extractUsername:o}}}Mb.$inject=["settings"];class Nb{constructor(e,t,n){this._clientId=null;const r=e.routes(),o=()=>this._clientId,i=e=>function(e,t,{getAccessToken:n,getClientId:r,onRequestStarted:o,onRequestFinished:i}){return async(a,s,l)=>{o();try{const[o,i]=await Promise.all([e,n()]),c=function(e,t){let n=e;const r=t.split(".");for(const[e,t]of r.entries()){const o=n[t];if(!o||"url"in o){if(o&&e===r.length-1)return o;break}n=o}return null}(o,t);if(!c)throw new Error(`Missing API route: ${t}`);const u={"Content-Type":"application/json","Hypothesis-Client-Version":"1.
|
|
673
|
+
_exportCommon(e,{displayNamesEnabled:t,defaultAuthority:n}){const[r]=e;if(!r)throw new Error("No annotations to export");const o=e=>Zi(e,n,t),{uri:i,title:a}=Qi(r);return{uri:i,title:a,uniqueUsers:[...new Set(e.map((e=>o(e))).filter(Boolean))],replies:e.filter((e=>Pr(e))),extractUsername:o}}}Mb.$inject=["settings"];class Nb{constructor(e,t,n){this._clientId=null;const r=e.routes(),o=()=>this._clientId,i=e=>function(e,t,{getAccessToken:n,getClientId:r,onRequestStarted:o,onRequestFinished:i}){return async(a,s,l)=>{o();try{const[o,i]=await Promise.all([e,n()]),c=function(e,t){let n=e;const r=t.split(".");for(const[e,t]of r.entries()){const o=n[t];if(!o||"url"in o){if(o&&e===r.length-1)return o;break}n=o}return null}(o,t);if(!c)throw new Error(`Missing API route: ${t}`);const u={"Content-Type":"application/json","Hypothesis-Client-Version":"1.1724.0"};i&&(u.Authorization="Bearer "+i);const d=r();d&&(u["X-Client-Id"]=d);const{url:h,unusedParams:p}=ci(c.url,a),m=new URL(h);for(const[e,t]of Object.entries(p)){
|
|
674
674
|
const n=Array.isArray(t)?t:[t];for(const t of n)null!=t&&m.searchParams.append(e,t.toString())}return await yp(m.toString(),{body:s?JSON.stringify(Eb(s)):null,headers:u,method:c.method,signal:l})}finally{i()}}}(r,e,{getAccessToken:()=>t.getAccessToken(),getClientId:o,onRequestStarted:n.apiRequestStarted,onRequestFinished:n.apiRequestFinished});this.search=i("search"),this.annotation={read:i("annotation.read"),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"),moderate:i("annotation.moderate")},this.group={member:{delete:i("group.member.delete")},members:{read:i("group.members.read")},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")},this.analytics={events:{create:i("analytics.events.create")}}}setClientId(e){this._clientId=e}}
|
|
675
675
|
Nb.$inject=["apiRoutes","auth","store"];var Ib,Ob,zb,Lb,Pb,Rb={};function Db(){return zb||(zb=1,e=Rb,t=function(){if(Ob)return Ib;function e(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))}return Ob=1,Ib=e,e.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},e.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},e.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=(new Date).getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),
|
|
676
676
|
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},e.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)},e.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},e.prototype.start=function(e){
|
|
@@ -788,8 +788,8 @@ Object.keys(this._configMessages).forEach((t=>{this._configMessages[t]&&e.send(t
|
|
|
788
788
|
value:this.clientId}),this.setConfig("auth-check",{type:"whoami",id:1})}async connect(e={}){this._updateImmediately=e.applyUpdatesImmediately??!0,this._reconnectSetUp||(this._reconnectSetUp=!0,ry(this._store.subscribe,(()=>this._store.profile().userid),(()=>this._reconnect()))),this._socket||await this._reconnect()}}FS.$inject=["store","apiRoutes","auth","groups","session","$window"];const $S="hypothesis.user.tags.list",BS="hypothesis.user.tags.map";class qS{constructor(e){this._storage=e}filter(e,t=null){const n=this._storage.getObject($S)||[];let r=0;return n.filter((n=>{if(null!==t&&r>=t)return!1;const o=n.split(/\W+/),i=new RegExp(`^${hv(e)}`,"i");return!(!o.some((e=>e.match(i)))&&!n.match(i))&&(++r,!0)}))}store(e){const t=this._storage.getObject(BS)||{};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(BS,t);const n=Object.keys(t).sort(((e,n)=>t[e].count!==t[n].count?t[n].count-t[e].count:e.localeCompare(n)))
|
|
789
789
|
;this._storage.setObject($S,n)}}qS.$inject=["localStorage"];class US{constructor(e){this._store=e}forceVisible(e){e.children.forEach((e=>{this.forceVisible(e)})),e.visible||this._store.setForcedVisible(e.id,!0)}}US.$inject=["store"];class GS{#t=new Map;#n=30;#r;constructor(e){this.#r=e}get cacheSize(){return this.#n}set cacheSize(e){this.#n=e,this.#o()}#o(){for(const e of this.#t.keys()){const t=this.#t.get(e);if(t&&URL.revokeObjectURL(t.url),this.#t.delete(e),this.#t.size<=this.cacheSize)break}}async fetch(e,t={}){const n=this.get(e);if(n)return n;const r=await this.#r.requestThumbnail(e,t),o=await async function(e){const t=new OffscreenCanvas(e.width,e.height);t.getContext("2d").drawImage(e,0,0,e.width,e.height);const n=await t.convertToBlob();return URL.createObjectURL(n)}(r),i={url:o,width:r.width,height:r.height};return this.#t.set(e,i),this.#t.size>this.cacheSize&&this.#o(),i}get(e){const t=this.#t.get(e);return t?(this.#t.delete(e),this.#t.set(e,t),t):null}cachedThumbnailTags(){
|
|
790
790
|
return[...this.#t.keys()]}}GS.$inject=["frameSync"];class VS extends $f{constructor(e,t){super(),this._store=e,this._window=t,this._delayedMessageQueue=[],this._window.addEventListener("focus",(()=>{this._delayedMessageQueue.forEach((({type:e,messageText:t,options:n})=>this._addMessage(e,t,n))),this._delayedMessageQueue=[]}))}dismiss(e){this._store.getToastMessage(e)&&(this._store.removeToastMessage(e),this.emit("toastMessageDismissed",e))}_addMessage(e,t,{autoDismiss:n=!0,visuallyHidden:r=!1,delayed:o=!1}={}){if(this._store.hasToastMessage(e,t))return;if(o&&!this._window.document.hasFocus()){const o={autoDismiss:n,visuallyHidden:r};return void this._delayedMessageQueue.push({type:e,messageText:t,options:o})}const i={type:e,id:tv(10),message:t,visuallyHidden:r,autoDismiss:n};this._store.addToastMessage(i),this.emit("toastMessageAdded",i)}error(e,t){this._addMessage("error",e,t)}success(e,t){this._addMessage("success",e,t)}notice(e,t){this._addMessage("notice",e,t)}}VS.$inject=["store","$window"]
|
|
791
|
-
;const WS=function(e){for(var t={},n=e.querySelectorAll("script.js-hypothesis-config"),r=0;r<n.length;r++){var o=void 0;try{o=JSON.parse(n[r].textContent||"")}catch(e){console.warn("Could not parse settings from js-hypothesis-config tags",e),o={}}Object.assign(t,o)}return t}(document),KS=function(e){const{version:t,origin:n}=rv(e.location.href);return"1.
|
|
792
|
-
n.error("Hypothesis failed to connect to the web page. Try reloading the page.",{autoDismiss:!1})}))}WS.sentry&&KS&&function(e){const t=function(){const e=import.meta.url;return e?new URL(e).origin:null}(),n=t?[t]:void 0;!function(e={}){const t=!e.skipBrowserExtensionCheck&&AS(),n={...e,enabled:!t&&e.enabled,stackParser:(r=e.stackParser||cS,Array.isArray(r)?Cy(...r):r),integrations:bx({integrations:e.integrations,defaultIntegrations:null==e.defaultIntegrations?[ok(),tk(),fS(),pS(),_S(),SS(),pk(),kS(),yS()]:e.defaultIntegrations}),transport:e.transport||tS};var r;Bx(Fk,n)}({dsn:e.dsn,environment:e.environment,allowUrls:n,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.
|
|
791
|
+
;const WS=function(e){for(var t={},n=e.querySelectorAll("script.js-hypothesis-config"),r=0;r<n.length;r++){var o=void 0;try{o=JSON.parse(n[r].textContent||"")}catch(e){console.warn("Could not parse settings from js-hypothesis-config tags",e),o={}}Object.assign(t,o)}return t}(document),KS=function(e){const{version:t,origin:n}=rv(e.location.href);return"1.1724.0"!==t?(console.warn(`The Hypothesis sidebar is using a different version (1.1724.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 YS(e,t){e.setClientId(t.clientId)}function XS(e){e.sync()}function ZS(e,t){e.load(),t.load()}function QS(e,t,n){e.init(),t.init(),n.init()}function JS(e,t,n){"sidebar"===t.route()&&e.connect().catch((()=>{
|
|
792
|
+
n.error("Hypothesis failed to connect to the web page. Try reloading the page.",{autoDismiss:!1})}))}WS.sentry&&KS&&function(e){const t=function(){const e=import.meta.url;return e?new URL(e).origin:null}(),n=t?[t]:void 0;!function(e={}){const t=!e.skipBrowserExtensionCheck&&AS(),n={...e,enabled:!t&&e.enabled,stackParser:(r=e.stackParser||cS,Array.isArray(r)?Cy(...r):r),integrations:bx({integrations:e.integrations,defaultIntegrations:null==e.defaultIntegrations?[ok(),tk(),fS(),pS(),_S(),SS(),pk(),kS(),yS()]:e.defaultIntegrations}),transport:e.transport||tS};var r;Bx(Fk,n)}({dsn:e.dsn,environment:e.environment,allowUrls:n,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.1724.0",beforeSend:(e,t)=>{if(TS>=5)return cv("Client-side Sentry quota reached. No further Sentry events will be sent"),null;++TS;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{}return e}});try{
|
|
793
793
|
ux("host_config",rv(window.location.href))}catch{}ux("loaded_scripts",Array.from(document.querySelectorAll("script")).filter((e=>!e.type||e.type.match(/javascript|module/))).map((e=>e.src||"<inline>"))),Xb(((e,t)=>{ES(e,t)}))}(WS.sentry),document.body.addEventListener("click",(e=>{const t=e.target;"A"===t.tagName&&"_blank"===t.target&&(t.rel="noopener")})),YS.$inject=["api","streamer"],XS.$inject=["router"],ZS.$inject=["groups","session"],QS.$inject=["autosaveService","persistedDefaults","serviceURL"],JS.$inject=["frameSync","store","toastMessenger"];const eA=document.querySelector("hypothesis-app");!function(e=window){e.addEventListener("message",yv)}(),async function(e,t=window){const n=function(e){const t=rv(e.location.href),n=["annotations","group","query","appType","openSidebar","showHighlights","services","branding","enableExperimentalNewNoteButton","focus","requestConfigFromFrame","theme","usernameUrl","commentsMode","groupsAllowlist"],r={openSidebar:ov,requestConfigFromFrame:e=>{
|
|
794
794
|
if("string"==typeof e)return e;const t=function(e){return"object"==typeof e&&null!==e?e:{}}(e);return{origin:av(t.origin),ancestorLevel:iv(t.ancestorLevel)}}},o={};for(const[e,i]of Object.entries(t))n.includes(e)&&null!==i&&(r[e]?o[e]=r[e](i):o[e]=i);return o}(window),r=function(e,t){const n=e.requestConfigFromFrame;if(!n)return null;if("number"!=typeof n.ancestorLevel||"string"!=typeof n.origin)throw new Error("Improper `requestConfigFromFrame` object. Both `ancestorLevel` and `origin` need to be specified");return{targetFrame:sv(n.ancestorLevel,t),origin:n.origin}}(n,t);let o;if(r){const e=await async function(e,t){return{...await nv(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=nv(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),
|
|
795
795
|
i.apiUrl=function(e){const t=Kn(e);if(!t)return e.apiUrl;if(t.apiUrl)return t.apiUrl;throw new Error("Service should contain an apiUrl value.")}(i),i}(WS).then((e=>{!function(e,t){const n=new U;n.register("analytics",_v).register("annotationsExporter",Mb).register("annotationsService",xv).register("annotationActivity",wv).register("api",Nb).register("apiRoutes",$b).register("auth",Ub).register("autosaveService",Gb).register("dashboard",Vb).register("frameSync",ay).register("groups",cy).register("importAnnotationsService",MS).register("loadAnnotationsService",NS).register("localStorage",OS).register("persistedDefaults",LS).register("router",PS).register("serviceURL",RS).register("session",DS).register("streamer",FS).register("streamFilter",jS).register("tags",qS).register("threadsService",US).register("thumbnailService",GS).register("toastMessenger",VS).register("store",{factory:ji}),n.register("$window",{value:window}).register("settings",{value:e}),n.run(XS),n.run(QS),n.run(YS),n.run(ZS),n.run(bv),n.run(JS),
|