hypothesis 1.1000.0 → 1.1003.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/boot.js +1 -1
- package/build/manifest.json +11 -11
- package/build/scripts/annotator.bundle.js +33 -33
- package/build/scripts/annotator.bundle.js.map +1 -1
- package/build/scripts/sidebar.bundle.js +97 -97
- package/build/scripts/sidebar.bundle.js.map +1 -1
- package/build/scripts/ui-playground.bundle.js.map +1 -1
- package/build/styles/annotator.css +40 -42
- package/build/styles/annotator.css.map +1 -1
- package/build/styles/sidebar.css +90 -30
- package/build/styles/sidebar.css.map +1 -1
- package/build/styles/ui-playground.css +27 -29
- package/build/styles/ui-playground.css.map +1 -1
- package/package.json +2 -2
package/build/boot.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";function t(t,e){for(var s in e)e.hasOwnProperty(s)&&(t[s]=e[s]);return t}function e(t){for(var e=arguments.length,s=new Array(e>1?e-1:0),n=1;n<e;n++)s[n-1]=arguments[n];return s.every((function(e){return"function"==typeof t[e]}))}var s={es2017:function(){return!e(Object,"entries","values")},es2018:function(){return"function"!=typeof Promise||!e(Promise.prototype,"finally")}};function n(t){return function(t){if(Array.isArray(t))return r(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return r(t,e);var s=Object.prototype.toString.call(t).slice(8,-1);"Object"===s&&t.constructor&&(s=t.constructor.name);if("Map"===s||"Set"===s)return Array.from(t);if("Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return r(t,e)}(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 r(t,e){(null==e||e>t.length)&&(e=t.length);for(var s=0,n=new Array(e);s<e;s++)n[s]=t[s];return n}var o=["es2017","es2018"];function
|
|
1
|
+
!function(){"use strict";function t(t,e){for(var s in e)e.hasOwnProperty(s)&&(t[s]=e[s]);return t}function e(t){for(var e=arguments.length,s=new Array(e>1?e-1:0),n=1;n<e;n++)s[n-1]=arguments[n];return s.every((function(e){return"function"==typeof t[e]}))}var s={es2017:function(){return!e(Object,"entries","values")},es2018:function(){return"function"!=typeof Promise||!e(Promise.prototype,"finally")}};function n(t){return function(t){if(Array.isArray(t))return r(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return r(t,e);var s=Object.prototype.toString.call(t).slice(8,-1);"Object"===s&&t.constructor&&(s=t.constructor.name);if("Map"===s||"Set"===s)return Array.from(t);if("Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return r(t,e)}(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 r(t,e){(null==e||e>t.length)&&(e=t.length);for(var s=0,n=new Array(e);s<e;s++)n[s]=t[s];return n}var o=["es2017","es2018"];function i(t){t.setAttribute("data-hypothesis-asset","")}function a(t,e){var s=t.createElement("link");s.rel="stylesheet",s.type="text/css",s.href=e,i(s),t.head.appendChild(s)}function c(t,e){var s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=t.createElement("script");n.type="module",s&&(e+="#ts=".concat(Date.now())),n.src=e,n.async=!1,i(n),t.head.appendChild(n)}function l(t,e,s,n){var r=t.createElement("link");r.rel=e,r.href=n,r.type="application/annotator+".concat(s),i(r),t.head.appendChild(r)}function u(t,e,s){var n=t.createElement("link");n.rel="preload",n.as=e,n.href=s,"fetch"===e&&(n.crossOrigin="anonymous"),i(n),t.head.appendChild(n)}function p(t,e){return t.assetRoot+"build/"+t.manifest[e]}function d(t,e,s){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=n.forceModuleReload;s.forEach((function(s){var n=p(e,s);n.match(/\.css/)?a(t,n):c(t,n,r)}))}function f(t){return function(t){return t.filter((function(t){var e=s[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 h(t){var e=t.match(/(https?):\/\/([^:/]+)/);return e?{protocol:e[1],hostname:e[2]}:null}function y(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,e=t.currentScript;return e?h(e.src):null}function m(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(-1===t.indexOf("{"))return t;var s=y(e);if(!s)throw new Error("Could not process URL template because script origin is unknown");return t=(t=t.replace("{current_host}",s.hostname)).replace("{current_scheme}",s.protocol)}var b={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?febb29","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?ca5bf9","styles/annotator.css":"styles/annotator.css?50cf61","styles/annotator.css.map":"styles/annotator.css.map?fd8644","styles/highlights.css":"styles/highlights.css?c308d0","styles/highlights.css.map":"styles/highlights.css.map?5be890","styles/katex.min.css":"styles/katex.min.css?28919c","styles/katex.min.css.map":"styles/katex.min.css.map?4daef7","styles/pdfjs-overrides.css":"styles/pdfjs-overrides.css?ed2cb3","styles/pdfjs-overrides.css.map":"styles/pdfjs-overrides.css.map?13b830","styles/sidebar.css":"styles/sidebar.css?c15b17","styles/sidebar.css.map":"styles/sidebar.css.map?72933c","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?f5882b","styles/ui-playground.css.map":"styles/ui-playground.css.map?8f9b77","styles/ui-playground.css":"styles/ui-playground.css?8320bf","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?d15f22","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?deb70c","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?2b5f8b"};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 v=function(e){for(var s={},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(t){console.warn("Could not parse settings from js-hypothesis-config tags",t),o={}}t(s,o)}return s}(document),g=m(v.assetRoot||"https://cdn.hypothes.is/hypothesis/1.1003.0/");if(document.querySelector("hypothesis-app"))!function(t,e){u(t,"fetch",e.apiUrl),u(t,"fetch",e.apiUrl+"links");var s=f(o);d(t,e,[].concat(n(s),["scripts/sidebar.bundle.js","styles/katex.min.css","styles/sidebar.css"]))}(document,{assetRoot:g,manifest:b,apiUrl:v.apiUrl});else{var j=m(v.notebookAppUrl||"https://hypothes.is/notebook"),w=m(v.sidebarAppUrl||"https://hypothes.is/app.html");!function(t,e){if(!t.querySelector('link[type="application/annotator+html"]')){l(t,"sidebar","html",e.sidebarAppUrl),l(t,"notebook","html",e.notebookAppUrl),u(t,"style",p(e,"styles/annotator.css")),l(t,"hypothesis-client","javascript",e.assetRoot+"build/boot.js");var s=f(o),r=[];void 0!==window.PDFViewerApplication&&r.push("styles/pdfjs-overrides.css"),d(t,e,[].concat(n(s),r,["scripts/annotator.bundle.js","styles/highlights.css"]),{forceModuleReload:!0})}}(document,{assetRoot:g,manifest:b,notebookAppUrl:j,sidebarAppUrl:w})}}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,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
|
-
"scripts/annotator.bundle.js": "scripts/annotator.bundle.js?
|
|
2
|
+
"scripts/annotator.bundle.js": "scripts/annotator.bundle.js?febb29",
|
|
3
3
|
"scripts/ui-playground.bundle.js": "scripts/ui-playground.bundle.js?ca5bf9",
|
|
4
|
-
"styles/annotator.css": "styles/annotator.css?
|
|
5
|
-
"styles/annotator.css.map": "styles/annotator.css.map?
|
|
4
|
+
"styles/annotator.css": "styles/annotator.css?50cf61",
|
|
5
|
+
"styles/annotator.css.map": "styles/annotator.css.map?fd8644",
|
|
6
6
|
"styles/highlights.css": "styles/highlights.css?c308d0",
|
|
7
7
|
"styles/highlights.css.map": "styles/highlights.css.map?5be890",
|
|
8
8
|
"styles/katex.min.css": "styles/katex.min.css?28919c",
|
|
9
9
|
"styles/katex.min.css.map": "styles/katex.min.css.map?4daef7",
|
|
10
10
|
"styles/pdfjs-overrides.css": "styles/pdfjs-overrides.css?ed2cb3",
|
|
11
11
|
"styles/pdfjs-overrides.css.map": "styles/pdfjs-overrides.css.map?13b830",
|
|
12
|
-
"styles/sidebar.css": "styles/sidebar.css?
|
|
13
|
-
"styles/sidebar.css.map": "styles/sidebar.css.map?
|
|
14
|
-
"
|
|
15
|
-
"styles/ui-playground.css.map": "styles/ui-playground.css.map?
|
|
16
|
-
"
|
|
17
|
-
"scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?
|
|
18
|
-
"scripts/annotator.bundle.js.map": "scripts/annotator.bundle.js.map?
|
|
19
|
-
"scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?
|
|
12
|
+
"styles/sidebar.css": "styles/sidebar.css?c15b17",
|
|
13
|
+
"styles/sidebar.css.map": "styles/sidebar.css.map?72933c",
|
|
14
|
+
"scripts/ui-playground.bundle.js.map": "scripts/ui-playground.bundle.js.map?f5882b",
|
|
15
|
+
"styles/ui-playground.css.map": "styles/ui-playground.css.map?8f9b77",
|
|
16
|
+
"styles/ui-playground.css": "styles/ui-playground.css?8320bf",
|
|
17
|
+
"scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?d15f22",
|
|
18
|
+
"scripts/annotator.bundle.js.map": "scripts/annotator.bundle.js.map?deb70c",
|
|
19
|
+
"scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?2b5f8b"
|
|
20
20
|
}
|
|
@@ -2,13 +2,13 @@ var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?windo
|
|
|
2
2
|
r(t.target)&&(e||s(t.target))&&a(t.target)}function d(t){r(t.target)&&(t.target.classList.contains("focus-visible")||t.target.hasAttribute("data-focus-visible-added"))&&(n=!0,window.clearTimeout(o),o=window.setTimeout((function(){n=!1}),100),l(t.target))}function f(t){"hidden"===document.visibilityState&&(n&&(e=!0),p())}function p(){document.addEventListener("mousemove",m),document.addEventListener("mousedown",m),document.addEventListener("mouseup",m),document.addEventListener("pointermove",m),document.addEventListener("pointerdown",m),document.addEventListener("pointerup",m),document.addEventListener("touchmove",m),document.addEventListener("touchstart",m),document.addEventListener("touchend",m)}function g(){document.removeEventListener("mousemove",m),document.removeEventListener("mousedown",m),document.removeEventListener("mouseup",m),document.removeEventListener("pointermove",m),document.removeEventListener("pointerdown",m),document.removeEventListener("pointerup",m),
|
|
3
3
|
document.removeEventListener("touchmove",m),document.removeEventListener("touchstart",m),document.removeEventListener("touchend",m)}function m(t){t.target.nodeName&&"html"===t.target.nodeName.toLowerCase()||(e=!1,g())}document.addEventListener("keydown",c,!0),document.addEventListener("mousedown",h,!0),document.addEventListener("pointerdown",h,!0),document.addEventListener("touchstart",h,!0),document.addEventListener("visibilitychange",f,!0),p(),t.addEventListener("focus",u,!0),t.addEventListener("blur",d,!0),t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&t.host?t.host.setAttribute("data-js-focus-visible",""):t.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if("undefined"!=typeof window&&"undefined"!=typeof document){var e;window.applyFocusVisiblePolyfill=t;try{e=new CustomEvent("focus-visible-polyfill-ready")}catch(t){
|
|
4
4
|
(e=document.createEvent("CustomEvent")).initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(e)}"undefined"!=typeof document&&t(document)}();var e,n,o,i,r,s,a={},l=[],c=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function h(t,e){for(var n in e)t[n]=e[n];return t}function u(t){var e=t.parentNode;e&&e.removeChild(t)}function d(t,e,i,r,s){var a={type:t,props:e,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==s?++o:s};return null==s&&null!=n.vnode&&n.vnode(a),a}function f(t){return t.children}function p(t,e){this.props=t,this.context=e}function g(t,e){if(null==e)return t.__?g(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?g(t):null}function m(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return m(t)}}
|
|
5
|
-
function _(t){(!t.__d&&(t.__d=!0)&&i.push(t)&&!v.__r++||s!==n.debounceRendering)&&((s=n.debounceRendering)||r)(v)}function v(){for(var t;v.__r=i.length;)t=i.sort((function(t,e){return t.__v.__b-e.__v.__b})),i=[],t.some((function(t){var e,n,o,i,r,s;t.__d&&(r=(i=(e=t).__v).__e,(s=e.__P)&&(n=[],(o=h({},i)).__v=i.__v+1,T(s,i,o,e.__n,void 0!==s.ownerSVGElement,null!=i.__h?[r]:null,n,null==r?g(i):r,i.__h),A(n,i),i.__e!=r&&m(i)))}))}function y(t,e,n,o,i,r,s,c,h,u){var p,m,_,v,y,C,E
|
|
6
|
-
_.ref&&
|
|
7
|
-
;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof o&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||C(t.style,e,"");if(n)for(e in n)o&&n[e]===o[e]||C(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])r=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+r]=n,n?o||t.addEventListener(e,r?S:
|
|
8
|
-
;try{t:if("function"==typeof S){if(b=e.props,C=(u=S.contextType)&&i[u.__c],
|
|
9
|
-
null!=d.componentWillUpdate&&d.componentWillUpdate(b,d.__s,
|
|
10
|
-
null!=s)for(;v<s.length;v++)if((h=s[v])&&"setAttribute"in h==!!_&&(_?h.localName===_:3===h.nodeType)){t=h,s[v]=null;break}if(null==t){if(null===_)return document.createTextNode(m);t=r?document.createElementNS("http://www.w3.org/2000/svg",_):document.createElement(_,m.is&&m),s=null,c=!1}if(null===_)p===m||c&&t.data===m||(t.data=m);else{if(s=s&&e.call(t.childNodes),d=(p=o.props||a).dangerouslySetInnerHTML,f=m.dangerouslySetInnerHTML,!c){if(null!=s)for(p={},v=0;v<t.attributes.length;v++)p[t.attributes[v].name]=t.attributes[v].value;(f||d)&&(f&&(d&&f.__html==d.__html||f.__html===t.innerHTML)||(t.innerHTML=f&&f.__html||""))}if(function(t,e,n,o,i){var r;for(r in n)"children"===r||"key"===r||r in e||
|
|
11
|
-
null!=s)for(v=s.length;v--;)null!=s[v]&&u(s[v]);c||("value"in m&&void 0!==(v=m.value)&&(v!==t.value||"progress"===_&&!v||"option"===_&&v!==p.value)&&
|
|
5
|
+
function _(t){(!t.__d&&(t.__d=!0)&&i.push(t)&&!v.__r++||s!==n.debounceRendering)&&((s=n.debounceRendering)||r)(v)}function v(){for(var t;v.__r=i.length;)t=i.sort((function(t,e){return t.__v.__b-e.__v.__b})),i=[],t.some((function(t){var e,n,o,i,r,s;t.__d&&(r=(i=(e=t).__v).__e,(s=e.__P)&&(n=[],(o=h({},i)).__v=i.__v+1,T(s,i,o,e.__n,void 0!==s.ownerSVGElement,null!=i.__h?[r]:null,n,null==r?g(i):r,i.__h),A(n,i),i.__e!=r&&m(i)))}))}function y(t,e,n,o,i,r,s,c,h,u){var p,m,_,v,y,C,x,E=o&&o.__k||l,S=E.length;for(n.__k=[],p=0;p<e.length;p++)if(null!=(v=n.__k[p]=null==(v=e[p])||"boolean"==typeof v?null:"string"==typeof v||"number"==typeof v||"bigint"==typeof v?d(null,v,null,null,v):Array.isArray(v)?d(f,{children:v},null,null,null):v.__b>0?d(v.type,v.props,v.key,null,v.__v):v)){if(v.__=n,v.__b=n.__b+1,null===(_=E[p])||_&&v.key==_.key&&v.type===_.type)E[p]=void 0;else for(m=0;m<S;m++){if((_=E[m])&&v.key==_.key&&v.type===_.type){E[m]=void 0;break}_=null}T(t,v,_=_||a,i,r,s,c,h,u),y=v.__e,(m=v.ref)&&_.ref!=m&&(x||(x=[]),
|
|
6
|
+
_.ref&&x.push(_.ref,null,v),x.push(m,v.__c||y,v)),null!=y?(null==C&&(C=y),"function"==typeof v.type&&v.__k===_.__k?v.__d=h=w(v,h,t):h=b(t,v,_,E,y,h),"function"==typeof n.type&&(n.__d=h)):h&&_.__e==h&&h.parentNode!=t&&(h=g(_))}for(n.__e=C,p=S;p--;)null!=E[p]&&("function"==typeof n.type&&null!=E[p].__e&&E[p].__e==n.__d&&(n.__d=g(o,p+1)),N(E[p],E[p]));if(x)for(p=0;p<x.length;p++)R(x[p],x[++p],x[++p])}function w(t,e,n){for(var o,i=t.__k,r=0;i&&r<i.length;r++)(o=i[r])&&(o.__=t,e="function"==typeof o.type?w(o,e,n):b(n,o,o,i,o.__e,e));return e}function b(t,e,n,o,i,r){var s,a,l;if(void 0!==e.__d)s=e.__d,e.__d=void 0;else if(null==n||i!=r||null==i.parentNode)t:if(null==r||r.parentNode!==t)t.appendChild(i),s=null;else{for(a=r,l=0;(a=a.nextSibling)&&l<o.length;l+=2)if(a==i)break t;t.insertBefore(i,r),s=r}return void 0!==s?s:i.nextSibling}function C(t,e,n){"-"===e[0]?t.setProperty(e,n):t[e]=null==n?"":"number"!=typeof n||c.test(e)?n:n+"px"}function x(t,e,n,o,i){var r
|
|
7
|
+
;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof o&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||C(t.style,e,"");if(n)for(e in n)o&&n[e]===o[e]||C(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])r=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+r]=n,n?o||t.addEventListener(e,r?S:E,r):t.removeEventListener(e,r?S:E,r);else if("dangerouslySetInnerHTML"!==e){if(i)e=e.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null!=n&&(!1!==n||"a"===e[0]&&"r"===e[1])?t.setAttribute(e,n):t.removeAttribute(e))}}function E(t){this.l[t.type+!1](n.event?n.event(t):t)}function S(t){this.l[t.type+!0](n.event?n.event(t):t)}function T(t,e,o,i,r,s,a,l,c){var u,d,g,m,_,v,w,b,C,x,E,S=e.type;if(void 0!==e.constructor)return null;null!=o.__h&&(c=o.__h,l=e.__e=o.__e,e.__h=null,s=[l]),(u=n.__b)&&u(e)
|
|
8
|
+
;try{t:if("function"==typeof S){if(b=e.props,C=(u=S.contextType)&&i[u.__c],x=u?C?C.props.value:u.__:i,o.__c?w=(d=e.__c=o.__c).__=d.__E:("prototype"in S&&S.prototype.render?e.__c=d=new S(b,x):(e.__c=d=new p(b,x),d.constructor=S,d.render=L),C&&C.sub(d),d.props=b,d.state||(d.state={}),d.context=x,d.__n=i,g=d.__d=!0,d.__h=[]),null==d.__s&&(d.__s=d.state),null!=S.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=h({},d.__s)),h(d.__s,S.getDerivedStateFromProps(b,d.__s))),m=d.props,_=d.state,g)null==S.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==S.getDerivedStateFromProps&&b!==m&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(b,x),!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(b,d.__s,x)||e.__v===o.__v){d.props=b,d.state=d.__s,e.__v!==o.__v&&(d.__d=!1),d.__v=e,e.__e=o.__e,e.__k=o.__k,e.__k.forEach((function(t){t&&(t.__=e)})),d.__h.length&&a.push(d);break t}
|
|
9
|
+
null!=d.componentWillUpdate&&d.componentWillUpdate(b,d.__s,x),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(m,_,v)}))}d.context=x,d.props=b,d.state=d.__s,(u=n.__r)&&u(e),d.__d=!1,d.__v=e,d.__P=t,u=d.render(d.props,d.state,d.context),d.state=d.__s,null!=d.getChildContext&&(i=h(h({},i),d.getChildContext())),g||null==d.getSnapshotBeforeUpdate||(v=d.getSnapshotBeforeUpdate(m,_)),E=null!=u&&u.type===f&&null==u.key?u.props.children:u,y(t,Array.isArray(E)?E:[E],e,o,i,r,s,a,l,c),d.base=e.__e,e.__h=null,d.__h.length&&a.push(d),w&&(d.__E=d.__=null),d.__e=!1}else null==s&&e.__v===o.__v?(e.__k=o.__k,e.__e=o.__e):e.__e=k(o.__e,e,o,i,r,s,a,c);(u=n.diffed)&&u(e)}catch(t){e.__v=null,(c||null!=s)&&(e.__e=l,e.__h=!!c,s[s.indexOf(l)]=null),n.__e(t,e,o)}}function A(t,e){n.__c&&n.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){n.__e(t,e.__v)}}))}function k(t,n,o,i,r,s,l,c){var h,d,f,p=o.props,m=n.props,_=n.type,v=0;if("svg"===_&&(r=!0),
|
|
10
|
+
null!=s)for(;v<s.length;v++)if((h=s[v])&&"setAttribute"in h==!!_&&(_?h.localName===_:3===h.nodeType)){t=h,s[v]=null;break}if(null==t){if(null===_)return document.createTextNode(m);t=r?document.createElementNS("http://www.w3.org/2000/svg",_):document.createElement(_,m.is&&m),s=null,c=!1}if(null===_)p===m||c&&t.data===m||(t.data=m);else{if(s=s&&e.call(t.childNodes),d=(p=o.props||a).dangerouslySetInnerHTML,f=m.dangerouslySetInnerHTML,!c){if(null!=s)for(p={},v=0;v<t.attributes.length;v++)p[t.attributes[v].name]=t.attributes[v].value;(f||d)&&(f&&(d&&f.__html==d.__html||f.__html===t.innerHTML)||(t.innerHTML=f&&f.__html||""))}if(function(t,e,n,o,i){var r;for(r in n)"children"===r||"key"===r||r in e||x(t,r,null,n[r],o);for(r in e)i&&"function"!=typeof e[r]||"children"===r||"key"===r||"value"===r||"checked"===r||n[r]===e[r]||x(t,r,e[r],n[r],o)}(t,m,p,r,c),f)n.__k=[];else if(v=n.props.children,y(t,Array.isArray(v)?v:[v],n,o,i,r&&"foreignObject"!==_,s,l,s?s[0]:o.__k&&g(o,0),c),
|
|
11
|
+
null!=s)for(v=s.length;v--;)null!=s[v]&&u(s[v]);c||("value"in m&&void 0!==(v=m.value)&&(v!==t.value||"progress"===_&&!v||"option"===_&&v!==p.value)&&x(t,"value",v,p.value,!1),"checked"in m&&void 0!==(v=m.checked)&&v!==t.checked&&x(t,"checked",v,p.checked,!1))}return t}function R(t,e,o){try{"function"==typeof t?t(e):t.current=e}catch(t){n.__e(t,o)}}function N(t,e,o){var i,r;if(n.unmount&&n.unmount(t),(i=t.ref)&&(i.current&&i.current!==t.__e||R(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){n.__e(t,e)}i.base=i.__P=null}if(i=t.__k)for(r=0;r<i.length;r++)i[r]&&N(i[r],e,"function"!=typeof t.type);o||null==t.__e||u(t.__e),t.__e=t.__d=void 0}function L(t,e,n){return this.constructor(t,n)}function P(t,o,i){var r,s,l;n.__&&n.__(t,o),s=(r="function"==typeof i)?null:i&&i.__k||o.__k,l=[],T(o,t=(!r&&i||o).__k=function(t,n,o){var i,r,s,a={};for(s in n)"key"==s?i=n[s]:"ref"==s?r=n[s]:a[s]=n[s];if(arguments.length>2&&(a.children=arguments.length>3?e.call(arguments,2):o),
|
|
12
12
|
"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===a[s]&&(a[s]=t.defaultProps[s]);return d(t,a,i,r,null)}(f,null,[t]),s||a,a,void 0!==o.ownerSVGElement,!r&&i?[i]:s?null:o.firstChild?e.call(o.childNodes):null,l,!r&&i?i:s?s.__e:o.firstChild,r),A(l,t)}e=l.slice,n={__e:function(t,e){for(var n,o,i;e=e.__;)if((n=e.__c)&&!n.__)try{if((o=n.constructor)&&null!=o.getDerivedStateFromError&&(n.setState(o.getDerivedStateFromError(t)),i=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t),i=n.__d),i)return n.__E=n}catch(e){t=e}throw t}},o=0,p.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=h({},this.state),"function"==typeof t&&(t=t(h({},n),this.props)),t&&h(n,t),null!=t&&this.__v&&(e&&this.__h.push(e),_(this))},p.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),_(this))},p.prototype.render=f,i=[],r="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,v.__r=0,
|
|
13
13
|
"undefined"!=typeof window&&window.__PREACT_DEVTOOLS__&&window.__PREACT_DEVTOOLS__.attachPreact("10.6.6",n,{Fragment:f,Component:p});var O={};function M(t){return t.type===f?"Fragment":"function"==typeof t.type?t.type.displayName||t.type.name:"string"==typeof t.type?t.type:"#text"}var I=[],B=[];function D(){return I.length>0?I[I.length-1]:null}var F=!1;function H(t){return"function"==typeof t.type&&t.type!=f}function V(t){for(var e=[t],n=t;null!=n.__o;)e.push(n.__o),n=n.__o;return e.reduce((function(t,e){t+=" in "+M(e);var n=e.__source;return n?t+=" (at "+n.fileName+":"+n.lineNumber+")":F||(F=!0,console.warn("Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons.")),t+"\n"}),"")}var q="function"==typeof WeakMap,U=p.prototype.setState;p.prototype.setState=function(t,e){
|
|
14
14
|
return null==this.__v?null==this.state&&console.warn('Calling "this.setState" inside the constructor of a component is a no-op and might be a bug in your application. Instead, set "this.state = {}" directly.\n\n'+V(D())):null==this.__P&&console.warn('Can\'t call "this.setState" on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.\n\n'+V(this.__v)),U.call(this,t,e)};var W=p.prototype.forceUpdate;function z(t){var e=t.props,n=M(t),o="";for(var i in e)if(e.hasOwnProperty(i)&&"children"!==i){var r=e[i];"function"==typeof r&&(r="function "+(r.displayName||r.name)+"() {}"),r=Object(r)!==r||r.toString?r+"":Object.prototype.toString.call(r),o+=" "+i+"="+JSON.stringify(r)}var s=e.children;return"<"+n+o+(s&&s.length?">..</"+n+">":" />")}p.prototype.forceUpdate=function(t){
|
|
@@ -21,14 +21,14 @@ Object.keys(t).forEach((function(n){var r;try{r=t[n](e,n,o,"prop",null,"SECRET_D
|
|
|
21
21
|
}else if("object"===r)if(i.toString===Object.prototype.toString)for(var a in i)t.call(i,a)&&i[a]&&n.push(a);else n.push(i.toString())}}return n.join(" ")}$.exports?(e.default=e,$.exports=e):window.classNames=e}();var X,Y,Z,G=j.exports,K=0,J=[],Q=n.__b,tt=n.__r,et=n.diffed,nt=n.__c,ot=n.unmount;function it(t,e){n.__h&&n.__h(Y,t,K||e),K=0;var o=Y.__H||(Y.__H={__:[],__h:[]});return t>=o.__.length&&o.__.push({}),o.__[t]}function rt(t){return K=1,function(t,e,n){var o=it(X++,2);return o.t=t,o.__c||(o.__=[n?n(e):pt(void 0,e),function(t){var e=o.t(o.__[0],t);o.__[0]!==e&&(o.__=[e,o.__[1]],o.__c.setState({}))}],o.__c=Y),o.__}(pt,t)}function st(t,e){var o=it(X++,3);!n.__s&&ft(o.__H,e)&&(o.__=t,o.__H=e,Y.__H.__h.push(o))}function at(t,e){var o=it(X++,4);!n.__s&&ft(o.__H,e)&&(o.__=t,o.__H=e,Y.__h.push(o))}function lt(t){return K=5,function(t,e){var n=it(X++,7);return ft(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}((function(){return{current:t}}),[])}function ct(){for(var t;t=J.shift();)if(t.__P)try{t.__H.__h.forEach(ut),
|
|
22
22
|
t.__H.__h.forEach(dt),t.__H.__h=[]}catch(e){t.__H.__h=[],n.__e(e,t.__v)}}n.__b=function(t){Y=null,Q&&Q(t)},n.__r=function(t){tt&&tt(t),X=0;var e=(Y=t.__c).__H;e&&(e.__h.forEach(ut),e.__h.forEach(dt),e.__h=[])},n.diffed=function(t){et&&et(t);var e=t.__c;e&&e.__H&&e.__H.__h.length&&(1!==J.push(e)&&Z===n.requestAnimationFrame||((Z=n.requestAnimationFrame)||function(t){var e,n=function(){clearTimeout(o),ht&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,100);ht&&(e=requestAnimationFrame(n))})(ct)),Y=null},n.__c=function(t,e){e.some((function(t){try{t.__h.forEach(ut),t.__h=t.__h.filter((function(t){return!t.__||dt(t)}))}catch(o){e.some((function(t){t.__h&&(t.__h=[])})),e=[],n.__e(o,t.__v)}})),nt&&nt(t,e)},n.unmount=function(t){ot&&ot(t);var e,o=t.__c;o&&o.__H&&(o.__H.__.forEach((function(t){try{ut(t)}catch(t){e=t}})),e&&n.__e(e,o.__v))};var ht="function"==typeof requestAnimationFrame;function ut(t){var e=Y,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),Y=e}function dt(t){var e=Y;t.__c=t.__(),Y=e}
|
|
23
23
|
function ft(t,e){return!t||t.length!==e.length||e.some((function(e,n){return e!==t[n]}))}function pt(t,e){return"function"==typeof e?e(t):e}var gt=0;function mt(t,e,o,i,r){var s,a,l={};for(a in e)"ref"==a?s=e[a]:l[a]=e[a];var c={type:t,props:l,key:o,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--gt,__source:i,__self:r};if("function"==typeof t&&(s=t.defaultProps))for(a in s)void 0===l[a]&&(l[a]=s[a]);return n.vnode&&n.vnode(c),c}const _t=new Map;function vt({name:t,className:e="",inline:n=!1,title:o=""}){const i=_t.get(t);if(!i)throw new Error(`Icon "${t.toString()}" is not registered`);const r=lt();at((()=>{const t=r.current.querySelector("svg");t&&t.setAttribute("class",e)}),[e,i]);const s={};return o&&(s.title=o),mt("span",{className:G("Hyp-SvgIcon",{"Hyp-SvgIcon--inline":n}),dangerouslySetInnerHTML:{__html:i},ref:r,...s},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/SvgIcon.js",lineNumber:69,columnNumber:5})}
|
|
24
|
-
function yt(t,e){const n="string"==typeof t?Symbol(t):t;return _t.set(n,e),n}var wt="/home/runner/work/frontend-shared/frontend-shared/src/components/buttons.js";function bt({buttonRef:t,classes:e,className:n,icon:o,iconPosition:i="left",size:r="medium",variant:s="normal",expanded:a,pressed:l,type:c="button",...h}){var u;const d=null!==(u=null==h?void 0:h.role)&&void 0!==u?u:"button",f={"aria-label":h.title};return"tab"===d?f["aria-selected"]=l:(f["aria-pressed"]=l,f["aria-expanded"]=a),mt("button",{ref:t,className:G(n,`${n}--${r}`,`${n}--${s}`,{[`${n}--icon-${i}`]:o},e),type:c,...f,...h},void 0,!1,{fileName:wt,lineNumber:82,columnNumber:5})}function Ct({className:t="Hyp-IconButton",...e}){const{icon:n}=e;return mt(bt,{className:t,...e,children:mt(vt,{name:n},void 0,!1,{fileName:wt,lineNumber:109,columnNumber:7})},void 0,!1,{fileName:wt,lineNumber:108,columnNumber:5})}function
|
|
24
|
+
function yt(t,e){const n="string"==typeof t?Symbol(t):t;return _t.set(n,e),n}var wt="/home/runner/work/frontend-shared/frontend-shared/src/components/buttons.js";function bt({buttonRef:t,classes:e,className:n,icon:o,iconPosition:i="left",size:r="medium",variant:s="normal",expanded:a,pressed:l,type:c="button",...h}){var u;const d=null!==(u=null==h?void 0:h.role)&&void 0!==u?u:"button",f={"aria-label":h.title};return"tab"===d?f["aria-selected"]=l:(f["aria-pressed"]=l,f["aria-expanded"]=a),mt("button",{ref:t,className:G(n,`${n}--${r}`,`${n}--${s}`,{[`${n}--icon-${i}`]:o},e),type:c,...f,...h},void 0,!1,{fileName:wt,lineNumber:82,columnNumber:5})}function Ct({className:t="Hyp-IconButton",...e}){const{icon:n}=e;return mt(bt,{className:t,...e,children:mt(vt,{name:n},void 0,!1,{fileName:wt,lineNumber:109,columnNumber:7})},void 0,!1,{fileName:wt,lineNumber:108,columnNumber:5})}function xt({children:t,className:e="Hyp-LabeledButton",...n}){const{icon:o,iconPosition:i="left"}=n;return mt(bt,{className:e,...n,
|
|
25
25
|
children:[o&&"left"===i&&mt(vt,{name:o},void 0,!1,{fileName:wt,lineNumber:127,columnNumber:43}),t,o&&"right"===i&&mt(vt,{name:o},void 0,!1,{fileName:wt,lineNumber:129,columnNumber:44})]},void 0,!0,{fileName:wt,lineNumber:126,columnNumber:5})}yt("checkbox",' <svg\n width="32"\n height="32"\n viewBox="-4 -4 39 39"\n aria-hidden="true"\n focusable="false"\n >\n <rect\n class="hyp-svg-checkbox--background"\n width="35"\n height="35"\n x="-2"\n y="-2"\n stroke="currentColor"\n fill="none"\n stroke-width="3"\n rx="5"\n ry="5"\n />\n <polyline\n class="hyp-svg-checkbox--checkmark"\n points="4,14 12,23 28,5"\n stroke="transparent"\n stroke-width="5"\n fill="none"\n />\n</svg>')
|
|
26
|
-
;var
|
|
27
|
-
className:G("Hyp-Link",e),ref:n,rel:"noopener noreferrer",...o,children:t},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/Link.js",lineNumber:24,columnNumber:5})}yt("cancel",
|
|
26
|
+
;var Et='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 8l3.536-3.536L8 8 4.464 4.464 8 8zm0 0l-3.536 3.536L8 8l3.536 3.536L8 8z"></path></g></svg>\n';yt("cancel",Et);function St({name:t,classes:e="",containerClasses:n="",title:o=""}){const i=_t.get(t);if(!i)throw new Error(`Icon "${t.toString()}" is not registered`);const r=lt();at((()=>{const t=r.current.querySelector("svg");t&&t.setAttribute("class",G("Hyp-Icon",e))}),[e,i]);const s={};return o&&(s.title=o),mt("span",{className:n,dangerouslySetInnerHTML:{__html:i},ref:r,...s},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/Icon.js",lineNumber:60,columnNumber:5})}function Tt({children:t,classes:e="",linkRef:n,...o}){return mt("a",{
|
|
27
|
+
className:G("Hyp-Link",e),ref:n,rel:"noopener noreferrer",...o,children:t},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/Link.js",lineNumber:24,columnNumber:5})}yt("cancel",Et)
|
|
28
28
|
;yt("spinner",'<svg viewBox="0 0 64 64">\n <g stroke-width="6" stroke="currentColor" stroke-linecap="round">\n <line y1="16" y2="28" transform="translate(32,32) rotate(180)">\n <animate attributeName="stroke-opacity" dur="750ms" values="0;1;.8;.65;.45;.3;.15;0" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(225)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".15;0;1;.8;.65;.45;.3;.15" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(270)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".3;.15;0;1;.8;.65;.45;.3" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(315)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".45;.3;.15;0;1;.85;.65;.45" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(0)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".65;.45;.3;.15;0;1;.8;.65;" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(45)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".8;.65;.45;.3;.15;0;1;.8" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(90)">\n <animate attributeName="stroke-opacity" dur="750ms" values="1;.85;.6;.45;.3;.15;0;1;" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(135)">\n <animate attributeName="stroke-opacity" dur="750ms" values="0;1;.8;.65;.45;.3;.15;0" repeatCount="indefinite"></animate>\n </line>\n </g>\n</svg>')
|
|
29
29
|
;const At={
|
|
30
30
|
annotate:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">\n <path fill="currentColor" fill-rule="nonzero" d="M15 0c.27 0 .505.099.703.297A.961.961 0 0116 1v15l-4-3H1a.974.974 0 01-.703-.29A.953.953 0 010 12V1C0 .719.096.482.29.29A.966.966 0 011 0h14zM7 3l-.469.063c-.312.041-.656.187-1.031.437-.375.25-.719.646-1.031 1.188C4.156 5.229 4 6 4 7l.002.063.006.062a.896.896 0 01.008.11l-.002.074-.006.066a1.447 1.447 0 00.43 1.188C4.729 8.854 5.082 9 5.5 9c.417 0 .77-.146 1.063-.438C6.854 8.271 7 7.918 7 7.5c0-.417-.146-.77-.438-1.063A1.447 1.447 0 005.5 6c-.073 0-.146.005-.219.016-.073.01-.14.026-.203.046.177-1.03.542-1.632 1.094-1.804L7 4V3zm5 0l-.469.063c-.312.041-.656.187-1.031.437-.375.25-.719.646-1.031 1.188C9.156 5.229 9 6 9 7l.002.063.006.062a.896.896 0 01.008.11l-.002.074-.006.066a1.447 1.447 0 00.43 1.188c.291.291.645.437 1.062.437.417 0 .77-.146 1.063-.438.291-.291.437-.645.437-1.062 0-.417-.146-.77-.438-1.063A1.447 1.447 0 0010.5 6c-.073 0-.146.005-.219.016-.073.01-.14.026-.203.046.177-1.03.542-1.632 1.094-1.804L12 4V3z"/>\n</svg>\n',
|
|
31
|
-
cancel:
|
|
31
|
+
cancel:Et,caution:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path><line x1="12" y1="9" x2="12" y2="13"></line><line x1="12" y1="17" x2="12.01" y2="17"></line></svg>',"caret-left":'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 12L6 8l4-4"></path></g></svg>',
|
|
32
32
|
"caret-right":'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 4l4 4-4 4"></path></g></svg>',
|
|
33
33
|
hide:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" d="M1.61289944,0.209704612 L1.70710678,0.292893219 L15.7071068,14.2928932 C16.0976311,14.6834175 16.0976311,15.3165825 15.7071068,15.7071068 C15.3466228,16.0675907 14.7793918,16.0953203 14.3871006,15.7902954 L14.2928932,15.7071068 L0.292893219,1.70710678 C-0.0976310729,1.31658249 -0.0976310729,0.683417511 0.292893219,0.292893219 C0.65337718,-0.0675907428 1.22060824,-0.0953202783 1.61289944,0.209704612 Z M2.19604887,5.05494269 C2.65878442,5.35642943 2.78950241,5.97595401 2.48801567,6.43868956 C2.16488794,6.93464068 2,7.46139686 2,8 C2,10.1228856 4.62796016,12 8,12 C8.22060643,12 8.4396701,11.9919023 8.65660209,11.9758355 C9.20737829,11.9350431 9.68693944,12.3484666 9.72773191,12.8992428 C9.76852437,13.450019 9.35510087,13.9295801 8.80432467,13.9703726 C8.53822524,13.9900809 8.26988704,14 8,14 C3.64005335,14 0,11.3999619 0,8 C0,7.06308249 0.28281658,6.15958778 0.812302005,5.34690949 C1.11378875,4.88417394 1.73331332,4.75345595 2.19604887,5.05494269 Z M8,2 C12.3599467,2 16,4.6000381 16,8 C16,8.93691751 15.7171834,9.84041222 15.187698,10.6530905 C14.8862113,11.1158261 14.2666867,11.246544 13.8039511,10.9450573 C13.3412156,10.6435706 13.2104976,10.024046 13.5119843,9.56131044 C13.8351121,9.06535932 14,8.53860314 14,8 C14,5.8771144 11.3720398,4 8,4 C7.77939357,4 7.5603299,4.00809769 7.34339791,4.02416445 C6.79262171,4.06495692 6.31306056,3.65153342 6.27226809,3.10075722 C6.23147563,2.54998102 6.64489913,2.07041987 7.19567533,2.02962741 C7.46177476,2.00991913 7.73011296,2 8,2 Z"></path></svg>',
|
|
34
34
|
highlight:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15H1h11zm-.5-6v2l-1 1v-2l1-1zm.5-7v6h-2V2h2zm0-1h-2 2zm0 8h-2 2z"></path></g></svg>',
|
|
@@ -45,8 +45,8 @@ const t="https://h.readthedocs.io/projects/client/en/latest/publishers/config/#w
|
|
|
45
45
|
const e=t.location.href.match(/#annotations:(query|q):(.+)$/i);if(e)try{return decodeURIComponent(e[2])}catch(t){}return null}()},hostPageSetting:o}}function Gt(t,e){return t.hostPageSetting(e)}const Kt={annotations:{allowInBrowserExt:!0,defaultValue:null,getValue:t=>t.annotations},appType:{allowInBrowserExt:!0,defaultValue:null,getValue:Gt},branding:{defaultValue:null,allowInBrowserExt:!1,getValue:Gt},clientUrl:{allowInBrowserExt:!0,defaultValue:null,getValue:t=>t.clientUrl},enableExperimentalNewNoteButton:{allowInBrowserExt:!1,defaultValue:null,getValue:Gt},group:{allowInBrowserExt:!0,defaultValue:null,getValue:t=>t.group},focus:{allowInBrowserExt:!1,defaultValue:null,getValue:Gt},theme:{allowInBrowserExt:!1,defaultValue:null,getValue:Gt},usernameUrl:{allowInBrowserExt:!1,defaultValue:null,getValue:Gt},onLayoutChange:{allowInBrowserExt:!1,defaultValue:null,getValue:Gt},openSidebar:{allowInBrowserExt:!0,defaultValue:!1,coerce:Xt,getValue:Gt},query:{allowInBrowserExt:!0,defaultValue:null,getValue:t=>t.query},
|
|
46
46
|
requestConfigFromFrame:{allowInBrowserExt:!1,defaultValue:null,getValue:Gt},services:{allowInBrowserExt:!1,defaultValue:null,getValue:Gt},showHighlights:{allowInBrowserExt:!1,defaultValue:"always",getValue:t=>t.showHighlights},notebookAppUrl:{allowInBrowserExt:!0,defaultValue:null,getValue:t=>t.notebookAppUrl},sidebarAppUrl:{allowInBrowserExt:!0,defaultValue:null,getValue:t=>t.sidebarAppUrl},subFrameIdentifier:{allowInBrowserExt:!0,defaultValue:null,getValue:Gt},externalContainerSelector:{allowInBrowserExt:!1,defaultValue:null,getValue:Gt}};function Jt(t="annotator",e=window){const n=Zt(e),o={};let i=function(t){const e={annotator:["clientUrl","subFrameIdentifier"],sidebar:["appType","annotations","branding","enableExperimentalNewNoteButton","externalContainerSelector","focus","group","onLayoutChange","openSidebar","query","requestConfigFromFrame","services","showHighlights","sidebarAppUrl","theme","usernameUrl"],
|
|
47
47
|
notebook:["branding","group","notebookAppUrl","requestConfigFromFrame","services","theme","usernameUrl"]};switch(t){case"annotator":return e.annotator;case"sidebar":return e.sidebar;case"notebook":return e.notebook;case"all":return[...e.annotator,...e.sidebar,...e.notebook];default:throw new Error(`Invalid application context used: "${t}"`)}}(t);return i.forEach((t=>{const i=Kt[t],r=void 0!==i.defaultValue,s=!((a=Yt(e,"sidebar","html")).startsWith("http://")||a.startsWith("https://"));var a;if(!i.allowInBrowserExt&&s)return void(r&&(o[t]=i.defaultValue));const l=i.getValue(n,t);void 0!==l?o[t]=i.coerce?i.coerce(l):l:r&&(o[t]=i.defaultValue)})),o}const Qt={alt:1,ctrl:2,meta:4,shift:8};function te(t,e,{rootElement:n=document.body}={}){const o=n=>{(function(t,e){const n=e.split("+").map((t=>t.toLowerCase()));let o=0,i=null;for(let t of n){const e=Qt[t];if(e)o|=e;else{if(null!==i)throw new Error("Multiple non-modifier keys specified");i=t}}if(!i)throw new Error(`Invalid shortcut: ${e}`)
|
|
48
|
-
;return((t.ctrlKey?Qt.ctrl:0)|(t.metaKey?Qt.meta:0)|(t.altKey?Qt.alt:0)|(t.shiftKey?Qt.shift:0))===o&&function(t){const e={Left:"ArrowLeft",Up:"ArrowUp",Down:"ArrowDown",Right:"ArrowRight",Spacebar:" ",Del:"Delete"};return e[t]?e[t]:t}(t.key).toLowerCase()===i})(n,t)&&e(n)};return n.addEventListener("keydown",o),()=>n.removeEventListener("keydown",o)}function ee(t,e,{rootElement:n=document.body}={}){st((()=>{if(t)return te(t,e,{rootElement:n})}),[t,e,n])}function ne({badgeCount:t}){return mt("span",{className:G("rounded px-1 py-0.5","text-color-text-inverted font-bold bg-grey-7","dim-bg"),children:t})}function oe({arrowDirection:t}){return mt(St,{name:"pointer",classes:G("absolute left-1/2 -translate-x-1/2","h-auto w-auto z-2","text-grey-3 fill-white",{"rotate-180":"down"===t,"top-0 -translate-y-full":"up"===t})})}function ie({badgeCount:t,icon:e,label:n,onClick:o,shortcut:i}){ee(i,o);const r=i?`${n} (${i})`:n;return mt(
|
|
49
|
-
className:G("flex flex-col gap-y-1 items-center py-2.5 px-2","text-annotator-sm leading-none text-grey-7","transition-colors duration-200","dim-item"),
|
|
48
|
+
;return((t.ctrlKey?Qt.ctrl:0)|(t.metaKey?Qt.meta:0)|(t.altKey?Qt.alt:0)|(t.shiftKey?Qt.shift:0))===o&&function(t){const e={Left:"ArrowLeft",Up:"ArrowUp",Down:"ArrowDown",Right:"ArrowRight",Spacebar:" ",Del:"Delete"};return e[t]?e[t]:t}(t.key).toLowerCase()===i})(n,t)&&e(n)};return n.addEventListener("keydown",o),()=>n.removeEventListener("keydown",o)}function ee(t,e,{rootElement:n=document.body}={}){st((()=>{if(t)return te(t,e,{rootElement:n})}),[t,e,n])}function ne({badgeCount:t}){return mt("span",{className:G("rounded px-1 py-0.5","text-color-text-inverted font-bold bg-grey-7","dim-bg"),children:t})}function oe({arrowDirection:t}){return mt(St,{name:"pointer",classes:G("absolute left-1/2 -translate-x-1/2","h-auto w-auto z-2","text-grey-3 fill-white",{"rotate-180":"down"===t,"top-0 -translate-y-full":"up"===t})})}function ie({badgeCount:t,icon:e,label:n,onClick:o,shortcut:i}){ee(i,o);const r=i?`${n} (${i})`:n;return mt(xt,{
|
|
49
|
+
className:G("flex flex-col gap-y-1 items-center py-2.5 px-2","text-annotator-sm leading-none text-grey-7","transition-colors duration-200","dim-item"),onClick:o,title:r,children:[e&&mt(St,{classes:"text-annotator-lg",name:e,title:r}),"number"==typeof t&&mt(ne,{badgeCount:t}),mt("span",{className:"font-normal",children:n})]})}function re({arrowDirection:t,isVisible:e,onCommand:n,annotationCount:o=0}){const i=e?"a":null,r=e?"h":null,s=e?"s":null;return ee(e?"Escape":null,(()=>n("hide"))),mt("div",{className:G("AdderToolbar","absolute select-none bg-white rounded shadow-adderToolbar","border border-solid border-grey-3","opacity-5",{"animate-adderPopUp":"up"===t&&e,"animate-adderPopDown":"down"===t&&e}),dir:"ltr",style:{visibility:e?"visible":"hidden"},children:[mt("div",{className:"flex dim-items-on-hover",children:[mt(ie,{icon:"annotate",onClick:()=>n("annotate"),label:"Annotate",shortcut:i}),mt(ie,{icon:"highlight",onClick:()=>n("highlight"),label:"Highlight",shortcut:r}),o>0&&mt(f,{children:[mt("div",{
|
|
50
50
|
className:G("m-1.5 border-r border-grey-4 border-solid")}),mt(ie,{badgeCount:o,onClick:()=>n("show"),label:"Show",shortcut:s})]})]}),mt(oe,{arrowDirection:t})]})}const se=(t=window)=>t.matchMedia("(pointer: coarse)").matches;function ae(t){const e=t.attachShadow({mode:"open"});!function(t){var e;const n=null===(e=document.querySelector('link[rel="preload"][href*="/build/styles/annotator.css"]'))||void 0===e?void 0:e.href;if(!n)return;const o=document.createElement("link");o.rel="stylesheet",o.href=n,t.appendChild(o)}(e);const n=window.applyFocusVisiblePolyfill;var o;return n&&n(e),(o=e).addEventListener("mouseup",(t=>t.stopPropagation())),o.addEventListener("mousedown",(t=>t.stopPropagation())),o.addEventListener("touchstart",(t=>t.stopPropagation()),{passive:!0}),e}function le(t){return t.toString()+"px"}class ce{constructor(t,e){this._outerContainer=document.createElement("hypothesis-adder"),t.appendChild(this._outerContainer),this._shadowRoot=ae(this._outerContainer),
|
|
51
51
|
Object.assign(this._outerContainer.style,{position:"absolute",top:0,left:0}),this._view=t.ownerDocument.defaultView,this._width=()=>this._shadowRoot.firstChild.getBoundingClientRect().width,this._height=()=>this._shadowRoot.firstChild.getBoundingClientRect().height,this._isVisible=!1,this._arrowDirection="up",this._onAnnotate=e.onAnnotate,this._onHighlight=e.onHighlight,this._onShowAnnotations=e.onShowAnnotations,this.annotationsForSelection=[],this._render()}hide(){this._isVisible=!1,this._render(),Object.assign(this._outerContainer.style,{top:0,left:0})}destroy(){P(null,this._shadowRoot),this._outerContainer.remove()}show(t,e){const{left:n,top:o,arrowDirection:i}=this._calculateTarget(t,e);this._showAt(n,o),this._isVisible=!0,this._arrowDirection=2===i?"up":"down",this._render()}_calculateTarget(t,e){let n,o,i;n=e&&!se()?1:2;const r=Math.min(20,t.width),s=this._width(),a=se()?10:0,l=this._height();return i=e?t.left-s/2+r:t.left+t.width-s/2-r,t.top-l<0&&1===n?n=2:t.top+l>this._view.innerHeight&&(n=1),
|
|
52
52
|
o=2===n?t.top+t.height+10+a:t.top-l-10,i=Math.max(i,0),i=Math.min(i,this._view.innerWidth-s),o=Math.max(o,0),o=Math.min(o,this._view.innerHeight-l),{top:o,left:i,arrowDirection:n}}_findZindex(t,e){if(void 0===document.elementsFromPoint)return 32768;const n=this._width(),o=this._height(),i=[...new Set([...document.elementsFromPoint(t,e),...document.elementsFromPoint(t,e+o),...document.elementsFromPoint(t+n/2,e+o/2),...document.elementsFromPoint(t+n,e),...document.elementsFromPoint(t+n,e+o)])].map((t=>+getComputedStyle(t).zIndex)).filter(Number.isInteger);return i.push(0),Math.max(...i)+1}_showAt(t,e){const n=function(t){let e=t.parentElement;for(;e.parentElement&&"static"===getComputedStyle(e).position;)e=e.parentElement;return e}(this._outerContainer).getBoundingClientRect(),o=this._findZindex(t,e);Object.assign(this._outerContainer.style,{left:le(t-n.left),top:le(e-n.top),zIndex:o})}_render(){P(mt(re,{isVisible:this._isVisible,arrowDirection:this._arrowDirection,onCommand:t=>{switch(t){case"annotate":
|
|
@@ -56,8 +56,8 @@ if(e<0||e>t.childNodes.length)throw new Error("Child node offset is out of range
|
|
|
56
56
|
if(t.focusNode===t.anchorNode)return t.focusOffset<t.anchorOffset;return t.getRangeAt(0).startContainer===t.focusNode}function _e(t,e){try{var n,o;const i=null!==(n=null===(o=e.nodeValue)||void 0===o?void 0:o.length)&&void 0!==n?n:e.childNodes.length;return t.comparePoint(e,0)<=0&&t.comparePoint(e,i)>=0}catch(t){return!1}}function ve(t,e){const n=t.commonAncestorContainer,o=n.ownerDocument.createNodeIterator(n,NodeFilter.SHOW_ALL);let i;for(;i=o.nextNode();)_e(t,i)&&e(i)}function ye(t){if(t.isCollapsed)return null;const e=function(t){const e=/^\s*$/,n=[];ve(t,(t=>{t.nodeType!==Node.TEXT_NODE||t.textContent.match(e)||n.push(t)}));let o=[];return n.forEach((e=>{const n=e.ownerDocument.createRange();if(n.selectNodeContents(e),e===t.startContainer&&n.setStart(e,t.startOffset),e===t.endContainer&&n.setEnd(e,t.endOffset),n.collapsed)return;const i=Array.from(n.getClientRects());n.detach(),o=o.concat(i)})),o}(t.getRangeAt(0));return 0===e.length?null:me(t)?e[0]:e[e.length-1]}function we(t,e="hypothesis-highlight"){
|
|
57
57
|
const n=function(t){if(t.collapsed)return[];let e=t.commonAncestorContainer;if(e.nodeType!==Node.ELEMENT_NODE&&(e=e.parentElement),!e)return[];const n=[],o=e.ownerDocument.createNodeIterator(e,NodeFilter.SHOW_TEXT);let i;for(;i=o.nextNode();){if(!_e(t,i))continue;let e=i;e===t.startContainer&&t.startOffset>0?e.splitText(t.startOffset):(e===t.endContainer&&t.endOffset<e.data.length&&e.splitText(t.endOffset),n.push(e))}return n}(t),o=n.length>0&&ge(n[0]);let i=[],r=null,s=null;n.forEach((t=>{r&&r.nextSibling===t?s.push(t):(s=[t],i.push(s)),r=t}));const a=/^\s*$/;i=i.filter((t=>t.some((t=>!a.test(t.data)))));const l=[];return i.forEach((t=>{const n=document.createElement("hypothesis-highlight");n.className=e;t[0].parentNode.replaceChild(n,t[0]),t.forEach((t=>n.appendChild(t))),l.push(n)})),o||function(t){if(0===t.length)return;const e=function(t){const e=t.closest(".page");return e&&e.querySelector(".canvasWrapper > canvas")||null}(t[0]);if(!e||!e.parentElement)return
|
|
58
58
|
;let n=e.parentElement.querySelector(".hypothesis-highlight-layer");const o=CSS.supports("mix-blend-mode","multiply");if(!n){n=document.createElementNS("http://www.w3.org/2000/svg","svg"),n.setAttribute("class","hypothesis-highlight-layer"),e.parentElement.appendChild(n),e.parentElement.style.position="relative";const t=n.style;t.position="absolute",t.left="0",t.top="0",t.width="100%",t.height="100%",o?t.mixBlendMode="multiply":t.opacity="0.3"}const i=e.getBoundingClientRect(),r=t.map((t=>{const e=t.getBoundingClientRect(),n=document.createElementNS("http://www.w3.org/2000/svg","rect");return n.setAttribute("x",(e.left-i.left).toString()),n.setAttribute("y",(e.top-i.top).toString()),n.setAttribute("width",e.width.toString()),n.setAttribute("height",e.height.toString()),o?n.setAttribute("class","hypothesis-svg-highlight"):n.setAttribute("class","hypothesis-svg-highlight is-opaque"),t.classList.add("is-transparent"),t.svgHighlight=n,n}));n.append(...r)}(l),l}function be(t,e){const n=t.parentNode
|
|
59
|
-
;e.forEach((e=>n.insertBefore(e,t))),t.remove()}function Ce(t){for(let e of t){if(e.parentNode){be(e,Array.from(e.childNodes))}e.svgHighlight&&e.svgHighlight.remove()}}function
|
|
60
|
-
requestAnimationFrame((()=>{const t=function(t){const e=[];return t.forEach((({annotation:t,highlights:n})=>{if(null==n||!n.length)return;const{top:o,bottom:i}=
|
|
59
|
+
;e.forEach((e=>n.insertBefore(e,t))),t.remove()}function Ce(t){for(let e of t){if(e.parentNode){be(e,Array.from(e.childNodes))}e.svgHighlight&&e.svgHighlight.remove()}}function xe(t,e){t.forEach((t=>{if(t.svgHighlight){if(t.svgHighlight.classList.toggle("is-focused",e),e){t.svgHighlight.parentNode.append(t.svgHighlight)}}else t.classList.toggle("hypothesis-highlight-focused",e)}))}function Ee(t){const e=t.map((t=>t.getBoundingClientRect()));return e.reduce(((t,e)=>({top:Math.min(t.top,e.top),left:Math.min(t.left,e.left),bottom:Math.max(t.bottom,e.bottom),right:Math.max(t.right,e.right)})))}class Se{constructor({contentContainer:t,hostRPC:e}){this._hostRPC=e,this._updatePending=!1,this._anchors=[],this._listeners=new kt,this._listeners.add(window,"resize",(()=>this.update())),this._listeners.add(window,"scroll",(()=>this.update())),this._listeners.add(t,"scroll",(()=>this.update()))}destroy(){this._listeners.removeAll()}update(t){t&&(this._anchors=t),this._updatePending||(this._updatePending=!0,
|
|
60
|
+
requestAnimationFrame((()=>{const t=function(t){const e=[];return t.forEach((({annotation:t,highlights:n})=>{if(null==n||!n.length)return;const{top:o,bottom:i}=Ee(n);o>=i||e.push({tag:t.$tag,top:o,bottom:i})})),e.sort(((t,e)=>t.top-e.top)),e}(this._anchors);this._hostRPC.call("anchorsChanged",t),this._updatePending=!1})))}}function Te(t){return t.split("").reverse().join("")}function Ae(t){return(t|-t)>>31&1}function ke(t,e,n,o){let i=t.P[n],r=t.M[n];const s=o>>>31,a=e[n]|s,l=a|r,c=(a&i)+i^i|a;let h=r|~(c|i),u=i&c;const d=Ae(h&t.lastRowMask[n])-Ae(u&t.lastRowMask[n]);return h<<=1,u<<=1,u|=s,h|=Ae(o)-s,i=u|~(l|h),r=h&l,t.P[n]=i,t.M[n]=r,d}function Re(t,e,n){if(0===e.length)return[];n=Math.min(n,e.length);const o=[],i=32,r=Math.ceil(e.length/i)-1,s={P:new Uint32Array(r+1),M:new Uint32Array(r+1),lastRowMask:new Uint32Array(r+1)};s.lastRowMask.fill(1<<31),s.lastRowMask[r]=1<<(e.length-1)%i;const a=new Uint32Array(r+1),l=new Map,c=[];for(let t=0;t<256;t++)c.push(a);for(let t=0;t<e.length;t+=1){
|
|
61
61
|
const n=e.charCodeAt(t);if(l.has(n))continue;const o=new Uint32Array(r+1);l.set(n,o),n<c.length&&(c[n]=o);for(let t=0;t<=r;t+=1){o[t]=0;for(let r=0;r<i;r+=1){const s=t*i+r;if(s>=e.length)continue;e.charCodeAt(s)===n&&(o[t]|=1<<r)}}}let h=Math.max(0,Math.ceil(n/i)-1);const u=new Uint32Array(r+1);for(let t=0;t<=h;t+=1)u[t]=(t+1)*i;u[r]=e.length;for(let t=0;t<=h;t+=1)s.P[t]=-1,s.M[t]=0;for(let d=0;d<t.length;d+=1){const f=t.charCodeAt(d);let p;f<c.length?p=c[f]:(p=l.get(f),void 0===p&&(p=a));let g=0;for(let t=0;t<=h;t+=1)g=ke(s,p,t,g),u[t]+=g;if(u[h]-g<=n&&h<r&&(1&p[h+1]||g<0)){let t;if(h+=1,s.P[h]=-1,s.M[h]=0,h===r){const n=e.length%i;t=0===n?i:n}else t=i;u[h]=u[h-1]+t-g+ke(s,p,h,g)}else for(;h>0&&u[h]>=n+i;)h-=1;h===r&&u[h]<=n&&(u[h]<n&&o.splice(0,o.length),o.push({start:-1,end:d+1,errors:u[h]}),n=u[h])}return o}function Ne(t,e,n){return function(t,e,n){const o=Te(e);return n.map((n=>{const i=Math.max(0,n.end-e.length-n.errors);return{
|
|
62
62
|
start:Re(Te(t.slice(i,n.end)),o,n.errors).reduce(((t,e)=>n.end-e.end<t?n.end-e.end:t),n.end),end:n.end,errors:n.errors}}))}(t,e,Re(t,e,n))}function Le(t,e,n){let o=0,i=[];for(;-1!==o;)o=t.indexOf(e,o),-1!==o&&(i.push({start:o,end:o+e.length,errors:0}),o+=1);return i.length>0?i:Ne(t,e,n)}function Pe(t,e){if(0===e.length||0===t.length)return 0;return 1-Le(t,e,e.length)[0].errors/e.length}function Oe(t,e,n={}){if(0===e.length)return null;const o=Math.min(256,e.length/2),i=Le(t,e,o);if(0===i.length)return null;const r=o=>{const i=1-o.errors/e.length,r=n.prefix?Pe(t.slice(Math.max(0,o.start-n.prefix.length),o.start),n.prefix):1,s=n.suffix?Pe(t.slice(o.end,o.end+n.suffix.length),n.suffix):1;let a=1;if("number"==typeof n.hint){a=1-Math.abs(o.start-n.hint)/t.length}return(50*i+20*r+20*s+2*a)/92},s=i.map((t=>({start:t.start,end:t.end,score:r(t)})));return s.sort(((t,e)=>e.score-t.score)),s[0]}function Me(t){const e=function(t){const e=t.nodeName.toLowerCase();let n=e;return"#text"===e&&(n="text()"),n
|
|
63
63
|
}(t),n=function(t){let e=0,n=t;for(;n;)n.nodeName===t.nodeName&&(e+=1),n=n.previousSibling;return e}(t);return`${e}[${n}]`}function Ie(t,e){let n="",o=t;for(;o!==e;){if(!o)throw new Error("Node is not a descendant of root");n=Me(o)+"/"+n,o=o.parentNode}return n="/"+n,n=n.replace(/\/$/,""),n}function Be(t,e,n){e=e.toUpperCase();let o=-1;for(let i=0;i<t.children.length;i++){const r=t.children[i];if(r.nodeName.toUpperCase()===e&&(++o,o===n))return r}return null}function De(t,e=document.body){try{return function(t,e){if(null===t.match(/^(\/[A-Za-z0-9-]+(\[[0-9]+\])?)+$/))throw new Error("Expression is not a simple XPath");const n=t.split("/");let o=e;n.shift();for(let t of n){let e,n;const i=t.indexOf("[");if(-1!==i){e=t.slice(0,i);const o=t.slice(i+1,t.indexOf("]"));if(n=parseInt(o)-1,n<0)return null}else e=t,n=0;const r=Be(o,e,n);if(!r)return null;o=r}return o}(t,e)}catch(n){return document.evaluate("."+t,e,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue}}class Fe{constructor(t,e){this.root=t,
|
|
@@ -73,8 +73,8 @@ if("requestAnimationFrame"in window)return window.requestAnimationFrame(t);setTi
|
|
|
73
73
|
;for(var a=[];o;)if(e.debug&&console.log("Scrolling parent node",o),r(o,i)&&(s?s(o,rn):rn(o))&&(i++,a.push(o)),!(o=an(o))){l("complete");break}return a.reduce(((n,o,i)=>function(t,e,n,o,i){var r,s=!e._scrollSettings,a=e._scrollSettings,l=Date.now(),c={passive:!0};function h(t){e._scrollSettings=null,e.parentElement&&e.parentElement._scrollSettings&&e.parentElement._scrollSettings.end(t),n.debug&&console.log("Scrolling ended with type",t,"for",e),i(t),r&&(e.removeEventListener("touchstart",r,c),e.removeEventListener("wheel",r,c))}a&&a.end("canceled");var u=n.maxSynchronousAlignments;return null==u&&(u=3),e._scrollSettings={startTime:l,endIterations:0,target:t,time:n.time,ease:n.ease,align:n.align,isWindow:n.isWindow||on,maxSynchronousAlignments:u,end:h,scrollAncestor:o},"cancellable"in n&&!n.cancellable||(r=h.bind(null,"canceled"),e.addEventListener("touchstart",r,c),e.addEventListener("wheel",r,c)),s&&nn(e),r}(t,o,e,a[i+1],l)),null)}function l(t){--i||n&&n(t)}};function cn(t,e,n){return t+n*(e-t)}
|
|
74
74
|
async function hn(t,e,{maxDuration:n=500}={}){const o=t.scrollTop,i=e,r=Date.now(),s=Math.min(Math.abs(i-o)/3,n);let a=0;for(;a<1;)await new Promise((t=>{requestAnimationFrame(t)})),a=Math.min(1,(Date.now()-r)/s),t.scrollTop=cn(o,i,a)}class un{constructor(t=document.body){this.container=t,this.anchor=Ue,this.describe=We,this._htmlMeta=new $e,this.sideBySideEnabled=!1}canAnnotate(){return!0}destroy(){}contentContainer(){return this.container}fitSideBySide(t){return!!this.sideBySideEnabled&&(t.expanded?(this._activateSideBySide(t.width),!0):(this._deactivateSideBySide(),!1))}_activateSideBySide(t){const e=t+12;tn((()=>{document.body.style.marginRight=`${e}px`;const t=function(t){const e=new Map,n=new Map,o=Ze.join(","),i=Array.from(t.querySelectorAll(o)).map((t=>({rect:t.getBoundingClientRect(),textLength:t.textContent.length}))).filter((({rect:t})=>t.width>0&&t.height>0)).sort(((t,e)=>e.textLength-t.textLength)).slice(0,15);if(i.forEach((({rect:t})=>{var o,i;let r=null!==(o=e.get(t.left))&&void 0!==o?o:0;r+=1,
|
|
75
75
|
e.set(t.left,r);let s=null!==(i=n.get(t.right))&&void 0!==i?i:0;s+=1,n.set(t.right,s)})),0===e.size||0===n.size)return null;const r=[...e.entries()].sort(((t,e)=>e[1]-t[1])),s=[...n.entries()].sort(((t,e)=>e[1]-t[1])),[a]=r[0],[l]=s[0];return{left:a,right:l}}(document.body);if(t){const n=Math.max(0,window.innerWidth-e-t.right);if(n>0){const t=Math.max(0,e-n);document.body.style.marginRight=`${t}px`}t.left<12&&(document.body.style.marginLeft="12px")}else document.body.style.marginLeft="",document.body.style.marginRight=""}))}_deactivateSideBySide(){tn((()=>{document.body.style.marginLeft="",document.body.style.marginRight=""}))}async getMetadata(){return this._htmlMeta.getDocumentMetadata()}async uri(){return this._htmlMeta.uri()}async scrollToAnchor(t){var e;const n=null===(e=t.highlights)||void 0===e?void 0:e[0];n&&await async function(t,{maxDuration:e=500}={}){const n=t.closest("body");n&&"BODY"!==n.tagName&&Object.defineProperty(n,"tagName",{value:"BODY",configurable:!0}),await new Promise((n=>ln(t,{time:e
|
|
76
|
-
},n)))}(n)}}var dn=/^\s+|\s+$/g,fn=/^[-+]0x[0-9a-f]+$/i,pn=/^0b[01]+$/i,gn=/^0o[0-7]+$/i,mn=parseInt,_n="object"==typeof t&&t&&t.Object===Object&&t,vn="object"==typeof self&&self&&self.Object===Object&&self,yn=_n||vn||Function("return this")(),wn=Object.prototype.toString,bn=Math.max,Cn=Math.min,
|
|
77
|
-
h?f(t):s}function g(t){var n=t-l;return void 0===l||n>=e||n<0||u&&t-c>=r}function m(){var t=
|
|
76
|
+
},n)))}(n)}}var dn=/^\s+|\s+$/g,fn=/^[-+]0x[0-9a-f]+$/i,pn=/^0b[01]+$/i,gn=/^0o[0-7]+$/i,mn=parseInt,_n="object"==typeof t&&t&&t.Object===Object&&t,vn="object"==typeof self&&self&&self.Object===Object&&self,yn=_n||vn||Function("return this")(),wn=Object.prototype.toString,bn=Math.max,Cn=Math.min,xn=function(){return yn.Date.now()};function En(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Sn(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==wn.call(t)}(t))return NaN;if(En(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=En(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(dn,"");var n=pn.test(t);return n||gn.test(t)?mn(t.slice(2),n?2:8):fn.test(t)?NaN:+t}var Tn=function(t,e,n){var o,i,r,s,a,l,c=0,h=!1,u=!1,d=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function f(e){var n=o,r=i;return o=i=void 0,c=e,s=t.apply(r,n)}function p(t){return c=t,a=setTimeout(m,e),
|
|
77
|
+
h?f(t):s}function g(t){var n=t-l;return void 0===l||n>=e||n<0||u&&t-c>=r}function m(){var t=xn();if(g(t))return _(t);a=setTimeout(m,function(t){var n=e-(t-l);return u?Cn(n,r-(t-c)):n}(t))}function _(t){return a=void 0,d&&o?f(t):(o=i=void 0,s)}function v(){var t=xn(),n=g(t);if(o=arguments,i=this,l=t,n){if(void 0===a)return p(l);if(u)return a=setTimeout(m,e),f(l)}return void 0===a&&(a=setTimeout(m,e)),s}return e=Sn(e)||0,En(n)&&(h=!!n.leading,r=(u="maxWait"in n)?bn(Sn(n.maxWait)||0,e):r,d="trailing"in n?!!n.trailing:d),v.cancel=function(){void 0!==a&&clearTimeout(a),c=0,o=l=i=a=void 0},v.flush=function(){return void 0===a?s:_(xn())},v};let An=new Set;function kn(...t){const e=t.join();An.has(e)||(console.warn(...t),An.add(e))}kn.reset=()=>{An.clear()};const Rn=0,Nn=3,Ln=new Map,Pn=new Map;function On(t,e){return`${t}:${e}`}function Mn(t){var e;const n="closest"in t?t:t.parentElement;return null!==(e=null==n?void 0:n.closest(".textLayer"))&&void 0!==e?e:null}function In(){return PDFViewerApplication.pdfViewer}
|
|
78
78
|
async function Bn(t){const e=In();let n=e.getPageView(t);return n&&n.pdfPage||(n=await new Promise((n=>{const o=()=>{e.eventBus?e.eventBus.off("pagesloaded",o):document.removeEventListener("pagesloaded",o),n(e.getPageView(t))};e.eventBus?e.eventBus.on("pagesloaded",o):document.addEventListener("pagesloaded",o)}))),n}function Dn(t){const e=Ln.get(t);if(e)return e;const n=(async()=>{const e=await Bn(t);let n=(await e.pdfPage.getTextContent({normalizeWhitespace:!0})).items;return n.length>0&&!("hasEOL"in n[0])&&(n=n.filter((t=>/\S/.test(t.str)))),n.map((t=>t.str)).join("")})();return Ln.set(t,n),n}async function Fn(t){const e=In();let n=0,o=0,i="";for(let r=0;r<e.pagesCount;r++)if(i=await Dn(r),n=o,o+=i.length,o>=t)return{index:r,offset:n,text:i};return{index:e.pagesCount-1,offset:n,text:i}}async function Hn(t,e,n){const[o,i]=await Promise.all([Bn(t),Dn(t)]);if(o.renderingState===Nn&&o.textLayer&&o.textLayer.renderingDone){const t=o.textLayer.textLayerDiv
|
|
79
79
|
;i!==t.textContent&&kn("PDF text layer content does not match page text. This will cause anchoring misalignment.");const r=new fe(t,e),s=new fe(t,n);return new pe(r,s).toRange()}const r=function(t){let e=t.querySelector(".annotator-placeholder");return e||(e=document.createElement("span"),e.classList.add("annotator-placeholder"),e.textContent="Loading annotations...",t.appendChild(e),e)}(o.div),s=document.createRange();return s.setStartBefore(r),s.setEndAfter(r),s}function Vn(t){const e=[];let n="";for(let o=0;o<t.length;o++){const i=t[o];" "!==i&&"\t"!==i&&"\n"!==i&&(n+=i,e.push(o))}return[n,e]}async function qn(t,e){const n=e.find((t=>"TextQuoteSelector"===t.type));if(!n)throw new Error("No quote selector found");const o=e.find((t=>"TextPositionSelector"===t.type));if(o){try{const{index:t,offset:e,text:i}=await Fn(o.start),r=o.start-e,s=o.end-e,a=i.substring(r,s);if(n.exact!==a)throw new Error("quote mismatch");return await Hn(t,r,s)}catch{}try{const t=On(n.exact,o.start),e=Pn.get(t);if(e){
|
|
80
80
|
const{pageIndex:t,anchor:n}=e;return await Hn(t,n.start,n.end)}}catch{}}return async function(t,e){const n=In().pagesCount,o=Array(n).fill(0).map(((t,e)=>e));let i,r;if(e){const{index:t,offset:n}=await Fn(e);i=t,r=e-n,o.sort(((e,n)=>Math.abs(e-t)-Math.abs(n-t)))}const[s]=void 0!==t.prefix?Vn(t.prefix):[],[a]=void 0!==t.suffix?Vn(t.suffix):[],[l]=Vn(t.exact);let c;for(let t of o){const e=await Dn(t),[n,o]=Vn(e);let h;if(void 0!==i&&void 0!==r){let n;for(n=t<i?e.length:t===i?r:0,h=0;h<o.length&&o[h]<n;)++h}const u=Oe(n,l,{prefix:s,suffix:a,hint:h});if(u&&(!c||u.score>c.match.score)){c={page:t,match:{start:o[u.start],end:o[u.end-1]+1,score:u.score}};const e=n.slice(u.start,u.end)===l,i=void 0!==s&&n.slice(Math.max(0,u.start-s.length),u.start)===s,r=void 0!==a&&n.slice(u.end,a.length)===a,h=void 0!==s||void 0!==a;if(e&&(i||r||!h))break}}if(c){const{page:n,match:o}=c;if(e){const i=On(t.exact,e);Pn.set(i,{pageIndex:n,anchor:o})}return Hn(n,o.start,o.end)}throw new Error("Quote not found")}(n,null==o?void 0:o.start)
|
|
@@ -97,35 +97,35 @@ if(!t.range)return null;try{return t.range.toRange()}catch{return null}}function
|
|
|
97
97
|
this._listeners=new kt,this._setupElementEvents(),this._focusedAnnotations=new Set}_setupElementEvents(){const t=t=>{this._sideBySideActive||go(t).length||this._sidebarRPC.call("closeSidebar")};this._listeners.add(this.element,"mouseup",(t=>{const{target:e,metaKey:n,ctrlKey:o}=t,i=go(e);if(i.length&&this._highlightsVisible){const t=n||o;this.selectAnnotations(i,t)}})),this._listeners.add(this.element,"mousedown",(({target:e})=>{t(e)})),this._listeners.add(this.element,"touchstart",(({target:e})=>{t(e)})),this._listeners.add(this.element,"mouseover",(({target:t})=>{const e=go(t);e.length&&this._highlightsVisible&&this._sidebarRPC.call("focusAnnotations",e)})),this._listeners.add(this.element,"mouseout",(()=>{this._highlightsVisible&&this._sidebarRPC.call("focusAnnotations",[])})),this._listeners.add(window,"resize",(()=>this._repositionAdder()))}async getDocumentInfo(){const[t,e]=await Promise.all([this._integration.uri(),this._integration.getMetadata()]);return{uri:ze(t),metadata:e,
|
|
98
98
|
frameIdentifier:this._frameIdentifier}}_repositionAdder(){var t;if(!1===this._isAdderVisible)return;const e=null===(t=window.getSelection())||void 0===t?void 0:t.getRangeAt(0);e&&this._onSelection(e)}async _connectHost(t){this._hostRPC.on("clearSelection",(()=>{uo(document)&&(this._informHostOnNextSelectionClear=!1,_o())})),this._hostRPC.on("createAnnotation",(()=>this.createAnnotation())),this._hostRPC.on("focusAnnotations",(t=>this._focusAnnotations(t))),this._hostRPC.on("scrollToClosestOffScreenAnchor",((t,e)=>this._scrollToClosestOffScreenAnchor(t,e))),this._hostRPC.on("selectAnnotations",((t,e)=>this.selectAnnotations(t,e))),this._hostRPC.on("sidebarLayoutChanged",(e=>{var n,o;((n=window)===(o=t)||n.parent===o&&n.frameElement&&n.frameElement.getBoundingClientRect().width/n.parent.innerWidth>=.8)&&this.fitSideBySide(e)}));const e=await this._portFinder.discover("host");this._hostRPC.connect(e)}async _connectSidebar(){this._sidebarRPC.on("focusAnnotations",(t=>this._focusAnnotations(t))),
|
|
99
99
|
this._sidebarRPC.on("scrollToAnnotation",(t=>{const e=this.anchors.find((e=>e.annotation.$tag===t));if(null==e||!e.highlights)return;const n=mo(e);if(!n)return;const o=new CustomEvent("scrolltorange",{bubbles:!0,cancelable:!0,detail:n});this.element.dispatchEvent(o)&&this._integration.scrollToAnchor(e)})),this._sidebarRPC.on("setHighlightsVisible",(t=>{this.setHighlightsVisible(t)})),this._sidebarRPC.on("deleteAnnotation",(t=>this.detach(t))),this._sidebarRPC.on("loadAnnotations",(t=>t.forEach((t=>this.anchor(t))))),this._portFinder.discover("sidebar").then((t=>{this._sidebarRPC.connect(t)})),this.getDocumentInfo().then((t=>this._sidebarRPC.call("documentInfoChanged",t)))}destroy(){this._portFinder.destroy(),this._hostRPC.destroy(),this._sidebarRPC.destroy(),this._listeners.removeAll(),this._selectionObserver.disconnect(),this._adder.destroy(),this._bucketBarClient.destroy(),function(t){Ce(Array.from(t.querySelectorAll("hypothesis-highlight")))}(this.element),this._integration.destroy()}async anchor(t){
|
|
100
|
-
const e=t=>{const e=mo(t);if(!e)return;const n=we(e);n.forEach((e=>{e._annotation=t.annotation})),t.highlights=n,this._focusedAnnotations.has(t.annotation.$tag)&&
|
|
101
|
-
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:"+Nt(8)};return this._sidebarRPC.call("createAnnotation",r),this.anchor(r),_o(),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);
|
|
100
|
+
const e=t=>{const e=mo(t);if(!e)return;const n=we(e);n.forEach((e=>{e._annotation=t.annotation})),t.highlights=n,this._focusedAnnotations.has(t.annotation.$tag)&&xe(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=pe.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),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&&Ce(e.highlights);this._updateAnchors(n,e)}_updateAnchors(t,e){this.anchors=t,
|
|
101
|
+
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:"+Nt(8)};return this._sidebarRPC.call("createAnnotation",r),this.anchor(r),_o(),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);xe(e.highlights,n)}this._sidebarRPC.call("focusAnnotations",t)}_scrollToClosestOffScreenAnchor(t,e){const n=function(t,e){let n=null,o=0;for(let r of t){var i;if(null===(i=r.highlights)||void 0===i||!i.length)continue;const t=Ee(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
|
|
102
102
|
}(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=me(e),o=ye(e);o?(this.selectedRanges=[t],this._hostRPC.call("textSelected"),this._adder.annotationsForSelection=po(),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")}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(){
|
|
103
|
-
return this._sideBySideActive}get focusedAnnotationTags(){return this._focusedAnnotations}}function yo(t,e){const n=new URL(t),o=new URLSearchParams;return o.append("config",JSON.stringify(e)),n.hash=o.toString(),n.toString()}function wo(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.
|
|
104
|
-
function Co({eventBus:t,config:e}){const[n,o]=rt(0),[i,r]=rt(!0),[s,a]=rt(null),l=lt(""),c=lt(null);st((()=>(l.current=document.body.style.overflow,()=>{document.body.style.overflow=l.current})),[]),st((()=>{document.body.style.overflow=i?l.current:"hidden"}),[i]),st((()=>{const e=t.createEmitter();return e.subscribe("openNotebook",(t=>{r(!1),o((t=>t+1)),a(t)})),c.current=e,()=>{e.destroy()}}),[t]);return null===s?null:mt("div",{className:G("fixed z-max top-0 left-0 right-0 bottom-0 p-3 bg-black/50",{hidden:i}),"data-testid":"notebook-outer",children:mt("div",{className:"relative w-full h-full","data-testid":"notebook-inner",children:[mt("div",{className:"absolute right-0 text-xl m-3",children:mt(Ct,{icon:"cancel",title:"Close the Notebook",onClick:()=>{var t;r(!0),null===(t=c.current)||void 0===t||t.publish("closeNotebook")},variant:"dark"})}),mt(bo,{config:e,groupId:s},n)]})})}class
|
|
105
|
-
t.appendChild(this._outerContainer),this.shadowRoot=ae(this._outerContainer),P(mt(Co,{eventBus:e,config:n}),this.shadowRoot)}destroy(){P(null,this.shadowRoot),this._outerContainer.remove()}}var
|
|
106
|
-
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){return"function"==typeof t?t.apply(e&&e[0]||i,e):t}function w(t,e){return t===i?e:t}function b(t,e,n){f(S(e),(function(e){t.addEventListener(e,n,!1)}))}function C(t,e,n){f(S(e),(function(e){t.removeEventListener(e,n,!1)}))}function
|
|
103
|
+
return this._sideBySideActive}get focusedAnnotationTags(){return this._focusedAnnotations}}function yo(t,e){const n=new URL(t),o=new URLSearchParams;return o.append("config",JSON.stringify(e)),n.hash=o.toString(),n.toString()}function wo(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.1003.0";const i=new URL(window.location.href);if(i.hash="",o.hostURL=i.toString(),(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),t.onHelpRequest&&(t.onHelpRequestProvided=!0)}return o}function bo({config:t,groupId:e}){return mt("iframe",{title:"Hypothesis annotation notebook",className:"h-full w-full border-0",allowFullScreen:!0,src:yo(t.notebookAppUrl,{...wo(t.notebookAppUrl,t),group:e})})}
|
|
104
|
+
function Co({eventBus:t,config:e}){const[n,o]=rt(0),[i,r]=rt(!0),[s,a]=rt(null),l=lt(""),c=lt(null);st((()=>(l.current=document.body.style.overflow,()=>{document.body.style.overflow=l.current})),[]),st((()=>{document.body.style.overflow=i?l.current:"hidden"}),[i]),st((()=>{const e=t.createEmitter();return e.subscribe("openNotebook",(t=>{r(!1),o((t=>t+1)),a(t)})),c.current=e,()=>{e.destroy()}}),[t]);return null===s?null:mt("div",{className:G("fixed z-max top-0 left-0 right-0 bottom-0 p-3 bg-black/50",{hidden:i}),"data-testid":"notebook-outer",children:mt("div",{className:"relative w-full h-full","data-testid":"notebook-inner",children:[mt("div",{className:"absolute right-0 text-xl m-3",children:mt(Ct,{icon:"cancel",title:"Close the Notebook",onClick:()=>{var t;r(!0),null===(t=c.current)||void 0===t||t.publish("closeNotebook")},variant:"dark"})}),mt(bo,{config:e,groupId:s},n)]})})}class xo{constructor(t,e,n={}){this._outerContainer=document.createElement("hypothesis-notebook"),
|
|
105
|
+
t.appendChild(this._outerContainer),this.shadowRoot=ae(this._outerContainer),P(mt(Co,{eventBus:e,config:n}),this.shadowRoot)}destroy(){P(null,this.shadowRoot),this._outerContainer.remove()}}var Eo={exports:{}};!function(t){!function(e,n,o,i){var r,s=["","webkit","Moz","MS","ms","o"],a=n.createElement("div"),l=Math.round,c=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(){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)}}
|
|
106
|
+
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){return"function"==typeof t?t.apply(e&&e[0]||i,e):t}function w(t,e){return t===i?e:t}function b(t,e,n){f(S(e),(function(e){t.addEventListener(e,n,!1)}))}function C(t,e,n){f(S(e),(function(e){t.removeEventListener(e,n,!1)}))}function x(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function E(t,e){return t.indexOf(e)>-1}
|
|
107
107
|
function S(t){return t.trim().split(/\s+/g)}function T(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var o=0;o<t.length;){if(n&&t[o][n]==e||!n&&t[o]===e)return o;o++}return-1}function A(t){return Array.prototype.slice.call(t,0)}function k(t,e,n){for(var o=[],i=[],r=0;r<t.length;){var s=e?t[r][e]:t[r];T(i,s)<0&&o.push(t[r]),i[r]=s,r++}return n&&(o=e?o.sort((function(t,n){return t[e]>n[e]})):o.sort()),o}function R(t,e){for(var n,o,r=e[0].toUpperCase()+e.slice(1),a=0;a<s.length;){if((o=(n=s[a])?n+r:e)in t)return o;a++}return i}var N=1;function L(t){var n=t.ownerDocument||t;return n.defaultView||n.parentWindow||e}var P="ontouchstart"in e,O=R(e,"PointerEvent")!==i,M=P&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),I="touch",B="mouse",D=24,F=["x","y"],H=["clientX","clientY"];function V(t,e){var n=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){y(t.options.enable,[t])&&n.handler(e)},this.init()}function q(t,e,n){
|
|
108
108
|
var o=n.pointers.length,r=n.changedPointers.length,s=1&e&&o-r==0,a=12&e&&o-r==0;n.isFirst=!!s,n.isFinal=!!a,s&&(t.session={}),n.eventType=e,function(t,e){var n=t.session,o=e.pointers,r=o.length;n.firstInput||(n.firstInput=U(e));r>1&&!n.firstMultiple?n.firstMultiple=U(e):1===r&&(n.firstMultiple=!1);var s=n.firstInput,a=n.firstMultiple,l=a?a.center:s.center,u=e.center=W(o);e.timeStamp=h(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=X(l,u),e.distance=j(l,u),function(t,e){var n=e.center,o=t.offsetDelta||{},i=t.prevDelta||{},r=t.prevInput||{};1!==e.eventType&&4!==r.eventType||(i=t.prevDelta={x:r.deltaX||0,y:r.deltaY||0},o=t.offsetDelta={x:n.x,y:n.y});e.deltaX=i.x+(n.x-o.x),e.deltaY=i.y+(n.y-o.y)}(n,e),e.offsetDirection=$(e.deltaX,e.deltaY);var d=z(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=d.x,e.overallVelocityY=d.y,e.overallVelocity=c(d.x)>c(d.y)?d.x:d.y,e.scale=a?(f=a.pointers,p=o,j(p[0],p[1],H)/j(f[0],f[1],H)):1,e.rotation=a?function(t,e){return X(e[1],e[0],H)+X(t[1],t[0],H)}(a.pointers,o):0,
|
|
109
|
-
e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length,function(t,e){var n,o,r,s,a=t.lastInterval||e,l=e.timeStamp-a.timeStamp;if(8!=e.eventType&&(l>25||a.velocity===i)){var h=e.deltaX-a.deltaX,u=e.deltaY-a.deltaY,d=z(l,h,u);o=d.x,r=d.y,n=c(d.x)>c(d.y)?d.x:d.y,s=$(h,u),t.lastInterval=e}else n=a.velocity,o=a.velocityX,r=a.velocityY,s=a.direction;e.velocity=n,e.velocityX=o,e.velocityY=r,e.direction=s}(n,e);var f,p;var g=t.element;
|
|
109
|
+
e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length,function(t,e){var n,o,r,s,a=t.lastInterval||e,l=e.timeStamp-a.timeStamp;if(8!=e.eventType&&(l>25||a.velocity===i)){var h=e.deltaX-a.deltaX,u=e.deltaY-a.deltaY,d=z(l,h,u);o=d.x,r=d.y,n=c(d.x)>c(d.y)?d.x:d.y,s=$(h,u),t.lastInterval=e}else n=a.velocity,o=a.velocityX,r=a.velocityY,s=a.direction;e.velocity=n,e.velocityX=o,e.velocityY=r,e.direction=s}(n,e);var f,p;var g=t.element;x(e.srcEvent.target,g)&&(g=e.srcEvent.target);e.target=g}(t,n),t.emit("hammer.input",n),t.recognize(n),t.session.prevInput=n}function U(t){for(var e=[],n=0;n<t.pointers.length;)e[n]={clientX:l(t.pointers[n].clientX),clientY:l(t.pointers[n].clientY)},n++;return{timeStamp:h(),pointers:e,center:W(e),deltaX:t.deltaX,deltaY:t.deltaY}}function W(t){var e=t.length;if(1===e)return{x:l(t[0].clientX),y:l(t[0].clientY)};for(var n=0,o=0,i=0;i<e;)n+=t[i].clientX,o+=t[i].clientY,i++;return{x:l(n/e),y:l(o/e)}}function z(t,e,n){
|
|
110
110
|
return{x:e/t||0,y:n/t||0}}function $(t,e){return t===e?1:c(t)>=c(e)?t<0?2:4:e<0?8:16}function j(t,e,n){n||(n=F);var o=e[n[0]]-t[n[0]],i=e[n[1]]-t[n[1]];return Math.sqrt(o*o+i*i)}function X(t,e,n){n||(n=F);var o=e[n[0]]-t[n[0]],i=e[n[1]]-t[n[1]];return 180*Math.atan2(i,o)/Math.PI}V.prototype={handler:function(){},init:function(){this.evEl&&b(this.element,this.evEl,this.domHandler),this.evTarget&&b(this.target,this.evTarget,this.domHandler),this.evWin&&b(L(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&C(this.element,this.evEl,this.domHandler),this.evTarget&&C(this.target,this.evTarget,this.domHandler),this.evWin&&C(L(this.element),this.evWin,this.domHandler)}};var Y={mousedown:1,mousemove:2,mouseup:4},Z="mousedown",G="mousemove mouseup";function K(){this.evEl=Z,this.evWin=G,this.pressed=!1,V.apply(this,arguments)}_(K,V,{handler:function(t){var e=Y[t.type];1&e&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{
|
|
111
111
|
pointers:[t],changedPointers:[t],pointerType:B,srcEvent:t}))}});var J={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},Q={2:I,3:"pen",4:B,5:"kinect"},tt="pointerdown",et="pointermove pointerup pointercancel";function nt(){this.evEl=tt,this.evWin=et,V.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}e.MSPointerEvent&&!e.PointerEvent&&(tt="MSPointerDown",et="MSPointerMove MSPointerUp MSPointerCancel"),_(nt,V,{handler:function(t){var e=this.store,n=!1,o=t.type.toLowerCase().replace("ms",""),i=J[o],r=Q[t.pointerType]||t.pointerType,s=r==I,a=T(e,t.pointerId,"pointerId");1&i&&(0===t.button||s)?a<0&&(e.push(t),a=e.length-1):12&i&&(n=!0),a<0||(e[a]=t,this.callback(this.manager,i,{pointers:e,changedPointers:[t],pointerType:r,srcEvent:t}),n&&e.splice(a,1))}});var ot={touchstart:1,touchmove:2,touchend:4,touchcancel:8},it="touchstart",rt="touchstart touchmove touchend touchcancel";function st(){this.evTarget=it,this.evWin=rt,this.started=!1,V.apply(this,arguments)}
|
|
112
|
-
function at(t,e){var n=A(t.touches),o=A(t.changedTouches);return 12&e&&(n=k(n.concat(o),"identifier",!0)),[n,o]}_(st,V,{handler:function(t){var e=ot[t.type];if(1===e&&(this.started=!0),this.started){var n=at.call(this,t,e);12&e&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:I,srcEvent:t})}}});var lt={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ct="touchstart touchmove touchend touchcancel";function ht(){this.evTarget=ct,this.targetIds={},V.apply(this,arguments)}function ut(t,e){var n=A(t.touches),o=this.targetIds;if(3&e&&1===n.length)return o[n[0].identifier]=!0,[n,n];var i,r,s=A(t.changedTouches),a=[],l=this.target;if(r=n.filter((function(t){return
|
|
112
|
+
function at(t,e){var n=A(t.touches),o=A(t.changedTouches);return 12&e&&(n=k(n.concat(o),"identifier",!0)),[n,o]}_(st,V,{handler:function(t){var e=ot[t.type];if(1===e&&(this.started=!0),this.started){var n=at.call(this,t,e);12&e&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:I,srcEvent:t})}}});var lt={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ct="touchstart touchmove touchend touchcancel";function ht(){this.evTarget=ct,this.targetIds={},V.apply(this,arguments)}function ut(t,e){var n=A(t.touches),o=this.targetIds;if(3&e&&1===n.length)return o[n[0].identifier]=!0,[n,n];var i,r,s=A(t.changedTouches),a=[],l=this.target;if(r=n.filter((function(t){return x(t.target,l)})),1===e)for(i=0;i<r.length;)o[r[i].identifier]=!0,i++;for(i=0;i<s.length;)o[s[i].identifier]&&a.push(s[i]),12&e&&delete o[s[i].identifier],i++;return a.length?[k(r.concat(a),"identifier",!0),a]:void 0}_(ht,V,{handler:function(t){var e=lt[t.type],n=ut.call(this,t,e)
|
|
113
113
|
;n&&this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:I,srcEvent:t})}});function dt(){V.apply(this,arguments);var t=v(this.handler,this);this.touch=new ht(this.manager,t),this.mouse=new K(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function ft(t,e){1&t?(this.primaryTouch=e.changedPointers[0].identifier,pt.call(this,e)):12&t&&pt.call(this,e)}function pt(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var n={x:e.clientX,y:e.clientY};this.lastTouches.push(n);var o=this.lastTouches;setTimeout((function(){var t=o.indexOf(n);t>-1&&o.splice(t,1)}),2500)}}function gt(t){for(var e=t.srcEvent.clientX,n=t.srcEvent.clientY,o=0;o<this.lastTouches.length;o++){var i=this.lastTouches[o],r=Math.abs(e-i.x),s=Math.abs(n-i.y);if(r<=25&&s<=25)return!0}return!1}_(dt,V,{handler:function(t,e,n){var o=n.pointerType==I,i=n.pointerType==B;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(o)ft.call(this,e,n);else if(i&>.call(this,n))return
|
|
114
|
-
;this.callback(t,e,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var mt=R(a.style,"touchAction"),_t=mt!==i,vt="compute",yt="auto",wt="manipulation",bt="none",Ct="pan-x",
|
|
115
|
-
;if(this.manager.session.prevented)e.preventDefault();else{var o=this.actions,i=
|
|
114
|
+
;this.callback(t,e,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var mt=R(a.style,"touchAction"),_t=mt!==i,vt="compute",yt="auto",wt="manipulation",bt="none",Ct="pan-x",xt="pan-y",Et=function(){if(!_t)return!1;var t={},n=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(o){t[o]=!n||e.CSS.supports("touch-action",o)})),t}();function St(t,e){this.manager=t,this.set(e)}St.prototype={set:function(t){t==vt&&(t=this.compute()),_t&&this.manager.element.style&&Et[t]&&(this.manager.element.style[mt]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return f(this.manager.recognizers,(function(e){y(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))})),function(t){if(E(t,bt))return bt;var e=E(t,Ct),n=E(t,xt);if(e&&n)return bt;if(e||n)return e?Ct:xt;if(E(t,wt))return wt;return yt}(t.join(" "))},preventDefaults:function(t){var e=t.srcEvent,n=t.offsetDirection
|
|
115
|
+
;if(this.manager.session.prevented)e.preventDefault();else{var o=this.actions,i=E(o,bt)&&!Et.none,r=E(o,xt)&&!Et["pan-y"],s=E(o,Ct)&&!Et["pan-x"];if(i){var a=1===t.pointers.length,l=t.distance<2,c=t.deltaTime<250;if(a&&l&&c)return}if(!s||!r)return i||r&&6&n||s&&n&D?this.preventSrc(e):void 0}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var Tt=32;function At(t){this.options=r({},this.defaults,t||{}),this.id=N++,this.manager=null,this.options.enable=w(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function kt(t){return 16&t?"cancel":8&t?"end":4&t?"move":2&t?"start":""}function Rt(t){return 16==t?"down":8==t?"up":2==t?"left":4==t?"right":""}function Nt(t,e){var n=e.manager;return n?n.get(t):t}function Lt(){At.apply(this,arguments)}function Pt(){Lt.apply(this,arguments),this.pX=null,this.pY=null}function Ot(){Lt.apply(this,arguments)}function Mt(){At.apply(this,arguments),this._timer=null,this._input=null}function It(){Lt.apply(this,arguments)}
|
|
116
116
|
function Bt(){Lt.apply(this,arguments)}function Dt(){At.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Ft(t,e){return(e=e||{}).recognizers=w(e.recognizers,Ft.defaults.preset),new Ht(t,e)}At.prototype={defaults:{},set:function(t){return r(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(d(t,"recognizeWith",this))return this;var e=this.simultaneous;return e[(t=Nt(t,this)).id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return d(t,"dropRecognizeWith",this)||(t=Nt(t,this),delete this.simultaneous[t.id]),this},requireFailure:function(t){if(d(t,"requireFailure",this))return this;var e=this.requireFail;return-1===T(e,t=Nt(t,this))&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(d(t,"dropRequireFailure",this))return this;t=Nt(t,this);var e=T(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){
|
|
117
117
|
return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){var e=this,n=this.state;function o(n){e.manager.emit(n,t)}n<8&&o(e.options.event+kt(n)),o(e.options.event),t.additionalEvent&&o(t.additionalEvent),n>=8&&o(e.options.event+kt(n))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=Tt},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(33&this.requireFail[t].state))return!1;t++}return!0},recognize:function(t){var e=r({},t);if(!y(this.options.enable,[this,e]))return this.reset(),void(this.state=Tt);56&this.state&&(this.state=1),this.state=this.process(e),30&this.state&&this.tryEmit(e)},process:function(t){},getTouchAction:function(){},reset:function(){}},_(Lt,At,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,n=t.eventType,o=6&e,i=this.attrTest(t);return o&&(8&n||!i)?16|e:o||i?4&n?8|e:2&e?4|e:2:Tt}}),_(Pt,Lt,{defaults:{
|
|
118
|
-
event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var t=this.options.direction,e=[];return 6&t&&e.push(
|
|
118
|
+
event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var t=this.options.direction,e=[];return 6&t&&e.push(xt),t&D&&e.push(Ct),e},directionTest:function(t){var e=this.options,n=!0,o=t.distance,i=t.direction,r=t.deltaX,s=t.deltaY;return i&e.direction||(6&e.direction?(i=0===r?1:r<0?2:4,n=r!=this.pX,o=Math.abs(t.deltaX)):(i=0===s?1:s<0?8:16,n=s!=this.pY,o=Math.abs(t.deltaY))),t.direction=i,n&&o>e.threshold&&i&e.direction},attrTest:function(t){return Lt.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=Rt(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),_(Ot,Lt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[bt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out"
|
|
119
119
|
;t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),_(Mt,At,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[yt]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,o=t.distance<e.threshold,i=t.deltaTime>e.time;if(this._input=t,!o||!n||12&t.eventType&&!i)this.reset();else if(1&t.eventType)this.reset(),this._timer=u((function(){this.state=8,this.tryEmit()}),e.time,this);else if(4&t.eventType)return 8;return Tt},reset:function(){clearTimeout(this._timer)},emit:function(t){8===this.state&&(t&&4&t.eventType?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=h(),this.manager.emit(this.options.event,this._input)))}}),_(It,Lt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[bt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)}}),_(Bt,Lt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1
|
|
120
120
|
},getTouchAction:function(){return Pt.prototype.getTouchAction.call(this)},attrTest:function(t){var e,n=this.options.direction;return 30&n?e=t.overallVelocity:6&n?e=t.overallVelocityX:n&D&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&c(e)>this.options.velocity&&4&t.eventType},emit:function(t){var e=Rt(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),_(Dt,At,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[wt]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,o=t.distance<e.threshold,i=t.deltaTime<e.time;if(this.reset(),1&t.eventType&&0===this.count)return this.failTimeout();if(o&&i&&n){if(4!=t.eventType)return this.failTimeout();var r=!this.pTime||t.timeStamp-this.pTime<e.interval,s=!this.pCenter||j(this.pCenter,t.center)<e.posThreshold
|
|
121
121
|
;if(this.pTime=t.timeStamp,this.pCenter=t.center,s&&r?this.count+=1:this.count=1,this._input=t,0===this.count%e.taps)return this.hasRequireFailures()?(this._timer=u((function(){this.state=8,this.tryEmit()}),e.interval,this),2):8}return Tt},failTimeout:function(){return this._timer=u((function(){this.state=Tt}),this.options.interval,this),Tt},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Ft.VERSION="2.0.7",Ft.defaults={domEvents:!1,touchAction:vt,enable:!0,inputTarget:null,inputClass:null,preset:[[It,{enable:!1}],[Ot,{enable:!1},["rotate"]],[Bt,{direction:6}],[Pt,{direction:6},["swipe"]],[Dt],[Dt,{event:"doubletap",taps:2},["tap"]],[Mt]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Ht(t,e){var n;this.options=r({},Ft.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,
|
|
122
122
|
this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=new((n=this).options.inputClass||(O?nt:M?ht:P?dt:K))(n,q),this.touchAction=new St(this,this.options.touchAction),Vt(this,!0),f(this.options.recognizers,(function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])}),this)}function Vt(t,e){var n,o=t.element;o.style&&(f(t.options.cssProps,(function(i,r){n=R(o.style,r),e?(t.oldCssProps[n]=o.style[n],o.style[n]=i):o.style[n]=t.oldCssProps[n]||""})),e||(t.oldCssProps={}))}Ht.prototype={set:function(t){return r(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?2:1},recognize:function(t){var e=this.session;if(!e.stopped){var n;this.touchAction.preventDefaults(t);var o=this.recognizers,i=e.curRecognizer;(!i||i&&8&i.state)&&(i=e.curRecognizer=null);for(var r=0;r<o.length;)n=o[r],
|
|
123
123
|
2===e.stopped||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(t),!i&&14&n.state&&(i=e.curRecognizer=n),r++}},get:function(t){if(t instanceof At)return t;for(var e=this.recognizers,n=0;n<e.length;n++)if(e[n].options.event==t)return e[n];return null},add:function(t){if(d(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},remove:function(t){if(d(t,"remove",this))return this;if(t=this.get(t)){var e=this.recognizers,n=T(e,t);-1!==n&&(e.splice(n,1),this.touchAction.update())}return this},on:function(t,e){if(t!==i&&e!==i){var n=this.handlers;return f(S(t),(function(t){n[t]=n[t]||[],n[t].push(e)})),this}},off:function(t,e){if(t!==i){var n=this.handlers;return f(S(t),(function(t){e?n[t]&&n[t].splice(T(n[t],e),1):delete n[t]})),this}},emit:function(t,e){this.options.domEvents&&function(t,e){var o=n.createEvent("Event");o.initEvent(t,!0,!0),o.gesture=e,e.target.dispatchEvent(o)}(t,e)
|
|
124
|
-
;var o=this.handlers[t]&&this.handlers[t].slice();if(o&&o.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var i=0;i<o.length;)o[i](e),i++}},destroy:function(){this.element&&Vt(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},r(Ft,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:Tt,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:D,DIRECTION_ALL:30,Manager:Ht,Input:V,TouchAction:St,TouchInput:ht,MouseInput:K,PointerEventInput:nt,TouchMouseInput:dt,SingleTouchInput:st,Recognizer:At,AttrRecognizer:Lt,Tap:Dt,Pan:Pt,Swipe:Bt,Pinch:Ot,Rotate:It,Press:Mt,on:b,off:C,each:f,merge:m,extend:g,assign:r,inherit:_,bindFn:v,prefixed:R}),(void 0!==e?e:"undefined"!=typeof self?self:{}).Hammer=Ft,t.exports?t.exports=Ft:e.Hammer=Ft}(window,document)}(
|
|
125
|
-
;function To({children:t}){return mt("ul",{className:G("absolute w-[23px] left-[-22px] h-full","bg-grey-2 sidebar-collapsed:bg-black/[.08]","pointer-events-none"),children:t})}function Ao({children:t,topPosition:e}){return mt("li",{className:G("absolute right-0","pointer-events-auto"),style:{top:e},children:t})}function ko({above:t,below:e,buckets:n,onFocusAnnotations:o,onScrollToClosestOffScreenAnchor:i,onSelectAnnotations:r}){const s=t.tags.size>0,a=e.tags.size>0;return mt(To,{children:[s&&mt(Ao,{topPosition:t.position,children:mt(
|
|
126
|
-
onBlur:()=>o([]),onFocus:()=>o([...t.tags]),onMouseEnter:()=>o([...t.tags]),onMouseOut:()=>o([]),title:`Select nearby annotations (${t.tags.size})`,children:t.tags.size})},e))),a&&mt(Ao,{topPosition:e.position,children:mt(
|
|
124
|
+
;var o=this.handlers[t]&&this.handlers[t].slice();if(o&&o.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var i=0;i<o.length;)o[i](e),i++}},destroy:function(){this.element&&Vt(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},r(Ft,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:Tt,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:D,DIRECTION_ALL:30,Manager:Ht,Input:V,TouchAction:St,TouchInput:ht,MouseInput:K,PointerEventInput:nt,TouchMouseInput:dt,SingleTouchInput:st,Recognizer:At,AttrRecognizer:Lt,Tap:Dt,Pan:Pt,Swipe:Bt,Pinch:Ot,Rotate:It,Press:Mt,on:b,off:C,each:f,merge:m,extend:g,assign:r,inherit:_,bindFn:v,prefixed:R}),(void 0!==e?e:"undefined"!=typeof self?self:{}).Hammer=Ft,t.exports?t.exports=Ft:e.Hammer=Ft}(window,document)}(Eo);var So=Eo.exports
|
|
125
|
+
;function To({children:t}){return mt("ul",{className:G("absolute w-[23px] left-[-22px] h-full","bg-grey-2 sidebar-collapsed:bg-black/[.08]","pointer-events-none"),children:t})}function Ao({children:t,topPosition:e}){return mt("li",{className:G("absolute right-0","pointer-events-auto"),style:{top:e},children:t})}function ko({above:t,below:e,buckets:n,onFocusAnnotations:o,onScrollToClosestOffScreenAnchor:i,onSelectAnnotations:r}){const s=t.tags.size>0,a=e.tags.size>0;return mt(To,{children:[s&&mt(Ao,{topPosition:t.position,children:mt(xt,{className:G("BucketButton UpBucketButton","right-0 mt-[-11px]"),"data-testid":"up-navigation-button",onClick:()=>i([...t.tags],"up"),onBlur:()=>o([]),onFocus:()=>o([...t.tags]),onMouseEnter:()=>o([...t.tags]),onMouseOut:()=>o([]),title:`Go up to next annotations (${t.tags.size})`,children:t.tags.size})}),n.map(((t,e)=>mt(Ao,{topPosition:t.position,children:mt(xt,{className:G("BucketButton LeftBucketButton","right-0 mt-[-8px]"),onClick:e=>r([...t.tags],e.metaKey||e.ctrlKey),
|
|
126
|
+
onBlur:()=>o([]),onFocus:()=>o([...t.tags]),onMouseEnter:()=>o([...t.tags]),onMouseOut:()=>o([]),title:`Select nearby annotations (${t.tags.size})`,children:t.tags.size})},e))),a&&mt(Ao,{topPosition:e.position,children:mt(xt,{className:"BucketButton DownBucketButton right-0","data-testid":"down-navigation-button",onClick:()=>i([...e.tags],"down"),onBlur:()=>o([]),onFocus:()=>o([...e.tags]),onMouseEnter:()=>o([...e.tags]),onMouseOut:()=>o([]),title:`Go up to next annotations (${e.tags.size})`,children:e.tags.size})})]})}class Ro{constructor(t,{onFocusAnnotations:e,onScrollToClosestOffScreenAnchor:n,onSelectAnnotations:o}){this._bucketsContainer=document.createElement("div"),t.appendChild(this._bucketsContainer),this._onFocusAnnotations=e,this._onScrollToClosestOffScreenAnchor=n,this._onSelectAnnotations=o,this.update([])}destroy(){P(null,this._bucketsContainer),this._bucketsContainer.remove()}update(t){const e=function(t){const e=new Set,n=new Set,o=[];let i=null;function r({bottom:t,tag:e,top:n}){return{
|
|
127
127
|
bottom:t,position:n+(t-n)/2,tags:new Set([e]),top:n}}return t.forEach((t=>{if(t.top<137)return void e.add(t.tag);if(t.top>window.innerHeight-22)return void n.add(t.tag);if(!i)return void(i=r(t));const s=t.top>i.top&&t.bottom<i.bottom;if(t.top-i.bottom>60&&!s)o.push(i),i=r(t);else{const e=t.bottom>i.bottom?t.bottom:i.bottom,n=e-i.top;i.tags.add(t.tag),i.bottom=e,i.position=i.top+n/2}})),i&&o.push(i),{above:{tags:e,position:137},below:{tags:n,position:window.innerHeight-22},buckets:o}}(t);P(mt(ko,{above:e.above,below:e.below,buckets:e.buckets,onFocusAnnotations:t=>this._onFocusAnnotations(t),onScrollToClosestOffScreenAnchor:(t,e)=>this._onScrollToClosestOffScreenAnchor(t,e),onSelectAnnotations:(t,e)=>this._onSelectAnnotations(t,e)}),this._bucketsContainer)}}let No={};const Lo=t=>{No=t||{}},Po=function(t){t.on("featureFlagsUpdated",Lo)};function Oo({...t}){const{icon:e,title:n,...o}=t;return mt(Ct,{
|
|
128
|
-
className:G("w-[30px] h-[30px]","flex items-center justify-center","border
|
|
128
|
+
className:G("w-[30px] h-[30px]","rounded-px","flex items-center justify-center","border bg-white text-grey-6 hover:text-grey-9","shadow transition-colors"),icon:e,title:n,...o})}function Mo({closeSidebar:t,createAnnotation:e,isSidebarOpen:n,newAnnotationType:o,showHighlights:i,toggleHighlights:r,toggleSidebar:s,toggleSidebarRef:a,useMinimalControls:l=!1}){return mt("div",{className:G("absolute left-[-33px] w-[33px] z-2","text-px-base leading-none"),children:[l&&n&&mt(Ct,{className:G("w-[27px] h-[27px] mt-[140px] ml-px-1.5","flex items-center justify-center bg-white border","text-grey-6 hover:text-grey-9 transition-colors","border-r-0","shadow-sidebar"),title:"Close annotation sidebar",icon:"cancel",onClick:t}),!l&&mt(f,{children:[mt(Ct,{className:G("h-[40px] w-[33px] pl-px-1.5","bg-white text-grey-5 hover:text-grey-9","border-l border-b"),buttonRef:a,title:"Annotation sidebar",icon:n?"caret-right":"caret-left",expanded:n,pressed:n,onClick:s}),mt("div",{className:"space-y-px-1.5 mt-px-2",children:[mt(Oo,{
|
|
129
129
|
title:"Show highlights",icon:i?"show":"hide",selected:i,onClick:r}),mt(Oo,{title:"note"===o?"New page note":"New annotation",icon:"note"===o?"note":"annotate",onClick:e})]})]})]})}class Io{constructor(t,e){const{createAnnotation:n,setSidebarOpen:o,setHighlightsVisible:i}=e;this._container=t,this._useMinimalControls=!1,this._newAnnotationType="note",this._highlightsVisible=!1,this._sidebarOpen=!1,this._closeSidebar=()=>o(!1),this._toggleSidebar=()=>o(!this._sidebarOpen),this._toggleHighlights=()=>i(!this._highlightsVisible),this._createAnnotation=()=>{n(),o(!0)},this._sidebarToggleButton={current:null},this.render()}getWidth(){return this._container.firstChild.getBoundingClientRect().width}set useMinimalControls(t){this._useMinimalControls=t,this.render()}get useMinimalControls(){return this._useMinimalControls}set sidebarOpen(t){this._sidebarOpen=t,this.render()}get sidebarOpen(){return this._sidebarOpen}set newAnnotationType(t){this._newAnnotationType=t,this.render()}get newAnnotationType(){
|
|
130
130
|
return this._newAnnotationType}set highlightsVisible(t){this._highlightsVisible=t,this.render()}get highlightsVisible(){return this._highlightsVisible}get sidebarToggleButton(){return this._sidebarToggleButton.current}render(){P(mt(Mo,{closeSidebar:this._closeSidebar,createAnnotation:this._createAnnotation,newAnnotationType:this._newAnnotationType,isSidebarOpen:this._sidebarOpen,showHighlights:this._highlightsVisible,toggleHighlights:this._toggleHighlights,toggleSidebar:this._toggleSidebar,toggleSidebarRef:this._sidebarToggleButton,useMinimalControls:this.useMinimalControls}),this._container)}}class Bo{constructor(t,e,n={}){if(this._emitter=e.createEmitter(),this._guestWithSelection=null,this._guestRPC=[],this._sidebarRPC=new zt,this.iframe=function(t){const e=yo(t.sidebarAppUrl,wo(t.sidebarAppUrl,t)),n=document.createElement("iframe");return n.setAttribute("allowfullscreen",""),n.src=e,n.title="Hypothesis annotation viewer",n.className="sidebar-frame",n}(n),this._config=n,this.bucketBar=null,
|
|
131
131
|
n.externalContainerSelector){var o;this.externalFrame=null!==(o=document.querySelector(n.externalContainerSelector))&&void 0!==o?o:t,this.externalFrame.appendChild(this.iframe)}else{this.iframeContainer=document.createElement("div"),this.iframeContainer.style.display="none",this.iframeContainer.className="sidebar-container","clean"===n.theme?this.iframeContainer.classList.add("theme-clean"):this.bucketBar=new Ro(this.iframeContainer,{onFocusAnnotations:t=>this._guestRPC.forEach((e=>e.call("focusAnnotations",t))),onScrollToClosestOffScreenAnchor:(t,e)=>this._guestRPC.forEach((n=>n.call("scrollToClosestOffScreenAnchor",t,e))),onSelectAnnotations:(t,e)=>this._guestRPC.forEach((n=>n.call("selectAnnotations",t,e)))}),this.iframeContainer.appendChild(this.iframe),this.hypothesisSidebar=document.createElement("hypothesis-sidebar");ae(this.hypothesisSidebar).appendChild(this.iframeContainer),t.appendChild(this.hypothesisSidebar)}this.iframe.contentWindow&&Vt(this.iframe.contentWindow),this._listeners=new kt
|
|
@@ -136,5 +136,5 @@ this._sidebarRPC.on("openSidebar",(()=>this.open())),this._sidebarRPC.on("closeS
|
|
|
136
136
|
const t=this._gestureState.final,e=-t;this.iframeContainer.style.marginLeft=`${t}px`,e>=280&&(this.iframeContainer.style.width=`${e}px`),this._updateLayoutState()}})))}_updateLayoutState(t){var e;const n=this.iframeContainer&&this.toolbar.getWidth()||0,o=null!==(e=this.iframeContainer)&&void 0!==e?e:this.externalFrame,i=o.getBoundingClientRect(),r=window.getComputedStyle(o),s=parseInt(r.width),a=parseInt(r.marginLeft);let l=n;"boolean"==typeof t?t&&(l+=s):(a<280?l-=a:l+=s,t=l>n);const c={expanded:t,width:t?l:n,height:i.height,toolbarWidth:n};this._layoutState=c,this.onLayoutChange&&this.onLayoutChange(c),this._guestRPC.forEach((t=>t.call("sidebarLayoutChanged",c)))}_onResize(){!0===this.toolbar.sidebarOpen&&(window.innerWidth<280?this.close():this.open())}_onPan(t){const e=this.iframeContainer;if(e)switch(t.type){case"panstart":this._resetGestureState(),e.classList.add("sidebar-no-transition"),e.style.pointerEvents="none",this._gestureState.initial=parseInt(getComputedStyle(e).marginLeft);break;case"panend":
|
|
137
137
|
e.classList.remove("sidebar-no-transition"),e.style.pointerEvents="",null===this._gestureState.final||this._gestureState.final<=-280?this.open():this.close(),this._resetGestureState();break;case"panleft":case"panright":{if("number"!=typeof this._gestureState.initial)return;const e=this._gestureState.initial,n=t.deltaX;this._gestureState.final=Math.min(Math.round(e+n),0),this._updateLayout();break}}}open(){if(this._sidebarRPC.call("sidebarOpened"),this.iframeContainer){const t=this.iframeContainer.getBoundingClientRect().width;this.iframeContainer.style.marginLeft=-1*t+"px",this.iframeContainer.classList.remove("sidebar-collapsed")}this.toolbar.sidebarOpen=!0,"whenSidebarOpen"===this._config.showHighlights&&this.setHighlightsVisible(!0),this._updateLayoutState(!0)}close(){this.iframeContainer&&(this.iframeContainer.style.marginLeft="",this.iframeContainer.classList.add("sidebar-collapsed")),this.toolbar.sidebarOpen=!1,"whenSidebarOpen"===this._config.showHighlights&&this.setHighlightsVisible(!1),
|
|
138
138
|
this._updateLayoutState(!1)}setHighlightsVisible(t){this.toolbar.highlightsVisible=t,this._sidebarRPC.call("setHighlightsVisible",t)}show(){this.iframeContainer&&this.iframeContainer.classList.remove("is-hidden")}hide(){this.iframeContainer&&this.iframeContainer.classList.add("is-hidden")}}class Do{constructor(t){this._emitter=t,this._subscriptions=[]}publish(t,...e){this._emitter.emit(t,...e)}subscribe(t,e){this._emitter.on(t,e),this._subscriptions.push([t,e])}unsubscribe(t,e){this._emitter.off(t,e),this._subscriptions=this._subscriptions.filter((([n,o])=>n!==t||o!==e))}destroy(){for(let[t,e]of this._subscriptions)this._emitter.off(t,e);this._subscriptions=[]}}class Fo{constructor(){this._emitter=new Bt}createEmitter(){return new Do(this._emitter)}}!function(t,{reset:e=!1}={}){e&&_t.clear();for(let[e,n]of Object.entries(t))_t.set(e,n)}(At);const Ho=document.querySelector('link[type="application/annotator+html"][rel="sidebar"]');new Promise((t=>{"loading"!==document.readyState&&t(),
|
|
139
|
-
document.addEventListener("readystatechange",(()=>t()))})).then((function(){const t=Jt("annotator"),e=t.subFrameIdentifier?window.parent:window,n=[];if(e===window){const t=function(t=navigator.userAgent){if(!Wt(t))return()=>{};const e=t=>{var e;if("hypothesisPortClosed"===(null===(e=t.data)||void 0===e?void 0:e.type)&&t.ports[0]){const e=t.ports[0];Ut(e,"close"),e.close()}};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)}();n.push({destroy:t});const e=Jt("sidebar"),o=new URL(e.sidebarAppUrl).origin,i=new qt(o),r=new Fo,s=new Bo(document.body,r,e),a=new
|
|
139
|
+
document.addEventListener("readystatechange",(()=>t()))})).then((function(){const t=Jt("annotator"),e=t.subFrameIdentifier?window.parent:window,n=[];if(e===window){const t=function(t=navigator.userAgent){if(!Wt(t))return()=>{};const e=t=>{var e;if("hypothesisPortClosed"===(null===(e=t.data)||void 0===e?void 0:e.type)&&t.ports[0]){const e=t.ports[0];Ut(e,"close"),e.close()}};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)}();n.push({destroy:t});const e=Jt("sidebar"),o=new URL(e.sidebarAppUrl).origin,i=new qt(o),r=new Fo,s=new Bo(document.body,r,e),a=new xo(document.body,r,Jt("notebook"));i.on("frameConnected",((t,e)=>s.onFrameConnected(t,e))),n.push(i,s,a)}if("container"===so()){const e=new ao(t);n.push(e)}else{const o=new oo(document.body,t),i=new vo(document.body,t,e);n.push(o,i)}Ho.addEventListener("destroy",(()=>{n.forEach((t=>t.destroy()));document.querySelectorAll("[data-hypothesis-asset]").forEach((t=>t.remove()))}))}));
|
|
140
140
|
//# sourceMappingURL=annotator.bundle.js.map
|