hypothesis 1.876.0 → 1.877.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 +8 -8
- package/build/scripts/annotator.bundle.js +2 -2
- package/build/scripts/annotator.bundle.js.map +66 -57
- package/build/scripts/sidebar.bundle.js +2 -2
- package/build/scripts/sidebar.bundle.js.map +88 -42
- package/build/scripts/ui-playground.bundle.js +2 -2
- package/build/scripts/ui-playground.bundle.js.map +114 -80
- package/build/styles/sidebar.css +1 -1
- package/build/styles/sidebar.css.map +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function e(t,n,o){var i="function"==typeof hypothesisRequire&&hypothesisRequire;function r(s,a){if(!n[s]){if(!t[s]){var l="function"==typeof hypothesisRequire&&hypothesisRequire;if(!a&&l)return l(s,!0);if(i)return i(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[s]={exports:{}};t[s][0].call(u.exports,(function(e){var n=t[s][1][e];return r(n||e)}),u,u.exports,e,t,n,o)}return n[s].exports}for(var s=0;s<o.length;s++)r(o[s]);return r}({1:[function(e,t,n){t.exports='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false" class="Icon Icon--cancel"><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'},{}],2:[function(e,t,n){t.exports=' <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>'},{}],3:[function(e,t,n){t.exports='<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>'},{}],4:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.normalizeKeyName=function(e){const t={Left:"ArrowLeft",Up:"ArrowUp",Down:"ArrowDown",Right:"ArrowRight",Spacebar:" ",Del:"Delete"};return t[e]?t[e]:e}},{}],5:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Checkbox=u,n.LabeledCheckbox=function(e){var t;let{children:n,id:o}=e,s=c(e,["children","id"]);return null!==(t=o)&&void 0!==t||(o=s.name),(0,i.jsxDEV)("label",{htmlFor:o,className:"Hyp-LabeledCheckbox",children:[(0,i.jsxDEV)(u,a({id:o},s),void 0,!1,{fileName:r,lineNumber:76,columnNumber:7},this),(0,i.jsxDEV)("span",{"data-testid":"label-text",children:n},void 0,!1,{fileName:r,lineNumber:77,columnNumber:7},this)]},void 0,!0,{fileName:r,lineNumber:75,columnNumber:5},this)};var o=e("./SvgIcon"),i=e("preact/compat/jsx-dev-runtime"),r="/home/runner/work/frontend-shared/frontend-shared/src/components/Checkbox.js";function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){if(null==e)return{};var n,o,i=function(e,t){if(null==e)return{};var n,o,i={},r=Object.keys(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function u(e){let{inputRef:t,onToggle:n,onClick:s}=e,l=c(e,["inputRef","onToggle","onClick"]);return(0,i.jsxDEV)(i.Fragment,{children:[(0,i.jsxDEV)("input",a({className:"Hyp-Checkbox",ref:t,type:"checkbox",onClick:function(e){null==n||n(e.currentTarget.checked),null==s||s.call(this,e)}},l),void 0,!1,{fileName:r,lineNumber:55,columnNumber:7},this),(0,i.jsxDEV)(o.SvgIcon,{className:"hyp-svg-checkbox",name:"hyp-checkbox"},void 0,!1,{fileName:r,lineNumber:62,columnNumber:7},this)]},void 0,!0)}(0,o.registerIcons)({"hyp-checkbox":e("../../images/icons/checkbox.svg")})},{"../../images/icons/checkbox.svg":2,"./SvgIcon":10,"preact/compat/jsx-dev-runtime":24}],6:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Dialog=function({buttons:e,cancelLabel:t="Cancel",children:n,contentClass:o,icon:u,initialFocus:d,onCancel:f,role:p="dialog",title:m}){const g=h("dialog-description"),_=h("dialog-title"),v=(0,r.useRef)(null);return(0,r.useEffect)((()=>{if(null!==d){const e=null==d?void 0:d.current;e&&!e.disabled?e.focus():v.current.focus()}}),[]),(0,r.useLayoutEffect)((()=>{const e=v.current.querySelector("p");e&&(e.id=g,v.current.setAttribute("aria-describedby",g))}),[g]),(0,l.jsxDEV)("div",{"aria-labelledby":_,className:(0,i.default)("Hyp-Dialog",{"Hyp-Dialog--closeable":!!f},o),ref:v,role:p,tabIndex:-1,children:[(0,l.jsxDEV)("header",{children:[u&&(0,l.jsxDEV)("div",{className:"Hyp-Dialog__header-icon",children:(0,l.jsxDEV)(a.SvgIcon,{name:u,title:m,"data-testid":"header-icon"},void 0,!1,{fileName:c,lineNumber:129,columnNumber:13},this)},void 0,!1,{fileName:c,lineNumber:128,columnNumber:11},this),(0,l.jsxDEV)("h2",{className:"Hyp-Dialog__title",id:_,children:m},void 0,!1,{fileName:c,lineNumber:132,columnNumber:9},this),f&&(0,l.jsxDEV)("div",{className:"Hyp-Dialog__close",children:(0,l.jsxDEV)(s.IconButton,{icon:"hyp-cancel",title:"Close",onClick:f},void 0,!1,{fileName:c,lineNumber:137,columnNumber:13},this)},void 0,!1,{fileName:c,lineNumber:136,columnNumber:11},this)]},void 0,!0,{fileName:c,lineNumber:126,columnNumber:7},this),n,(0,l.jsxDEV)("div",{className:"Hyp-Dialog__actions",children:[f&&(0,l.jsxDEV)(s.LabeledButton,{"data-testid":"cancel-button",onClick:f,children:t},void 0,!1,{fileName:c,lineNumber:144,columnNumber:11},this),e]},void 0,!0,{fileName:c,lineNumber:142,columnNumber:7},this)]},void 0,!0,{fileName:c,lineNumber:115,columnNumber:5},this)};var o,i=(o=e("classnames"))&&o.__esModule?o:{default:o},r=e("preact/hooks"),s=e("./buttons"),a=e("./SvgIcon"),l=e("preact/compat/jsx-dev-runtime"),c="/home/runner/work/frontend-shared/frontend-shared/src/components/Dialog.js";(0,a.registerIcons)({"hyp-cancel":e("../../images/icons/cancel.svg")});let u=0;function h(e){const[t]=(0,r.useState)((()=>(++u,`${e}-${u}`)));return t}},{"../../images/icons/cancel.svg":1,"./SvgIcon":10,"./buttons":14,classnames:20,"preact/compat/jsx-dev-runtime":24,"preact/hooks":26}],7:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Modal=f,n.ConfirmModal=function(e){let{message:t,confirmAction:n,onConfirm:o,onCancel:i}=e,r=d(e,["message","confirmAction","onConfirm","onCancel"]);return(0,a.jsxDEV)(f,u(u({onCancel:i,buttons:[(0,a.jsxDEV)(s.LabeledButton,{onClick:o,variant:"primary","data-testid":"confirm-button",children:n},"ok",!1,{fileName:l,lineNumber:74,columnNumber:9},this)]},r),{},{children:(0,a.jsxDEV)("p",{children:t},void 0,!1,{fileName:l,lineNumber:85,columnNumber:7},this)}),void 0,!1,{fileName:l,lineNumber:71,columnNumber:5},this)};var o=e("preact/hooks"),i=e("../hooks/use-element-should-close"),r=e("./Dialog"),s=e("./buttons"),a=e("preact/compat/jsx-dev-runtime"),l="/home/runner/work/frontend-shared/frontend-shared/src/components/Modal.js";function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){h(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t){if(null==e)return{};var n,o,i=function(e,t){if(null==e)return{};var n,o,i={},r=Object.keys(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function f(e){let{children:t,onCancel:n}=e,s=d(e,["children","onCancel"]);const c=(0,o.useRef)(null);return(0,i.useElementShouldClose)(c,!0,(()=>{n&&n()})),(0,a.jsxDEV)(a.Fragment,{children:[(0,a.jsxDEV)("div",{className:"Hyp-Modal__overlay"},void 0,!1,{fileName:l,lineNumber:37,columnNumber:7},this),(0,a.jsxDEV)("div",{className:"Hyp-Modal",ref:c,children:(0,a.jsxDEV)(r.Dialog,u(u({onCancel:n},s),{},{children:t}),void 0,!1,{fileName:l,lineNumber:39,columnNumber:9},this)},void 0,!1,{fileName:l,lineNumber:38,columnNumber:7},this)]},void 0,!0)}},{"../hooks/use-element-should-close":16,"./Dialog":6,"./buttons":14,"preact/compat/jsx-dev-runtime":24,"preact/hooks":26}],8:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Panel=function({children:e,icon:t,onClose:n,title:o}){const c=!!n;return(0,a.jsxDEV)("div",{className:(0,i.default)("Hyp-Panel",{"Hyp-Panel--closeable":c}),children:[(0,a.jsxDEV)("header",{children:[t&&(0,a.jsxDEV)("div",{className:"Hyp-Panel__header-icon",children:(0,a.jsxDEV)(s.SvgIcon,{name:t,title:o},void 0,!1,{fileName:l,lineNumber:38,columnNumber:13},this)},void 0,!1,{fileName:l,lineNumber:37,columnNumber:11},this),(0,a.jsxDEV)("h2",{className:"Hyp-Panel__title",children:o},void 0,!1,{fileName:l,lineNumber:41,columnNumber:9},this),c&&(0,a.jsxDEV)("div",{className:"Hyp-Panel__close",children:(0,a.jsxDEV)(r.IconButton,{icon:"hyp-cancel",title:"Close",onClick:n},void 0,!1,{fileName:l,lineNumber:44,columnNumber:13},this)},void 0,!1,{fileName:l,lineNumber:43,columnNumber:11},this)]},void 0,!0,{fileName:l,lineNumber:35,columnNumber:7},this),(0,a.jsxDEV)("div",{className:"Hyp-Panel__content",children:e},void 0,!1,{fileName:l,lineNumber:48,columnNumber:7},this)]},void 0,!0,{fileName:l,lineNumber:30,columnNumber:5},this)};var o,i=(o=e("classnames"))&&o.__esModule?o:{default:o},r=e("./buttons"),s=e("./SvgIcon"),a=e("preact/compat/jsx-dev-runtime"),l="/home/runner/work/frontend-shared/frontend-shared/src/components/Panel.js";(0,s.registerIcons)({"hyp-cancel":e("../../images/icons/cancel.svg")})},{"../../images/icons/cancel.svg":1,"./SvgIcon":10,"./buttons":14,classnames:20,"preact/compat/jsx-dev-runtime":24}],9:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Spinner=function({classes:e="",size:t="medium"}){const n=`Hyp-Spinner--${t}`;return(0,s.jsxDEV)(r.SvgIcon,{name:"hyp-spinner",className:(0,i.default)(n,e)},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/Spinner.js",lineNumber:26,columnNumber:5},this)};var o,i=(o=e("classnames"))&&o.__esModule?o:{default:o},r=e("./SvgIcon"),s=e("preact/compat/jsx-dev-runtime");(0,r.registerIcons)({"hyp-spinner":e("../../images/icons/spinner--spokes.svg")})},{"../../images/icons/spinner--spokes.svg":3,"./SvgIcon":10,classnames:20,"preact/compat/jsx-dev-runtime":24}],10:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.SvgIcon=function({name:e,className:t="",inline:n=!1,title:o=""}){if(!c[e])throw new Error(`Icon name "${e}" is not registered`);const u=c[e],h=(0,r.useRef)();(0,r.useLayoutEffect)((()=>{const e=h.current.querySelector("svg");e&&e.setAttribute("class",t)}),[t,u]);const d={};return o&&(d.title=o),(0,s.jsxDEV)("span",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({className:(0,i.default)("Hyp-SvgIcon",{"Hyp-SvgIcon--inline":n}),dangerouslySetInnerHTML:{__html:u},ref:h},d),void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/SvgIcon.js",lineNumber:69,columnNumber:5},this)},n.registerIcons=function(e,{reset:t=!1}={}){t&&(c={}),Object.assign(c,e)},n.availableIcons=function(){return c};var o,i=(o=e("classnames"))&&o.__esModule?o:{default:o},r=e("preact/hooks"),s=e("preact/compat/jsx-dev-runtime");function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let c={}},{classnames:20,"preact/compat/jsx-dev-runtime":24,"preact/hooks":26}],11:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Table=function({accessibleLabel:e,classes:t,containerClasses:n,emptyItemsMessage:o,isLoading:d=!1,items:f,onSelectItem:p,onUseItem:m,renderItem:g,selectedItem:_,tableHeaders:v}){const b=(0,r.useRef)([]),y=(0,r.useRef)(null),w=(0,r.useRef)(null),x=e=>{const t=b.current[f.indexOf(e)];t&&t.focus(),p(e)};return(0,r.useEffect)((()=>{if(!_)return;const e=b.current[f.indexOf(_)],t=w.current,n=y.current;if(e&&t&&n){const o=t.offsetHeight,i=e.offsetTop-n.scrollTop;i>=n.clientHeight&&e.scrollIntoView(),i<=o&&n.scrollBy(0,i-o)}}),[f,_]),(0,c.jsxDEV)(l.Scrollbox,{withHeader:!0,classes:(0,i.default)("Hyp-Table-Scrollbox",n),containerRef:y,children:[(0,c.jsxDEV)("table",{"aria-label":e,className:(0,i.default)("Hyp-Table",t),tabIndex:0,role:"grid",onKeyDown:e=>{let t=!1;switch(e.key){case"Enter":t=!0,_&&m(_);break;case"ArrowUp":t=!0,x(h(f,_,-1));break;case"ArrowDown":t=!0,x(h(f,_,1));break;default:t=!1}t&&(e.preventDefault(),e.stopPropagation())},children:[(0,c.jsxDEV)("thead",{ref:(0,s.downcastRef)(w),children:(0,c.jsxDEV)("tr",{children:v.map((({classes:e,label:t},n)=>(0,c.jsxDEV)("th",{className:(0,i.default)("Hyp-Table__header",e),scope:"col",children:t},`${t}-${n}`,!1,{fileName:u,lineNumber:180,columnNumber:15},this)))},void 0,!1,{fileName:u,lineNumber:178,columnNumber:11},this)},void 0,!1,{fileName:u,lineNumber:177,columnNumber:9},this),(0,c.jsxDEV)("tbody",{children:!d&&f.map(((e,t)=>(0,c.jsxDEV)("tr",{"aria-selected":_===e,className:(0,i.default)({"is-selected":_===e}),onMouseDown:()=>p(e),onClick:()=>p(e),onDblClick:()=>m(e),ref:e=>b.current[t]=e,tabIndex:-1,children:g(e,_===e)},t,!1,{fileName:u,lineNumber:193,columnNumber:15},this)))},void 0,!1,{fileName:u,lineNumber:190,columnNumber:9},this)]},void 0,!0,{fileName:u,lineNumber:170,columnNumber:7},this),d&&(0,c.jsxDEV)("div",{className:"Hyp-Table-Scrollbox__loading",children:(0,c.jsxDEV)(a.Spinner,{size:"large"},void 0,!1,{fileName:u,lineNumber:212,columnNumber:11},this)},void 0,!1,{fileName:u,lineNumber:211,columnNumber:9},this),!d&&0===f.length&&o&&(0,c.jsxDEV)("div",{className:"Hyp-Table-Scrollbox__message","data-testid":"empty-items-message",children:o},void 0,!1,{fileName:u,lineNumber:216,columnNumber:9},this)]},void 0,!0,{fileName:u,lineNumber:165,columnNumber:5},this)};var o,i=(o=e("classnames"))&&o.__esModule?o:{default:o},r=e("preact/hooks"),s=e("../util/typing"),a=e("./Spinner"),l=e("./containers"),c=e("preact/compat/jsx-dev-runtime"),u="/home/runner/work/frontend-shared/frontend-shared/src/components/Table.js";function h(e,t,n){const o=t?e.indexOf(t):-1,i=o+n;return o<0||i<0?e[0]:i>=e.length?e[e.length-1]:e[i]}},{"../util/typing":18,"./Spinner":9,"./containers":15,classnames:20,"preact/compat/jsx-dev-runtime":24,"preact/hooks":26}],12:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.TextInput=function(e){let{classes:t="",inputRef:n,hasError:o=!1,type:a="text"}=e,c=function(e,t){if(null==e)return{};var n,o,i=function(e,t){if(null==e)return{};var n,o,i={},r=Object.keys(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,["classes","inputRef","hasError","type"]);return(0,r.jsxDEV)("input",l(l({className:(0,i.default)("Hyp-TextInput",{"has-error":o},t)},c),{},{ref:n,type:a}),void 0,!1,{fileName:s,lineNumber:39,columnNumber:5},this)},n.TextInputWithButton=function({children:e,classes:t=""}){return(0,r.jsxDEV)("div",{className:(0,i.default)("Hyp-TextInputWithButton",t),children:e},void 0,!1,{fileName:s,lineNumber:67,columnNumber:5},this)};var o,i=(o=e("classnames"))&&o.__esModule?o:{default:o},r=e("preact/compat/jsx-dev-runtime"),s="/home/runner/work/frontend-shared/frontend-shared/src/components/TextInput.js";function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},{classnames:20,"preact/compat/jsx-dev-runtime":24}],13:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Thumbnail=function({children:e,classes:t="",isLoading:n=!1,placeholder:o="...",size:c="medium"}){const u=(0,r.toChildArray)(e).length?e:o;return(0,a.jsxDEV)("div",{className:(0,i.default)("Hyp-Thumbnail",t),children:(0,a.jsxDEV)("div",{className:"Hyp-Thumbnail__content",children:[n&&(0,a.jsxDEV)(s.Spinner,{size:c},void 0,!1,{fileName:l,lineNumber:59,columnNumber:23},this),!n&&u]},void 0,!0,{fileName:l,lineNumber:58,columnNumber:7},this)},void 0,!1,{fileName:l,lineNumber:57,columnNumber:5},this)};var o,i=(o=e("classnames"))&&o.__esModule?o:{default:o},r=e("preact"),s=e("./Spinner"),a=e("preact/compat/jsx-dev-runtime"),l="/home/runner/work/frontend-shared/frontend-shared/src/components/Thumbnail.js"},{"./Spinner":9,classnames:20,preact:25,"preact/compat/jsx-dev-runtime":24}],14:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.IconButton=function(e){let{className:t="Hyp-IconButton"}=e,n=h(e,["className"]);const{icon:o}=n;return(0,s.jsxDEV)(d,c(c({className:t},n),{},{children:(0,s.jsxDEV)(r.SvgIcon,{name:o},void 0,!1,{fileName:a,lineNumber:100,columnNumber:7},this)}),void 0,!1,{fileName:a,lineNumber:99,columnNumber:5},this)},n.LabeledButton=function(e){let{children:t,className:n="Hyp-LabeledButton"}=e,o=h(e,["children","className"]);const{icon:i,iconPosition:l="left"}=o;return(0,s.jsxDEV)(d,c(c({className:n},o),{},{children:[i&&"left"===l&&(0,s.jsxDEV)(r.SvgIcon,{name:i},void 0,!1,{fileName:a,lineNumber:118,columnNumber:43},this),t,i&&"right"===l&&(0,s.jsxDEV)(r.SvgIcon,{name:i},void 0,!1,{fileName:a,lineNumber:120,columnNumber:44},this)]}),void 0,!0,{fileName:a,lineNumber:117,columnNumber:5},this)},n.LinkButton=function(e){return(0,s.jsxDEV)(d,c({className:"Hyp-LinkButton"},e),void 0,!1,{fileName:a,lineNumber:131,columnNumber:10},this)};var o,i=(o=e("classnames"))&&o.__esModule?o:{default:o},r=e("./SvgIcon"),s=e("preact/compat/jsx-dev-runtime"),a="/home/runner/work/frontend-shared/frontend-shared/src/components/buttons.js";function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e,t){if(null==e)return{};var n,o,i=function(e,t){if(null==e)return{};var n,o,i={},r=Object.keys(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function d(e){let{buttonRef:t,classes:n,className:o,icon:r,iconPosition:l="left",size:u="medium",variant:d="normal",expanded:f,pressed:p,type:m="button"}=e,g=h(e,["buttonRef","classes","className","icon","iconPosition","size","variant","expanded","pressed","type"]);const _={"aria-expanded":f,"aria-pressed":p,"aria-label":g.title};return(0,s.jsxDEV)("button",c(c({ref:t,className:(0,i.default)(o,`${o}--${u}`,`${o}--${d}`,{[`${o}--icon-${l}`]:r},n),type:m},_),g),void 0,!1,{fileName:a,lineNumber:73,columnNumber:5},this)}},{"./SvgIcon":10,classnames:20,"preact/compat/jsx-dev-runtime":24}],15:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Frame=function({children:e,classes:t="",containerRef:n}){return(0,s.jsxDEV)("div",{className:(0,i.default)("Hyp-Frame",t),ref:(0,r.downcastRef)(n),children:e},void 0,!1,{fileName:a,lineNumber:26,columnNumber:5},this)},n.Card=function({children:e,classes:t="",containerRef:n}){return(0,s.jsxDEV)("div",{className:(0,i.default)("Hyp-Card",t),ref:(0,r.downcastRef)(n),children:e},void 0,!1,{fileName:a,lineNumber:42,columnNumber:5},this)},n.Actions=function({children:e,direction:t="row",classes:n="",containerRef:o}){const l=`Hyp-Actions--${t}`;return(0,s.jsxDEV)("div",{className:(0,i.default)(l,n),ref:(0,r.downcastRef)(o),children:e},void 0,!1,{fileName:a,lineNumber:72,columnNumber:5},this)},n.Scrollbox=function({children:e,classes:t="",containerRef:n,withHeader:o=!1}){const l=o?"Hyp-Scrollbox--with-header":"Hyp-Scrollbox";return(0,s.jsxDEV)("div",{className:(0,i.default)(l,t),ref:(0,r.downcastRef)(n),children:e},void 0,!1,{fileName:a,lineNumber:101,columnNumber:5},this)};var o,i=(o=e("classnames"))&&o.__esModule?o:{default:o},r=e("../util/typing"),s=e("preact/compat/jsx-dev-runtime"),a="/home/runner/work/frontend-shared/frontend-shared/src/components/containers.js"},{"../util/typing":18,classnames:20,"preact/compat/jsx-dev-runtime":24}],16:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.useElementShouldClose=function(e,t,n){(0,o.useEffect)((()=>{if(!t)return()=>{};const o=r(document.body,["keydown"],(e=>{const t=e;"Escape"===(0,i.normalizeKeyName)(t.key)&&n()})),s=r(document.body,["focus"],(t=>{e.current.contains(t.target)||n()}),{useCapture:!0}),a=r(document.body,["mousedown","click"],(t=>{e.current.contains(t.target)||n()}),{useCapture:!0});return()=>{o(),a(),s()}}),[e,t,n])};var o=e("preact/hooks"),i=e("../browser-compatibility-utils");function r(e,t,n,{useCapture:o=!1}={}){return t.forEach((t=>e.addEventListener(t,n,o))),()=>{t.forEach((t=>e.removeEventListener(t,n,o)))}}},{"../browser-compatibility-utils":4,"preact/hooks":26}],17:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"IconButton",{enumerable:!0,get:function(){return o.IconButton}}),Object.defineProperty(n,"LabeledButton",{enumerable:!0,get:function(){return o.LabeledButton}}),Object.defineProperty(n,"LinkButton",{enumerable:!0,get:function(){return o.LinkButton}}),Object.defineProperty(n,"LabeledCheckbox",{enumerable:!0,get:function(){return i.LabeledCheckbox}}),Object.defineProperty(n,"Checkbox",{enumerable:!0,get:function(){return i.Checkbox}}),Object.defineProperty(n,"Frame",{enumerable:!0,get:function(){return r.Frame}}),Object.defineProperty(n,"Card",{enumerable:!0,get:function(){return r.Card}}),Object.defineProperty(n,"Actions",{enumerable:!0,get:function(){return r.Actions}}),Object.defineProperty(n,"Scrollbox",{enumerable:!0,get:function(){return r.Scrollbox}}),Object.defineProperty(n,"Dialog",{enumerable:!0,get:function(){return s.Dialog}}),Object.defineProperty(n,"Modal",{enumerable:!0,get:function(){return a.Modal}}),Object.defineProperty(n,"ConfirmModal",{enumerable:!0,get:function(){return a.ConfirmModal}}),Object.defineProperty(n,"Panel",{enumerable:!0,get:function(){return l.Panel}}),Object.defineProperty(n,"Spinner",{enumerable:!0,get:function(){return c.Spinner}}),Object.defineProperty(n,"SvgIcon",{enumerable:!0,get:function(){return u.SvgIcon}}),Object.defineProperty(n,"registerIcons",{enumerable:!0,get:function(){return u.registerIcons}}),Object.defineProperty(n,"Table",{enumerable:!0,get:function(){return h.Table}}),Object.defineProperty(n,"TextInput",{enumerable:!0,get:function(){return d.TextInput}}),Object.defineProperty(n,"TextInputWithButton",{enumerable:!0,get:function(){return d.TextInputWithButton}}),Object.defineProperty(n,"Thumbnail",{enumerable:!0,get:function(){return f.Thumbnail}}),Object.defineProperty(n,"useElementShouldClose",{enumerable:!0,get:function(){return p.useElementShouldClose}}),Object.defineProperty(n,"normalizeKeyName",{enumerable:!0,get:function(){return m.normalizeKeyName}});var o=e("./components/buttons"),i=e("./components/Checkbox"),r=e("./components/containers"),s=e("./components/Dialog"),a=e("./components/Modal"),l=e("./components/Panel"),c=e("./components/Spinner"),u=e("./components/SvgIcon"),h=e("./components/Table"),d=e("./components/TextInput"),f=e("./components/Thumbnail"),p=e("./hooks/use-element-should-close"),m=e("./browser-compatibility-utils")},{"./browser-compatibility-utils":4,"./components/Checkbox":5,"./components/Dialog":6,"./components/Modal":7,"./components/Panel":8,"./components/Spinner":9,"./components/SvgIcon":10,"./components/Table":11,"./components/TextInput":12,"./components/Thumbnail":13,"./components/buttons":14,"./components/containers":15,"./hooks/use-element-should-close":16}],18:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.downcastRef=function(e){return e}},{}],19:[function(e,t,n){"use strict";function o(e){return e.split("").reverse().join("")}function i(e){return(e|-e)>>31&1}function r(e,t,n,o){var r=e.P[n],s=e.M[n],a=o>>>31,l=t[n]|a,c=l|s,u=(l&r)+r^r|l,h=s|~(u|r),d=r&u,f=i(h&e.lastRowMask[n])-i(d&e.lastRowMask[n]);return h<<=1,d<<=1,r=(d|=a)|~(c|(h|=i(o)-a)),s=h&c,e.P[n]=r,e.M[n]=s,f}function s(e,t,n){if(0===t.length)return[];n=Math.min(n,t.length);var o=[],i=32,s=Math.ceil(t.length/i)-1,a={P:new Uint32Array(s+1),M:new Uint32Array(s+1),lastRowMask:new Uint32Array(s+1)};a.lastRowMask.fill(1<<31),a.lastRowMask[s]=1<<(t.length-1)%i;for(var l=new Uint32Array(s+1),c=new Map,u=[],h=0;h<256;h++)u.push(l);for(var d=0;d<t.length;d+=1){var f=t.charCodeAt(d);if(!c.has(f)){var p=new Uint32Array(s+1);c.set(f,p),f<u.length&&(u[f]=p);for(var m=0;m<=s;m+=1){p[m]=0;for(var g=0;g<i;g+=1){var _=m*i+g;_>=t.length||t.charCodeAt(_)===f&&(p[m]|=1<<g)}}}}var v=Math.max(0,Math.ceil(n/i)-1),b=new Uint32Array(s+1);for(m=0;m<=v;m+=1)b[m]=(m+1)*i;for(b[s]=t.length,m=0;m<=v;m+=1)a.P[m]=-1,a.M[m]=0;for(var y=0;y<e.length;y+=1){var w=e.charCodeAt(y);p=void 0,w<u.length?p=u[w]:void 0===(p=c.get(w))&&(p=l);var x=0;for(m=0;m<=v;m+=1)x=r(a,p,m,x),b[m]+=x;if(b[v]-x<=n&&v<s&&(1&p[v+1]||x<0)){v+=1,a.P[v]=-1,a.M[v]=0;var E=v===s?t.length%i:i;b[v]=b[v-1]+E-x+r(a,p,v,x)}else for(;v>0&&b[v]>=n+i;)v-=1;v===s&&b[v]<=n&&(b[v]<n&&o.splice(0,o.length),o.push({start:-1,end:y+1,errors:b[v]}),n=b[v])}return o}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e,t,n){return function(e,t,n){var i=o(t);return n.map((function(n){var r=Math.max(0,n.end-t.length-n.errors);return{start:s(o(e.slice(r,n.end)),i,n.errors).reduce((function(e,t){return n.end-t.end<e?n.end-t.end:e}),n.end),end:n.end,errors:n.errors}}))}(e,t,s(e,t,n))}},{}],20:[function(e,t,n){(function(e){(function(){
|
|
1
|
+
!function e(t,n,o){var i="function"==typeof hypothesisRequire&&hypothesisRequire;function r(s,a){if(!n[s]){if(!t[s]){var l="function"==typeof hypothesisRequire&&hypothesisRequire;if(!a&&l)return l(s,!0);if(i)return i(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[s]={exports:{}};t[s][0].call(u.exports,(function(e){var n=t[s][1][e];return r(n||e)}),u,u.exports,e,t,n,o)}return n[s].exports}for(var s=0;s<o.length;s++)r(o[s]);return r}({1:[function(e,t,n){t.exports='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false" class="Icon Icon--cancel"><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'},{}],2:[function(e,t,n){t.exports=' <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>'},{}],3:[function(e,t,n){t.exports='<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>'},{}],4:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.normalizeKeyName=function(e){const t={Left:"ArrowLeft",Up:"ArrowUp",Down:"ArrowDown",Right:"ArrowRight",Spacebar:" ",Del:"Delete"};return t[e]?t[e]:e}},{}],5:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Checkbox=c,n.LabeledCheckbox=function({children:e,id:t,containerClasses:n="",...o}){var r;return null!==(r=t)&&void 0!==r||(t=o.name),(0,s.jsxDEV)("label",{htmlFor:t,className:(0,i.default)("Hyp-LabeledCheckbox",n),children:[(0,s.jsxDEV)(c,{id:t,...o},void 0,!1,{fileName:a,lineNumber:96,columnNumber:7},this),(0,s.jsxDEV)("span",{"data-testid":"label-text",children:e},void 0,!1,{fileName:a,lineNumber:97,columnNumber:7},this)]},void 0,!0,{fileName:a,lineNumber:92,columnNumber:5},this)};var o=l(e("../../images/icons/checkbox.svg")),i=l(e("classnames")),r=e("./SvgIcon"),s=e("preact/compat/jsx-dev-runtime"),a="/home/runner/work/frontend-shared/frontend-shared/src/components/Checkbox.js";function l(e){return e&&e.__esModule?e:{default:e}}function c({classes:e="",inputRef:t,onToggle:n,onClick:o,...l}){return(0,s.jsxDEV)(s.Fragment,{children:[(0,s.jsxDEV)("input",{className:(0,i.default)("Hyp-Checkbox",e),ref:t,type:"checkbox",onClick:function(e){null==n||n(e.currentTarget.checked),null==o||o.call(this,e)},...l},void 0,!1,{fileName:a,lineNumber:67,columnNumber:7},this),(0,s.jsxDEV)(r.SvgIcon,{className:"hyp-svg-checkbox",name:"hyp-checkbox"},void 0,!1,{fileName:a,lineNumber:74,columnNumber:7},this)]},void 0,!0)}(0,r.registerIcons)({"hyp-checkbox":o.default})},{"../../images/icons/checkbox.svg":2,"./SvgIcon":10,classnames:20,"preact/compat/jsx-dev-runtime":24}],6:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Dialog=function({buttons:e,cancelLabel:t="Cancel",children:n,contentClass:r,icon:u,initialFocus:h,onCancel:f,role:p="dialog",title:m}){const g=d("dialog-description"),_=d("dialog-title"),v=(0,i.useRef)(null);return(0,i.useEffect)((()=>{if(null!==h){const e=null==h?void 0:h.current;e&&!e.disabled?e.focus():v.current.focus()}}),[]),(0,i.useLayoutEffect)((()=>{const e=v.current.querySelector("p");e&&(e.id=g,v.current.setAttribute("aria-describedby",g))}),[g]),(0,l.jsxDEV)("div",{"aria-labelledby":_,className:(0,o.default)("Hyp-Dialog",{"Hyp-Dialog--closeable":!!f},r),ref:v,role:p,tabIndex:-1,children:[(0,l.jsxDEV)("header",{children:[u&&(0,l.jsxDEV)("div",{className:"Hyp-Dialog__header-icon",children:(0,l.jsxDEV)(a.SvgIcon,{name:u,title:m,"data-testid":"header-icon"},void 0,!1,{fileName:c,lineNumber:130,columnNumber:13},this)},void 0,!1,{fileName:c,lineNumber:129,columnNumber:11},this),(0,l.jsxDEV)("h2",{className:"Hyp-Dialog__title",id:_,children:m},void 0,!1,{fileName:c,lineNumber:133,columnNumber:9},this),f&&(0,l.jsxDEV)("div",{className:"Hyp-Dialog__close",children:(0,l.jsxDEV)(s.IconButton,{icon:"hyp-cancel",title:"Close",onClick:f},void 0,!1,{fileName:c,lineNumber:138,columnNumber:13},this)},void 0,!1,{fileName:c,lineNumber:137,columnNumber:11},this)]},void 0,!0,{fileName:c,lineNumber:127,columnNumber:7},this),n,(0,l.jsxDEV)("div",{className:"Hyp-Dialog__actions",children:[f&&(0,l.jsxDEV)(s.LabeledButton,{"data-testid":"cancel-button",onClick:f,children:t},void 0,!1,{fileName:c,lineNumber:145,columnNumber:11},this),e]},void 0,!0,{fileName:c,lineNumber:143,columnNumber:7},this)]},void 0,!0,{fileName:c,lineNumber:116,columnNumber:5},this)};var o=u(e("classnames")),i=e("preact/hooks"),r=u(e("../../images/icons/cancel.svg")),s=e("./buttons"),a=e("./SvgIcon"),l=e("preact/compat/jsx-dev-runtime"),c="/home/runner/work/frontend-shared/frontend-shared/src/components/Dialog.js";function u(e){return e&&e.__esModule?e:{default:e}}(0,a.registerIcons)({"hyp-cancel":r.default});let h=0;function d(e){const[t]=(0,i.useState)((()=>(++h,`${e}-${h}`)));return t}},{"../../images/icons/cancel.svg":1,"./SvgIcon":10,"./buttons":14,classnames:20,"preact/compat/jsx-dev-runtime":24,"preact/hooks":26}],7:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Modal=c,n.ConfirmModal=function({message:e,confirmAction:t,onConfirm:n,onCancel:o,...i}){return(0,a.jsxDEV)(c,{onCancel:o,buttons:[(0,a.jsxDEV)(s.LabeledButton,{onClick:n,variant:"primary","data-testid":"confirm-button",children:t},"ok",!1,{fileName:l,lineNumber:74,columnNumber:9},this)],...i,children:(0,a.jsxDEV)("p",{children:e},void 0,!1,{fileName:l,lineNumber:85,columnNumber:7},this)},void 0,!1,{fileName:l,lineNumber:71,columnNumber:5},this)};var o=e("preact/hooks"),i=e("../hooks/use-element-should-close"),r=e("./Dialog"),s=e("./buttons"),a=e("preact/compat/jsx-dev-runtime"),l="/home/runner/work/frontend-shared/frontend-shared/src/components/Modal.js";function c({children:e,onCancel:t,...n}){const s=(0,o.useRef)(null);return(0,i.useElementShouldClose)(s,!0,(()=>{t&&t()})),(0,a.jsxDEV)(a.Fragment,{children:[(0,a.jsxDEV)("div",{className:"Hyp-Modal__overlay"},void 0,!1,{fileName:l,lineNumber:37,columnNumber:7},this),(0,a.jsxDEV)("div",{className:"Hyp-Modal",ref:s,children:(0,a.jsxDEV)(r.Dialog,{onCancel:t,...n,children:e},void 0,!1,{fileName:l,lineNumber:39,columnNumber:9},this)},void 0,!1,{fileName:l,lineNumber:38,columnNumber:7},this)]},void 0,!0)}},{"../hooks/use-element-should-close":16,"./Dialog":6,"./buttons":14,"preact/compat/jsx-dev-runtime":24,"preact/hooks":26}],8:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Panel=function({children:e,icon:t,onClose:n,title:i}){const c=!!n;return(0,a.jsxDEV)("div",{className:(0,o.default)("Hyp-Panel",{"Hyp-Panel--closeable":c}),children:[(0,a.jsxDEV)("header",{children:[t&&(0,a.jsxDEV)("div",{className:"Hyp-Panel__header-icon",children:(0,a.jsxDEV)(s.SvgIcon,{name:t,title:i},void 0,!1,{fileName:l,lineNumber:39,columnNumber:13},this)},void 0,!1,{fileName:l,lineNumber:38,columnNumber:11},this),(0,a.jsxDEV)("h2",{className:"Hyp-Panel__title",children:i},void 0,!1,{fileName:l,lineNumber:42,columnNumber:9},this),c&&(0,a.jsxDEV)("div",{className:"Hyp-Panel__close",children:(0,a.jsxDEV)(r.IconButton,{icon:"hyp-cancel",title:"Close",onClick:n},void 0,!1,{fileName:l,lineNumber:45,columnNumber:13},this)},void 0,!1,{fileName:l,lineNumber:44,columnNumber:11},this)]},void 0,!0,{fileName:l,lineNumber:36,columnNumber:7},this),(0,a.jsxDEV)("div",{className:"Hyp-Panel__content",children:e},void 0,!1,{fileName:l,lineNumber:49,columnNumber:7},this)]},void 0,!0,{fileName:l,lineNumber:31,columnNumber:5},this)};var o=c(e("classnames")),i=c(e("../../images/icons/cancel.svg")),r=e("./buttons"),s=e("./SvgIcon"),a=e("preact/compat/jsx-dev-runtime"),l="/home/runner/work/frontend-shared/frontend-shared/src/components/Panel.js";function c(e){return e&&e.__esModule?e:{default:e}}(0,s.registerIcons)({"hyp-cancel":i.default})},{"../../images/icons/cancel.svg":1,"./SvgIcon":10,"./buttons":14,classnames:20,"preact/compat/jsx-dev-runtime":24}],9:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Spinner=function({classes:e="",size:t="medium"}){const n=`Hyp-Spinner--${t}`;return(0,s.jsxDEV)(r.SvgIcon,{name:"hyp-spinner",className:(0,o.default)(n,e)},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/Spinner.js",lineNumber:27,columnNumber:5},this)};var o=a(e("classnames")),i=a(e("../../images/icons/spinner--spokes.svg")),r=e("./SvgIcon"),s=e("preact/compat/jsx-dev-runtime");function a(e){return e&&e.__esModule?e:{default:e}}(0,r.registerIcons)({"hyp-spinner":i.default})},{"../../images/icons/spinner--spokes.svg":3,"./SvgIcon":10,classnames:20,"preact/compat/jsx-dev-runtime":24}],10:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.SvgIcon=function({name:e,className:t="",inline:n=!1,title:o=""}){if(!a[e])throw new Error(`Icon name "${e}" is not registered`);const l=a[e],c=(0,r.useRef)();(0,r.useLayoutEffect)((()=>{const e=c.current.querySelector("svg");e&&e.setAttribute("class",t)}),[t,l]);const u={};return o&&(u.title=o),(0,s.jsxDEV)("span",{className:(0,i.default)("Hyp-SvgIcon",{"Hyp-SvgIcon--inline":n}),dangerouslySetInnerHTML:{__html:l},ref:c,...u},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/SvgIcon.js",lineNumber:69,columnNumber:5},this)},n.registerIcons=function(e,{reset:t=!1}={}){t&&(a={}),Object.assign(a,e)},n.availableIcons=function(){return a};var o,i=(o=e("classnames"))&&o.__esModule?o:{default:o},r=e("preact/hooks"),s=e("preact/compat/jsx-dev-runtime");let a={}},{classnames:20,"preact/compat/jsx-dev-runtime":24,"preact/hooks":26}],11:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Table=function({accessibleLabel:e,classes:t,containerClasses:n,emptyItemsMessage:o,isLoading:d=!1,items:f,onSelectItem:p,onUseItem:m,renderItem:g,selectedItem:_,tableHeaders:v}){const b=(0,r.useRef)([]),y=(0,r.useRef)(null),w=(0,r.useRef)(null),x=e=>{const t=b.current[f.indexOf(e)];t&&t.focus(),p(e)};return(0,r.useEffect)((()=>{if(!_)return;const e=b.current[f.indexOf(_)],t=w.current,n=y.current;if(e&&t&&n){const o=t.offsetHeight,i=e.offsetTop-n.scrollTop;i>=n.clientHeight&&e.scrollIntoView(),i<=o&&n.scrollBy(0,i-o)}}),[f,_]),(0,c.jsxDEV)(l.Scrollbox,{withHeader:!0,classes:(0,i.default)("Hyp-Table-Scrollbox",n),containerRef:y,children:[(0,c.jsxDEV)("table",{"aria-label":e,className:(0,i.default)("Hyp-Table",t),tabIndex:0,role:"grid",onKeyDown:e=>{let t=!1;switch(e.key){case"Enter":t=!0,_&&m(_);break;case"ArrowUp":t=!0,x(h(f,_,-1));break;case"ArrowDown":t=!0,x(h(f,_,1));break;default:t=!1}t&&(e.preventDefault(),e.stopPropagation())},children:[(0,c.jsxDEV)("thead",{ref:(0,s.downcastRef)(w),children:(0,c.jsxDEV)("tr",{children:v.map((({classes:e,label:t},n)=>(0,c.jsxDEV)("th",{className:(0,i.default)("Hyp-Table__header",e),scope:"col",children:t},`${t}-${n}`,!1,{fileName:u,lineNumber:180,columnNumber:15},this)))},void 0,!1,{fileName:u,lineNumber:178,columnNumber:11},this)},void 0,!1,{fileName:u,lineNumber:177,columnNumber:9},this),(0,c.jsxDEV)("tbody",{children:!d&&f.map(((e,t)=>(0,c.jsxDEV)("tr",{"aria-selected":_===e,className:(0,i.default)({"is-selected":_===e}),onMouseDown:()=>p(e),onClick:()=>p(e),onDblClick:()=>m(e),ref:e=>b.current[t]=e,tabIndex:-1,children:g(e,_===e)},t,!1,{fileName:u,lineNumber:193,columnNumber:15},this)))},void 0,!1,{fileName:u,lineNumber:190,columnNumber:9},this)]},void 0,!0,{fileName:u,lineNumber:170,columnNumber:7},this),d&&(0,c.jsxDEV)("div",{className:"Hyp-Table-Scrollbox__loading",children:(0,c.jsxDEV)(a.Spinner,{size:"large"},void 0,!1,{fileName:u,lineNumber:212,columnNumber:11},this)},void 0,!1,{fileName:u,lineNumber:211,columnNumber:9},this),!d&&0===f.length&&o&&(0,c.jsxDEV)("div",{className:"Hyp-Table-Scrollbox__message","data-testid":"empty-items-message",children:o},void 0,!1,{fileName:u,lineNumber:216,columnNumber:9},this)]},void 0,!0,{fileName:u,lineNumber:165,columnNumber:5},this)};var o,i=(o=e("classnames"))&&o.__esModule?o:{default:o},r=e("preact/hooks"),s=e("../util/typing"),a=e("./Spinner"),l=e("./containers"),c=e("preact/compat/jsx-dev-runtime"),u="/home/runner/work/frontend-shared/frontend-shared/src/components/Table.js";function h(e,t,n){const o=t?e.indexOf(t):-1,i=o+n;return o<0||i<0?e[0]:i>=e.length?e[e.length-1]:e[i]}},{"../util/typing":18,"./Spinner":9,"./containers":15,classnames:20,"preact/compat/jsx-dev-runtime":24,"preact/hooks":26}],12:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.TextInput=function({classes:e="",inputRef:t,hasError:n=!1,type:o="text",...a}){return(0,r.jsxDEV)("input",{className:(0,i.default)("Hyp-TextInput",{"has-error":n},e),...a,ref:t,type:o},void 0,!1,{fileName:s,lineNumber:39,columnNumber:5},this)},n.TextInputWithButton=function({children:e,classes:t=""}){return(0,r.jsxDEV)("div",{className:(0,i.default)("Hyp-TextInputWithButton",t),children:e},void 0,!1,{fileName:s,lineNumber:67,columnNumber:5},this)};var o,i=(o=e("classnames"))&&o.__esModule?o:{default:o},r=e("preact/compat/jsx-dev-runtime"),s="/home/runner/work/frontend-shared/frontend-shared/src/components/TextInput.js"},{classnames:20,"preact/compat/jsx-dev-runtime":24}],13:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Thumbnail=function({children:e,classes:t="",isLoading:n=!1,placeholder:o="...",size:c="medium"}){const u=(0,r.toChildArray)(e).length?e:o;return(0,a.jsxDEV)("div",{className:(0,i.default)("Hyp-Thumbnail",t),children:(0,a.jsxDEV)("div",{className:"Hyp-Thumbnail__content",children:[n&&(0,a.jsxDEV)(s.Spinner,{size:c},void 0,!1,{fileName:l,lineNumber:59,columnNumber:23},this),!n&&u]},void 0,!0,{fileName:l,lineNumber:58,columnNumber:7},this)},void 0,!1,{fileName:l,lineNumber:57,columnNumber:5},this)};var o,i=(o=e("classnames"))&&o.__esModule?o:{default:o},r=e("preact"),s=e("./Spinner"),a=e("preact/compat/jsx-dev-runtime"),l="/home/runner/work/frontend-shared/frontend-shared/src/components/Thumbnail.js"},{"./Spinner":9,classnames:20,preact:25,"preact/compat/jsx-dev-runtime":24}],14:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.IconButton=function({className:e="Hyp-IconButton",...t}){const{icon:n}=t;return(0,s.jsxDEV)(l,{className:e,...t,children:(0,s.jsxDEV)(r.SvgIcon,{name:n},void 0,!1,{fileName:a,lineNumber:100,columnNumber:7},this)},void 0,!1,{fileName:a,lineNumber:99,columnNumber:5},this)},n.LabeledButton=function({children:e,className:t="Hyp-LabeledButton",...n}){const{icon:o,iconPosition:i="left"}=n;return(0,s.jsxDEV)(l,{className:t,...n,children:[o&&"left"===i&&(0,s.jsxDEV)(r.SvgIcon,{name:o},void 0,!1,{fileName:a,lineNumber:118,columnNumber:43},this),e,o&&"right"===i&&(0,s.jsxDEV)(r.SvgIcon,{name:o},void 0,!1,{fileName:a,lineNumber:120,columnNumber:44},this)]},void 0,!0,{fileName:a,lineNumber:117,columnNumber:5},this)},n.LinkButton=function(e){return(0,s.jsxDEV)(l,{className:"Hyp-LinkButton",...e},void 0,!1,{fileName:a,lineNumber:131,columnNumber:10},this)};var o,i=(o=e("classnames"))&&o.__esModule?o:{default:o},r=e("./SvgIcon"),s=e("preact/compat/jsx-dev-runtime"),a="/home/runner/work/frontend-shared/frontend-shared/src/components/buttons.js";function l({buttonRef:e,classes:t,className:n,icon:o,iconPosition:r="left",size:l="medium",variant:c="normal",expanded:u,pressed:h,type:d="button",...f}){const p={"aria-expanded":u,"aria-pressed":h,"aria-label":f.title};return(0,s.jsxDEV)("button",{ref:e,className:(0,i.default)(n,`${n}--${l}`,`${n}--${c}`,{[`${n}--icon-${r}`]:o},t),type:d,...p,...f},void 0,!1,{fileName:a,lineNumber:73,columnNumber:5},this)}},{"./SvgIcon":10,classnames:20,"preact/compat/jsx-dev-runtime":24}],15:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Frame=function({children:e,classes:t="",containerRef:n}){return(0,s.jsxDEV)("div",{className:(0,i.default)("Hyp-Frame",t),ref:(0,r.downcastRef)(n),children:e},void 0,!1,{fileName:a,lineNumber:26,columnNumber:5},this)},n.Card=function({children:e,classes:t="",containerRef:n}){return(0,s.jsxDEV)("div",{className:(0,i.default)("Hyp-Card",t),ref:(0,r.downcastRef)(n),children:e},void 0,!1,{fileName:a,lineNumber:42,columnNumber:5},this)},n.Actions=function({children:e,direction:t="row",classes:n="",containerRef:o}){const l=`Hyp-Actions--${t}`;return(0,s.jsxDEV)("div",{className:(0,i.default)(l,n),ref:(0,r.downcastRef)(o),children:e},void 0,!1,{fileName:a,lineNumber:72,columnNumber:5},this)},n.Scrollbox=function({children:e,classes:t="",containerRef:n,withHeader:o=!1}){const l=o?"Hyp-Scrollbox--with-header":"Hyp-Scrollbox";return(0,s.jsxDEV)("div",{className:(0,i.default)(l,t),ref:(0,r.downcastRef)(n),children:e},void 0,!1,{fileName:a,lineNumber:101,columnNumber:5},this)};var o,i=(o=e("classnames"))&&o.__esModule?o:{default:o},r=e("../util/typing"),s=e("preact/compat/jsx-dev-runtime"),a="/home/runner/work/frontend-shared/frontend-shared/src/components/containers.js"},{"../util/typing":18,classnames:20,"preact/compat/jsx-dev-runtime":24}],16:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.useElementShouldClose=function(e,t,n){(0,o.useEffect)((()=>{if(!t)return()=>{};const o=r(document.body,["keydown"],(e=>{const t=e;"Escape"===(0,i.normalizeKeyName)(t.key)&&n()})),s=r(document.body,["focus"],(t=>{e.current.contains(t.target)||n()}),{useCapture:!0}),a=r(document.body,["mousedown","click"],(t=>{e.current.contains(t.target)||n()}),{useCapture:!0});return()=>{o(),a(),s()}}),[e,t,n])};var o=e("preact/hooks"),i=e("../browser-compatibility-utils");function r(e,t,n,{useCapture:o=!1}={}){return t.forEach((t=>e.addEventListener(t,n,o))),()=>{t.forEach((t=>e.removeEventListener(t,n,o)))}}},{"../browser-compatibility-utils":4,"preact/hooks":26}],17:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"IconButton",{enumerable:!0,get:function(){return o.IconButton}}),Object.defineProperty(n,"LabeledButton",{enumerable:!0,get:function(){return o.LabeledButton}}),Object.defineProperty(n,"LinkButton",{enumerable:!0,get:function(){return o.LinkButton}}),Object.defineProperty(n,"LabeledCheckbox",{enumerable:!0,get:function(){return i.LabeledCheckbox}}),Object.defineProperty(n,"Checkbox",{enumerable:!0,get:function(){return i.Checkbox}}),Object.defineProperty(n,"Frame",{enumerable:!0,get:function(){return r.Frame}}),Object.defineProperty(n,"Card",{enumerable:!0,get:function(){return r.Card}}),Object.defineProperty(n,"Actions",{enumerable:!0,get:function(){return r.Actions}}),Object.defineProperty(n,"Scrollbox",{enumerable:!0,get:function(){return r.Scrollbox}}),Object.defineProperty(n,"Dialog",{enumerable:!0,get:function(){return s.Dialog}}),Object.defineProperty(n,"Modal",{enumerable:!0,get:function(){return a.Modal}}),Object.defineProperty(n,"ConfirmModal",{enumerable:!0,get:function(){return a.ConfirmModal}}),Object.defineProperty(n,"Panel",{enumerable:!0,get:function(){return l.Panel}}),Object.defineProperty(n,"Spinner",{enumerable:!0,get:function(){return c.Spinner}}),Object.defineProperty(n,"SvgIcon",{enumerable:!0,get:function(){return u.SvgIcon}}),Object.defineProperty(n,"registerIcons",{enumerable:!0,get:function(){return u.registerIcons}}),Object.defineProperty(n,"Table",{enumerable:!0,get:function(){return h.Table}}),Object.defineProperty(n,"TextInput",{enumerable:!0,get:function(){return d.TextInput}}),Object.defineProperty(n,"TextInputWithButton",{enumerable:!0,get:function(){return d.TextInputWithButton}}),Object.defineProperty(n,"Thumbnail",{enumerable:!0,get:function(){return f.Thumbnail}}),Object.defineProperty(n,"useElementShouldClose",{enumerable:!0,get:function(){return p.useElementShouldClose}}),Object.defineProperty(n,"normalizeKeyName",{enumerable:!0,get:function(){return m.normalizeKeyName}});var o=e("./components/buttons"),i=e("./components/Checkbox"),r=e("./components/containers"),s=e("./components/Dialog"),a=e("./components/Modal"),l=e("./components/Panel"),c=e("./components/Spinner"),u=e("./components/SvgIcon"),h=e("./components/Table"),d=e("./components/TextInput"),f=e("./components/Thumbnail"),p=e("./hooks/use-element-should-close"),m=e("./browser-compatibility-utils")},{"./browser-compatibility-utils":4,"./components/Checkbox":5,"./components/Dialog":6,"./components/Modal":7,"./components/Panel":8,"./components/Spinner":9,"./components/SvgIcon":10,"./components/Table":11,"./components/TextInput":12,"./components/Thumbnail":13,"./components/buttons":14,"./components/containers":15,"./hooks/use-element-should-close":16}],18:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.downcastRef=function(e){return e}},{}],19:[function(e,t,n){"use strict";function o(e){return e.split("").reverse().join("")}function i(e){return(e|-e)>>31&1}function r(e,t,n,o){var r=e.P[n],s=e.M[n],a=o>>>31,l=t[n]|a,c=l|s,u=(l&r)+r^r|l,h=s|~(u|r),d=r&u,f=i(h&e.lastRowMask[n])-i(d&e.lastRowMask[n]);return h<<=1,d<<=1,r=(d|=a)|~(c|(h|=i(o)-a)),s=h&c,e.P[n]=r,e.M[n]=s,f}function s(e,t,n){if(0===t.length)return[];n=Math.min(n,t.length);var o=[],i=32,s=Math.ceil(t.length/i)-1,a={P:new Uint32Array(s+1),M:new Uint32Array(s+1),lastRowMask:new Uint32Array(s+1)};a.lastRowMask.fill(1<<31),a.lastRowMask[s]=1<<(t.length-1)%i;for(var l=new Uint32Array(s+1),c=new Map,u=[],h=0;h<256;h++)u.push(l);for(var d=0;d<t.length;d+=1){var f=t.charCodeAt(d);if(!c.has(f)){var p=new Uint32Array(s+1);c.set(f,p),f<u.length&&(u[f]=p);for(var m=0;m<=s;m+=1){p[m]=0;for(var g=0;g<i;g+=1){var _=m*i+g;_>=t.length||t.charCodeAt(_)===f&&(p[m]|=1<<g)}}}}var v=Math.max(0,Math.ceil(n/i)-1),b=new Uint32Array(s+1);for(m=0;m<=v;m+=1)b[m]=(m+1)*i;for(b[s]=t.length,m=0;m<=v;m+=1)a.P[m]=-1,a.M[m]=0;for(var y=0;y<e.length;y+=1){var w=e.charCodeAt(y);p=void 0,w<u.length?p=u[w]:void 0===(p=c.get(w))&&(p=l);var x=0;for(m=0;m<=v;m+=1)x=r(a,p,m,x),b[m]+=x;if(b[v]-x<=n&&v<s&&(1&p[v+1]||x<0)){v+=1,a.P[v]=-1,a.M[v]=0;var E=v===s?t.length%i:i;b[v]=b[v-1]+E-x+r(a,p,v,x)}else for(;v>0&&b[v]>=n+i;)v-=1;v===s&&b[v]<=n&&(b[v]<n&&o.splice(0,o.length),o.push({start:-1,end:y+1,errors:b[v]}),n=b[v])}return o}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e,t,n){return function(e,t,n){var i=o(t);return n.map((function(n){var r=Math.max(0,n.end-t.length-n.errors);return{start:s(o(e.slice(r,n.end)),i,n.errors).reduce((function(e,t){return n.end-t.end<e?n.end-t.end:e}),n.end),end:n.end,errors:n.errors}}))}(e,t,s(e,t,n))}},{}],20:[function(e,t,n){(function(e){(function(){
|
|
2
2
|
/*!
|
|
3
3
|
Copyright (c) 2018 Jed Watson.
|
|
4
4
|
Licensed under the MIT License (MIT), see
|
|
@@ -10,5 +10,5 @@
|
|
|
10
10
|
*
|
|
11
11
|
* Copyright (c) 2016 Jorik Tangelder;
|
|
12
12
|
* Licensed under the MIT license */
|
|
13
|
-
!function(n,o,i,r){"use strict";var s,a=["","webkit","Moz","MS","ms","o"],l=o.createElement("div"),c=Math.round,u=Math.abs,h=Date.now;function d(e,t,n){return setTimeout(b(e,n),t)}function f(e,t,n){return!!Array.isArray(e)&&(p(e,n[t],n),!0)}function p(e,t,n){var o;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==r)for(o=0;o<e.length;)t.call(n,e[o],o,e),o++;else for(o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o,e)}function m(e,t,o){var i="DEPRECATED METHOD: "+t+"\n"+o+" AT \n";return function(){var t=new Error("get-stack-trace"),o=t&&t.stack?t.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",r=n.console&&(n.console.warn||n.console.log);return r&&r.call(n.console,i,o),e.apply(this,arguments)}}s="function"!=typeof Object.assign?function(e){if(e===r||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var o=arguments[n];if(o!==r&&null!==o)for(var i in o)o.hasOwnProperty(i)&&(t[i]=o[i])}return t}:Object.assign;var g=m((function(e,t,n){for(var o=Object.keys(t),i=0;i<o.length;)(!n||n&&e[o[i]]===r)&&(e[o[i]]=t[o[i]]),i++;return e}),"extend","Use `assign`."),_=m((function(e,t){return g(e,t,!0)}),"merge","Use `assign`.");function v(e,t,n){var o,i=t.prototype;(o=e.prototype=Object.create(i)).constructor=e,o._super=i,n&&s(o,n)}function b(e,t){return function(){return e.apply(t,arguments)}}function y(e,t){return"function"==typeof e?e.apply(t&&t[0]||r,t):e}function w(e,t){return e===r?t:e}function x(e,t,n){p(S(t),(function(t){e.addEventListener(t,n,!1)}))}function E(e,t,n){p(S(t),(function(t){e.removeEventListener(t,n,!1)}))}function O(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function N(e,t){return e.indexOf(t)>-1}function S(e){return e.trim().split(/\s+/g)}function j(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var o=0;o<e.length;){if(n&&e[o][n]==t||!n&&e[o]===t)return o;o++}return-1}function C(e){return Array.prototype.slice.call(e,0)}function T(e,t,n){for(var o=[],i=[],r=0;r<e.length;){var s=t?e[r][t]:e[r];j(i,s)<0&&o.push(e[r]),i[r]=s,r++}return n&&(o=t?o.sort((function(e,n){return e[t]>n[t]})):o.sort()),o}function P(e,t){for(var n,o,i=t[0].toUpperCase()+t.slice(1),s=0;s<a.length;){if((o=(n=a[s])?n+i:t)in e)return o;s++}return r}var k=1;function A(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||n}var M="ontouchstart"in n,D=P(n,"PointerEvent")!==r,R=M&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),I="touch",L="mouse",H=["x","y"],V=["clientX","clientY"];function F(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){y(e.options.enable,[e])&&n.handler(t)},this.init()}function B(e,t,n){var o=n.pointers.length,i=n.changedPointers.length,s=1&t&&o-i==0,a=12&t&&o-i==0;n.isFirst=!!s,n.isFinal=!!a,s&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,o=t.pointers,i=o.length;n.firstInput||(n.firstInput=U(t)),i>1&&!n.firstMultiple?n.firstMultiple=U(t):1===i&&(n.firstMultiple=!1);var s=n.firstInput,a=n.firstMultiple,l=a?a.center:s.center,c=t.center=q(o);t.timeStamp=h(),t.deltaTime=t.timeStamp-s.timeStamp,t.angle=X(l,c),t.distance=z(l,c),function(e,t){var n=t.center,o=e.offsetDelta||{},i=e.prevDelta||{},r=e.prevInput||{};1!==t.eventType&&4!==r.eventType||(i=e.prevDelta={x:r.deltaX||0,y:r.deltaY||0},o=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=i.x+(n.x-o.x),t.deltaY=i.y+(n.y-o.y)}(n,t),t.offsetDirection=$(t.deltaX,t.deltaY);var d,f,p=W(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=p.x,t.overallVelocityY=p.y,t.overallVelocity=u(p.x)>u(p.y)?p.x:p.y,t.scale=a?(d=a.pointers,z((f=o)[0],f[1],V)/z(d[0],d[1],V)):1,t.rotation=a?function(e,t){return X(t[1],t[0],V)+X(e[1],e[0],V)}(a.pointers,o):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,o,i,s,a=e.lastInterval||t,l=t.timeStamp-a.timeStamp;if(8!=t.eventType&&(l>25||a.velocity===r)){var c=t.deltaX-a.deltaX,h=t.deltaY-a.deltaY,d=W(l,c,h);o=d.x,i=d.y,n=u(d.x)>u(d.y)?d.x:d.y,s=$(c,h),e.lastInterval=t}else n=a.velocity,o=a.velocityX,i=a.velocityY,s=a.direction;t.velocity=n,t.velocityX=o,t.velocityY=i,t.direction=s}(n,t);var m=e.element;O(t.srcEvent.target,m)&&(m=t.srcEvent.target),t.target=m}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function U(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:c(e.pointers[n].clientX),clientY:c(e.pointers[n].clientY)},n++;return{timeStamp:h(),pointers:t,center:q(t),deltaX:e.deltaX,deltaY:e.deltaY}}function q(e){var t=e.length;if(1===t)return{x:c(e[0].clientX),y:c(e[0].clientY)};for(var n=0,o=0,i=0;i<t;)n+=e[i].clientX,o+=e[i].clientY,i++;return{x:c(n/t),y:c(o/t)}}function W(e,t,n){return{x:t/e||0,y:n/e||0}}function $(e,t){return e===t?1:u(e)>=u(t)?e<0?2:4:t<0?8:16}function z(e,t,n){n||(n=H);var o=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(o*o+i*i)}function X(e,t,n){n||(n=H);var o=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,o)/Math.PI}F.prototype={handler:function(){},init:function(){this.evEl&&x(this.element,this.evEl,this.domHandler),this.evTarget&&x(this.target,this.evTarget,this.domHandler),this.evWin&&x(A(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(A(this.element),this.evWin,this.domHandler)}};var Y={mousedown:1,mousemove:2,mouseup:4},G="mousedown",Q="mousemove mouseup";function K(){this.evEl=G,this.evWin=Q,this.pressed=!1,F.apply(this,arguments)}v(K,F,{handler:function(e){var t=Y[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:L,srcEvent:e}))}});var Z={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},J={2:I,3:"pen",4:L,5:"kinect"},ee="pointerdown",te="pointermove pointerup pointercancel";function ne(){this.evEl=ee,this.evWin=te,F.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}n.MSPointerEvent&&!n.PointerEvent&&(ee="MSPointerDown",te="MSPointerMove MSPointerUp MSPointerCancel"),v(ne,F,{handler:function(e){var t=this.store,n=!1,o=e.type.toLowerCase().replace("ms",""),i=Z[o],r=J[e.pointerType]||e.pointerType,s=r==I,a=j(t,e.pointerId,"pointerId");1&i&&(0===e.button||s)?a<0&&(t.push(e),a=t.length-1):12&i&&(n=!0),a<0||(t[a]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:r,srcEvent:e}),n&&t.splice(a,1))}});var oe={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ie="touchstart",re="touchstart touchmove touchend touchcancel";function se(){this.evTarget=ie,this.evWin=re,this.started=!1,F.apply(this,arguments)}function ae(e,t){var n=C(e.touches),o=C(e.changedTouches);return 12&t&&(n=T(n.concat(o),"identifier",!0)),[n,o]}v(se,F,{handler:function(e){var t=oe[e.type];if(1===t&&(this.started=!0),this.started){var n=ae.call(this,e,t);12&t&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:I,srcEvent:e})}}});var le={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ce="touchstart touchmove touchend touchcancel";function ue(){this.evTarget=ce,this.targetIds={},F.apply(this,arguments)}function he(e,t){var n=C(e.touches),o=this.targetIds;if(3&t&&1===n.length)return o[n[0].identifier]=!0,[n,n];var i,r,s=C(e.changedTouches),a=[],l=this.target;if(r=n.filter((function(e){return O(e.target,l)})),1===t)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&t&&delete o[s[i].identifier],i++;return a.length?[T(r.concat(a),"identifier",!0),a]:void 0}function de(){F.apply(this,arguments);var e=b(this.handler,this);this.touch=new ue(this.manager,e),this.mouse=new K(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function fe(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,pe.call(this,t)):12&e&&pe.call(this,t)}function pe(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var o=this.lastTouches;setTimeout((function(){var e=o.indexOf(n);e>-1&&o.splice(e,1)}),2500)}}function me(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,o=0;o<this.lastTouches.length;o++){var i=this.lastTouches[o],r=Math.abs(t-i.x),s=Math.abs(n-i.y);if(r<=25&&s<=25)return!0}return!1}v(ue,F,{handler:function(e){var t=le[e.type],n=he.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:I,srcEvent:e})}}),v(de,F,{handler:function(e,t,n){var o=n.pointerType==I,i=n.pointerType==L;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(o)fe.call(this,t,n);else if(i&&me.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var ge=P(l.style,"touchAction"),_e=ge!==r,ve="compute",be="auto",ye="manipulation",we="none",xe="pan-x",Ee="pan-y",Oe=function(){if(!_e)return!1;var e={},t=n.CSS&&n.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(o){e[o]=!t||n.CSS.supports("touch-action",o)})),e}();function Ne(e,t){this.manager=e,this.set(t)}Ne.prototype={set:function(e){e==ve&&(e=this.compute()),_e&&this.manager.element.style&&Oe[e]&&(this.manager.element.style[ge]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return p(this.manager.recognizers,(function(t){y(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(N(e,we))return we;var t=N(e,xe),n=N(e,Ee);return t&&n?we:t||n?t?xe:Ee:N(e,ye)?ye:be}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var o=this.actions,i=N(o,we)&&!Oe.none,r=N(o,Ee)&&!Oe["pan-y"],s=N(o,xe)&&!Oe["pan-x"];if(i){var a=1===e.pointers.length,l=e.distance<2,c=e.deltaTime<250;if(a&&l&&c)return}if(!s||!r)return i||r&&6&n||s&&24&n?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var Se=32;function je(e){this.options=s({},this.defaults,e||{}),this.id=k++,this.manager=null,this.options.enable=w(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function Ce(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function Te(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function Pe(e,t){var n=t.manager;return n?n.get(e):e}function ke(){je.apply(this,arguments)}function Ae(){ke.apply(this,arguments),this.pX=null,this.pY=null}function Me(){ke.apply(this,arguments)}function De(){je.apply(this,arguments),this._timer=null,this._input=null}function Re(){ke.apply(this,arguments)}function Ie(){ke.apply(this,arguments)}function Le(){je.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function He(e,t){return(t=t||{}).recognizers=w(t.recognizers,He.defaults.preset),new Ve(e,t)}function Ve(e,t){this.options=s({},He.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new(this.options.inputClass||(D?ne:R?ue:M?de:K))(this,B),this.touchAction=new Ne(this,this.options.touchAction),Fe(this,!0),p(this.options.recognizers,(function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}function Fe(e,t){var n,o=e.element;o.style&&(p(e.options.cssProps,(function(i,r){n=P(o.style,r),t?(e.oldCssProps[n]=o.style[n],o.style[n]=i):o.style[n]=e.oldCssProps[n]||""})),t||(e.oldCssProps={}))}je.prototype={defaults:{},set:function(e){return s(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(f(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Pe(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return f(e,"dropRecognizeWith",this)||(e=Pe(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(f(e,"requireFailure",this))return this;var t=this.requireFail;return-1===j(t,e=Pe(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(f(e,"dropRequireFailure",this))return this;e=Pe(e,this);var t=j(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function o(n){t.manager.emit(n,e)}n<8&&o(t.options.event+Ce(n)),o(t.options.event),e.additionalEvent&&o(e.additionalEvent),n>=8&&o(t.options.event+Ce(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=Se},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},recognize:function(e){var t=s({},e);if(!y(this.options.enable,[this,t]))return this.reset(),void(this.state=Se);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},v(ke,je,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,o=6&t,i=this.attrTest(e);return o&&(8&n||!i)?16|t:o||i?4&n?8|t:2&t?4|t:2:Se}}),v(Ae,ke,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push(Ee),24&e&&t.push(xe),t},directionTest:function(e){var t=this.options,n=!0,o=e.distance,i=e.direction,r=e.deltaX,s=e.deltaY;return i&t.direction||(6&t.direction?(i=0===r?1:r<0?2:4,n=r!=this.pX,o=Math.abs(e.deltaX)):(i=0===s?1:s<0?8:16,n=s!=this.pY,o=Math.abs(e.deltaY))),e.direction=i,n&&o>t.threshold&&i&t.direction},attrTest:function(e){return ke.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=Te(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),v(Me,ke,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[we]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),v(De,je,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[be]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,o=e.distance<t.threshold,i=e.deltaTime>t.time;if(this._input=e,!o||!n||12&e.eventType&&!i)this.reset();else if(1&e.eventType)this.reset(),this._timer=d((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return Se},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=h(),this.manager.emit(this.options.event,this._input)))}}),v(Re,ke,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[we]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),v(Ie,ke,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Ae.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return 30&n?t=e.overallVelocity:6&n?t=e.overallVelocityX:24&n&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&u(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=Te(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),v(Le,je,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ye]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,o=e.distance<t.threshold,i=e.deltaTime<t.time;if(this.reset(),1&e.eventType&&0===this.count)return this.failTimeout();if(o&&i&&n){if(4!=e.eventType)return this.failTimeout();var r=!this.pTime||e.timeStamp-this.pTime<t.interval,s=!this.pCenter||z(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,s&&r?this.count+=1:this.count=1,this._input=e,0==this.count%t.taps)return this.hasRequireFailures()?(this._timer=d((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return Se},failTimeout:function(){return this._timer=d((function(){this.state=Se}),this.options.interval,this),Se},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),He.VERSION="2.0.7",He.defaults={domEvents:!1,touchAction:ve,enable:!0,inputTarget:null,inputClass:null,preset:[[Re,{enable:!1}],[Me,{enable:!1},["rotate"]],[Ie,{direction:6}],[Ae,{direction:6},["swipe"]],[Le],[Le,{event:"doubletap",taps:2},["tap"]],[De]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Ve.prototype={set:function(e){return s(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var n;this.touchAction.preventDefaults(e);var o=this.recognizers,i=t.curRecognizer;(!i||i&&8&i.state)&&(i=t.curRecognizer=null);for(var r=0;r<o.length;)n=o[r],2===t.stopped||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(e),!i&&14&n.state&&(i=t.curRecognizer=n),r++}},get:function(e){if(e instanceof je)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(f(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(f(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=j(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==r&&t!==r){var n=this.handlers;return p(S(e),(function(e){n[e]=n[e]||[],n[e].push(t)})),this}},off:function(e,t){if(e!==r){var n=this.handlers;return p(S(e),(function(e){t?n[e]&&n[e].splice(j(n[e],t),1):delete n[e]})),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var n=o.createEvent("Event");n.initEvent(e,!0,!0),n.gesture=t,t.target.dispatchEvent(n)}(e,t);var n=this.handlers[e]&&this.handlers[e].slice();if(n&&n.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var i=0;i<n.length;)n[i](t),i++}},destroy:function(){this.element&&Fe(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},s(He,{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:Se,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:24,DIRECTION_ALL:30,Manager:Ve,Input:F,TouchAction:Ne,TouchInput:ue,MouseInput:K,PointerEventInput:ne,TouchMouseInput:de,SingleTouchInput:se,Recognizer:je,AttrRecognizer:ke,Tap:Le,Pan:Ae,Swipe:Ie,Pinch:Me,Rotate:Re,Press:De,on:x,off:E,each:p,merge:_,extend:g,assign:s,inherit:v,bindFn:b,prefixed:P}),(void 0!==n?n:"undefined"!=typeof self?self:{}).Hammer=He,"function"==typeof e&&e.amd?e((function(){return He})):void 0!==t&&t.exports?t.exports=He:n.Hammer=He}(window,document)}).call(this)}).call(this,void 0)},{}],23:[function(e,t,n){(function(e){(function(){var n=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,r=/^0o[0-7]+$/i,s=parseInt,a="object"==typeof e&&e&&e.Object===Object&&e,l="object"==typeof self&&self&&self.Object===Object&&self,c=a||l||Function("return this")(),u=Object.prototype.toString,h=Math.max,d=Math.min,f=function(){return c.Date.now()};function p(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function m(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==u.call(e)}(e))return NaN;if(p(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=p(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var a=i.test(e);return a||r.test(e)?s(e.slice(2),a?2:8):o.test(e)?NaN:+e}t.exports=function(e,t,n){var o,i,r,s,a,l,c=0,u=!1,g=!1,_=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(t){var n=o,r=i;return o=i=void 0,c=t,s=e.apply(r,n)}function b(e){return c=e,a=setTimeout(w,t),u?v(e):s}function y(e){var n=e-l;return void 0===l||n>=t||n<0||g&&e-c>=r}function w(){var e=f();if(y(e))return x(e);a=setTimeout(w,function(e){var n=t-(e-l);return g?d(n,r-(e-c)):n}(e))}function x(e){return a=void 0,_&&o?v(e):(o=i=void 0,s)}function E(){var e=f(),n=y(e);if(o=arguments,i=this,l=e,n){if(void 0===a)return b(l);if(g)return a=setTimeout(w,t),v(l)}return void 0===a&&(a=setTimeout(w,t)),s}return t=m(t)||0,p(n)&&(u=!!n.leading,r=(g="maxWait"in n)?h(m(n.maxWait)||0,t):r,_="trailing"in n?!!n.trailing:_),E.cancel=function(){void 0!==a&&clearTimeout(a),c=0,o=l=i=a=void 0},E.flush=function(){return void 0===a?s:x(f())},E}}).call(this)}).call(this,window)},{}],24:[function(e,t,n){t.exports=e("preact/jsx-runtime")},{"preact/jsx-runtime":27}],25:[function(e,t,n){var o,i,r,s,a,l,c={},u=[],h=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function d(e,t){for(var n in t)e[n]=t[n];return e}function f(e){var t=e.parentNode;t&&t.removeChild(e)}function p(e,t,n){var o,i,r,s=arguments,a={};for(r in t)"key"==r?o=t[r]:"ref"==r?i=t[r]:a[r]=t[r];if(arguments.length>3)for(n=[n],r=3;r<arguments.length;r++)n.push(s[r]);if(null!=n&&(a.children=n),"function"==typeof e&&null!=e.defaultProps)for(r in e.defaultProps)void 0===a[r]&&(a[r]=e.defaultProps[r]);return m(e,a,o,i,null)}function m(e,t,n,i,r){var s={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++o.__v:r};return null!=o.vnode&&o.vnode(s),s}function g(e){return e.children}function _(e,t){this.props=e,this.context=t}function v(e,t){if(null==t)return e.__?v(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?v(e):null}function b(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return b(e)}}function y(e){(!e.__d&&(e.__d=!0)&&r.push(e)&&!w.__r++||a!==o.debounceRendering)&&((a=o.debounceRendering)||s)(w)}function w(){for(var e;w.__r=r.length;)e=r.sort((function(e,t){return e.__v.__b-t.__v.__b})),r=[],e.some((function(e){var t,n,o,i,r,s;e.__d&&(r=(i=(t=e).__v).__e,(s=t.__P)&&(n=[],(o=d({},i)).__v=i.__v+1,T(s,i,o,t.__n,void 0!==s.ownerSVGElement,null!=i.__h?[r]:null,n,null==r?v(i):r,i.__h),P(n,i),i.__e!=r&&b(i)))}))}function x(e,t,n,o,i,r,s,a,l,h){var d,f,p,_,b,y,w,x=o&&o.__k||u,N=x.length;for(n.__k=[],d=0;d<t.length;d++)if(null!=(_=n.__k[d]=null==(_=t[d])||"boolean"==typeof _?null:"string"==typeof _||"number"==typeof _||"bigint"==typeof _?m(null,_,null,null,_):Array.isArray(_)?m(g,{children:_},null,null,null):_.__b>0?m(_.type,_.props,_.key,null,_.__v):_)){if(_.__=n,_.__b=n.__b+1,null===(p=x[d])||p&&_.key==p.key&&_.type===p.type)x[d]=void 0;else for(f=0;f<N;f++){if((p=x[f])&&_.key==p.key&&_.type===p.type){x[f]=void 0;break}p=null}T(e,_,p=p||c,i,r,s,a,l,h),b=_.__e,(f=_.ref)&&p.ref!=f&&(w||(w=[]),p.ref&&w.push(p.ref,null,_),w.push(f,_.__c||b,_)),null!=b?(null==y&&(y=b),"function"==typeof _.type&&null!=_.__k&&_.__k===p.__k?_.__d=l=E(_,l,e):l=O(e,_,p,x,b,l),h||"option"!==n.type?"function"==typeof n.type&&(n.__d=l):e.value=""):l&&p.__e==l&&l.parentNode!=e&&(l=v(p))}for(n.__e=y,d=N;d--;)null!=x[d]&&("function"==typeof n.type&&null!=x[d].__e&&x[d].__e==n.__d&&(n.__d=v(o,d+1)),M(x[d],x[d]));if(w)for(d=0;d<w.length;d++)A(w[d],w[++d],w[++d])}function E(e,t,n){var o,i;for(o=0;o<e.__k.length;o++)(i=e.__k[o])&&(i.__=e,t="function"==typeof i.type?E(i,t,n):O(n,i,i,e.__k,i.__e,t));return t}function O(e,t,n,o,i,r){var s,a,l;if(void 0!==t.__d)s=t.__d,t.__d=void 0;else if(null==n||i!=r||null==i.parentNode)e:if(null==r||r.parentNode!==e)e.appendChild(i),s=null;else{for(a=r,l=0;(a=a.nextSibling)&&l<o.length;l+=2)if(a==i)break e;e.insertBefore(i,r),s=r}return void 0!==s?s:i.nextSibling}function N(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||h.test(t)?n:n+"px"}function S(e,t,n,o,i){var r;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof o&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||N(e.style,t,"");if(n)for(t in n)o&&n[t]===o[t]||N(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])r=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+r]=n,n?o||e.addEventListener(t,r?C:j,r):e.removeEventListener(t,r?C:j,r);else if("dangerouslySetInnerHTML"!==t){if(i)t=t.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null!=n&&(!1!==n||"a"===t[0]&&"r"===t[1])?e.setAttribute(t,n):e.removeAttribute(t))}}function j(e){this.l[e.type+!1](o.event?o.event(e):e)}function C(e){this.l[e.type+!0](o.event?o.event(e):e)}function T(e,t,n,i,r,s,a,l,c){var u,h,f,p,m,v,b,y,w,E,O,N=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(c=n.__h,l=t.__e=n.__e,t.__h=null,s=[l]),(u=o.__b)&&u(t);try{e:if("function"==typeof N){if(y=t.props,w=(u=N.contextType)&&i[u.__c],E=u?w?w.props.value:u.__:i,n.__c?b=(h=t.__c=n.__c).__=h.__E:("prototype"in N&&N.prototype.render?t.__c=h=new N(y,E):(t.__c=h=new _(y,E),h.constructor=N,h.render=D),w&&w.sub(h),h.props=y,h.state||(h.state={}),h.context=E,h.__n=i,f=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=N.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=d({},h.__s)),d(h.__s,N.getDerivedStateFromProps(y,h.__s))),p=h.props,m=h.state,f)null==N.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==N.getDerivedStateFromProps&&y!==p&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(y,E),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(y,h.__s,E)||t.__v===n.__v){h.props=y,h.state=h.__s,t.__v!==n.__v&&(h.__d=!1),h.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),h.__h.length&&a.push(h);break e}null!=h.componentWillUpdate&&h.componentWillUpdate(y,h.__s,E),null!=h.componentDidUpdate&&h.__h.push((function(){h.componentDidUpdate(p,m,v)}))}h.context=E,h.props=y,h.state=h.__s,(u=o.__r)&&u(t),h.__d=!1,h.__v=t,h.__P=e,u=h.render(h.props,h.state,h.context),h.state=h.__s,null!=h.getChildContext&&(i=d(d({},i),h.getChildContext())),f||null==h.getSnapshotBeforeUpdate||(v=h.getSnapshotBeforeUpdate(p,m)),O=null!=u&&u.type===g&&null==u.key?u.props.children:u,x(e,Array.isArray(O)?O:[O],t,n,i,r,s,a,l,c),h.base=t.__e,t.__h=null,h.__h.length&&a.push(h),b&&(h.__E=h.__=null),h.__e=!1}else null==s&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=k(n.__e,t,n,i,r,s,a,c);(u=o.diffed)&&u(t)}catch(e){t.__v=null,(c||null!=s)&&(t.__e=l,t.__h=!!c,s[s.indexOf(l)]=null),o.__e(e,t,n)}}function P(e,t){o.__c&&o.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){o.__e(e,t.__v)}}))}function k(e,t,n,o,i,r,s,a){var l,h,d,p,m=n.props,g=t.props,_=t.type,v=0;if("svg"===_&&(i=!0),null!=r)for(;v<r.length;v++)if((l=r[v])&&(l===e||(_?l.localName==_:3==l.nodeType))){e=l,r[v]=null;break}if(null==e){if(null===_)return document.createTextNode(g);e=i?document.createElementNS("http://www.w3.org/2000/svg",_):document.createElement(_,g.is&&g),r=null,a=!1}if(null===_)m===g||a&&e.data===g||(e.data=g);else{if(r=r&&u.slice.call(e.childNodes),h=(m=n.props||c).dangerouslySetInnerHTML,d=g.dangerouslySetInnerHTML,!a){if(null!=r)for(m={},p=0;p<e.attributes.length;p++)m[e.attributes[p].name]=e.attributes[p].value;(d||h)&&(d&&(h&&d.__html==h.__html||d.__html===e.innerHTML)||(e.innerHTML=d&&d.__html||""))}if(function(e,t,n,o,i){var r;for(r in n)"children"===r||"key"===r||r in t||S(e,r,null,n[r],o);for(r in t)i&&"function"!=typeof t[r]||"children"===r||"key"===r||"value"===r||"checked"===r||n[r]===t[r]||S(e,r,t[r],n[r],o)}(e,g,m,i,a),d)t.__k=[];else if(v=t.props.children,x(e,Array.isArray(v)?v:[v],t,n,o,i&&"foreignObject"!==_,r,s,e.firstChild,a),null!=r)for(v=r.length;v--;)null!=r[v]&&f(r[v]);a||("value"in g&&void 0!==(v=g.value)&&(v!==e.value||"progress"===_&&!v)&&S(e,"value",v,m.value,!1),"checked"in g&&void 0!==(v=g.checked)&&v!==e.checked&&S(e,"checked",v,m.checked,!1))}return e}function A(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){o.__e(e,n)}}function M(e,t,n){var i,r,s;if(o.unmount&&o.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||A(i,null,t)),n||"function"==typeof e.type||(n=null!=(r=e.__e)),e.__e=e.__d=void 0,null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){o.__e(e,t)}i.base=i.__P=null}if(i=e.__k)for(s=0;s<i.length;s++)i[s]&&M(i[s],t,n);null!=r&&f(r)}function D(e,t,n){return this.constructor(e,n)}function R(e,t,n){var i,r,s;o.__&&o.__(e,t),r=(i="function"==typeof n)?null:n&&n.__k||t.__k,s=[],T(t,e=(!i&&n||t).__k=p(g,null,[e]),r||c,c,void 0!==t.ownerSVGElement,!i&&n?[n]:r?null:t.firstChild?u.slice.call(t.childNodes):null,s,!i&&n?n:r?r.__e:t.firstChild,i),P(s,e)}o={__e:function(e,t){for(var n,o,i;t=t.__;)if((n=t.__c)&&!n.__)try{if((o=n.constructor)&&null!=o.getDerivedStateFromError&&(n.setState(o.getDerivedStateFromError(e)),i=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e),i=n.__d),i)return n.__E=n}catch(t){e=t}throw e},__v:0},i=function(e){return null!=e&&void 0===e.constructor},_.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=d({},this.state),"function"==typeof e&&(e=e(d({},n),this.props)),e&&d(n,e),null!=e&&this.__v&&(t&&this.__h.push(t),y(this))},_.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),y(this))},_.prototype.render=g,r=[],s="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,w.__r=0,l=0,n.render=R,n.hydrate=function e(t,n){R(t,n,e)},n.createElement=p,n.h=p,n.Fragment=g,n.createRef=function(){return{current:null}},n.isValidElement=i,n.Component=_,n.cloneElement=function(e,t,n){var o,i,r,s=arguments,a=d({},e.props);for(r in t)"key"==r?o=t[r]:"ref"==r?i=t[r]:a[r]=t[r];if(arguments.length>3)for(n=[n],r=3;r<arguments.length;r++)n.push(s[r]);return null!=n&&(a.children=n),m(e.type,a,o||e.key,i||e.ref,null)},n.createContext=function(e,t){var n={__c:t="__cC"+l++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,o;return this.getChildContext||(n=[],(o={})[t]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some(y)},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n},n.toChildArray=function e(t,n){return n=n||[],null==t||"boolean"==typeof t||(Array.isArray(t)?t.some((function(t){e(t,n)})):n.push(t)),n},n.options=o},{}],26:[function(e,t,n){var o,i,r,s=e("preact"),a=0,l=[],c=s.options.__b,u=s.options.__r,h=s.options.diffed,d=s.options.__c,f=s.options.unmount;function p(e,t){s.options.__h&&s.options.__h(i,e,a||t),a=0;var n=i.__H||(i.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function m(e){return a=1,g(O,e)}function g(e,t,n){var r=p(o++,2);return r.t=e,r.__c||(r.__=[n?n(t):O(void 0,t),function(e){var t=r.t(r.__[0],e);r.__[0]!==t&&(r.__=[t,r.__[1]],r.__c.setState({}))}],r.__c=i),r.__}function _(e,t){var n=p(o++,4);!s.options.__s&&E(n.__H,t)&&(n.__=e,n.__H=t,i.__h.push(n))}function v(e,t){var n=p(o++,7);return E(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function b(){l.forEach((function(e){if(e.__P)try{e.__H.__h.forEach(w),e.__H.__h.forEach(x),e.__H.__h=[]}catch(i){e.__H.__h=[],s.options.__e(i,e.__v)}})),l=[]}s.options.__b=function(e){i=null,c&&c(e)},s.options.__r=function(e){u&&u(e),o=0;var t=(i=e.__c).__H;t&&(t.__h.forEach(w),t.__h.forEach(x),t.__h=[])},s.options.diffed=function(e){h&&h(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==l.push(t)&&r===s.options.requestAnimationFrame||((r=s.options.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(o),y&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,100);y&&(t=requestAnimationFrame(n))})(b)),i=void 0},s.options.__c=function(e,t){t.some((function(e){try{e.__h.forEach(w),e.__h=e.__h.filter((function(e){return!e.__||x(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],s.options.__e(r,e.__v)}})),d&&d(e,t)},s.options.unmount=function(e){f&&f(e);var t=e.__c;if(t&&t.__H)try{t.__H.__.forEach(w)}catch(e){s.options.__e(e,t.__v)}};var y="function"==typeof requestAnimationFrame;function w(e){var t=i;"function"==typeof e.__c&&e.__c(),i=t}function x(e){var t=i;e.__c=e.__(),i=t}function E(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function O(e,t){return"function"==typeof t?t(e):t}n.useState=m,n.useReducer=g,n.useEffect=function(e,t){var n=p(o++,3);!s.options.__s&&E(n.__H,t)&&(n.__=e,n.__H=t,i.__H.__h.push(n))},n.useLayoutEffect=_,n.useRef=function(e){return a=5,v((function(){return{current:e}}),[])},n.useImperativeHandle=function(e,t,n){a=6,_((function(){"function"==typeof e?e(t()):e&&(e.current=t())}),null==n?n:n.concat(e))},n.useMemo=v,n.useCallback=function(e,t){return a=8,v((function(){return e}),t)},n.useContext=function(e){var t=i.context[e.__c],n=p(o++,9);return n.__c=e,t?(null==n.__&&(n.__=!0,t.sub(i)),t.props.value):e.__},n.useDebugValue=function(e,t){s.options.useDebugValue&&s.options.useDebugValue(t?t(e):e)},n.useErrorBoundary=function(e){var t=p(o++,10),n=m();return t.__=e,i.componentDidCatch||(i.componentDidCatch=function(e){t.__&&t.__(e),n[1](e)}),[n[0],function(){n[1](void 0)}]}},{preact:25}],27:[function(e,t,n){var o=e("preact");function i(e,t,n,i,r){var s={};for(var a in t)"ref"!=a&&(s[a]=t[a]);var l,c,u={type:e,props:s,key:n,ref:t&&t.ref,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:++o.options.__v,__source:i,__self:r};if("function"==typeof e&&(l=e.defaultProps))for(c in l)void 0===s[c]&&(s[c]=l[c]);return o.options.vnode&&o.options.vnode(u),u}n.Fragment=o.Fragment,n.jsx=i,n.jsxs=i,n.jsxDEV=i},{preact:25}],28:[function(e,t,n){var o="complete",i="canceled";function r(e,t,n){Math.max(0,t),Math.max(0,n),e.self===e?e.scrollTo(t,n):(e.scrollLeft=t,e.scrollTop=n)}function s(e){var t=e._scrollSettings;if(t){var n=t.maxSynchronousAlignments,i=function(e,t){var n,o,i,r,s,a,l,c=e.align,u=e.target.getBoundingClientRect(),h=c&&null!=c.left?c.left:.5,d=c&&null!=c.top?c.top:.5,f=c&&null!=c.leftOffset?c.leftOffset:0,p=c&&null!=c.topOffset?c.topOffset:0,m=h,g=d;if(e.isWindow(t))a=Math.min(u.width,t.innerWidth),l=Math.min(u.height,t.innerHeight),o=u.left+t.pageXOffset-t.innerWidth*m+a*m,i=u.top+t.pageYOffset-t.innerHeight*g+l*g,o-=f,i-=p,o=e.align.lockX?t.pageXOffset:o,i=e.align.lockY?t.pageYOffset:i,r=o-t.pageXOffset,s=i-t.pageYOffset;else{a=u.width,l=u.height,n=t.getBoundingClientRect();var _=u.left-(n.left-t.scrollLeft),v=u.top-(n.top-t.scrollTop);o=_+a*m-t.clientWidth*m,i=v+l*g-t.clientHeight*g,o-=f,i-=p,o=Math.max(Math.min(o,t.scrollWidth-t.clientWidth),0),i=Math.max(Math.min(i,t.scrollHeight-t.clientHeight),0),o=e.align.lockX?t.scrollLeft:o,i=e.align.lockY?t.scrollTop:i,r=o-t.scrollLeft,s=i-t.scrollTop}return{x:o,y:i,differenceX:r,differenceY:s}}(t,e),a=Date.now()-t.startTime,l=Math.min(1/t.time*a,1);if(t.endIterations>=n)return r(e,i.x,i.y),e._scrollSettings=null,t.end(o);var c=1-t.ease(l);if(r(e,i.x-i.differenceX*c,i.y-i.differenceY*c),a>=t.time)return t.endIterations++,t.scrollAncestor&&s(t.scrollAncestor),void s(e);!function(e){if("requestAnimationFrame"in window)return window.requestAnimationFrame(e);setTimeout(e,16)}(s.bind(null,e))}}function a(e){return e.self===e}function l(e){return"pageXOffset"in e||(e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth)&&"hidden"!==getComputedStyle(e).overflow}function c(){return!0}function u(e){if(e.assignedSlot)return u(e.assignedSlot);if(e.parentElement)return"BODY"===e.parentElement.tagName?e.parentElement.ownerDocument.defaultView||e.parentElement.ownerDocument.ownerWindow:e.parentElement;if(e.getRootNode){var t=e.getRootNode();if(11===t.nodeType)return t.host}}t.exports=function(e,t,n){if(e){"function"==typeof t&&(n=t,t=null),t||(t={}),t.time=isNaN(t.time)?1e3:t.time,t.ease=t.ease||function(e){return 1-Math.pow(1-e,e/2)},t.align=t.align||{};var r=u(e),h=1,d=t.validTarget||c,f=t.isScrollable;t.debug&&(console.log("About to scroll to",e),r||console.error("Target did not have a parent, is it mounted in the DOM?"));for(var p=[];r;)if(t.debug&&console.log("Scrolling parent node",r),d(r,h)&&(f?f(r,l):l(r))&&(h++,p.push(r)),!(r=u(r))){m(o);break}return p.reduce(((n,o,r)=>function(e,t,n,o,r){var l,c=!t._scrollSettings,u=t._scrollSettings,h=Date.now(),d={passive:!0};function f(e){t._scrollSettings=null,t.parentElement&&t.parentElement._scrollSettings&&t.parentElement._scrollSettings.end(e),n.debug&&console.log("Scrolling ended with type",e,"for",t),r(e),l&&(t.removeEventListener("touchstart",l,d),t.removeEventListener("wheel",l,d))}u&&u.end(i);var p=n.maxSynchronousAlignments;return null==p&&(p=3),t._scrollSettings={startTime:h,endIterations:0,target:e,time:n.time,ease:n.ease,align:n.align,isWindow:n.isWindow||a,maxSynchronousAlignments:p,end:f,scrollAncestor:o},"cancellable"in n&&!n.cancellable||(l=f.bind(null,i),t.addEventListener("touchstart",l,d),t.addEventListener("wheel",l,d)),c&&s(t),l}(e,o,t,p[r+1],m)),null)}function m(e){--h||n&&n(e)}}},{}],29:[function(e,t,n){function o(){}o.prototype={on:function(e,t,n){var o=this.e||(this.e={});return(o[e]||(o[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var o=this;function i(){o.off(e,i),t.apply(n,arguments)}return i._=t,this.on(e,i,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),o=0,i=n.length;o<i;o++)n[o].fn.apply(n[o].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),o=n[e],i=[];if(o&&t)for(var r=0,s=o.length;r<s;r++)o[r].fn!==t&&o[r].fn._!==t&&i.push(o[r]);return i.length?n[e]=i:delete n[e],this}},t.exports=o,t.exports.TinyEmitter=o},{}],30:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Adder=n.ARROW_POINTING_UP=n.ARROW_POINTING_DOWN=void 0;var o,i=e("preact"),r=(o=e("./components/AdderToolbar"))&&o.__esModule?o:{default:o},s=e("../shared/user-agent"),a=e("./util/shadow-root"),l=e("preact/jsx-runtime");n.ARROW_POINTING_DOWN=1;function c(e){return e.toString()+"px"}n.ARROW_POINTING_UP=2;n.Adder=class{constructor(e,t){this._outerContainer=document.createElement("hypothesis-adder"),e.appendChild(this._outerContainer),this._shadowRoot=(0,a.createShadowRoot)(this._outerContainer),Object.assign(this._outerContainer.style,{position:"absolute",top:0,left:0}),this._view=e.ownerDocument.defaultView,this._width=()=>this._shadowRoot.firstChild.getBoundingClientRect().width,this._height=()=>this._shadowRoot.firstChild.getBoundingClientRect().height,this._isVisible=!1,this._arrowDirection="up",this._onAnnotate=t.onAnnotate,this._onHighlight=t.onHighlight,this._onShowAnnotations=t.onShowAnnotations,this.annotationsForSelection=[],this._render()}hide(){this._isVisible=!1,this._render(),Object.assign(this._outerContainer.style,{top:0,left:0})}destroy(){(0,i.render)(null,this._shadowRoot),this._outerContainer.remove()}show(e,t){const{left:n,top:o,arrowDirection:i}=this._calculateTarget(e,t);this._showAt(n,o),this._isVisible=!0,this._arrowDirection=2===i?"up":"down",this._render()}_calculateTarget(e,t){let n,o,i;n=t&&!(0,s.isTouchDevice)()?1:2;const r=Math.min(20,e.width),a=this._width(),l=(0,s.isTouchDevice)()?10:0,c=this._height();return i=t?e.left-a/2+r:e.left+e.width-a/2-r,e.top-c<0&&1===n?n=2:e.top+c>this._view.innerHeight&&(n=1),o=2===n?e.top+e.height+10+l:e.top-c-10,i=Math.max(i,0),i=Math.min(i,this._view.innerWidth-a),o=Math.max(o,0),o=Math.min(o,this._view.innerHeight-c),{top:o,left:i,arrowDirection:n}}_findZindex(e,t){if(void 0===document.elementsFromPoint)return 32768;const n=this._width(),o=this._height(),i=[...new Set([...document.elementsFromPoint(e,t),...document.elementsFromPoint(e,t+o),...document.elementsFromPoint(e+n/2,t+o/2),...document.elementsFromPoint(e+n,t),...document.elementsFromPoint(e+n,t+o)])].map((e=>+getComputedStyle(e).zIndex)).filter(Number.isInteger);return i.push(0),Math.max(...i)+1}_showAt(e,t){const n=function(e){let t=e.parentElement;for(;t.parentElement&&"static"===getComputedStyle(t).position;)t=t.parentElement;return t}(this._outerContainer).getBoundingClientRect(),o=this._findZindex(e,t);Object.assign(this._outerContainer.style,{left:c(e-n.left),top:c(t-n.top),zIndex:o})}_render(){(0,i.render)((0,l.jsx)(r.default,{isVisible:this._isVisible,arrowDirection:this._arrowDirection,onCommand:e=>{switch(e){case"annotate":this._onAnnotate(),this.hide();break;case"highlight":this._onHighlight(),this.hide();break;case"show":this._onShowAnnotations(this.annotationsForSelection);break;case"hide":this.hide()}},annotationCount:this.annotationsForSelection.length}),this._shadowRoot)}}},{"../shared/user-agent":92,"./components/AdderToolbar":41,"./util/shadow-root":73,preact:25,"preact/jsx-runtime":27}],31:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.anchor=function(e,t,n={}){let r=null,s=null,a=null;for(let o of t)switch(o.type){case"TextPositionSelector":r=o,n.hint=r.start;break;case"TextQuoteSelector":s=o;break;case"RangeSelector":a=o}const l=e=>{var t;if(null!==(t=s)&&void 0!==t&&t.exact&&e.toString()!==s.exact)throw new Error("quote mismatch");return e};let c=Promise.reject("unable to anchor");return a&&(c=c.catch((()=>i(o.RangeAnchor.fromSelector(e,a),n).then(l)))),r&&(c=c.catch((()=>i(o.TextPositionAnchor.fromSelector(e,r),n).then(l)))),s&&(c=c.catch((()=>i(o.TextQuoteAnchor.fromSelector(e,s),n)))),c},n.describe=function(e,t){const n=[o.RangeAnchor,o.TextPositionAnchor,o.TextQuoteAnchor],i=[];for(let o of n)try{const n=o.fromRange(e,t);i.push(n.toSelector())}catch(r){continue}return i};var o=e("./types");async function i(e,t={}){return e.toRange(t)}},{"./types":36}],32:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.matchQuote=function(e,t,n={}){if(0===t.length)return null;const o=Math.min(256,t.length/2),i=r(e,t,o);if(0===i.length)return null;const a=o=>{const i=1-o.errors/t.length,r=n.prefix?s(e.slice(Math.max(0,o.start-n.prefix.length),o.start),n.prefix):1,a=n.suffix?s(e.slice(o.end,o.end+n.suffix.length),n.suffix):1;let l=1;return"number"==typeof n.hint&&(l=1-Math.abs(o.start-n.hint)/e.length),(50*i+20*r+20*a+2*l)/92},l=i.map((e=>({start:e.start,end:e.end,score:a(e)})));return l.sort(((e,t)=>t.score-e.score)),l[0]};var o,i=(o=e("approx-string-match"))&&o.__esModule?o:{default:o};function r(e,t,n){let o=0,r=[];for(;-1!==o;)o=e.indexOf(t,o),-1!==o&&(r.push({start:o,end:o+t.length,errors:0}),o+=1);return r.length>0?r:(0,i.default)(e,t,n)}function s(e,t){return 0===t.length||0===e.length?0:1-r(e,t,t.length)[0].errors/t.length}},{"approx-string-match":19}],33:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.documentHasText=async function(){const e=p();let t=!1;for(let n=0;n<e.pagesCount;n++)if((await g(n)).trim().length>0){t=!0;break}return t},n.anchor=async function(e,t){const n=t.find((e=>"TextQuoteSelector"===e.type));if(!n)throw new Error("No quote selector found");const o=t.find((e=>"TextPositionSelector"===e.type));if(o){try{const{index:e,offset:t,text:i}=await _(o.start),r=o.start-t,s=o.end-t,a=i.substring(r,s);if(n.exact!==a)throw new Error("quote mismatch");return await v(e,r,s)}catch(i){}try{const e=d(n.exact,o.start),t=h.get(e);if(t){const{pageIndex:e,anchor:n}=t;return await v(e,n.start,n.end)}}catch(s){}}return async function(e,t){const n=p().pagesCount,o=Array(n).fill(0).map(((e,t)=>t));let i,s;if(t){const{index:e,offset:n}=await _(t);i=e,s=t-n,o.sort(((t,n)=>Math.abs(t-e)-Math.abs(n-e)))}const[a]=void 0!==e.prefix?b(e.prefix):[],[l]=void 0!==e.suffix?b(e.suffix):[],[c]=b(e.exact);let u;for(let h of o){const e=await g(h),[t,n]=b(e);let o;if(void 0!==i&&void 0!==s){let t;for(t=h<i?e.length:h===i?s:0,o=0;o<n.length&&n[o]<t;)++o}const d=(0,r.matchQuote)(t,c,{prefix:a,suffix:l,hint:o});if(d&&(!u||d.score>u.match.score)){u={page:h,match:{start:n[d.start],end:n[d.end-1]+1,score:d.score}};const e=t.slice(d.start,d.end)===c,o=void 0!==a&&t.slice(Math.max(0,d.start-a.length),d.start)===a,i=void 0!==l&&t.slice(d.end,l.length)===l,r=void 0!==a||void 0!==l;if(e&&(o||i||!r))break}}if(u){const{page:n,match:o}=u;if(t){const i=d(e.exact,t);h.set(i,{pageIndex:n,anchor:o})}return v(n,o.start,o.end)}throw new Error("Quote not found")}(n,null==o?void 0:o.start)},n.describe=async function(e,t){try{t=a.TextRange.fromRange(t).toRange()}catch(u){throw new Error("Selection does not contain text")}const n=f(t.startContainer),o=f(t.endContainer);if(!n||!o)throw new Error("Selection is outside page text");if(n!==o)throw new Error("Selecting across page breaks is not supported");const i=a.TextPosition.fromPoint(t.startContainer,t.startOffset).relativeTo(n),r=a.TextPosition.fromPoint(t.endContainer,t.endOffset).relativeTo(o),s=function(e){let t=0;for(;e.previousSibling;)++t,e=e.previousSibling;return t}(n.parentNode),c=await async function(e){if(e>=p().pagesCount)throw new Error("Invalid page index");let t=0;for(let n=0;n<e;n++)t+=(await g(n)).length;return t}(s);return[{type:"TextPositionSelector",start:c+i.offset,end:c+r.offset},l.TextQuoteAnchor.fromRange(e,t).toSelector()]},n.purgeCache=function(){u.clear(),h.clear()},n.RenderingStates=void 0;var o,i=(o=e("../../shared/warn-once"))&&o.__esModule?o:{default:o},r=e("./match-quote"),s=e("./placeholder"),a=e("./text-range"),l=e("./types");const c={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3};n.RenderingStates=c;const u=new Map,h=new Map;function d(e,t){return`${e}:${t}`}function f(e){var t;const n="closest"in e?e:e.parentElement;return null!==(t=null==n?void 0:n.closest(".textLayer"))&&void 0!==t?t:null}function p(){return PDFViewerApplication.pdfViewer}async function m(e){const t=p();let n=t.getPageView(e);return n&&n.pdfPage||(n=await new Promise((n=>{const o=()=>{t.eventBus?t.eventBus.off("pagesloaded",o):document.removeEventListener("pagesloaded",o),n(t.getPageView(e))};t.eventBus?t.eventBus.on("pagesloaded",o):document.addEventListener("pagesloaded",o)}))),n}function g(e){const t=u.get(e);if(t)return t;const n=(async()=>{const t=await m(e);let n=(await t.pdfPage.getTextContent({normalizeWhitespace:!0})).items;return n.length>0&&!("hasEOL"in n[0])&&(n=n.filter((e=>/\S/.test(e.str)))),n.map((e=>e.str)).join("")})();return u.set(e,n),n}async function _(e){const t=p();let n=0,o=0,i="";for(let r=0;r<t.pagesCount;r++)if(i=await g(r),n=o,o+=i.length,o>=e)return{index:r,offset:n,text:i};return{index:t.pagesCount-1,offset:n,text:i}}async function v(e,t,n){const[o,r]=await Promise.all([m(e),g(e)]);if(o.renderingState===c.FINISHED&&o.textLayer&&o.textLayer.renderingDone){const e=o.textLayer.textLayerDiv;r!==e.textContent&&(0,i.default)("PDF text layer content does not match page text. This will cause anchoring misalignment.");const s=new a.TextPosition(e,t),l=new a.TextPosition(e,n);return new a.TextRange(s,l).toRange()}const l=(0,s.createPlaceholder)(o.div),u=document.createRange();return u.setStartBefore(l),u.setEndAfter(l),u}function b(e){const t=[];let n="";for(let o=0;o<e.length;o++){const i=e[o];" "!==i&&"\t"!==i&&"\n"!==i&&(n+=i,t.push(o))}return[n,t]}},{"../../shared/warn-once":93,"./match-quote":32,"./placeholder":34,"./text-range":35,"./types":36}],34:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.createPlaceholder=function(e){let t=e.querySelector(o);return t||(t=document.createElement("span"),t.classList.add("annotator-placeholder"),t.textContent="Loading annotations...",e.appendChild(t),t)},n.hasPlaceholder=function(e){return null!==e.querySelector(o)},n.removePlaceholder=function(e){var t;null===(t=e.querySelector(o))||void 0===t||t.remove()},n.isInPlaceholder=function(e){return!!e.parentElement&&null!==e.parentElement.closest(o)};const o=".annotator-placeholder"},{}],35:[function(e,t,n){"use strict";function o(e){switch(e.nodeType){case Node.ELEMENT_NODE:case Node.TEXT_NODE:return e.textContent.length;default:return 0}}function i(e){let t=e.previousSibling,n=0;for(;t;)n+=o(t),t=t.previousSibling;return n}function r(e,...t){let n=t.shift();const o=e.ownerDocument.createNodeIterator(e,NodeFilter.SHOW_TEXT),i=[];let r,s=o.nextNode(),a=0;for(;void 0!==n&&s;)r=s,a+r.data.length>n?(i.push({node:r,offset:n-a}),n=t.shift()):(s=o.nextNode(),a+=r.data.length);for(;void 0!==n&&r&&a===n;)i.push({node:r,offset:r.data.length}),n=t.shift();if(void 0!==n)throw new RangeError("Offset exceeds text length");return i}Object.defineProperty(n,"__esModule",{value:!0}),n.TextRange=n.TextPosition=n.RESOLVE_BACKWARDS=n.RESOLVE_FORWARDS=void 0;n.RESOLVE_FORWARDS=1;n.RESOLVE_BACKWARDS=2;class s{constructor(e,t){if(t<0)throw new Error("Offset is invalid");this.element=e,this.offset=t}relativeTo(e){if(!e.contains(this.element))throw new Error("Parent is not an ancestor of current element");let t=this.element,n=this.offset;for(;t!==e;)n+=i(t),t=t.parentElement;return new s(t,n)}resolve(e={}){try{return r(this.element,this.offset)[0]}catch(t){if(0===this.offset&&void 0!==e.direction){const n=document.createTreeWalker(this.element.getRootNode(),NodeFilter.SHOW_TEXT);n.currentNode=this.element;const o=1===e.direction,i=o?n.nextNode():n.previousNode();if(!i)throw t;return{node:i,offset:o?0:i.data.length}}throw t}}static fromCharOffset(e,t){switch(e.nodeType){case Node.TEXT_NODE:return s.fromPoint(e,t);case Node.ELEMENT_NODE:return new s(e,t);default:throw new Error("Node is not an element or text node")}}static fromPoint(e,t){switch(e.nodeType){case Node.TEXT_NODE:{if(t<0||t>e.data.length)throw new Error("Text node offset is out of range");if(!e.parentElement)throw new Error("Text node has no parent");const n=i(e)+t;return new s(e.parentElement,n)}case Node.ELEMENT_NODE:{if(t<0||t>e.childNodes.length)throw new Error("Child node offset is out of range");let n=0;for(let i=0;i<t;i++)n+=o(e.childNodes[i]);return new s(e,n)}default:throw new Error("Point is not in an element or text node")}}}n.TextPosition=s;class a{constructor(e,t){this.start=e,this.end=t}relativeTo(e){return new a(this.start.relativeTo(e),this.end.relativeTo(e))}toRange(){let e,t;this.start.element===this.end.element&&this.start.offset<=this.end.offset?[e,t]=r(this.start.element,this.start.offset,this.end.offset):(e=this.start.resolve({direction:1}),t=this.end.resolve({direction:2}));const n=new Range;return n.setStart(e.node,e.offset),n.setEnd(t.node,t.offset),n}static fromRange(e){const t=s.fromPoint(e.startContainer,e.startOffset),n=s.fromPoint(e.endContainer,e.endOffset);return new a(t,n)}static fromOffsets(e,t,n){return new a(new s(e,t),new s(e,n))}}n.TextRange=a},{}],36:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.TextQuoteAnchor=n.TextPositionAnchor=n.RangeAnchor=void 0;var o=e("./match-quote"),i=e("./text-range"),r=e("./xpath");function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class c{constructor(e,t){this.root=e,this.range=t}static fromRange(e,t){return new c(e,t)}static fromSelector(e,t){const n=(0,r.nodeFromXPath)(t.startContainer,e);if(!n)throw new Error("Failed to resolve startContainer XPath");const o=(0,r.nodeFromXPath)(t.endContainer,e);if(!o)throw new Error("Failed to resolve endContainer XPath");const s=i.TextPosition.fromCharOffset(n,t.startOffset),a=i.TextPosition.fromCharOffset(o,t.endOffset),l=new i.TextRange(s,a).toRange();return new c(e,l)}toRange(){return this.range}toSelector(){const e=i.TextRange.fromRange(this.range).toRange(),t=i.TextRange.fromRange(e),n=(0,r.xpathFromNode)(t.start.element,this.root),o=(0,r.xpathFromNode)(t.end.element,this.root);return{type:"RangeSelector",startContainer:n,startOffset:t.start.offset,endContainer:o,endOffset:t.end.offset}}}n.RangeAnchor=c;class u{constructor(e,t,n){this.root=e,this.start=t,this.end=n}static fromRange(e,t){const n=i.TextRange.fromRange(t).relativeTo(e);return new u(e,n.start.offset,n.end.offset)}static fromSelector(e,t){return new u(e,t.start,t.end)}toSelector(){return{type:"TextPositionSelector",start:this.start,end:this.end}}toRange(){return i.TextRange.fromOffsets(this.root,this.start,this.end).toRange()}}n.TextPositionAnchor=u;class h{constructor(e,t,n={}){this.root=e,this.exact=t,this.context=n}static fromRange(e,t){const n=e.textContent,o=i.TextRange.fromRange(t).relativeTo(e),r=o.start.offset,s=o.end.offset;return new h(e,n.slice(r,s),{prefix:n.slice(Math.max(0,r-32),r),suffix:n.slice(s,Math.min(n.length,s+32))})}static fromSelector(e,t){const{prefix:n,suffix:o}=t;return new h(e,t.exact,{prefix:n,suffix:o})}toSelector(){return{type:"TextQuoteSelector",exact:this.exact,prefix:this.context.prefix,suffix:this.context.suffix}}toRange(e={}){return this.toPositionAnchor(e).toRange()}toPositionAnchor(e={}){const t=this.root.textContent,n=(0,o.matchQuote)(t,this.exact,a(a({},this.context),{},{hint:e.hint}));if(!n)throw new Error("Quote not found");return new u(this.root,n.start,n.end)}}n.TextQuoteAnchor=h},{"./match-quote":32,"./text-range":35,"./xpath":37}],37:[function(e,t,n){"use strict";function o(e){return`${function(e){const t=e.nodeName.toLowerCase();let n=t;return"#text"===t&&(n="text()"),n}(e)}[${function(e){let t=0,n=e;for(;n;)n.nodeName===e.nodeName&&(t+=1),n=n.previousSibling;return t}(e)}]`}function i(e,t,n){t=t.toUpperCase();let o=-1;for(let i=0;i<e.children.length;i++){const r=e.children[i];if(r.nodeName.toUpperCase()===t&&(++o,o===n))return r}return null}Object.defineProperty(n,"__esModule",{value:!0}),n.xpathFromNode=function(e,t){let n="",i=e;for(;i!==t;){if(!i)throw new Error("Node is not a descendant of root");n=o(i)+"/"+n,i=i.parentNode}return n="/"+n,n=n.replace(/\/$/,""),n},n.nodeFromXPath=function(e,t=document.body){try{return function(e,t){if(null===e.match(/^(\/[A-Za-z0-9-]+(\[[0-9]+\])?)+$/))throw new Error("Expression is not a simple XPath");const n=e.split("/");let o=t;n.shift();for(let r of n){let e,t;const n=r.indexOf("[");if(-1!==n){e=r.slice(0,n);const o=r.slice(n+1,r.indexOf("]"));if(t=parseInt(o)-1,t<0)return null}else e=r,t=0;const s=i(o,e,t);if(!s)return null;o=s}return o}(e,t)}catch(n){return document.evaluate("."+e,t,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue}}},{}],38:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e,t){t.on(i.default.PUBLIC_ANNOTATION_COUNT_CHANGED,(function(t){const n=e.querySelectorAll("[data-hypothesis-annotation-count]");Array.from(n).forEach((e=>{e.textContent=t}))}))};var o,i=(o=e("../shared/bridge-events"))&&o.__esModule?o:{default:o}},{"../shared/bridge-events":86}],39:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.AnnotationSync=void 0;n.AnnotationSync=class{constructor(e,t){this._emitter=e.createEmitter(),this.bridge=t,this.cache={},this.destroyed=!1,this.bridge.on("deleteAnnotation",((e,t)=>{if(this.destroyed)return void t(null);const n=this._parse(e);delete this.cache[n.$tag],this._emitter.publish("annotationDeleted",n),this._format(n),t(null)})),this.bridge.on("loadAnnotations",((e,t)=>{if(this.destroyed)return void t(null);const n=e.map((e=>this._parse(e)));this._emitter.publish("annotationsLoaded",n),t(null)})),this._emitter.subscribe("beforeAnnotationCreated",(e=>{e.$tag||this.bridge.call("beforeCreateAnnotation",this._format(e))}))}sync(e){this.destroyed||this.bridge.call("sync",e.map((e=>this._format(e))))}_tag(e,t){return e.$tag||(t=t||window.btoa(Math.random().toString()),Object.defineProperty(e,"$tag",{value:t}),this.cache[t]=e),e}_parse(e){const t=Object.assign(this.cache[e.tag]||{},e.msg);return this._tag(t,e.tag)}_format(e){return this._tag(e),{tag:e.$tag,msg:e}}destroy(){this.destroyed=!0,this._emitter.destroy()}}},{}],40:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o,i=e("preact"),r=e("../shared/listener-collection"),s=(o=e("./components/Buckets"))&&o.__esModule?o:{default:o},a=e("./util/buckets"),l=e("preact/jsx-runtime");n.default=class{constructor(e,t,{contentContainer:n=document.body}={}){this._contentContainer=n,this._bucketsContainer=document.createElement("div"),e.appendChild(this._bucketsContainer),this._guest=t,this._listeners=new r.ListenerCollection,this._listeners.add(window,"resize",(()=>this.update())),this._listeners.add(window,"scroll",(()=>this.update())),this._listeners.add(n,"scroll",(()=>this.update())),this._update()}destroy(){this._listeners.removeAll(),this._bucketsContainer.remove()}update(){this._updatePending||(this._updatePending=!0,requestAnimationFrame((()=>{this._update(),this._updatePending=!1})))}_update(){const e=(0,a.anchorBuckets)(this._guest.anchors);(0,i.render)((0,l.jsx)(s.default,{above:e.above,below:e.below,buckets:e.buckets,onSelectAnnotations:(e,t)=>this._guest.selectAnnotations(e,t),scrollToAnchor:e=>this._guest.scrollToAnchor(e)}),this._bucketsContainer)}}},{"../shared/listener-collection":88,"./components/Buckets":42,"./util/buckets":70,preact:25,"preact/jsx-runtime":27}],41:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function({arrowDirection:e,isVisible:t,onCommand:n,annotationCount:o=0}){const c=t?"a":null,u=t?"h":null,h=t?"s":null,d=t?"Escape":null;return(0,s.useShortcut)(d,(()=>n("hide"))),(0,a.jsxs)("div",{className:(0,i.default)("AdderToolbar",{"AdderToolbar--down":"up"===e,"AdderToolbar--up":"down"===e,"is-active":t}),style:{visibility:t?"visible":"hidden"},children:[(0,a.jsxs)("div",{className:"AdderToolbar__actions",children:[(0,a.jsx)(l,{icon:"annotate",onClick:()=>n("annotate"),label:"Annotate",shortcut:c}),(0,a.jsx)(l,{icon:"highlight",onClick:()=>n("highlight"),label:"Highlight",shortcut:u}),o>0&&(0,a.jsx)("div",{className:"AdderToolbar__separator"}),o>0&&(0,a.jsx)(l,{badgeCount:o,onClick:()=>n("show"),label:"Show",shortcut:h})]}),(0,a.jsx)(r.SvgIcon,{name:"pointer",inline:!0,className:(0,i.default)("AdderToolbar__arrow",{"AdderToolbar__arrow--down":"down"===e,"AdderToolbar__arrow--up":"up"===e})})]})};var o,i=(o=e("classnames"))&&o.__esModule?o:{default:o},r=e("@hypothesis/frontend-shared"),s=e("../../shared/shortcut"),a=e("preact/jsx-runtime");function l({badgeCount:e,icon:t,label:n,onClick:o,shortcut:i}){(0,s.useShortcut)(i,o);const l=i?`${n} (${i})`:n;return(0,a.jsxs)("button",{className:"AdderToolbar__button",onClick:o,"aria-label":l,title:l,children:[t&&(0,a.jsx)(r.SvgIcon,{name:t,className:"AdderToolbar__icon"}),"number"==typeof e&&(0,a.jsx)("span",{className:"AdderToolbar__badge",children:e}),(0,a.jsx)("span",{className:"AdderToolbar__label",children:n})]})}},{"../../shared/shortcut":90,"@hypothesis/frontend-shared":17,classnames:20,"preact/jsx-runtime":27}],42:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function({above:e,below:t,buckets:n,onSelectAnnotations:o,scrollToAnchor:i}){const r=e.anchors.length>0,s=t.anchors.length>0;return(0,a.jsxs)("ul",{className:"Buckets__list",children:[r&&(0,a.jsx)("li",{className:"Buckets__bucket",style:{top:e.position},children:(0,a.jsx)(c,{bucket:e,direction:"up",scrollToAnchor:i})}),n.map(((e,t)=>(0,a.jsx)("li",{className:"Buckets__bucket",style:{top:e.position},children:(0,a.jsx)(l,{bucket:e,onSelectAnnotations:o})},t))),s&&(0,a.jsx)("li",{className:"Buckets__bucket",style:{top:t.position},children:(0,a.jsx)(c,{bucket:t,direction:"down",scrollToAnchor:i})})]})};var o,i=(o=e("classnames"))&&o.__esModule?o:{default:o},r=e("../highlighter"),s=e("../util/buckets"),a=e("preact/jsx-runtime");function l({bucket:e,onSelectAnnotations:t}){const n=e.anchors.map((e=>e.annotation)),o=`Select nearby annotations (${e.anchors.length})`;function i(t){e.anchors.forEach((e=>{(0,r.setHighlightsFocused)(e.highlights||[],t)}))}return(0,a.jsx)("button",{className:"Buckets__button Buckets__button--left",onClick:e=>function(e){t(n,e.metaKey||e.ctrlKey)}(e),onMouseMove:()=>i(!0),onMouseOut:()=>i(!1),onBlur:()=>i(!1),title:o,"aria-label":o,children:e.anchors.length})}function c({bucket:e,direction:t,scrollToAnchor:n}){const o=`Go ${t} to next annotations (${e.anchors.length})`;return(0,a.jsx)("button",{className:(0,i.default)("Buckets__button",`Buckets__button--${t}`),onClick:function(){const o=(0,s.findClosestOffscreenAnchor)(e.anchors,t);o&&n(o)},title:o,"aria-label":o,children:e.anchors.length})}},{"../highlighter":56,"../util/buckets":70,classnames:20,"preact/jsx-runtime":27}],43:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function({eventBus:e,config:t}){const[n,o]=(0,r.useState)(0),[a,u]=(0,r.useState)(!0),[h,d]=(0,r.useState)(null),f=(0,r.useRef)(""),p=(0,r.useRef)(null);return(0,r.useEffect)((()=>(f.current=document.body.style.overflow,()=>{document.body.style.overflow=f.current})),[]),(0,r.useEffect)((()=>{document.body.style.overflow=a?f.current:"hidden"}),[a]),(0,r.useEffect)((()=>(p.current=e.createEmitter(),p.current.subscribe("openNotebook",(e=>{u(!1),o((e=>e+1)),d(e)})),()=>{p.current.destroy()})),[e]),null===h?null:(0,l.jsx)("div",{className:(0,s.default)("NotebookModal__outer",{"is-hidden":a}),children:(0,l.jsxs)("div",{className:"NotebookModal__inner",children:[(0,l.jsx)("div",{className:"NotebookModal__close-button-container",children:(0,l.jsx)(i.IconButton,{icon:"cancel",title:"Close the Notebook",onClick:()=>{u(!0),p.current.publish("closeNotebook")},variant:"dark"})}),(0,l.jsx)(c,{config:t,groupId:h},n)]})})};var o,i=e("@hypothesis/frontend-shared"),r=e("preact/hooks"),s=(o=e("classnames"))&&o.__esModule?o:{default:o},a=e("../config/sidebar"),l=e("preact/jsx-runtime");function c({config:e,groupId:t}){const n=(0,a.createSidebarConfig)(e);n.group=t;const o=encodeURIComponent(JSON.stringify(n)),i=`${e.notebookAppUrl}#config=${o}`;return(0,l.jsx)("iframe",{title:"Hypothesis annotation notebook",className:"NotebookIframe",allowFullScreen:!0,src:i})}},{"../config/sidebar":50,"@hypothesis/frontend-shared":17,classnames:20,"preact/hooks":26,"preact/jsx-runtime":27}],44:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function({closeSidebar:e,createAnnotation:t,isSidebarOpen:n,newAnnotationType:o,showHighlights:s,toggleHighlights:a,toggleSidebar:l,toggleSidebarRef:c,useMinimalControls:u=!1}){return(0,i.jsxs)("div",{className:"Toolbar",children:[u&&n&&(0,i.jsx)(r,{className:"Toolbar__sidebar-close",label:"Close annotation sidebar",icon:"cancel",onClick:e}),!u&&(0,i.jsx)(r,{className:"Toolbar__sidebar-toggle",buttonRef:c,label:"Annotation sidebar",icon:n?"caret-right":"caret-left",expanded:n,onClick:l}),!u&&(0,i.jsxs)("div",{className:"Toolbar__buttonbar",children:[(0,i.jsx)(r,{label:"Show highlights",icon:s?"show":"hide",selected:s,onClick:a}),(0,i.jsx)(r,{label:"note"===o?"New page note":"New annotation",icon:"note"===o?"note":"annotate",onClick:t})]})]})};var o=e("@hypothesis/frontend-shared"),i=e("preact/jsx-runtime");function r({buttonRef:e,expanded:t,className:n="Toolbar__button",label:r,icon:s,onClick:a,selected:l=!1}){return(0,i.jsx)("button",{className:n,"aria-label":r,"aria-expanded":t,"aria-pressed":l,onClick:a,ref:e,title:r,children:(0,i.jsx)(o.SvgIcon,{name:s})})}},{"@hypothesis/frontend-shared":17,"preact/jsx-runtime":27}],45:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(){return(0,i.jsxs)("div",{className:"WarningBanner WarningBanner--notice",children:[(0,i.jsx)("div",{className:"WarningBanner__type",children:(0,i.jsx)(o.SvgIcon,{name:"caution",className:"WarningBanner__icon"})}),(0,i.jsxs)("div",{className:"WarningBanner__message",children:[(0,i.jsx)("strong",{children:"This PDF does not contain selectable text:"})," ",(0,i.jsx)("a",{target:"_blank",rel:"noreferrer",href:"https://web.hypothes.is/help/how-to-ocr-optimize-pdfs/",children:"Learn how to fix this"})," ","in order to annotate with Hypothesis."]})]})};var o=e("@hypothesis/frontend-shared"),i=e("preact/jsx-runtime")},{"@hypothesis/frontend-shared":17,"preact/jsx-runtime":27}],46:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e){if(!e.hasOwnProperty("hypothesisConfig"))return{};if("function"!=typeof e.hypothesisConfig){const e="https://h.readthedocs.io/projects/client/en/latest/publishers/config/#window.hypothesisConfig";return console.warn("hypothesisConfig must be a function, see: "+e),{}}return e.hypothesisConfig()}},{}],47:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.getConfig=function(e="annotator",t=window){const n=(0,r.default)(t),o={};return function(e){const t={annotator:["clientUrl","showHighlights","subFrameIdentifier"],sidebar:["appType","annotations","branding","enableExperimentalNewNoteButton","externalContainerSelector","focus","group","onLayoutChange","openSidebar","query","requestConfigFromFrame","services","showHighlights","sidebarAppUrl","theme","usernameUrl"],notebook:["branding","group","notebookAppUrl","requestConfigFromFrame","services","theme","usernameUrl"]};switch(e){case"annotator":return t.annotator;case"sidebar":return t.sidebar;case"notebook":return t.notebook;case"all":return[...t.annotator,...t.sidebar,...t.notebook];default:throw new Error(`Invalid application context used: "${e}"`)}}(e).forEach((e=>{const r=c[e],s=void 0!==r.defaultValue,l=(0,i.isBrowserExtension)((0,a.urlFromLinkTag)(t,"sidebar","html"));if(!r.allowInBrowserExt&&l)return void(s&&(o[e]=r.defaultValue));const u=r.getValue(n,e);void 0!==u?o[e]=r.coerce?r.coerce(u):u:s&&(o[e]=r.defaultValue)})),o};var o,i=e("./is-browser-extension"),r=(o=e("./settings"))&&o.__esModule?o:{default:o},s=e("../../shared/type-coercions"),a=e("./url-from-link-tag");function l(e,t){return e.hostPageSetting(t)}const c={annotations:{allowInBrowserExt:!0,defaultValue:null,getValue:e=>e.annotations},appType:{allowInBrowserExt:!0,defaultValue:null,getValue:l},branding:{defaultValue:null,allowInBrowserExt:!1,getValue:l},clientUrl:{allowInBrowserExt:!0,defaultValue:null,getValue:e=>e.clientUrl},enableExperimentalNewNoteButton:{allowInBrowserExt:!1,defaultValue:null,getValue:l},group:{allowInBrowserExt:!0,defaultValue:null,getValue:e=>e.group},focus:{allowInBrowserExt:!1,defaultValue:null,getValue:l},theme:{allowInBrowserExt:!1,defaultValue:null,getValue:l},usernameUrl:{allowInBrowserExt:!1,defaultValue:null,getValue:l},onLayoutChange:{allowInBrowserExt:!1,defaultValue:null,getValue:l},openSidebar:{allowInBrowserExt:!0,defaultValue:!1,coerce:s.toBoolean,getValue:l},query:{allowInBrowserExt:!0,defaultValue:null,getValue:e=>e.query},requestConfigFromFrame:{allowInBrowserExt:!1,defaultValue:null,getValue:l},services:{allowInBrowserExt:!1,defaultValue:null,getValue:l},showHighlights:{allowInBrowserExt:!1,defaultValue:"always",getValue:e=>e.showHighlights},notebookAppUrl:{allowInBrowserExt:!0,defaultValue:null,getValue:e=>e.notebookAppUrl},sidebarAppUrl:{allowInBrowserExt:!0,defaultValue:null,getValue:e=>e.sidebarAppUrl},subFrameIdentifier:{allowInBrowserExt:!0,defaultValue:null,getValue:l},externalContainerSelector:{allowInBrowserExt:!1,defaultValue:null,getValue:l}}},{"../../shared/type-coercions":91,"./is-browser-extension":48,"./settings":49,"./url-from-link-tag":51}],48:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isBrowserExtension=function(e){return!(e.startsWith("http://")||e.startsWith("https://"))}},{}],49:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e){const t=(0,s.default)(e);let n;function o(e){return t.hasOwnProperty(e)?t[e]:n.hasOwnProperty(e)?n[e]:void 0}return n=(0,r.toBoolean)(t.ignoreOtherConfiguration)?{}:(0,i.parseJsonConfig)(e.document),{get annotations(){return n.annotations||function(){const t=e.location.href.match(/#annotations:([A-Za-z0-9_-]+)$/);return t?t[1]:null}()},get clientUrl(){return(0,a.urlFromLinkTag)(e,"hypothesis-client","javascript")},get group(){return n.group||function(){const t=e.location.href.match(/#annotations:group:([A-Za-z0-9_-]+)$/);return t?t[1]:null}()},get notebookAppUrl(){return(0,a.urlFromLinkTag)(e,"notebook","html")},get showHighlights(){return function(){let e=o("showHighlights");return void 0===e&&(e="always"),"boolean"==typeof e?e?"always":"never":e}()},get sidebarAppUrl(){return(0,a.urlFromLinkTag)(e,"sidebar","html")},get query(){return n.query||function(){const t=e.location.href.match(/#annotations:(query|q):(.+)$/i);if(t)try{return decodeURIComponent(t[2])}catch(n){}return null}()},hostPageSetting:o}};var o,i=e("../../boot/parse-json-config"),r=e("../../shared/type-coercions"),s=(o=e("./config-func-settings-from"))&&o.__esModule?o:{default:o},a=e("./url-from-link-tag")},{"../../boot/parse-json-config":75,"../../shared/type-coercions":91,"./config-func-settings-from":46,"./url-from-link-tag":51}],50:[function(e,t,n){"use strict";function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(n,"__esModule",{value:!0}),n.createSidebarConfig=function(e){var t;const n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e);if((null===(t=n.services)||void 0===t?void 0:t.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["notebookAppUrl","sidebarAppUrl"].forEach((e=>delete n[e])),n}},{}],51:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.urlFromLinkTag=function(e,t,n){const o=e.document.querySelector(`link[type="application/annotator+${n}"][rel="${t}"]`);if(!o)throw new Error(`No application/annotator+${n} (rel="${t}") link in the document`);if(!o.href)throw new Error(`application/annotator+${n} (rel="${t}") link has no href`);return o.href}},{}],52:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.CrossFrame=void 0;var o=e("../shared/bridge"),i=e("./annotation-sync"),r=e("./hypothesis-injector");n.CrossFrame=class{constructor(e,t,n){this._bridge=new o.Bridge,this._annotationSync=new i.AnnotationSync(t,this._bridge),this._hypothesisInjector=new r.HypothesisInjector(e,this._bridge,n)}connectToSidebar(e,t){const n=new MessageChannel;e.postMessage({type:"hypothesisGuestReady"},t,[n.port2]),this._bridge.createChannel(n.port1)}destroy(){this._bridge.destroy(),this._annotationSync.destroy(),this._hypothesisInjector.destroy()}sync(e){this._annotationSync.sync(e)}on(e,t){this._bridge.on(e,t)}call(e,...t){this._bridge.call(e,...t)}onConnect(e){this._bridge.onConnect(e)}}},{"../shared/bridge":87,"./annotation-sync":39,"./hypothesis-injector":57}],53:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=r(e("../shared/bridge-events")),i=r(e("../shared/warn-once"));function r(e){return e&&e.__esModule?e:{default:e}}let s={};const a=e=>{s=e||{}};var l={init:function(e){e.on(o.default.FEATURE_FLAGS_UPDATED,a)},reset:function(){a({})},flagEnabled:function(e){return e in s?s[e]:((0,i.default)("looked up unknown feature",e),!1)}};n.default=l},{"../shared/bridge-events":86,"../shared/warn-once":93}],54:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.onDocumentReady=r,n.FrameObserver=n.DEBOUNCE_WAIT=void 0;var o,i=(o=e("lodash.debounce"))&&o.__esModule?o:{default:o};n.DEBOUNCE_WAIT=40;function r(e){return new Promise((t=>{const n=e.contentWindow.document,{readyState:o,location:i}=n;"about:blank"===i.href&&e.hasAttribute("src")&&"about:blank"!==e.src?e.addEventListener("load",(()=>{t()})):"loading"!==o?t():n.addEventListener("DOMContentLoaded",(()=>t()))}))}n.FrameObserver=class{constructor(e,t,n){this._element=e,this._onFrameAdded=t,this._onFrameRemoved=n,this._annotatableFrames=new Set,this._isDisconnected=!1,this._mutationObserver=new MutationObserver((0,i.default)((()=>{this._discoverFrames()}),40)),this._discoverFrames(),this._mutationObserver.observe(this._element,{childList:!0,subtree:!0,attributeFilter:["enable-annotation"]})}disconnect(){this._isDisconnected=!0,this._mutationObserver.disconnect()}async _addFrame(e){this._annotatableFrames.add(e);try{if(await r(e),this._isDisconnected)return;e.contentWindow.addEventListener("unload",(()=>{this._removeFrame(e)})),this._onFrameAdded(e)}catch(t){console.warn(`Unable to inject the Hypothesis client (from '${document.location.href}' into a cross-origin frame '${e.src}')`)}}_removeFrame(e){this._annotatableFrames.delete(e),this._onFrameRemoved(e)}_discoverFrames(){const e=new Set(this._element.querySelectorAll("iframe[enable-annotation]"));for(let t of e)this._annotatableFrames.has(t)||this._addFrame(t);for(let t of this._annotatableFrames)e.has(t)||this._removeFrame(t)}}},{"lodash.debounce":23}],55:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=e("../shared/listener-collection"),i=e("./adder"),r=e("./anchoring/text-range"),s=e("./cross-frame"),a=e("./highlighter"),l=e("./integrations/html"),c=e("./integrations/pdf"),u=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var s=i?Object.getOwnPropertyDescriptor(e,r):null;s&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}(e("./range-util")),h=e("./selection-observer"),d=e("./util/url");function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}function p(e){return(0,a.getHighlightsContainingNode)(e).map((e=>e._annotation)).filter((e=>void 0!==e))}function m(e){if(!e.range)return null;try{return e.range.toRange()}catch(t){return null}}n.default=class{constructor(e,t,n={}){var r=this;this.element=e,this._emitter=t.createEmitter(),this._visibleHighlights=!1,this._isAdderVisible=!1,this._adder=new i.Adder(this.element,{onAnnotate:async function(){await r.createAnnotation(),document.getSelection().removeAllRanges()},onHighlight:async function(){r.setVisibleHighlights(!0),await r.createAnnotation({highlight:!0}),document.getSelection().removeAllRanges()},onShowAnnotations:e=>{this.selectAnnotations(e)}}),this._selectionObserver=new h.SelectionObserver((e=>{e?this._onSelection(e):this._onClearSelection()})),this.anchors=[],this._integration="pdf"===n.documentType?new c.PDFIntegration(this):new l.HTMLIntegration(this.element),this._frameIdentifier=n.subFrameIdentifier||null,this.crossframe=new s.CrossFrame(this.element,t,n),this.crossframe.onConnect((()=>this._setupInitialState(n))),this._connectSidebarEvents(),this._sideBySideActive=!1,this._connectAnnotationSync(),this._listeners=new o.ListenerCollection,this._setupElementEvents(),this._focusedAnnotations=new Set}_setupElementEvents(){const e=e=>{this._sideBySideActive||p(e).length||this.crossframe.call("closeSidebar")};this._listeners.add(this.element,"mouseup",(e=>{const{target:t,metaKey:n,ctrlKey:o}=e,i=p(t);if(i.length&&this._visibleHighlights){const e=n||o;this.selectAnnotations(i,e)}})),this._listeners.add(this.element,"mousedown",(({target:t})=>{e(t)})),this._listeners.add(this.element,"touchstart",(({target:t})=>{e(t)})),this._listeners.add(this.element,"mouseover",(({target:e})=>{const t=p(e);t.length&&this._visibleHighlights&&this._focusAnnotations(t)})),this._listeners.add(this.element,"mouseout",(()=>{this._visibleHighlights&&this._focusAnnotations([])})),this._listeners.add(window,"resize",(()=>this._repositionAdder()))}async getDocumentInfo(){const[e,t]=await Promise.all([this._integration.uri(),this._integration.getMetadata()]);return{uri:(0,d.normalizeURI)(e),metadata:t,frameIdentifier:this._frameIdentifier}}_repositionAdder(){var e;if(!1===this._isAdderVisible)return;const t=null===(e=window.getSelection())||void 0===e?void 0:e.getRangeAt(0);t&&this._onSelection(t)}_setupInitialState(e){this._emitter.publish("panelReady"),this.setVisibleHighlights("always"===e.showHighlights)}_connectAnnotationSync(){this._emitter.subscribe("annotationDeleted",(e=>{this.detach(e)})),this._emitter.subscribe("annotationsLoaded",(e=>{e.map((e=>this.anchor(e)))}))}_connectSidebarEvents(){this.crossframe.on("focusAnnotations",((e=[])=>{this._focusedAnnotations.clear(),e.forEach((e=>this._focusedAnnotations.add(e)));for(let t of this.anchors)if(t.highlights){const n=e.includes(t.annotation.$tag);(0,a.setHighlightsFocused)(t.highlights,n)}})),this.crossframe.on("scrollToAnnotation",(e=>{const t=this.anchors.find((t=>t.annotation.$tag===e));if(null==t||!t.highlights)return;const n=m(t);if(!n)return;const o=new CustomEvent("scrolltorange",{bubbles:!0,cancelable:!0,detail:n});this.element.dispatchEvent(o)&&this._integration.scrollToAnchor(t)})),this.crossframe.on("getDocumentInfo",(e=>{this.getDocumentInfo().then((t=>e(null,t))).catch((t=>e(t)))})),this.crossframe.on("setVisibleHighlights",(e=>{this.setVisibleHighlights(e)}))}destroy(){this._listeners.removeAll(),this._selectionObserver.disconnect(),this._adder.destroy(),(0,a.removeAllHighlights)(this.element),this._integration.destroy(),this._emitter.destroy(),this.crossframe.destroy()}async anchor(e){var t=this;const n=e=>{const t=m(e);if(!t)return;const n=(0,a.highlightRange)(t);n.forEach((t=>{t._annotation=e.annotation})),e.highlights=n,this._focusedAnnotations.has(e.annotation.$tag)&&(0,a.setHighlightsFocused)(n,!0)};this.detach(e,!1),e.target||(e.target=[]);const o=await Promise.all(e.target.map((async function(n){if(!n.selector||!n.selector.some((e=>"TextQuoteSelector"===e.type)))return{annotation:e,target:n};let o;try{const i=await t._integration.anchor(t.element,n.selector),s=r.TextRange.fromRange(i);o={annotation:e,target:n,range:s}}catch(i){o={annotation:e,target:n}}return o})));for(let i of o)n(i);return e.$orphan=o.length>0&&o.every((e=>e.target.selector&&!e.range)),this._updateAnchors(this.anchors.concat(o),!0),this.crossframe.sync([e]),o}detach(e,t=!0){const n=[];for(let o of this.anchors)o.annotation!==e?n.push(o):o.highlights&&(0,a.removeHighlights)(o.highlights);this._updateAnchors(n,t)}_updateAnchors(e,t){this.anchors=e,t&&this._emitter.publish("anchorsChanged",this.anchors)}async createAnnotation({highlight:e=!1}={}){var t;const n=null!==(t=this.selectedRanges)&&void 0!==t?t:[];this.selectedRanges=null;const o=await this.getDocumentInfo(),i=this.element,r=(await Promise.all(n.map((e=>this._integration.describe(i,e))))).map((e=>({source:o.uri,selector:e}))),s={uri:o.uri,document:o.metadata,target:r,$highlight:e,$tag:""};return this._emitter.publish("beforeAnnotationCreated",s),this.anchor(s),s.$highlight||this.crossframe.call("openSidebar"),s}_focusAnnotations(e){const t=e.map((e=>e.$tag));this.crossframe.call("focusAnnotations",t)}_onSelection(e){const t=document.getSelection(),n=u.isSelectionBackwards(t),o=u.selectionFocusRect(t);o?(this.selectedRanges=[e],this._emitter.publish("hasSelectionChanged",!0),this._adder.annotationsForSelection=function(){const e=window.getSelection().getRangeAt(0);return u.itemsForRange(e,(e=>e._annotation))}(),this._isAdderVisible=!0,this._adder.show(o,n)):this._onClearSelection()}_onClearSelection(){this._isAdderVisible=!1,this._adder.hide(),this.selectedRanges=[],this._emitter.publish("hasSelectionChanged",!1)}selectAnnotations(e,t=!1){const n=e.map((e=>e.$tag));t?this.crossframe.call("toggleAnnotationSelection",n):this.crossframe.call("showAnnotations",n),this.crossframe.call("openSidebar")}scrollToAnchor(e){return this._integration.scrollToAnchor(e)}setVisibleHighlights(e){(0,a.setHighlightsVisible)(this.element,e),this._visibleHighlights=e,this._emitter.publish("highlightsVisibleChanged",e)}contentContainer(){return this._integration.contentContainer()}fitSideBySide(e){this._sideBySideActive=this._integration.fitSideBySide(e)}get sideBySideActive(){return this._sideBySideActive}get focusedAnnotationTags(){return this._focusedAnnotations}}},{"../shared/listener-collection":88,"./adder":30,"./anchoring/text-range":35,"./cross-frame":52,"./highlighter":56,"./integrations/html":61,"./integrations/pdf":63,"./range-util":65,"./selection-observer":66,"./util/url":74}],56:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.highlightRange=function(e,t="hypothesis-highlight"){const n=function(e){if(e.collapsed)return[];let t=e.commonAncestorContainer;if(t.nodeType!==Node.ELEMENT_NODE&&(t=t.parentElement),!t)return[];const n=[],o=t.ownerDocument.createNodeIterator(t,NodeFilter.SHOW_TEXT);let r;for(;r=o.nextNode();){if(!(0,i.isNodeInRange)(e,r))continue;let t=r;t===e.startContainer&&e.startOffset>0?t.splitText(e.startOffset):(t===e.endContainer&&e.endOffset<t.data.length&&t.splitText(e.endOffset),n.push(t))}return n}(e),s=n.length>0&&(0,o.isInPlaceholder)(n[0]);let a=[],l=null,c=null;n.forEach((e=>{l&&l.nextSibling===e?c.push(e):(c=[e],a.push(c)),l=e}));const u=/^\s*$/;a=a.filter((e=>e.some((e=>!u.test(e.nodeValue)))));const h=[];return a.forEach((e=>{const n=document.createElement("hypothesis-highlight");n.className=t,e[0].parentNode.replaceChild(n,e[0]),e.forEach((e=>n.appendChild(e))),h.push(n)})),s||function(e){if(0===e.length)return;const t=function(e){const t=e.closest(".page");if(!t)return null;return t.querySelector(".canvasWrapper > canvas")||null}(e[0]);if(!t||!t.parentElement)return;let n=t.parentElement.querySelector(".hypothesis-highlight-layer");const o=CSS.supports("mix-blend-mode","multiply");if(!n){n=document.createElementNS(r,"svg"),n.setAttribute("class","hypothesis-highlight-layer"),t.parentElement.appendChild(n),t.parentElement.style.position="relative";const e=n.style;e.position="absolute",e.left="0",e.top="0",e.width="100%",e.height="100%",o?e.mixBlendMode="multiply":e.opacity="0.3"}const i=t.getBoundingClientRect(),s=e.map((e=>{const t=e.getBoundingClientRect(),n=document.createElementNS(r,"rect");return n.setAttribute("x",(t.left-i.left).toString()),n.setAttribute("y",(t.top-i.top).toString()),n.setAttribute("width",t.width.toString()),n.setAttribute("height",t.height.toString()),o?n.setAttribute("class","hypothesis-svg-highlight"):n.setAttribute("class","hypothesis-svg-highlight is-opaque"),e.classList.add("is-transparent"),e.svgHighlight=n,n}));n.append(...s)}(h),h},n.removeAllHighlights=function(e){a(Array.from(e.querySelectorAll("hypothesis-highlight")))},n.removeHighlights=a,n.setHighlightsFocused=function(e,t){e.forEach((e=>{e.svgHighlight?(e.svgHighlight.classList.toggle("is-focused",t),t&&e.svgHighlight.parentNode.append(e.svgHighlight)):e.classList.toggle("hypothesis-highlight-focused",t)}))},n.setHighlightsVisible=function(e,t){e.classList.toggle("hypothesis-highlights-always-on",t)},n.getHighlightsContainingNode=function(e){let t=e.nodeType===Node.ELEMENT_NODE?e:e.parentElement;const n=[];for(;t;)t.classList.contains("hypothesis-highlight")&&n.push(t),t=t.parentElement;return n},n.getBoundingClientRect=function(e){return e.map((e=>e.getBoundingClientRect())).reduce(((e,t)=>({top:Math.min(e.top,t.top),left:Math.min(e.left,t.left),bottom:Math.max(e.bottom,t.bottom),right:Math.max(e.right,t.right)})))};var o=e("./anchoring/placeholder"),i=e("./range-util");const r="http://www.w3.org/2000/svg";function s(e,t){const n=e.parentNode;t.forEach((t=>n.insertBefore(t,e))),e.remove()}function a(e){for(let t of e)t.parentNode&&s(t,Array.from(t.childNodes)),t.svgHighlight&&t.svgHighlight.remove()}},{"./anchoring/placeholder":34,"./range-util":65}],57:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.HypothesisInjector=void 0;var o=e("./frame-observer");function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.HypothesisInjector=class{constructor(e,t,n){this._bridge=t,this._config=n,this._frameIdentifiers=new Map,this._frameObserver=new o.FrameObserver(e,(e=>this._addHypothesis(e)),(e=>this._removeHypothesis(e)))}destroy(){this._frameObserver.disconnect()}_addHypothesis(e){if(function(e){return"__hypothesis"in e.contentWindow}(e))return;const t=Math.random().toString().replace(/\D/g,"");this._frameIdentifiers.set(e,t);const n=r(r({},this._config),{},{subFrameIdentifier:t}),{clientUrl:o}=this._config;!function(e,t,n){const o=document.createElement("script");o.className="js-hypothesis-config",o.type="application/json",o.innerText=JSON.stringify(n);const i=document.createElement("script");i.async=!0,i.src=t;const r=e.contentDocument;r.body.appendChild(o),r.body.appendChild(i)}(e,o,n)}_removeHypothesis(e){this._bridge.call("destroyFrame",this._frameIdentifiers.get(e)),this._frameIdentifiers.delete(e)}}},{"./frame-observer":54}],58:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o={annotate:e("../images/icons/annotate.svg"),cancel:e("../images/icons/cancel.svg"),caution:e("../images/icons/caution.svg"),"caret-left":e("../images/icons/caret-left.svg"),"caret-right":e("../images/icons/caret-right.svg"),hide:e("../images/icons/hide.svg"),highlight:e("../images/icons/highlight.svg"),note:e("../images/icons/note.svg"),pointer:e("../images/icons/pointer.svg"),show:e("../images/icons/show.svg")};n.default=o},{"../images/icons/annotate.svg":76,"../images/icons/cancel.svg":77,"../images/icons/caret-left.svg":78,"../images/icons/caret-right.svg":79,"../images/icons/caution.svg":80,"../images/icons/hide.svg":81,"../images/icons/highlight.svg":82,"../images/icons/note.svg":83,"../images/icons/pointer.svg":84,"../images/icons/show.svg":85}],59:[function(e,t,n){"use strict";e("focus-visible");var o=e("@hypothesis/frontend-shared"),i=u(e("./icons")),r=e("./config/index"),s=u(e("./guest")),a=u(e("./notebook")),l=u(e("./sidebar")),c=e("./util/emitter");function u(e){return e&&e.__esModule?e:{default:e}}function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){f(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}(0,o.registerIcons)(i.default);const p=window,m=document.querySelector('link[type="application/annotator+html"][rel="sidebar"]');new Promise((e=>{"loading"!==document.readyState&&e(),document.addEventListener("readystatechange",(()=>e()))})).then((function(){p.__hypothesis={};const e=(0,r.getConfig)("annotator"),t=void 0!==p.PDFViewerApplication,n=new c.EventBus,o=new s.default(document.body,n,d(d({},e),{},{documentType:t?"pdf":"html"}));let i;e.subFrameIdentifier||(i=new l.default(document.body,n,o,(0,r.getConfig)("sidebar")),p.__hypothesis.sidebarWindow=i.ready.then((()=>[i.iframe.contentWindow])));const u=new a.default(document.body,n,(0,r.getConfig)("notebook"));let h=p.__hypothesis.sidebarWindow;try{var f;h||(h=null===(f=window.parent.__hypothesis)||void 0===f?void 0:f.sidebarWindow)}catch(g){}if(h){const e=new URL(m.href).origin;h.then((([t])=>o.crossframe.connectToSidebar(t,e)))}else console.warn(`Hypothesis guest frame in ${location.origin} could not find a sidebar to connect to.\nGuest frames can only connect to sidebars in their same-origin parent frame.`);m.addEventListener("destroy",(()=>{var e;delete p.__hypothesis,null===(e=i)||void 0===e||e.destroy(),u.destroy(),o.destroy(),document.querySelectorAll("[data-hypothesis-asset]").forEach((e=>e.remove()))}))}))},{"./config/index":47,"./guest":55,"./icons":58,"./notebook":64,"./sidebar":68,"./util/emitter":71,"@hypothesis/frontend-shared":17,"focus-visible":21}],60:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.HTMLMetadata=void 0;var o=e("../util/url");n.HTMLMetadata=class{constructor(e={}){this.document=e.document||document}uri(){let e=decodeURIComponent(this._getDocumentHref());const t=this._getLinks();for(let n of t)"canonical"===n.rel&&(e=n.href);return e}getDocumentMetadata(){const e={title:document.title,link:[],dc:this._getMetaTags("dc","name","."),eprints:this._getMetaTags("eprints","name","."),facebook:this._getMetaTags("og","property",":"),highwire:this._getMetaTags("citation","name","_"),prism:this._getMetaTags("prism","name","."),twitter:this._getMetaTags("twitter","name",":")},t=this._getFavicon();t&&(e.favicon=t),e.title=this._getTitle(e),e.link=this._getLinks(e);const n=e.link.find((e=>e.href.startsWith("urn:x-dc")));return n&&(e.documentFingerprint=n.href),e}_getMetaTags(e,t,n){const o={};for(let i of Array.from(this.document.querySelectorAll("meta"))){const r=i.getAttribute(t),{content:s}=i;if(r){const t=r.match(RegExp(`^${e}${n}(.+)$`,"i"));if(t){const e=t[1];o[e]?o[e].push(s):o[e]=[s]}}}return o}_getTitle(e){return e.highwire.title?e.highwire.title[0]:e.eprints.title?e.eprints.title[0]:e.prism.title?e.prism.title[0]:e.facebook.title?e.facebook.title[0]:e.twitter.title?e.twitter.title[0]:e.dc.title?e.dc.title[0]:this.document.title}_getLinks(e={dc:{},highwire:{}}){const t=[{href:this._getDocumentHref()}],n=Array.from(this.document.querySelectorAll("link"));for(let s of n)if(["alternate","canonical","bookmark","shortlink"].includes(s.rel)){if("alternate"===s.rel){if(s.type&&s.type.match(/^application\/(rss|atom)\+xml/))continue;if(s.hreflang)continue}try{const e=this._absoluteUrl(s.href);t.push({href:e,rel:s.rel,type:s.type})}catch(r){}}for(let s of Object.keys(e.highwire)){const n=e.highwire[s];if("pdf_url"===s)for(let e of n)try{t.push({href:this._absoluteUrl(e),type:"application/pdf"})}catch(r){}if("doi"===s)for(let e of n)"doi:"!==e.slice(0,4)&&(e=`doi:${e}`),t.push({href:e})}for(let s of Object.keys(e.dc)){const n=e.dc[s];if("identifier"===s)for(let e of n)"doi:"===e.slice(0,4)&&t.push({href:e})}const o=e.dc["relation.ispartof"],i=e.dc.identifier;if(o&&i){const e=o[o.length-1],n=i[i.length-1],r="urn:x-dc:"+encodeURIComponent(e)+"/"+encodeURIComponent(n);t.push({href:r})}return t}_getFavicon(){let e=null;for(let n of Array.from(this.document.querySelectorAll("link")))if(["shortcut icon","icon"].includes(n.rel))try{e=this._absoluteUrl(n.href)}catch(t){}return e}_absoluteUrl(e){return(0,o.normalizeURI)(e,this.document.baseURI)}_getDocumentHref(){const{href:e}=this.document.location,t=["http:","https:","file:"],n=new URL(e).protocol;return t.includes(n)?e:this.document.baseURI&&t.includes(new URL(this.document.baseURI).protocol)?this.document.baseURI:e}}},{"../util/url":74}],61:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.HTMLIntegration=void 0;var o,i=(o=e("scroll-into-view"))&&o.__esModule?o:{default:o},r=e("../anchoring/html"),s=e("./html-metadata");n.HTMLIntegration=class{constructor(e=document.body){this.container=e,this.anchor=r.anchor,this.describe=r.describe,this._htmlMeta=new s.HTMLMetadata}destroy(){}contentContainer(){return this.container}fitSideBySide(){return!1}async getMetadata(){return this._htmlMeta.getDocumentMetadata()}async uri(){return this._htmlMeta.uri()}scrollToAnchor(e){const t=e.highlights;return new Promise((e=>{(0,i.default)(t[0],e)}))}}},{"../anchoring/html":31,"./html-metadata":60,"scroll-into-view":28}],62:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.PDFMetadata=void 0;var o=e("../util/url");function i(e){return Array.isArray(e.pdfDocument.fingerprints)?e.pdfDocument.fingerprints[0]:e.pdfDocument.fingerprint}function r(e){return`urn:x-pdf:${e}`}function s(e){if(!e.url)return null;const t=(0,o.normalizeURI)(e.url);return 0!==t.indexOf("file://")?t:null}n.PDFMetadata=class{constructor(e){this._loaded=function(e){return e.initializedPromise?e.initializedPromise:e.initialized?Promise.resolve():new Promise((t=>{const n=setInterval((()=>{e.initialized&&(clearTimeout(n),t())}),5)}))}(e).then((()=>e.downloadComplete?e:new Promise((t=>{const n=()=>{e.eventBus?(e.eventBus.off("documentload",n),e.eventBus.off("documentloaded",n)):window.removeEventListener("documentload",n),t(e)};e.eventBus?(e.eventBus.on("documentloaded",n),e.eventBus.on("documentload",n)):window.addEventListener("documentload",n)}))))}getUri(){return this._loaded.then((e=>{let t=s(e);return t||(t=r(i(e))),t}))}async getMetadata(){const e=await this._loaded,{info:t,contentDispositionFilename:n,metadata:o}=await e.pdfDocument.getMetadata(),a=i(e),l=s(e);let c;c=null!=o&&o.has("dc:title")&&"Untitled"!==o.get("dc:title")?o.get("dc:title"):null!=t&&t.Title?t.Title:n||(l?function(e){const t=new URL(e).pathname.split("/");return t[t.length-1]}(l):"");const u=[{href:r(a)}];return l&&u.push({href:l}),{title:c,link:u,documentFingerprint:a}}}},{"../util/url":74}],63:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.PDFIntegration=void 0;var o=f(e("lodash.debounce")),i=e("preact"),r=e("../../shared/listener-collection"),s=e("../anchoring/pdf"),a=e("../anchoring/placeholder"),l=f(e("../components/WarningBanner")),c=e("../util/shadow-root"),u=e("../util/scroll"),h=e("./pdf-metadata"),d=e("preact/jsx-runtime");function f(e){return e&&e.__esModule?e:{default:e}}function p(e){var t;const n=null===(t=e.highlights)||void 0===t?void 0:t[0];return n&&(0,a.isInPlaceholder)(n)}function m(e){return new Promise((t=>setTimeout(t,e)))}n.PDFIntegration=class{constructor(e,t={}){var n,i,s;this.annotator=e;const a=window,l=a.PDFViewerApplication;this.pdfViewer=l.pdfViewer,this.pdfViewer.viewer.classList.add("has-transparent-text-layer"),this.pdfContainer=null!==(n=null===(i=l.appConfig)||void 0===i?void 0:i.appContainer)&&void 0!==n?n:document.body,this.pdfMetadata=new h.PDFMetadata(l),this.observer=new MutationObserver((0,o.default)((()=>this._update()),100)),this.observer.observe(this.pdfViewer.viewer,{attributes:!0,attributeFilter:["data-loaded"],childList:!0,subtree:!0}),this._reanchoringMaxWait=null!==(s=t.reanchoringMaxWait)&&void 0!==s?s:3e3,this._warningBanner=null,this._checkForSelectableText(),this._updateAnnotationLayerVisibility=()=>{const e=a.getSelection();this.pdfViewer.viewer.classList.toggle("is-selecting",!e.isCollapsed)},this._listeners=new r.ListenerCollection,this._listeners.add(document,"selectionchange",this._updateAnnotationLayerVisibility),this._destroyed=!1}destroy(){this._listeners.removeAll(),this.pdfViewer.viewer.classList.remove("has-transparent-text-layer"),this.observer.disconnect(),this._destroyed=!0}uri(){return this.pdfMetadata.getUri()}getMetadata(){return this.pdfMetadata.getMetadata()}anchor(e,t){return(0,s.anchor)(e,t)}describe(e,t){return(0,s.describe)(e,t)}async _checkForSelectableText(){try{await this.uri()}catch(e){return}if(!this._destroyed)try{const e=await(0,s.documentHasText)();this._toggleNoSelectableTextWarning(!e)}catch(t){console.warn("Unable to check for text in PDF:",t)}}_toggleNoSelectableTextWarning(e){const t=document.querySelector("#outerContainer");var n;if(!e)return null===(n=this._warningBanner)||void 0===n||n.remove(),this._warningBanner=null,void(t.style.height="");this._warningBanner=document.createElement("hypothesis-banner"),document.body.prepend(this._warningBanner);const o=(0,c.createShadowRoot)(this._warningBanner);(0,i.render)((0,d.jsx)(l.default,{}),o);const r=this._warningBanner.getBoundingClientRect().height;t.style.height=`calc(100% - ${r}px)`}_update(){const e=[],t=this.pdfViewer.pagesCount;for(let o=0;o<t;o++){var n;const e=this.pdfViewer.getPageView(o);if(null!=e&&null!==(n=e.textLayer)&&void 0!==n&&n.renderingDone)switch(e.renderingState){case s.RenderingStates.INITIAL:e.textLayer=null;break;case s.RenderingStates.FINISHED:(0,a.removePlaceholder)(e.div)}}for(let o of this.annotator.anchors)if(o.highlights){if(e.includes(o.annotation))continue;for(let t=0;t<o.highlights.length;t++){const n=o.highlights[t];if(!document.body.contains(n)){o.highlights.splice(t,1),delete o.range,e.push(o.annotation);break}}}e.map((e=>this.annotator.anchor(e)))}contentContainer(){return document.querySelector("#viewerContainer")}fitSideBySide(e){const t=window.innerWidth-e.width,n=e.expanded&&t>=680,o=n?e.width:e.toolbarWidth;this.pdfContainer.style.width=`calc(100% - ${o}px)`;const i=this.pdfViewer.currentScaleValue;return"auto"!==i&&"page-fit"!==i&&"page-width"!==i||(this.pdfViewer.currentScaleValue=i),this.pdfViewer.update(),n}async scrollToAnchor(e){const t=e.annotation,n=p(e),o=this._anchorOffset(e);if(null!==o&&(await(0,u.scrollElement)(this.contentContainer(),o),n)){const e=await this._waitForAnnotationToBeAnchored(t,this._reanchoringMaxWait);if(!e)return;const n=this._anchorOffset(e);if(null===n)return;await(0,u.scrollElement)(this.contentContainer(),n)}}async _waitForAnnotationToBeAnchored(e,t){var n;const o=Date.now();let i;do{i=this.annotator.anchors.find((t=>t.annotation===e)),i&&!p(i)||(i=null,await m(20))}while(!i&&Date.now()-o<t);return null!==(n=i)&&void 0!==n?n:null}_anchorOffset(e){if(!e.highlights)return null;const t=e.highlights[0];return(0,u.offsetRelativeTo)(t,this.contentContainer())}}},{"../../shared/listener-collection":88,"../anchoring/pdf":33,"../anchoring/placeholder":34,"../components/WarningBanner":45,"../util/scroll":72,"../util/shadow-root":73,"./pdf-metadata":62,"lodash.debounce":23,preact:25,"preact/jsx-runtime":27}],64:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o,i=e("./util/shadow-root"),r=e("preact"),s=(o=e("./components/NotebookModal"))&&o.__esModule?o:{default:o},a=e("preact/jsx-runtime");n.default=class{constructor(e,t,n={}){this._outerContainer=document.createElement("hypothesis-notebook"),e.appendChild(this._outerContainer),this.shadowRoot=(0,i.createShadowRoot)(this._outerContainer),(0,r.render)((0,a.jsx)(s.default,{eventBus:t,config:n}),this.shadowRoot)}destroy(){(0,r.render)(null,this.shadowRoot),this._outerContainer.remove()}}},{"./components/NotebookModal":43,"./util/shadow-root":73,preact:25,"preact/jsx-runtime":27}],65:[function(e,t,n){"use strict";function o(e){return e.focusNode===e.anchorNode?e.focusOffset<e.anchorOffset:e.getRangeAt(0).startContainer===e.focusNode}function i(e,t){try{var n,o;const i=null!==(n=null===(o=t.nodeValue)||void 0===o?void 0:o.length)&&void 0!==n?n:t.childNodes.length;return e.comparePoint(t,0)<=0&&e.comparePoint(t,i)>=0}catch(i){return!1}}function r(e,t){const n=e.commonAncestorContainer,o=n.ownerDocument.createNodeIterator(n,NodeFilter.SHOW_ALL);let r;for(;r=o.nextNode();)i(e,r)&&t(r)}function s(e){const t=/^\s*$/,n=[];r(e,(e=>{e.nodeType!==Node.TEXT_NODE||e.textContent.match(t)||n.push(e)}));let o=[];return n.forEach((t=>{const n=t.ownerDocument.createRange();if(n.selectNodeContents(t),t===e.startContainer&&n.setStart(t,e.startOffset),t===e.endContainer&&n.setEnd(t,e.endOffset),n.collapsed)return;const i=Array.from(n.getClientRects());n.detach(),o=o.concat(i)})),o}Object.defineProperty(n,"__esModule",{value:!0}),n.isSelectionBackwards=o,n.isNodeInRange=i,n.forEachNodeInRange=r,n.getTextBoundingBoxes=s,n.selectionFocusRect=function(e){if(e.isCollapsed)return null;const t=s(e.getRangeAt(0));return 0===t.length?null:o(e)?t[0]:t[t.length-1]},n.itemsForRange=function(e,t){const n=new Set,o=new Set;return r(e,(e=>{let i=e;for(;i&&!n.has(i);){n.add(i);const e=t(i);e&&o.add(e),i=i.parentNode}})),[...o]}},{}],66:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionObserver=void 0;var o=e("../shared/listener-collection");n.SelectionObserver=class{constructor(e,t=document){let n=!1;this._pendingCallback=null;const i=(n=10)=>{this._pendingCallback=setTimeout((()=>{e(function(e){const t=e.getSelection();if(!t||0===t.rangeCount)return null;const n=t.getRangeAt(0);return n.collapsed?null:n}(t))}),n)};this._eventHandler=e=>{if("mousedown"===e.type&&(n=!0),"mouseup"===e.type&&(n=!1),n)return;this._cancelPendingCallback();const t="mouseup"===e.type?10:100;i(t)},this._document=t,this._listeners=new o.ListenerCollection,this._events=["mousedown","mouseup","selectionchange"];for(let o of this._events)this._listeners.add(t,o,this._eventHandler);i(1)}disconnect(){this._listeners.removeAll(),this._cancelPendingCallback()}_cancelPendingCallback(){this._pendingCallback&&(clearTimeout(this._pendingCallback),this._pendingCallback=null)}}},{"../shared/listener-collection":88}],67:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e,t){const n=e.querySelectorAll("[data-hypothesis-trigger]");function o(e){t(),e.stopPropagation()}Array.from(n).forEach((e=>{e.addEventListener("click",o)}))}},{}],68:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.MIN_RESIZE=void 0;var o=f(e("hammerjs")),i=f(e("../shared/bridge-events")),r=e("../shared/listener-collection"),s=f(e("./annotation-counts")),a=f(e("./bucket-bar")),l=e("./config/sidebar"),c=f(e("./features")),u=f(e("./sidebar-trigger")),h=e("./toolbar"),d=e("./util/shadow-root");function f(e){return e&&e.__esModule?e:{default:e}}n.MIN_RESIZE=280;n.default=class{constructor(e,t,n,o={}){if(this._emitter=t.createEmitter(),this.iframe=function(e){const t=(0,l.createSidebarConfig)(e),n="config="+encodeURIComponent(JSON.stringify(t)),o=e.sidebarAppUrl+"#"+n,i=document.createElement("iframe");return i.setAttribute("allowfullscreen",""),i.src=o,i.title="Hypothesis annotation viewer",i.className="h-sidebar-iframe",i}(o),this.options=o,this.bucketBar=null,o.externalContainerSelector){var i;this.externalFrame=null!==(i=document.querySelector(o.externalContainerSelector))&&void 0!==i?i:e,this.externalFrame.appendChild(this.iframe)}else{if(this.iframeContainer=document.createElement("div"),this.iframeContainer.style.display="none",this.iframeContainer.className="annotator-frame","clean"===o.theme)this.iframeContainer.classList.add("annotator-frame--theme-clean");else{const e=new a.default(this.iframeContainer,n,{contentContainer:n.contentContainer()});this._emitter.subscribe("anchorsChanged",(()=>e.update())),this.bucketBar=e}this.iframeContainer.appendChild(this.iframe),this.hypothesisSidebar=document.createElement("hypothesis-sidebar"),(0,d.createShadowRoot)(this.hypothesisSidebar).appendChild(this.iframeContainer),e.appendChild(this.hypothesisSidebar)}this.guest=n,this._listeners=new r.ListenerCollection,this._emitter.subscribe("panelReady",(()=>{this.iframeContainer&&(this.iframeContainer.style.display="")})),this._emitter.subscribe("beforeAnnotationCreated",(e=>{e.$highlight||this.iframe.contentWindow.focus()})),(o.openSidebar||o.annotations||o.query||o.group)&&this._emitter.subscribe("panelReady",(()=>this.open()));const s=document.createElement("div");this.toolbar=new h.ToolbarController(s,{createAnnotation:()=>n.createAnnotation(),setSidebarOpen:e=>e?this.open():this.close(),setHighlightsVisible:e=>this.setAllVisibleHighlights(e)}),"clean"===o.theme?this.toolbar.useMinimalControls=!0:this.toolbar.useMinimalControls=!1,this._emitter.subscribe("highlightsVisibleChanged",(e=>{this.toolbar.highlightsVisible=e})),this._emitter.subscribe("hasSelectionChanged",(e=>{this.toolbar.newAnnotationType=e?"annotation":"note"})),this.iframeContainer?(this.iframeContainer.prepend(s),this.toolbarWidth=this.toolbar.getWidth()):this.toolbarWidth=0,this._listeners.add(window,"resize",(()=>this._onResize())),this._gestureState={initial:null,final:null},this._setupGestures(),this.close();const[c]=o.services||[];c&&(this.onLoginRequest=c.onLoginRequest,this.onLogoutRequest=c.onLogoutRequest,this.onSignupRequest=c.onSignupRequest,this.onProfileRequest=c.onProfileRequest,this.onHelpRequest=c.onHelpRequest),this.onLayoutChange=o.onLayoutChange,this._notifyOfLayoutChange(!1),this._setupSidebarEvents(),this.ready=new Promise((e=>{this._listeners.add(window,"message",(t=>{const n=t.data;"hypothesisSidebarReady"===(null==n?void 0:n.type)&&e()}))}))}destroy(){var e,t;null===(e=this.bucketBar)||void 0===e||e.destroy(),this._listeners.removeAll(),null===(t=this._hammerManager)||void 0===t||t.destroy(),this.hypothesisSidebar?this.hypothesisSidebar.remove():this.iframe.remove(),this._emitter.destroy()}_setupSidebarEvents(){(0,s.default)(document.body,this.guest.crossframe),(0,u.default)(document.body,(()=>this.open())),c.default.init(this.guest.crossframe),this.guest.crossframe.on("openSidebar",(()=>this.open())),this.guest.crossframe.on("closeSidebar",(()=>this.close())),this.guest.crossframe.on("openNotebook",(e=>{this.hide(),this._emitter.publish("openNotebook",e)})),this._emitter.subscribe("closeNotebook",(()=>{this.show()})),[[i.default.LOGIN_REQUESTED,this.onLoginRequest],[i.default.LOGOUT_REQUESTED,this.onLogoutRequest],[i.default.SIGNUP_REQUESTED,this.onSignupRequest],[i.default.PROFILE_REQUESTED,this.onProfileRequest],[i.default.HELP_REQUESTED,this.onHelpRequest]].forEach((([e,t])=>{t&&this.guest.crossframe.on(e,(()=>t()))}))}_resetGestureState(){this._gestureState={initial:null,final:null}}_setupGestures(){const e=this.toolbar.sidebarToggleButton;e&&(this._hammerManager=new o.default.Manager(e).on("panstart panend panleft panright",(e=>this._onPan(e))),this._hammerManager.add(new o.default.Pan({direction:o.default.DIRECTION_HORIZONTAL})))}_updateLayout(){this.renderFrame||(this.renderFrame=requestAnimationFrame((()=>{if(this.renderFrame=null,this._gestureState.final!==this._gestureState.initial&&this.iframeContainer){const e=this._gestureState.final,t=-e;this.iframeContainer.style.marginLeft=`${e}px`,t>=280&&(this.iframeContainer.style.width=`${t}px`),this._notifyOfLayoutChange()}})))}_notifyOfLayoutChange(e){var t;const n=this.iframeContainer&&this.toolbar.getWidth()||0,o=null!==(t=this.iframeContainer)&&void 0!==t?t:this.externalFrame,i=o.getBoundingClientRect(),r=window.getComputedStyle(o),s=parseInt(r.width),a=parseInt(r.marginLeft);let l=n;"boolean"==typeof e?e&&(l+=s):(a<280?l-=a:l+=s,e=l>n);const c={expanded:e,width:e?l:n,height:i.height,toolbarWidth:n};this.onLayoutChange&&this.onLayoutChange(c),this.guest.fitSideBySide(c),this._emitter.publish("sidebarLayoutChanged",c)}_onResize(){!0===this.toolbar.sidebarOpen&&(window.innerWidth<280?this.close():this.open())}_onPan(e){const t=this.iframeContainer;if(t)switch(e.type){case"panstart":this._resetGestureState(),t.classList.add("annotator-no-transition"),t.style.pointerEvents="none",this._gestureState.initial=parseInt(getComputedStyle(t).marginLeft);break;case"panend":t.classList.remove("annotator-no-transition"),t.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 t=this._gestureState.initial,n=e.deltaX;this._gestureState.final=Math.min(Math.round(t+n),0),this._updateLayout();break}}}open(){if(this.guest.crossframe.call("sidebarOpened"),this._emitter.publish("sidebarOpened"),this.iframeContainer){const e=this.iframeContainer.getBoundingClientRect().width;this.iframeContainer.style.marginLeft=-1*e+"px",this.iframeContainer.classList.remove("annotator-collapsed")}this.toolbar.sidebarOpen=!0,"whenSidebarOpen"===this.options.showHighlights&&this.guest.setVisibleHighlights(!0),this._notifyOfLayoutChange(!0)}close(){this.iframeContainer&&(this.iframeContainer.style.marginLeft="",this.iframeContainer.classList.add("annotator-collapsed")),this.toolbar.sidebarOpen=!1,"whenSidebarOpen"===this.options.showHighlights&&this.guest.setVisibleHighlights(!1),this._notifyOfLayoutChange(!1)}setAllVisibleHighlights(e){this.guest.crossframe.call("setVisibleHighlights",e)}show(){this.iframeContainer&&this.iframeContainer.classList.remove("is-hidden")}hide(){this.iframeContainer&&this.iframeContainer.classList.add("is-hidden")}}},{"../shared/bridge-events":86,"../shared/listener-collection":88,"./annotation-counts":38,"./bucket-bar":40,"./config/sidebar":50,"./features":53,"./sidebar-trigger":67,"./toolbar":69,"./util/shadow-root":73,hammerjs:22}],69:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ToolbarController=void 0;var o,i=e("preact"),r=(o=e("./components/Toolbar"))&&o.__esModule?o:{default:o},s=e("preact/jsx-runtime");n.ToolbarController=class{constructor(e,t){const{createAnnotation:n,setSidebarOpen:o,setHighlightsVisible:r}=t;this._container=e,this._useMinimalControls=!1,this._newAnnotationType="note",this._highlightsVisible=!1,this._sidebarOpen=!1,this._closeSidebar=()=>o(!1),this._toggleSidebar=()=>o(!this._sidebarOpen),this._toggleHighlights=()=>r(!this._highlightsVisible),this._createAnnotation=()=>{n(),o(!0)},this._sidebarToggleButton=(0,i.createRef)(),this.render()}getWidth(){return this._container.firstChild.getBoundingClientRect().width}set useMinimalControls(e){this._useMinimalControls=e,this.render()}get useMinimalControls(){return this._useMinimalControls}set sidebarOpen(e){this._sidebarOpen=e,this.render()}get sidebarOpen(){return this._sidebarOpen}set newAnnotationType(e){this._newAnnotationType=e,this.render()}get newAnnotationType(){return this._newAnnotationType}set highlightsVisible(e){this._highlightsVisible=e,this.render()}get highlightsVisible(){return this._highlightsVisible}get sidebarToggleButton(){return this._sidebarToggleButton.current}render(){(0,i.render)((0,s.jsx)(r.default,{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)}}},{"./components/Toolbar":44,preact:25,"preact/jsx-runtime":27}],70:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.findClosestOffscreenAnchor=function(e,t){let n=null,i=0;for(let s of e){var r;if(null===(r=s.highlights)||void 0===r||!r.length)continue;const e=(0,o.getBoundingClientRect)(s.highlights).top;"up"===t&&e>=137||"down"===t&&e<=window.innerHeight-22||(!n||"up"===t&&e>i||"down"===t&&e<i)&&(n=s,i=e)}return n},n.anchorBuckets=function(e){const t=function(e){const t=[];return e.forEach((e=>{var n;if(null===(n=e.highlights)||void 0===n||!n.length)return;const i=(0,o.getBoundingClientRect)(e.highlights);i.top>=i.bottom||t.push({top:i.top,bottom:i.bottom,anchor:e})})),t.sort(((e,t)=>e.top<t.top?-1:1)),t}(e),n=new Set,i=new Set,r=[];let s=null;function a(e){const t=e.bottom-e.top,n=e.top+t/2;return{anchors:[e.anchor],top:e.top,bottom:e.bottom,position:n}}return t.forEach((e=>{if(e.top<137)return void n.add(e.anchor);if(e.top>window.innerHeight-22)return void i.add(e.anchor);if(!s)return void(s=a(e));const t=e.top>s.top&&e.bottom<s.bottom;if(e.top-s.bottom>60&&!t)r.push(s),s=a(e);else{const t=e.bottom>s.bottom?e.bottom:s.bottom,n=t-s.top;s.anchors.push(e.anchor),s.bottom=t,s.position=s.top+n/2}})),s&&r.push(s),{above:{anchors:Array.from(n),position:137},below:{anchors:Array.from(i),position:window.innerHeight-22},buckets:r}};var o=e("../highlighter")},{"../highlighter":56}],71:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.EventBus=void 0;var o=e("tiny-emitter");class i{constructor(e){this._emitter=e,this._subscriptions=[]}publish(e,...t){this._emitter.emit(e,...t)}subscribe(e,t){this._emitter.on(e,t),this._subscriptions.push([e,t])}unsubscribe(e,t){this._emitter.off(e,t),this._subscriptions=this._subscriptions.filter((([n,o])=>n!==e||o!==t))}destroy(){for(let[e,t]of this._subscriptions)this._emitter.off(e,t);this._subscriptions=[]}}n.EventBus=class{constructor(){this._emitter=new o.TinyEmitter}createEmitter(){return new i(this._emitter)}}},{"tiny-emitter":29}],72:[function(e,t,n){"use strict";function o(e,t,n){return e+n*(t-e)}Object.defineProperty(n,"__esModule",{value:!0}),n.offsetRelativeTo=function(e,t){let n=0;for(;e!==t&&t.contains(e);)n+=e.offsetTop,e=e.offsetParent;return n},n.scrollElement=async function(e,t,{maxDuration:n=500}={}){const i=e.scrollTop,r=t,s=Date.now(),a=Math.min(Math.abs(r-i)/3,n);let l=0;for(;l<1;)await new Promise((e=>{requestAnimationFrame(e)})),l=Math.min(1,(Date.now()-s)/a),e.scrollTop=o(i,r,l)}},{}],73:[function(e,t,n){"use strict";function o(e){e.addEventListener("mouseup",(e=>e.stopPropagation())),e.addEventListener("mousedown",(e=>e.stopPropagation())),e.addEventListener("touchstart",(e=>e.stopPropagation()),{passive:!0})}Object.defineProperty(n,"__esModule",{value:!0}),n.createShadowRoot=function(e){if(!e.attachShadow)return o(e),e;const t=e.attachShadow({mode:"open"});!function(e){var t;const n=null===(t=document.querySelector('link[rel="stylesheet"][href*="/build/styles/annotator.css"]'))||void 0===t?void 0:t.href;if(!n)return;const o=document.createElement("link");o.rel="stylesheet",o.href=n,e.appendChild(o)}(t);const n=window.applyFocusVisiblePolyfill;return n&&n(t),o(t),t}},{}],74:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.normalizeURI=function(e,t=document.baseURI){return new URL(e,t).href.toString().replace(/#.*/,"")}},{}],75:[function(e,t,n){"use strict";function o(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}Object.defineProperty(n,"__esModule",{value:!0}),n.parseJsonConfig=function(e){for(var t={},n=e.querySelectorAll("script.js-hypothesis-config"),i=0;i<n.length;i++){var r=void 0;try{r=JSON.parse(n[i].textContent||"")}catch(s){console.warn("Could not parse settings from js-hypothesis-config tags",s),r={}}o(t,r)}return t}},{}],76:[function(e,t,n){t.exports='<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'},{}],77:[function(e,t,n){arguments[4][1][0].apply(n,arguments)},{dup:1}],78:[function(e,t,n){t.exports='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><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>\n'},{}],79:[function(e,t,n){t.exports='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false" class="Icon Icon--caret-right"><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>\n'},{}],80:[function(e,t,n){t.exports='<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" class="feather feather-alert-triangle"><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>'},{}],81:[function(e,t,n){t.exports='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><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.73 12.973A9.89 9.89 0 0 1 8 13c-3.866 0-7-2.239-7-5 0-.753.233-1.467.65-2.107m5.62-2.866A9.89 9.89 0 0 1 8 3c3.866 0 7 2.239 7 5 0 .753-.233 1.467-.65 2.107M1 1l14 14L1 1z"></path></g></svg>\n'},{}],82:[function(e,t,n){t.exports='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><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>\n'},{}],83:[function(e,t,n){t.exports='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><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="M1 15h6l8-6V1H1v14zm6-1V9h7"></path></g></svg>\n'},{}],84:[function(e,t,n){t.exports='<svg xmlns="http://www.w3.org/2000/svg" width="15" height="8" viewBox="0 0 15 8" aria-hidden="true" focusable="false"><path d="M0 8 L7 0 L15 8" stroke="currentColor" strokeWidth="2" /></svg>\n'},{}],85:[function(e,t,n){t.exports='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><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 13c3.866 0 7-2.239 7-5s-3.134-5-7-5-7 2.239-7 5 3.134 5 7 5zm0-4a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"></path></g></svg>\n'},{}],86:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default={FEATURE_FLAGS_UPDATED:"featureFlagsUpdated",HELP_REQUESTED:"helpRequested",LOGIN_REQUESTED:"loginRequested",LOGOUT_REQUESTED:"logoutRequested",PROFILE_REQUESTED:"profileRequested",PUBLIC_ANNOTATION_COUNT_CHANGED:"publicAnnotationCountChanged",SIGNUP_REQUESTED:"signupRequested"}},{}],87:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Bridge=void 0;var o=e("./port-rpc");n.Bridge=class{constructor(){this.links=[],this.channelListeners={},this.onConnectListeners=[],this.on("connect",(e=>e()))}destroy(){this.links.forEach((e=>e.destroy())),this.links=[]}createChannel(e){const t=new o.PortRPC(e,this.channelListeners);let n=!1;return t.call("connect",(()=>{n||(n=!0,this.onConnectListeners.forEach((e=>e(t))))})),this.links.push(t),t}call(e,...t){let n;const o=t[t.length-1];"function"==typeof o&&(n=o,t=t.slice(0,-1));const i=e=>t=>{throw e.destroy(),this.links=this.links.filter((t=>t!==e)),t},r=this.links.map((n=>new Promise(((o,i)=>{const r=setTimeout((()=>o(null)),1e3);try{n.call(e,...t,((e,t)=>{clearTimeout(r),e?i(e):o(t)}))}catch(s){i(s)}})).catch(i(n))));let s=Promise.all(r);return n&&(s=s.then((e=>n(null,e))).catch((e=>n(e)))),s}on(e,t){if(this.links.length>0)throw new Error(`Listener '${e}' can't be registered because a channel has already been created`);if(this.channelListeners[e])throw new Error(`Listener '${e}' already bound in Bridge`);return this.channelListeners[e]=t,this}onConnect(e){return this.onConnectListeners.push(e),this}}},{"./port-rpc":89}],88:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ListenerCollection=void 0;n.ListenerCollection=class{constructor(){this._listeners=[]}add(e,t,n,o){e.addEventListener(t,n,o),this._listeners.push({eventTarget:e,eventType:t,listener:n})}removeAll(){this._listeners.forEach((({eventTarget:e,eventType:t,listener:n})=>{e.removeEventListener(t,n)})),this._listeners=[]}}},{}],89:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.PortRPC=void 0;var o=e("./listener-collection");const i="frame-rpc";n.PortRPC=class{constructor(e,t){this._port=e,this._methods=t,this._sequence=0,this._callbacks={},this._destroyed=!1,this._listeners=new o.ListenerCollection,this._listeners.add(this._port,"message",(e=>this._handle(e))),this._port.start()}destroy(){this._destroyed=!0,this._listeners.removeAll(),this._port.close()}call(e,...t){if(this._destroyed)return;const n=this._sequence++,o=t[t.length-1];"function"==typeof o&&(this._callbacks[n]=o,t=t.slice(0,-1));const r={arguments:t,method:e,protocol:i,sequence:n,version:"1.0.0"};this._port.postMessage(r)}_parseMessage({data:e}){return e&&"object"==typeof e?e.protocol!==i||"1.0.0"!==e.version?null:Array.isArray(e.arguments)?e:null:null}_handle(e){const t=this._parseMessage(e);if(null!==t)if("method"in t){if(!this._methods.hasOwnProperty(t.method))return;const e=(...e)=>{const n={arguments:e,protocol:i,response:t.sequence,version:"1.0.0"};this._port.postMessage(n)};this._methods[t.method](...t.arguments,e)}else if("response"in t){const e=this._callbacks[t.response];delete this._callbacks[t.response],e&&e(...t.arguments)}}}},{"./listener-collection":88}],90:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.matchShortcut=s,n.installShortcut=a,n.useShortcut=function(e,t,{rootElement:n=document.body}={}){(0,i.useEffect)((()=>{if(e)return a(e,t,{rootElement:n})}),[e,t,n])};var o=e("@hypothesis/frontend-shared"),i=e("preact/hooks");const r={alt:1,ctrl:2,meta:4,shift:8};function s(e,t){const n=t.split("+").map((e=>e.toLowerCase()));let i=0,s=null;for(let o of n){const e=r[o];if(e)i|=e;else{if(null!==s)throw new Error("Multiple non-modifier keys specified");s=o}}if(!s)throw new Error(`Invalid shortcut: ${t}`);return((e.ctrlKey?r.ctrl:0)|(e.metaKey?r.meta:0)|(e.altKey?r.alt:0)|(e.shiftKey?r.shift:0))===i&&(0,o.normalizeKeyName)(e.key).toLowerCase()===s}function a(e,t,{rootElement:n=document.body}={}){const o=n=>{s(n,e)&&t(n)};return n.addEventListener("keydown",o),()=>n.removeEventListener("keydown",o)}},{"@hypothesis/frontend-shared":17,"preact/hooks":26}],91:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.toBoolean=function(e){if("string"==typeof e&&"false"===e.trim().toLocaleLowerCase())return!1;const t=Number(e);return isNaN(t)?"string"==typeof e:Boolean(t)},n.toInteger=function(e){return parseInt(e)},n.toObject=function(e){return"object"==typeof e&&null!==e?e:{}},n.toString=function(e){return e&&"function"==typeof e.toString?e.toString():""}},{}],92:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isTouchDevice=n.isIOS=n.isMacOS=void 0;n.isMacOS=(e=window.navigator.userAgent)=>e.indexOf("Mac OS")>=0;n.isIOS=(e=window.navigator,t="ontouchend"in document)=>["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(e.platform)||e.userAgent.includes("Mac")&&t;n.isTouchDevice=(e=window)=>e.matchMedia("(pointer: coarse)").matches},{}],93:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=i;let o={};function i(...e){const t=e.join();t in o||(console.warn(...e),o[t]=!0)}i.reset=()=>{o={}}},{}]},{},[59]);
|
|
13
|
+
!function(n,o,i,r){"use strict";var s,a=["","webkit","Moz","MS","ms","o"],l=o.createElement("div"),c=Math.round,u=Math.abs,h=Date.now;function d(e,t,n){return setTimeout(b(e,n),t)}function f(e,t,n){return!!Array.isArray(e)&&(p(e,n[t],n),!0)}function p(e,t,n){var o;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==r)for(o=0;o<e.length;)t.call(n,e[o],o,e),o++;else for(o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o,e)}function m(e,t,o){var i="DEPRECATED METHOD: "+t+"\n"+o+" AT \n";return function(){var t=new Error("get-stack-trace"),o=t&&t.stack?t.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",r=n.console&&(n.console.warn||n.console.log);return r&&r.call(n.console,i,o),e.apply(this,arguments)}}s="function"!=typeof Object.assign?function(e){if(e===r||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var o=arguments[n];if(o!==r&&null!==o)for(var i in o)o.hasOwnProperty(i)&&(t[i]=o[i])}return t}:Object.assign;var g=m((function(e,t,n){for(var o=Object.keys(t),i=0;i<o.length;)(!n||n&&e[o[i]]===r)&&(e[o[i]]=t[o[i]]),i++;return e}),"extend","Use `assign`."),_=m((function(e,t){return g(e,t,!0)}),"merge","Use `assign`.");function v(e,t,n){var o,i=t.prototype;(o=e.prototype=Object.create(i)).constructor=e,o._super=i,n&&s(o,n)}function b(e,t){return function(){return e.apply(t,arguments)}}function y(e,t){return"function"==typeof e?e.apply(t&&t[0]||r,t):e}function w(e,t){return e===r?t:e}function x(e,t,n){p(S(t),(function(t){e.addEventListener(t,n,!1)}))}function E(e,t,n){p(S(t),(function(t){e.removeEventListener(t,n,!1)}))}function N(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function C(e,t){return e.indexOf(t)>-1}function S(e){return e.trim().split(/\s+/g)}function T(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var o=0;o<e.length;){if(n&&e[o][n]==t||!n&&e[o]===t)return o;o++}return-1}function O(e){return Array.prototype.slice.call(e,0)}function k(e,t,n){for(var o=[],i=[],r=0;r<e.length;){var s=t?e[r][t]:e[r];T(i,s)<0&&o.push(e[r]),i[r]=s,r++}return n&&(o=t?o.sort((function(e,n){return e[t]>n[t]})):o.sort()),o}function j(e,t){for(var n,o,i=t[0].toUpperCase()+t.slice(1),s=0;s<a.length;){if((o=(n=a[s])?n+i:t)in e)return o;s++}return r}var P=1;function A(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||n}var M="ontouchstart"in n,R=j(n,"PointerEvent")!==r,D=M&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),I="touch",L="mouse",H=["x","y"],V=["clientX","clientY"];function F(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){y(e.options.enable,[e])&&n.handler(t)},this.init()}function B(e,t,n){var o=n.pointers.length,i=n.changedPointers.length,s=1&t&&o-i==0,a=12&t&&o-i==0;n.isFirst=!!s,n.isFinal=!!a,s&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,o=t.pointers,i=o.length;n.firstInput||(n.firstInput=U(t)),i>1&&!n.firstMultiple?n.firstMultiple=U(t):1===i&&(n.firstMultiple=!1);var s=n.firstInput,a=n.firstMultiple,l=a?a.center:s.center,c=t.center=q(o);t.timeStamp=h(),t.deltaTime=t.timeStamp-s.timeStamp,t.angle=X(l,c),t.distance=z(l,c),function(e,t){var n=t.center,o=e.offsetDelta||{},i=e.prevDelta||{},r=e.prevInput||{};1!==t.eventType&&4!==r.eventType||(i=e.prevDelta={x:r.deltaX||0,y:r.deltaY||0},o=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=i.x+(n.x-o.x),t.deltaY=i.y+(n.y-o.y)}(n,t),t.offsetDirection=$(t.deltaX,t.deltaY);var d,f,p=W(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=p.x,t.overallVelocityY=p.y,t.overallVelocity=u(p.x)>u(p.y)?p.x:p.y,t.scale=a?(d=a.pointers,z((f=o)[0],f[1],V)/z(d[0],d[1],V)):1,t.rotation=a?function(e,t){return X(t[1],t[0],V)+X(e[1],e[0],V)}(a.pointers,o):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,o,i,s,a=e.lastInterval||t,l=t.timeStamp-a.timeStamp;if(8!=t.eventType&&(l>25||a.velocity===r)){var c=t.deltaX-a.deltaX,h=t.deltaY-a.deltaY,d=W(l,c,h);o=d.x,i=d.y,n=u(d.x)>u(d.y)?d.x:d.y,s=$(c,h),e.lastInterval=t}else n=a.velocity,o=a.velocityX,i=a.velocityY,s=a.direction;t.velocity=n,t.velocityX=o,t.velocityY=i,t.direction=s}(n,t);var m=e.element;N(t.srcEvent.target,m)&&(m=t.srcEvent.target),t.target=m}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function U(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:c(e.pointers[n].clientX),clientY:c(e.pointers[n].clientY)},n++;return{timeStamp:h(),pointers:t,center:q(t),deltaX:e.deltaX,deltaY:e.deltaY}}function q(e){var t=e.length;if(1===t)return{x:c(e[0].clientX),y:c(e[0].clientY)};for(var n=0,o=0,i=0;i<t;)n+=e[i].clientX,o+=e[i].clientY,i++;return{x:c(n/t),y:c(o/t)}}function W(e,t,n){return{x:t/e||0,y:n/e||0}}function $(e,t){return e===t?1:u(e)>=u(t)?e<0?2:4:t<0?8:16}function z(e,t,n){n||(n=H);var o=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(o*o+i*i)}function X(e,t,n){n||(n=H);var o=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,o)/Math.PI}F.prototype={handler:function(){},init:function(){this.evEl&&x(this.element,this.evEl,this.domHandler),this.evTarget&&x(this.target,this.evTarget,this.domHandler),this.evWin&&x(A(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(A(this.element),this.evWin,this.domHandler)}};var Y={mousedown:1,mousemove:2,mouseup:4},G="mousedown",Q="mousemove mouseup";function K(){this.evEl=G,this.evWin=Q,this.pressed=!1,F.apply(this,arguments)}v(K,F,{handler:function(e){var t=Y[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:L,srcEvent:e}))}});var Z={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},J={2:I,3:"pen",4:L,5:"kinect"},ee="pointerdown",te="pointermove pointerup pointercancel";function ne(){this.evEl=ee,this.evWin=te,F.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}n.MSPointerEvent&&!n.PointerEvent&&(ee="MSPointerDown",te="MSPointerMove MSPointerUp MSPointerCancel"),v(ne,F,{handler:function(e){var t=this.store,n=!1,o=e.type.toLowerCase().replace("ms",""),i=Z[o],r=J[e.pointerType]||e.pointerType,s=r==I,a=T(t,e.pointerId,"pointerId");1&i&&(0===e.button||s)?a<0&&(t.push(e),a=t.length-1):12&i&&(n=!0),a<0||(t[a]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:r,srcEvent:e}),n&&t.splice(a,1))}});var oe={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ie="touchstart",re="touchstart touchmove touchend touchcancel";function se(){this.evTarget=ie,this.evWin=re,this.started=!1,F.apply(this,arguments)}function ae(e,t){var n=O(e.touches),o=O(e.changedTouches);return 12&t&&(n=k(n.concat(o),"identifier",!0)),[n,o]}v(se,F,{handler:function(e){var t=oe[e.type];if(1===t&&(this.started=!0),this.started){var n=ae.call(this,e,t);12&t&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:I,srcEvent:e})}}});var le={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ce="touchstart touchmove touchend touchcancel";function ue(){this.evTarget=ce,this.targetIds={},F.apply(this,arguments)}function he(e,t){var n=O(e.touches),o=this.targetIds;if(3&t&&1===n.length)return o[n[0].identifier]=!0,[n,n];var i,r,s=O(e.changedTouches),a=[],l=this.target;if(r=n.filter((function(e){return N(e.target,l)})),1===t)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&t&&delete o[s[i].identifier],i++;return a.length?[k(r.concat(a),"identifier",!0),a]:void 0}function de(){F.apply(this,arguments);var e=b(this.handler,this);this.touch=new ue(this.manager,e),this.mouse=new K(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function fe(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,pe.call(this,t)):12&e&&pe.call(this,t)}function pe(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var o=this.lastTouches;setTimeout((function(){var e=o.indexOf(n);e>-1&&o.splice(e,1)}),2500)}}function me(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,o=0;o<this.lastTouches.length;o++){var i=this.lastTouches[o],r=Math.abs(t-i.x),s=Math.abs(n-i.y);if(r<=25&&s<=25)return!0}return!1}v(ue,F,{handler:function(e){var t=le[e.type],n=he.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:I,srcEvent:e})}}),v(de,F,{handler:function(e,t,n){var o=n.pointerType==I,i=n.pointerType==L;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(o)fe.call(this,t,n);else if(i&&me.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var ge=j(l.style,"touchAction"),_e=ge!==r,ve="compute",be="auto",ye="manipulation",we="none",xe="pan-x",Ee="pan-y",Ne=function(){if(!_e)return!1;var e={},t=n.CSS&&n.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(o){e[o]=!t||n.CSS.supports("touch-action",o)})),e}();function Ce(e,t){this.manager=e,this.set(t)}Ce.prototype={set:function(e){e==ve&&(e=this.compute()),_e&&this.manager.element.style&&Ne[e]&&(this.manager.element.style[ge]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return p(this.manager.recognizers,(function(t){y(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(C(e,we))return we;var t=C(e,xe),n=C(e,Ee);return t&&n?we:t||n?t?xe:Ee:C(e,ye)?ye:be}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var o=this.actions,i=C(o,we)&&!Ne.none,r=C(o,Ee)&&!Ne["pan-y"],s=C(o,xe)&&!Ne["pan-x"];if(i){var a=1===e.pointers.length,l=e.distance<2,c=e.deltaTime<250;if(a&&l&&c)return}if(!s||!r)return i||r&&6&n||s&&24&n?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var Se=32;function Te(e){this.options=s({},this.defaults,e||{}),this.id=P++,this.manager=null,this.options.enable=w(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function Oe(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function ke(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function je(e,t){var n=t.manager;return n?n.get(e):e}function Pe(){Te.apply(this,arguments)}function Ae(){Pe.apply(this,arguments),this.pX=null,this.pY=null}function Me(){Pe.apply(this,arguments)}function Re(){Te.apply(this,arguments),this._timer=null,this._input=null}function De(){Pe.apply(this,arguments)}function Ie(){Pe.apply(this,arguments)}function Le(){Te.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function He(e,t){return(t=t||{}).recognizers=w(t.recognizers,He.defaults.preset),new Ve(e,t)}function Ve(e,t){this.options=s({},He.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new(this.options.inputClass||(R?ne:D?ue:M?de:K))(this,B),this.touchAction=new Ce(this,this.options.touchAction),Fe(this,!0),p(this.options.recognizers,(function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}function Fe(e,t){var n,o=e.element;o.style&&(p(e.options.cssProps,(function(i,r){n=j(o.style,r),t?(e.oldCssProps[n]=o.style[n],o.style[n]=i):o.style[n]=e.oldCssProps[n]||""})),t||(e.oldCssProps={}))}Te.prototype={defaults:{},set:function(e){return s(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(f(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=je(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return f(e,"dropRecognizeWith",this)||(e=je(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(f(e,"requireFailure",this))return this;var t=this.requireFail;return-1===T(t,e=je(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(f(e,"dropRequireFailure",this))return this;e=je(e,this);var t=T(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function o(n){t.manager.emit(n,e)}n<8&&o(t.options.event+Oe(n)),o(t.options.event),e.additionalEvent&&o(e.additionalEvent),n>=8&&o(t.options.event+Oe(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=Se},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},recognize:function(e){var t=s({},e);if(!y(this.options.enable,[this,t]))return this.reset(),void(this.state=Se);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},v(Pe,Te,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,o=6&t,i=this.attrTest(e);return o&&(8&n||!i)?16|t:o||i?4&n?8|t:2&t?4|t:2:Se}}),v(Ae,Pe,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push(Ee),24&e&&t.push(xe),t},directionTest:function(e){var t=this.options,n=!0,o=e.distance,i=e.direction,r=e.deltaX,s=e.deltaY;return i&t.direction||(6&t.direction?(i=0===r?1:r<0?2:4,n=r!=this.pX,o=Math.abs(e.deltaX)):(i=0===s?1:s<0?8:16,n=s!=this.pY,o=Math.abs(e.deltaY))),e.direction=i,n&&o>t.threshold&&i&t.direction},attrTest:function(e){return Pe.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=ke(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),v(Me,Pe,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[we]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),v(Re,Te,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[be]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,o=e.distance<t.threshold,i=e.deltaTime>t.time;if(this._input=e,!o||!n||12&e.eventType&&!i)this.reset();else if(1&e.eventType)this.reset(),this._timer=d((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return Se},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=h(),this.manager.emit(this.options.event,this._input)))}}),v(De,Pe,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[we]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),v(Ie,Pe,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Ae.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return 30&n?t=e.overallVelocity:6&n?t=e.overallVelocityX:24&n&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&u(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=ke(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),v(Le,Te,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ye]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,o=e.distance<t.threshold,i=e.deltaTime<t.time;if(this.reset(),1&e.eventType&&0===this.count)return this.failTimeout();if(o&&i&&n){if(4!=e.eventType)return this.failTimeout();var r=!this.pTime||e.timeStamp-this.pTime<t.interval,s=!this.pCenter||z(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,s&&r?this.count+=1:this.count=1,this._input=e,0==this.count%t.taps)return this.hasRequireFailures()?(this._timer=d((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return Se},failTimeout:function(){return this._timer=d((function(){this.state=Se}),this.options.interval,this),Se},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),He.VERSION="2.0.7",He.defaults={domEvents:!1,touchAction:ve,enable:!0,inputTarget:null,inputClass:null,preset:[[De,{enable:!1}],[Me,{enable:!1},["rotate"]],[Ie,{direction:6}],[Ae,{direction:6},["swipe"]],[Le],[Le,{event:"doubletap",taps:2},["tap"]],[Re]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Ve.prototype={set:function(e){return s(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var n;this.touchAction.preventDefaults(e);var o=this.recognizers,i=t.curRecognizer;(!i||i&&8&i.state)&&(i=t.curRecognizer=null);for(var r=0;r<o.length;)n=o[r],2===t.stopped||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(e),!i&&14&n.state&&(i=t.curRecognizer=n),r++}},get:function(e){if(e instanceof Te)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(f(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(f(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=T(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==r&&t!==r){var n=this.handlers;return p(S(e),(function(e){n[e]=n[e]||[],n[e].push(t)})),this}},off:function(e,t){if(e!==r){var n=this.handlers;return p(S(e),(function(e){t?n[e]&&n[e].splice(T(n[e],t),1):delete n[e]})),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var n=o.createEvent("Event");n.initEvent(e,!0,!0),n.gesture=t,t.target.dispatchEvent(n)}(e,t);var n=this.handlers[e]&&this.handlers[e].slice();if(n&&n.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var i=0;i<n.length;)n[i](t),i++}},destroy:function(){this.element&&Fe(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},s(He,{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:Se,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:24,DIRECTION_ALL:30,Manager:Ve,Input:F,TouchAction:Ce,TouchInput:ue,MouseInput:K,PointerEventInput:ne,TouchMouseInput:de,SingleTouchInput:se,Recognizer:Te,AttrRecognizer:Pe,Tap:Le,Pan:Ae,Swipe:Ie,Pinch:Me,Rotate:De,Press:Re,on:x,off:E,each:p,merge:_,extend:g,assign:s,inherit:v,bindFn:b,prefixed:j}),(void 0!==n?n:"undefined"!=typeof self?self:{}).Hammer=He,"function"==typeof e&&e.amd?e((function(){return He})):void 0!==t&&t.exports?t.exports=He:n.Hammer=He}(window,document)}).call(this)}).call(this,void 0)},{}],23:[function(e,t,n){(function(e){(function(){var n=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,r=/^0o[0-7]+$/i,s=parseInt,a="object"==typeof e&&e&&e.Object===Object&&e,l="object"==typeof self&&self&&self.Object===Object&&self,c=a||l||Function("return this")(),u=Object.prototype.toString,h=Math.max,d=Math.min,f=function(){return c.Date.now()};function p(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function m(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==u.call(e)}(e))return NaN;if(p(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=p(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var a=i.test(e);return a||r.test(e)?s(e.slice(2),a?2:8):o.test(e)?NaN:+e}t.exports=function(e,t,n){var o,i,r,s,a,l,c=0,u=!1,g=!1,_=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(t){var n=o,r=i;return o=i=void 0,c=t,s=e.apply(r,n)}function b(e){return c=e,a=setTimeout(w,t),u?v(e):s}function y(e){var n=e-l;return void 0===l||n>=t||n<0||g&&e-c>=r}function w(){var e=f();if(y(e))return x(e);a=setTimeout(w,function(e){var n=t-(e-l);return g?d(n,r-(e-c)):n}(e))}function x(e){return a=void 0,_&&o?v(e):(o=i=void 0,s)}function E(){var e=f(),n=y(e);if(o=arguments,i=this,l=e,n){if(void 0===a)return b(l);if(g)return a=setTimeout(w,t),v(l)}return void 0===a&&(a=setTimeout(w,t)),s}return t=m(t)||0,p(n)&&(u=!!n.leading,r=(g="maxWait"in n)?h(m(n.maxWait)||0,t):r,_="trailing"in n?!!n.trailing:_),E.cancel=function(){void 0!==a&&clearTimeout(a),c=0,o=l=i=a=void 0},E.flush=function(){return void 0===a?s:x(f())},E}}).call(this)}).call(this,window)},{}],24:[function(e,t,n){t.exports=e("preact/jsx-runtime")},{"preact/jsx-runtime":27}],25:[function(e,t,n){var o,i,r,s,a,l,c={},u=[],h=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function d(e,t){for(var n in t)e[n]=t[n];return e}function f(e){var t=e.parentNode;t&&t.removeChild(e)}function p(e,t,n){var o,i,r,s=arguments,a={};for(r in t)"key"==r?o=t[r]:"ref"==r?i=t[r]:a[r]=t[r];if(arguments.length>3)for(n=[n],r=3;r<arguments.length;r++)n.push(s[r]);if(null!=n&&(a.children=n),"function"==typeof e&&null!=e.defaultProps)for(r in e.defaultProps)void 0===a[r]&&(a[r]=e.defaultProps[r]);return m(e,a,o,i,null)}function m(e,t,n,i,r){var s={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++o.__v:r};return null!=o.vnode&&o.vnode(s),s}function g(e){return e.children}function _(e,t){this.props=e,this.context=t}function v(e,t){if(null==t)return e.__?v(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?v(e):null}function b(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return b(e)}}function y(e){(!e.__d&&(e.__d=!0)&&r.push(e)&&!w.__r++||a!==o.debounceRendering)&&((a=o.debounceRendering)||s)(w)}function w(){for(var e;w.__r=r.length;)e=r.sort((function(e,t){return e.__v.__b-t.__v.__b})),r=[],e.some((function(e){var t,n,o,i,r,s;e.__d&&(r=(i=(t=e).__v).__e,(s=t.__P)&&(n=[],(o=d({},i)).__v=i.__v+1,k(s,i,o,t.__n,void 0!==s.ownerSVGElement,null!=i.__h?[r]:null,n,null==r?v(i):r,i.__h),j(n,i),i.__e!=r&&b(i)))}))}function x(e,t,n,o,i,r,s,a,l,h){var d,f,p,_,b,y,w,x=o&&o.__k||u,C=x.length;for(n.__k=[],d=0;d<t.length;d++)if(null!=(_=n.__k[d]=null==(_=t[d])||"boolean"==typeof _?null:"string"==typeof _||"number"==typeof _||"bigint"==typeof _?m(null,_,null,null,_):Array.isArray(_)?m(g,{children:_},null,null,null):_.__b>0?m(_.type,_.props,_.key,null,_.__v):_)){if(_.__=n,_.__b=n.__b+1,null===(p=x[d])||p&&_.key==p.key&&_.type===p.type)x[d]=void 0;else for(f=0;f<C;f++){if((p=x[f])&&_.key==p.key&&_.type===p.type){x[f]=void 0;break}p=null}k(e,_,p=p||c,i,r,s,a,l,h),b=_.__e,(f=_.ref)&&p.ref!=f&&(w||(w=[]),p.ref&&w.push(p.ref,null,_),w.push(f,_.__c||b,_)),null!=b?(null==y&&(y=b),"function"==typeof _.type&&null!=_.__k&&_.__k===p.__k?_.__d=l=E(_,l,e):l=N(e,_,p,x,b,l),h||"option"!==n.type?"function"==typeof n.type&&(n.__d=l):e.value=""):l&&p.__e==l&&l.parentNode!=e&&(l=v(p))}for(n.__e=y,d=C;d--;)null!=x[d]&&("function"==typeof n.type&&null!=x[d].__e&&x[d].__e==n.__d&&(n.__d=v(o,d+1)),M(x[d],x[d]));if(w)for(d=0;d<w.length;d++)A(w[d],w[++d],w[++d])}function E(e,t,n){var o,i;for(o=0;o<e.__k.length;o++)(i=e.__k[o])&&(i.__=e,t="function"==typeof i.type?E(i,t,n):N(n,i,i,e.__k,i.__e,t));return t}function N(e,t,n,o,i,r){var s,a,l;if(void 0!==t.__d)s=t.__d,t.__d=void 0;else if(null==n||i!=r||null==i.parentNode)e:if(null==r||r.parentNode!==e)e.appendChild(i),s=null;else{for(a=r,l=0;(a=a.nextSibling)&&l<o.length;l+=2)if(a==i)break e;e.insertBefore(i,r),s=r}return void 0!==s?s:i.nextSibling}function C(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||h.test(t)?n:n+"px"}function S(e,t,n,o,i){var r;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof o&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||C(e.style,t,"");if(n)for(t in n)o&&n[t]===o[t]||C(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])r=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+r]=n,n?o||e.addEventListener(t,r?O:T,r):e.removeEventListener(t,r?O:T,r);else if("dangerouslySetInnerHTML"!==t){if(i)t=t.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null!=n&&(!1!==n||"a"===t[0]&&"r"===t[1])?e.setAttribute(t,n):e.removeAttribute(t))}}function T(e){this.l[e.type+!1](o.event?o.event(e):e)}function O(e){this.l[e.type+!0](o.event?o.event(e):e)}function k(e,t,n,i,r,s,a,l,c){var u,h,f,p,m,v,b,y,w,E,N,C=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(c=n.__h,l=t.__e=n.__e,t.__h=null,s=[l]),(u=o.__b)&&u(t);try{e:if("function"==typeof C){if(y=t.props,w=(u=C.contextType)&&i[u.__c],E=u?w?w.props.value:u.__:i,n.__c?b=(h=t.__c=n.__c).__=h.__E:("prototype"in C&&C.prototype.render?t.__c=h=new C(y,E):(t.__c=h=new _(y,E),h.constructor=C,h.render=R),w&&w.sub(h),h.props=y,h.state||(h.state={}),h.context=E,h.__n=i,f=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=C.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=d({},h.__s)),d(h.__s,C.getDerivedStateFromProps(y,h.__s))),p=h.props,m=h.state,f)null==C.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==C.getDerivedStateFromProps&&y!==p&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(y,E),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(y,h.__s,E)||t.__v===n.__v){h.props=y,h.state=h.__s,t.__v!==n.__v&&(h.__d=!1),h.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),h.__h.length&&a.push(h);break e}null!=h.componentWillUpdate&&h.componentWillUpdate(y,h.__s,E),null!=h.componentDidUpdate&&h.__h.push((function(){h.componentDidUpdate(p,m,v)}))}h.context=E,h.props=y,h.state=h.__s,(u=o.__r)&&u(t),h.__d=!1,h.__v=t,h.__P=e,u=h.render(h.props,h.state,h.context),h.state=h.__s,null!=h.getChildContext&&(i=d(d({},i),h.getChildContext())),f||null==h.getSnapshotBeforeUpdate||(v=h.getSnapshotBeforeUpdate(p,m)),N=null!=u&&u.type===g&&null==u.key?u.props.children:u,x(e,Array.isArray(N)?N:[N],t,n,i,r,s,a,l,c),h.base=t.__e,t.__h=null,h.__h.length&&a.push(h),b&&(h.__E=h.__=null),h.__e=!1}else null==s&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=P(n.__e,t,n,i,r,s,a,c);(u=o.diffed)&&u(t)}catch(e){t.__v=null,(c||null!=s)&&(t.__e=l,t.__h=!!c,s[s.indexOf(l)]=null),o.__e(e,t,n)}}function j(e,t){o.__c&&o.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){o.__e(e,t.__v)}}))}function P(e,t,n,o,i,r,s,a){var l,h,d,p,m=n.props,g=t.props,_=t.type,v=0;if("svg"===_&&(i=!0),null!=r)for(;v<r.length;v++)if((l=r[v])&&(l===e||(_?l.localName==_:3==l.nodeType))){e=l,r[v]=null;break}if(null==e){if(null===_)return document.createTextNode(g);e=i?document.createElementNS("http://www.w3.org/2000/svg",_):document.createElement(_,g.is&&g),r=null,a=!1}if(null===_)m===g||a&&e.data===g||(e.data=g);else{if(r=r&&u.slice.call(e.childNodes),h=(m=n.props||c).dangerouslySetInnerHTML,d=g.dangerouslySetInnerHTML,!a){if(null!=r)for(m={},p=0;p<e.attributes.length;p++)m[e.attributes[p].name]=e.attributes[p].value;(d||h)&&(d&&(h&&d.__html==h.__html||d.__html===e.innerHTML)||(e.innerHTML=d&&d.__html||""))}if(function(e,t,n,o,i){var r;for(r in n)"children"===r||"key"===r||r in t||S(e,r,null,n[r],o);for(r in t)i&&"function"!=typeof t[r]||"children"===r||"key"===r||"value"===r||"checked"===r||n[r]===t[r]||S(e,r,t[r],n[r],o)}(e,g,m,i,a),d)t.__k=[];else if(v=t.props.children,x(e,Array.isArray(v)?v:[v],t,n,o,i&&"foreignObject"!==_,r,s,e.firstChild,a),null!=r)for(v=r.length;v--;)null!=r[v]&&f(r[v]);a||("value"in g&&void 0!==(v=g.value)&&(v!==e.value||"progress"===_&&!v)&&S(e,"value",v,m.value,!1),"checked"in g&&void 0!==(v=g.checked)&&v!==e.checked&&S(e,"checked",v,m.checked,!1))}return e}function A(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){o.__e(e,n)}}function M(e,t,n){var i,r,s;if(o.unmount&&o.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||A(i,null,t)),n||"function"==typeof e.type||(n=null!=(r=e.__e)),e.__e=e.__d=void 0,null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){o.__e(e,t)}i.base=i.__P=null}if(i=e.__k)for(s=0;s<i.length;s++)i[s]&&M(i[s],t,n);null!=r&&f(r)}function R(e,t,n){return this.constructor(e,n)}function D(e,t,n){var i,r,s;o.__&&o.__(e,t),r=(i="function"==typeof n)?null:n&&n.__k||t.__k,s=[],k(t,e=(!i&&n||t).__k=p(g,null,[e]),r||c,c,void 0!==t.ownerSVGElement,!i&&n?[n]:r?null:t.firstChild?u.slice.call(t.childNodes):null,s,!i&&n?n:r?r.__e:t.firstChild,i),j(s,e)}o={__e:function(e,t){for(var n,o,i;t=t.__;)if((n=t.__c)&&!n.__)try{if((o=n.constructor)&&null!=o.getDerivedStateFromError&&(n.setState(o.getDerivedStateFromError(e)),i=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e),i=n.__d),i)return n.__E=n}catch(t){e=t}throw e},__v:0},i=function(e){return null!=e&&void 0===e.constructor},_.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=d({},this.state),"function"==typeof e&&(e=e(d({},n),this.props)),e&&d(n,e),null!=e&&this.__v&&(t&&this.__h.push(t),y(this))},_.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),y(this))},_.prototype.render=g,r=[],s="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,w.__r=0,l=0,n.render=D,n.hydrate=function e(t,n){D(t,n,e)},n.createElement=p,n.h=p,n.Fragment=g,n.createRef=function(){return{current:null}},n.isValidElement=i,n.Component=_,n.cloneElement=function(e,t,n){var o,i,r,s=arguments,a=d({},e.props);for(r in t)"key"==r?o=t[r]:"ref"==r?i=t[r]:a[r]=t[r];if(arguments.length>3)for(n=[n],r=3;r<arguments.length;r++)n.push(s[r]);return null!=n&&(a.children=n),m(e.type,a,o||e.key,i||e.ref,null)},n.createContext=function(e,t){var n={__c:t="__cC"+l++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,o;return this.getChildContext||(n=[],(o={})[t]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some(y)},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n},n.toChildArray=function e(t,n){return n=n||[],null==t||"boolean"==typeof t||(Array.isArray(t)?t.some((function(t){e(t,n)})):n.push(t)),n},n.options=o},{}],26:[function(e,t,n){var o,i,r,s=e("preact"),a=0,l=[],c=s.options.__b,u=s.options.__r,h=s.options.diffed,d=s.options.__c,f=s.options.unmount;function p(e,t){s.options.__h&&s.options.__h(i,e,a||t),a=0;var n=i.__H||(i.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function m(e){return a=1,g(N,e)}function g(e,t,n){var r=p(o++,2);return r.t=e,r.__c||(r.__=[n?n(t):N(void 0,t),function(e){var t=r.t(r.__[0],e);r.__[0]!==t&&(r.__=[t,r.__[1]],r.__c.setState({}))}],r.__c=i),r.__}function _(e,t){var n=p(o++,4);!s.options.__s&&E(n.__H,t)&&(n.__=e,n.__H=t,i.__h.push(n))}function v(e,t){var n=p(o++,7);return E(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function b(){l.forEach((function(e){if(e.__P)try{e.__H.__h.forEach(w),e.__H.__h.forEach(x),e.__H.__h=[]}catch(i){e.__H.__h=[],s.options.__e(i,e.__v)}})),l=[]}s.options.__b=function(e){i=null,c&&c(e)},s.options.__r=function(e){u&&u(e),o=0;var t=(i=e.__c).__H;t&&(t.__h.forEach(w),t.__h.forEach(x),t.__h=[])},s.options.diffed=function(e){h&&h(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==l.push(t)&&r===s.options.requestAnimationFrame||((r=s.options.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(o),y&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,100);y&&(t=requestAnimationFrame(n))})(b)),i=void 0},s.options.__c=function(e,t){t.some((function(e){try{e.__h.forEach(w),e.__h=e.__h.filter((function(e){return!e.__||x(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],s.options.__e(r,e.__v)}})),d&&d(e,t)},s.options.unmount=function(e){f&&f(e);var t=e.__c;if(t&&t.__H)try{t.__H.__.forEach(w)}catch(e){s.options.__e(e,t.__v)}};var y="function"==typeof requestAnimationFrame;function w(e){var t=i;"function"==typeof e.__c&&e.__c(),i=t}function x(e){var t=i;e.__c=e.__(),i=t}function E(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function N(e,t){return"function"==typeof t?t(e):t}n.useState=m,n.useReducer=g,n.useEffect=function(e,t){var n=p(o++,3);!s.options.__s&&E(n.__H,t)&&(n.__=e,n.__H=t,i.__H.__h.push(n))},n.useLayoutEffect=_,n.useRef=function(e){return a=5,v((function(){return{current:e}}),[])},n.useImperativeHandle=function(e,t,n){a=6,_((function(){"function"==typeof e?e(t()):e&&(e.current=t())}),null==n?n:n.concat(e))},n.useMemo=v,n.useCallback=function(e,t){return a=8,v((function(){return e}),t)},n.useContext=function(e){var t=i.context[e.__c],n=p(o++,9);return n.__c=e,t?(null==n.__&&(n.__=!0,t.sub(i)),t.props.value):e.__},n.useDebugValue=function(e,t){s.options.useDebugValue&&s.options.useDebugValue(t?t(e):e)},n.useErrorBoundary=function(e){var t=p(o++,10),n=m();return t.__=e,i.componentDidCatch||(i.componentDidCatch=function(e){t.__&&t.__(e),n[1](e)}),[n[0],function(){n[1](void 0)}]}},{preact:25}],27:[function(e,t,n){var o=e("preact");function i(e,t,n,i,r){var s={};for(var a in t)"ref"!=a&&(s[a]=t[a]);var l,c,u={type:e,props:s,key:n,ref:t&&t.ref,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:++o.options.__v,__source:i,__self:r};if("function"==typeof e&&(l=e.defaultProps))for(c in l)void 0===s[c]&&(s[c]=l[c]);return o.options.vnode&&o.options.vnode(u),u}n.Fragment=o.Fragment,n.jsx=i,n.jsxs=i,n.jsxDEV=i},{preact:25}],28:[function(e,t,n){var o="complete",i="canceled";function r(e,t,n){Math.max(0,t),Math.max(0,n),e.self===e?e.scrollTo(t,n):(e.scrollLeft=t,e.scrollTop=n)}function s(e){var t=e._scrollSettings;if(t){var n=t.maxSynchronousAlignments,i=function(e,t){var n,o,i,r,s,a,l,c=e.align,u=e.target.getBoundingClientRect(),h=c&&null!=c.left?c.left:.5,d=c&&null!=c.top?c.top:.5,f=c&&null!=c.leftOffset?c.leftOffset:0,p=c&&null!=c.topOffset?c.topOffset:0,m=h,g=d;if(e.isWindow(t))a=Math.min(u.width,t.innerWidth),l=Math.min(u.height,t.innerHeight),o=u.left+t.pageXOffset-t.innerWidth*m+a*m,i=u.top+t.pageYOffset-t.innerHeight*g+l*g,o-=f,i-=p,o=e.align.lockX?t.pageXOffset:o,i=e.align.lockY?t.pageYOffset:i,r=o-t.pageXOffset,s=i-t.pageYOffset;else{a=u.width,l=u.height,n=t.getBoundingClientRect();var _=u.left-(n.left-t.scrollLeft),v=u.top-(n.top-t.scrollTop);o=_+a*m-t.clientWidth*m,i=v+l*g-t.clientHeight*g,o-=f,i-=p,o=Math.max(Math.min(o,t.scrollWidth-t.clientWidth),0),i=Math.max(Math.min(i,t.scrollHeight-t.clientHeight),0),o=e.align.lockX?t.scrollLeft:o,i=e.align.lockY?t.scrollTop:i,r=o-t.scrollLeft,s=i-t.scrollTop}return{x:o,y:i,differenceX:r,differenceY:s}}(t,e),a=Date.now()-t.startTime,l=Math.min(1/t.time*a,1);if(t.endIterations>=n)return r(e,i.x,i.y),e._scrollSettings=null,t.end(o);var c=1-t.ease(l);if(r(e,i.x-i.differenceX*c,i.y-i.differenceY*c),a>=t.time)return t.endIterations++,t.scrollAncestor&&s(t.scrollAncestor),void s(e);!function(e){if("requestAnimationFrame"in window)return window.requestAnimationFrame(e);setTimeout(e,16)}(s.bind(null,e))}}function a(e){return e.self===e}function l(e){return"pageXOffset"in e||(e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth)&&"hidden"!==getComputedStyle(e).overflow}function c(){return!0}function u(e){if(e.assignedSlot)return u(e.assignedSlot);if(e.parentElement)return"BODY"===e.parentElement.tagName?e.parentElement.ownerDocument.defaultView||e.parentElement.ownerDocument.ownerWindow:e.parentElement;if(e.getRootNode){var t=e.getRootNode();if(11===t.nodeType)return t.host}}t.exports=function(e,t,n){if(e){"function"==typeof t&&(n=t,t=null),t||(t={}),t.time=isNaN(t.time)?1e3:t.time,t.ease=t.ease||function(e){return 1-Math.pow(1-e,e/2)},t.align=t.align||{};var r=u(e),h=1,d=t.validTarget||c,f=t.isScrollable;t.debug&&(console.log("About to scroll to",e),r||console.error("Target did not have a parent, is it mounted in the DOM?"));for(var p=[];r;)if(t.debug&&console.log("Scrolling parent node",r),d(r,h)&&(f?f(r,l):l(r))&&(h++,p.push(r)),!(r=u(r))){m(o);break}return p.reduce(((n,o,r)=>function(e,t,n,o,r){var l,c=!t._scrollSettings,u=t._scrollSettings,h=Date.now(),d={passive:!0};function f(e){t._scrollSettings=null,t.parentElement&&t.parentElement._scrollSettings&&t.parentElement._scrollSettings.end(e),n.debug&&console.log("Scrolling ended with type",e,"for",t),r(e),l&&(t.removeEventListener("touchstart",l,d),t.removeEventListener("wheel",l,d))}u&&u.end(i);var p=n.maxSynchronousAlignments;return null==p&&(p=3),t._scrollSettings={startTime:h,endIterations:0,target:e,time:n.time,ease:n.ease,align:n.align,isWindow:n.isWindow||a,maxSynchronousAlignments:p,end:f,scrollAncestor:o},"cancellable"in n&&!n.cancellable||(l=f.bind(null,i),t.addEventListener("touchstart",l,d),t.addEventListener("wheel",l,d)),c&&s(t),l}(e,o,t,p[r+1],m)),null)}function m(e){--h||n&&n(e)}}},{}],29:[function(e,t,n){function o(){}o.prototype={on:function(e,t,n){var o=this.e||(this.e={});return(o[e]||(o[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var o=this;function i(){o.off(e,i),t.apply(n,arguments)}return i._=t,this.on(e,i,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),o=0,i=n.length;o<i;o++)n[o].fn.apply(n[o].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),o=n[e],i=[];if(o&&t)for(var r=0,s=o.length;r<s;r++)o[r].fn!==t&&o[r].fn._!==t&&i.push(o[r]);return i.length?n[e]=i:delete n[e],this}},t.exports=o,t.exports.TinyEmitter=o},{}],30:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Adder=n.ARROW_POINTING_UP=n.ARROW_POINTING_DOWN=void 0;var o,i=e("preact"),r=(o=e("./components/AdderToolbar"))&&o.__esModule?o:{default:o},s=e("../shared/user-agent"),a=e("./util/shadow-root"),l=e("preact/jsx-runtime");n.ARROW_POINTING_DOWN=1;function c(e){return e.toString()+"px"}n.ARROW_POINTING_UP=2;n.Adder=class{constructor(e,t){this._outerContainer=document.createElement("hypothesis-adder"),e.appendChild(this._outerContainer),this._shadowRoot=(0,a.createShadowRoot)(this._outerContainer),Object.assign(this._outerContainer.style,{position:"absolute",top:0,left:0}),this._view=e.ownerDocument.defaultView,this._width=()=>this._shadowRoot.firstChild.getBoundingClientRect().width,this._height=()=>this._shadowRoot.firstChild.getBoundingClientRect().height,this._isVisible=!1,this._arrowDirection="up",this._onAnnotate=t.onAnnotate,this._onHighlight=t.onHighlight,this._onShowAnnotations=t.onShowAnnotations,this.annotationsForSelection=[],this._render()}hide(){this._isVisible=!1,this._render(),Object.assign(this._outerContainer.style,{top:0,left:0})}destroy(){(0,i.render)(null,this._shadowRoot),this._outerContainer.remove()}show(e,t){const{left:n,top:o,arrowDirection:i}=this._calculateTarget(e,t);this._showAt(n,o),this._isVisible=!0,this._arrowDirection=2===i?"up":"down",this._render()}_calculateTarget(e,t){let n,o,i;n=t&&!(0,s.isTouchDevice)()?1:2;const r=Math.min(20,e.width),a=this._width(),l=(0,s.isTouchDevice)()?10:0,c=this._height();return i=t?e.left-a/2+r:e.left+e.width-a/2-r,e.top-c<0&&1===n?n=2:e.top+c>this._view.innerHeight&&(n=1),o=2===n?e.top+e.height+10+l:e.top-c-10,i=Math.max(i,0),i=Math.min(i,this._view.innerWidth-a),o=Math.max(o,0),o=Math.min(o,this._view.innerHeight-c),{top:o,left:i,arrowDirection:n}}_findZindex(e,t){if(void 0===document.elementsFromPoint)return 32768;const n=this._width(),o=this._height(),i=[...new Set([...document.elementsFromPoint(e,t),...document.elementsFromPoint(e,t+o),...document.elementsFromPoint(e+n/2,t+o/2),...document.elementsFromPoint(e+n,t),...document.elementsFromPoint(e+n,t+o)])].map((e=>+getComputedStyle(e).zIndex)).filter(Number.isInteger);return i.push(0),Math.max(...i)+1}_showAt(e,t){const n=function(e){let t=e.parentElement;for(;t.parentElement&&"static"===getComputedStyle(t).position;)t=t.parentElement;return t}(this._outerContainer).getBoundingClientRect(),o=this._findZindex(e,t);Object.assign(this._outerContainer.style,{left:c(e-n.left),top:c(t-n.top),zIndex:o})}_render(){(0,i.render)((0,l.jsx)(r.default,{isVisible:this._isVisible,arrowDirection:this._arrowDirection,onCommand:e=>{switch(e){case"annotate":this._onAnnotate(),this.hide();break;case"highlight":this._onHighlight(),this.hide();break;case"show":this._onShowAnnotations(this.annotationsForSelection);break;case"hide":this.hide()}},annotationCount:this.annotationsForSelection.length}),this._shadowRoot)}}},{"../shared/user-agent":92,"./components/AdderToolbar":41,"./util/shadow-root":73,preact:25,"preact/jsx-runtime":27}],31:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.anchor=function(e,t,n={}){let r=null,s=null,a=null;for(let o of t)switch(o.type){case"TextPositionSelector":r=o,n.hint=r.start;break;case"TextQuoteSelector":s=o;break;case"RangeSelector":a=o}const l=e=>{var t;if(null!==(t=s)&&void 0!==t&&t.exact&&e.toString()!==s.exact)throw new Error("quote mismatch");return e};let c=Promise.reject("unable to anchor");return a&&(c=c.catch((()=>i(o.RangeAnchor.fromSelector(e,a),n).then(l)))),r&&(c=c.catch((()=>i(o.TextPositionAnchor.fromSelector(e,r),n).then(l)))),s&&(c=c.catch((()=>i(o.TextQuoteAnchor.fromSelector(e,s),n)))),c},n.describe=function(e,t){const n=[o.RangeAnchor,o.TextPositionAnchor,o.TextQuoteAnchor],i=[];for(let o of n)try{const n=o.fromRange(e,t);i.push(n.toSelector())}catch(r){continue}return i};var o=e("./types");async function i(e,t={}){return e.toRange(t)}},{"./types":36}],32:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.matchQuote=function(e,t,n={}){if(0===t.length)return null;const o=Math.min(256,t.length/2),i=r(e,t,o);if(0===i.length)return null;const a=o=>{const i=1-o.errors/t.length,r=n.prefix?s(e.slice(Math.max(0,o.start-n.prefix.length),o.start),n.prefix):1,a=n.suffix?s(e.slice(o.end,o.end+n.suffix.length),n.suffix):1;let l=1;return"number"==typeof n.hint&&(l=1-Math.abs(o.start-n.hint)/e.length),(50*i+20*r+20*a+2*l)/92},l=i.map((e=>({start:e.start,end:e.end,score:a(e)})));return l.sort(((e,t)=>t.score-e.score)),l[0]};var o,i=(o=e("approx-string-match"))&&o.__esModule?o:{default:o};function r(e,t,n){let o=0,r=[];for(;-1!==o;)o=e.indexOf(t,o),-1!==o&&(r.push({start:o,end:o+t.length,errors:0}),o+=1);return r.length>0?r:(0,i.default)(e,t,n)}function s(e,t){return 0===t.length||0===e.length?0:1-r(e,t,t.length)[0].errors/t.length}},{"approx-string-match":19}],33:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.documentHasText=async function(){const e=p();let t=!1;for(let n=0;n<e.pagesCount;n++)if((await g(n)).trim().length>0){t=!0;break}return t},n.anchor=async function(e,t){const n=t.find((e=>"TextQuoteSelector"===e.type));if(!n)throw new Error("No quote selector found");const o=t.find((e=>"TextPositionSelector"===e.type));if(o){try{const{index:e,offset:t,text:i}=await _(o.start),r=o.start-t,s=o.end-t,a=i.substring(r,s);if(n.exact!==a)throw new Error("quote mismatch");return await v(e,r,s)}catch(i){}try{const e=d(n.exact,o.start),t=h.get(e);if(t){const{pageIndex:e,anchor:n}=t;return await v(e,n.start,n.end)}}catch(s){}}return async function(e,t){const n=p().pagesCount,o=Array(n).fill(0).map(((e,t)=>t));let i,s;if(t){const{index:e,offset:n}=await _(t);i=e,s=t-n,o.sort(((t,n)=>Math.abs(t-e)-Math.abs(n-e)))}const[a]=void 0!==e.prefix?b(e.prefix):[],[l]=void 0!==e.suffix?b(e.suffix):[],[c]=b(e.exact);let u;for(let h of o){const e=await g(h),[t,n]=b(e);let o;if(void 0!==i&&void 0!==s){let t;for(t=h<i?e.length:h===i?s:0,o=0;o<n.length&&n[o]<t;)++o}const d=(0,r.matchQuote)(t,c,{prefix:a,suffix:l,hint:o});if(d&&(!u||d.score>u.match.score)){u={page:h,match:{start:n[d.start],end:n[d.end-1]+1,score:d.score}};const e=t.slice(d.start,d.end)===c,o=void 0!==a&&t.slice(Math.max(0,d.start-a.length),d.start)===a,i=void 0!==l&&t.slice(d.end,l.length)===l,r=void 0!==a||void 0!==l;if(e&&(o||i||!r))break}}if(u){const{page:n,match:o}=u;if(t){const i=d(e.exact,t);h.set(i,{pageIndex:n,anchor:o})}return v(n,o.start,o.end)}throw new Error("Quote not found")}(n,null==o?void 0:o.start)},n.describe=async function(e,t){try{t=a.TextRange.fromRange(t).toRange()}catch(u){throw new Error("Selection does not contain text")}const n=f(t.startContainer),o=f(t.endContainer);if(!n||!o)throw new Error("Selection is outside page text");if(n!==o)throw new Error("Selecting across page breaks is not supported");const i=a.TextPosition.fromPoint(t.startContainer,t.startOffset).relativeTo(n),r=a.TextPosition.fromPoint(t.endContainer,t.endOffset).relativeTo(o),s=function(e){let t=0;for(;e.previousSibling;)++t,e=e.previousSibling;return t}(n.parentNode),c=await async function(e){if(e>=p().pagesCount)throw new Error("Invalid page index");let t=0;for(let n=0;n<e;n++)t+=(await g(n)).length;return t}(s);return[{type:"TextPositionSelector",start:c+i.offset,end:c+r.offset},l.TextQuoteAnchor.fromRange(e,t).toSelector()]},n.purgeCache=function(){u.clear(),h.clear()},n.RenderingStates=void 0;var o,i=(o=e("../../shared/warn-once"))&&o.__esModule?o:{default:o},r=e("./match-quote"),s=e("./placeholder"),a=e("./text-range"),l=e("./types");const c={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3};n.RenderingStates=c;const u=new Map,h=new Map;function d(e,t){return`${e}:${t}`}function f(e){var t;const n="closest"in e?e:e.parentElement;return null!==(t=null==n?void 0:n.closest(".textLayer"))&&void 0!==t?t:null}function p(){return PDFViewerApplication.pdfViewer}async function m(e){const t=p();let n=t.getPageView(e);return n&&n.pdfPage||(n=await new Promise((n=>{const o=()=>{t.eventBus?t.eventBus.off("pagesloaded",o):document.removeEventListener("pagesloaded",o),n(t.getPageView(e))};t.eventBus?t.eventBus.on("pagesloaded",o):document.addEventListener("pagesloaded",o)}))),n}function g(e){const t=u.get(e);if(t)return t;const n=(async()=>{const t=await m(e);let n=(await t.pdfPage.getTextContent({normalizeWhitespace:!0})).items;return n.length>0&&!("hasEOL"in n[0])&&(n=n.filter((e=>/\S/.test(e.str)))),n.map((e=>e.str)).join("")})();return u.set(e,n),n}async function _(e){const t=p();let n=0,o=0,i="";for(let r=0;r<t.pagesCount;r++)if(i=await g(r),n=o,o+=i.length,o>=e)return{index:r,offset:n,text:i};return{index:t.pagesCount-1,offset:n,text:i}}async function v(e,t,n){const[o,r]=await Promise.all([m(e),g(e)]);if(o.renderingState===c.FINISHED&&o.textLayer&&o.textLayer.renderingDone){const e=o.textLayer.textLayerDiv;r!==e.textContent&&(0,i.default)("PDF text layer content does not match page text. This will cause anchoring misalignment.");const s=new a.TextPosition(e,t),l=new a.TextPosition(e,n);return new a.TextRange(s,l).toRange()}const l=(0,s.createPlaceholder)(o.div),u=document.createRange();return u.setStartBefore(l),u.setEndAfter(l),u}function b(e){const t=[];let n="";for(let o=0;o<e.length;o++){const i=e[o];" "!==i&&"\t"!==i&&"\n"!==i&&(n+=i,t.push(o))}return[n,t]}},{"../../shared/warn-once":93,"./match-quote":32,"./placeholder":34,"./text-range":35,"./types":36}],34:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.createPlaceholder=function(e){let t=e.querySelector(o);return t||(t=document.createElement("span"),t.classList.add("annotator-placeholder"),t.textContent="Loading annotations...",e.appendChild(t),t)},n.hasPlaceholder=function(e){return null!==e.querySelector(o)},n.removePlaceholder=function(e){var t;null===(t=e.querySelector(o))||void 0===t||t.remove()},n.isInPlaceholder=function(e){return!!e.parentElement&&null!==e.parentElement.closest(o)};const o=".annotator-placeholder"},{}],35:[function(e,t,n){"use strict";function o(e){switch(e.nodeType){case Node.ELEMENT_NODE:case Node.TEXT_NODE:return e.textContent.length;default:return 0}}function i(e){let t=e.previousSibling,n=0;for(;t;)n+=o(t),t=t.previousSibling;return n}function r(e,...t){let n=t.shift();const o=e.ownerDocument.createNodeIterator(e,NodeFilter.SHOW_TEXT),i=[];let r,s=o.nextNode(),a=0;for(;void 0!==n&&s;)r=s,a+r.data.length>n?(i.push({node:r,offset:n-a}),n=t.shift()):(s=o.nextNode(),a+=r.data.length);for(;void 0!==n&&r&&a===n;)i.push({node:r,offset:r.data.length}),n=t.shift();if(void 0!==n)throw new RangeError("Offset exceeds text length");return i}Object.defineProperty(n,"__esModule",{value:!0}),n.TextRange=n.TextPosition=n.RESOLVE_BACKWARDS=n.RESOLVE_FORWARDS=void 0;n.RESOLVE_FORWARDS=1;n.RESOLVE_BACKWARDS=2;class s{constructor(e,t){if(t<0)throw new Error("Offset is invalid");this.element=e,this.offset=t}relativeTo(e){if(!e.contains(this.element))throw new Error("Parent is not an ancestor of current element");let t=this.element,n=this.offset;for(;t!==e;)n+=i(t),t=t.parentElement;return new s(t,n)}resolve(e={}){try{return r(this.element,this.offset)[0]}catch(t){if(0===this.offset&&void 0!==e.direction){const n=document.createTreeWalker(this.element.getRootNode(),NodeFilter.SHOW_TEXT);n.currentNode=this.element;const o=1===e.direction,i=o?n.nextNode():n.previousNode();if(!i)throw t;return{node:i,offset:o?0:i.data.length}}throw t}}static fromCharOffset(e,t){switch(e.nodeType){case Node.TEXT_NODE:return s.fromPoint(e,t);case Node.ELEMENT_NODE:return new s(e,t);default:throw new Error("Node is not an element or text node")}}static fromPoint(e,t){switch(e.nodeType){case Node.TEXT_NODE:{if(t<0||t>e.data.length)throw new Error("Text node offset is out of range");if(!e.parentElement)throw new Error("Text node has no parent");const n=i(e)+t;return new s(e.parentElement,n)}case Node.ELEMENT_NODE:{if(t<0||t>e.childNodes.length)throw new Error("Child node offset is out of range");let n=0;for(let i=0;i<t;i++)n+=o(e.childNodes[i]);return new s(e,n)}default:throw new Error("Point is not in an element or text node")}}}n.TextPosition=s;class a{constructor(e,t){this.start=e,this.end=t}relativeTo(e){return new a(this.start.relativeTo(e),this.end.relativeTo(e))}toRange(){let e,t;this.start.element===this.end.element&&this.start.offset<=this.end.offset?[e,t]=r(this.start.element,this.start.offset,this.end.offset):(e=this.start.resolve({direction:1}),t=this.end.resolve({direction:2}));const n=new Range;return n.setStart(e.node,e.offset),n.setEnd(t.node,t.offset),n}static fromRange(e){const t=s.fromPoint(e.startContainer,e.startOffset),n=s.fromPoint(e.endContainer,e.endOffset);return new a(t,n)}static fromOffsets(e,t,n){return new a(new s(e,t),new s(e,n))}}n.TextRange=a},{}],36:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.TextQuoteAnchor=n.TextPositionAnchor=n.RangeAnchor=void 0;var o=e("./match-quote"),i=e("./text-range"),r=e("./xpath");function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class c{constructor(e,t){this.root=e,this.range=t}static fromRange(e,t){return new c(e,t)}static fromSelector(e,t){const n=(0,r.nodeFromXPath)(t.startContainer,e);if(!n)throw new Error("Failed to resolve startContainer XPath");const o=(0,r.nodeFromXPath)(t.endContainer,e);if(!o)throw new Error("Failed to resolve endContainer XPath");const s=i.TextPosition.fromCharOffset(n,t.startOffset),a=i.TextPosition.fromCharOffset(o,t.endOffset),l=new i.TextRange(s,a).toRange();return new c(e,l)}toRange(){return this.range}toSelector(){const e=i.TextRange.fromRange(this.range).toRange(),t=i.TextRange.fromRange(e),n=(0,r.xpathFromNode)(t.start.element,this.root),o=(0,r.xpathFromNode)(t.end.element,this.root);return{type:"RangeSelector",startContainer:n,startOffset:t.start.offset,endContainer:o,endOffset:t.end.offset}}}n.RangeAnchor=c;class u{constructor(e,t,n){this.root=e,this.start=t,this.end=n}static fromRange(e,t){const n=i.TextRange.fromRange(t).relativeTo(e);return new u(e,n.start.offset,n.end.offset)}static fromSelector(e,t){return new u(e,t.start,t.end)}toSelector(){return{type:"TextPositionSelector",start:this.start,end:this.end}}toRange(){return i.TextRange.fromOffsets(this.root,this.start,this.end).toRange()}}n.TextPositionAnchor=u;class h{constructor(e,t,n={}){this.root=e,this.exact=t,this.context=n}static fromRange(e,t){const n=e.textContent,o=i.TextRange.fromRange(t).relativeTo(e),r=o.start.offset,s=o.end.offset;return new h(e,n.slice(r,s),{prefix:n.slice(Math.max(0,r-32),r),suffix:n.slice(s,Math.min(n.length,s+32))})}static fromSelector(e,t){const{prefix:n,suffix:o}=t;return new h(e,t.exact,{prefix:n,suffix:o})}toSelector(){return{type:"TextQuoteSelector",exact:this.exact,prefix:this.context.prefix,suffix:this.context.suffix}}toRange(e={}){return this.toPositionAnchor(e).toRange()}toPositionAnchor(e={}){const t=this.root.textContent,n=(0,o.matchQuote)(t,this.exact,a(a({},this.context),{},{hint:e.hint}));if(!n)throw new Error("Quote not found");return new u(this.root,n.start,n.end)}}n.TextQuoteAnchor=h},{"./match-quote":32,"./text-range":35,"./xpath":37}],37:[function(e,t,n){"use strict";function o(e){return`${function(e){const t=e.nodeName.toLowerCase();let n=t;return"#text"===t&&(n="text()"),n}(e)}[${function(e){let t=0,n=e;for(;n;)n.nodeName===e.nodeName&&(t+=1),n=n.previousSibling;return t}(e)}]`}function i(e,t,n){t=t.toUpperCase();let o=-1;for(let i=0;i<e.children.length;i++){const r=e.children[i];if(r.nodeName.toUpperCase()===t&&(++o,o===n))return r}return null}Object.defineProperty(n,"__esModule",{value:!0}),n.xpathFromNode=function(e,t){let n="",i=e;for(;i!==t;){if(!i)throw new Error("Node is not a descendant of root");n=o(i)+"/"+n,i=i.parentNode}return n="/"+n,n=n.replace(/\/$/,""),n},n.nodeFromXPath=function(e,t=document.body){try{return function(e,t){if(null===e.match(/^(\/[A-Za-z0-9-]+(\[[0-9]+\])?)+$/))throw new Error("Expression is not a simple XPath");const n=e.split("/");let o=t;n.shift();for(let r of n){let e,t;const n=r.indexOf("[");if(-1!==n){e=r.slice(0,n);const o=r.slice(n+1,r.indexOf("]"));if(t=parseInt(o)-1,t<0)return null}else e=r,t=0;const s=i(o,e,t);if(!s)return null;o=s}return o}(e,t)}catch(n){return document.evaluate("."+e,t,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue}}},{}],38:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e,t){t.on(i.default.PUBLIC_ANNOTATION_COUNT_CHANGED,(function(t){const n=e.querySelectorAll("[data-hypothesis-annotation-count]");Array.from(n).forEach((e=>{e.textContent=t}))}))};var o,i=(o=e("../shared/bridge-events"))&&o.__esModule?o:{default:o}},{"../shared/bridge-events":86}],39:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.AnnotationSync=void 0;n.AnnotationSync=class{constructor(e,t){this._emitter=e.createEmitter(),this.bridge=t,this.cache={},this.destroyed=!1,this.bridge.on("deleteAnnotation",((e,t)=>{if(this.destroyed)return void t(null);const n=this._parse(e);delete this.cache[n.$tag],this._emitter.publish("annotationDeleted",n),this._format(n),t(null)})),this.bridge.on("loadAnnotations",((e,t)=>{if(this.destroyed)return void t(null);const n=e.map((e=>this._parse(e)));this._emitter.publish("annotationsLoaded",n),t(null)})),this._emitter.subscribe("beforeAnnotationCreated",(e=>{e.$tag||this.bridge.call("beforeCreateAnnotation",this._format(e))}))}sync(e){this.destroyed||this.bridge.call("sync",e.map((e=>this._format(e))))}_tag(e,t){return e.$tag||(t=t||window.btoa(Math.random().toString()),Object.defineProperty(e,"$tag",{value:t}),this.cache[t]=e),e}_parse(e){const t=Object.assign(this.cache[e.tag]||{},e.msg);return this._tag(t,e.tag)}_format(e){return this._tag(e),{tag:e.$tag,msg:e}}destroy(){this.destroyed=!0,this._emitter.destroy()}}},{}],40:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o,i=e("preact"),r=e("../shared/listener-collection"),s=(o=e("./components/Buckets"))&&o.__esModule?o:{default:o},a=e("./util/buckets"),l=e("preact/jsx-runtime");n.default=class{constructor(e,t,{contentContainer:n=document.body}={}){this._contentContainer=n,this._bucketsContainer=document.createElement("div"),e.appendChild(this._bucketsContainer),this._guest=t,this._listeners=new r.ListenerCollection,this._listeners.add(window,"resize",(()=>this.update())),this._listeners.add(window,"scroll",(()=>this.update())),this._listeners.add(n,"scroll",(()=>this.update())),this._update()}destroy(){this._listeners.removeAll(),this._bucketsContainer.remove()}update(){this._updatePending||(this._updatePending=!0,requestAnimationFrame((()=>{this._update(),this._updatePending=!1})))}_update(){const e=(0,a.anchorBuckets)(this._guest.anchors);(0,i.render)((0,l.jsx)(s.default,{above:e.above,below:e.below,buckets:e.buckets,onSelectAnnotations:(e,t)=>this._guest.selectAnnotations(e,t),scrollToAnchor:e=>this._guest.scrollToAnchor(e)}),this._bucketsContainer)}}},{"../shared/listener-collection":88,"./components/Buckets":42,"./util/buckets":70,preact:25,"preact/jsx-runtime":27}],41:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function({arrowDirection:e,isVisible:t,onCommand:n,annotationCount:o=0}){const c=t?"a":null,u=t?"h":null,h=t?"s":null,d=t?"Escape":null;return(0,s.useShortcut)(d,(()=>n("hide"))),(0,a.jsxs)("div",{className:(0,i.default)("AdderToolbar",{"AdderToolbar--down":"up"===e,"AdderToolbar--up":"down"===e,"is-active":t}),style:{visibility:t?"visible":"hidden"},children:[(0,a.jsxs)("div",{className:"AdderToolbar__actions",children:[(0,a.jsx)(l,{icon:"annotate",onClick:()=>n("annotate"),label:"Annotate",shortcut:c}),(0,a.jsx)(l,{icon:"highlight",onClick:()=>n("highlight"),label:"Highlight",shortcut:u}),o>0&&(0,a.jsx)("div",{className:"AdderToolbar__separator"}),o>0&&(0,a.jsx)(l,{badgeCount:o,onClick:()=>n("show"),label:"Show",shortcut:h})]}),(0,a.jsx)(r.SvgIcon,{name:"pointer",inline:!0,className:(0,i.default)("AdderToolbar__arrow",{"AdderToolbar__arrow--down":"down"===e,"AdderToolbar__arrow--up":"up"===e})})]})};var o,i=(o=e("classnames"))&&o.__esModule?o:{default:o},r=e("@hypothesis/frontend-shared"),s=e("../../shared/shortcut"),a=e("preact/jsx-runtime");function l({badgeCount:e,icon:t,label:n,onClick:o,shortcut:i}){(0,s.useShortcut)(i,o);const l=i?`${n} (${i})`:n;return(0,a.jsxs)("button",{className:"AdderToolbar__button",onClick:o,"aria-label":l,title:l,children:[t&&(0,a.jsx)(r.SvgIcon,{name:t,className:"AdderToolbar__icon"}),"number"==typeof e&&(0,a.jsx)("span",{className:"AdderToolbar__badge",children:e}),(0,a.jsx)("span",{className:"AdderToolbar__label",children:n})]})}},{"../../shared/shortcut":90,"@hypothesis/frontend-shared":17,classnames:20,"preact/jsx-runtime":27}],42:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function({above:e,below:t,buckets:n,onSelectAnnotations:o,scrollToAnchor:i}){const r=e.anchors.length>0,s=t.anchors.length>0;return(0,a.jsxs)("ul",{className:"Buckets__list",children:[r&&(0,a.jsx)("li",{className:"Buckets__bucket",style:{top:e.position},children:(0,a.jsx)(c,{bucket:e,direction:"up",scrollToAnchor:i})}),n.map(((e,t)=>(0,a.jsx)("li",{className:"Buckets__bucket",style:{top:e.position},children:(0,a.jsx)(l,{bucket:e,onSelectAnnotations:o})},t))),s&&(0,a.jsx)("li",{className:"Buckets__bucket",style:{top:t.position},children:(0,a.jsx)(c,{bucket:t,direction:"down",scrollToAnchor:i})})]})};var o,i=(o=e("classnames"))&&o.__esModule?o:{default:o},r=e("../highlighter"),s=e("../util/buckets"),a=e("preact/jsx-runtime");function l({bucket:e,onSelectAnnotations:t}){const n=e.anchors.map((e=>e.annotation)),o=`Select nearby annotations (${e.anchors.length})`;function i(t){e.anchors.forEach((e=>{(0,r.setHighlightsFocused)(e.highlights||[],t)}))}return(0,a.jsx)("button",{className:"Buckets__button Buckets__button--left",onClick:e=>function(e){t(n,e.metaKey||e.ctrlKey)}(e),onMouseMove:()=>i(!0),onMouseOut:()=>i(!1),onBlur:()=>i(!1),title:o,"aria-label":o,children:e.anchors.length})}function c({bucket:e,direction:t,scrollToAnchor:n}){const o=`Go ${t} to next annotations (${e.anchors.length})`;return(0,a.jsx)("button",{className:(0,i.default)("Buckets__button",`Buckets__button--${t}`),onClick:function(){const o=(0,s.findClosestOffscreenAnchor)(e.anchors,t);o&&n(o)},title:o,"aria-label":o,children:e.anchors.length})}},{"../highlighter":56,"../util/buckets":70,classnames:20,"preact/jsx-runtime":27}],43:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function({eventBus:e,config:t}){const[n,o]=(0,r.useState)(0),[a,u]=(0,r.useState)(!0),[h,d]=(0,r.useState)(null),f=(0,r.useRef)(""),p=(0,r.useRef)(null);return(0,r.useEffect)((()=>(f.current=document.body.style.overflow,()=>{document.body.style.overflow=f.current})),[]),(0,r.useEffect)((()=>{document.body.style.overflow=a?f.current:"hidden"}),[a]),(0,r.useEffect)((()=>(p.current=e.createEmitter(),p.current.subscribe("openNotebook",(e=>{u(!1),o((e=>e+1)),d(e)})),()=>{p.current.destroy()})),[e]),null===h?null:(0,l.jsx)("div",{className:(0,s.default)("NotebookModal__outer",{"is-hidden":a}),children:(0,l.jsxs)("div",{className:"NotebookModal__inner",children:[(0,l.jsx)("div",{className:"NotebookModal__close-button-container",children:(0,l.jsx)(i.IconButton,{icon:"cancel",title:"Close the Notebook",onClick:()=>{u(!0),p.current.publish("closeNotebook")},variant:"dark"})}),(0,l.jsx)(c,{config:t,groupId:h},n)]})})};var o,i=e("@hypothesis/frontend-shared"),r=e("preact/hooks"),s=(o=e("classnames"))&&o.__esModule?o:{default:o},a=e("../config/sidebar"),l=e("preact/jsx-runtime");function c({config:e,groupId:t}){const n=(0,a.createSidebarConfig)(e);n.group=t;const o=encodeURIComponent(JSON.stringify(n)),i=`${e.notebookAppUrl}#config=${o}`;return(0,l.jsx)("iframe",{title:"Hypothesis annotation notebook",className:"NotebookIframe",allowFullScreen:!0,src:i})}},{"../config/sidebar":50,"@hypothesis/frontend-shared":17,classnames:20,"preact/hooks":26,"preact/jsx-runtime":27}],44:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function({closeSidebar:e,createAnnotation:t,isSidebarOpen:n,newAnnotationType:o,showHighlights:s,toggleHighlights:a,toggleSidebar:l,toggleSidebarRef:c,useMinimalControls:u=!1}){return(0,i.jsxs)("div",{className:"Toolbar",children:[u&&n&&(0,i.jsx)(r,{className:"Toolbar__sidebar-close",label:"Close annotation sidebar",icon:"cancel",onClick:e}),!u&&(0,i.jsx)(r,{className:"Toolbar__sidebar-toggle",buttonRef:c,label:"Annotation sidebar",icon:n?"caret-right":"caret-left",expanded:n,onClick:l}),!u&&(0,i.jsxs)("div",{className:"Toolbar__buttonbar",children:[(0,i.jsx)(r,{label:"Show highlights",icon:s?"show":"hide",selected:s,onClick:a}),(0,i.jsx)(r,{label:"note"===o?"New page note":"New annotation",icon:"note"===o?"note":"annotate",onClick:t})]})]})};var o=e("@hypothesis/frontend-shared"),i=e("preact/jsx-runtime");function r({buttonRef:e,expanded:t,className:n="Toolbar__button",label:r,icon:s,onClick:a,selected:l=!1}){return(0,i.jsx)("button",{className:n,"aria-label":r,"aria-expanded":t,"aria-pressed":l,onClick:a,ref:e,title:r,children:(0,i.jsx)(o.SvgIcon,{name:s})})}},{"@hypothesis/frontend-shared":17,"preact/jsx-runtime":27}],45:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(){return(0,i.jsxs)("div",{className:"WarningBanner WarningBanner--notice",children:[(0,i.jsx)("div",{className:"WarningBanner__type",children:(0,i.jsx)(o.SvgIcon,{name:"caution",className:"WarningBanner__icon"})}),(0,i.jsxs)("div",{className:"WarningBanner__message",children:[(0,i.jsx)("strong",{children:"This PDF does not contain selectable text:"})," ",(0,i.jsx)("a",{target:"_blank",rel:"noreferrer",href:"https://web.hypothes.is/help/how-to-ocr-optimize-pdfs/",children:"Learn how to fix this"})," ","in order to annotate with Hypothesis."]})]})};var o=e("@hypothesis/frontend-shared"),i=e("preact/jsx-runtime")},{"@hypothesis/frontend-shared":17,"preact/jsx-runtime":27}],46:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e){if(!e.hasOwnProperty("hypothesisConfig"))return{};if("function"!=typeof e.hypothesisConfig){const e="https://h.readthedocs.io/projects/client/en/latest/publishers/config/#window.hypothesisConfig";return console.warn("hypothesisConfig must be a function, see: "+e),{}}return e.hypothesisConfig()}},{}],47:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.getConfig=function(e="annotator",t=window){const n=(0,r.default)(t),o={};return function(e){const t={annotator:["clientUrl","showHighlights","subFrameIdentifier"],sidebar:["appType","annotations","branding","enableExperimentalNewNoteButton","externalContainerSelector","focus","group","onLayoutChange","openSidebar","query","requestConfigFromFrame","services","showHighlights","sidebarAppUrl","theme","usernameUrl"],notebook:["branding","group","notebookAppUrl","requestConfigFromFrame","services","theme","usernameUrl"]};switch(e){case"annotator":return t.annotator;case"sidebar":return t.sidebar;case"notebook":return t.notebook;case"all":return[...t.annotator,...t.sidebar,...t.notebook];default:throw new Error(`Invalid application context used: "${e}"`)}}(e).forEach((e=>{const r=c[e],s=void 0!==r.defaultValue,l=(0,i.isBrowserExtension)((0,a.urlFromLinkTag)(t,"sidebar","html"));if(!r.allowInBrowserExt&&l)return void(s&&(o[e]=r.defaultValue));const u=r.getValue(n,e);void 0!==u?o[e]=r.coerce?r.coerce(u):u:s&&(o[e]=r.defaultValue)})),o};var o,i=e("./is-browser-extension"),r=(o=e("./settings"))&&o.__esModule?o:{default:o},s=e("../../shared/type-coercions"),a=e("./url-from-link-tag");function l(e,t){return e.hostPageSetting(t)}const c={annotations:{allowInBrowserExt:!0,defaultValue:null,getValue:e=>e.annotations},appType:{allowInBrowserExt:!0,defaultValue:null,getValue:l},branding:{defaultValue:null,allowInBrowserExt:!1,getValue:l},clientUrl:{allowInBrowserExt:!0,defaultValue:null,getValue:e=>e.clientUrl},enableExperimentalNewNoteButton:{allowInBrowserExt:!1,defaultValue:null,getValue:l},group:{allowInBrowserExt:!0,defaultValue:null,getValue:e=>e.group},focus:{allowInBrowserExt:!1,defaultValue:null,getValue:l},theme:{allowInBrowserExt:!1,defaultValue:null,getValue:l},usernameUrl:{allowInBrowserExt:!1,defaultValue:null,getValue:l},onLayoutChange:{allowInBrowserExt:!1,defaultValue:null,getValue:l},openSidebar:{allowInBrowserExt:!0,defaultValue:!1,coerce:s.toBoolean,getValue:l},query:{allowInBrowserExt:!0,defaultValue:null,getValue:e=>e.query},requestConfigFromFrame:{allowInBrowserExt:!1,defaultValue:null,getValue:l},services:{allowInBrowserExt:!1,defaultValue:null,getValue:l},showHighlights:{allowInBrowserExt:!1,defaultValue:"always",getValue:e=>e.showHighlights},notebookAppUrl:{allowInBrowserExt:!0,defaultValue:null,getValue:e=>e.notebookAppUrl},sidebarAppUrl:{allowInBrowserExt:!0,defaultValue:null,getValue:e=>e.sidebarAppUrl},subFrameIdentifier:{allowInBrowserExt:!0,defaultValue:null,getValue:l},externalContainerSelector:{allowInBrowserExt:!1,defaultValue:null,getValue:l}}},{"../../shared/type-coercions":91,"./is-browser-extension":48,"./settings":49,"./url-from-link-tag":51}],48:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isBrowserExtension=function(e){return!(e.startsWith("http://")||e.startsWith("https://"))}},{}],49:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e){const t=(0,s.default)(e);let n;function o(e){return t.hasOwnProperty(e)?t[e]:n.hasOwnProperty(e)?n[e]:void 0}return n=(0,r.toBoolean)(t.ignoreOtherConfiguration)?{}:(0,i.parseJsonConfig)(e.document),{get annotations(){return n.annotations||function(){const t=e.location.href.match(/#annotations:([A-Za-z0-9_-]+)$/);return t?t[1]:null}()},get clientUrl(){return(0,a.urlFromLinkTag)(e,"hypothesis-client","javascript")},get group(){return n.group||function(){const t=e.location.href.match(/#annotations:group:([A-Za-z0-9_-]+)$/);return t?t[1]:null}()},get notebookAppUrl(){return(0,a.urlFromLinkTag)(e,"notebook","html")},get showHighlights(){return function(){let e=o("showHighlights");return void 0===e&&(e="always"),"boolean"==typeof e?e?"always":"never":e}()},get sidebarAppUrl(){return(0,a.urlFromLinkTag)(e,"sidebar","html")},get query(){return n.query||function(){const t=e.location.href.match(/#annotations:(query|q):(.+)$/i);if(t)try{return decodeURIComponent(t[2])}catch(n){}return null}()},hostPageSetting:o}};var o,i=e("../../boot/parse-json-config"),r=e("../../shared/type-coercions"),s=(o=e("./config-func-settings-from"))&&o.__esModule?o:{default:o},a=e("./url-from-link-tag")},{"../../boot/parse-json-config":75,"../../shared/type-coercions":91,"./config-func-settings-from":46,"./url-from-link-tag":51}],50:[function(e,t,n){"use strict";function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(n,"__esModule",{value:!0}),n.createSidebarConfig=function(e){var t;const n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e);if((null===(t=n.services)||void 0===t?void 0:t.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["notebookAppUrl","sidebarAppUrl"].forEach((e=>delete n[e])),n}},{}],51:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.urlFromLinkTag=function(e,t,n){const o=e.document.querySelector(`link[type="application/annotator+${n}"][rel="${t}"]`);if(!o)throw new Error(`No application/annotator+${n} (rel="${t}") link in the document`);if(!o.href)throw new Error(`application/annotator+${n} (rel="${t}") link has no href`);return o.href}},{}],52:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.CrossFrame=void 0;var o=e("../shared/bridge"),i=e("./annotation-sync"),r=e("./hypothesis-injector");n.CrossFrame=class{constructor(e,t,n){this._bridge=new o.Bridge,this._annotationSync=new i.AnnotationSync(t,this._bridge),this._hypothesisInjector=new r.HypothesisInjector(e,this._bridge,n)}connectToSidebar(e,t){const n=new MessageChannel;e.postMessage({type:"hypothesisGuestReady"},t,[n.port2]),this._bridge.createChannel(n.port1)}destroy(){this._bridge.destroy(),this._annotationSync.destroy(),this._hypothesisInjector.destroy()}sync(e){this._annotationSync.sync(e)}on(e,t){this._bridge.on(e,t)}call(e,...t){this._bridge.call(e,...t)}onConnect(e){this._bridge.onConnect(e)}}},{"../shared/bridge":87,"./annotation-sync":39,"./hypothesis-injector":57}],53:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=r(e("../shared/bridge-events")),i=r(e("../shared/warn-once"));function r(e){return e&&e.__esModule?e:{default:e}}let s={};const a=e=>{s=e||{}};var l={init:function(e){e.on(o.default.FEATURE_FLAGS_UPDATED,a)},reset:function(){a({})},flagEnabled:function(e){return e in s?s[e]:((0,i.default)("looked up unknown feature",e),!1)}};n.default=l},{"../shared/bridge-events":86,"../shared/warn-once":93}],54:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.onDocumentReady=r,n.FrameObserver=n.DEBOUNCE_WAIT=void 0;var o,i=(o=e("lodash.debounce"))&&o.__esModule?o:{default:o};n.DEBOUNCE_WAIT=40;function r(e){return new Promise((t=>{const n=e.contentWindow.document,{readyState:o,location:i}=n;"about:blank"===i.href&&e.hasAttribute("src")&&"about:blank"!==e.src?e.addEventListener("load",(()=>{t()})):"loading"!==o?t():n.addEventListener("DOMContentLoaded",(()=>t()))}))}n.FrameObserver=class{constructor(e,t,n){this._element=e,this._onFrameAdded=t,this._onFrameRemoved=n,this._annotatableFrames=new Set,this._isDisconnected=!1,this._mutationObserver=new MutationObserver((0,i.default)((()=>{this._discoverFrames()}),40)),this._discoverFrames(),this._mutationObserver.observe(this._element,{childList:!0,subtree:!0,attributeFilter:["enable-annotation"]})}disconnect(){this._isDisconnected=!0,this._mutationObserver.disconnect()}async _addFrame(e){this._annotatableFrames.add(e);try{if(await r(e),this._isDisconnected)return;e.contentWindow.addEventListener("unload",(()=>{this._removeFrame(e)})),this._onFrameAdded(e)}catch(t){console.warn(`Unable to inject the Hypothesis client (from '${document.location.href}' into a cross-origin frame '${e.src}')`)}}_removeFrame(e){this._annotatableFrames.delete(e),this._onFrameRemoved(e)}_discoverFrames(){const e=new Set(this._element.querySelectorAll("iframe[enable-annotation]"));for(let t of e)this._annotatableFrames.has(t)||this._addFrame(t);for(let t of this._annotatableFrames)e.has(t)||this._removeFrame(t)}}},{"lodash.debounce":23}],55:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=e("../shared/listener-collection"),i=e("./adder"),r=e("./anchoring/text-range"),s=e("./cross-frame"),a=e("./highlighter"),l=e("./integrations/html"),c=e("./integrations/pdf"),u=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var s=i?Object.getOwnPropertyDescriptor(e,r):null;s&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}(e("./range-util")),h=e("./selection-observer"),d=e("./util/url");function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}function p(e){return(0,a.getHighlightsContainingNode)(e).map((e=>e._annotation)).filter((e=>void 0!==e))}function m(e){if(!e.range)return null;try{return e.range.toRange()}catch(t){return null}}n.default=class{constructor(e,t,n={}){var r=this;this.element=e,this._emitter=t.createEmitter(),this._visibleHighlights=!1,this._isAdderVisible=!1,this._adder=new i.Adder(this.element,{onAnnotate:async function(){await r.createAnnotation(),document.getSelection().removeAllRanges()},onHighlight:async function(){r.setVisibleHighlights(!0),await r.createAnnotation({highlight:!0}),document.getSelection().removeAllRanges()},onShowAnnotations:e=>{this.selectAnnotations(e)}}),this._selectionObserver=new h.SelectionObserver((e=>{e?this._onSelection(e):this._onClearSelection()})),this.anchors=[],this._integration="pdf"===n.documentType?new c.PDFIntegration(this):new l.HTMLIntegration(this.element),this._frameIdentifier=n.subFrameIdentifier||null,this.crossframe=new s.CrossFrame(this.element,t,n),this.crossframe.onConnect((()=>this._setupInitialState(n))),this._connectSidebarEvents(),this._sideBySideActive=!1,this._connectAnnotationSync(),this._listeners=new o.ListenerCollection,this._setupElementEvents(),this._focusedAnnotations=new Set}_setupElementEvents(){const e=e=>{this._sideBySideActive||p(e).length||this.crossframe.call("closeSidebar")};this._listeners.add(this.element,"mouseup",(e=>{const{target:t,metaKey:n,ctrlKey:o}=e,i=p(t);if(i.length&&this._visibleHighlights){const e=n||o;this.selectAnnotations(i,e)}})),this._listeners.add(this.element,"mousedown",(({target:t})=>{e(t)})),this._listeners.add(this.element,"touchstart",(({target:t})=>{e(t)})),this._listeners.add(this.element,"mouseover",(({target:e})=>{const t=p(e);t.length&&this._visibleHighlights&&this._focusAnnotations(t)})),this._listeners.add(this.element,"mouseout",(()=>{this._visibleHighlights&&this._focusAnnotations([])})),this._listeners.add(window,"resize",(()=>this._repositionAdder()))}async getDocumentInfo(){const[e,t]=await Promise.all([this._integration.uri(),this._integration.getMetadata()]);return{uri:(0,d.normalizeURI)(e),metadata:t,frameIdentifier:this._frameIdentifier}}_repositionAdder(){var e;if(!1===this._isAdderVisible)return;const t=null===(e=window.getSelection())||void 0===e?void 0:e.getRangeAt(0);t&&this._onSelection(t)}_setupInitialState(e){this._emitter.publish("panelReady"),this.setVisibleHighlights("always"===e.showHighlights)}_connectAnnotationSync(){this._emitter.subscribe("annotationDeleted",(e=>{this.detach(e)})),this._emitter.subscribe("annotationsLoaded",(e=>{e.map((e=>this.anchor(e)))}))}_connectSidebarEvents(){this.crossframe.on("focusAnnotations",((e=[])=>{this._focusedAnnotations.clear(),e.forEach((e=>this._focusedAnnotations.add(e)));for(let t of this.anchors)if(t.highlights){const n=e.includes(t.annotation.$tag);(0,a.setHighlightsFocused)(t.highlights,n)}})),this.crossframe.on("scrollToAnnotation",(e=>{const t=this.anchors.find((t=>t.annotation.$tag===e));if(null==t||!t.highlights)return;const n=m(t);if(!n)return;const o=new CustomEvent("scrolltorange",{bubbles:!0,cancelable:!0,detail:n});this.element.dispatchEvent(o)&&this._integration.scrollToAnchor(t)})),this.crossframe.on("getDocumentInfo",(e=>{this.getDocumentInfo().then((t=>e(null,t))).catch((t=>e(t)))})),this.crossframe.on("setVisibleHighlights",(e=>{this.setVisibleHighlights(e)}))}destroy(){this._listeners.removeAll(),this._selectionObserver.disconnect(),this._adder.destroy(),(0,a.removeAllHighlights)(this.element),this._integration.destroy(),this._emitter.destroy(),this.crossframe.destroy()}async anchor(e){var t=this;const n=e=>{const t=m(e);if(!t)return;const n=(0,a.highlightRange)(t);n.forEach((t=>{t._annotation=e.annotation})),e.highlights=n,this._focusedAnnotations.has(e.annotation.$tag)&&(0,a.setHighlightsFocused)(n,!0)};this.detach(e,!1),e.target||(e.target=[]);const o=await Promise.all(e.target.map((async function(n){if(!n.selector||!n.selector.some((e=>"TextQuoteSelector"===e.type)))return{annotation:e,target:n};let o;try{const i=await t._integration.anchor(t.element,n.selector),s=r.TextRange.fromRange(i);o={annotation:e,target:n,range:s}}catch(i){o={annotation:e,target:n}}return o})));for(let i of o)n(i);return e.$orphan=o.length>0&&o.every((e=>e.target.selector&&!e.range)),this._updateAnchors(this.anchors.concat(o),!0),this.crossframe.sync([e]),o}detach(e,t=!0){const n=[];for(let o of this.anchors)o.annotation!==e?n.push(o):o.highlights&&(0,a.removeHighlights)(o.highlights);this._updateAnchors(n,t)}_updateAnchors(e,t){this.anchors=e,t&&this._emitter.publish("anchorsChanged",this.anchors)}async createAnnotation({highlight:e=!1}={}){var t;const n=null!==(t=this.selectedRanges)&&void 0!==t?t:[];this.selectedRanges=null;const o=await this.getDocumentInfo(),i=this.element,r=(await Promise.all(n.map((e=>this._integration.describe(i,e))))).map((e=>({source:o.uri,selector:e}))),s={uri:o.uri,document:o.metadata,target:r,$highlight:e,$tag:""};return this._emitter.publish("beforeAnnotationCreated",s),this.anchor(s),s.$highlight||this.crossframe.call("openSidebar"),s}_focusAnnotations(e){const t=e.map((e=>e.$tag));this.crossframe.call("focusAnnotations",t)}_onSelection(e){const t=document.getSelection(),n=u.isSelectionBackwards(t),o=u.selectionFocusRect(t);o?(this.selectedRanges=[e],this._emitter.publish("hasSelectionChanged",!0),this._adder.annotationsForSelection=function(){const e=window.getSelection().getRangeAt(0);return u.itemsForRange(e,(e=>e._annotation))}(),this._isAdderVisible=!0,this._adder.show(o,n)):this._onClearSelection()}_onClearSelection(){this._isAdderVisible=!1,this._adder.hide(),this.selectedRanges=[],this._emitter.publish("hasSelectionChanged",!1)}selectAnnotations(e,t=!1){const n=e.map((e=>e.$tag));t?this.crossframe.call("toggleAnnotationSelection",n):this.crossframe.call("showAnnotations",n),this.crossframe.call("openSidebar")}scrollToAnchor(e){return this._integration.scrollToAnchor(e)}setVisibleHighlights(e){(0,a.setHighlightsVisible)(this.element,e),this._visibleHighlights=e,this._emitter.publish("highlightsVisibleChanged",e)}contentContainer(){return this._integration.contentContainer()}fitSideBySide(e){this._sideBySideActive=this._integration.fitSideBySide(e)}get sideBySideActive(){return this._sideBySideActive}get focusedAnnotationTags(){return this._focusedAnnotations}}},{"../shared/listener-collection":88,"./adder":30,"./anchoring/text-range":35,"./cross-frame":52,"./highlighter":56,"./integrations/html":61,"./integrations/pdf":63,"./range-util":65,"./selection-observer":66,"./util/url":74}],56:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.highlightRange=function(e,t="hypothesis-highlight"){const n=function(e){if(e.collapsed)return[];let t=e.commonAncestorContainer;if(t.nodeType!==Node.ELEMENT_NODE&&(t=t.parentElement),!t)return[];const n=[],o=t.ownerDocument.createNodeIterator(t,NodeFilter.SHOW_TEXT);let r;for(;r=o.nextNode();){if(!(0,i.isNodeInRange)(e,r))continue;let t=r;t===e.startContainer&&e.startOffset>0?t.splitText(e.startOffset):(t===e.endContainer&&e.endOffset<t.data.length&&t.splitText(e.endOffset),n.push(t))}return n}(e),s=n.length>0&&(0,o.isInPlaceholder)(n[0]);let a=[],l=null,c=null;n.forEach((e=>{l&&l.nextSibling===e?c.push(e):(c=[e],a.push(c)),l=e}));const u=/^\s*$/;a=a.filter((e=>e.some((e=>!u.test(e.nodeValue)))));const h=[];return a.forEach((e=>{const n=document.createElement("hypothesis-highlight");n.className=t,e[0].parentNode.replaceChild(n,e[0]),e.forEach((e=>n.appendChild(e))),h.push(n)})),s||function(e){if(0===e.length)return;const t=function(e){const t=e.closest(".page");if(!t)return null;return t.querySelector(".canvasWrapper > canvas")||null}(e[0]);if(!t||!t.parentElement)return;let n=t.parentElement.querySelector(".hypothesis-highlight-layer");const o=CSS.supports("mix-blend-mode","multiply");if(!n){n=document.createElementNS(r,"svg"),n.setAttribute("class","hypothesis-highlight-layer"),t.parentElement.appendChild(n),t.parentElement.style.position="relative";const e=n.style;e.position="absolute",e.left="0",e.top="0",e.width="100%",e.height="100%",o?e.mixBlendMode="multiply":e.opacity="0.3"}const i=t.getBoundingClientRect(),s=e.map((e=>{const t=e.getBoundingClientRect(),n=document.createElementNS(r,"rect");return n.setAttribute("x",(t.left-i.left).toString()),n.setAttribute("y",(t.top-i.top).toString()),n.setAttribute("width",t.width.toString()),n.setAttribute("height",t.height.toString()),o?n.setAttribute("class","hypothesis-svg-highlight"):n.setAttribute("class","hypothesis-svg-highlight is-opaque"),e.classList.add("is-transparent"),e.svgHighlight=n,n}));n.append(...s)}(h),h},n.removeAllHighlights=function(e){a(Array.from(e.querySelectorAll("hypothesis-highlight")))},n.removeHighlights=a,n.setHighlightsFocused=function(e,t){e.forEach((e=>{e.svgHighlight?(e.svgHighlight.classList.toggle("is-focused",t),t&&e.svgHighlight.parentNode.append(e.svgHighlight)):e.classList.toggle("hypothesis-highlight-focused",t)}))},n.setHighlightsVisible=function(e,t){e.classList.toggle("hypothesis-highlights-always-on",t)},n.getHighlightsContainingNode=function(e){let t=e.nodeType===Node.ELEMENT_NODE?e:e.parentElement;const n=[];for(;t;)t.classList.contains("hypothesis-highlight")&&n.push(t),t=t.parentElement;return n},n.getBoundingClientRect=function(e){return e.map((e=>e.getBoundingClientRect())).reduce(((e,t)=>({top:Math.min(e.top,t.top),left:Math.min(e.left,t.left),bottom:Math.max(e.bottom,t.bottom),right:Math.max(e.right,t.right)})))};var o=e("./anchoring/placeholder"),i=e("./range-util");const r="http://www.w3.org/2000/svg";function s(e,t){const n=e.parentNode;t.forEach((t=>n.insertBefore(t,e))),e.remove()}function a(e){for(let t of e)t.parentNode&&s(t,Array.from(t.childNodes)),t.svgHighlight&&t.svgHighlight.remove()}},{"./anchoring/placeholder":34,"./range-util":65}],57:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.HypothesisInjector=void 0;var o=e("./frame-observer");function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.HypothesisInjector=class{constructor(e,t,n){this._bridge=t,this._config=n,this._frameIdentifiers=new Map,this._frameObserver=new o.FrameObserver(e,(e=>this._addHypothesis(e)),(e=>this._removeHypothesis(e)))}destroy(){this._frameObserver.disconnect()}_addHypothesis(e){if(function(e){return"__hypothesis"in e.contentWindow}(e))return;const t=Math.random().toString().replace(/\D/g,"");this._frameIdentifiers.set(e,t);const n=r(r({},this._config),{},{subFrameIdentifier:t}),{clientUrl:o}=this._config;!function(e,t,n){const o=document.createElement("script");o.className="js-hypothesis-config",o.type="application/json",o.innerText=JSON.stringify(n);const i=document.createElement("script");i.async=!0,i.src=t;const r=e.contentDocument;r.body.appendChild(o),r.body.appendChild(i)}(e,o,n)}_removeHypothesis(e){this._bridge.call("destroyFrame",this._frameIdentifiers.get(e)),this._frameIdentifiers.delete(e)}}},{"./frame-observer":54}],58:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=f(e("../images/icons/annotate.svg")),i=f(e("../images/icons/cancel.svg")),r=f(e("../images/icons/caution.svg")),s=f(e("../images/icons/caret-left.svg")),a=f(e("../images/icons/caret-right.svg")),l=f(e("../images/icons/hide.svg")),c=f(e("../images/icons/highlight.svg")),u=f(e("../images/icons/note.svg")),h=f(e("../images/icons/pointer.svg")),d=f(e("../images/icons/show.svg"));function f(e){return e&&e.__esModule?e:{default:e}}var p={annotate:o.default,cancel:i.default,caution:r.default,"caret-left":s.default,"caret-right":a.default,hide:l.default,highlight:c.default,note:u.default,pointer:h.default,show:d.default};n.default=p},{"../images/icons/annotate.svg":76,"../images/icons/cancel.svg":77,"../images/icons/caret-left.svg":78,"../images/icons/caret-right.svg":79,"../images/icons/caution.svg":80,"../images/icons/hide.svg":81,"../images/icons/highlight.svg":82,"../images/icons/note.svg":83,"../images/icons/pointer.svg":84,"../images/icons/show.svg":85}],59:[function(e,t,n){"use strict";e("focus-visible");var o=e("@hypothesis/frontend-shared"),i=u(e("./icons")),r=e("./config/index"),s=u(e("./guest")),a=u(e("./notebook")),l=u(e("./sidebar")),c=e("./util/emitter");function u(e){return e&&e.__esModule?e:{default:e}}function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){f(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}(0,o.registerIcons)(i.default);const p=window,m=document.querySelector('link[type="application/annotator+html"][rel="sidebar"]');new Promise((e=>{"loading"!==document.readyState&&e(),document.addEventListener("readystatechange",(()=>e()))})).then((function(){p.__hypothesis={};const e=(0,r.getConfig)("annotator"),t=void 0!==p.PDFViewerApplication,n=new c.EventBus,o=new s.default(document.body,n,d(d({},e),{},{documentType:t?"pdf":"html"}));let i;e.subFrameIdentifier||(i=new l.default(document.body,n,o,(0,r.getConfig)("sidebar")),p.__hypothesis.sidebarWindow=i.ready.then((()=>[i.iframe.contentWindow])));const u=new a.default(document.body,n,(0,r.getConfig)("notebook"));let h=p.__hypothesis.sidebarWindow;try{var f;h||(h=null===(f=window.parent.__hypothesis)||void 0===f?void 0:f.sidebarWindow)}catch(g){}if(h){const e=new URL(m.href).origin;h.then((([t])=>o.crossframe.connectToSidebar(t,e)))}else console.warn(`Hypothesis guest frame in ${location.origin} could not find a sidebar to connect to.\nGuest frames can only connect to sidebars in their same-origin parent frame.`);m.addEventListener("destroy",(()=>{var e;delete p.__hypothesis,null===(e=i)||void 0===e||e.destroy(),u.destroy(),o.destroy(),document.querySelectorAll("[data-hypothesis-asset]").forEach((e=>e.remove()))}))}))},{"./config/index":47,"./guest":55,"./icons":58,"./notebook":64,"./sidebar":68,"./util/emitter":71,"@hypothesis/frontend-shared":17,"focus-visible":21}],60:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.HTMLMetadata=void 0;var o=e("../util/url");n.HTMLMetadata=class{constructor(e={}){this.document=e.document||document}uri(){let e=decodeURIComponent(this._getDocumentHref());const t=this._getLinks();for(let n of t)"canonical"===n.rel&&(e=n.href);return e}getDocumentMetadata(){const e={title:document.title,link:[],dc:this._getMetaTags("dc","name","."),eprints:this._getMetaTags("eprints","name","."),facebook:this._getMetaTags("og","property",":"),highwire:this._getMetaTags("citation","name","_"),prism:this._getMetaTags("prism","name","."),twitter:this._getMetaTags("twitter","name",":")},t=this._getFavicon();t&&(e.favicon=t),e.title=this._getTitle(e),e.link=this._getLinks(e);const n=e.link.find((e=>e.href.startsWith("urn:x-dc")));return n&&(e.documentFingerprint=n.href),e}_getMetaTags(e,t,n){const o={};for(let i of Array.from(this.document.querySelectorAll("meta"))){const r=i.getAttribute(t),{content:s}=i;if(r){const t=r.match(RegExp(`^${e}${n}(.+)$`,"i"));if(t){const e=t[1];o[e]?o[e].push(s):o[e]=[s]}}}return o}_getTitle(e){return e.highwire.title?e.highwire.title[0]:e.eprints.title?e.eprints.title[0]:e.prism.title?e.prism.title[0]:e.facebook.title?e.facebook.title[0]:e.twitter.title?e.twitter.title[0]:e.dc.title?e.dc.title[0]:this.document.title}_getLinks(e={dc:{},highwire:{}}){const t=[{href:this._getDocumentHref()}],n=Array.from(this.document.querySelectorAll("link"));for(let s of n)if(["alternate","canonical","bookmark","shortlink"].includes(s.rel)){if("alternate"===s.rel){if(s.type&&s.type.match(/^application\/(rss|atom)\+xml/))continue;if(s.hreflang)continue}try{const e=this._absoluteUrl(s.href);t.push({href:e,rel:s.rel,type:s.type})}catch(r){}}for(let s of Object.keys(e.highwire)){const n=e.highwire[s];if("pdf_url"===s)for(let e of n)try{t.push({href:this._absoluteUrl(e),type:"application/pdf"})}catch(r){}if("doi"===s)for(let e of n)"doi:"!==e.slice(0,4)&&(e=`doi:${e}`),t.push({href:e})}for(let s of Object.keys(e.dc)){const n=e.dc[s];if("identifier"===s)for(let e of n)"doi:"===e.slice(0,4)&&t.push({href:e})}const o=e.dc["relation.ispartof"],i=e.dc.identifier;if(o&&i){const e=o[o.length-1],n=i[i.length-1],r="urn:x-dc:"+encodeURIComponent(e)+"/"+encodeURIComponent(n);t.push({href:r})}return t}_getFavicon(){let e=null;for(let n of Array.from(this.document.querySelectorAll("link")))if(["shortcut icon","icon"].includes(n.rel))try{e=this._absoluteUrl(n.href)}catch(t){}return e}_absoluteUrl(e){return(0,o.normalizeURI)(e,this.document.baseURI)}_getDocumentHref(){const{href:e}=this.document.location,t=["http:","https:","file:"],n=new URL(e).protocol;return t.includes(n)?e:this.document.baseURI&&t.includes(new URL(this.document.baseURI).protocol)?this.document.baseURI:e}}},{"../util/url":74}],61:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.HTMLIntegration=void 0;var o,i=(o=e("scroll-into-view"))&&o.__esModule?o:{default:o},r=e("../anchoring/html"),s=e("./html-metadata");n.HTMLIntegration=class{constructor(e=document.body){this.container=e,this.anchor=r.anchor,this.describe=r.describe,this._htmlMeta=new s.HTMLMetadata}destroy(){}contentContainer(){return this.container}fitSideBySide(){return!1}async getMetadata(){return this._htmlMeta.getDocumentMetadata()}async uri(){return this._htmlMeta.uri()}scrollToAnchor(e){const t=e.highlights;return new Promise((e=>{(0,i.default)(t[0],e)}))}}},{"../anchoring/html":31,"./html-metadata":60,"scroll-into-view":28}],62:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.PDFMetadata=void 0;var o=e("../util/url");function i(e){return Array.isArray(e.pdfDocument.fingerprints)?e.pdfDocument.fingerprints[0]:e.pdfDocument.fingerprint}function r(e){return`urn:x-pdf:${e}`}function s(e){if(!e.url)return null;const t=(0,o.normalizeURI)(e.url);return 0!==t.indexOf("file://")?t:null}n.PDFMetadata=class{constructor(e){this._loaded=function(e){return e.initializedPromise?e.initializedPromise:e.initialized?Promise.resolve():new Promise((t=>{const n=setInterval((()=>{e.initialized&&(clearTimeout(n),t())}),5)}))}(e).then((()=>e.downloadComplete?e:new Promise((t=>{const n=()=>{e.eventBus?(e.eventBus.off("documentload",n),e.eventBus.off("documentloaded",n)):window.removeEventListener("documentload",n),t(e)};e.eventBus?(e.eventBus.on("documentloaded",n),e.eventBus.on("documentload",n)):window.addEventListener("documentload",n)}))))}getUri(){return this._loaded.then((e=>{let t=s(e);return t||(t=r(i(e))),t}))}async getMetadata(){const e=await this._loaded,{info:t,contentDispositionFilename:n,metadata:o}=await e.pdfDocument.getMetadata(),a=i(e),l=s(e);let c;c=null!=o&&o.has("dc:title")&&"Untitled"!==o.get("dc:title")?o.get("dc:title"):null!=t&&t.Title?t.Title:n||(l?function(e){const t=new URL(e).pathname.split("/");return t[t.length-1]}(l):"");const u=[{href:r(a)}];return l&&u.push({href:l}),{title:c,link:u,documentFingerprint:a}}}},{"../util/url":74}],63:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.PDFIntegration=void 0;var o=f(e("lodash.debounce")),i=e("preact"),r=e("../../shared/listener-collection"),s=e("../anchoring/pdf"),a=e("../anchoring/placeholder"),l=f(e("../components/WarningBanner")),c=e("../util/shadow-root"),u=e("../util/scroll"),h=e("./pdf-metadata"),d=e("preact/jsx-runtime");function f(e){return e&&e.__esModule?e:{default:e}}function p(e){var t;const n=null===(t=e.highlights)||void 0===t?void 0:t[0];return n&&(0,a.isInPlaceholder)(n)}function m(e){return new Promise((t=>setTimeout(t,e)))}n.PDFIntegration=class{constructor(e,t={}){var n,i,s;this.annotator=e;const a=window,l=a.PDFViewerApplication;this.pdfViewer=l.pdfViewer,this.pdfViewer.viewer.classList.add("has-transparent-text-layer"),this.pdfContainer=null!==(n=null===(i=l.appConfig)||void 0===i?void 0:i.appContainer)&&void 0!==n?n:document.body,this.pdfMetadata=new h.PDFMetadata(l),this.observer=new MutationObserver((0,o.default)((()=>this._update()),100)),this.observer.observe(this.pdfViewer.viewer,{attributes:!0,attributeFilter:["data-loaded"],childList:!0,subtree:!0}),this._reanchoringMaxWait=null!==(s=t.reanchoringMaxWait)&&void 0!==s?s:3e3,this._warningBanner=null,this._checkForSelectableText(),this._updateAnnotationLayerVisibility=()=>{const e=a.getSelection();this.pdfViewer.viewer.classList.toggle("is-selecting",!e.isCollapsed)},this._listeners=new r.ListenerCollection,this._listeners.add(document,"selectionchange",this._updateAnnotationLayerVisibility),this._destroyed=!1}destroy(){this._listeners.removeAll(),this.pdfViewer.viewer.classList.remove("has-transparent-text-layer"),this.observer.disconnect(),this._destroyed=!0}uri(){return this.pdfMetadata.getUri()}getMetadata(){return this.pdfMetadata.getMetadata()}anchor(e,t){return(0,s.anchor)(e,t)}describe(e,t){return(0,s.describe)(e,t)}async _checkForSelectableText(){try{await this.uri()}catch(e){return}if(!this._destroyed)try{const e=await(0,s.documentHasText)();this._toggleNoSelectableTextWarning(!e)}catch(t){console.warn("Unable to check for text in PDF:",t)}}_toggleNoSelectableTextWarning(e){const t=document.querySelector("#outerContainer");var n;if(!e)return null===(n=this._warningBanner)||void 0===n||n.remove(),this._warningBanner=null,void(t.style.height="");this._warningBanner=document.createElement("hypothesis-banner"),document.body.prepend(this._warningBanner);const o=(0,c.createShadowRoot)(this._warningBanner);(0,i.render)((0,d.jsx)(l.default,{}),o);const r=this._warningBanner.getBoundingClientRect().height;t.style.height=`calc(100% - ${r}px)`}_update(){const e=[],t=this.pdfViewer.pagesCount;for(let o=0;o<t;o++){var n;const e=this.pdfViewer.getPageView(o);if(null!=e&&null!==(n=e.textLayer)&&void 0!==n&&n.renderingDone)switch(e.renderingState){case s.RenderingStates.INITIAL:e.textLayer=null;break;case s.RenderingStates.FINISHED:(0,a.removePlaceholder)(e.div)}}for(let o of this.annotator.anchors)if(o.highlights){if(e.includes(o.annotation))continue;for(let t=0;t<o.highlights.length;t++){const n=o.highlights[t];if(!document.body.contains(n)){o.highlights.splice(t,1),delete o.range,e.push(o.annotation);break}}}e.map((e=>this.annotator.anchor(e)))}contentContainer(){return document.querySelector("#viewerContainer")}fitSideBySide(e){const t=window.innerWidth-e.width,n=e.expanded&&t>=680,o=n?e.width:e.toolbarWidth;this.pdfContainer.style.width=`calc(100% - ${o}px)`;const i=this.pdfViewer.currentScaleValue;return"auto"!==i&&"page-fit"!==i&&"page-width"!==i||(this.pdfViewer.currentScaleValue=i),this.pdfViewer.update(),n}async scrollToAnchor(e){const t=e.annotation,n=p(e),o=this._anchorOffset(e);if(null!==o&&(await(0,u.scrollElement)(this.contentContainer(),o),n)){const e=await this._waitForAnnotationToBeAnchored(t,this._reanchoringMaxWait);if(!e)return;const n=this._anchorOffset(e);if(null===n)return;await(0,u.scrollElement)(this.contentContainer(),n)}}async _waitForAnnotationToBeAnchored(e,t){var n;const o=Date.now();let i;do{i=this.annotator.anchors.find((t=>t.annotation===e)),i&&!p(i)||(i=null,await m(20))}while(!i&&Date.now()-o<t);return null!==(n=i)&&void 0!==n?n:null}_anchorOffset(e){if(!e.highlights)return null;const t=e.highlights[0];return(0,u.offsetRelativeTo)(t,this.contentContainer())}}},{"../../shared/listener-collection":88,"../anchoring/pdf":33,"../anchoring/placeholder":34,"../components/WarningBanner":45,"../util/scroll":72,"../util/shadow-root":73,"./pdf-metadata":62,"lodash.debounce":23,preact:25,"preact/jsx-runtime":27}],64:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o,i=e("./util/shadow-root"),r=e("preact"),s=(o=e("./components/NotebookModal"))&&o.__esModule?o:{default:o},a=e("preact/jsx-runtime");n.default=class{constructor(e,t,n={}){this._outerContainer=document.createElement("hypothesis-notebook"),e.appendChild(this._outerContainer),this.shadowRoot=(0,i.createShadowRoot)(this._outerContainer),(0,r.render)((0,a.jsx)(s.default,{eventBus:t,config:n}),this.shadowRoot)}destroy(){(0,r.render)(null,this.shadowRoot),this._outerContainer.remove()}}},{"./components/NotebookModal":43,"./util/shadow-root":73,preact:25,"preact/jsx-runtime":27}],65:[function(e,t,n){"use strict";function o(e){return e.focusNode===e.anchorNode?e.focusOffset<e.anchorOffset:e.getRangeAt(0).startContainer===e.focusNode}function i(e,t){try{var n,o;const i=null!==(n=null===(o=t.nodeValue)||void 0===o?void 0:o.length)&&void 0!==n?n:t.childNodes.length;return e.comparePoint(t,0)<=0&&e.comparePoint(t,i)>=0}catch(i){return!1}}function r(e,t){const n=e.commonAncestorContainer,o=n.ownerDocument.createNodeIterator(n,NodeFilter.SHOW_ALL);let r;for(;r=o.nextNode();)i(e,r)&&t(r)}function s(e){const t=/^\s*$/,n=[];r(e,(e=>{e.nodeType!==Node.TEXT_NODE||e.textContent.match(t)||n.push(e)}));let o=[];return n.forEach((t=>{const n=t.ownerDocument.createRange();if(n.selectNodeContents(t),t===e.startContainer&&n.setStart(t,e.startOffset),t===e.endContainer&&n.setEnd(t,e.endOffset),n.collapsed)return;const i=Array.from(n.getClientRects());n.detach(),o=o.concat(i)})),o}Object.defineProperty(n,"__esModule",{value:!0}),n.isSelectionBackwards=o,n.isNodeInRange=i,n.forEachNodeInRange=r,n.getTextBoundingBoxes=s,n.selectionFocusRect=function(e){if(e.isCollapsed)return null;const t=s(e.getRangeAt(0));return 0===t.length?null:o(e)?t[0]:t[t.length-1]},n.itemsForRange=function(e,t){const n=new Set,o=new Set;return r(e,(e=>{let i=e;for(;i&&!n.has(i);){n.add(i);const e=t(i);e&&o.add(e),i=i.parentNode}})),[...o]}},{}],66:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionObserver=void 0;var o=e("../shared/listener-collection");n.SelectionObserver=class{constructor(e,t=document){let n=!1;this._pendingCallback=null;const i=(n=10)=>{this._pendingCallback=setTimeout((()=>{e(function(e){const t=e.getSelection();if(!t||0===t.rangeCount)return null;const n=t.getRangeAt(0);return n.collapsed?null:n}(t))}),n)};this._eventHandler=e=>{if("mousedown"===e.type&&(n=!0),"mouseup"===e.type&&(n=!1),n)return;this._cancelPendingCallback();const t="mouseup"===e.type?10:100;i(t)},this._document=t,this._listeners=new o.ListenerCollection,this._events=["mousedown","mouseup","selectionchange"];for(let o of this._events)this._listeners.add(t,o,this._eventHandler);i(1)}disconnect(){this._listeners.removeAll(),this._cancelPendingCallback()}_cancelPendingCallback(){this._pendingCallback&&(clearTimeout(this._pendingCallback),this._pendingCallback=null)}}},{"../shared/listener-collection":88}],67:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e,t){const n=e.querySelectorAll("[data-hypothesis-trigger]");function o(e){t(),e.stopPropagation()}Array.from(n).forEach((e=>{e.addEventListener("click",o)}))}},{}],68:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.MIN_RESIZE=void 0;var o=f(e("hammerjs")),i=f(e("../shared/bridge-events")),r=e("../shared/listener-collection"),s=f(e("./annotation-counts")),a=f(e("./bucket-bar")),l=e("./config/sidebar"),c=f(e("./features")),u=f(e("./sidebar-trigger")),h=e("./toolbar"),d=e("./util/shadow-root");function f(e){return e&&e.__esModule?e:{default:e}}n.MIN_RESIZE=280;n.default=class{constructor(e,t,n,o={}){if(this._emitter=t.createEmitter(),this.iframe=function(e){const t=(0,l.createSidebarConfig)(e),n="config="+encodeURIComponent(JSON.stringify(t)),o=e.sidebarAppUrl+"#"+n,i=document.createElement("iframe");return i.setAttribute("allowfullscreen",""),i.src=o,i.title="Hypothesis annotation viewer",i.className="h-sidebar-iframe",i}(o),this.options=o,this.bucketBar=null,o.externalContainerSelector){var i;this.externalFrame=null!==(i=document.querySelector(o.externalContainerSelector))&&void 0!==i?i:e,this.externalFrame.appendChild(this.iframe)}else{if(this.iframeContainer=document.createElement("div"),this.iframeContainer.style.display="none",this.iframeContainer.className="annotator-frame","clean"===o.theme)this.iframeContainer.classList.add("annotator-frame--theme-clean");else{const e=new a.default(this.iframeContainer,n,{contentContainer:n.contentContainer()});this._emitter.subscribe("anchorsChanged",(()=>e.update())),this.bucketBar=e}this.iframeContainer.appendChild(this.iframe),this.hypothesisSidebar=document.createElement("hypothesis-sidebar"),(0,d.createShadowRoot)(this.hypothesisSidebar).appendChild(this.iframeContainer),e.appendChild(this.hypothesisSidebar)}this.guest=n,this._listeners=new r.ListenerCollection,this._emitter.subscribe("panelReady",(()=>{this.iframeContainer&&(this.iframeContainer.style.display="")})),this._emitter.subscribe("beforeAnnotationCreated",(e=>{e.$highlight||this.iframe.contentWindow.focus()})),(o.openSidebar||o.annotations||o.query||o.group)&&this._emitter.subscribe("panelReady",(()=>this.open()));const s=document.createElement("div");this.toolbar=new h.ToolbarController(s,{createAnnotation:()=>n.createAnnotation(),setSidebarOpen:e=>e?this.open():this.close(),setHighlightsVisible:e=>this.setAllVisibleHighlights(e)}),"clean"===o.theme?this.toolbar.useMinimalControls=!0:this.toolbar.useMinimalControls=!1,this._emitter.subscribe("highlightsVisibleChanged",(e=>{this.toolbar.highlightsVisible=e})),this._emitter.subscribe("hasSelectionChanged",(e=>{this.toolbar.newAnnotationType=e?"annotation":"note"})),this.iframeContainer?(this.iframeContainer.prepend(s),this.toolbarWidth=this.toolbar.getWidth()):this.toolbarWidth=0,this._listeners.add(window,"resize",(()=>this._onResize())),this._gestureState={initial:null,final:null},this._setupGestures(),this.close();const[c]=o.services||[];c&&(this.onLoginRequest=c.onLoginRequest,this.onLogoutRequest=c.onLogoutRequest,this.onSignupRequest=c.onSignupRequest,this.onProfileRequest=c.onProfileRequest,this.onHelpRequest=c.onHelpRequest),this.onLayoutChange=o.onLayoutChange,this._notifyOfLayoutChange(!1),this._setupSidebarEvents(),this.ready=new Promise((e=>{this._listeners.add(window,"message",(t=>{const n=t.data;"hypothesisSidebarReady"===(null==n?void 0:n.type)&&e()}))}))}destroy(){var e,t;null===(e=this.bucketBar)||void 0===e||e.destroy(),this._listeners.removeAll(),null===(t=this._hammerManager)||void 0===t||t.destroy(),this.hypothesisSidebar?this.hypothesisSidebar.remove():this.iframe.remove(),this._emitter.destroy()}_setupSidebarEvents(){(0,s.default)(document.body,this.guest.crossframe),(0,u.default)(document.body,(()=>this.open())),c.default.init(this.guest.crossframe),this.guest.crossframe.on("openSidebar",(()=>this.open())),this.guest.crossframe.on("closeSidebar",(()=>this.close())),this.guest.crossframe.on("openNotebook",(e=>{this.hide(),this._emitter.publish("openNotebook",e)})),this._emitter.subscribe("closeNotebook",(()=>{this.show()})),[[i.default.LOGIN_REQUESTED,this.onLoginRequest],[i.default.LOGOUT_REQUESTED,this.onLogoutRequest],[i.default.SIGNUP_REQUESTED,this.onSignupRequest],[i.default.PROFILE_REQUESTED,this.onProfileRequest],[i.default.HELP_REQUESTED,this.onHelpRequest]].forEach((([e,t])=>{t&&this.guest.crossframe.on(e,(()=>t()))}))}_resetGestureState(){this._gestureState={initial:null,final:null}}_setupGestures(){const e=this.toolbar.sidebarToggleButton;e&&(this._hammerManager=new o.default.Manager(e).on("panstart panend panleft panright",(e=>this._onPan(e))),this._hammerManager.add(new o.default.Pan({direction:o.default.DIRECTION_HORIZONTAL})))}_updateLayout(){this.renderFrame||(this.renderFrame=requestAnimationFrame((()=>{if(this.renderFrame=null,this._gestureState.final!==this._gestureState.initial&&this.iframeContainer){const e=this._gestureState.final,t=-e;this.iframeContainer.style.marginLeft=`${e}px`,t>=280&&(this.iframeContainer.style.width=`${t}px`),this._notifyOfLayoutChange()}})))}_notifyOfLayoutChange(e){var t;const n=this.iframeContainer&&this.toolbar.getWidth()||0,o=null!==(t=this.iframeContainer)&&void 0!==t?t:this.externalFrame,i=o.getBoundingClientRect(),r=window.getComputedStyle(o),s=parseInt(r.width),a=parseInt(r.marginLeft);let l=n;"boolean"==typeof e?e&&(l+=s):(a<280?l-=a:l+=s,e=l>n);const c={expanded:e,width:e?l:n,height:i.height,toolbarWidth:n};this.onLayoutChange&&this.onLayoutChange(c),this.guest.fitSideBySide(c),this._emitter.publish("sidebarLayoutChanged",c)}_onResize(){!0===this.toolbar.sidebarOpen&&(window.innerWidth<280?this.close():this.open())}_onPan(e){const t=this.iframeContainer;if(t)switch(e.type){case"panstart":this._resetGestureState(),t.classList.add("annotator-no-transition"),t.style.pointerEvents="none",this._gestureState.initial=parseInt(getComputedStyle(t).marginLeft);break;case"panend":t.classList.remove("annotator-no-transition"),t.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 t=this._gestureState.initial,n=e.deltaX;this._gestureState.final=Math.min(Math.round(t+n),0),this._updateLayout();break}}}open(){if(this.guest.crossframe.call("sidebarOpened"),this._emitter.publish("sidebarOpened"),this.iframeContainer){const e=this.iframeContainer.getBoundingClientRect().width;this.iframeContainer.style.marginLeft=-1*e+"px",this.iframeContainer.classList.remove("annotator-collapsed")}this.toolbar.sidebarOpen=!0,"whenSidebarOpen"===this.options.showHighlights&&this.guest.setVisibleHighlights(!0),this._notifyOfLayoutChange(!0)}close(){this.iframeContainer&&(this.iframeContainer.style.marginLeft="",this.iframeContainer.classList.add("annotator-collapsed")),this.toolbar.sidebarOpen=!1,"whenSidebarOpen"===this.options.showHighlights&&this.guest.setVisibleHighlights(!1),this._notifyOfLayoutChange(!1)}setAllVisibleHighlights(e){this.guest.crossframe.call("setVisibleHighlights",e)}show(){this.iframeContainer&&this.iframeContainer.classList.remove("is-hidden")}hide(){this.iframeContainer&&this.iframeContainer.classList.add("is-hidden")}}},{"../shared/bridge-events":86,"../shared/listener-collection":88,"./annotation-counts":38,"./bucket-bar":40,"./config/sidebar":50,"./features":53,"./sidebar-trigger":67,"./toolbar":69,"./util/shadow-root":73,hammerjs:22}],69:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ToolbarController=void 0;var o,i=e("preact"),r=(o=e("./components/Toolbar"))&&o.__esModule?o:{default:o},s=e("preact/jsx-runtime");n.ToolbarController=class{constructor(e,t){const{createAnnotation:n,setSidebarOpen:o,setHighlightsVisible:r}=t;this._container=e,this._useMinimalControls=!1,this._newAnnotationType="note",this._highlightsVisible=!1,this._sidebarOpen=!1,this._closeSidebar=()=>o(!1),this._toggleSidebar=()=>o(!this._sidebarOpen),this._toggleHighlights=()=>r(!this._highlightsVisible),this._createAnnotation=()=>{n(),o(!0)},this._sidebarToggleButton=(0,i.createRef)(),this.render()}getWidth(){return this._container.firstChild.getBoundingClientRect().width}set useMinimalControls(e){this._useMinimalControls=e,this.render()}get useMinimalControls(){return this._useMinimalControls}set sidebarOpen(e){this._sidebarOpen=e,this.render()}get sidebarOpen(){return this._sidebarOpen}set newAnnotationType(e){this._newAnnotationType=e,this.render()}get newAnnotationType(){return this._newAnnotationType}set highlightsVisible(e){this._highlightsVisible=e,this.render()}get highlightsVisible(){return this._highlightsVisible}get sidebarToggleButton(){return this._sidebarToggleButton.current}render(){(0,i.render)((0,s.jsx)(r.default,{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)}}},{"./components/Toolbar":44,preact:25,"preact/jsx-runtime":27}],70:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.findClosestOffscreenAnchor=function(e,t){let n=null,i=0;for(let s of e){var r;if(null===(r=s.highlights)||void 0===r||!r.length)continue;const e=(0,o.getBoundingClientRect)(s.highlights).top;"up"===t&&e>=137||"down"===t&&e<=window.innerHeight-22||(!n||"up"===t&&e>i||"down"===t&&e<i)&&(n=s,i=e)}return n},n.anchorBuckets=function(e){const t=function(e){const t=[];return e.forEach((e=>{var n;if(null===(n=e.highlights)||void 0===n||!n.length)return;const i=(0,o.getBoundingClientRect)(e.highlights);i.top>=i.bottom||t.push({top:i.top,bottom:i.bottom,anchor:e})})),t.sort(((e,t)=>e.top<t.top?-1:1)),t}(e),n=new Set,i=new Set,r=[];let s=null;function a(e){const t=e.bottom-e.top,n=e.top+t/2;return{anchors:[e.anchor],top:e.top,bottom:e.bottom,position:n}}return t.forEach((e=>{if(e.top<137)return void n.add(e.anchor);if(e.top>window.innerHeight-22)return void i.add(e.anchor);if(!s)return void(s=a(e));const t=e.top>s.top&&e.bottom<s.bottom;if(e.top-s.bottom>60&&!t)r.push(s),s=a(e);else{const t=e.bottom>s.bottom?e.bottom:s.bottom,n=t-s.top;s.anchors.push(e.anchor),s.bottom=t,s.position=s.top+n/2}})),s&&r.push(s),{above:{anchors:Array.from(n),position:137},below:{anchors:Array.from(i),position:window.innerHeight-22},buckets:r}};var o=e("../highlighter")},{"../highlighter":56}],71:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.EventBus=void 0;var o=e("tiny-emitter");class i{constructor(e){this._emitter=e,this._subscriptions=[]}publish(e,...t){this._emitter.emit(e,...t)}subscribe(e,t){this._emitter.on(e,t),this._subscriptions.push([e,t])}unsubscribe(e,t){this._emitter.off(e,t),this._subscriptions=this._subscriptions.filter((([n,o])=>n!==e||o!==t))}destroy(){for(let[e,t]of this._subscriptions)this._emitter.off(e,t);this._subscriptions=[]}}n.EventBus=class{constructor(){this._emitter=new o.TinyEmitter}createEmitter(){return new i(this._emitter)}}},{"tiny-emitter":29}],72:[function(e,t,n){"use strict";function o(e,t,n){return e+n*(t-e)}Object.defineProperty(n,"__esModule",{value:!0}),n.offsetRelativeTo=function(e,t){let n=0;for(;e!==t&&t.contains(e);)n+=e.offsetTop,e=e.offsetParent;return n},n.scrollElement=async function(e,t,{maxDuration:n=500}={}){const i=e.scrollTop,r=t,s=Date.now(),a=Math.min(Math.abs(r-i)/3,n);let l=0;for(;l<1;)await new Promise((e=>{requestAnimationFrame(e)})),l=Math.min(1,(Date.now()-s)/a),e.scrollTop=o(i,r,l)}},{}],73:[function(e,t,n){"use strict";function o(e){e.addEventListener("mouseup",(e=>e.stopPropagation())),e.addEventListener("mousedown",(e=>e.stopPropagation())),e.addEventListener("touchstart",(e=>e.stopPropagation()),{passive:!0})}Object.defineProperty(n,"__esModule",{value:!0}),n.createShadowRoot=function(e){if(!e.attachShadow)return o(e),e;const t=e.attachShadow({mode:"open"});!function(e){var t;const n=null===(t=document.querySelector('link[rel="stylesheet"][href*="/build/styles/annotator.css"]'))||void 0===t?void 0:t.href;if(!n)return;const o=document.createElement("link");o.rel="stylesheet",o.href=n,e.appendChild(o)}(t);const n=window.applyFocusVisiblePolyfill;return n&&n(t),o(t),t}},{}],74:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.normalizeURI=function(e,t=document.baseURI){return new URL(e,t).href.toString().replace(/#.*/,"")}},{}],75:[function(e,t,n){"use strict";function o(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}Object.defineProperty(n,"__esModule",{value:!0}),n.parseJsonConfig=function(e){for(var t={},n=e.querySelectorAll("script.js-hypothesis-config"),i=0;i<n.length;i++){var r=void 0;try{r=JSON.parse(n[i].textContent||"")}catch(s){console.warn("Could not parse settings from js-hypothesis-config tags",s),r={}}o(t,r)}return t}},{}],76:[function(e,t,n){t.exports='<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'},{}],77:[function(e,t,n){arguments[4][1][0].apply(n,arguments)},{dup:1}],78:[function(e,t,n){t.exports='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><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>\n'},{}],79:[function(e,t,n){t.exports='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false" class="Icon Icon--caret-right"><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>\n'},{}],80:[function(e,t,n){t.exports='<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" class="feather feather-alert-triangle"><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>'},{}],81:[function(e,t,n){t.exports='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><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.73 12.973A9.89 9.89 0 0 1 8 13c-3.866 0-7-2.239-7-5 0-.753.233-1.467.65-2.107m5.62-2.866A9.89 9.89 0 0 1 8 3c3.866 0 7 2.239 7 5 0 .753-.233 1.467-.65 2.107M1 1l14 14L1 1z"></path></g></svg>\n'},{}],82:[function(e,t,n){t.exports='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><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>\n'},{}],83:[function(e,t,n){t.exports='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><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="M1 15h6l8-6V1H1v14zm6-1V9h7"></path></g></svg>\n'},{}],84:[function(e,t,n){t.exports='<svg xmlns="http://www.w3.org/2000/svg" width="15" height="8" viewBox="0 0 15 8" aria-hidden="true" focusable="false"><path d="M0 8 L7 0 L15 8" stroke="currentColor" strokeWidth="2" /></svg>\n'},{}],85:[function(e,t,n){t.exports='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><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 13c3.866 0 7-2.239 7-5s-3.134-5-7-5-7 2.239-7 5 3.134 5 7 5zm0-4a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"></path></g></svg>\n'},{}],86:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default={FEATURE_FLAGS_UPDATED:"featureFlagsUpdated",HELP_REQUESTED:"helpRequested",LOGIN_REQUESTED:"loginRequested",LOGOUT_REQUESTED:"logoutRequested",PROFILE_REQUESTED:"profileRequested",PUBLIC_ANNOTATION_COUNT_CHANGED:"publicAnnotationCountChanged",SIGNUP_REQUESTED:"signupRequested"}},{}],87:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Bridge=void 0;var o=e("./port-rpc");n.Bridge=class{constructor(){this.links=[],this.channelListeners={},this.onConnectListeners=[],this.on("connect",(e=>e()))}destroy(){this.links.forEach((e=>e.destroy())),this.links=[]}createChannel(e){const t=new o.PortRPC(e,this.channelListeners);let n=!1;return t.call("connect",(()=>{n||(n=!0,this.onConnectListeners.forEach((e=>e(t))))})),this.links.push(t),t}call(e,...t){let n;const o=t[t.length-1];"function"==typeof o&&(n=o,t=t.slice(0,-1));const i=e=>t=>{throw e.destroy(),this.links=this.links.filter((t=>t!==e)),t},r=this.links.map((n=>new Promise(((o,i)=>{const r=setTimeout((()=>o(null)),1e3);try{n.call(e,...t,((e,t)=>{clearTimeout(r),e?i(e):o(t)}))}catch(s){i(s)}})).catch(i(n))));let s=Promise.all(r);return n&&(s=s.then((e=>n(null,e))).catch((e=>n(e)))),s}on(e,t){if(this.links.length>0)throw new Error(`Listener '${e}' can't be registered because a channel has already been created`);if(this.channelListeners[e])throw new Error(`Listener '${e}' already bound in Bridge`);return this.channelListeners[e]=t,this}onConnect(e){return this.onConnectListeners.push(e),this}}},{"./port-rpc":89}],88:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ListenerCollection=void 0;n.ListenerCollection=class{constructor(){this._listeners=[]}add(e,t,n,o){e.addEventListener(t,n,o),this._listeners.push({eventTarget:e,eventType:t,listener:n})}removeAll(){this._listeners.forEach((({eventTarget:e,eventType:t,listener:n})=>{e.removeEventListener(t,n)})),this._listeners=[]}}},{}],89:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.PortRPC=void 0;var o=e("./listener-collection");const i="frame-rpc";n.PortRPC=class{constructor(e,t){this._port=e,this._methods=t,this._sequence=0,this._callbacks={},this._destroyed=!1,this._listeners=new o.ListenerCollection,this._listeners.add(this._port,"message",(e=>this._handle(e))),this._port.start()}destroy(){this._destroyed=!0,this._listeners.removeAll(),this._port.close()}call(e,...t){if(this._destroyed)return;const n=this._sequence++,o=t[t.length-1];"function"==typeof o&&(this._callbacks[n]=o,t=t.slice(0,-1));const r={arguments:t,method:e,protocol:i,sequence:n,version:"1.0.0"};this._port.postMessage(r)}_parseMessage({data:e}){return e&&"object"==typeof e?e.protocol!==i||"1.0.0"!==e.version?null:Array.isArray(e.arguments)?e:null:null}_handle(e){const t=this._parseMessage(e);if(null!==t)if("method"in t){if(!this._methods.hasOwnProperty(t.method))return;const e=(...e)=>{const n={arguments:e,protocol:i,response:t.sequence,version:"1.0.0"};this._port.postMessage(n)};this._methods[t.method](...t.arguments,e)}else if("response"in t){const e=this._callbacks[t.response];delete this._callbacks[t.response],e&&e(...t.arguments)}}}},{"./listener-collection":88}],90:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.matchShortcut=s,n.installShortcut=a,n.useShortcut=function(e,t,{rootElement:n=document.body}={}){(0,i.useEffect)((()=>{if(e)return a(e,t,{rootElement:n})}),[e,t,n])};var o=e("@hypothesis/frontend-shared"),i=e("preact/hooks");const r={alt:1,ctrl:2,meta:4,shift:8};function s(e,t){const n=t.split("+").map((e=>e.toLowerCase()));let i=0,s=null;for(let o of n){const e=r[o];if(e)i|=e;else{if(null!==s)throw new Error("Multiple non-modifier keys specified");s=o}}if(!s)throw new Error(`Invalid shortcut: ${t}`);return((e.ctrlKey?r.ctrl:0)|(e.metaKey?r.meta:0)|(e.altKey?r.alt:0)|(e.shiftKey?r.shift:0))===i&&(0,o.normalizeKeyName)(e.key).toLowerCase()===s}function a(e,t,{rootElement:n=document.body}={}){const o=n=>{s(n,e)&&t(n)};return n.addEventListener("keydown",o),()=>n.removeEventListener("keydown",o)}},{"@hypothesis/frontend-shared":17,"preact/hooks":26}],91:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.toBoolean=function(e){if("string"==typeof e&&"false"===e.trim().toLocaleLowerCase())return!1;const t=Number(e);return isNaN(t)?"string"==typeof e:Boolean(t)},n.toInteger=function(e){return parseInt(e)},n.toObject=function(e){return"object"==typeof e&&null!==e?e:{}},n.toString=function(e){return e&&"function"==typeof e.toString?e.toString():""}},{}],92:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isTouchDevice=n.isIOS=n.isMacOS=void 0;n.isMacOS=(e=window.navigator.userAgent)=>e.indexOf("Mac OS")>=0;n.isIOS=(e=window.navigator,t="ontouchend"in document)=>["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(e.platform)||e.userAgent.includes("Mac")&&t;n.isTouchDevice=(e=window)=>e.matchMedia("(pointer: coarse)").matches},{}],93:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=i;let o={};function i(...e){const t=e.join();t in o||(console.warn(...e),o[t]=!0)}i.reset=()=>{o={}}},{}]},{},[59]);
|
|
14
14
|
//# sourceMappingURL=annotator.bundle.js.map
|