hypothesis 1.1582.0 → 1.1584.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/boot.js CHANGED
@@ -1 +1 @@
1
- !function(){"use strict";var s={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?058c3e","styles/annotator.css":"styles/annotator.css?427463","styles/annotator.css.map":"styles/annotator.css.map?94a857","styles/highlights.css":"styles/highlights.css?6b4ebd","styles/highlights.css.map":"styles/highlights.css.map?241350","styles/katex.min.css":"styles/katex.min.css?d92c5a","styles/katex.min.css.map":"styles/katex.min.css.map?e7e03f","styles/pdfjs-overrides.css":"styles/pdfjs-overrides.css?c95edf","styles/pdfjs-overrides.css.map":"styles/pdfjs-overrides.css.map?1d8ac6","styles/sidebar.css":"styles/sidebar.css?0e33f1","styles/sidebar.css.map":"styles/sidebar.css.map?9a27bf","styles/ui-playground.css":"styles/ui-playground.css?c7ef72","styles/ui-playground.css.map":"styles/ui-playground.css.map?0df86b","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?b57f89","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?616c4e","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?d38ce4","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?964b5b","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?4fc569"};function e(s){s.setAttribute("data-hypothesis-asset","")}function t(s,t){var o=s.createElement("link");o.rel="stylesheet",o.type="text/css",o.href=t,e(o),s.head.appendChild(o)}function o(s,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=o.esModule,n=void 0===r||r,i=o.forceReload,a=void 0!==i&&i,l=s.createElement("script");n&&(l.type="module"),a&&(t+="#ts=".concat(Date.now())),l.src=t,l.async=!1,e(l),s.head.appendChild(l)}function r(s,t,o,r){var n=s.createElement("link");n.rel=t,n.href=r,n.type="application/annotator+".concat(o),e(n),s.head.appendChild(n)}function n(s,t,o){var r=s.createElement("link");r.rel="preload",r.as=t,r.href=o,"fetch"===t&&(r.crossOrigin="anonymous"),e(r),s.head.appendChild(r)}function i(s,e){return s.assetRoot+"build/"+s.manifest[e]}function a(s){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(-1===s.indexOf("{"))return s;var t=function(){var s,e,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:document).currentScript;return t?(s=t.src,(e=s.match(/(https?):\/\/([^:/]+)/))?{protocol:e[1],hostname:e[2]}:null):null}(e);if(!t)throw new Error("Could not process URL template because script origin is unknown");return s=(s=s.replace("{current_host}",t.hostname)).replace("{current_scheme}",t.protocol)}if(function(){var s=[()=>Object.fromEntries([]),()=>new URL(document.location.href),()=>new Request("https://hypothes.is"),()=>Element.prototype.attachShadow,()=>CSS.supports("display: grid"),()=>(document.evaluate("/html/body",document,null,XPathResult.ANY_TYPE,null),!0)];try{return s.every((s=>s()))}catch(s){return!1}}()){var l=function(s){for(var e={},t=s.querySelectorAll("script.js-hypothesis-config"),o=0;o<t.length;o++){var r=void 0;try{r=JSON.parse(t[o].textContent||"")}catch(s){console.warn("Could not parse settings from js-hypothesis-config tags",s),r={}}Object.assign(e,r)}return e}(document),p=a(l.assetRoot||"https://cdn.hypothes.is/hypothesis/1.1582.0/");if(document.querySelector("hypothesis-app")){!function(s,e){n(s,"fetch",e.apiUrl),n(s,"fetch",e.apiUrl+"links");for(var r=0,a=["scripts/sidebar.bundle.js"];r<a.length;r++)o(s,i(e,a[r]),{esModule:!0});for(var l=0,p=["styles/katex.min.css","styles/sidebar.css"];l<p.length;l++)t(s,i(e,p[l]))}(document,{assetRoot:p,manifest:s,apiUrl:l.apiUrl})}else{var c=function(){var s;return null===(s=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).chrome)||void 0===s||null===(s=s.runtime)||void 0===s?void 0:s.id}();if(c&&!function(s){return!!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:document).querySelector("script.js-hypothesis-config[data-extension-id=".concat(s,"]"))}(c))throw new Error("Could not start Hypothesis extension as configuration is missing");var d=l,h=a(d.notebookAppUrl||"https://hypothes.is/notebook"),u=a(d.profileAppUrl||"https://hypothes.is/user-profile"),y=a(d.sidebarAppUrl||"https://hypothes.is/app.html");!function(s,e){if(!s.querySelector('link[type="application/annotator+html"]')){r(s,"sidebar","html",e.sidebarAppUrl),r(s,"notebook","html",e.notebookAppUrl),r(s,"profile","html",e.profileAppUrl),n(s,"style",i(e,"styles/annotator.css")),r(s,"hypothesis-client","javascript",e.assetRoot+"build/boot.js");for(var a=0,l=["scripts/annotator.bundle.js"];a<l.length;a++)o(s,i(e,l[a]),{esModule:!1});var p=[];void 0!==window.PDFViewerApplication&&p.push("styles/pdfjs-overrides.css"),p.push("styles/highlights.css");for(var c=0,d=p;c<d.length;c++)t(s,i(e,d[c]))}}(document,{assetRoot:p,manifest:s,notebookAppUrl:h,profileAppUrl:u,sidebarAppUrl:y})}}else console.warn("The Hypothesis annotation tool is not supported in this browser. See https://web.hypothes.is/help/which-browsers-are-supported-by-hypothesis/.")}();
1
+ !function(){"use strict";var s={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?323bd3","styles/annotator.css":"styles/annotator.css?427463","styles/annotator.css.map":"styles/annotator.css.map?94a857","styles/highlights.css":"styles/highlights.css?6b4ebd","styles/highlights.css.map":"styles/highlights.css.map?241350","styles/katex.min.css":"styles/katex.min.css?d92c5a","styles/katex.min.css.map":"styles/katex.min.css.map?e7e03f","styles/pdfjs-overrides.css":"styles/pdfjs-overrides.css?c95edf","styles/pdfjs-overrides.css.map":"styles/pdfjs-overrides.css.map?1d8ac6","styles/sidebar.css":"styles/sidebar.css?661aee","styles/sidebar.css.map":"styles/sidebar.css.map?9a27bf","styles/ui-playground.css":"styles/ui-playground.css?df98db","styles/ui-playground.css.map":"styles/ui-playground.css.map?0df86b","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?90e514","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?446f84","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?4107fe","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?310ebb","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?f66fa1"};function e(s){s.setAttribute("data-hypothesis-asset","")}function t(s,t){var o=s.createElement("link");o.rel="stylesheet",o.type="text/css",o.href=t,e(o),s.head.appendChild(o)}function o(s,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=o.esModule,n=void 0===r||r,i=o.forceReload,a=void 0!==i&&i,l=s.createElement("script");n&&(l.type="module"),a&&(t+="#ts=".concat(Date.now())),l.src=t,l.async=!1,e(l),s.head.appendChild(l)}function r(s,t,o,r){var n=s.createElement("link");n.rel=t,n.href=r,n.type="application/annotator+".concat(o),e(n),s.head.appendChild(n)}function n(s,t,o){var r=s.createElement("link");r.rel="preload",r.as=t,r.href=o,"fetch"===t&&(r.crossOrigin="anonymous"),e(r),s.head.appendChild(r)}function i(s,e){return s.assetRoot+"build/"+s.manifest[e]}function a(s){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(-1===s.indexOf("{"))return s;var t=function(){var s,e,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:document).currentScript;return t?(s=t.src,(e=s.match(/(https?):\/\/([^:/]+)/))?{protocol:e[1],hostname:e[2]}:null):null}(e);if(!t)throw new Error("Could not process URL template because script origin is unknown");return s=(s=s.replace("{current_host}",t.hostname)).replace("{current_scheme}",t.protocol)}if(function(){var s=[()=>Object.fromEntries([]),()=>new URL(document.location.href),()=>new Request("https://hypothes.is"),()=>Element.prototype.attachShadow,()=>CSS.supports("display: grid"),()=>(document.evaluate("/html/body",document,null,XPathResult.ANY_TYPE,null),!0)];try{return s.every((s=>s()))}catch(s){return!1}}()){var l=function(s){for(var e={},t=s.querySelectorAll("script.js-hypothesis-config"),o=0;o<t.length;o++){var r=void 0;try{r=JSON.parse(t[o].textContent||"")}catch(s){console.warn("Could not parse settings from js-hypothesis-config tags",s),r={}}Object.assign(e,r)}return e}(document),p=a(l.assetRoot||"https://cdn.hypothes.is/hypothesis/1.1584.0/");if(document.querySelector("hypothesis-app")){!function(s,e){n(s,"fetch",e.apiUrl),n(s,"fetch",e.apiUrl+"links");for(var r=0,a=["scripts/sidebar.bundle.js"];r<a.length;r++)o(s,i(e,a[r]),{esModule:!0});for(var l=0,p=["styles/katex.min.css","styles/sidebar.css"];l<p.length;l++)t(s,i(e,p[l]))}(document,{assetRoot:p,manifest:s,apiUrl:l.apiUrl})}else{var c=function(){var s;return null===(s=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).chrome)||void 0===s||null===(s=s.runtime)||void 0===s?void 0:s.id}();if(c&&!function(s){return!!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:document).querySelector("script.js-hypothesis-config[data-extension-id=".concat(s,"]"))}(c))throw new Error("Could not start Hypothesis extension as configuration is missing");var d=l,h=a(d.notebookAppUrl||"https://hypothes.is/notebook"),u=a(d.profileAppUrl||"https://hypothes.is/user-profile"),y=a(d.sidebarAppUrl||"https://hypothes.is/app.html");!function(s,e){if(!s.querySelector('link[type="application/annotator+html"]')){r(s,"sidebar","html",e.sidebarAppUrl),r(s,"notebook","html",e.notebookAppUrl),r(s,"profile","html",e.profileAppUrl),n(s,"style",i(e,"styles/annotator.css")),r(s,"hypothesis-client","javascript",e.assetRoot+"build/boot.js");for(var a=0,l=["scripts/annotator.bundle.js"];a<l.length;a++)o(s,i(e,l[a]),{esModule:!1});var p=[];void 0!==window.PDFViewerApplication&&p.push("styles/pdfjs-overrides.css"),p.push("styles/highlights.css");for(var c=0,d=p;c<d.length;c++)t(s,i(e,d[c]))}}(document,{assetRoot:p,manifest:s,notebookAppUrl:h,profileAppUrl:u,sidebarAppUrl:y})}}else console.warn("The Hypothesis annotation tool is not supported in this browser. See https://web.hypothes.is/help/which-browsers-are-supported-by-hypothesis/.")}();
@@ -1,5 +1,5 @@
1
1
  {
2
- "scripts/annotator.bundle.js": "scripts/annotator.bundle.js?058c3e",
2
+ "scripts/annotator.bundle.js": "scripts/annotator.bundle.js?323bd3",
3
3
  "styles/annotator.css": "styles/annotator.css?427463",
4
4
  "styles/annotator.css.map": "styles/annotator.css.map?94a857",
5
5
  "styles/highlights.css": "styles/highlights.css?6b4ebd",
@@ -8,13 +8,13 @@
8
8
  "styles/katex.min.css.map": "styles/katex.min.css.map?e7e03f",
9
9
  "styles/pdfjs-overrides.css": "styles/pdfjs-overrides.css?c95edf",
10
10
  "styles/pdfjs-overrides.css.map": "styles/pdfjs-overrides.css.map?1d8ac6",
11
- "styles/sidebar.css": "styles/sidebar.css?0e33f1",
11
+ "styles/sidebar.css": "styles/sidebar.css?661aee",
12
12
  "styles/sidebar.css.map": "styles/sidebar.css.map?9a27bf",
13
- "styles/ui-playground.css": "styles/ui-playground.css?c7ef72",
13
+ "styles/ui-playground.css": "styles/ui-playground.css?df98db",
14
14
  "styles/ui-playground.css.map": "styles/ui-playground.css.map?0df86b",
15
- "scripts/annotator.bundle.js.map": "scripts/annotator.bundle.js.map?b57f89",
16
- "scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?616c4e",
17
- "scripts/ui-playground.bundle.js": "scripts/ui-playground.bundle.js?d38ce4",
18
- "scripts/ui-playground.bundle.js.map": "scripts/ui-playground.bundle.js.map?964b5b",
19
- "scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?4fc569"
15
+ "scripts/annotator.bundle.js.map": "scripts/annotator.bundle.js.map?90e514",
16
+ "scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?446f84",
17
+ "scripts/ui-playground.bundle.js": "scripts/ui-playground.bundle.js?4107fe",
18
+ "scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?310ebb",
19
+ "scripts/ui-playground.bundle.js.map": "scripts/ui-playground.bundle.js.map?f66fa1"
20
20
  }
@@ -43,9 +43,9 @@ const xt=ke("input-group:border input-group:rounded-none","input-group:first:rou
43
43
  className:ke("peer-focus-visible:ring","w-em h-em")},void 0,0,{fileName:St,lineNumber:88,columnNumber:7},this),e]},void 0,0,{fileName:St,lineNumber:51,columnNumber:5},this)}var At="/home/runner/work/frontend-shared/frontend-shared/src/components/input/Checkbox.tsx";function Rt({checked:e,defaultChecked:t=!1,icon:n=Qe,checkedIcon:o=Ze,onChange:i,...r}){const s="boolean"==typeof e,[a,l]=oe(t);return Te(Et,{icon:n,checkedIcon:o,type:"checkbox",checked:s?e:a,onChange:function(e){null==i||i.call(this,e),s||l(e.target.checked)},...r},void 0,0,{fileName:At,lineNumber:65,columnNumber:5},this)}const kt=q(null);var Pt="/home/runner/work/frontend-shared/frontend-shared/src/components/input/RadioGroup.tsx";function Tt({value:e,children:t,subtitle:n,disabled:o}){const i=ce(kt);if(!i)throw new Error("RadioGroup.Radio can only be used as RadioGroup child");const{selected:r,disabled:s=o,onChange:a}=i,l=!s&&r===e;return Te("div",{role:"radio","aria-checked":l,"aria-disabled":s,
44
44
  className:ke("focus-visible-ring rounded-lg px-3 py-2 flex-1 group",{"bg-grey-3/50":l,"hover:bg-grey-3/25":!l&&!s,"opacity-70":s,"cursor-pointer":!s}),"data-value":e,onClick:s?void 0:()=>a(e),onKeyDown:s?void 0:t=>{["Enter"," "].includes(t.key)&&(t.preventDefault(),a(e))},tabIndex:-1,children:[Te("div",{className:"flex items-center gap-x-1.5",children:[l?Te(_t,{},void 0,0,{fileName:Pt,lineNumber:68,columnNumber:23},this):Te(pt,{},void 0,0,{fileName:Pt,lineNumber:68,columnNumber:46},this),t]},void 0,0,{fileName:Pt,lineNumber:67,columnNumber:7},this),n&&Te("div",{className:ke("pl-4 ml-1.5 mt-1 text-sm",{"text-grey-7":l,"text-grey-6 group-hover:text-grey-7":!l&&!s}),children:n},void 0,0,{fileName:Pt,lineNumber:72,columnNumber:9},this)]},void 0,0,{fileName:Pt,lineNumber:40,columnNumber:5},this)}Tt.displayName="RadioGroup.Radio",Object.assign((function({direction:e="horizontal",children:t,selected:n,onChange:o,disabled:i,"aria-label":r,"aria-labelledby":s,name:a}){const l=se(null);return ye(l,{loop:!1,
45
45
  selector:'[role="radio"]:not([aria-disabled="true"])',focusElement:e=>{o(e.dataset.value),e.focus()}}),Te(kt.Provider,{value:{selected:n,disabled:i,onChange:o},children:[Te("div",{"aria-label":r,"aria-labelledby":s,ref:l,role:"radiogroup",className:ke("w-full flex gap-1.5",{"flex-col":"vertical"===e}),children:t},void 0,0,{fileName:Pt,lineNumber:134,columnNumber:7},this),a&&Te("input",{type:"hidden","data-testid":"hidden-input",name:a,value:n,disabled:i},void 0,0,{fileName:Pt,lineNumber:146,columnNumber:9},this)]},void 0,0,{fileName:Pt,lineNumber:131,columnNumber:5},this)}),{Radio:Tt,displayName:"RadioGroup"});var Mt="/home/runner/work/frontend-shared/frontend-shared/src/components/feedback/Popover.tsx";const Lt=".15rem",Ot=8;function It(e,t,n,o,i){ie((()=>{if(!i)return()=>{};const t=e.current,o=e=>{"open"===e.oldState&&"closed"===e.newState&&n()};return t.addEventListener("toggle",o),()=>t.removeEventListener("toggle",o)}),[i,n,e]);const r=o&&!i;!function(e,t,{enabled:n=!0}={}){ie((()=>{if(!n)return()=>{}
46
- ;const o=document.body,i=new ve,r=n=>{e.current&&!n.composedPath().includes(e.current)&&t(n)};return i.add(o,"mousedown",r),i.add(o,"click",r),()=>{i.removeAll()}}),[e,n,t])}(e,(e=>{e.composedPath().includes(t.current)||n()}),{enabled:r}),function(e,t,{enabled:n=!0}={}){ie((()=>{if(!n)return()=>{};const o=document.body,i=new ve;return i.add(o,"keydown",(n=>{e.includes(n.key)&&t(n)})),()=>{i.removeAll()}}),[n,t,e])}(["Escape"],n,{enabled:r})}function Bt({anchorElementRef:e,children:t,open:n,onClose:o,align:i="left",classes:r,variant:s="panel",onScroll:a,asNativePopover:l=HTMLElement.prototype.hasOwnProperty("popover")}){const c=se(null);return function(e,t,n,o,i){const r=le((()=>{const n=t.current,r=e.current,s=e=>{Object.assign(n.style,e);const t=Object.keys(e);return()=>t.map((e=>n.style[e]=""))},a=window.innerHeight,{top:l,bottom:c,left:u,height:d,width:h}=r.getBoundingClientRect(),f=a-c,{height:m,width:p}=n.getBoundingClientRect(),g=f<m&&l>f;if(!o)return s(g?{bottom:"100%",marginBottom:Lt}:{top:"100%",
47
- marginTop:Lt});const{top:_,width:b}=document.body.getBoundingClientRect(),v=Math.abs(_),w=(i?u+h:b-u)-Ot;let y=u;return p>w?y=i?Ot:y-(p-w):i&&p>h&&(y-=p-h),s({minWidth:`${h}px`,top:g?`calc(${v+l-m}px - ${Lt})`:`calc(${v+l+d}px + ${Lt})`,left:`${Math.max(Ot,y)}px`})}),[o,e,t,i]);re((()=>{if(!n)return()=>{};const e=t.current;o&&e.togglePopover(!0);const i=r();if(!o)return i;const s=new ve;s.add(document.body,"scroll",r,{capture:!0});const a=new ResizeObserver(r);return a.observe(e),()=>{o&&(null==e||e.togglePopover(!1)),i(),s.removeAll(),a.disconnect()}}),[r,o,n,t])}(e,c,n,l,"right"===i),It(c,e,o,n,l),function({popoverRef:e,open:t}){re((()=>{const n=e.current,o=t?document.activeElement:null;return n&&o?()=>{const e=document.activeElement;e&&!n.contains(e)&&e!==document.body||o.focus()}:()=>{}}),[e,t])}({open:n,popoverRef:c}),Te("div",{
48
- className:ke("absolute z-5","panel"===s&&["max-h-80 overflow-y-auto overflow-x-hidden","rounded border bg-white shadow hover:shadow-md focus-within:shadow-md"],l&&["max-w-[calc(100%-16px)]","p-0 m-0"],!l&&{hidden:!n,"right-0":"right"===i,"min-w-full":!0},r),ref:c,popover:l&&"auto",onScroll:a,"data-testid":"popover","data-component":"Popover",children:n&&t},void 0,0,{fileName:Mt,lineNumber:350,columnNumber:5},this)}const Ht=q(null);var Dt="/home/runner/work/frontend-shared/frontend-shared/src/components/input/Select.tsx";function Ft(e,t){return"function"==typeof e?e(t):e}function Vt({value:e,children:t,disabled:n=!1,classes:o,elementRef:i,title:r}){const s=se(null),a=se(null),l=Ce(i),c=e=>e.target===s.current||e.target===a.current,u=ce(Ht);if(!u)throw new Error("Select.Option can only be used as Select or MultiSelect child");const{selectValue:d,value:h,multiple:f}=u,m=ae((()=>!n&&(f?h.includes(e)||0===h.length&&void 0===e:h===e)),[h,n,f,e]),p=le((()=>{const t={closeListbox:!0};d(f?void 0!==e?[e]:[]:e,t)
46
+ ;const o=document.body,i=new ve,r=n=>{e.current&&!n.composedPath().includes(e.current)&&t(n)};return i.add(o,"mousedown",r),i.add(o,"click",r),()=>{i.removeAll()}}),[e,n,t])}(e,(e=>{e.composedPath().includes(t.current)||n()}),{enabled:r}),function(e,t,{enabled:n=!0}={}){ie((()=>{if(!n)return()=>{};const o=document.body,i=new ve;return i.add(o,"keydown",(n=>{e.includes(n.key)&&t(n)})),()=>{i.removeAll()}}),[n,t,e])}(["Escape"],n,{enabled:r})}function Bt({anchorElementRef:e,children:t,open:n,onClose:o,align:i="left",classes:r,variant:s="panel",onScroll:a,elementRef:l,asNativePopover:c=HTMLElement.prototype.hasOwnProperty("popover")}){const u=Ce(l);return function(e,t,n,o,i){const r=le((()=>{const n=t.current,r=e.current,s=e=>{Object.assign(n.style,e);const t=Object.keys(e);return()=>t.map((e=>n.style[e]=""))},a=window.innerHeight,{top:l,bottom:c,left:u,height:d,width:h}=r.getBoundingClientRect(),f=a-c,{height:m,width:p}=n.getBoundingClientRect(),g=f<m&&l>f;if(!o)return s(g?{bottom:"100%",marginBottom:Lt}:{
47
+ top:"100%",marginTop:Lt});const{top:_,width:b}=document.body.getBoundingClientRect(),v=Math.abs(_),w=(i?u+h:b-u)-Ot;let y=u;return p>w?y=i?Ot:y-(p-w):i&&p>h&&(y-=p-h),s({minWidth:`${h}px`,top:g?`calc(${v+l-m}px - ${Lt})`:`calc(${v+l+d}px + ${Lt})`,left:`${Math.max(Ot,y)}px`})}),[o,e,t,i]);re((()=>{if(!n)return()=>{};const e=t.current;o&&e.togglePopover(!0);const i=r();if(!o)return i;const s=new ve;s.add(document.body,"scroll",r,{capture:!0});const a=new ResizeObserver(r);return a.observe(e),()=>{o&&(null==e||e.togglePopover(!1)),i(),s.removeAll(),a.disconnect()}}),[r,o,n,t])}(e,u,n,c,"right"===i),It(u,e,o,n,c),function({popoverRef:e,open:t}){re((()=>{const n=e.current,o=t?document.activeElement:null;return n&&o?()=>{const e=document.activeElement;e&&!n.contains(e)&&e!==document.body||o.focus()}:()=>{}}),[e,t])}({open:n,popoverRef:u}),Te("div",{
48
+ className:ke("absolute z-5","panel"===s&&["max-h-80 overflow-y-auto overflow-x-hidden","rounded border bg-white shadow hover:shadow-md focus-within:shadow-md"],c&&["max-w-[calc(100%-16px)]","p-0 m-0"],!c&&{hidden:!n,"right-0":"right"===i,"min-w-full":!0},r),ref:u,popover:c&&"auto",onScroll:a,"data-testid":"popover","data-component":"Popover",children:n&&t},void 0,0,{fileName:Mt,lineNumber:356,columnNumber:5},this)}const Ht=q(null);var Dt="/home/runner/work/frontend-shared/frontend-shared/src/components/input/Select.tsx";function Ft(e,t){return"function"==typeof e?e(t):e}function Vt({value:e,children:t,disabled:n=!1,classes:o,elementRef:i,title:r}){const s=se(null),a=se(null),l=Ce(i),c=e=>e.target===s.current||e.target===a.current,u=ce(Ht);if(!u)throw new Error("Select.Option can only be used as Select or MultiSelect child");const{selectValue:d,value:h,multiple:f}=u,m=ae((()=>!n&&(f?h.includes(e)||0===h.length&&void 0===e:h===e)),[h,n,f,e]),p=le((()=>{const t={closeListbox:!0};d(f?void 0!==e?[e]:[]:e,t)
49
49
  }),[f,d,e]),g=le((()=>{if(!f)return;const t={closeListbox:void 0===e};if(void 0===e)return void d([],t);const n=h.indexOf(e);if(-1===n)d([...h,e],t);else{const e=[...h];e.splice(n,1),d(e,t)}}),[h,f,d,e]);return Te("li",{className:ke("w-full ring-inset outline-none rounded-none select-none","px-1 mb-1 first:mt-1 whitespace-nowrap group",{"text-grey-4":n,"cursor-pointer":!n},o),onClick:e=>{n||c(e)||p()},onKeyDown:e=>{n||(["Enter"," "].includes(e.key)&&!c(e)?(e.preventDefault(),p()):s.current&&"ArrowRight"===e.key&&(e.preventDefault(),s.current.focus()))},role:"option","aria-disabled":n,"aria-selected":m,tabIndex:m?0:-1,ref:l,title:r,children:Te("div",{className:ke("flex justify-between items-center","w-full rounded",{"hover:bg-grey-1 group-focus-visible:ring":!n,"bg-grey-1 hover:bg-grey-2":m}),children:[Te("div",{className:ke("py-2 pl-3",{truncate:"truncate"===u.listboxOverflow,"whitespace-normal":"wrap"===u.listboxOverflow}),children:Ft(t,{selected:m,disabled:n})},void 0,0,{fileName:Dt,lineNumber:203,
50
50
  columnNumber:9},this),!f&&Te("div",{className:"px-3",children:Te(Ge,{className:ke("text-grey-6 scale-125",{"opacity-0":!m})},void 0,0,{fileName:Dt,lineNumber:213,columnNumber:13},this)},void 0,0,{fileName:Dt,lineNumber:212,columnNumber:11},this),f&&Te(Rt,{containerClasses:ke("self-stretch px-3","text-lg",{"text-grey-6":m,"text-grey-3 hover:text-grey-6":!m}),checked:m,checkedIcon:Ze,elementRef:s,containerRef:a,onChange:g,onKeyDown:e=>{var t;"ArrowLeft"===e.key&&(e.preventDefault(),null===(t=l.current)||void 0===t||t.focus())}},void 0,0,{fileName:Dt,lineNumber:224,columnNumber:11},this)]},void 0,0,{fileName:Dt,lineNumber:193,columnNumber:7},this)},void 0,0,{fileName:Dt,lineNumber:146,columnNumber:5},this)}function Ut({buttonContent:e,value:t,onChange:n,children:o,disabled:i,elementRef:r,buttonId:s,buttonClasses:a,popoverClasses:l,containerClasses:c,onPopoverScroll:u,alignListbox:d="left",multiple:h,listboxOverflow:f="truncate","aria-label":m,"aria-labelledby":p,listboxAsPopover:g}){
51
51
  const _=se(null),b=se(null),[v,w]=oe(!1),y=le((()=>w(!1)),[w]),x=ue(),N=Ce(r),C=ue(),S=le(((e,t)=>{n(e),t.closeListbox&&y()}),[n,y]);return function(e,t,{enabled:n=!0}={}){ie((()=>{if(!n||!e.current)return()=>{};const o=new ve;return o.add(e.current,"focusout",(n=>{const o=n;e.current&&!e.current.contains(o.relatedTarget)&&t(o)})),()=>{o.removeAll()}}),[e,n,t])}(_,y),ye(b,{horizontal:!1,loop:!1,autofocus:!0,containerVisible:v,selector:'[role="option"]:not([aria-disabled="true"])'}),Te("div",{className:ke("relative w-full border rounded",{"border-grey-5":v},xt,c),ref:_,children:[Te("button",{id:null!=s?s:C,className:ke("focus-visible-ring transition-colors whitespace-nowrap","w-full flex items-center justify-between gap-x-2","bg-grey-0 disabled:bg-grey-1 disabled:text-grey-6","text-left","rounded-[inherit]",a),type:"button",role:"combobox",disabled:i,"aria-expanded":v,"aria-haspopup":"listbox","aria-controls":x,"aria-label":m,"aria-labelledby":p,ref:N,onClick:()=>w((e=>!e)),onKeyDown:e=>{
@@ -147,7 +147,7 @@ this._sidebarRPC.on("navigateToSegment",(e=>this._integration.navigateToSegment?
147
147
  if(!t.selector||!t.selector.some((e=>"TextQuoteSelector"===e.type)))return{annotation:e,target:t};let n;try{const o=await this._integration.anchor(this.element,t.selector),i=ho.fromRange(o);n={annotation:e,target:t,range:i}}catch{n={annotation:e,target:t}}return n})));if(!this._annotations.has(e.$tag))return[];for(const e of n)t(e);return e.$orphan=n.length>0&&n.every((e=>e.target.selector&&!e.range)),this._updateAnchors(this.anchors.concat(n),!0),this._sidebarRPC.call("syncAnchoringStatus",e),n}detach(e,t=!0){this._annotations.delete(e);const n=[];for(const t of this.anchors)t.annotation.$tag!==e?n.push(t):t.highlights&&So(t.highlights);this._updateAnchors(n,t)}_updateAnchors(e,t){this.anchors=e,this._clusterToolbar?.scheduleClusterUpdates(),t&&this._bucketBarClient.update(this.anchors)}async createAnnotation({highlight:e=!1}={}){const t=this.selectedRanges;this.selectedRanges=[];const n=await this.getDocumentInfo(),o=this.element,i=(await Promise.all(t.map((e=>this._integration.describe(o,e))))).map((e=>({
148
148
  source:n.uri,selector:e}))),r={uri:n.uri,document:n.metadata,target:i,$highlight:e,$cluster:e?"user-highlights":"user-annotations",$tag:"a:"+Zt(8)};return this._sidebarRPC.call("createAnnotation",r),this.anchor(r),Cr(),r}_hoverAnnotations(e){this._hoveredAnnotations.clear(),e.forEach((e=>this._hoveredAnnotations.add(e)));for(const t of this.anchors)if(t.highlights){const n=e.includes(t.annotation.$tag);Eo(t.highlights,n)}this._sidebarRPC.call("hoverAnnotations",e)}_onSelection(e){const t=this._integration.getAnnotatableRange(e);if(!t)return void this._onClearSelection();const n=document.getSelection(),o=_o(n),i=wo(n);i?(this.selectedRanges=[t],this._hostRPC.call("textSelected"),this._adder.annotationsForSelection=yr(),this._isAdderVisible=!0,this._adder.show(i,o)):this._onClearSelection()}_onClearSelection(){this._isAdderVisible=!1,this._adder.hide(),this.selectedRanges=[],this._informHostOnNextSelectionClear&&this._hostRPC.call("textUnselected"),this._informHostOnNextSelectionClear=!0}
149
149
  selectAnnotations(e,{toggle:t=!1,focusInSidebar:n=!1}={}){t?this._sidebarRPC.call("toggleAnnotationSelection",e):this._sidebarRPC.call("showAnnotations",e,n),this._sidebarRPC.call("openSidebar")}setHighlightsVisible(e,t=!0){!function(e,t){e.classList.toggle("hypothesis-highlights-always-on",t)}(this.element,e),this._highlightsVisible=e,t&&this._hostRPC.call("highlightsVisibleChanged",e)}get highlightsVisible(){return this._highlightsVisible}fitSideBySide(e){this._sidebarLayout=e,this._integration.fitSideBySide(e)}get hoveredAnnotationTags(){return this._hoveredAnnotations}_handleShortcut(e){zn(e,"Ctrl+Shift+H")&&this.setHighlightsVisible(!this._highlightsVisible)}_setOutsideAssignmentNoticeVisible(e){this._outsideAssignmentNotice||(this._outsideAssignmentNotice=new br(this.element)),this._outsideAssignmentNotice.setVisible(e)}}function Ar(e,t){const n=new URL(e),o=new URLSearchParams;return o.append("config",JSON.stringify(t)),n.hash=o.toString(),n.toString()}function Rr(e,t){const n={}
150
- ;for(const[e,o]of Object.entries(t))"notebookAppUrl"!==e&&"sidebarAppUrl"!==e&&null!=o&&(n[e]=o);n.origin=new URL(e).origin,n.version="1.1582.0";const o=new URL(window.location.href);if(o.hash="",n.hostURL=o.toString(),Array.isArray(n.services)&&n.services?.length>0){const e=n.services[0];e.onLoginRequest&&(e.onLoginRequestProvided=!0),e.onLogoutRequest&&(e.onLogoutRequestProvided=!0),e.onSignupRequest&&(e.onSignupRequestProvided=!0),e.onProfileRequest&&(e.onProfileRequestProvided=!0),e.onHelpRequest&&(e.onHelpRequestProvided=!0)}return n}function kr({closed:e,onClose:t,children:n,"data-testid":o,"aria-label":i}){const r=se(null);return ie((()=>{e?r.current?.close():r.current?.showModal()}),[e]),ie((()=>{const e=r.current;return e?.addEventListener("cancel",t),()=>{e?.removeEventListener("cancel",t)}}),[t]),Te("dialog",{ref:r,className:"relative w-full h-full backdrop:bg-black/50","data-testid":o,"aria-label":i,children:n})}function Pr({closed:e,children:t,...n}){return Te("div",{...n,
150
+ ;for(const[e,o]of Object.entries(t))"notebookAppUrl"!==e&&"sidebarAppUrl"!==e&&null!=o&&(n[e]=o);n.origin=new URL(e).origin,n.version="1.1584.0";const o=new URL(window.location.href);if(o.hash="",n.hostURL=o.toString(),Array.isArray(n.services)&&n.services?.length>0){const e=n.services[0];e.onLoginRequest&&(e.onLoginRequestProvided=!0),e.onLogoutRequest&&(e.onLogoutRequestProvided=!0),e.onSignupRequest&&(e.onSignupRequestProvided=!0),e.onProfileRequest&&(e.onProfileRequestProvided=!0),e.onHelpRequest&&(e.onHelpRequestProvided=!0)}return n}function kr({closed:e,onClose:t,children:n,"data-testid":o,"aria-label":i}){const r=se(null);return ie((()=>{e?r.current?.close():r.current?.showModal()}),[e]),ie((()=>{const e=r.current;return e?.addEventListener("cancel",t),()=>{e?.removeEventListener("cancel",t)}}),[t]),Te("dialog",{ref:r,className:"relative w-full h-full backdrop:bg-black/50","data-testid":o,"aria-label":i,children:n})}function Pr({closed:e,children:t,...n}){return Te("div",{...n,
151
151
  className:ke("fixed z-max top-0 left-0 right-0 bottom-0 p-3 bg-black/50",{hidden:e}),children:Te("div",{className:"relative w-full h-full",children:t})})}function Tr({document_:e=document,...t}){return Te(ae((()=>function(e){return"function"==typeof e.createElement("dialog").showModal}(e)?kr:Pr),[e]),{...t})}function Mr({config:e,groupId:t}){return Te("iframe",{title:"Hypothesis annotation notebook",className:"h-full w-full border-0",allow:"fullscreen; clipboard-write",src:Ar(e.notebookAppUrl,{...Rr(e.notebookAppUrl,e),group:t})})}function Lr({eventBus:e,config:t}){const[n,o]=oe(0),[i,r]=oe(!0),[s,a]=oe(null),l=se(""),c=se(null);ie((()=>(l.current=document.body.style.overflow,()=>{document.body.style.overflow=l.current})),[]),ie((()=>{document.body.style.overflow=i?l.current:"hidden"}),[i]),ie((()=>{const t=e.createEmitter();return t.subscribe("openNotebook",(e=>{r(!1),o((e=>e+1)),a(e)})),c.current=t,()=>{t.destroy()}}),[e]);const u=le((()=>{r(!0),c.current?.publish("closeNotebook")}),[])
152
152
  ;return null===s?null:Te(Tr,{closed:i,onClose:u,"data-testid":"notebook-outer","aria-label":"Hypothesis notebook",children:[Te("div",{className:"absolute right-0 m-3",children:Te(Ct,{title:"Close notebook",onClick:u,variant:"dark",classes:ke("!bg-transparent enabled:hover:!bg-grey-3"),"data-testid":"close-button",children:Te(Fe,{className:"w-4 h-4"})})}),Te(Mr,{config:t,groupId:s},n)]})}class Or{constructor(e,t,n){this._container=new Zn("notebook",(()=>Te(Lr,{eventBus:t,config:n}))),e.append(this._container.element),this._container.render()}destroy(){this._container.destroy()}}function Ir({eventBus:e,config:t}){const[n,o]=oe(!0),i=se(null);ie((()=>{const t=e.createEmitter();return t.subscribe("openProfile",(()=>{o(!1)})),i.current=t,()=>{t.destroy()}}),[e]);const r=()=>{o(!0),i.current?.publish("closeProfile")};return n?null:Te(Tr,{closed:n,onClose:r,"data-testid":"profile-outer","aria-label":"Hypothesis profile",children:[Te("div",{className:"absolute right-0 m-3",children:Te(Ct,{
153
153
  title:"Close profile dialog",onClick:r,variant:"dark",classes:ke("!bg-transparent enabled:hover:!bg-grey-3"),children:Te(Fe,{className:"w-4 h-4"})})}),Te("iframe",{title:"Hypothesis profile",className:"h-full w-full border-0",src:t.profileAppUrl})]})}class Br{constructor(e,t,n){this._container=new Zn("profile",(()=>Te(Ir,{eventBus:t,config:n}))),e.append(this._container.element),this._container.render()}destroy(){this._container.destroy()}}function Hr({above:e,below:t,buckets:n,onFocusAnnotations:o,onScrollToAnnotation:i,onSelectAnnotations:r}){const s=e.anchors.length>0,a=t.anchors.length>0,l=e=>e.anchors.map((e=>e.tag));return Te("ul",{className:"relative",children:[s&&Te("li",{className:"absolute right-0 pointer-events-auto mt-[-11px]",style:{top:e.position},children:Te(Qt,{"data-testid":"up-navigation-button",direction:"up",onClick:()=>{const t=[...e.anchors].sort(((e,t)=>e.bottom-t.bottom)),n=t[t.length-1];i(n.tag)},onBlur:()=>o([]),onFocus:()=>o(l(e)),onMouseEnter:()=>o(l(e)),onMouseOut:()=>o([]),