@teipublisher/pb-components 2.14.5 → 2.15.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/CHANGELOG.md +23 -0
- package/dist/pb-components-bundle.js +6 -5
- package/i18n/common/de.json +47 -24
- package/i18n/common/en.json +4 -1
- package/i18n/common/es.json +62 -13
- package/package.json +1 -1
- package/src/authority/custom.js +1 -0
- package/src/pb-authority-lookup.js +4 -3
- package/src/pb-view-annotate.js +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
# [2.15.0](https://github.com/eeditiones/tei-publisher-components/compare/v2.14.6...v2.15.0) (2023-11-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **i18n:** corrects preposition ([0f702ae](https://github.com/eeditiones/tei-publisher-components/commit/0f702aeabdd81e152503a410b048e7dc15af3229))
|
|
7
|
+
* **i18n:** minor correction in es translation ([811ff02](https://github.com/eeditiones/tei-publisher-components/commit/811ff02b91aa461d885933fdba66b6f318e575d4))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* **i18n:** adds missing translations in spanish ([4c231ab](https://github.com/eeditiones/tei-publisher-components/commit/4c231ab9dbdfcbed6429480d637dc676cb7b8aa1))
|
|
13
|
+
|
|
14
|
+
## [2.14.6](https://github.com/eeditiones/tei-publisher-components/compare/v2.14.5...v2.14.6) (2023-11-21)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **pb-authority-lookup:** add missing i18n labels ([cdf33cb](https://github.com/eeditiones/tei-publisher-components/commit/cdf33cbe6194a4165f308f9e9f94af310def8b7f))
|
|
20
|
+
* **pb-authority-lookup:** fix undefined error ([d549209](https://github.com/eeditiones/tei-publisher-components/commit/d5492091c4b9a02ee6c345e61ad424ee554a70fe))
|
|
21
|
+
* **pb-authority-lookup,custom:** add property to info event details if authority is editable ([fd2e388](https://github.com/eeditiones/tei-publisher-components/commit/fd2e3885402e2cde219be1c3f9db4c162bdfd336))
|
|
22
|
+
* **pb-view-annotate:** add callback function to pb-annotation-detail event; refreshes popover position when called ([b76bf9f](https://github.com/eeditiones/tei-publisher-components/commit/b76bf9fd0cd7df30d5dc89f180dcb313e7ea836c))
|
|
23
|
+
|
|
1
24
|
## [2.14.5](https://github.com/eeditiones/tei-publisher-components/compare/v2.14.4...v2.14.5) (2023-11-17)
|
|
2
25
|
|
|
3
26
|
|
|
@@ -507,7 +507,7 @@ const et=n`
|
|
|
507
507
|
border-color: #999;
|
|
508
508
|
color: #999;
|
|
509
509
|
}
|
|
510
|
-
`}}customElements.define("pb-demo-snippet",at);class lt{static subscribe(t,e,i,n=!1){const r=lt._getChannels(e),o=document.addEventListener(t,t=>{i&&t.detail&&t.detail.key&&r.includes(t.detail.key)&&i(t,o)},{once:n})}static subscribeOnce(t,e=null){const i=lt._getChannels(e);return new Promise(e=>{document.addEventListener(t,t=>{t.detail&&t.detail.key&&i.includes(t.detail.key)&&e(t)},{once:!0})})}static _getChannels(t){return null!==t&&t.length?Array.isArray(t)?t:[t]:[N]}static emit(t,e=null,i=null){const n=i||{};n.key=e||N;const r=new CustomEvent(t,{detail:n});document.dispatchEvent(r)}}window.pbEvents||(window.pbEvents=lt);const ct="2.14.5";class ht extends V{static get properties(){return Object.assign({version:{type:String,reflect:!0}},super.properties)}constructor(){super(),this.version=ct}connectedCallback(){if(super.connectedCallback(),!this.version){const t=P("../package.json");fetch(t).then(t=>t.json()).then(t=>{this.version=t.version})}}render(){return I`<span>${this.version?this.version:"unknown"}</span>`}createRenderRoot(){return this}}customElements.define("pb-version",ht);var dt="top",pt="bottom",ut="right",gt="left",ft="auto",mt=[dt,pt,ut,gt],vt="start",bt="end",yt="clippingParents",_t="viewport",wt="popper",xt="reference",kt=mt.reduce((function(t,e){return t.concat([e+"-"+vt,e+"-"+bt])}),[]),At=[].concat(mt,[ft]).reduce((function(t,e){return t.concat([e,e+"-"+vt,e+"-"+bt])}),[]),St=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function zt(t){return t?(t.nodeName||"").toLowerCase():null}function Ct(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Et(t){return t instanceof Ct(t).Element||t instanceof Element}function Tt(t){return t instanceof Ct(t).HTMLElement||t instanceof HTMLElement}function Lt(t){return"undefined"!=typeof ShadowRoot&&(t instanceof Ct(t).ShadowRoot||t instanceof ShadowRoot)}function Mt(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},r=e.elements[t];Tt(r)&&zt(r)&&(Object.assign(r.style,i),Object.keys(n).forEach((function(t){var e=n[t];!1===e?r.removeAttribute(t):r.setAttribute(t,!0===e?"":e)})))}))}function Ot(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach((function(t){var n=e.elements[t],r=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce((function(t,e){return t[e]="",t}),{});Tt(n)&&zt(n)&&(Object.assign(n.style,o),Object.keys(r).forEach((function(t){n.removeAttribute(t)})))}))}}var $t={name:"applyStyles",enabled:!0,phase:"write",fn:Mt,effect:Ot,requires:["computeStyles"]};function Ht(t){return t.split("-")[0]}var It=Math.max,Rt=Math.min,Pt=Math.round;function Vt(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function Nt(){return!/^((?!chrome|android).)*safari/i.test(Vt())}function Dt(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=t.getBoundingClientRect(),r=1,o=1;e&&Tt(t)&&(r=t.offsetWidth>0&&Pt(n.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Pt(n.height)/t.offsetHeight||1);var s=(Et(t)?Ct(t):window).visualViewport,a=!Nt()&&i,l=(n.left+(a&&s?s.offsetLeft:0))/r,c=(n.top+(a&&s?s.offsetTop:0))/o,h=n.width/r,d=n.height/o;return{width:h,height:d,top:c,right:l+h,bottom:c+d,left:l,x:l,y:c}}function Ft(t){var e=Dt(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function Bt(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&Lt(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function jt(t){return Ct(t).getComputedStyle(t)}function qt(t){return["table","td","th"].indexOf(zt(t))>=0}function Ut(t){return((Et(t)?t.ownerDocument:t.document)||window.document).documentElement}function Wt(t){return"html"===zt(t)?t:t.assignedSlot||t.parentNode||(Lt(t)?t.host:null)||Ut(t)}function Yt(t){return Tt(t)&&"fixed"!==jt(t).position?t.offsetParent:null}function Gt(t){var e=/firefox/i.test(Vt());if(/Trident/i.test(Vt())&&Tt(t)&&"fixed"===jt(t).position)return null;var i=Wt(t);for(Lt(i)&&(i=i.host);Tt(i)&&["html","body"].indexOf(zt(i))<0;){var n=jt(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}function Kt(t){for(var e=Ct(t),i=Yt(t);i&&qt(i)&&"static"===jt(i).position;)i=Yt(i);return i&&("html"===zt(i)||"body"===zt(i)&&"static"===jt(i).position)?e:i||Gt(t)||e}function Xt(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Zt(t,e,i){return It(t,Rt(e,i))}function Qt(t,e,i){var n=Zt(t,e,i);return n>i?i:n}function Jt(){return{top:0,right:0,bottom:0,left:0}}function te(t){return Object.assign({},Jt(),t)}function ee(t,e){return e.reduce((function(e,i){return e[i]=t,e}),{})}var ie=function(t,e){return te("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:ee(t,mt))};function ne(t){var e,i=t.state,n=t.name,r=t.options,o=i.elements.arrow,s=i.modifiersData.popperOffsets,a=Ht(i.placement),l=Xt(a),c=[gt,ut].indexOf(a)>=0?"height":"width";if(o&&s){var h=ie(r.padding,i),d=Ft(o),p="y"===l?dt:gt,u="y"===l?pt:ut,g=i.rects.reference[c]+i.rects.reference[l]-s[l]-i.rects.popper[c],f=s[l]-i.rects.reference[l],m=Kt(o),v=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,b=g/2-f/2,y=h[p],_=v-d[c]-h[u],w=v/2-d[c]/2+b,x=Zt(y,w,_),k=l;i.modifiersData[n]=((e={})[k]=x,e.centerOffset=x-w,e)}}function re(t){var e=t.state,i=t.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&Bt(e.elements.popper,n)&&(e.elements.arrow=n)}function oe(t){return t.split("-")[1]}var se={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ae(t,e){var i=t.x,n=t.y,r=e.devicePixelRatio||1;return{x:Pt(i*r)/r||0,y:Pt(n*r)/r||0}}function le(t){var e,i=t.popper,n=t.popperRect,r=t.placement,o=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,h=t.roundOffsets,d=t.isFixed,p=s.x,u=void 0===p?0:p,g=s.y,f=void 0===g?0:g,m="function"==typeof h?h({x:u,y:f}):{x:u,y:f};u=m.x,f=m.y;var v=s.hasOwnProperty("x"),b=s.hasOwnProperty("y"),y=gt,_=dt,w=window;if(c){var x=Kt(i),k="clientHeight",A="clientWidth";if(x===Ct(i)&&"static"!==jt(x=Ut(i)).position&&"absolute"===a&&(k="scrollHeight",A="scrollWidth"),x=x,r===dt||(r===gt||r===ut)&&o===bt)_=pt,f-=(d&&x===w&&w.visualViewport?w.visualViewport.height:x[k])-n.height,f*=l?1:-1;if(r===gt||(r===dt||r===pt)&&o===bt)y=ut,u-=(d&&x===w&&w.visualViewport?w.visualViewport.width:x[A])-n.width,u*=l?1:-1}var S,z=Object.assign({position:a},c&&se),C=!0===h?ae({x:u,y:f},Ct(i)):{x:u,y:f};return u=C.x,f=C.y,l?Object.assign({},z,((S={})[_]=b?"0":"",S[y]=v?"0":"",S.transform=(w.devicePixelRatio||1)<=1?"translate("+u+"px, "+f+"px)":"translate3d("+u+"px, "+f+"px, 0)",S)):Object.assign({},z,((e={})[_]=b?f+"px":"",e[y]=v?u+"px":"",e.transform="",e))}function ce(t){var e=t.state,i=t.options,n=i.gpuAcceleration,r=void 0===n||n,o=i.adaptive,s=void 0===o||o,a=i.roundOffsets,l=void 0===a||a,c={placement:Ht(e.placement),variation:oe(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,le(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,le(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var he={passive:!0};function de(t){var e=t.state,i=t.instance,n=t.options,r=n.scroll,o=void 0===r||r,s=n.resize,a=void 0===s||s,l=Ct(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach((function(t){t.addEventListener("scroll",i.update,he)})),a&&l.addEventListener("resize",i.update,he),function(){o&&c.forEach((function(t){t.removeEventListener("scroll",i.update,he)})),a&&l.removeEventListener("resize",i.update,he)}}var pe={left:"right",right:"left",bottom:"top",top:"bottom"};function ue(t){return t.replace(/left|right|bottom|top/g,(function(t){return pe[t]}))}var ge={start:"end",end:"start"};function fe(t){return t.replace(/start|end/g,(function(t){return ge[t]}))}function me(t){var e=Ct(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ve(t){return Dt(Ut(t)).left+me(t).scrollLeft}function be(t,e){var i=Ct(t),n=Ut(t),r=i.visualViewport,o=n.clientWidth,s=n.clientHeight,a=0,l=0;if(r){o=r.width,s=r.height;var c=Nt();(c||!c&&"fixed"===e)&&(a=r.offsetLeft,l=r.offsetTop)}return{width:o,height:s,x:a+ve(t),y:l}}function ye(t){var e,i=Ut(t),n=me(t),r=null==(e=t.ownerDocument)?void 0:e.body,o=It(i.scrollWidth,i.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=It(i.scrollHeight,i.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-n.scrollLeft+ve(t),l=-n.scrollTop;return"rtl"===jt(r||i).direction&&(a+=It(i.clientWidth,r?r.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function _e(t){var e=jt(t),i=e.overflow,n=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+r+n)}function we(t){return["html","body","#document"].indexOf(zt(t))>=0?t.ownerDocument.body:Tt(t)&&_e(t)?t:we(Wt(t))}function xe(t,e){var i;void 0===e&&(e=[]);var n=we(t),r=n===(null==(i=t.ownerDocument)?void 0:i.body),o=Ct(n),s=r?[o].concat(o.visualViewport||[],_e(n)?n:[]):n,a=e.concat(s);return r?a:a.concat(xe(Wt(s)))}function ke(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Ae(t,e){var i=Dt(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}function Se(t,e,i){return e===_t?ke(be(t,i)):Et(e)?Ae(e,i):ke(ye(Ut(t)))}function ze(t){var e=xe(Wt(t)),i=["absolute","fixed"].indexOf(jt(t).position)>=0&&Tt(t)?Kt(t):t;return Et(i)?e.filter((function(t){return Et(t)&&Bt(t,i)&&"body"!==zt(t)})):[]}function Ce(t,e,i,n){var r="clippingParents"===e?ze(t):[].concat(e),o=[].concat(r,[i]),s=o[0],a=o.reduce((function(e,i){var r=Se(t,i,n);return e.top=It(r.top,e.top),e.right=Rt(r.right,e.right),e.bottom=Rt(r.bottom,e.bottom),e.left=It(r.left,e.left),e}),Se(t,s,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Ee(t){var e,i=t.reference,n=t.element,r=t.placement,o=r?Ht(r):null,s=r?oe(r):null,a=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(o){case dt:e={x:a,y:i.y-n.height};break;case pt:e={x:a,y:i.y+i.height};break;case ut:e={x:i.x+i.width,y:l};break;case gt:e={x:i.x-n.width,y:l};break;default:e={x:i.x,y:i.y}}var c=o?Xt(o):null;if(null!=c){var h="y"===c?"height":"width";switch(s){case vt:e[c]=e[c]-(i[h]/2-n[h]/2);break;case bt:e[c]=e[c]+(i[h]/2-n[h]/2)}}return e}function Te(t,e){void 0===e&&(e={});var i=e,n=i.placement,r=void 0===n?t.placement:n,o=i.strategy,s=void 0===o?t.strategy:o,a=i.boundary,l=void 0===a?yt:a,c=i.rootBoundary,h=void 0===c?_t:c,d=i.elementContext,p=void 0===d?wt:d,u=i.altBoundary,g=void 0!==u&&u,f=i.padding,m=void 0===f?0:f,v=te("number"!=typeof m?m:ee(m,mt)),b=p===wt?xt:wt,y=t.rects.popper,_=t.elements[g?b:p],w=Ce(Et(_)?_:_.contextElement||Ut(t.elements.popper),l,h,s),x=Dt(t.elements.reference),k=Ee({reference:x,element:y,strategy:"absolute",placement:r}),A=ke(Object.assign({},y,k)),S=p===wt?A:x,z={top:w.top-S.top+v.top,bottom:S.bottom-w.bottom+v.bottom,left:w.left-S.left+v.left,right:S.right-w.right+v.right},C=t.modifiersData.offset;if(p===wt&&C){var E=C[r];Object.keys(z).forEach((function(t){var e=[ut,pt].indexOf(t)>=0?1:-1,i=[dt,pt].indexOf(t)>=0?"y":"x";z[t]+=E[i]*e}))}return z}function Le(t,e){void 0===e&&(e={});var i=e,n=i.placement,r=i.boundary,o=i.rootBoundary,s=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=void 0===l?At:l,h=oe(n),d=h?a?kt:kt.filter((function(t){return oe(t)===h})):mt,p=d.filter((function(t){return c.indexOf(t)>=0}));0===p.length&&(p=d);var u=p.reduce((function(e,i){return e[i]=Te(t,{placement:i,boundary:r,rootBoundary:o,padding:s})[Ht(i)],e}),{});return Object.keys(u).sort((function(t,e){return u[t]-u[e]}))}function Me(t){if(Ht(t)===ft)return[];var e=ue(t);return[fe(t),e,fe(e)]}function Oe(t){var e=t.state,i=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var r=i.mainAxis,o=void 0===r||r,s=i.altAxis,a=void 0===s||s,l=i.fallbackPlacements,c=i.padding,h=i.boundary,d=i.rootBoundary,p=i.altBoundary,u=i.flipVariations,g=void 0===u||u,f=i.allowedAutoPlacements,m=e.options.placement,v=Ht(m),b=l||(v===m||!g?[ue(m)]:Me(m)),y=[m].concat(b).reduce((function(t,i){return t.concat(Ht(i)===ft?Le(e,{placement:i,boundary:h,rootBoundary:d,padding:c,flipVariations:g,allowedAutoPlacements:f}):i)}),[]),_=e.rects.reference,w=e.rects.popper,x=new Map,k=!0,A=y[0],S=0;S<y.length;S++){var z=y[S],C=Ht(z),E=oe(z)===vt,T=[dt,pt].indexOf(C)>=0,L=T?"width":"height",M=Te(e,{placement:z,boundary:h,rootBoundary:d,altBoundary:p,padding:c}),O=T?E?ut:gt:E?pt:dt;_[L]>w[L]&&(O=ue(O));var $=ue(O),H=[];if(o&&H.push(M[C]<=0),a&&H.push(M[O]<=0,M[$]<=0),H.every((function(t){return t}))){A=z,k=!1;break}x.set(z,H)}if(k)for(var I=function(t){var e=y.find((function(e){var i=x.get(e);if(i)return i.slice(0,t).every((function(t){return t}))}));if(e)return A=e,"break"},R=g?3:1;R>0;R--){if("break"===I(R))break}e.placement!==A&&(e.modifiersData[n]._skip=!0,e.placement=A,e.reset=!0)}}function $e(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function He(t){return[dt,ut,pt,gt].some((function(e){return t[e]>=0}))}function Ie(t){var e=t.state,i=t.name,n=e.rects.reference,r=e.rects.popper,o=e.modifiersData.preventOverflow,s=Te(e,{elementContext:"reference"}),a=Te(e,{altBoundary:!0}),l=$e(s,n),c=$e(a,r,o),h=He(l),d=He(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":d})}function Re(t,e,i){var n=Ht(t),r=[gt,dt].indexOf(n)>=0?-1:1,o="function"==typeof i?i(Object.assign({},e,{placement:t})):i,s=o[0],a=o[1];return s=s||0,a=(a||0)*r,[gt,ut].indexOf(n)>=0?{x:a,y:s}:{x:s,y:a}}function Pe(t){var e=t.state,i=t.options,n=t.name,r=i.offset,o=void 0===r?[0,0]:r,s=At.reduce((function(t,i){return t[i]=Re(i,e.rects,o),t}),{}),a=s[e.placement],l=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=s}function Ve(t){var e=t.state,i=t.name;e.modifiersData[i]=Ee({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}function Ne(t){return"x"===t?"y":"x"}function De(t){var e=t.state,i=t.options,n=t.name,r=i.mainAxis,o=void 0===r||r,s=i.altAxis,a=void 0!==s&&s,l=i.boundary,c=i.rootBoundary,h=i.altBoundary,d=i.padding,p=i.tether,u=void 0===p||p,g=i.tetherOffset,f=void 0===g?0:g,m=Te(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:h}),v=Ht(e.placement),b=oe(e.placement),y=!b,_=Xt(v),w=Ne(_),x=e.modifiersData.popperOffsets,k=e.rects.reference,A=e.rects.popper,S="function"==typeof f?f(Object.assign({},e.rects,{placement:e.placement})):f,z="number"==typeof S?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),C=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,E={x:0,y:0};if(x){if(o){var T,L="y"===_?dt:gt,M="y"===_?pt:ut,O="y"===_?"height":"width",$=x[_],H=$+m[L],I=$-m[M],R=u?-A[O]/2:0,P=b===vt?k[O]:A[O],V=b===vt?-A[O]:-k[O],N=e.elements.arrow,D=u&&N?Ft(N):{width:0,height:0},F=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Jt(),B=F[L],j=F[M],q=Zt(0,k[O],D[O]),U=y?k[O]/2-R-q-B-z.mainAxis:P-q-B-z.mainAxis,W=y?-k[O]/2+R+q+j+z.mainAxis:V+q+j+z.mainAxis,Y=e.elements.arrow&&Kt(e.elements.arrow),G=Y?"y"===_?Y.clientTop||0:Y.clientLeft||0:0,K=null!=(T=null==C?void 0:C[_])?T:0,X=$+W-K,Z=Zt(u?Rt(H,$+U-K-G):H,$,u?It(I,X):I);x[_]=Z,E[_]=Z-$}if(a){var Q,J="x"===_?dt:gt,tt="x"===_?pt:ut,et=x[w],it="y"===w?"height":"width",nt=et+m[J],rt=et-m[tt],ot=-1!==[dt,gt].indexOf(v),st=null!=(Q=null==C?void 0:C[w])?Q:0,at=ot?nt:et-k[it]-A[it]-st+z.altAxis,lt=ot?et+k[it]+A[it]-st-z.altAxis:rt,ct=u&&ot?Qt(at,et,lt):Zt(u?at:nt,et,u?lt:rt);x[w]=ct,E[w]=ct-et}e.modifiersData[n]=E}}function Fe(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Be(t){return t!==Ct(t)&&Tt(t)?Fe(t):me(t)}function je(t){var e=t.getBoundingClientRect(),i=Pt(e.width)/t.offsetWidth||1,n=Pt(e.height)/t.offsetHeight||1;return 1!==i||1!==n}function qe(t,e,i){void 0===i&&(i=!1);var n=Tt(e),r=Tt(e)&&je(e),o=Ut(e),s=Dt(t,r,i),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!i)&&(("body"!==zt(e)||_e(o))&&(a=Be(e)),Tt(e)?((l=Dt(e,!0)).x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=ve(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function Ue(t){var e=new Map,i=new Set,n=[];function r(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!i.has(t)){var n=e.get(t);n&&r(n)}})),n.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){i.has(t.name)||r(t)})),n}function We(t){var e=Ue(t);return St.reduce((function(t,i){return t.concat(e.filter((function(t){return t.phase===i})))}),[])}function Ye(t){var e;return function(){return e||(e=new Promise((function(i){Promise.resolve().then((function(){e=void 0,i(t())}))}))),e}}function Ge(t){var e=t.reduce((function(t,e){var i=t[e.name];return t[e.name]=i?Object.assign({},i,e,{options:Object.assign({},i.options,e.options),data:Object.assign({},i.data,e.data)}):e,t}),{});return Object.keys(e).map((function(t){return e[t]}))}var Ke={placement:"bottom",modifiers:[],strategy:"absolute"};function Xe(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return!e.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function Ze(t){void 0===t&&(t={});var e=t,i=e.defaultModifiers,n=void 0===i?[]:i,r=e.defaultOptions,o=void 0===r?Ke:r;return function(t,e,i){void 0===i&&(i=o);var r={placement:"bottom",orderedModifiers:[],options:Object.assign({},Ke,o),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},s=[],a=!1,l={state:r,setOptions:function(i){var s="function"==typeof i?i(r.options):i;h(),r.options=Object.assign({},o,r.options,s),r.scrollParents={reference:Et(t)?xe(t):t.contextElement?xe(t.contextElement):[],popper:xe(e)};var a=We(Ge([].concat(n,r.options.modifiers)));return r.orderedModifiers=a.filter((function(t){return t.enabled})),c(),l.update()},forceUpdate:function(){if(!a){var t=r.elements,e=t.reference,i=t.popper;if(Xe(e,i)){r.rects={reference:qe(e,Kt(i),"fixed"===r.options.strategy),popper:Ft(i)},r.reset=!1,r.placement=r.options.placement,r.orderedModifiers.forEach((function(t){return r.modifiersData[t.name]=Object.assign({},t.data)}));for(var n=0;n<r.orderedModifiers.length;n++)if(!0!==r.reset){var o=r.orderedModifiers[n],s=o.fn,c=o.options,h=void 0===c?{}:c,d=o.name;"function"==typeof s&&(r=s({state:r,options:h,name:d,instance:l})||r)}else r.reset=!1,n=-1}}},update:Ye((function(){return new Promise((function(t){l.forceUpdate(),t(r)}))})),destroy:function(){h(),a=!0}};if(!Xe(t,e))return l;function c(){r.orderedModifiers.forEach((function(t){var e=t.name,i=t.options,n=void 0===i?{}:i,o=t.effect;if("function"==typeof o){var a=o({state:r,name:e,instance:l,options:n}),c=function(){};s.push(a||c)}}))}function h(){s.forEach((function(t){return t()})),s=[]}return l.setOptions(i).then((function(t){!a&&i.onFirstUpdate&&i.onFirstUpdate(t)})),l}}var Qe=Ze({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:de,data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:Ve,data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:ce,data:{}},$t,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Pe},{name:"flip",enabled:!0,phase:"main",fn:Oe,requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:De,requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:ne,effect:re,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Ie}]}),Je="tippy-box",ti="tippy-content",ei="tippy-backdrop",ii="tippy-arrow",ni="tippy-svg-arrow",ri={passive:!0,capture:!0},oi=function(){return document.body};function si(t,e,i){if(Array.isArray(t)){var n=t[e];return null==n?Array.isArray(i)?i[e]:i:n}return t}function ai(t,e){var i={}.toString.call(t);return 0===i.indexOf("[object")&&i.indexOf(e+"]")>-1}function li(t,e){return"function"==typeof t?t.apply(void 0,e):t}function ci(t,e){return 0===e?t:function(n){clearTimeout(i),i=setTimeout((function(){t(n)}),e)};var i}function hi(t){return t.split(/\s+/).filter(Boolean)}function di(t){return[].concat(t)}function pi(t,e){-1===t.indexOf(e)&&t.push(e)}function ui(t){return t.filter((function(e,i){return t.indexOf(e)===i}))}function gi(t){return t.split("-")[0]}function fi(t){return[].slice.call(t)}function mi(t){return Object.keys(t).reduce((function(e,i){return void 0!==t[i]&&(e[i]=t[i]),e}),{})}function vi(){return document.createElement("div")}function bi(t){return["Element","Fragment"].some((function(e){return ai(t,e)}))}function yi(t){return ai(t,"NodeList")}function _i(t){return ai(t,"MouseEvent")}function wi(t){return!(!t||!t._tippy||t._tippy.reference!==t)}function xi(t){return bi(t)?[t]:yi(t)?fi(t):Array.isArray(t)?t:fi(document.querySelectorAll(t))}function ki(t,e){t.forEach((function(t){t&&(t.style.transitionDuration=e+"ms")}))}function Ai(t,e){t.forEach((function(t){t&&t.setAttribute("data-state",e)}))}function Si(t){var e,i=di(t)[0];return null!=i&&null!=(e=i.ownerDocument)&&e.body?i.ownerDocument:document}function zi(t,e){var i=e.clientX,n=e.clientY;return t.every((function(t){var e=t.popperRect,r=t.popperState,o=t.props.interactiveBorder,s=gi(r.placement),a=r.modifiersData.offset;if(!a)return!0;var l="bottom"===s?a.top.y:0,c="top"===s?a.bottom.y:0,h="right"===s?a.left.x:0,d="left"===s?a.right.x:0,p=e.top-n+l>o,u=n-e.bottom-c>o,g=e.left-i+h>o,f=i-e.right-d>o;return p||u||g||f}))}function Ci(t,e,i){var n=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(e){t[n](e,i)}))}function Ei(t,e){for(var i=e;i;){var n;if(t.contains(i))return!0;i=null==i.getRootNode||null==(n=i.getRootNode())?void 0:n.host}return!1}var Ti={isTouch:!1},Li=0;function Mi(){Ti.isTouch||(Ti.isTouch=!0,window.performance&&document.addEventListener("mousemove",Oi))}function Oi(){var t=performance.now();t-Li<20&&(Ti.isTouch=!1,document.removeEventListener("mousemove",Oi)),Li=t}function $i(){var t=document.activeElement;if(wi(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function Hi(){document.addEventListener("touchstart",Mi,ri),window.addEventListener("blur",$i)}var Ii=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto,Ri={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Pi={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Vi=Object.assign({appendTo:oi,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Ri,Pi),Ni=Object.keys(Vi),Di=function(t){Object.keys(t).forEach((function(e){Vi[e]=t[e]}))};function Fi(t){var e=(t.plugins||[]).reduce((function(e,i){var n,r=i.name,o=i.defaultValue;r&&(e[r]=void 0!==t[r]?t[r]:null!=(n=Vi[r])?n:o);return e}),{});return Object.assign({},t,e)}function Bi(t,e){return(e?Object.keys(Fi(Object.assign({},Vi,{plugins:e}))):Ni).reduce((function(e,i){var n=(t.getAttribute("data-tippy-"+i)||"").trim();if(!n)return e;if("content"===i)e[i]=n;else try{e[i]=JSON.parse(n)}catch(t){e[i]=n}return e}),{})}function ji(t,e){var i=Object.assign({},e,{content:li(e.content,[t])},e.ignoreAttributes?{}:Bi(t,e.plugins));return i.aria=Object.assign({},Vi.aria,i.aria),i.aria={expanded:"auto"===i.aria.expanded?e.interactive:i.aria.expanded,content:"auto"===i.aria.content?e.interactive?null:"describedby":i.aria.content},i}var qi=function(){return"innerHTML"};function Ui(t,e){t[qi()]=e}function Wi(t){var e=vi();return!0===t?e.className=ii:(e.className=ni,bi(t)?e.appendChild(t):Ui(e,t)),e}function Yi(t,e){bi(e.content)?(Ui(t,""),t.appendChild(e.content)):"function"!=typeof e.content&&(e.allowHTML?Ui(t,e.content):t.textContent=e.content)}function Gi(t){var e=t.firstElementChild,i=fi(e.children);return{box:e,content:i.find((function(t){return t.classList.contains(ti)})),arrow:i.find((function(t){return t.classList.contains(ii)||t.classList.contains(ni)})),backdrop:i.find((function(t){return t.classList.contains(ei)}))}}function Ki(t){var e=vi(),i=vi();i.className=Je,i.setAttribute("data-state","hidden"),i.setAttribute("tabindex","-1");var n=vi();function r(i,n){var r=Gi(e),o=r.box,s=r.content,a=r.arrow;n.theme?o.setAttribute("data-theme",n.theme):o.removeAttribute("data-theme"),"string"==typeof n.animation?o.setAttribute("data-animation",n.animation):o.removeAttribute("data-animation"),n.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof n.maxWidth?n.maxWidth+"px":n.maxWidth,n.role?o.setAttribute("role",n.role):o.removeAttribute("role"),i.content===n.content&&i.allowHTML===n.allowHTML||Yi(s,t.props),n.arrow?a?i.arrow!==n.arrow&&(o.removeChild(a),o.appendChild(Wi(n.arrow))):o.appendChild(Wi(n.arrow)):a&&o.removeChild(a)}return n.className=ti,n.setAttribute("data-state","hidden"),Yi(n,t.props),e.appendChild(i),i.appendChild(n),r(t.props,t.props),{popper:e,onUpdate:r}}Ki.$$tippy=!0;var Xi=1,Zi=[],Qi=[];function Ji(t,e){var i,n,r,o,s,a,l,c=ji(t,Object.assign({},Vi,Fi(mi(e)))),h=!1,d=!1,p=!1,u=!1,g=[],f=ci(X,c.interactiveDebounce),m=Xi++,v=null,b=ui(c.plugins),y={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},_={id:m,reference:t,popper:vi(),popperInstance:v,props:c,state:y,plugins:b,clearDelayTimeouts:lt,setProps:ct,setContent:ht,show:dt,hide:pt,hideWithInteractivity:ut,enable:st,disable:at,unmount:gt,destroy:ft};if(!c.render)return _;var w=c.render(_),x=w.popper,k=w.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+_.id,_.popper=x,t._tippy=_,x._tippy=_;var A=b.map((function(t){return t.fn(_)})),S=t.hasAttribute("aria-expanded");return Y(),R(),$(),H("onCreate",[_]),c.showOnCreate&&rt(),x.addEventListener("mouseenter",(function(){_.props.interactive&&_.state.isVisible&&_.clearDelayTimeouts()})),x.addEventListener("mouseleave",(function(){_.props.interactive&&_.props.trigger.indexOf("mouseenter")>=0&&L().addEventListener("mousemove",f)})),_;function z(){var t=_.props.touch;return Array.isArray(t)?t:[t,0]}function C(){return"hold"===z()[0]}function E(){var t;return!(null==(t=_.props.render)||!t.$$tippy)}function T(){return l||t}function L(){var t=T().parentNode;return t?Si(t):document}function M(){return Gi(x)}function O(t){return _.state.isMounted&&!_.state.isVisible||Ti.isTouch||o&&"focus"===o.type?0:si(_.props.delay,t?0:1,Vi.delay)}function $(t){void 0===t&&(t=!1),x.style.pointerEvents=_.props.interactive&&!t?"":"none",x.style.zIndex=""+_.props.zIndex}function H(t,e,i){var n;(void 0===i&&(i=!0),A.forEach((function(i){i[t]&&i[t].apply(i,e)})),i)&&(n=_.props)[t].apply(n,e)}function I(){var e=_.props.aria;if(e.content){var i="aria-"+e.content,n=x.id;di(_.props.triggerTarget||t).forEach((function(t){var e=t.getAttribute(i);if(_.state.isVisible)t.setAttribute(i,e?e+" "+n:n);else{var r=e&&e.replace(n,"").trim();r?t.setAttribute(i,r):t.removeAttribute(i)}}))}}function R(){!S&&_.props.aria.expanded&&di(_.props.triggerTarget||t).forEach((function(t){_.props.interactive?t.setAttribute("aria-expanded",_.state.isVisible&&t===T()?"true":"false"):t.removeAttribute("aria-expanded")}))}function P(){L().removeEventListener("mousemove",f),Zi=Zi.filter((function(t){return t!==f}))}function V(e){if(!Ti.isTouch||!p&&"mousedown"!==e.type){var i=e.composedPath&&e.composedPath()[0]||e.target;if(!_.props.interactive||!Ei(x,i)){if(di(_.props.triggerTarget||t).some((function(t){return Ei(t,i)}))){if(Ti.isTouch)return;if(_.state.isVisible&&_.props.trigger.indexOf("click")>=0)return}else H("onClickOutside",[_,e]);!0===_.props.hideOnClick&&(_.clearDelayTimeouts(),_.hide(),d=!0,setTimeout((function(){d=!1})),_.state.isMounted||B())}}}function N(){p=!0}function D(){p=!1}function F(){var t=L();t.addEventListener("mousedown",V,!0),t.addEventListener("touchend",V,ri),t.addEventListener("touchstart",D,ri),t.addEventListener("touchmove",N,ri)}function B(){var t=L();t.removeEventListener("mousedown",V,!0),t.removeEventListener("touchend",V,ri),t.removeEventListener("touchstart",D,ri),t.removeEventListener("touchmove",N,ri)}function j(t,e){U(t,(function(){!_.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&e()}))}function q(t,e){U(t,e)}function U(t,e){var i=M().box;function n(t){t.target===i&&(Ci(i,"remove",n),e())}if(0===t)return e();Ci(i,"remove",s),Ci(i,"add",n),s=n}function W(e,i,n){void 0===n&&(n=!1),di(_.props.triggerTarget||t).forEach((function(t){t.addEventListener(e,i,n),g.push({node:t,eventType:e,handler:i,options:n})}))}function Y(){C()&&(W("touchstart",K,{passive:!0}),W("touchend",Z,{passive:!0})),hi(_.props.trigger).forEach((function(t){if("manual"!==t)switch(W(t,K),t){case"mouseenter":W("mouseleave",Z);break;case"focus":W(Ii?"focusout":"blur",Q);break;case"focusin":W("focusout",Q)}}))}function G(){g.forEach((function(t){var e=t.node,i=t.eventType,n=t.handler,r=t.options;e.removeEventListener(i,n,r)})),g=[]}function K(t){var e,i=!1;if(_.state.isEnabled&&!J(t)&&!d){var n="focus"===(null==(e=o)?void 0:e.type);o=t,l=t.currentTarget,R(),!_.state.isVisible&&_i(t)&&Zi.forEach((function(e){return e(t)})),"click"===t.type&&(_.props.trigger.indexOf("mouseenter")<0||h)&&!1!==_.props.hideOnClick&&_.state.isVisible?i=!0:rt(t),"click"===t.type&&(h=!i),i&&!n&&ot(t)}}function X(t){var e=t.target,i=T().contains(e)||x.contains(e);"mousemove"===t.type&&i||zi(nt().concat(x).map((function(t){var e,i=null==(e=t._tippy.popperInstance)?void 0:e.state;return i?{popperRect:t.getBoundingClientRect(),popperState:i,props:c}:null})).filter(Boolean),t)&&(P(),ot(t))}function Z(t){J(t)||_.props.trigger.indexOf("click")>=0&&h||(_.props.interactive?_.hideWithInteractivity(t):ot(t))}function Q(t){_.props.trigger.indexOf("focusin")<0&&t.target!==T()||_.props.interactive&&t.relatedTarget&&x.contains(t.relatedTarget)||ot(t)}function J(t){return!!Ti.isTouch&&C()!==t.type.indexOf("touch")>=0}function tt(){et();var e=_.props,i=e.popperOptions,n=e.placement,r=e.offset,o=e.getReferenceClientRect,s=e.moveTransition,l=E()?Gi(x).arrow:null,c=o?{getBoundingClientRect:o,contextElement:o.contextElement||T()}:t,h=[{name:"offset",options:{offset:r}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var e=t.state;if(E()){var i=M().box;["placement","reference-hidden","escaped"].forEach((function(t){"placement"===t?i.setAttribute("data-placement",e.placement):e.attributes.popper["data-popper-"+t]?i.setAttribute("data-"+t,""):i.removeAttribute("data-"+t)})),e.attributes.popper={}}}}];E()&&l&&h.push({name:"arrow",options:{element:l,padding:3}}),h.push.apply(h,(null==i?void 0:i.modifiers)||[]),_.popperInstance=Qe(c,x,Object.assign({},i,{placement:n,onFirstUpdate:a,modifiers:h}))}function et(){_.popperInstance&&(_.popperInstance.destroy(),_.popperInstance=null)}function it(){var t,e=_.props.appendTo,i=T();(t=_.props.interactive&&e===oi||"parent"===e?i.parentNode:li(e,[i])).contains(x)||t.appendChild(x),_.state.isMounted=!0,tt()}function nt(){return fi(x.querySelectorAll("[data-tippy-root]"))}function rt(t){_.clearDelayTimeouts(),t&&H("onTrigger",[_,t]),F();var e=O(!0),n=z(),r=n[0],o=n[1];Ti.isTouch&&"hold"===r&&o&&(e=o),e?i=setTimeout((function(){_.show()}),e):_.show()}function ot(t){if(_.clearDelayTimeouts(),H("onUntrigger",[_,t]),_.state.isVisible){if(!(_.props.trigger.indexOf("mouseenter")>=0&&_.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&h)){var e=O(!1);e?n=setTimeout((function(){_.state.isVisible&&_.hide()}),e):r=requestAnimationFrame((function(){_.hide()}))}}else B()}function st(){_.state.isEnabled=!0}function at(){_.hide(),_.state.isEnabled=!1}function lt(){clearTimeout(i),clearTimeout(n),cancelAnimationFrame(r)}function ct(e){if(!_.state.isDestroyed){H("onBeforeUpdate",[_,e]),G();var i=_.props,n=ji(t,Object.assign({},i,mi(e),{ignoreAttributes:!0}));_.props=n,Y(),i.interactiveDebounce!==n.interactiveDebounce&&(P(),f=ci(X,n.interactiveDebounce)),i.triggerTarget&&!n.triggerTarget?di(i.triggerTarget).forEach((function(t){t.removeAttribute("aria-expanded")})):n.triggerTarget&&t.removeAttribute("aria-expanded"),R(),$(),k&&k(i,n),_.popperInstance&&(tt(),nt().forEach((function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)}))),H("onAfterUpdate",[_,e])}}function ht(t){_.setProps({content:t})}function dt(){var t=_.state.isVisible,e=_.state.isDestroyed,i=!_.state.isEnabled,n=Ti.isTouch&&!_.props.touch,r=si(_.props.duration,0,Vi.duration);if(!(t||e||i||n||T().hasAttribute("disabled")||(H("onShow",[_],!1),!1===_.props.onShow(_)))){if(_.state.isVisible=!0,E()&&(x.style.visibility="visible"),$(),F(),_.state.isMounted||(x.style.transition="none"),E()){var o=M();ki([o.box,o.content],0)}a=function(){var t;if(_.state.isVisible&&!u){if(u=!0,x.offsetHeight,x.style.transition=_.props.moveTransition,E()&&_.props.animation){var e=M(),i=e.box,n=e.content;ki([i,n],r),Ai([i,n],"visible")}I(),R(),pi(Qi,_),null==(t=_.popperInstance)||t.forceUpdate(),H("onMount",[_]),_.props.animation&&E()&&q(r,(function(){_.state.isShown=!0,H("onShown",[_])}))}},it()}}function pt(){var t=!_.state.isVisible,e=_.state.isDestroyed,i=!_.state.isEnabled,n=si(_.props.duration,1,Vi.duration);if(!(t||e||i)&&(H("onHide",[_],!1),!1!==_.props.onHide(_))){if(_.state.isVisible=!1,_.state.isShown=!1,u=!1,h=!1,E()&&(x.style.visibility="hidden"),P(),B(),$(!0),E()){var r=M(),o=r.box,s=r.content;_.props.animation&&(ki([o,s],n),Ai([o,s],"hidden"))}I(),R(),_.props.animation?E()&&j(n,_.unmount):_.unmount()}}function ut(t){L().addEventListener("mousemove",f),pi(Zi,f),f(t)}function gt(){_.state.isVisible&&_.hide(),_.state.isMounted&&(et(),nt().forEach((function(t){t._tippy.unmount()})),x.parentNode&&x.parentNode.removeChild(x),Qi=Qi.filter((function(t){return t!==_})),_.state.isMounted=!1,H("onHidden",[_]))}function ft(){_.state.isDestroyed||(_.clearDelayTimeouts(),_.unmount(),G(),delete t._tippy,_.state.isDestroyed=!0,H("onDestroy",[_]))}}function tn(t,e){void 0===e&&(e={});var i=Vi.plugins.concat(e.plugins||[]);Hi();var n=Object.assign({},e,{plugins:i}),r=xi(t).reduce((function(t,e){var i=e&&Ji(e,n);return i&&t.push(i),t}),[]);return bi(t)?r[0]:r}tn.defaultProps=Vi,tn.setDefaultProps=Di,tn.currentInput=Ti;Object.assign({},$t,{effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow)}});function en(t){return t.replace(/(?:^\w|[A-Z]|\b\w)/g,(t,e)=>0==+t?"":0===e?t.toLowerCase():t.toUpperCase()).replace("-","")}tn.setDefaultProps({render:Ki});const nn='\n .tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n }\n\n .tippy-iOS {\n cursor: pointer!important;\n -webkit-tap-highlight-color: transparent\n }\n\n [data-tippy-root] {\n max-width: calc(100vw - 10px)\n }\n\n .tippy-box {\n position: relative;\n background-color: #333;\n color: #fff;\n border-radius: 4px;\n font-size: var(--pb-popover-font-size, var(--pb-base-font-size, 14px));\n line-height: var(--pb-popover-line-height, var(--pb-base-line-height, 1.4));\n text-align: left;\n font-style: normal;\n font-weight: normal;\n outline: 0;\n transition-property: transform, visibility, opacity\n }\n\n .tippy-box[data-placement^=top]>.tippy-arrow {\n bottom: 0\n }\n\n .tippy-box[data-placement^=top]>.tippy-arrow:before {\n bottom: -7px;\n left: 0;\n border-width: 8px 8px 0;\n border-top-color: initial;\n transform-origin: center top\n }\n\n .tippy-box[data-placement^=bottom]>.tippy-arrow {\n top: 0\n }\n\n .tippy-box[data-placement^=bottom]>.tippy-arrow:before {\n top: -7px;\n left: 0;\n border-width: 0 8px 8px;\n border-bottom-color: initial;\n transform-origin: center bottom\n }\n\n .tippy-box[data-placement^=left]>.tippy-arrow {\n right: 0\n }\n\n .tippy-box[data-placement^=left]>.tippy-arrow:before {\n border-width: 8px 0 8px 8px;\n border-left-color: initial;\n right: -7px;\n transform-origin: center left\n }\n\n .tippy-box[data-placement^=right]>.tippy-arrow {\n left: 0\n }\n\n .tippy-box[data-placement^=right]>.tippy-arrow:before {\n left: -7px;\n border-width: 8px 8px 8px 0;\n border-right-color: initial;\n transform-origin: center right\n }\n\n .tippy-box[data-inertia][data-state=visible] {\n transition-timing-function: cubic-bezier(.54, 1.5, .38, 1.11)\n }\n\n .tippy-arrow {\n width: 16px;\n height: 16px;\n color: #333\n }\n\n .tippy-arrow:before {\n content: "";\n position: absolute;\n border-color: transparent;\n border-style: solid\n }\n\n .tippy-content {\n position: relative;\n padding: 5px 9px;\n z-index: 1;\n overflow: auto;\n max-height: var(--pb-popover-max-height, calc(100vh - 60px));\n min-height: var(--pb-popover-min-height, auto);\n max-width: var(--pb-popover-max-width, auto);\n min-width: var(--pb-popover-min-width, auto);\n color: var(--pb-popover-color);\n }\n',rn='\n .tippy-box[data-theme~=light-border] {\n background-color: #fff;\n background-clip: padding-box;\n border: 1px solid rgba(0, 8, 16, .15);\n color: #333;\n box-shadow: 0 4px 14px -2px rgba(0, 8, 16, .08)\n }\n\n .tippy-box[data-theme~=light-border]>.tippy-backdrop {\n background-color: #fff\n }\n\n .tippy-box[data-theme~=light-border]>.tippy-arrow:after, .tippy-box[data-theme~=light-border]>.tippy-svg-arrow:after {\n content: "";\n position: absolute;\n z-index: -1\n }\n\n .tippy-box[data-theme~=light-border]>.tippy-arrow:after {\n border-color: transparent;\n border-style: solid\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-arrow:before {\n border-top-color: #fff\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-arrow:after {\n border-top-color: rgba(0, 8, 16, .2);\n border-width: 7px 7px 0;\n top: 17px;\n left: 1px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-svg-arrow>svg {\n top: 16px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-svg-arrow:after {\n top: 17px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-arrow:before {\n border-bottom-color: #fff;\n bottom: 16px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-arrow:after {\n border-bottom-color: rgba(0, 8, 16, .2);\n border-width: 0 7px 7px;\n bottom: 17px;\n left: 1px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-svg-arrow>svg {\n bottom: 16px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-svg-arrow:after {\n bottom: 17px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-arrow:before {\n border-left-color: #fff\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-arrow:after {\n border-left-color: rgba(0, 8, 16, .2);\n border-width: 7px 0 7px 7px;\n left: 17px;\n top: 1px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-svg-arrow>svg {\n left: 11px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-svg-arrow:after {\n left: 12px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-arrow:before {\n border-right-color: #fff;\n right: 16px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-arrow:after {\n border-width: 7px 7px 7px 0;\n right: 17px;\n top: 1px;\n border-right-color: rgba(0, 8, 16, .2)\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-svg-arrow>svg {\n right: 11px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-svg-arrow:after {\n right: 12px\n }\n\n .tippy-box[data-theme~=light-border]>.tippy-svg-arrow {\n fill: #fff\n }\n\n .tippy-box[data-theme~=light-border]>.tippy-svg-arrow:after {\n background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMCA2czEuNzk2LS4wMTMgNC42Ny0zLjYxNUM1Ljg1MS45IDYuOTMuMDA2IDggMGMxLjA3LS4wMDYgMi4xNDguODg3IDMuMzQzIDIuMzg1QzE0LjIzMyA2LjAwNSAxNiA2IDE2IDZIMHoiIGZpbGw9InJnYmEoMCwgOCwgMTYsIDAuMikiLz48L3N2Zz4=);\n background-size: 16px 6px;\n width: 16px;\n height: 6px\n }\n',on="\n .tippy-box[data-theme~=light] {\n color: #26323d;\n box-shadow: 0 0 20px 4px rgba(154, 161, 177, .15), 0 4px 80px -8px rgba(36, 40, 47, .25), 0 4px 4px -2px rgba(91, 94, 105, .15);\n background-color: #fff\n }\n\n .tippy-box[data-theme~=light][data-placement^=top]>.tippy-arrow:before {\n border-top-color: #fff\n }\n\n .tippy-box[data-theme~=light][data-placement^=bottom]>.tippy-arrow:before {\n border-bottom-color: #fff\n }\n\n .tippy-box[data-theme~=light][data-placement^=left]>.tippy-arrow:before {\n border-left-color: #fff\n }\n\n .tippy-box[data-theme~=light][data-placement^=right]>.tippy-arrow:before {\n border-right-color: #fff\n }\n\n .tippy-box[data-theme~=light]>.tippy-backdrop {\n background-color: #fff\n }\n\n .tippy-box[data-theme~=light]>.tippy-svg-arrow {\n fill: #fff\n }",sn="\n .tippy-box[data-theme~=material] {\n background-color: #505355;\n font-weight: 600\n }\n\n .tippy-box[data-theme~=material][data-placement^=top]>.tippy-arrow:before {\n border-top-color: #505355\n }\n\n .tippy-box[data-theme~=material][data-placement^=bottom]>.tippy-arrow:before {\n border-bottom-color: #505355\n }\n\n .tippy-box[data-theme~=material][data-placement^=left]>.tippy-arrow:before {\n border-left-color: #505355\n }\n\n .tippy-box[data-theme~=material][data-placement^=right]>.tippy-arrow:before {\n border-right-color: #505355\n }\n\n .tippy-box[data-theme~=material]>.tippy-backdrop {\n background-color: #505355\n }\n\n .tippy-box[data-theme~=material]>.tippy-svg-arrow {\n fill: #505355\n }\n",an="\n .tippy-box[data-theme~=translucent] {\n background-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent]>.tippy-arrow {\n width: 14px;\n height: 14px\n }\n\n .tippy-box[data-theme~=translucent][data-placement^=top]>.tippy-arrow:before {\n border-width: 7px 7px 0;\n border-top-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent][data-placement^=bottom]>.tippy-arrow:before {\n border-width: 0 7px 7px;\n border-bottom-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent][data-placement^=left]>.tippy-arrow:before {\n border-width: 7px 0 7px 7px;\n border-left-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent][data-placement^=right]>.tippy-arrow:before {\n border-width: 7px 7px 7px 0;\n border-right-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent]>.tippy-backdrop {\n background-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent]>.tippy-svg-arrow {\n fill: rgba(0, 0, 0, .7)\n }\n";var ln=Object.freeze({__proto__:null,camelize:en,base:nn,lightBorder:rn,light:on,material:sn,translucent:an});function cn(t,e,i){if(!t.querySelector("#pb-popover-"+e)){const n=t.nodeType===Node.DOCUMENT_NODE?document.head:t;console.log("Loading tippy styles for theme %s into %o",e,n);const r=document.createElement("style");r.type="text/css",r.id="pb-popover-"+e,r.innerHTML=i,n.appendChild(r)}}function hn(t,e){if(cn(t,"base",nn),e&&"none"!==e){const i=en(e),n=ln[i];n&&cn(t,i,n)}}class dn extends(D(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{for:{type:String},theme:{type:String},placement:{type:String},fallbackPlacement:{type:String,attribute:"fallback-placement"},persistent:{type:Boolean},trigger:{type:String},touch:{type:String},popupClass:{type:String,attribute:"popup-class"},remote:{type:String},stopPropagation:{type:Boolean,attribute:"stop-propagation"}})}constructor(){super(),this.persistent=!1,this.trigger=null,this.for=null,this.theme=null,this.placement=null,this.touch=null,this.fallbackPlacement=null,this.popupClass=null,this.stopPropagation=!1,this._tippy=null,this._content=null}render(){return this.for?I`<div class="hidden"><slot></slot></div>`:I`<span id="link" part="trigger" class="${this.persistent?"persistent":""}"><slot name="default"><slot></slot></slot></span><span class="hidden"><slot name="alternate"></slot></span>`}disconnectedCallback(){super.disconnectedCallback(),this._tippy&&this._tippy.destroy(),this._observer&&this._observer.disconnect()}_checkCSSProperties(){if(this.theme||"none"===this.theme||(this.theme=H(this,"--pb-popover-theme","none")),this.placement||(this.placement=H(this,"--pb-popover-placement","auto")),this.fallbackPlacement||(this.fallbackPlacement=H(this,"--pb-popover-fallback-placement",null)),this.persistent||(this.persistent=H(this,"--pb-popover-persistent",!1)),this.trigger||(this.trigger=H(this,"--pb-popover-trigger",null)),!this.touch){const t=H(this,"--pb-popover-touch","hold");this.touch="true"===t||t}}_injectStyles(){this._checkCSSProperties(),hn(this.getRootNode(),this.theme)}_getContent(){if(this._content)return this._content;const t=this._getSlot();if(t){const e=document.createElement("div");return t.assignedNodes().forEach(t=>{e.appendChild(t.content?t.content.cloneNode(!0):t.cloneNode(!0))}),this._content=e,e}return null}_getSlot(){return this.for?this.shadowRoot.querySelector("slot"):this.shadowRoot.querySelector("[name=alternate]")}_registerMutationObserver(){const t=this._getSlot();this._observer=new MutationObserver(()=>{this.alternate=this._getContent(),console.log("alternate changed"),this.emitTo("pb-popover-changed",this.alternate)}),this._observer.observe(this,{subtree:!0,childList:!0,characterData:!0}),t&&t.assignedNodes().forEach(t=>{this._observer.observe(t.content?t.content:t,{subtree:!0,childList:!0,characterData:!0})})}get alternate(){return this._getContent()}set alternate(t){this._content=t,this._tippy&&this._tippy.setContent(this._content)}command(t,e){"disable"===t&&(this.disabled=e,this._tippy&&(e?this._tippy.disable():this._tippy.enable()))}firstUpdated(){super.firstUpdated(),this._injectStyles(),this._registerMutationObserver(),this.trigger||(this.trigger=this.persistent?"click":"mouseenter");const t=this.getRootNode();let e;if(this.for?(e=t.getElementById(this.for),e||console.error("<pb-popover> target element %s not found",this.for)):e=this.shadowRoot.getElementById("link"),e){const i={allowHTML:!0,appendTo:t.nodeType===Node.DOCUMENT_NODE?document.body:t,placement:this.placement,interactive:!0,ignoreAttributes:!0,boundary:"viewport",maxWidth:"none",touch:this.touch,hideOnClick:!1,trigger:this.trigger};if(this.stopPropagation&&(i.onTrigger=(t,e)=>{e.stopPropagation()}),this.persistent&&(i.onClickOutside=(t,e)=>{t.hideWithInteractivity(e)}),this.theme&&"none"!==this.theme&&(i.theme=this.theme),this.fallbackPlacement){const t=this.fallbackPlacement.split(" ");i.popperOptions={modifiers:[{name:"flip",options:{fallbackPlacements:t}}]}}this.popupClass&&(i.onCreate=t=>{t.popper.classList.add(this.popupClass)}),i.onShow=t=>{this.remote?this._loadRemoteContent():t.setContent(this._getContent()),this.emitTo("pb-popover-show",{source:this,popup:t})},this._tippy=tn(e,i)}}_loadRemoteContent(){const t=this.toAbsoluteURL(this.remote);fetch(t,{method:"GET",mode:"cors",credentials:"same-origin"}).then(t=>t.text()).then(t=>{this.alternate=t}).catch(t=>{console.error("<pb-popover> Error retrieving remote content: %o",t)})}static get styles(){return[R`
|
|
510
|
+
`}}customElements.define("pb-demo-snippet",at);class lt{static subscribe(t,e,i,n=!1){const r=lt._getChannels(e),o=document.addEventListener(t,t=>{i&&t.detail&&t.detail.key&&r.includes(t.detail.key)&&i(t,o)},{once:n})}static subscribeOnce(t,e=null){const i=lt._getChannels(e);return new Promise(e=>{document.addEventListener(t,t=>{t.detail&&t.detail.key&&i.includes(t.detail.key)&&e(t)},{once:!0})})}static _getChannels(t){return null!==t&&t.length?Array.isArray(t)?t:[t]:[N]}static emit(t,e=null,i=null){const n=i||{};n.key=e||N;const r=new CustomEvent(t,{detail:n});document.dispatchEvent(r)}}window.pbEvents||(window.pbEvents=lt);const ct="2.15.0";class ht extends V{static get properties(){return Object.assign({version:{type:String,reflect:!0}},super.properties)}constructor(){super(),this.version=ct}connectedCallback(){if(super.connectedCallback(),!this.version){const t=P("../package.json");fetch(t).then(t=>t.json()).then(t=>{this.version=t.version})}}render(){return I`<span>${this.version?this.version:"unknown"}</span>`}createRenderRoot(){return this}}customElements.define("pb-version",ht);var dt="top",pt="bottom",ut="right",gt="left",ft="auto",mt=[dt,pt,ut,gt],vt="start",bt="end",yt="clippingParents",_t="viewport",wt="popper",xt="reference",kt=mt.reduce((function(t,e){return t.concat([e+"-"+vt,e+"-"+bt])}),[]),At=[].concat(mt,[ft]).reduce((function(t,e){return t.concat([e,e+"-"+vt,e+"-"+bt])}),[]),St=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function zt(t){return t?(t.nodeName||"").toLowerCase():null}function Ct(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Et(t){return t instanceof Ct(t).Element||t instanceof Element}function Tt(t){return t instanceof Ct(t).HTMLElement||t instanceof HTMLElement}function Lt(t){return"undefined"!=typeof ShadowRoot&&(t instanceof Ct(t).ShadowRoot||t instanceof ShadowRoot)}function Mt(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},r=e.elements[t];Tt(r)&&zt(r)&&(Object.assign(r.style,i),Object.keys(n).forEach((function(t){var e=n[t];!1===e?r.removeAttribute(t):r.setAttribute(t,!0===e?"":e)})))}))}function Ot(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach((function(t){var n=e.elements[t],r=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce((function(t,e){return t[e]="",t}),{});Tt(n)&&zt(n)&&(Object.assign(n.style,o),Object.keys(r).forEach((function(t){n.removeAttribute(t)})))}))}}var $t={name:"applyStyles",enabled:!0,phase:"write",fn:Mt,effect:Ot,requires:["computeStyles"]};function Ht(t){return t.split("-")[0]}var It=Math.max,Rt=Math.min,Pt=Math.round;function Vt(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function Nt(){return!/^((?!chrome|android).)*safari/i.test(Vt())}function Dt(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=t.getBoundingClientRect(),r=1,o=1;e&&Tt(t)&&(r=t.offsetWidth>0&&Pt(n.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Pt(n.height)/t.offsetHeight||1);var s=(Et(t)?Ct(t):window).visualViewport,a=!Nt()&&i,l=(n.left+(a&&s?s.offsetLeft:0))/r,c=(n.top+(a&&s?s.offsetTop:0))/o,h=n.width/r,d=n.height/o;return{width:h,height:d,top:c,right:l+h,bottom:c+d,left:l,x:l,y:c}}function Ft(t){var e=Dt(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function Bt(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&Lt(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function jt(t){return Ct(t).getComputedStyle(t)}function qt(t){return["table","td","th"].indexOf(zt(t))>=0}function Ut(t){return((Et(t)?t.ownerDocument:t.document)||window.document).documentElement}function Wt(t){return"html"===zt(t)?t:t.assignedSlot||t.parentNode||(Lt(t)?t.host:null)||Ut(t)}function Yt(t){return Tt(t)&&"fixed"!==jt(t).position?t.offsetParent:null}function Gt(t){var e=/firefox/i.test(Vt());if(/Trident/i.test(Vt())&&Tt(t)&&"fixed"===jt(t).position)return null;var i=Wt(t);for(Lt(i)&&(i=i.host);Tt(i)&&["html","body"].indexOf(zt(i))<0;){var n=jt(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}function Kt(t){for(var e=Ct(t),i=Yt(t);i&&qt(i)&&"static"===jt(i).position;)i=Yt(i);return i&&("html"===zt(i)||"body"===zt(i)&&"static"===jt(i).position)?e:i||Gt(t)||e}function Xt(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Zt(t,e,i){return It(t,Rt(e,i))}function Qt(t,e,i){var n=Zt(t,e,i);return n>i?i:n}function Jt(){return{top:0,right:0,bottom:0,left:0}}function te(t){return Object.assign({},Jt(),t)}function ee(t,e){return e.reduce((function(e,i){return e[i]=t,e}),{})}var ie=function(t,e){return te("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:ee(t,mt))};function ne(t){var e,i=t.state,n=t.name,r=t.options,o=i.elements.arrow,s=i.modifiersData.popperOffsets,a=Ht(i.placement),l=Xt(a),c=[gt,ut].indexOf(a)>=0?"height":"width";if(o&&s){var h=ie(r.padding,i),d=Ft(o),p="y"===l?dt:gt,u="y"===l?pt:ut,g=i.rects.reference[c]+i.rects.reference[l]-s[l]-i.rects.popper[c],f=s[l]-i.rects.reference[l],m=Kt(o),v=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,b=g/2-f/2,y=h[p],_=v-d[c]-h[u],w=v/2-d[c]/2+b,x=Zt(y,w,_),k=l;i.modifiersData[n]=((e={})[k]=x,e.centerOffset=x-w,e)}}function re(t){var e=t.state,i=t.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&Bt(e.elements.popper,n)&&(e.elements.arrow=n)}function oe(t){return t.split("-")[1]}var se={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ae(t,e){var i=t.x,n=t.y,r=e.devicePixelRatio||1;return{x:Pt(i*r)/r||0,y:Pt(n*r)/r||0}}function le(t){var e,i=t.popper,n=t.popperRect,r=t.placement,o=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,h=t.roundOffsets,d=t.isFixed,p=s.x,u=void 0===p?0:p,g=s.y,f=void 0===g?0:g,m="function"==typeof h?h({x:u,y:f}):{x:u,y:f};u=m.x,f=m.y;var v=s.hasOwnProperty("x"),b=s.hasOwnProperty("y"),y=gt,_=dt,w=window;if(c){var x=Kt(i),k="clientHeight",A="clientWidth";if(x===Ct(i)&&"static"!==jt(x=Ut(i)).position&&"absolute"===a&&(k="scrollHeight",A="scrollWidth"),x=x,r===dt||(r===gt||r===ut)&&o===bt)_=pt,f-=(d&&x===w&&w.visualViewport?w.visualViewport.height:x[k])-n.height,f*=l?1:-1;if(r===gt||(r===dt||r===pt)&&o===bt)y=ut,u-=(d&&x===w&&w.visualViewport?w.visualViewport.width:x[A])-n.width,u*=l?1:-1}var S,z=Object.assign({position:a},c&&se),C=!0===h?ae({x:u,y:f},Ct(i)):{x:u,y:f};return u=C.x,f=C.y,l?Object.assign({},z,((S={})[_]=b?"0":"",S[y]=v?"0":"",S.transform=(w.devicePixelRatio||1)<=1?"translate("+u+"px, "+f+"px)":"translate3d("+u+"px, "+f+"px, 0)",S)):Object.assign({},z,((e={})[_]=b?f+"px":"",e[y]=v?u+"px":"",e.transform="",e))}function ce(t){var e=t.state,i=t.options,n=i.gpuAcceleration,r=void 0===n||n,o=i.adaptive,s=void 0===o||o,a=i.roundOffsets,l=void 0===a||a,c={placement:Ht(e.placement),variation:oe(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,le(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,le(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var he={passive:!0};function de(t){var e=t.state,i=t.instance,n=t.options,r=n.scroll,o=void 0===r||r,s=n.resize,a=void 0===s||s,l=Ct(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach((function(t){t.addEventListener("scroll",i.update,he)})),a&&l.addEventListener("resize",i.update,he),function(){o&&c.forEach((function(t){t.removeEventListener("scroll",i.update,he)})),a&&l.removeEventListener("resize",i.update,he)}}var pe={left:"right",right:"left",bottom:"top",top:"bottom"};function ue(t){return t.replace(/left|right|bottom|top/g,(function(t){return pe[t]}))}var ge={start:"end",end:"start"};function fe(t){return t.replace(/start|end/g,(function(t){return ge[t]}))}function me(t){var e=Ct(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ve(t){return Dt(Ut(t)).left+me(t).scrollLeft}function be(t,e){var i=Ct(t),n=Ut(t),r=i.visualViewport,o=n.clientWidth,s=n.clientHeight,a=0,l=0;if(r){o=r.width,s=r.height;var c=Nt();(c||!c&&"fixed"===e)&&(a=r.offsetLeft,l=r.offsetTop)}return{width:o,height:s,x:a+ve(t),y:l}}function ye(t){var e,i=Ut(t),n=me(t),r=null==(e=t.ownerDocument)?void 0:e.body,o=It(i.scrollWidth,i.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=It(i.scrollHeight,i.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-n.scrollLeft+ve(t),l=-n.scrollTop;return"rtl"===jt(r||i).direction&&(a+=It(i.clientWidth,r?r.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function _e(t){var e=jt(t),i=e.overflow,n=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+r+n)}function we(t){return["html","body","#document"].indexOf(zt(t))>=0?t.ownerDocument.body:Tt(t)&&_e(t)?t:we(Wt(t))}function xe(t,e){var i;void 0===e&&(e=[]);var n=we(t),r=n===(null==(i=t.ownerDocument)?void 0:i.body),o=Ct(n),s=r?[o].concat(o.visualViewport||[],_e(n)?n:[]):n,a=e.concat(s);return r?a:a.concat(xe(Wt(s)))}function ke(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Ae(t,e){var i=Dt(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}function Se(t,e,i){return e===_t?ke(be(t,i)):Et(e)?Ae(e,i):ke(ye(Ut(t)))}function ze(t){var e=xe(Wt(t)),i=["absolute","fixed"].indexOf(jt(t).position)>=0&&Tt(t)?Kt(t):t;return Et(i)?e.filter((function(t){return Et(t)&&Bt(t,i)&&"body"!==zt(t)})):[]}function Ce(t,e,i,n){var r="clippingParents"===e?ze(t):[].concat(e),o=[].concat(r,[i]),s=o[0],a=o.reduce((function(e,i){var r=Se(t,i,n);return e.top=It(r.top,e.top),e.right=Rt(r.right,e.right),e.bottom=Rt(r.bottom,e.bottom),e.left=It(r.left,e.left),e}),Se(t,s,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Ee(t){var e,i=t.reference,n=t.element,r=t.placement,o=r?Ht(r):null,s=r?oe(r):null,a=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(o){case dt:e={x:a,y:i.y-n.height};break;case pt:e={x:a,y:i.y+i.height};break;case ut:e={x:i.x+i.width,y:l};break;case gt:e={x:i.x-n.width,y:l};break;default:e={x:i.x,y:i.y}}var c=o?Xt(o):null;if(null!=c){var h="y"===c?"height":"width";switch(s){case vt:e[c]=e[c]-(i[h]/2-n[h]/2);break;case bt:e[c]=e[c]+(i[h]/2-n[h]/2)}}return e}function Te(t,e){void 0===e&&(e={});var i=e,n=i.placement,r=void 0===n?t.placement:n,o=i.strategy,s=void 0===o?t.strategy:o,a=i.boundary,l=void 0===a?yt:a,c=i.rootBoundary,h=void 0===c?_t:c,d=i.elementContext,p=void 0===d?wt:d,u=i.altBoundary,g=void 0!==u&&u,f=i.padding,m=void 0===f?0:f,v=te("number"!=typeof m?m:ee(m,mt)),b=p===wt?xt:wt,y=t.rects.popper,_=t.elements[g?b:p],w=Ce(Et(_)?_:_.contextElement||Ut(t.elements.popper),l,h,s),x=Dt(t.elements.reference),k=Ee({reference:x,element:y,strategy:"absolute",placement:r}),A=ke(Object.assign({},y,k)),S=p===wt?A:x,z={top:w.top-S.top+v.top,bottom:S.bottom-w.bottom+v.bottom,left:w.left-S.left+v.left,right:S.right-w.right+v.right},C=t.modifiersData.offset;if(p===wt&&C){var E=C[r];Object.keys(z).forEach((function(t){var e=[ut,pt].indexOf(t)>=0?1:-1,i=[dt,pt].indexOf(t)>=0?"y":"x";z[t]+=E[i]*e}))}return z}function Le(t,e){void 0===e&&(e={});var i=e,n=i.placement,r=i.boundary,o=i.rootBoundary,s=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=void 0===l?At:l,h=oe(n),d=h?a?kt:kt.filter((function(t){return oe(t)===h})):mt,p=d.filter((function(t){return c.indexOf(t)>=0}));0===p.length&&(p=d);var u=p.reduce((function(e,i){return e[i]=Te(t,{placement:i,boundary:r,rootBoundary:o,padding:s})[Ht(i)],e}),{});return Object.keys(u).sort((function(t,e){return u[t]-u[e]}))}function Me(t){if(Ht(t)===ft)return[];var e=ue(t);return[fe(t),e,fe(e)]}function Oe(t){var e=t.state,i=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var r=i.mainAxis,o=void 0===r||r,s=i.altAxis,a=void 0===s||s,l=i.fallbackPlacements,c=i.padding,h=i.boundary,d=i.rootBoundary,p=i.altBoundary,u=i.flipVariations,g=void 0===u||u,f=i.allowedAutoPlacements,m=e.options.placement,v=Ht(m),b=l||(v===m||!g?[ue(m)]:Me(m)),y=[m].concat(b).reduce((function(t,i){return t.concat(Ht(i)===ft?Le(e,{placement:i,boundary:h,rootBoundary:d,padding:c,flipVariations:g,allowedAutoPlacements:f}):i)}),[]),_=e.rects.reference,w=e.rects.popper,x=new Map,k=!0,A=y[0],S=0;S<y.length;S++){var z=y[S],C=Ht(z),E=oe(z)===vt,T=[dt,pt].indexOf(C)>=0,L=T?"width":"height",M=Te(e,{placement:z,boundary:h,rootBoundary:d,altBoundary:p,padding:c}),O=T?E?ut:gt:E?pt:dt;_[L]>w[L]&&(O=ue(O));var $=ue(O),H=[];if(o&&H.push(M[C]<=0),a&&H.push(M[O]<=0,M[$]<=0),H.every((function(t){return t}))){A=z,k=!1;break}x.set(z,H)}if(k)for(var I=function(t){var e=y.find((function(e){var i=x.get(e);if(i)return i.slice(0,t).every((function(t){return t}))}));if(e)return A=e,"break"},R=g?3:1;R>0;R--){if("break"===I(R))break}e.placement!==A&&(e.modifiersData[n]._skip=!0,e.placement=A,e.reset=!0)}}function $e(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function He(t){return[dt,ut,pt,gt].some((function(e){return t[e]>=0}))}function Ie(t){var e=t.state,i=t.name,n=e.rects.reference,r=e.rects.popper,o=e.modifiersData.preventOverflow,s=Te(e,{elementContext:"reference"}),a=Te(e,{altBoundary:!0}),l=$e(s,n),c=$e(a,r,o),h=He(l),d=He(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":d})}function Re(t,e,i){var n=Ht(t),r=[gt,dt].indexOf(n)>=0?-1:1,o="function"==typeof i?i(Object.assign({},e,{placement:t})):i,s=o[0],a=o[1];return s=s||0,a=(a||0)*r,[gt,ut].indexOf(n)>=0?{x:a,y:s}:{x:s,y:a}}function Pe(t){var e=t.state,i=t.options,n=t.name,r=i.offset,o=void 0===r?[0,0]:r,s=At.reduce((function(t,i){return t[i]=Re(i,e.rects,o),t}),{}),a=s[e.placement],l=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=s}function Ve(t){var e=t.state,i=t.name;e.modifiersData[i]=Ee({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}function Ne(t){return"x"===t?"y":"x"}function De(t){var e=t.state,i=t.options,n=t.name,r=i.mainAxis,o=void 0===r||r,s=i.altAxis,a=void 0!==s&&s,l=i.boundary,c=i.rootBoundary,h=i.altBoundary,d=i.padding,p=i.tether,u=void 0===p||p,g=i.tetherOffset,f=void 0===g?0:g,m=Te(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:h}),v=Ht(e.placement),b=oe(e.placement),y=!b,_=Xt(v),w=Ne(_),x=e.modifiersData.popperOffsets,k=e.rects.reference,A=e.rects.popper,S="function"==typeof f?f(Object.assign({},e.rects,{placement:e.placement})):f,z="number"==typeof S?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),C=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,E={x:0,y:0};if(x){if(o){var T,L="y"===_?dt:gt,M="y"===_?pt:ut,O="y"===_?"height":"width",$=x[_],H=$+m[L],I=$-m[M],R=u?-A[O]/2:0,P=b===vt?k[O]:A[O],V=b===vt?-A[O]:-k[O],N=e.elements.arrow,D=u&&N?Ft(N):{width:0,height:0},F=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Jt(),B=F[L],j=F[M],q=Zt(0,k[O],D[O]),U=y?k[O]/2-R-q-B-z.mainAxis:P-q-B-z.mainAxis,W=y?-k[O]/2+R+q+j+z.mainAxis:V+q+j+z.mainAxis,Y=e.elements.arrow&&Kt(e.elements.arrow),G=Y?"y"===_?Y.clientTop||0:Y.clientLeft||0:0,K=null!=(T=null==C?void 0:C[_])?T:0,X=$+W-K,Z=Zt(u?Rt(H,$+U-K-G):H,$,u?It(I,X):I);x[_]=Z,E[_]=Z-$}if(a){var Q,J="x"===_?dt:gt,tt="x"===_?pt:ut,et=x[w],it="y"===w?"height":"width",nt=et+m[J],rt=et-m[tt],ot=-1!==[dt,gt].indexOf(v),st=null!=(Q=null==C?void 0:C[w])?Q:0,at=ot?nt:et-k[it]-A[it]-st+z.altAxis,lt=ot?et+k[it]+A[it]-st-z.altAxis:rt,ct=u&&ot?Qt(at,et,lt):Zt(u?at:nt,et,u?lt:rt);x[w]=ct,E[w]=ct-et}e.modifiersData[n]=E}}function Fe(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Be(t){return t!==Ct(t)&&Tt(t)?Fe(t):me(t)}function je(t){var e=t.getBoundingClientRect(),i=Pt(e.width)/t.offsetWidth||1,n=Pt(e.height)/t.offsetHeight||1;return 1!==i||1!==n}function qe(t,e,i){void 0===i&&(i=!1);var n=Tt(e),r=Tt(e)&&je(e),o=Ut(e),s=Dt(t,r,i),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!i)&&(("body"!==zt(e)||_e(o))&&(a=Be(e)),Tt(e)?((l=Dt(e,!0)).x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=ve(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function Ue(t){var e=new Map,i=new Set,n=[];function r(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!i.has(t)){var n=e.get(t);n&&r(n)}})),n.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){i.has(t.name)||r(t)})),n}function We(t){var e=Ue(t);return St.reduce((function(t,i){return t.concat(e.filter((function(t){return t.phase===i})))}),[])}function Ye(t){var e;return function(){return e||(e=new Promise((function(i){Promise.resolve().then((function(){e=void 0,i(t())}))}))),e}}function Ge(t){var e=t.reduce((function(t,e){var i=t[e.name];return t[e.name]=i?Object.assign({},i,e,{options:Object.assign({},i.options,e.options),data:Object.assign({},i.data,e.data)}):e,t}),{});return Object.keys(e).map((function(t){return e[t]}))}var Ke={placement:"bottom",modifiers:[],strategy:"absolute"};function Xe(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return!e.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function Ze(t){void 0===t&&(t={});var e=t,i=e.defaultModifiers,n=void 0===i?[]:i,r=e.defaultOptions,o=void 0===r?Ke:r;return function(t,e,i){void 0===i&&(i=o);var r={placement:"bottom",orderedModifiers:[],options:Object.assign({},Ke,o),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},s=[],a=!1,l={state:r,setOptions:function(i){var s="function"==typeof i?i(r.options):i;h(),r.options=Object.assign({},o,r.options,s),r.scrollParents={reference:Et(t)?xe(t):t.contextElement?xe(t.contextElement):[],popper:xe(e)};var a=We(Ge([].concat(n,r.options.modifiers)));return r.orderedModifiers=a.filter((function(t){return t.enabled})),c(),l.update()},forceUpdate:function(){if(!a){var t=r.elements,e=t.reference,i=t.popper;if(Xe(e,i)){r.rects={reference:qe(e,Kt(i),"fixed"===r.options.strategy),popper:Ft(i)},r.reset=!1,r.placement=r.options.placement,r.orderedModifiers.forEach((function(t){return r.modifiersData[t.name]=Object.assign({},t.data)}));for(var n=0;n<r.orderedModifiers.length;n++)if(!0!==r.reset){var o=r.orderedModifiers[n],s=o.fn,c=o.options,h=void 0===c?{}:c,d=o.name;"function"==typeof s&&(r=s({state:r,options:h,name:d,instance:l})||r)}else r.reset=!1,n=-1}}},update:Ye((function(){return new Promise((function(t){l.forceUpdate(),t(r)}))})),destroy:function(){h(),a=!0}};if(!Xe(t,e))return l;function c(){r.orderedModifiers.forEach((function(t){var e=t.name,i=t.options,n=void 0===i?{}:i,o=t.effect;if("function"==typeof o){var a=o({state:r,name:e,instance:l,options:n}),c=function(){};s.push(a||c)}}))}function h(){s.forEach((function(t){return t()})),s=[]}return l.setOptions(i).then((function(t){!a&&i.onFirstUpdate&&i.onFirstUpdate(t)})),l}}var Qe=Ze({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:de,data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:Ve,data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:ce,data:{}},$t,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Pe},{name:"flip",enabled:!0,phase:"main",fn:Oe,requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:De,requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:ne,effect:re,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Ie}]}),Je="tippy-box",ti="tippy-content",ei="tippy-backdrop",ii="tippy-arrow",ni="tippy-svg-arrow",ri={passive:!0,capture:!0},oi=function(){return document.body};function si(t,e,i){if(Array.isArray(t)){var n=t[e];return null==n?Array.isArray(i)?i[e]:i:n}return t}function ai(t,e){var i={}.toString.call(t);return 0===i.indexOf("[object")&&i.indexOf(e+"]")>-1}function li(t,e){return"function"==typeof t?t.apply(void 0,e):t}function ci(t,e){return 0===e?t:function(n){clearTimeout(i),i=setTimeout((function(){t(n)}),e)};var i}function hi(t){return t.split(/\s+/).filter(Boolean)}function di(t){return[].concat(t)}function pi(t,e){-1===t.indexOf(e)&&t.push(e)}function ui(t){return t.filter((function(e,i){return t.indexOf(e)===i}))}function gi(t){return t.split("-")[0]}function fi(t){return[].slice.call(t)}function mi(t){return Object.keys(t).reduce((function(e,i){return void 0!==t[i]&&(e[i]=t[i]),e}),{})}function vi(){return document.createElement("div")}function bi(t){return["Element","Fragment"].some((function(e){return ai(t,e)}))}function yi(t){return ai(t,"NodeList")}function _i(t){return ai(t,"MouseEvent")}function wi(t){return!(!t||!t._tippy||t._tippy.reference!==t)}function xi(t){return bi(t)?[t]:yi(t)?fi(t):Array.isArray(t)?t:fi(document.querySelectorAll(t))}function ki(t,e){t.forEach((function(t){t&&(t.style.transitionDuration=e+"ms")}))}function Ai(t,e){t.forEach((function(t){t&&t.setAttribute("data-state",e)}))}function Si(t){var e,i=di(t)[0];return null!=i&&null!=(e=i.ownerDocument)&&e.body?i.ownerDocument:document}function zi(t,e){var i=e.clientX,n=e.clientY;return t.every((function(t){var e=t.popperRect,r=t.popperState,o=t.props.interactiveBorder,s=gi(r.placement),a=r.modifiersData.offset;if(!a)return!0;var l="bottom"===s?a.top.y:0,c="top"===s?a.bottom.y:0,h="right"===s?a.left.x:0,d="left"===s?a.right.x:0,p=e.top-n+l>o,u=n-e.bottom-c>o,g=e.left-i+h>o,f=i-e.right-d>o;return p||u||g||f}))}function Ci(t,e,i){var n=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(e){t[n](e,i)}))}function Ei(t,e){for(var i=e;i;){var n;if(t.contains(i))return!0;i=null==i.getRootNode||null==(n=i.getRootNode())?void 0:n.host}return!1}var Ti={isTouch:!1},Li=0;function Mi(){Ti.isTouch||(Ti.isTouch=!0,window.performance&&document.addEventListener("mousemove",Oi))}function Oi(){var t=performance.now();t-Li<20&&(Ti.isTouch=!1,document.removeEventListener("mousemove",Oi)),Li=t}function $i(){var t=document.activeElement;if(wi(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function Hi(){document.addEventListener("touchstart",Mi,ri),window.addEventListener("blur",$i)}var Ii=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto,Ri={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Pi={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Vi=Object.assign({appendTo:oi,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Ri,Pi),Ni=Object.keys(Vi),Di=function(t){Object.keys(t).forEach((function(e){Vi[e]=t[e]}))};function Fi(t){var e=(t.plugins||[]).reduce((function(e,i){var n,r=i.name,o=i.defaultValue;r&&(e[r]=void 0!==t[r]?t[r]:null!=(n=Vi[r])?n:o);return e}),{});return Object.assign({},t,e)}function Bi(t,e){return(e?Object.keys(Fi(Object.assign({},Vi,{plugins:e}))):Ni).reduce((function(e,i){var n=(t.getAttribute("data-tippy-"+i)||"").trim();if(!n)return e;if("content"===i)e[i]=n;else try{e[i]=JSON.parse(n)}catch(t){e[i]=n}return e}),{})}function ji(t,e){var i=Object.assign({},e,{content:li(e.content,[t])},e.ignoreAttributes?{}:Bi(t,e.plugins));return i.aria=Object.assign({},Vi.aria,i.aria),i.aria={expanded:"auto"===i.aria.expanded?e.interactive:i.aria.expanded,content:"auto"===i.aria.content?e.interactive?null:"describedby":i.aria.content},i}var qi=function(){return"innerHTML"};function Ui(t,e){t[qi()]=e}function Wi(t){var e=vi();return!0===t?e.className=ii:(e.className=ni,bi(t)?e.appendChild(t):Ui(e,t)),e}function Yi(t,e){bi(e.content)?(Ui(t,""),t.appendChild(e.content)):"function"!=typeof e.content&&(e.allowHTML?Ui(t,e.content):t.textContent=e.content)}function Gi(t){var e=t.firstElementChild,i=fi(e.children);return{box:e,content:i.find((function(t){return t.classList.contains(ti)})),arrow:i.find((function(t){return t.classList.contains(ii)||t.classList.contains(ni)})),backdrop:i.find((function(t){return t.classList.contains(ei)}))}}function Ki(t){var e=vi(),i=vi();i.className=Je,i.setAttribute("data-state","hidden"),i.setAttribute("tabindex","-1");var n=vi();function r(i,n){var r=Gi(e),o=r.box,s=r.content,a=r.arrow;n.theme?o.setAttribute("data-theme",n.theme):o.removeAttribute("data-theme"),"string"==typeof n.animation?o.setAttribute("data-animation",n.animation):o.removeAttribute("data-animation"),n.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof n.maxWidth?n.maxWidth+"px":n.maxWidth,n.role?o.setAttribute("role",n.role):o.removeAttribute("role"),i.content===n.content&&i.allowHTML===n.allowHTML||Yi(s,t.props),n.arrow?a?i.arrow!==n.arrow&&(o.removeChild(a),o.appendChild(Wi(n.arrow))):o.appendChild(Wi(n.arrow)):a&&o.removeChild(a)}return n.className=ti,n.setAttribute("data-state","hidden"),Yi(n,t.props),e.appendChild(i),i.appendChild(n),r(t.props,t.props),{popper:e,onUpdate:r}}Ki.$$tippy=!0;var Xi=1,Zi=[],Qi=[];function Ji(t,e){var i,n,r,o,s,a,l,c=ji(t,Object.assign({},Vi,Fi(mi(e)))),h=!1,d=!1,p=!1,u=!1,g=[],f=ci(X,c.interactiveDebounce),m=Xi++,v=null,b=ui(c.plugins),y={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},_={id:m,reference:t,popper:vi(),popperInstance:v,props:c,state:y,plugins:b,clearDelayTimeouts:lt,setProps:ct,setContent:ht,show:dt,hide:pt,hideWithInteractivity:ut,enable:st,disable:at,unmount:gt,destroy:ft};if(!c.render)return _;var w=c.render(_),x=w.popper,k=w.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+_.id,_.popper=x,t._tippy=_,x._tippy=_;var A=b.map((function(t){return t.fn(_)})),S=t.hasAttribute("aria-expanded");return Y(),R(),$(),H("onCreate",[_]),c.showOnCreate&&rt(),x.addEventListener("mouseenter",(function(){_.props.interactive&&_.state.isVisible&&_.clearDelayTimeouts()})),x.addEventListener("mouseleave",(function(){_.props.interactive&&_.props.trigger.indexOf("mouseenter")>=0&&L().addEventListener("mousemove",f)})),_;function z(){var t=_.props.touch;return Array.isArray(t)?t:[t,0]}function C(){return"hold"===z()[0]}function E(){var t;return!(null==(t=_.props.render)||!t.$$tippy)}function T(){return l||t}function L(){var t=T().parentNode;return t?Si(t):document}function M(){return Gi(x)}function O(t){return _.state.isMounted&&!_.state.isVisible||Ti.isTouch||o&&"focus"===o.type?0:si(_.props.delay,t?0:1,Vi.delay)}function $(t){void 0===t&&(t=!1),x.style.pointerEvents=_.props.interactive&&!t?"":"none",x.style.zIndex=""+_.props.zIndex}function H(t,e,i){var n;(void 0===i&&(i=!0),A.forEach((function(i){i[t]&&i[t].apply(i,e)})),i)&&(n=_.props)[t].apply(n,e)}function I(){var e=_.props.aria;if(e.content){var i="aria-"+e.content,n=x.id;di(_.props.triggerTarget||t).forEach((function(t){var e=t.getAttribute(i);if(_.state.isVisible)t.setAttribute(i,e?e+" "+n:n);else{var r=e&&e.replace(n,"").trim();r?t.setAttribute(i,r):t.removeAttribute(i)}}))}}function R(){!S&&_.props.aria.expanded&&di(_.props.triggerTarget||t).forEach((function(t){_.props.interactive?t.setAttribute("aria-expanded",_.state.isVisible&&t===T()?"true":"false"):t.removeAttribute("aria-expanded")}))}function P(){L().removeEventListener("mousemove",f),Zi=Zi.filter((function(t){return t!==f}))}function V(e){if(!Ti.isTouch||!p&&"mousedown"!==e.type){var i=e.composedPath&&e.composedPath()[0]||e.target;if(!_.props.interactive||!Ei(x,i)){if(di(_.props.triggerTarget||t).some((function(t){return Ei(t,i)}))){if(Ti.isTouch)return;if(_.state.isVisible&&_.props.trigger.indexOf("click")>=0)return}else H("onClickOutside",[_,e]);!0===_.props.hideOnClick&&(_.clearDelayTimeouts(),_.hide(),d=!0,setTimeout((function(){d=!1})),_.state.isMounted||B())}}}function N(){p=!0}function D(){p=!1}function F(){var t=L();t.addEventListener("mousedown",V,!0),t.addEventListener("touchend",V,ri),t.addEventListener("touchstart",D,ri),t.addEventListener("touchmove",N,ri)}function B(){var t=L();t.removeEventListener("mousedown",V,!0),t.removeEventListener("touchend",V,ri),t.removeEventListener("touchstart",D,ri),t.removeEventListener("touchmove",N,ri)}function j(t,e){U(t,(function(){!_.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&e()}))}function q(t,e){U(t,e)}function U(t,e){var i=M().box;function n(t){t.target===i&&(Ci(i,"remove",n),e())}if(0===t)return e();Ci(i,"remove",s),Ci(i,"add",n),s=n}function W(e,i,n){void 0===n&&(n=!1),di(_.props.triggerTarget||t).forEach((function(t){t.addEventListener(e,i,n),g.push({node:t,eventType:e,handler:i,options:n})}))}function Y(){C()&&(W("touchstart",K,{passive:!0}),W("touchend",Z,{passive:!0})),hi(_.props.trigger).forEach((function(t){if("manual"!==t)switch(W(t,K),t){case"mouseenter":W("mouseleave",Z);break;case"focus":W(Ii?"focusout":"blur",Q);break;case"focusin":W("focusout",Q)}}))}function G(){g.forEach((function(t){var e=t.node,i=t.eventType,n=t.handler,r=t.options;e.removeEventListener(i,n,r)})),g=[]}function K(t){var e,i=!1;if(_.state.isEnabled&&!J(t)&&!d){var n="focus"===(null==(e=o)?void 0:e.type);o=t,l=t.currentTarget,R(),!_.state.isVisible&&_i(t)&&Zi.forEach((function(e){return e(t)})),"click"===t.type&&(_.props.trigger.indexOf("mouseenter")<0||h)&&!1!==_.props.hideOnClick&&_.state.isVisible?i=!0:rt(t),"click"===t.type&&(h=!i),i&&!n&&ot(t)}}function X(t){var e=t.target,i=T().contains(e)||x.contains(e);"mousemove"===t.type&&i||zi(nt().concat(x).map((function(t){var e,i=null==(e=t._tippy.popperInstance)?void 0:e.state;return i?{popperRect:t.getBoundingClientRect(),popperState:i,props:c}:null})).filter(Boolean),t)&&(P(),ot(t))}function Z(t){J(t)||_.props.trigger.indexOf("click")>=0&&h||(_.props.interactive?_.hideWithInteractivity(t):ot(t))}function Q(t){_.props.trigger.indexOf("focusin")<0&&t.target!==T()||_.props.interactive&&t.relatedTarget&&x.contains(t.relatedTarget)||ot(t)}function J(t){return!!Ti.isTouch&&C()!==t.type.indexOf("touch")>=0}function tt(){et();var e=_.props,i=e.popperOptions,n=e.placement,r=e.offset,o=e.getReferenceClientRect,s=e.moveTransition,l=E()?Gi(x).arrow:null,c=o?{getBoundingClientRect:o,contextElement:o.contextElement||T()}:t,h=[{name:"offset",options:{offset:r}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var e=t.state;if(E()){var i=M().box;["placement","reference-hidden","escaped"].forEach((function(t){"placement"===t?i.setAttribute("data-placement",e.placement):e.attributes.popper["data-popper-"+t]?i.setAttribute("data-"+t,""):i.removeAttribute("data-"+t)})),e.attributes.popper={}}}}];E()&&l&&h.push({name:"arrow",options:{element:l,padding:3}}),h.push.apply(h,(null==i?void 0:i.modifiers)||[]),_.popperInstance=Qe(c,x,Object.assign({},i,{placement:n,onFirstUpdate:a,modifiers:h}))}function et(){_.popperInstance&&(_.popperInstance.destroy(),_.popperInstance=null)}function it(){var t,e=_.props.appendTo,i=T();(t=_.props.interactive&&e===oi||"parent"===e?i.parentNode:li(e,[i])).contains(x)||t.appendChild(x),_.state.isMounted=!0,tt()}function nt(){return fi(x.querySelectorAll("[data-tippy-root]"))}function rt(t){_.clearDelayTimeouts(),t&&H("onTrigger",[_,t]),F();var e=O(!0),n=z(),r=n[0],o=n[1];Ti.isTouch&&"hold"===r&&o&&(e=o),e?i=setTimeout((function(){_.show()}),e):_.show()}function ot(t){if(_.clearDelayTimeouts(),H("onUntrigger",[_,t]),_.state.isVisible){if(!(_.props.trigger.indexOf("mouseenter")>=0&&_.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&h)){var e=O(!1);e?n=setTimeout((function(){_.state.isVisible&&_.hide()}),e):r=requestAnimationFrame((function(){_.hide()}))}}else B()}function st(){_.state.isEnabled=!0}function at(){_.hide(),_.state.isEnabled=!1}function lt(){clearTimeout(i),clearTimeout(n),cancelAnimationFrame(r)}function ct(e){if(!_.state.isDestroyed){H("onBeforeUpdate",[_,e]),G();var i=_.props,n=ji(t,Object.assign({},i,mi(e),{ignoreAttributes:!0}));_.props=n,Y(),i.interactiveDebounce!==n.interactiveDebounce&&(P(),f=ci(X,n.interactiveDebounce)),i.triggerTarget&&!n.triggerTarget?di(i.triggerTarget).forEach((function(t){t.removeAttribute("aria-expanded")})):n.triggerTarget&&t.removeAttribute("aria-expanded"),R(),$(),k&&k(i,n),_.popperInstance&&(tt(),nt().forEach((function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)}))),H("onAfterUpdate",[_,e])}}function ht(t){_.setProps({content:t})}function dt(){var t=_.state.isVisible,e=_.state.isDestroyed,i=!_.state.isEnabled,n=Ti.isTouch&&!_.props.touch,r=si(_.props.duration,0,Vi.duration);if(!(t||e||i||n||T().hasAttribute("disabled")||(H("onShow",[_],!1),!1===_.props.onShow(_)))){if(_.state.isVisible=!0,E()&&(x.style.visibility="visible"),$(),F(),_.state.isMounted||(x.style.transition="none"),E()){var o=M();ki([o.box,o.content],0)}a=function(){var t;if(_.state.isVisible&&!u){if(u=!0,x.offsetHeight,x.style.transition=_.props.moveTransition,E()&&_.props.animation){var e=M(),i=e.box,n=e.content;ki([i,n],r),Ai([i,n],"visible")}I(),R(),pi(Qi,_),null==(t=_.popperInstance)||t.forceUpdate(),H("onMount",[_]),_.props.animation&&E()&&q(r,(function(){_.state.isShown=!0,H("onShown",[_])}))}},it()}}function pt(){var t=!_.state.isVisible,e=_.state.isDestroyed,i=!_.state.isEnabled,n=si(_.props.duration,1,Vi.duration);if(!(t||e||i)&&(H("onHide",[_],!1),!1!==_.props.onHide(_))){if(_.state.isVisible=!1,_.state.isShown=!1,u=!1,h=!1,E()&&(x.style.visibility="hidden"),P(),B(),$(!0),E()){var r=M(),o=r.box,s=r.content;_.props.animation&&(ki([o,s],n),Ai([o,s],"hidden"))}I(),R(),_.props.animation?E()&&j(n,_.unmount):_.unmount()}}function ut(t){L().addEventListener("mousemove",f),pi(Zi,f),f(t)}function gt(){_.state.isVisible&&_.hide(),_.state.isMounted&&(et(),nt().forEach((function(t){t._tippy.unmount()})),x.parentNode&&x.parentNode.removeChild(x),Qi=Qi.filter((function(t){return t!==_})),_.state.isMounted=!1,H("onHidden",[_]))}function ft(){_.state.isDestroyed||(_.clearDelayTimeouts(),_.unmount(),G(),delete t._tippy,_.state.isDestroyed=!0,H("onDestroy",[_]))}}function tn(t,e){void 0===e&&(e={});var i=Vi.plugins.concat(e.plugins||[]);Hi();var n=Object.assign({},e,{plugins:i}),r=xi(t).reduce((function(t,e){var i=e&&Ji(e,n);return i&&t.push(i),t}),[]);return bi(t)?r[0]:r}tn.defaultProps=Vi,tn.setDefaultProps=Di,tn.currentInput=Ti;Object.assign({},$t,{effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow)}});function en(t){return t.replace(/(?:^\w|[A-Z]|\b\w)/g,(t,e)=>0==+t?"":0===e?t.toLowerCase():t.toUpperCase()).replace("-","")}tn.setDefaultProps({render:Ki});const nn='\n .tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n }\n\n .tippy-iOS {\n cursor: pointer!important;\n -webkit-tap-highlight-color: transparent\n }\n\n [data-tippy-root] {\n max-width: calc(100vw - 10px)\n }\n\n .tippy-box {\n position: relative;\n background-color: #333;\n color: #fff;\n border-radius: 4px;\n font-size: var(--pb-popover-font-size, var(--pb-base-font-size, 14px));\n line-height: var(--pb-popover-line-height, var(--pb-base-line-height, 1.4));\n text-align: left;\n font-style: normal;\n font-weight: normal;\n outline: 0;\n transition-property: transform, visibility, opacity\n }\n\n .tippy-box[data-placement^=top]>.tippy-arrow {\n bottom: 0\n }\n\n .tippy-box[data-placement^=top]>.tippy-arrow:before {\n bottom: -7px;\n left: 0;\n border-width: 8px 8px 0;\n border-top-color: initial;\n transform-origin: center top\n }\n\n .tippy-box[data-placement^=bottom]>.tippy-arrow {\n top: 0\n }\n\n .tippy-box[data-placement^=bottom]>.tippy-arrow:before {\n top: -7px;\n left: 0;\n border-width: 0 8px 8px;\n border-bottom-color: initial;\n transform-origin: center bottom\n }\n\n .tippy-box[data-placement^=left]>.tippy-arrow {\n right: 0\n }\n\n .tippy-box[data-placement^=left]>.tippy-arrow:before {\n border-width: 8px 0 8px 8px;\n border-left-color: initial;\n right: -7px;\n transform-origin: center left\n }\n\n .tippy-box[data-placement^=right]>.tippy-arrow {\n left: 0\n }\n\n .tippy-box[data-placement^=right]>.tippy-arrow:before {\n left: -7px;\n border-width: 8px 8px 8px 0;\n border-right-color: initial;\n transform-origin: center right\n }\n\n .tippy-box[data-inertia][data-state=visible] {\n transition-timing-function: cubic-bezier(.54, 1.5, .38, 1.11)\n }\n\n .tippy-arrow {\n width: 16px;\n height: 16px;\n color: #333\n }\n\n .tippy-arrow:before {\n content: "";\n position: absolute;\n border-color: transparent;\n border-style: solid\n }\n\n .tippy-content {\n position: relative;\n padding: 5px 9px;\n z-index: 1;\n overflow: auto;\n max-height: var(--pb-popover-max-height, calc(100vh - 60px));\n min-height: var(--pb-popover-min-height, auto);\n max-width: var(--pb-popover-max-width, auto);\n min-width: var(--pb-popover-min-width, auto);\n color: var(--pb-popover-color);\n }\n',rn='\n .tippy-box[data-theme~=light-border] {\n background-color: #fff;\n background-clip: padding-box;\n border: 1px solid rgba(0, 8, 16, .15);\n color: #333;\n box-shadow: 0 4px 14px -2px rgba(0, 8, 16, .08)\n }\n\n .tippy-box[data-theme~=light-border]>.tippy-backdrop {\n background-color: #fff\n }\n\n .tippy-box[data-theme~=light-border]>.tippy-arrow:after, .tippy-box[data-theme~=light-border]>.tippy-svg-arrow:after {\n content: "";\n position: absolute;\n z-index: -1\n }\n\n .tippy-box[data-theme~=light-border]>.tippy-arrow:after {\n border-color: transparent;\n border-style: solid\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-arrow:before {\n border-top-color: #fff\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-arrow:after {\n border-top-color: rgba(0, 8, 16, .2);\n border-width: 7px 7px 0;\n top: 17px;\n left: 1px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-svg-arrow>svg {\n top: 16px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-svg-arrow:after {\n top: 17px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-arrow:before {\n border-bottom-color: #fff;\n bottom: 16px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-arrow:after {\n border-bottom-color: rgba(0, 8, 16, .2);\n border-width: 0 7px 7px;\n bottom: 17px;\n left: 1px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-svg-arrow>svg {\n bottom: 16px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-svg-arrow:after {\n bottom: 17px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-arrow:before {\n border-left-color: #fff\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-arrow:after {\n border-left-color: rgba(0, 8, 16, .2);\n border-width: 7px 0 7px 7px;\n left: 17px;\n top: 1px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-svg-arrow>svg {\n left: 11px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-svg-arrow:after {\n left: 12px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-arrow:before {\n border-right-color: #fff;\n right: 16px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-arrow:after {\n border-width: 7px 7px 7px 0;\n right: 17px;\n top: 1px;\n border-right-color: rgba(0, 8, 16, .2)\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-svg-arrow>svg {\n right: 11px\n }\n\n .tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-svg-arrow:after {\n right: 12px\n }\n\n .tippy-box[data-theme~=light-border]>.tippy-svg-arrow {\n fill: #fff\n }\n\n .tippy-box[data-theme~=light-border]>.tippy-svg-arrow:after {\n background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMCA2czEuNzk2LS4wMTMgNC42Ny0zLjYxNUM1Ljg1MS45IDYuOTMuMDA2IDggMGMxLjA3LS4wMDYgMi4xNDguODg3IDMuMzQzIDIuMzg1QzE0LjIzMyA2LjAwNSAxNiA2IDE2IDZIMHoiIGZpbGw9InJnYmEoMCwgOCwgMTYsIDAuMikiLz48L3N2Zz4=);\n background-size: 16px 6px;\n width: 16px;\n height: 6px\n }\n',on="\n .tippy-box[data-theme~=light] {\n color: #26323d;\n box-shadow: 0 0 20px 4px rgba(154, 161, 177, .15), 0 4px 80px -8px rgba(36, 40, 47, .25), 0 4px 4px -2px rgba(91, 94, 105, .15);\n background-color: #fff\n }\n\n .tippy-box[data-theme~=light][data-placement^=top]>.tippy-arrow:before {\n border-top-color: #fff\n }\n\n .tippy-box[data-theme~=light][data-placement^=bottom]>.tippy-arrow:before {\n border-bottom-color: #fff\n }\n\n .tippy-box[data-theme~=light][data-placement^=left]>.tippy-arrow:before {\n border-left-color: #fff\n }\n\n .tippy-box[data-theme~=light][data-placement^=right]>.tippy-arrow:before {\n border-right-color: #fff\n }\n\n .tippy-box[data-theme~=light]>.tippy-backdrop {\n background-color: #fff\n }\n\n .tippy-box[data-theme~=light]>.tippy-svg-arrow {\n fill: #fff\n }",sn="\n .tippy-box[data-theme~=material] {\n background-color: #505355;\n font-weight: 600\n }\n\n .tippy-box[data-theme~=material][data-placement^=top]>.tippy-arrow:before {\n border-top-color: #505355\n }\n\n .tippy-box[data-theme~=material][data-placement^=bottom]>.tippy-arrow:before {\n border-bottom-color: #505355\n }\n\n .tippy-box[data-theme~=material][data-placement^=left]>.tippy-arrow:before {\n border-left-color: #505355\n }\n\n .tippy-box[data-theme~=material][data-placement^=right]>.tippy-arrow:before {\n border-right-color: #505355\n }\n\n .tippy-box[data-theme~=material]>.tippy-backdrop {\n background-color: #505355\n }\n\n .tippy-box[data-theme~=material]>.tippy-svg-arrow {\n fill: #505355\n }\n",an="\n .tippy-box[data-theme~=translucent] {\n background-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent]>.tippy-arrow {\n width: 14px;\n height: 14px\n }\n\n .tippy-box[data-theme~=translucent][data-placement^=top]>.tippy-arrow:before {\n border-width: 7px 7px 0;\n border-top-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent][data-placement^=bottom]>.tippy-arrow:before {\n border-width: 0 7px 7px;\n border-bottom-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent][data-placement^=left]>.tippy-arrow:before {\n border-width: 7px 0 7px 7px;\n border-left-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent][data-placement^=right]>.tippy-arrow:before {\n border-width: 7px 7px 7px 0;\n border-right-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent]>.tippy-backdrop {\n background-color: rgba(0, 0, 0, .7)\n }\n\n .tippy-box[data-theme~=translucent]>.tippy-svg-arrow {\n fill: rgba(0, 0, 0, .7)\n }\n";var ln=Object.freeze({__proto__:null,camelize:en,base:nn,lightBorder:rn,light:on,material:sn,translucent:an});function cn(t,e,i){if(!t.querySelector("#pb-popover-"+e)){const n=t.nodeType===Node.DOCUMENT_NODE?document.head:t;console.log("Loading tippy styles for theme %s into %o",e,n);const r=document.createElement("style");r.type="text/css",r.id="pb-popover-"+e,r.innerHTML=i,n.appendChild(r)}}function hn(t,e){if(cn(t,"base",nn),e&&"none"!==e){const i=en(e),n=ln[i];n&&cn(t,i,n)}}class dn extends(D(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{for:{type:String},theme:{type:String},placement:{type:String},fallbackPlacement:{type:String,attribute:"fallback-placement"},persistent:{type:Boolean},trigger:{type:String},touch:{type:String},popupClass:{type:String,attribute:"popup-class"},remote:{type:String},stopPropagation:{type:Boolean,attribute:"stop-propagation"}})}constructor(){super(),this.persistent=!1,this.trigger=null,this.for=null,this.theme=null,this.placement=null,this.touch=null,this.fallbackPlacement=null,this.popupClass=null,this.stopPropagation=!1,this._tippy=null,this._content=null}render(){return this.for?I`<div class="hidden"><slot></slot></div>`:I`<span id="link" part="trigger" class="${this.persistent?"persistent":""}"><slot name="default"><slot></slot></slot></span><span class="hidden"><slot name="alternate"></slot></span>`}disconnectedCallback(){super.disconnectedCallback(),this._tippy&&this._tippy.destroy(),this._observer&&this._observer.disconnect()}_checkCSSProperties(){if(this.theme||"none"===this.theme||(this.theme=H(this,"--pb-popover-theme","none")),this.placement||(this.placement=H(this,"--pb-popover-placement","auto")),this.fallbackPlacement||(this.fallbackPlacement=H(this,"--pb-popover-fallback-placement",null)),this.persistent||(this.persistent=H(this,"--pb-popover-persistent",!1)),this.trigger||(this.trigger=H(this,"--pb-popover-trigger",null)),!this.touch){const t=H(this,"--pb-popover-touch","hold");this.touch="true"===t||t}}_injectStyles(){this._checkCSSProperties(),hn(this.getRootNode(),this.theme)}_getContent(){if(this._content)return this._content;const t=this._getSlot();if(t){const e=document.createElement("div");return t.assignedNodes().forEach(t=>{e.appendChild(t.content?t.content.cloneNode(!0):t.cloneNode(!0))}),this._content=e,e}return null}_getSlot(){return this.for?this.shadowRoot.querySelector("slot"):this.shadowRoot.querySelector("[name=alternate]")}_registerMutationObserver(){const t=this._getSlot();this._observer=new MutationObserver(()=>{this.alternate=this._getContent(),console.log("alternate changed"),this.emitTo("pb-popover-changed",this.alternate)}),this._observer.observe(this,{subtree:!0,childList:!0,characterData:!0}),t&&t.assignedNodes().forEach(t=>{this._observer.observe(t.content?t.content:t,{subtree:!0,childList:!0,characterData:!0})})}get alternate(){return this._getContent()}set alternate(t){this._content=t,this._tippy&&this._tippy.setContent(this._content)}command(t,e){"disable"===t&&(this.disabled=e,this._tippy&&(e?this._tippy.disable():this._tippy.enable()))}firstUpdated(){super.firstUpdated(),this._injectStyles(),this._registerMutationObserver(),this.trigger||(this.trigger=this.persistent?"click":"mouseenter");const t=this.getRootNode();let e;if(this.for?(e=t.getElementById(this.for),e||console.error("<pb-popover> target element %s not found",this.for)):e=this.shadowRoot.getElementById("link"),e){const i={allowHTML:!0,appendTo:t.nodeType===Node.DOCUMENT_NODE?document.body:t,placement:this.placement,interactive:!0,ignoreAttributes:!0,boundary:"viewport",maxWidth:"none",touch:this.touch,hideOnClick:!1,trigger:this.trigger};if(this.stopPropagation&&(i.onTrigger=(t,e)=>{e.stopPropagation()}),this.persistent&&(i.onClickOutside=(t,e)=>{t.hideWithInteractivity(e)}),this.theme&&"none"!==this.theme&&(i.theme=this.theme),this.fallbackPlacement){const t=this.fallbackPlacement.split(" ");i.popperOptions={modifiers:[{name:"flip",options:{fallbackPlacements:t}}]}}this.popupClass&&(i.onCreate=t=>{t.popper.classList.add(this.popupClass)}),i.onShow=t=>{this.remote?this._loadRemoteContent():t.setContent(this._getContent()),this.emitTo("pb-popover-show",{source:this,popup:t})},this._tippy=tn(e,i)}}_loadRemoteContent(){const t=this.toAbsoluteURL(this.remote);fetch(t,{method:"GET",mode:"cors",credentials:"same-origin"}).then(t=>t.text()).then(t=>{this.alternate=t}).catch(t=>{console.error("<pb-popover> Error retrieving remote content: %o",t)})}static get styles(){return[R`
|
|
511
511
|
:host {
|
|
512
512
|
display: inline;
|
|
513
513
|
}
|
|
@@ -1235,7 +1235,7 @@ e({_template:n`
|
|
|
1235
1235
|
with-credentials
|
|
1236
1236
|
@response="${this._handleContent}"
|
|
1237
1237
|
@error="${this._handleError}"></iron-ajax>
|
|
1238
|
-
`]}}customElements.define("pb-view",na);const ra=[0,100],oa=[0,100],sa=t=>`${1===t.length?"0":""}${t}`,aa=(t,e,i)=>Math.max(Math.min(t,i),e),la=(t,e)=>Math.floor(Math.random()*(e-t+1))+t,ca=(t,e,i)=>{const n=la(t,e);for(let r=0;r<(null==i?void 0:i.length);r++){const o=i[r];if(2===(null==o?void 0:o.length)&&n>=o[0]&&n<=o[1])return ca(t,e,i)}return n},ha=t=>{const e=t.length;let i=0;for(let n=0;n<e;n++)i=(i<<5)-i+t.charCodeAt(n),i&=i;return i},da=(t,e)=>"number"==typeof e?e:t%Math.abs(e[1]-e[0])+e[0],pa=(t,e)=>"number"==typeof t?aa(Math.abs(t),...e):1===t.length||t[0]===t[1]?aa(Math.abs(t[0]),...e):[Math.abs(aa(t[0],...e)),aa(Math.abs(t[1]),...e)],ua=(t,e,i)=>(i<0?i+=1:i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t),ga=(t,e,i)=>{let n,r,o;if(t/=360,i/=100,0===(e/=100))n=r=o=i;else{const s=i<.5?i*(1+e):i+e-i*e,a=2*i-s;n=ua(a,s,t+1/3),r=ua(a,s,t),o=ua(a,s,t-1/3)}return[Math.round(255*n),Math.round(255*r),Math.round(255*o)]},fa=(t,e,i,n)=>(299*t+587*e+114*i)/1e3>=n,ma=(t,e,i)=>`hsl(${t}, ${e}%, ${i}%)`,va=(t,e,i,n)=>{switch(n){case"rgb":return`rgb(${t}, ${e}, ${i})`;case"hex":default:return`#${sa(t.toString(16))}${sa(e.toString(16))}${sa(i.toString(16))}`}},ba=(t,{format:e="hex",saturation:i=[50,55],lightness:n=[50,60],differencePoint:r=130}={})=>{const o=Math.abs(ha(String(t))),s=da(o,[0,360]),a=da(o,pa(i,ra)),l=da(o,pa(n,oa)),[c,h,d]=ga(s,a,l);return{color:"hsl"===e?ma(s,a,l):va(c,h,d,e),isLight:fa(c,h,d,r)}};function ya(t,e){let i=t;for(;i.parentNode!==e;)i=i.parentElement;return i}function _a(t){let e=t;e.nodeType===Node.TEXT_NODE&&(e=e.parentNode);const i=e.getAttribute("href");return i&&/^#fn_.*$/.test(i)}function wa(t,e,i){const n=document.createTreeWalker(t);for(n.currentNode=e;n.previousNode();){const t=n.currentNode;t.nodeType===Node.ELEMENT_NODE||_a(t)||(i+=t.textContent.length)}return i}function xa(t,e,i="start"){if(t.nodeType===Node.ELEMENT_NODE){const n=t.closest("[data-tei]");if(0===e)return{parent:n.getAttribute("data-tei"),offset:0};const r=n.childNodes[e];return{parent:n.getAttribute("data-tei"),offset:"end"===i?wa(n,r,0)-1:wa(n,r,0)}}const n=t.parentNode.closest("[data-tei]");if(n)return{parent:n.getAttribute("data-tei"),offset:wa(n,t,e)};console.error("No container with data-tei found for %o",t.parentNode)}function ka(t,e){let i=0,n=t.parentNode;for(;n&&n!==t.getRootNode();)n.classList.contains(e)&&(i+=1),n=n.parentNode;return i}function Aa(t,e){const i=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);return i.currentNode=e,i.nextNode()?i.currentNode:e}function Sa(t,e){let i=e;const n=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;n.nextNode();)if(!_a(n.currentNode)&&n.currentNode.textContent.length>0){if(i-n.currentNode.textContent.length<=0)return[n.currentNode,i];i-=n.currentNode.textContent.length}return null}function za(t,e,i,n=3){let r=e-1,o=0;for(;r>=0;){if(/[\p{P}\s]/.test(t.charAt(r))){for(;r>1&&/[\p{P}\s]/.test(t.charAt(r-1));)r-=1;if(o+=1,o===n)break}r-=1}let s=i+1;for(o=0;s<t.length;){if(/[\p{P}\s]/.test(t.charAt(s))){for(;s<t.length-1&&/[\p{P}\s]/.test(t.charAt(s+1));)s+=1;if(o+=1,o===n)break}s+=1}return`... ${t.substring(r,e)}<mark>${t.substring(e,i)}</mark>${t.substring(i,s+1)} ...`}function Ca(t){let e=t.parentElement;e.textContent.length<40&&(e=e.parentNode);const i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let n=0,r=0;const o=[];for(;i.nextNode();)i.currentNode===t&&(r=n),n+=i.currentNode.textContent.length,o.push(i.currentNode.textContent);return[o.join(""),r]}function Ea(t){const e={};return Object.keys(t.properties).forEach(i=>{const n=t.properties[i];n&&n.length>0&&(e[i]=n)}),Object.assign(t,{properties:e})}ba.random=({format:t="hex",saturation:e=[50,55],lightness:i=[50,60],differencePoint:n=130,excludeHue:r}={})=>{e=pa(e,ra),i=pa(i,oa);const o=r?ca(0,359,r):la(0,359),s="number"==typeof e?e:la(...e),a="number"==typeof i?i:la(...i),[l,c,h]=ga(o,s,a);return{color:"hsl"===t?ma(o,s,a):va(l,c,h,t),isLight:fa(l,c,h,n)}};class Ta extends na{static get properties(){return Object.assign({key:{type:String},keyMap:{type:Object,attribute:"key-map"},caseSensitive:{type:Boolean}},super.properties)}constructor(){super(),this.key="ref",this.keyMap={},this.caseSensitive=!1,this._ranges=[],this._rangesMap=new Map,this._history=[]}connectedCallback(){super.connectedCallback();let t=!1;this._inHandler=!1,this._pendingCallback=null;const e=(t=10)=>{this._pendingCallback=setTimeout(()=>{this._selectionChanged()},t)};this._eventHandler=i=>{if("selectionchange"===i.type||this._inHandler)return;if("mousedown"===i.type&&(t=!0),"mouseup"===i.type&&(t=!1),t)return;this._cancelPendingCallback();const n="mouseup"===i.type?10:100;e(n)},document.addEventListener("selectionchange",this._eventHandler.bind(this)),this.shadowRoot.addEventListener("mousedown",this._eventHandler.bind(this)),this.shadowRoot.addEventListener("mouseup",this._eventHandler.bind(this)),this.subscribeTo("pb-add-annotation",t=>this.addAnnotation(t.detail)),this.subscribeTo("pb-edit-annotation",this._editAnnotation.bind(this)),this.subscribeTo("pb-refresh",()=>{this._ranges=[],this._rangesMap.clear(),this._currentSelection=null,this._clearMarkers(),this.emitTo("pb-annotations-changed",{ranges:this._ranges,refresh:!0})}),this._resizeHandler()}get annotations(){return this._ranges}set annotations(t){this._ranges=t,this.updateAnnotations(!0),this._markIncompleteAnnotations(),this._initAnnotationColors(),this._annotationStyles()}saveHistory(){this._history.push(JSON.stringify(this._ranges)),this.emitTo("pb-annotations-history",this._history)}getHistory(){return this._history}popHistory(){if(0===this._history.length)return void console.warn("<pb-view-annotate> history is empty");this._scrollTop=this.scrollTop;const t=this._history.pop();this._clearMarkers(),this._ranges=JSON.parse(t),this._rangesMap.clear(),this._refresh(),this.emitTo("pb-annotations-changed",{ranges:this._ranges}),this.emitTo("pb-annotations-history",this._history)}clearHistory(t){this._history=t||[]}firstUpdated(){super.firstUpdated(),this.enableScrollbar(!1),hn(this.shadowRoot,"light-border")}render(){return[...super.render(),I`<div id="marker-layer"></div>`]}zoom(t){super.zoom(t),window.requestAnimationFrame(()=>this.refreshMarkers())}getKey(t){return this.keyMap[t]||this.key}_resizeHandler(){let t=null;const e=()=>{t=setTimeout(()=>{t=null,this.refreshMarkers()},200)};window.addEventListener("resize",()=>{t||this._clearMarkers(),t&&clearTimeout(t),e()})}_refresh(t){super._refresh(t),t&&t.detail&&t.detail.preserveScroll&&(this._scrollTop=this.scrollTop)}_handleContent(){super._handleContent(),this.updateComplete.then(()=>setTimeout(()=>{this._initAnnotationColors(),this._annotationStyles(),this.updateAnnotations(),this._markIncompleteAnnotations(),this._scrollTop&&(this.scrollTop=this._scrollTop,this._scrollTop=void 0),this.emitTo("pb-annotations-loaded")},300))}_updateAnnotation(t,e=!1,i=!1){const n=this.shadowRoot.getElementById("view"),r=Array.from(n.querySelectorAll(`[data-tei="${t.context}"]`)).filter(t=>null===t.closest("pb-popover")&&"footnote"!==t.getAttribute("rel"))[0];if(!r)return null;const o=document.createRange(),s=Sa(r,t.start),a=Sa(r,t.end);if(!s||!a)return console.error("<pb-view-annotate> Invalid range for %o",r),null;if(console.log("<pb-view-annotate> Range before adjust: %o %o",s,a),s[1]===s[0].textContent.length){const t=Aa(r,s[0]);t===a[0]?(o.setStart(t,0),s[0]=t,s[1]=0):o.setStartBefore(s[0].nextSibling||t)}else s[0]!==a[0]&&0===s[1]?o.setStartBefore(ya(s[0],r)):o.setStart(s[0],s[1]);s[0]!==a[0]&&a[0].textContent.length-1===a[1]?o.setEndAfter(ya(a[0],r)):o.setEnd(a[0],a[1]),console.log("<pb-view-annotate> Range: %o",o);const l=document.createElement("span"),c=""===t.properties[this.getKey(t.type)]?"incomplete":"";l.className=`annotation annotation-${t.type} ${t.type} ${c}`,l.dataset.type=t.type,l.dataset.annotation=JSON.stringify(t.properties);try{o.surroundContents(l)}catch(t){if(e)return null;throw new Error("An error occurred. The annotation may not be displayed. You should consider saving and reloading the document.")}return this._rangesMap.set(l,t),i||this.refreshMarkers(),l}updateAnnotations(t=!1){this._ranges.forEach(e=>{let i;switch(e.type){case"delete":i=this.shadowRoot.querySelector(`[data-tei="${e.node}"]`),i?this._deleteAnnotation(i):console.error("Annotation %s not found",e.context);break;case"modify":if(i=this.shadowRoot.querySelector(`[data-tei="${e.node}"]`),!i){console.error("<pb-view-annotate> Target node not found for %o",e.node);break}i.dataset.annotation=JSON.stringify(e.properties);break;default:this._updateAnnotation(e,t,!0)}}),window.requestAnimationFrame(()=>this.refreshMarkers())}_getSelection(){return this.shadowRoot.getSelection?this.shadowRoot.getSelection():window.getSelection()}_selectionChanged(){const t=this._getSelection(),e=this._selectedRange(t);if(e){let i=!1;const n=e.commonAncestorContainer;if(n.nodeType===Node.ELEMENT_NODE){if(e.startContainer.parentElement!==n){const t=ya(e.startContainer,n);e.setStartBefore(t),i=!0}if(e.endContainer.parentElement!==n){const t=ya(e.endContainer,n);e.setEndAfter(t),i=!0}}this._currentSelection=e,console.log("<pb-view-annotate> selection: %o",e),i&&(this._inHandler=!0,setTimeout(()=>{t.removeAllRanges(),t.addRange(e),this.inHandler=!1},100)),this.emitTo("pb-selection-changed",{hasContent:!0,range:e,selected:t.toString()})}else this.emitTo("pb-selection-changed",{hasContent:!1})}updateAnnotation(t,e=!1){t=Ea(t);const i=this._updateAnnotation(t,e);return i&&(this._ranges.push(t),this.emitTo("pb-annotations-changed",{type:t.type,text:t.text,ranges:this._ranges})),i}addAnnotation(t){const e=t.range||this._currentSelection,i=xa(e.startContainer,e.startOffset),n=xa(e.endContainer,e.endOffset,"end"),r={context:i.parent,start:i.offset,end:n.offset,text:e.cloneContents().textContent};return t.type&&(r.type=t.type),t.properties&&(r.properties=t.properties),console.log("<pb-view-annotate> range adjusted: %o",r),this._ranges.push(Ea(r)),this.emitTo("pb-annotations-changed",{type:r.type,text:r.text,ranges:this._ranges}),this._checkAnnotationColor(r.type),this._updateAnnotation(r)}deleteAnnotation(t){if(t.dataset.tei){const e=this._ranges.findIndex(e=>"modify"===e.type&&e.node===t.dataset.tei);e>-1&&this._ranges.splice(e,1);const i=t.parentNode.closest("[data-tei]"),n={type:"delete",node:t.dataset.tei,context:i.dataset.tei};this._ranges.push(n)}else{const e=this._rangesMap.get(t);this._rangesMap.delete(t);const i=this._ranges.indexOf(e);console.log("<pb-view-annotate> deleting annotation %o",e),this._ranges.splice(i,1)}this._deleteAnnotation(t)}_deleteAnnotation(t){const e=document.createRange();for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i].cloneNode(!0);t.parentNode.insertBefore(n,t),0===i&&e.setStartBefore(n),i===t.childNodes.length-1&&e.setEndAfter(n)}t.parentNode.removeChild(t),this.emitTo("pb-annotations-changed",{ranges:this._ranges}),window.requestAnimationFrame(()=>this.refreshMarkers()),this._inHandler=!0;try{const t=this._getSelection();t.removeAllRanges(),t.addRange(e)}catch(t){console.error("<pb-view-annotate> %s",t.message)}finally{this._inHandler=!1}}editAnnotation(t,e){if("edit"===t.dataset.type){let i=this._rangesMap.get(t);i?(i.properties=e,i=Ea(i),this.emitTo("pb-annotations-changed",{ranges:this._ranges})):console.error("no range found for edit span %o",t)}else if(t.dataset.tei){const i=t.closest("[data-tei]");let n=this._ranges.find(e=>"modify"===e.type&&e.node===t.dataset.tei);n||(n={type:"modify",node:t.dataset.tei,context:i.dataset.tei},this._ranges.push(n)),n.properties=e,n=Ea(n),this.emitTo("pb-annotations-changed",{ranges:this._ranges})}const i=JSON.parse(t.dataset.annotation),n=Object.assign(i||{},e);t.dataset.annotation=JSON.stringify(n),""!==n[this.getKey(t.dataset.type)]&&t.classList.remove("incomplete")}_editAnnotation(t){this.editAnnotation(t.detail.target,t.detail.properties)}_selectedRange(t){if(!t||0===t.rangeCount)return null;if(t.anchorNode.getRootNode()!==this.shadowRoot)return null;const e=t.getRangeAt(0);return e.collapsed?null:e}_cancelPendingCallback(){this._pendingCallback&&(clearTimeout(this._pendingCallback),this._pendingCallback=null)}_createTooltip(t){if(t._tippy||!t.dataset.annotation)return;const e=document.createElement("div");e.className="annotation-popup";const i=document.createElement("div");i.className="info",e.appendChild(i);const n=document.createElement("div");n.className="toolbar";const r=document.createElement("span");if(r.className="annotation-type",n.appendChild(r),t.dataset.annotation){const e=document.createElement("paper-icon-button");e.setAttribute("icon","icons:create"),e.setAttribute("title",G("annotations.edit")),e.addEventListener("click",()=>{const e=JSON.parse(t.dataset.annotation),i=t.textContent;this.emitTo("pb-annotation-edit",Object.assign({},{target:t,type:t.dataset.type,properties:e,text:i}))}),n.appendChild(e)}const o=document.createElement("paper-icon-button");o.setAttribute("icon","icons:delete"),o.setAttribute("title",G("annotations.delete")),o.addEventListener("click",()=>{this.saveHistory(),this.deleteAnnotation(t)}),n.appendChild(o),e.appendChild(n);const s=this.shadowRoot.getElementById("view");tn(t,{content:e,allowHTML:!0,interactive:!0,appendTo:s.nodeType===Node.DOCUMENT_NODE?document.body:s,theme:"light-border",hideOnClick:!1,maxWidth:"auto",trigger:"click",placement:"left",popperOptions:{modifiers:[{name:"flip",options:{fallbackPlacements:["right","top","bottom"]}}]},onTrigger:(e,n)=>{n.preventDefault(),n.stopPropagation();const o=t.dataset.type,s=JSON.parse(t.dataset.annotation)||{},a=this._annotationColors.get(o);if(r.innerHTML=o,r.style.backgroundColor=`var(--pb-annotation-${o})`,r.style.color=`var(${a&&a.isLight?"--pb-color-primary":"--pb-color-inverse"})`,s[this.getKey(o)])this.emitTo("pb-annotation-detail",{type:o,id:s[this.getKey(o)],container:i,span:t});else{i.innerHTML="";const t=Object.keys(s);if(0===t.length){const t=document.createElement("p");t.innerHTML=G("annotations.no-properties"),i.appendChild(t)}else{const e=document.createElement("table");t.forEach(t=>{const i=document.createElement("tr"),n=document.createElement("td");n.innerHTML=t,i.appendChild(n);const r=document.createElement("td");r.innerHTML=JSON.stringify(s[t],null,2),i.appendChild(r),e.appendChild(i)}),i.appendChild(e)}}},onClickOutside:(t,e)=>{t.hideWithInteractivity(e)}})}_showMarker(t,e,i,n=0){const r=t.getClientRects(),o=t.dataset.type;for(let t=0;t<r.length;t++){const s=r[t],a=document.createElement("div");a.className="marker annotation-"+o,a.style.position="absolute",a.style.left=s.left-i.left+"px",a.style.top=s.top-i.top+s.height+"px",a.style.marginTop=n+"px",a.style.width=s.width+"px",a.style.height="3px",a.style.backgroundColor=`var(--pb-annotation-${o})`,a.part="annotation",e.appendChild(a)}this._createTooltip(t)}_clearMarkers(){this.shadowRoot.getElementById("marker-layer").innerHTML=""}refreshMarkers(){const t=this.shadowRoot.getElementById("view"),e=t.getBoundingClientRect(),i=this.shadowRoot.getElementById("marker-layer");i.style.display="none",this._clearMarkers(),t.querySelectorAll(".annotation").forEach(t=>{t._tippy&&t._tippy.destroy(),this._showMarker(t,i,e,5*ka(t,"annotation"))}),i.style.display="block"}search(t,e){function i(t){let e=t.replace(/[/.?+*\\]/g,t=>"\\"+t).replace(/[\s\n\t]+/g,"\\s+");return/^\w/.test(e)&&(e="\\b"+e),/\w$/.test(e)&&(e+="\\b"),e}function n(t){return t.nodeType===Node.TEXT_NODE?NodeFilter.FILTER_ACCEPT:t.classList.contains("annotation-popup")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}n.acceptNode=n;const r=[];if(!e||0===e.length)return r;const o=e.filter(t=>t&&t.length>0).map(t=>i(t)).join("|");console.log(`<pb-view-annotate> Searching content for ${o}...`);const s=new RegExp(o,this.caseSensitive?"g":"gi"),a=document.createTreeWalker(this.shadowRoot.getElementById("view"),NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,n);for(;a.nextNode();){let e=a.currentNode;const i=Array.from(e.textContent.matchAll(s));for(const n of i){const i=n.index+n[0].length;let o=!1,s=null;const a=e.parentNode.dataset.annotation,l=e.parentNode.dataset.type;if(a&&l){const e=JSON.parse(a)||{};o=l===t,s=e[this.getKey(t)]}const c=xa(e,n.index),h=xa(e,i,"end"),[d,p]=Ca(e),u={annotated:o,context:c.parent,start:c.offset,end:h.offset,textNode:e,kwic:za(d,p+n.index,p+i)};u[this.getKey(t)]=s,r.push(u)}}return r}scrollTo(t){const e=this.shadowRoot.getElementById("view"),i=document.createRange();if(t.annotated)i.selectNode(t.textNode);else{const n=Array.from(e.querySelectorAll(`[data-tei="${t.context}"]`)).filter(t=>null===t.closest("pb-popover")&&"footnote"!==t.getAttribute("rel"))[0],r=Sa(n,t.start),o=Sa(n,t.end);i.setStart(r[0],r[1]),i.setEnd(o[0],o[1])}const n=e.getBoundingClientRect(),r=i.getBoundingClientRect();let o=e.querySelector("[part=highlight]");o||(o=document.createElement("div"),o.part="highlight",o.style.position="absolute",e.appendChild(o)),o.style.left=r.left-n.left-4+"px",o.style.top=r.top-n.top-4+"px",o.style.width=r.width+4+"px",o.style.height=r.height+"px",i.startContainer.parentNode.scrollIntoView(!0)}hideMarker(){const t=this.shadowRoot.getElementById("view").querySelector("[part=highlight]");t&&(t.style.top="-1000px")}_markIncompleteAnnotations(){this.shadowRoot.getElementById("view").querySelectorAll(".annotation.authority").forEach(t=>{if(t.dataset.type){const e=JSON.parse(t.dataset.annotation),i=this.getKey(t.dataset.type);e[i]&&0!==e[i].length?t.classList.remove("incomplete"):t.classList.add("incomplete")}})}_initAnnotationColors(){this._annotationColors=new Map;const t=new Set;this.shadowRoot.getElementById("view").querySelectorAll(".annotation").forEach(e=>{e.dataset.type&&t.add(e.dataset.type)}),t.forEach(t=>{this._annotationColors.set(t,ba("annotation-"+t.repeat(4),{saturation:70,lightness:[30,60]}))}),this.emitTo("pb-annotation-colors",{colors:this._annotationColors})}_checkAnnotationColor(t){this._annotationColors.has(t)||(this._annotationColors.set(t,ba("annotation-"+t.repeat(4),{saturation:70,lightness:[30,60]})),this._annotationStyles(),this.emitTo("pb-annotation-colors",{colors:this._annotationColors}))}_annotationStyles(){const t=this.shadowRoot.getElementById("view");let e=t.querySelector("_annotation-styles");e&&e.parentNode.removeChild(e);const i=[],n=[];this._annotationColors.forEach((t,e)=>{i.push(`--pb-annotation-${e}: ${t.color};`),i.push(`--pb-annotation-${e}-border: 2px solid var(--pb-annotation-${e});`),n.push(`\n .annotation-${e}::after {\n background-color: var(--pb-annotation-${e});\n border-color: var(--pb-annotation-${e});\n color: var(${t.isLight?"--pb-color-primary":"--pb-color-inverse"});\n }\n .annotation-${e}.incomplete::after {\n background: repeating-linear-gradient(\n 315deg,\n var(--pb-annotation-${e}),\n var(--pb-annotation-${e}) 5px,\n var(${t.isLight?"--pb-annotation-stripes-light":"--pb-annotation-stripes-dark"}) 5px,\n var(${t.isLight?"--pb-annotation-stripes-light":"--pb-annotation-stripes-dark"}) 10px\n );\n color: var(${t.isLight?"--pb-color-primary":"--pb-color-inverse"});\n }\n `)});const r=`\n :host {\n ${i.join("\n")}\n }\n\n ${n.join("\n")}\n `;e=document.createElement("style"),e.className="_annotation-styles",e.innerHTML=r,t.insertBefore(e,t.firstChild)}static get styles(){return[super.styles,R`
|
|
1238
|
+
`]}}customElements.define("pb-view",na);const ra=[0,100],oa=[0,100],sa=t=>`${1===t.length?"0":""}${t}`,aa=(t,e,i)=>Math.max(Math.min(t,i),e),la=(t,e)=>Math.floor(Math.random()*(e-t+1))+t,ca=(t,e,i)=>{const n=la(t,e);for(let r=0;r<(null==i?void 0:i.length);r++){const o=i[r];if(2===(null==o?void 0:o.length)&&n>=o[0]&&n<=o[1])return ca(t,e,i)}return n},ha=t=>{const e=t.length;let i=0;for(let n=0;n<e;n++)i=(i<<5)-i+t.charCodeAt(n),i&=i;return i},da=(t,e)=>"number"==typeof e?e:t%Math.abs(e[1]-e[0])+e[0],pa=(t,e)=>"number"==typeof t?aa(Math.abs(t),...e):1===t.length||t[0]===t[1]?aa(Math.abs(t[0]),...e):[Math.abs(aa(t[0],...e)),aa(Math.abs(t[1]),...e)],ua=(t,e,i)=>(i<0?i+=1:i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t),ga=(t,e,i)=>{let n,r,o;if(t/=360,i/=100,0===(e/=100))n=r=o=i;else{const s=i<.5?i*(1+e):i+e-i*e,a=2*i-s;n=ua(a,s,t+1/3),r=ua(a,s,t),o=ua(a,s,t-1/3)}return[Math.round(255*n),Math.round(255*r),Math.round(255*o)]},fa=(t,e,i,n)=>(299*t+587*e+114*i)/1e3>=n,ma=(t,e,i)=>`hsl(${t}, ${e}%, ${i}%)`,va=(t,e,i,n)=>{switch(n){case"rgb":return`rgb(${t}, ${e}, ${i})`;case"hex":default:return`#${sa(t.toString(16))}${sa(e.toString(16))}${sa(i.toString(16))}`}},ba=(t,{format:e="hex",saturation:i=[50,55],lightness:n=[50,60],differencePoint:r=130}={})=>{const o=Math.abs(ha(String(t))),s=da(o,[0,360]),a=da(o,pa(i,ra)),l=da(o,pa(n,oa)),[c,h,d]=ga(s,a,l);return{color:"hsl"===e?ma(s,a,l):va(c,h,d,e),isLight:fa(c,h,d,r)}};function ya(t,e){let i=t;for(;i.parentNode!==e;)i=i.parentElement;return i}function _a(t){let e=t;e.nodeType===Node.TEXT_NODE&&(e=e.parentNode);const i=e.getAttribute("href");return i&&/^#fn_.*$/.test(i)}function wa(t,e,i){const n=document.createTreeWalker(t);for(n.currentNode=e;n.previousNode();){const t=n.currentNode;t.nodeType===Node.ELEMENT_NODE||_a(t)||(i+=t.textContent.length)}return i}function xa(t,e,i="start"){if(t.nodeType===Node.ELEMENT_NODE){const n=t.closest("[data-tei]");if(0===e)return{parent:n.getAttribute("data-tei"),offset:0};const r=n.childNodes[e];return{parent:n.getAttribute("data-tei"),offset:"end"===i?wa(n,r,0)-1:wa(n,r,0)}}const n=t.parentNode.closest("[data-tei]");if(n)return{parent:n.getAttribute("data-tei"),offset:wa(n,t,e)};console.error("No container with data-tei found for %o",t.parentNode)}function ka(t,e){let i=0,n=t.parentNode;for(;n&&n!==t.getRootNode();)n.classList.contains(e)&&(i+=1),n=n.parentNode;return i}function Aa(t,e){const i=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);return i.currentNode=e,i.nextNode()?i.currentNode:e}function Sa(t,e){let i=e;const n=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;n.nextNode();)if(!_a(n.currentNode)&&n.currentNode.textContent.length>0){if(i-n.currentNode.textContent.length<=0)return[n.currentNode,i];i-=n.currentNode.textContent.length}return null}function za(t,e,i,n=3){let r=e-1,o=0;for(;r>=0;){if(/[\p{P}\s]/.test(t.charAt(r))){for(;r>1&&/[\p{P}\s]/.test(t.charAt(r-1));)r-=1;if(o+=1,o===n)break}r-=1}let s=i+1;for(o=0;s<t.length;){if(/[\p{P}\s]/.test(t.charAt(s))){for(;s<t.length-1&&/[\p{P}\s]/.test(t.charAt(s+1));)s+=1;if(o+=1,o===n)break}s+=1}return`... ${t.substring(r,e)}<mark>${t.substring(e,i)}</mark>${t.substring(i,s+1)} ...`}function Ca(t){let e=t.parentElement;e.textContent.length<40&&(e=e.parentNode);const i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let n=0,r=0;const o=[];for(;i.nextNode();)i.currentNode===t&&(r=n),n+=i.currentNode.textContent.length,o.push(i.currentNode.textContent);return[o.join(""),r]}function Ea(t){const e={};return Object.keys(t.properties).forEach(i=>{const n=t.properties[i];n&&n.length>0&&(e[i]=n)}),Object.assign(t,{properties:e})}ba.random=({format:t="hex",saturation:e=[50,55],lightness:i=[50,60],differencePoint:n=130,excludeHue:r}={})=>{e=pa(e,ra),i=pa(i,oa);const o=r?ca(0,359,r):la(0,359),s="number"==typeof e?e:la(...e),a="number"==typeof i?i:la(...i),[l,c,h]=ga(o,s,a);return{color:"hsl"===t?ma(o,s,a):va(l,c,h,t),isLight:fa(l,c,h,n)}};class Ta extends na{static get properties(){return Object.assign({key:{type:String},keyMap:{type:Object,attribute:"key-map"},caseSensitive:{type:Boolean}},super.properties)}constructor(){super(),this.key="ref",this.keyMap={},this.caseSensitive=!1,this._ranges=[],this._rangesMap=new Map,this._history=[]}connectedCallback(){super.connectedCallback();let t=!1;this._inHandler=!1,this._pendingCallback=null;const e=(t=10)=>{this._pendingCallback=setTimeout(()=>{this._selectionChanged()},t)};this._eventHandler=i=>{if("selectionchange"===i.type||this._inHandler)return;if("mousedown"===i.type&&(t=!0),"mouseup"===i.type&&(t=!1),t)return;this._cancelPendingCallback();const n="mouseup"===i.type?10:100;e(n)},document.addEventListener("selectionchange",this._eventHandler.bind(this)),this.shadowRoot.addEventListener("mousedown",this._eventHandler.bind(this)),this.shadowRoot.addEventListener("mouseup",this._eventHandler.bind(this)),this.subscribeTo("pb-add-annotation",t=>this.addAnnotation(t.detail)),this.subscribeTo("pb-edit-annotation",this._editAnnotation.bind(this)),this.subscribeTo("pb-refresh",()=>{this._ranges=[],this._rangesMap.clear(),this._currentSelection=null,this._clearMarkers(),this.emitTo("pb-annotations-changed",{ranges:this._ranges,refresh:!0})}),this._resizeHandler()}get annotations(){return this._ranges}set annotations(t){this._ranges=t,this.updateAnnotations(!0),this._markIncompleteAnnotations(),this._initAnnotationColors(),this._annotationStyles()}saveHistory(){this._history.push(JSON.stringify(this._ranges)),this.emitTo("pb-annotations-history",this._history)}getHistory(){return this._history}popHistory(){if(0===this._history.length)return void console.warn("<pb-view-annotate> history is empty");this._scrollTop=this.scrollTop;const t=this._history.pop();this._clearMarkers(),this._ranges=JSON.parse(t),this._rangesMap.clear(),this._refresh(),this.emitTo("pb-annotations-changed",{ranges:this._ranges}),this.emitTo("pb-annotations-history",this._history)}clearHistory(t){this._history=t||[]}firstUpdated(){super.firstUpdated(),this.enableScrollbar(!1),hn(this.shadowRoot,"light-border")}render(){return[...super.render(),I`<div id="marker-layer"></div>`]}zoom(t){super.zoom(t),window.requestAnimationFrame(()=>this.refreshMarkers())}getKey(t){return this.keyMap[t]||this.key}_resizeHandler(){let t=null;const e=()=>{t=setTimeout(()=>{t=null,this.refreshMarkers()},200)};window.addEventListener("resize",()=>{t||this._clearMarkers(),t&&clearTimeout(t),e()})}_refresh(t){super._refresh(t),t&&t.detail&&t.detail.preserveScroll&&(this._scrollTop=this.scrollTop)}_handleContent(){super._handleContent(),this.updateComplete.then(()=>setTimeout(()=>{this._initAnnotationColors(),this._annotationStyles(),this.updateAnnotations(),this._markIncompleteAnnotations(),this._scrollTop&&(this.scrollTop=this._scrollTop,this._scrollTop=void 0),this.emitTo("pb-annotations-loaded")},300))}_updateAnnotation(t,e=!1,i=!1){const n=this.shadowRoot.getElementById("view"),r=Array.from(n.querySelectorAll(`[data-tei="${t.context}"]`)).filter(t=>null===t.closest("pb-popover")&&"footnote"!==t.getAttribute("rel"))[0];if(!r)return null;const o=document.createRange(),s=Sa(r,t.start),a=Sa(r,t.end);if(!s||!a)return console.error("<pb-view-annotate> Invalid range for %o",r),null;if(console.log("<pb-view-annotate> Range before adjust: %o %o",s,a),s[1]===s[0].textContent.length){const t=Aa(r,s[0]);t===a[0]?(o.setStart(t,0),s[0]=t,s[1]=0):o.setStartBefore(s[0].nextSibling||t)}else s[0]!==a[0]&&0===s[1]?o.setStartBefore(ya(s[0],r)):o.setStart(s[0],s[1]);s[0]!==a[0]&&a[0].textContent.length-1===a[1]?o.setEndAfter(ya(a[0],r)):o.setEnd(a[0],a[1]),console.log("<pb-view-annotate> Range: %o",o);const l=document.createElement("span"),c=""===t.properties[this.getKey(t.type)]?"incomplete":"";l.className=`annotation annotation-${t.type} ${t.type} ${c}`,l.dataset.type=t.type,l.dataset.annotation=JSON.stringify(t.properties);try{o.surroundContents(l)}catch(t){if(e)return null;throw new Error("An error occurred. The annotation may not be displayed. You should consider saving and reloading the document.")}return this._rangesMap.set(l,t),i||this.refreshMarkers(),l}updateAnnotations(t=!1){this._ranges.forEach(e=>{let i;switch(e.type){case"delete":i=this.shadowRoot.querySelector(`[data-tei="${e.node}"]`),i?this._deleteAnnotation(i):console.error("Annotation %s not found",e.context);break;case"modify":if(i=this.shadowRoot.querySelector(`[data-tei="${e.node}"]`),!i){console.error("<pb-view-annotate> Target node not found for %o",e.node);break}i.dataset.annotation=JSON.stringify(e.properties);break;default:this._updateAnnotation(e,t,!0)}}),window.requestAnimationFrame(()=>this.refreshMarkers())}_getSelection(){return this.shadowRoot.getSelection?this.shadowRoot.getSelection():window.getSelection()}_selectionChanged(){const t=this._getSelection(),e=this._selectedRange(t);if(e){let i=!1;const n=e.commonAncestorContainer;if(n.nodeType===Node.ELEMENT_NODE){if(e.startContainer.parentElement!==n){const t=ya(e.startContainer,n);e.setStartBefore(t),i=!0}if(e.endContainer.parentElement!==n){const t=ya(e.endContainer,n);e.setEndAfter(t),i=!0}}this._currentSelection=e,console.log("<pb-view-annotate> selection: %o",e),i&&(this._inHandler=!0,setTimeout(()=>{t.removeAllRanges(),t.addRange(e),this.inHandler=!1},100)),this.emitTo("pb-selection-changed",{hasContent:!0,range:e,selected:t.toString()})}else this.emitTo("pb-selection-changed",{hasContent:!1})}updateAnnotation(t,e=!1){t=Ea(t);const i=this._updateAnnotation(t,e);return i&&(this._ranges.push(t),this.emitTo("pb-annotations-changed",{type:t.type,text:t.text,ranges:this._ranges})),i}addAnnotation(t){const e=t.range||this._currentSelection,i=xa(e.startContainer,e.startOffset),n=xa(e.endContainer,e.endOffset,"end"),r={context:i.parent,start:i.offset,end:n.offset,text:e.cloneContents().textContent};return t.type&&(r.type=t.type),t.properties&&(r.properties=t.properties),console.log("<pb-view-annotate> range adjusted: %o",r),this._ranges.push(Ea(r)),this.emitTo("pb-annotations-changed",{type:r.type,text:r.text,ranges:this._ranges}),this._checkAnnotationColor(r.type),this._updateAnnotation(r)}deleteAnnotation(t){if(t.dataset.tei){const e=this._ranges.findIndex(e=>"modify"===e.type&&e.node===t.dataset.tei);e>-1&&this._ranges.splice(e,1);const i=t.parentNode.closest("[data-tei]"),n={type:"delete",node:t.dataset.tei,context:i.dataset.tei};this._ranges.push(n)}else{const e=this._rangesMap.get(t);this._rangesMap.delete(t);const i=this._ranges.indexOf(e);console.log("<pb-view-annotate> deleting annotation %o",e),this._ranges.splice(i,1)}this._deleteAnnotation(t)}_deleteAnnotation(t){const e=document.createRange();for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i].cloneNode(!0);t.parentNode.insertBefore(n,t),0===i&&e.setStartBefore(n),i===t.childNodes.length-1&&e.setEndAfter(n)}t.parentNode.removeChild(t),this.emitTo("pb-annotations-changed",{ranges:this._ranges}),window.requestAnimationFrame(()=>this.refreshMarkers()),this._inHandler=!0;try{const t=this._getSelection();t.removeAllRanges(),t.addRange(e)}catch(t){console.error("<pb-view-annotate> %s",t.message)}finally{this._inHandler=!1}}editAnnotation(t,e){if("edit"===t.dataset.type){let i=this._rangesMap.get(t);i?(i.properties=e,i=Ea(i),this.emitTo("pb-annotations-changed",{ranges:this._ranges})):console.error("no range found for edit span %o",t)}else if(t.dataset.tei){const i=t.closest("[data-tei]");let n=this._ranges.find(e=>"modify"===e.type&&e.node===t.dataset.tei);n||(n={type:"modify",node:t.dataset.tei,context:i.dataset.tei},this._ranges.push(n)),n.properties=e,n=Ea(n),this.emitTo("pb-annotations-changed",{ranges:this._ranges})}const i=JSON.parse(t.dataset.annotation),n=Object.assign(i||{},e);t.dataset.annotation=JSON.stringify(n),""!==n[this.getKey(t.dataset.type)]&&t.classList.remove("incomplete")}_editAnnotation(t){this.editAnnotation(t.detail.target,t.detail.properties)}_selectedRange(t){if(!t||0===t.rangeCount)return null;if(t.anchorNode.getRootNode()!==this.shadowRoot)return null;const e=t.getRangeAt(0);return e.collapsed?null:e}_cancelPendingCallback(){this._pendingCallback&&(clearTimeout(this._pendingCallback),this._pendingCallback=null)}_createTooltip(t){if(t._tippy||!t.dataset.annotation)return;const e=document.createElement("div");e.className="annotation-popup";const i=document.createElement("div");i.className="info",e.appendChild(i);const n=document.createElement("div");n.className="toolbar";const r=document.createElement("span");if(r.className="annotation-type",n.appendChild(r),t.dataset.annotation){const e=document.createElement("paper-icon-button");e.setAttribute("icon","icons:create"),e.setAttribute("title",G("annotations.edit")),e.addEventListener("click",()=>{const e=JSON.parse(t.dataset.annotation),i=t.textContent;this.emitTo("pb-annotation-edit",Object.assign({},{target:t,type:t.dataset.type,properties:e,text:i}))}),n.appendChild(e)}const o=document.createElement("paper-icon-button");o.setAttribute("icon","icons:delete"),o.setAttribute("title",G("annotations.delete")),o.addEventListener("click",()=>{this.saveHistory(),this.deleteAnnotation(t)}),n.appendChild(o),e.appendChild(n);const s=this.shadowRoot.getElementById("view");tn(t,{content:e,allowHTML:!0,interactive:!0,appendTo:s.nodeType===Node.DOCUMENT_NODE?document.body:s,theme:"light-border",hideOnClick:!1,maxWidth:"auto",trigger:"click",placement:"left",popperOptions:{modifiers:[{name:"flip",options:{fallbackPlacements:["right","top","bottom"]}}]},onTrigger:(n,o)=>{o.preventDefault(),o.stopPropagation();const s=t.dataset.type,a=JSON.parse(t.dataset.annotation)||{},l=this._annotationColors.get(s);if(r.innerHTML=s,r.style.backgroundColor=`var(--pb-annotation-${s})`,r.style.color=`var(${l&&l.isLight?"--pb-color-primary":"--pb-color-inverse"})`,a[this.getKey(s)])this.emitTo("pb-annotation-detail",{type:s,id:a[this.getKey(s)],container:i,span:t,ready:()=>n.setContent(e)});else{i.innerHTML="";const t=Object.keys(a);if(0===t.length){const t=document.createElement("p");t.innerHTML=G("annotations.no-properties"),i.appendChild(t)}else{const e=document.createElement("table");t.forEach(t=>{const i=document.createElement("tr"),n=document.createElement("td");n.innerHTML=t,i.appendChild(n);const r=document.createElement("td");r.innerHTML=JSON.stringify(a[t],null,2),i.appendChild(r),e.appendChild(i)}),i.appendChild(e)}}},onClickOutside:(t,e)=>{t.hideWithInteractivity(e)}})}_showMarker(t,e,i,n=0){const r=t.getClientRects(),o=t.dataset.type;for(let t=0;t<r.length;t++){const s=r[t],a=document.createElement("div");a.className="marker annotation-"+o,a.style.position="absolute",a.style.left=s.left-i.left+"px",a.style.top=s.top-i.top+s.height+"px",a.style.marginTop=n+"px",a.style.width=s.width+"px",a.style.height="3px",a.style.backgroundColor=`var(--pb-annotation-${o})`,a.part="annotation",e.appendChild(a)}this._createTooltip(t)}_clearMarkers(){this.shadowRoot.getElementById("marker-layer").innerHTML=""}refreshMarkers(){const t=this.shadowRoot.getElementById("view"),e=t.getBoundingClientRect(),i=this.shadowRoot.getElementById("marker-layer");i.style.display="none",this._clearMarkers(),t.querySelectorAll(".annotation").forEach(t=>{t._tippy&&t._tippy.destroy(),this._showMarker(t,i,e,5*ka(t,"annotation"))}),i.style.display="block"}search(t,e){function i(t){let e=t.replace(/[/.?+*\\]/g,t=>"\\"+t).replace(/[\s\n\t]+/g,"\\s+");return/^\w/.test(e)&&(e="\\b"+e),/\w$/.test(e)&&(e+="\\b"),e}function n(t){return t.nodeType===Node.TEXT_NODE?NodeFilter.FILTER_ACCEPT:t.classList.contains("annotation-popup")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}n.acceptNode=n;const r=[];if(!e||0===e.length)return r;const o=e.filter(t=>t&&t.length>0).map(t=>i(t)).join("|");console.log(`<pb-view-annotate> Searching content for ${o}...`);const s=new RegExp(o,this.caseSensitive?"g":"gi"),a=document.createTreeWalker(this.shadowRoot.getElementById("view"),NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,n);for(;a.nextNode();){let e=a.currentNode;const i=Array.from(e.textContent.matchAll(s));for(const n of i){const i=n.index+n[0].length;let o=!1,s=null;const a=e.parentNode.dataset.annotation,l=e.parentNode.dataset.type;if(a&&l){const e=JSON.parse(a)||{};o=l===t,s=e[this.getKey(t)]}const c=xa(e,n.index),h=xa(e,i,"end"),[d,p]=Ca(e),u={annotated:o,context:c.parent,start:c.offset,end:h.offset,textNode:e,kwic:za(d,p+n.index,p+i)};u[this.getKey(t)]=s,r.push(u)}}return r}scrollTo(t){const e=this.shadowRoot.getElementById("view"),i=document.createRange();if(t.annotated)i.selectNode(t.textNode);else{const n=Array.from(e.querySelectorAll(`[data-tei="${t.context}"]`)).filter(t=>null===t.closest("pb-popover")&&"footnote"!==t.getAttribute("rel"))[0],r=Sa(n,t.start),o=Sa(n,t.end);i.setStart(r[0],r[1]),i.setEnd(o[0],o[1])}const n=e.getBoundingClientRect(),r=i.getBoundingClientRect();let o=e.querySelector("[part=highlight]");o||(o=document.createElement("div"),o.part="highlight",o.style.position="absolute",e.appendChild(o)),o.style.left=r.left-n.left-4+"px",o.style.top=r.top-n.top-4+"px",o.style.width=r.width+4+"px",o.style.height=r.height+"px",i.startContainer.parentNode.scrollIntoView(!0)}hideMarker(){const t=this.shadowRoot.getElementById("view").querySelector("[part=highlight]");t&&(t.style.top="-1000px")}_markIncompleteAnnotations(){this.shadowRoot.getElementById("view").querySelectorAll(".annotation.authority").forEach(t=>{if(t.dataset.type){const e=JSON.parse(t.dataset.annotation),i=this.getKey(t.dataset.type);e[i]&&0!==e[i].length?t.classList.remove("incomplete"):t.classList.add("incomplete")}})}_initAnnotationColors(){this._annotationColors=new Map;const t=new Set;this.shadowRoot.getElementById("view").querySelectorAll(".annotation").forEach(e=>{e.dataset.type&&t.add(e.dataset.type)}),t.forEach(t=>{this._annotationColors.set(t,ba("annotation-"+t.repeat(4),{saturation:70,lightness:[30,60]}))}),this.emitTo("pb-annotation-colors",{colors:this._annotationColors})}_checkAnnotationColor(t){this._annotationColors.has(t)||(this._annotationColors.set(t,ba("annotation-"+t.repeat(4),{saturation:70,lightness:[30,60]})),this._annotationStyles(),this.emitTo("pb-annotation-colors",{colors:this._annotationColors}))}_annotationStyles(){const t=this.shadowRoot.getElementById("view");let e=t.querySelector("_annotation-styles");e&&e.parentNode.removeChild(e);const i=[],n=[];this._annotationColors.forEach((t,e)=>{i.push(`--pb-annotation-${e}: ${t.color};`),i.push(`--pb-annotation-${e}-border: 2px solid var(--pb-annotation-${e});`),n.push(`\n .annotation-${e}::after {\n background-color: var(--pb-annotation-${e});\n border-color: var(--pb-annotation-${e});\n color: var(${t.isLight?"--pb-color-primary":"--pb-color-inverse"});\n }\n .annotation-${e}.incomplete::after {\n background: repeating-linear-gradient(\n 315deg,\n var(--pb-annotation-${e}),\n var(--pb-annotation-${e}) 5px,\n var(${t.isLight?"--pb-annotation-stripes-light":"--pb-annotation-stripes-dark"}) 5px,\n var(${t.isLight?"--pb-annotation-stripes-light":"--pb-annotation-stripes-dark"}) 10px\n );\n color: var(${t.isLight?"--pb-color-primary":"--pb-color-inverse"});\n }\n `)});const r=`\n :host {\n ${i.join("\n")}\n }\n\n ${n.join("\n")}\n `;e=document.createElement("style"),e.className="_annotation-styles",e.innerHTML=r,t.insertBefore(e,t.firstChild)}static get styles(){return[super.styles,R`
|
|
1239
1239
|
.annotation-type {
|
|
1240
1240
|
display: inline-block;
|
|
1241
1241
|
text-align: right;
|
|
@@ -3949,7 +3949,7 @@ const Al=e({is:"iron-label",listeners:{tap:"_tapHandler"},properties:{for:{type:
|
|
|
3949
3949
|
align-items: center;
|
|
3950
3950
|
padding: 0 16px;
|
|
3951
3951
|
}
|
|
3952
|
-
`}}customElements.define("pb-clipboard",zl);class Cl{constructor(t){this._prefix=t.getAttribute("prefix"),this._config={name:t.getAttribute("name"),properties:{}},this._register=this._config.name}get register(){return this._register}get name(){return this._register}set name(t){this._register=t}get editable(){return!1}query(t){throw new Error("Method query not implemented")}info(t,e){return e.innerHTML="not implemented",Promise.resolve()}async select(t){return Promise.resolve(t)}async getRecord(t){return Promise.reject()}}class El extends Cl{async query(t){const e=t.replace(/[^\w\s]+/g,""),i=[],n="https://api.metagrid.ch/search?query="+encodeURIComponent(e);return new Promise(t=>{fetch(n).then(t=>t.json()).then(e=>{e.resources.forEach(t=>{const e=`${t.metadata.last_name}, ${t.metadata.first_name} `,n={register:this._register,id:`${t.provider.slug}-${t.identifier}`,label:e,details:`${t.metadata.birth_date} - ${t.metadata.death_date}`,link:t.link.uri,provider:t.provider.slug};i.push(n)}),t({totalItems:e.meta.total,items:i})})})}info(t,e){const i=t.indexOf("-"),n=t.substring(0,i);return new Promise(i=>{this.getRecord(t).then(t=>{const r=`\n <h3 class="label">\n <a href="https://${t.link.uri}" target="_blank">\n ${t.metadata.last_name}, ${t.metadata.first_name}\n </a>\n </h3>\n <p>${t.metadata.birth_date} - ${t.metadata.death_date}</p>\n `;e.innerHTML=r,i({id:`${n}-${t.identifier}`,strings:[`${t.metadata.first_name} ${t.metadata.last_name}`]})})})}async getRecord(t){const e=t.indexOf("-"),i=t.substring(0,e),n=t.substring(e+1);return fetch(`https://api.metagrid.ch/search?slug=${i}&query=${n}`).then(t=>t.json()).then(t=>{const e=t.resources[0],i=Object.assign({},e);return i.name=`${e.metadata.first_name} ${e.metadata.last_name}`,i.links=["https://"+e.link.uri],e.metadata.birth_date&&e.metadata.birth_date.length>0&&(i.birth=e.metadata.birth_date),e.metadata.death_date&&e.metadata.death_date.length>0&&(i.death=e.metadata.death_date),i}).catch(t=>Promise.reject(t))}}class Tl extends Cl{constructor(t){super(t),this.user=t.getAttribute("user")}async query(t){const e=[];return new Promise(i=>{fetch(`https://secure.geonames.org/searchJSON?formatted=true&q=${encodeURIComponent(t)}&maxRows=100&&username=${this.user}&style=full`).then(t=>t.json()).then(t=>{t.geonames.forEach(t=>{const i={register:this._register,id:this._prefix?`${this._prefix}-${t.geonameId}`:t.geonameId,label:t.toponymName,details:`${t.fcodeName} - ${t.adminName1}, ${t.countryName}`,link:"https://www.geonames.org/"+t.geonameId,strings:[t.toponymName],provider:"geonames.org"};e.push(i)}),i({totalItems:t.totalResultsCount,items:e})})})}info(t,e){return t?new Promise((i,n)=>{this.getRecord(t).then(t=>{if(t.status)return void n(t.status.message);const r=`\n <h3 class="label">\n <a href="${t.link}" target="_blank">${t.name}</a>\n </h3>\n <p class="fcode">${t.note} - ${t.region}, ${t.country}</p>\n `;e.innerHTML=r,i({id:this._prefix?`${this._prefix}-${t.geonameId}`:t.geonameId,strings:[t.name]})}).catch(()=>n())}):Promise.resolve({})}async getRecord(t){const e=this._prefix?t.substring(this._prefix.length+1):t;return fetch(`https://secure.geonames.org/getJSON?geonameId=${encodeURIComponent(e)}&username=${this.user}`).then(t=>t.ok?t.json():Promise.reject(t.status)).then(t=>{const e=Object.assign({},t);return e.name=t.toponymName,e.country=t.countryName,e.region=t.adminName1,e.note=t.fcodeName,e.links=["https://www.geonames.org/"+t.geonameId,"https://"+t.wikipediaURL],e}).catch(()=>Promise.reject())}}function Ll(t="",e){return t.replace(/\${([^}]+)}/g,(t,i)=>{let n;return e[i]&&(n=e[i]),n||""})}function Ml(t,e){const i=t.querySelector(e);if(i instanceof HTMLTemplateElement){const t=document.createElement("div");return t.appendChild(i.content.cloneNode(!0)),t.innerHTML}return""}class Ol extends Cl{constructor(t){super(t),this.apiKey=t.getAttribute("api-key"),this.baseKey=t.getAttribute("base"),this.table=t.getAttribute("table"),this.view=t.getAttribute("view"),this.filterExpr=t.getAttribute("filter"),this.labelExpr=t.getAttribute("label");const e=t.getAttribute("fields");this.fields=e?e.split(/\s*,\s*/):["ID"];const i=t.getAttribute("tokenize");this.tokenize=i?i.split(/\s*,\s*/):[this.fields[0]],this.tokenizeChars=t.getAttribute("tokenize-regex")||"\\W",this.infoExpr=Ml(t,".info"),this.detailExpr=Ml(t,".detail"),this._init()}_init(){window.ESGlobalBridge.requestAvailability();const t=P("../lib/airtable.browser.js");window.ESGlobalBridge.instance.load("airtable",t),window.addEventListener("es-bridge-airtable-loaded",this._initAirtable.bind(this),{once:!0})}_initAirtable(){const t=require("airtable");this.base=new t({apiKey:this.apiKey}).base(this.baseKey)}async query(t){t=t.toLowerCase();const e=[],i=this.filterExpr?Ll(this.filterExpr,{key:t}):null,n={fields:this.fields,maxRecords:100};return this.view&&(n.view=this.view),i&&(n.filterByFormula=i),new Promise((t,i)=>{this.base(this.table).select(n).firstPage((n,r)=>{if(n)return console.error(n),void i(n);r.forEach(t=>{const i={};this.fields.forEach(e=>{i[e]=t.get(e)});const n={register:this._register,id:t.id,label:Ll(this.labelExpr,i),details:Ll(this.detailExpr,i),provider:"airtable"};e.push(n)}),t({totalItems:3,items:e})})})}info(t,e){return new Promise((i,n)=>{this.base(this.table).find(t,(r,o)=>{if(r){switch(r.statusCode){case 404:n(`No record found for ${t} in table ${this.table}`);break;default:n(`${r.statusCode}: ${r.message}`)}return}if(0===Object.keys(o.fields).length)return void n(`No record found for ${t} in table ${this.table}`);let s=[];const a={};this.fields.forEach(t=>{const e=o.get(t);e&&(a[t]=e,s.push(e))});const l=new RegExp(this.tokenizeChars);this.tokenize.forEach(t=>{a[t]&&(s=s.concat(a[t].split(l)))}),s=s.filter(t=>!/^\d+$/.test(t)),s.sort((t,e)=>e.length-t.length),e.innerHTML=Ll(this.infoExpr,a),i({id:o.id,strings:s})})})}}function $l(t){let e="";t.professionOrOccupation&&t.professionOrOccupation.length>0&&(e=t.professionOrOccupation.map(t=>t.label).join(", ")),t.biographicalOrHistoricalInformation&&(e=`${e}; ${t.biographicalOrHistoricalInformation.join(", ")}`);const i=[];return t.dateOfBirth&&t.dateOfBirth.length>0&&i.push(t.dateOfBirth[0]),t.dateOfDeath&&t.dateOfDeath.length>0&&(i.push(" - "),i.push(t.dateOfDeath[0])),i.length>0?`${i.join("")}${e?"; "+e:""}`:e}class Hl extends Cl{query(t){const e=[];let i;switch(this._register){case"place":i="PlaceOrGeographicName";break;case"term":i="SubjectHeading";break;case"organization":i="CorporateBody";break;default:i="Person"}return new Promise(n=>{fetch(`https://lobid.org/gnd/search?q=${encodeURIComponent(t)}&filter=%2B%28type%3A${i}%29&format=json&size=100`).then(t=>t.json()).then(t=>{t.member.forEach(t=>{const i={register:this._register,id:this._prefix?`${this._prefix}-${t.gndIdentifier}`:t.gndIdentifier,label:t.preferredName,link:t.id,details:$l(t),strings:[t.preferredName].concat(t.variantName),provider:"GND"};e.push(i)}),n({totalItems:t.totalItems,items:e})})})}async getRecord(t){const e=this._prefix?t.substring(this._prefix.length+1):t;return fetch(`https://lobid.org/gnd/${e}.json`).then(t=>t.ok?t.json():Promise.reject()).then(t=>{const e=Object.assign({},t);return e.name=t.preferredName,e.link=t.id,t.dateOfBirth&&t.dateOfBirth.length>0&&(e.birth=t.dateOfBirth[0]),t.dateOfDeath&&t.dateOfDeath.length>0&&(e.death=t.dateOfDeath[0]),t.biographicalOrHistoricalInformation&&(e.note=t.biographicalOrHistoricalInformation.join("; ")),t.professionOrOccupation&&t.professionOrOccupation.length>0&&(e.profession=t.professionOrOccupation.map(t=>t.label)),e}).catch(()=>Promise.reject())}info(t,e){return t?new Promise((i,n)=>{this.getRecord(t).then(t=>{let n;t.type.indexOf("SubjectHeading")>-1?n=this.infoSubject(t):t.type.indexOf("AuthorityResource")>-1&&(n=this.infoPerson(t));const r=`\n <h3 class="label">\n <a href="https://${t.id}" target="_blank"> ${t.preferredName} </a>\n </h3>\n ${n}\n `;e.innerHTML=r,i({id:this._prefix?`${this._prefix}-${t.gndIdentifier}`:t.gndIdentifier,strings:[t.preferredName].concat(t.variantName)})}).catch(()=>n())}):Promise.resolve()}infoPerson(t){const e=t.professionOrOccuption?t.professionOrOccupation.map(t=>t.label):[];return`<p>${t.dateOfBirth} - ${t.dateOfDeath}</p>\n <p>${e.join(" ")}</p>`}infoSubject(t){if(t.broaderTermGeneral){return`<p>${t.broaderTermGeneral.map(t=>t.label).join(", ")}</p>`}return""}}class Il extends Cl{constructor(t){super(t),this._api=t.getAttribute("api"),this._limit=t.getAttribute("limit")||999999}async query(t){const e=[],i=this.getRegister(),n=`https://meta.karl-barth.ch/api/${i}?${"bibls"===i?"biblsearch":"search"}=${encodeURIComponent(t)}&perPage=${this._limit}`,r=this.getLabelField();return new Promise(t=>{fetch(n).then(t=>t.json()).then(n=>{n.data.forEach(t=>{if("organization"===this._register&&"organisation"!==t.authority_type||"person"===this._register&&"person"!==t.authority_type)return;const n={register:this._register,id:this._prefix?`${this._prefix}:${t["full-id"]}`:t["full-id"],label:"string"==typeof r?t[r]:r(t),details:""+t["full-id"],link:`https://meta.karl-barth.ch/${i}/${t.id}`,strings:["string"==typeof r?t[r]:r(t)],provider:"KBGA"};e.push(n)}),t({totalItems:n.meta.total,items:e})})})}info(t,e){if(!t)return Promise.resolve({});const i=this.getLabelField();return new Promise(n=>{this.getRecord(t).then(t=>{const r=t.data.death?"† "+t.data.death:"",o=t.data.birth?`<p>* ${t.data.birth} ${r}</p>`:"",s=t.data.note_bio?`<p>${t.data.note_bio}</p>`:"",a=`\n <h3 class="label"><a href="https://${t.wikipediaURL}" target="_blank">${"string"==typeof i?t.data[i]:i(t.data)}</a></h3>\n ${o}\n ${s}\n `;e.innerHTML=a,n({id:t.data["full-id"],strings:["string"==typeof i?t.data[i]:i(t.data)]})})})}async getRecord(t){const e=t.replace(/^.*-([^-]+)$/,"$1");return fetch(`https://meta.karl-barth.ch/api/${this.getRegister()}/${e}`).then(t=>t.json()).then(t=>{const e=Object.assign({},t);switch(e.name=t.data[this.getLabelField()],this._register){case"place":e.country=t.data.country,e.location=t.data.location.coordinates,e.links=t.data.links.map(t=>t.url);break;case"person":e.birth=t.data.birth,e.death=t.data.death,e.note=t.data.note_bio,e.links=["https://"+t.wikipediaURL]}return e}).catch(t=>Promise.reject(t))}getLabelField(){let t;switch(this._register){case"place":t="placeName_full";break;case"term":t="fullLabel";break;case"abbreviation":t="label";break;case"bibl":case"songs":t="asHtml";break;default:t="persName_full"}return t}getRegister(){if(this._api)return this._api;let t;switch(this._register){case"person":case"organization":t="actors";break;case"place":t="places";break;case"term":t="terms";break;case"abbreviation":t="abbreviations";break;case"bibl":t="bibls";break;default:t=this._register}return t}}class Rl extends Cl{constructor(t){super(t),this._url=t.getAttribute("url")||"https://archives.georgfischer.com/api",this._api=t.getAttribute("api"),this._limit=t.getAttribute("limit")||999999,this._provider=t.getAttribute("provider")||t.getAttribute("connector")}async query(t){const e=[],i=this.getRegister(),n=`${this._url}/${i}?search=${encodeURIComponent(t)}&perPage=${this._limit}`,r=this.getLabelField();return new Promise(t=>{fetch(n).then(t=>t.json()).then(n=>{n.data?(n.data.forEach(t=>{if("organization"===this._register&&"Person"===t.authority_type||"person"===this._register&&"Person"!==t.authority_type)return;const n={register:this._register,id:this._prefix?`${this._prefix}-${t.id}`:t.id,label:t[r],details:""+t.id,link:`${this._url}/${i}/${t.id}`,strings:[t[r]],provider:this._provider};e.push(n)}),t({totalItems:n.meta.total,items:e})):t({totalItems:0,items:[]})}).catch(t=>Promise.reject(t))})}info(t,e){if(!t)return Promise.resolve({});const i=this._prefix?t.substring(this._prefix.length+1):t,n=this.getLabelField();return new Promise(t=>{this.getRecord(i).then(i=>{const r=i.data.death?"† "+i.data.death:"",o=i.data.birth?`<p>* ${i.data.birth} ${r}</p>`:"",s=i.data.note_bio?`<p>${i.data.note_bio}</p>`:"",a=`\n <h3 class="label"><a href="https://${i.wikipediaURL}" target="_blank">${i.data[n]}</a></h3>\n ${o}\n ${s}\n `;e.innerHTML=a,t({id:this._prefix?`${this._prefix}-${i.data.id}`:i.data.id,strings:[i.data[n]]})})})}async getRecord(t){const e=t.replace(/^.*-([^-]+)$/,"$1"),i=`${this._url}/${this.getRegister()}/${e}`;return fetch(i).then(t=>t.json()).then(t=>{const e=Object.assign({},t);switch(e.name=t.data[this.getLabelField()],this._register){case"place":e.country=t.data.country,e.location=t.data.location.coordinates,e.links=t.data.links.map(t=>t.url);break;case"person":e.birth=t.data.birth,e.death=t.data.death,e.note=t.data.note_bio,e.links=["https://"+t.wikipediaURL]}return e}).catch(t=>Promise.reject(t))}getLabelField(){let t;switch(this._register){case"term":t="label";break;default:t="fullname"}return t}getRegister(){if(this._api)return this._api;let t;switch(this._register){case"person":case"organization":t="actors";break;case"origPlace":case"place":t="places";break;case"term":t="keywords";break;case"abbreviation":t="abbreviations";break;default:t=this._register}return t}}async function Pl(t){const e=await fetch(t);return await e.json()}class Vl extends Cl{constructor(t){super(t),this.endpoint=t.getAttribute("endpoint"),this.debug=t.getAttribute("debug"),Pl(this.endpoint).then(t=>{this.ORConfig=t,this.debug&&console.log("OpenReconcile connector for register '%s' at endpoint <%s>. Using config: %o",this._register,this.endpoint,this.ORConfig)})}async query(t){const e=[],i={q1:{query:t}};return new Promise(t=>{fetch(this.endpoint,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"},body:"queries=".concat(JSON.stringify(i))}).then(t=>t.json()).then(i=>{i.q1.result.forEach(t=>{this.ORConfig.view?this.view=this.ORConfig.view.url.replace("{{id}}",t.id):this.view=t.id,t.description?this.description=t.description:t.type?this.description=t.type.map(t=>t.name.toString()).join(", "):this.description="";const i={register:this._register,id:this._prefix?`${this._prefix}-${t.id}`:t.id,label:t.name,link:this.view,details:this.description,provider:"OpenReconcile"};e.push(i)}),this.debug&&console.log("OpenReconcile results: %o",e),t({totalItems:i.q1.result.length,items:e})})})}info(t,e){return t?this.ORConfig.preview?new Promise((i,n)=>{const r=this._prefix?t.substring(this._prefix.length+1):t,o=this.ORConfig.preview.url.replace("{{id}}",encodeURIComponent(r));fetch(o).then(t=>t.text()).then(t=>{e.innerHTML=t,i({id:this._prefix?`${this._prefix}-${r}`:r})}).catch(()=>n())}):(e.innerHTML="no 'preview' information in endpoint's manifest",Promise.resolve()):Promise.resolve({})}}class Nl extends Cl{constructor(t,e){super(e),this._editable=e.hasAttribute("edit"),this._endpoint=t,this._connectors=Dl(t,e),this._connectors.forEach(t=>{t.name=this.name}),console.log("custom connector: endpoint: %s; using authorities: %o",this._endpoint,this._connectors)}get editable(){return this._editable}async query(t){return new Promise(e=>{fetch(`${this._endpoint}/api/register/search/${this._register}?query=${encodeURIComponent(t)}`).then(t=>t.json()).then(async i=>{let n=[];const r=new Set;i.forEach(t=>{n.push({register:this._register,id:t.id,label:t.label,link:t.link,details:t.details,provider:"local"}),r.add(t.id)});let o=i.length;for(const e of this._connectors){const i=await e.query(t);n=n.concat(i.items.filter(t=>!r.has(t.id))),o+=i.totalItems}e({totalItems:o,items:n})})})}info(t,e){if(!t)return Promise.resolve({});const i=t;return new Promise((n,r)=>{fetch(`${this._endpoint}/api/register/${this._register}/${encodeURIComponent(i)}`).then(async i=>{if(i.ok){const t=await i.json();return e.innerHTML=t.details,void n({id:t.id,strings:t.strings})}if(404===i.status)for(const i of this._connectors)try{const r=await i.info(t,e);r&&n(r)}catch(t){}r()})})}async select(t){let e;for(const i of this._connectors)if(e=await i.getRecord(t.id).catch(()=>null),e)break;return e?fetch(`${this._endpoint}/api/register/${this._register}/${encodeURIComponent(t.id)}`,{method:"POST",mode:"cors",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(t=>t.ok?t.json():Promise.reject(Error(t.status.toString()))):Promise.resolve(t)}}function Dl(t,e){const i=[];return e.querySelectorAll(":scope > pb-authority").forEach(e=>{let n;switch(e.getAttribute("connector")){case"GND":n=new Hl(e);break;case"GeoNames":n=new Tl(e);break;case"Airtable":n=new Ol(e);break;case"KBGA":n=new Il(e);break;case"Anton":case"GF":n=new Rl(e);break;case"ReconciliationService":n=new Vl(e);break;case"Custom":n=new Nl(t,e);break;default:n=new El(e)}i.push(n)}),i}class Fl extends(D(V)){static get properties(){return Object.assign({query:{type:String,reflect:!0},sortByLabel:{type:Boolean,attribute:"sort-by-label"},stopwords:{type:String},_results:{type:Array}},super.properties)}constructor(){super(),this.query="",this.type=null,this.sortByLabel=!1,this._results=[],this._authorities={}}connectedCallback(){super.connectedCallback(),this._stopwordSet=new Set,this.stopwords&&this.stopwords.split(/\s*,\s*/).forEach(t=>this._stopwordSet.add(t.toLowerCase())),this.subscribeTo("pb-authority-lookup",t=>{this.query=t.detail.query,this.type=t.detail.type,this._results=[],this._query()}),B("pb-page-ready",()=>{Dl(this.getEndpoint(),this).forEach(t=>{this._authorities[t.register]=t})}),console.log("<pb-authority-lookup> Registered authorities: %o",this._authorities)}render(){return I`
|
|
3952
|
+
`}}customElements.define("pb-clipboard",zl);class Cl{constructor(t){this._prefix=t.getAttribute("prefix"),this._config={name:t.getAttribute("name"),properties:{}},this._register=this._config.name}get register(){return this._register}get name(){return this._register}set name(t){this._register=t}get editable(){return!1}query(t){throw new Error("Method query not implemented")}info(t,e){return e.innerHTML="not implemented",Promise.resolve()}async select(t){return Promise.resolve(t)}async getRecord(t){return Promise.reject()}}class El extends Cl{async query(t){const e=t.replace(/[^\w\s]+/g,""),i=[],n="https://api.metagrid.ch/search?query="+encodeURIComponent(e);return new Promise(t=>{fetch(n).then(t=>t.json()).then(e=>{e.resources.forEach(t=>{const e=`${t.metadata.last_name}, ${t.metadata.first_name} `,n={register:this._register,id:`${t.provider.slug}-${t.identifier}`,label:e,details:`${t.metadata.birth_date} - ${t.metadata.death_date}`,link:t.link.uri,provider:t.provider.slug};i.push(n)}),t({totalItems:e.meta.total,items:i})})})}info(t,e){const i=t.indexOf("-"),n=t.substring(0,i);return new Promise(i=>{this.getRecord(t).then(t=>{const r=`\n <h3 class="label">\n <a href="https://${t.link.uri}" target="_blank">\n ${t.metadata.last_name}, ${t.metadata.first_name}\n </a>\n </h3>\n <p>${t.metadata.birth_date} - ${t.metadata.death_date}</p>\n `;e.innerHTML=r,i({id:`${n}-${t.identifier}`,strings:[`${t.metadata.first_name} ${t.metadata.last_name}`]})})})}async getRecord(t){const e=t.indexOf("-"),i=t.substring(0,e),n=t.substring(e+1);return fetch(`https://api.metagrid.ch/search?slug=${i}&query=${n}`).then(t=>t.json()).then(t=>{const e=t.resources[0],i=Object.assign({},e);return i.name=`${e.metadata.first_name} ${e.metadata.last_name}`,i.links=["https://"+e.link.uri],e.metadata.birth_date&&e.metadata.birth_date.length>0&&(i.birth=e.metadata.birth_date),e.metadata.death_date&&e.metadata.death_date.length>0&&(i.death=e.metadata.death_date),i}).catch(t=>Promise.reject(t))}}class Tl extends Cl{constructor(t){super(t),this.user=t.getAttribute("user")}async query(t){const e=[];return new Promise(i=>{fetch(`https://secure.geonames.org/searchJSON?formatted=true&q=${encodeURIComponent(t)}&maxRows=100&&username=${this.user}&style=full`).then(t=>t.json()).then(t=>{t.geonames.forEach(t=>{const i={register:this._register,id:this._prefix?`${this._prefix}-${t.geonameId}`:t.geonameId,label:t.toponymName,details:`${t.fcodeName} - ${t.adminName1}, ${t.countryName}`,link:"https://www.geonames.org/"+t.geonameId,strings:[t.toponymName],provider:"geonames.org"};e.push(i)}),i({totalItems:t.totalResultsCount,items:e})})})}info(t,e){return t?new Promise((i,n)=>{this.getRecord(t).then(t=>{if(t.status)return void n(t.status.message);const r=`\n <h3 class="label">\n <a href="${t.link}" target="_blank">${t.name}</a>\n </h3>\n <p class="fcode">${t.note} - ${t.region}, ${t.country}</p>\n `;e.innerHTML=r,i({id:this._prefix?`${this._prefix}-${t.geonameId}`:t.geonameId,strings:[t.name]})}).catch(()=>n())}):Promise.resolve({})}async getRecord(t){const e=this._prefix?t.substring(this._prefix.length+1):t;return fetch(`https://secure.geonames.org/getJSON?geonameId=${encodeURIComponent(e)}&username=${this.user}`).then(t=>t.ok?t.json():Promise.reject(t.status)).then(t=>{const e=Object.assign({},t);return e.name=t.toponymName,e.country=t.countryName,e.region=t.adminName1,e.note=t.fcodeName,e.links=["https://www.geonames.org/"+t.geonameId,"https://"+t.wikipediaURL],e}).catch(()=>Promise.reject())}}function Ll(t="",e){return t.replace(/\${([^}]+)}/g,(t,i)=>{let n;return e[i]&&(n=e[i]),n||""})}function Ml(t,e){const i=t.querySelector(e);if(i instanceof HTMLTemplateElement){const t=document.createElement("div");return t.appendChild(i.content.cloneNode(!0)),t.innerHTML}return""}class Ol extends Cl{constructor(t){super(t),this.apiKey=t.getAttribute("api-key"),this.baseKey=t.getAttribute("base"),this.table=t.getAttribute("table"),this.view=t.getAttribute("view"),this.filterExpr=t.getAttribute("filter"),this.labelExpr=t.getAttribute("label");const e=t.getAttribute("fields");this.fields=e?e.split(/\s*,\s*/):["ID"];const i=t.getAttribute("tokenize");this.tokenize=i?i.split(/\s*,\s*/):[this.fields[0]],this.tokenizeChars=t.getAttribute("tokenize-regex")||"\\W",this.infoExpr=Ml(t,".info"),this.detailExpr=Ml(t,".detail"),this._init()}_init(){window.ESGlobalBridge.requestAvailability();const t=P("../lib/airtable.browser.js");window.ESGlobalBridge.instance.load("airtable",t),window.addEventListener("es-bridge-airtable-loaded",this._initAirtable.bind(this),{once:!0})}_initAirtable(){const t=require("airtable");this.base=new t({apiKey:this.apiKey}).base(this.baseKey)}async query(t){t=t.toLowerCase();const e=[],i=this.filterExpr?Ll(this.filterExpr,{key:t}):null,n={fields:this.fields,maxRecords:100};return this.view&&(n.view=this.view),i&&(n.filterByFormula=i),new Promise((t,i)=>{this.base(this.table).select(n).firstPage((n,r)=>{if(n)return console.error(n),void i(n);r.forEach(t=>{const i={};this.fields.forEach(e=>{i[e]=t.get(e)});const n={register:this._register,id:t.id,label:Ll(this.labelExpr,i),details:Ll(this.detailExpr,i),provider:"airtable"};e.push(n)}),t({totalItems:3,items:e})})})}info(t,e){return new Promise((i,n)=>{this.base(this.table).find(t,(r,o)=>{if(r){switch(r.statusCode){case 404:n(`No record found for ${t} in table ${this.table}`);break;default:n(`${r.statusCode}: ${r.message}`)}return}if(0===Object.keys(o.fields).length)return void n(`No record found for ${t} in table ${this.table}`);let s=[];const a={};this.fields.forEach(t=>{const e=o.get(t);e&&(a[t]=e,s.push(e))});const l=new RegExp(this.tokenizeChars);this.tokenize.forEach(t=>{a[t]&&(s=s.concat(a[t].split(l)))}),s=s.filter(t=>!/^\d+$/.test(t)),s.sort((t,e)=>e.length-t.length),e.innerHTML=Ll(this.infoExpr,a),i({id:o.id,strings:s})})})}}function $l(t){let e="";t.professionOrOccupation&&t.professionOrOccupation.length>0&&(e=t.professionOrOccupation.map(t=>t.label).join(", ")),t.biographicalOrHistoricalInformation&&(e=`${e}; ${t.biographicalOrHistoricalInformation.join(", ")}`);const i=[];return t.dateOfBirth&&t.dateOfBirth.length>0&&i.push(t.dateOfBirth[0]),t.dateOfDeath&&t.dateOfDeath.length>0&&(i.push(" - "),i.push(t.dateOfDeath[0])),i.length>0?`${i.join("")}${e?"; "+e:""}`:e}class Hl extends Cl{query(t){const e=[];let i;switch(this._register){case"place":i="PlaceOrGeographicName";break;case"term":i="SubjectHeading";break;case"organization":i="CorporateBody";break;default:i="Person"}return new Promise(n=>{fetch(`https://lobid.org/gnd/search?q=${encodeURIComponent(t)}&filter=%2B%28type%3A${i}%29&format=json&size=100`).then(t=>t.json()).then(t=>{t.member.forEach(t=>{const i={register:this._register,id:this._prefix?`${this._prefix}-${t.gndIdentifier}`:t.gndIdentifier,label:t.preferredName,link:t.id,details:$l(t),strings:[t.preferredName].concat(t.variantName),provider:"GND"};e.push(i)}),n({totalItems:t.totalItems,items:e})})})}async getRecord(t){const e=this._prefix?t.substring(this._prefix.length+1):t;return fetch(`https://lobid.org/gnd/${e}.json`).then(t=>t.ok?t.json():Promise.reject()).then(t=>{const e=Object.assign({},t);return e.name=t.preferredName,e.link=t.id,t.dateOfBirth&&t.dateOfBirth.length>0&&(e.birth=t.dateOfBirth[0]),t.dateOfDeath&&t.dateOfDeath.length>0&&(e.death=t.dateOfDeath[0]),t.biographicalOrHistoricalInformation&&(e.note=t.biographicalOrHistoricalInformation.join("; ")),t.professionOrOccupation&&t.professionOrOccupation.length>0&&(e.profession=t.professionOrOccupation.map(t=>t.label)),e}).catch(()=>Promise.reject())}info(t,e){return t?new Promise((i,n)=>{this.getRecord(t).then(t=>{let n;t.type.indexOf("SubjectHeading")>-1?n=this.infoSubject(t):t.type.indexOf("AuthorityResource")>-1&&(n=this.infoPerson(t));const r=`\n <h3 class="label">\n <a href="https://${t.id}" target="_blank"> ${t.preferredName} </a>\n </h3>\n ${n}\n `;e.innerHTML=r,i({id:this._prefix?`${this._prefix}-${t.gndIdentifier}`:t.gndIdentifier,strings:[t.preferredName].concat(t.variantName)})}).catch(()=>n())}):Promise.resolve()}infoPerson(t){const e=t.professionOrOccuption?t.professionOrOccupation.map(t=>t.label):[];return`<p>${t.dateOfBirth} - ${t.dateOfDeath}</p>\n <p>${e.join(" ")}</p>`}infoSubject(t){if(t.broaderTermGeneral){return`<p>${t.broaderTermGeneral.map(t=>t.label).join(", ")}</p>`}return""}}class Il extends Cl{constructor(t){super(t),this._api=t.getAttribute("api"),this._limit=t.getAttribute("limit")||999999}async query(t){const e=[],i=this.getRegister(),n=`https://meta.karl-barth.ch/api/${i}?${"bibls"===i?"biblsearch":"search"}=${encodeURIComponent(t)}&perPage=${this._limit}`,r=this.getLabelField();return new Promise(t=>{fetch(n).then(t=>t.json()).then(n=>{n.data.forEach(t=>{if("organization"===this._register&&"organisation"!==t.authority_type||"person"===this._register&&"person"!==t.authority_type)return;const n={register:this._register,id:this._prefix?`${this._prefix}:${t["full-id"]}`:t["full-id"],label:"string"==typeof r?t[r]:r(t),details:""+t["full-id"],link:`https://meta.karl-barth.ch/${i}/${t.id}`,strings:["string"==typeof r?t[r]:r(t)],provider:"KBGA"};e.push(n)}),t({totalItems:n.meta.total,items:e})})})}info(t,e){if(!t)return Promise.resolve({});const i=this.getLabelField();return new Promise(n=>{this.getRecord(t).then(t=>{const r=t.data.death?"† "+t.data.death:"",o=t.data.birth?`<p>* ${t.data.birth} ${r}</p>`:"",s=t.data.note_bio?`<p>${t.data.note_bio}</p>`:"",a=`\n <h3 class="label"><a href="https://${t.wikipediaURL}" target="_blank">${"string"==typeof i?t.data[i]:i(t.data)}</a></h3>\n ${o}\n ${s}\n `;e.innerHTML=a,n({id:t.data["full-id"],strings:["string"==typeof i?t.data[i]:i(t.data)]})})})}async getRecord(t){const e=t.replace(/^.*-([^-]+)$/,"$1");return fetch(`https://meta.karl-barth.ch/api/${this.getRegister()}/${e}`).then(t=>t.json()).then(t=>{const e=Object.assign({},t);switch(e.name=t.data[this.getLabelField()],this._register){case"place":e.country=t.data.country,e.location=t.data.location.coordinates,e.links=t.data.links.map(t=>t.url);break;case"person":e.birth=t.data.birth,e.death=t.data.death,e.note=t.data.note_bio,e.links=["https://"+t.wikipediaURL]}return e}).catch(t=>Promise.reject(t))}getLabelField(){let t;switch(this._register){case"place":t="placeName_full";break;case"term":t="fullLabel";break;case"abbreviation":t="label";break;case"bibl":case"songs":t="asHtml";break;default:t="persName_full"}return t}getRegister(){if(this._api)return this._api;let t;switch(this._register){case"person":case"organization":t="actors";break;case"place":t="places";break;case"term":t="terms";break;case"abbreviation":t="abbreviations";break;case"bibl":t="bibls";break;default:t=this._register}return t}}class Rl extends Cl{constructor(t){super(t),this._url=t.getAttribute("url")||"https://archives.georgfischer.com/api",this._api=t.getAttribute("api"),this._limit=t.getAttribute("limit")||999999,this._provider=t.getAttribute("provider")||t.getAttribute("connector")}async query(t){const e=[],i=this.getRegister(),n=`${this._url}/${i}?search=${encodeURIComponent(t)}&perPage=${this._limit}`,r=this.getLabelField();return new Promise(t=>{fetch(n).then(t=>t.json()).then(n=>{n.data?(n.data.forEach(t=>{if("organization"===this._register&&"Person"===t.authority_type||"person"===this._register&&"Person"!==t.authority_type)return;const n={register:this._register,id:this._prefix?`${this._prefix}-${t.id}`:t.id,label:t[r],details:""+t.id,link:`${this._url}/${i}/${t.id}`,strings:[t[r]],provider:this._provider};e.push(n)}),t({totalItems:n.meta.total,items:e})):t({totalItems:0,items:[]})}).catch(t=>Promise.reject(t))})}info(t,e){if(!t)return Promise.resolve({});const i=this._prefix?t.substring(this._prefix.length+1):t,n=this.getLabelField();return new Promise(t=>{this.getRecord(i).then(i=>{const r=i.data.death?"† "+i.data.death:"",o=i.data.birth?`<p>* ${i.data.birth} ${r}</p>`:"",s=i.data.note_bio?`<p>${i.data.note_bio}</p>`:"",a=`\n <h3 class="label"><a href="https://${i.wikipediaURL}" target="_blank">${i.data[n]}</a></h3>\n ${o}\n ${s}\n `;e.innerHTML=a,t({id:this._prefix?`${this._prefix}-${i.data.id}`:i.data.id,strings:[i.data[n]]})})})}async getRecord(t){const e=t.replace(/^.*-([^-]+)$/,"$1"),i=`${this._url}/${this.getRegister()}/${e}`;return fetch(i).then(t=>t.json()).then(t=>{const e=Object.assign({},t);switch(e.name=t.data[this.getLabelField()],this._register){case"place":e.country=t.data.country,e.location=t.data.location.coordinates,e.links=t.data.links.map(t=>t.url);break;case"person":e.birth=t.data.birth,e.death=t.data.death,e.note=t.data.note_bio,e.links=["https://"+t.wikipediaURL]}return e}).catch(t=>Promise.reject(t))}getLabelField(){let t;switch(this._register){case"term":t="label";break;default:t="fullname"}return t}getRegister(){if(this._api)return this._api;let t;switch(this._register){case"person":case"organization":t="actors";break;case"origPlace":case"place":t="places";break;case"term":t="keywords";break;case"abbreviation":t="abbreviations";break;default:t=this._register}return t}}async function Pl(t){const e=await fetch(t);return await e.json()}class Vl extends Cl{constructor(t){super(t),this.endpoint=t.getAttribute("endpoint"),this.debug=t.getAttribute("debug"),Pl(this.endpoint).then(t=>{this.ORConfig=t,this.debug&&console.log("OpenReconcile connector for register '%s' at endpoint <%s>. Using config: %o",this._register,this.endpoint,this.ORConfig)})}async query(t){const e=[],i={q1:{query:t}};return new Promise(t=>{fetch(this.endpoint,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"},body:"queries=".concat(JSON.stringify(i))}).then(t=>t.json()).then(i=>{i.q1.result.forEach(t=>{this.ORConfig.view?this.view=this.ORConfig.view.url.replace("{{id}}",t.id):this.view=t.id,t.description?this.description=t.description:t.type?this.description=t.type.map(t=>t.name.toString()).join(", "):this.description="";const i={register:this._register,id:this._prefix?`${this._prefix}-${t.id}`:t.id,label:t.name,link:this.view,details:this.description,provider:"OpenReconcile"};e.push(i)}),this.debug&&console.log("OpenReconcile results: %o",e),t({totalItems:i.q1.result.length,items:e})})})}info(t,e){return t?this.ORConfig.preview?new Promise((i,n)=>{const r=this._prefix?t.substring(this._prefix.length+1):t,o=this.ORConfig.preview.url.replace("{{id}}",encodeURIComponent(r));fetch(o).then(t=>t.text()).then(t=>{e.innerHTML=t,i({id:this._prefix?`${this._prefix}-${r}`:r})}).catch(()=>n())}):(e.innerHTML="no 'preview' information in endpoint's manifest",Promise.resolve()):Promise.resolve({})}}class Nl extends Cl{constructor(t,e){super(e),this._editable=e.hasAttribute("edit"),this._endpoint=t,this._connectors=Dl(t,e),this._connectors.forEach(t=>{t.name=this.name}),console.log("custom connector: endpoint: %s; using authorities: %o",this._endpoint,this._connectors)}get editable(){return this._editable}async query(t){return new Promise(e=>{fetch(`${this._endpoint}/api/register/search/${this._register}?query=${encodeURIComponent(t)}`).then(t=>t.json()).then(async i=>{let n=[];const r=new Set;i.forEach(t=>{n.push({register:this._register,id:t.id,label:t.label,link:t.link,details:t.details,provider:"local"}),r.add(t.id)});let o=i.length;for(const e of this._connectors){const i=await e.query(t);n=n.concat(i.items.filter(t=>!r.has(t.id))),o+=i.totalItems}e({totalItems:o,items:n})})})}info(t,e){if(!t)return Promise.resolve({});const i=t;return new Promise((n,r)=>{fetch(`${this._endpoint}/api/register/${this._register}/${encodeURIComponent(i)}`).then(async i=>{if(i.ok){const t=await i.json();return e.innerHTML=t.details,void n({id:t.id,strings:t.strings,editable:this._editable})}if(404===i.status)for(const i of this._connectors)try{const r=await i.info(t,e);r&&n(r)}catch(t){}r()})})}async select(t){let e;for(const i of this._connectors)if(e=await i.getRecord(t.id).catch(()=>null),e)break;return e?fetch(`${this._endpoint}/api/register/${this._register}/${encodeURIComponent(t.id)}`,{method:"POST",mode:"cors",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(t=>t.ok?t.json():Promise.reject(Error(t.status.toString()))):Promise.resolve(t)}}function Dl(t,e){const i=[];return e.querySelectorAll(":scope > pb-authority").forEach(e=>{let n;switch(e.getAttribute("connector")){case"GND":n=new Hl(e);break;case"GeoNames":n=new Tl(e);break;case"Airtable":n=new Ol(e);break;case"KBGA":n=new Il(e);break;case"Anton":case"GF":n=new Rl(e);break;case"ReconciliationService":n=new Vl(e);break;case"Custom":n=new Nl(t,e);break;default:n=new El(e)}i.push(n)}),i}class Fl extends(D(V)){static get properties(){return Object.assign({query:{type:String,reflect:!0},sortByLabel:{type:Boolean,attribute:"sort-by-label"},stopwords:{type:String},_results:{type:Array}},super.properties)}constructor(){super(),this.query="",this.type=null,this.sortByLabel=!1,this._results=[],this._authorities={}}connectedCallback(){super.connectedCallback(),this._stopwordSet=new Set,this.stopwords&&this.stopwords.split(/\s*,\s*/).forEach(t=>this._stopwordSet.add(t.toLowerCase())),this.subscribeTo("pb-authority-lookup",t=>{this.query=t.detail.query,this.type=t.detail.type,this._results=[],this._query()}),B("pb-page-ready",()=>{Dl(this.getEndpoint(),this).forEach(t=>{this._authorities[t.register]=t})}),console.log("<pb-authority-lookup> Registered authorities: %o",this._authorities)}render(){return I`
|
|
3953
3953
|
<paper-input
|
|
3954
3954
|
id="query"
|
|
3955
3955
|
label="${W("annotations.lookup")}"
|
|
@@ -3958,7 +3958,7 @@ const Al=e({is:"iron-label",listeners:{tap:"_tapHandler"},properties:{for:{type:
|
|
|
3958
3958
|
@change="${this._queryChanged}"
|
|
3959
3959
|
>
|
|
3960
3960
|
<iron-icon icon="icons:search" slot="prefix"></iron-icon>
|
|
3961
|
-
${this._authorities[this.type].editable?I`<paper-icon-button icon="icons:add" @click="${this._addEntity}" slot="suffix"></paper-icon-button>`:null}
|
|
3961
|
+
${this._authorities[this.type]&&this._authorities[this.type].editable?I`<paper-icon-button icon="icons:add" @click="${this._addEntity}" title="${W("annotations.add-entity")}" slot="suffix"></paper-icon-button>`:null}
|
|
3962
3962
|
</paper-input>
|
|
3963
3963
|
<slot name="authform"></slot>
|
|
3964
3964
|
<div id="output">
|
|
@@ -3982,10 +3982,11 @@ const Al=e({is:"iron-label",listeners:{tap:"_tapHandler"},properties:{for:{type:
|
|
|
3982
3982
|
${t.provider?I`<div><span class="source" part="source">${t.provider}</span></div>`:null}
|
|
3983
3983
|
<div><span class="register" part="register">${t.register}</span></div>
|
|
3984
3984
|
|
|
3985
|
-
${this._authorities[this.type].editable?I`<div class="icons">
|
|
3985
|
+
${this._authorities[this.type]&&this._authorities[this.type].editable?I`<div class="icons">
|
|
3986
3986
|
<paper-icon-button
|
|
3987
3987
|
icon="editor:mode-edit"
|
|
3988
3988
|
@click="${()=>this._editEntity(t)}"
|
|
3989
|
+
title="${W("annotations.edit-entity")}"
|
|
3989
3990
|
></paper-icon-button>
|
|
3990
3991
|
</div>`:null}
|
|
3991
3992
|
${t.details?I`<div class="details" part="details">${t.details}</div>`:null}
|
package/i18n/common/de.json
CHANGED
|
@@ -46,7 +46,10 @@
|
|
|
46
46
|
},
|
|
47
47
|
"browse": {
|
|
48
48
|
"description": "Diese Anwendung dient vorrangig zum Experimentieren mit verschiedenen Dokumenten und deren Transformationen über das TEI Processing Model. Es können eigene Dateien hochgeladen und neue ODDs erstellt werden.",
|
|
49
|
-
"login": "zum Hochladen eigener Dateien oder Zugriff auf administrative Funktionen (Standardnutzer: 'tei
|
|
49
|
+
"login": "zum Hochladen eigener Dateien oder Zugriff auf administrative Funktionen (Standardnutzer: 'tei', Passwort: 'simple').",
|
|
50
|
+
"login-1": "Anmelden als ",
|
|
51
|
+
"login-2": "mit Passwort",
|
|
52
|
+
"login-3": "um mit eigenen Dateien und ODDs zu experimentieren",
|
|
50
53
|
"sort": "Sortiere nach",
|
|
51
54
|
"filter": "Filtere nach",
|
|
52
55
|
"filterPlaceholder": "Filter",
|
|
@@ -60,6 +63,9 @@
|
|
|
60
63
|
"confirmDeletion": "Möchten Sie die Datei wirklich löschen?",
|
|
61
64
|
"confirmDeletion_plural": "Möchten Sie wirklich {{count}} Dateien löschen?",
|
|
62
65
|
"documents": "Dokumente",
|
|
66
|
+
"documents-removed": "Dokumente gelöscht",
|
|
67
|
+
"document-not-found": "Dokument nicht gefunden",
|
|
68
|
+
"document-remove-failed": "Löschen des Dokuments fehlgeschlagen",
|
|
63
69
|
"collections": "Lokale Sammlung",
|
|
64
70
|
"dts": "Distributed Text Services (experimentell)",
|
|
65
71
|
"test": {
|
|
@@ -78,6 +84,10 @@
|
|
|
78
84
|
"title": "Markdown-Beispiel",
|
|
79
85
|
"description": "Ein Beispiel zur Verwendung von Markdown für statische Inhalte."
|
|
80
86
|
},
|
|
87
|
+
"annotate": {
|
|
88
|
+
"title": "Annotierte Dokumente",
|
|
89
|
+
"description": "Beschreibbare Sammlung zum Annotieren von Dokumenten."
|
|
90
|
+
},
|
|
81
91
|
"up": "Übergeordnetes Verzeichnis"
|
|
82
92
|
},
|
|
83
93
|
"upload": {
|
|
@@ -111,11 +121,15 @@
|
|
|
111
121
|
"reset": "Zurücksetzen",
|
|
112
122
|
"placeholder": "Suche nach",
|
|
113
123
|
"sections": "Abschnitte durchsuchen",
|
|
114
|
-
"headings": "Überschriften durchsuchen"
|
|
124
|
+
"headings": "Überschriften durchsuchen",
|
|
125
|
+
"title": "Titel suchen",
|
|
126
|
+
"content": "Inhalte durchsuchen",
|
|
127
|
+
"scope": "Suchbereich"
|
|
115
128
|
},
|
|
116
129
|
"dts": {
|
|
117
130
|
"endpoint": "Server wählen",
|
|
118
|
-
"note": "Experimentell: Zugriff auf externe Editionen über DTS API"
|
|
131
|
+
"note": "Experimentell: Zugriff auf externe Editionen über DTS API",
|
|
132
|
+
"requires-login": "Anmeldung erforderlich"
|
|
119
133
|
},
|
|
120
134
|
"odd": {
|
|
121
135
|
"files": "ODD Dateien",
|
|
@@ -175,7 +189,10 @@
|
|
|
175
189
|
"facets": {
|
|
176
190
|
"show": "Zeige 50 häufigste",
|
|
177
191
|
"genre": "Genre",
|
|
178
|
-
"language": "Sprache"
|
|
192
|
+
"language": "Sprache",
|
|
193
|
+
"feature": "Feature",
|
|
194
|
+
"form": "Art der Quelle",
|
|
195
|
+
"period": "Zeitraum"
|
|
179
196
|
},
|
|
180
197
|
"appgen": {
|
|
181
198
|
"account": {
|
|
@@ -217,38 +234,38 @@
|
|
|
217
234
|
"success": "Deine App wurde erfolgreich generiert!"
|
|
218
235
|
},
|
|
219
236
|
"annotations": {
|
|
220
|
-
"abbreviation": "Abkürzung",
|
|
221
|
-
"delete": "Annotation löschen",
|
|
222
237
|
"edit": "Annotation ändern",
|
|
238
|
+
"delete": "Annotation löschen",
|
|
239
|
+
"save": "Änderungen ins TEI speichern",
|
|
223
240
|
"no-properties": "Keine Eigenschaften vorhanden.",
|
|
224
|
-
"occurrences": "Vorkommen im Text",
|
|
225
|
-
"organisation": "Organisation",
|
|
226
241
|
"person": "Person",
|
|
242
|
+
"organisation": "Organisation",
|
|
227
243
|
"place": "Ort",
|
|
228
|
-
"term": "
|
|
244
|
+
"term": "Begriff",
|
|
229
245
|
"date": "Datum",
|
|
230
|
-
"
|
|
246
|
+
"reg": "Regularisierung",
|
|
247
|
+
"app": "Apparatus",
|
|
248
|
+
"hi": "Hervorhebung",
|
|
249
|
+
"ref": "Link (ref)",
|
|
250
|
+
"abbreviation": "Abkürzung",
|
|
251
|
+
"occurrences": "Vorkommen im Text",
|
|
231
252
|
"correction": "Korrektur",
|
|
253
|
+
"expansion": "Auflösung",
|
|
232
254
|
"reference": "Referenz",
|
|
233
|
-
"
|
|
255
|
+
"lookup": "Entität suchen",
|
|
256
|
+
"apply": "Anwenden",
|
|
257
|
+
"apply-all": "Alle selektieren und anwenden",
|
|
234
258
|
"changes": "Änderungen",
|
|
235
|
-
"reg": "Regularisierung",
|
|
236
|
-
"hi": "Hervorhebung",
|
|
237
|
-
"app": "Apparatus",
|
|
238
|
-
"download": "Ergebnis als lokale Datei speichern",
|
|
239
|
-
"restore": "Es wurden Annotationen für dieses Dokument aus einer früheren Sitzung gefunden. Möchtest Du diese wiederherstellen?",
|
|
240
259
|
"undo": "Letzten Arbeitsschritt rückgängig machen",
|
|
241
|
-
"
|
|
260
|
+
"download": "Ergebnis als lokale Datei speichern",
|
|
261
|
+
"reload": "Quelle neu laden",
|
|
242
262
|
"preview": "Voransicht erneuern",
|
|
243
|
-
"
|
|
263
|
+
"confirm-restore-title": "Annotationen wiederherstellen",
|
|
264
|
+
"restore": "Es wurden Annotationen für dieses Dokument aus einer früheren Sitzung gefunden. Möchtest Du diese wiederherstellen?",
|
|
265
|
+
"confirm-reload-title": "Quelle neu laden",
|
|
244
266
|
"confirm-reload": "Annotationen verwerfen und Quelle neu laden?",
|
|
245
|
-
"confirm-reload-title": "Quelle neu laden?",
|
|
246
|
-
"confirm-restore-title": "Annotationen wiederherstellen?",
|
|
247
|
-
"ref": "Link (ref)",
|
|
248
|
-
"reload": "Quelle neu laden",
|
|
249
267
|
"modify": "Änderung am Text vornehmen",
|
|
250
268
|
"modify-info": "Achtung: dies ist keine Annotation. Die Änderung wird beim Merge auf den Transkriptionstext angewandt.",
|
|
251
|
-
"apply-all": "Alle selektieren und anwenden",
|
|
252
269
|
"permission": "Zugriff verweigert: keine Berechtigung zum Speichern von Annotationen.",
|
|
253
270
|
"ner": {
|
|
254
271
|
"title": "Automatische Entitätenerkennung",
|
|
@@ -256,7 +273,13 @@
|
|
|
256
273
|
"run": "Ausführen",
|
|
257
274
|
"model": "Wähle ein Modell",
|
|
258
275
|
"denied": "Ungespeicherte Änderungen gefunden: bitte zuerst speichern oder verwerfen."
|
|
259
|
-
}
|
|
276
|
+
},
|
|
277
|
+
"confirm-discard-title": "Verwerfen",
|
|
278
|
+
"confirm-discard": "Liste anderer Vorkommen verwerfen?",
|
|
279
|
+
"doc-count": "{{count}} von {{total}}",
|
|
280
|
+
"toggle": "Ein-/Ausblenden der Vorschau/Kontrollleiste",
|
|
281
|
+
"add-entity": "Entität hinzufügen",
|
|
282
|
+
"edit-entity": "Entität bearbeiten"
|
|
260
283
|
},
|
|
261
284
|
"ner": {
|
|
262
285
|
"title": "Trainiere ein Modell zur Entitätenerkennung",
|
package/i18n/common/en.json
CHANGED
|
@@ -276,7 +276,10 @@
|
|
|
276
276
|
},
|
|
277
277
|
"confirm-discard-title": "Discard",
|
|
278
278
|
"confirm-discard": "Discard the list of occurrences?",
|
|
279
|
-
"doc-count": "{{count}} von {{total}}"
|
|
279
|
+
"doc-count": "{{count}} von {{total}}",
|
|
280
|
+
"toggle": "Show/hide preview/control panel",
|
|
281
|
+
"add-entity": "Create entity",
|
|
282
|
+
"edit-entity": "Edit entity"
|
|
280
283
|
},
|
|
281
284
|
"ner": {
|
|
282
285
|
"title": "Train a Named Entity Recognition Model",
|
package/i18n/common/es.json
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"no": "No",
|
|
29
29
|
"serverError": "La solicitud al servidor ha fallado.",
|
|
30
30
|
"generatingFile": "Generando el archivo...",
|
|
31
|
-
"downloadMessage": "Generar el archivo para su descarga puede tardar algunos minutos.
|
|
31
|
+
"downloadMessage": "Generar el archivo para su descarga puede tardar algunos minutos. Espera, por favor. Este mensaje debería cerrarse automáticamente cuando la descarga esté completa.",
|
|
32
32
|
"loading": "Cargando ..."
|
|
33
33
|
},
|
|
34
34
|
"document": {
|
|
@@ -37,16 +37,19 @@
|
|
|
37
37
|
"selectTemplate": "Seleccionar Plantilla",
|
|
38
38
|
"selectFeature": "Seleccionar una característica",
|
|
39
39
|
"normalized": "Vista normalizada",
|
|
40
|
-
"plain": "Vista de lectura
|
|
40
|
+
"plain": "Vista de lectura simple",
|
|
41
41
|
"view-type": "Ver por páginas",
|
|
42
42
|
"add-panel": "Añadir Vista",
|
|
43
43
|
"caveat-heading": "Cuidado",
|
|
44
44
|
"settings": "Configuración",
|
|
45
|
-
"caveat": "Experimenta con diferentes plantillas y ODDs cambiando las opciones aquí. Por favor, ten en cuenta que no todas las combinaciones de configuración tienen sentido para todos los documentos. Por ejemplo, un mapa no puede ser producido sin marcar ni procesar las coordenadas explícitamente, y la vista de página asume que se han marcado los saltos de página. Si ves el mensaje \"el servidor no devolvió ningún contenido\", generalmente es señal de una
|
|
45
|
+
"caveat": "Experimenta con diferentes plantillas y ODDs cambiando las opciones aquí. Por favor, ten en cuenta que no todas las combinaciones de configuración tienen sentido para todos los documentos. Por ejemplo, un mapa no puede ser producido sin marcar ni procesar las coordenadas explícitamente, y la vista de página asume que se han marcado los saltos de página. Si ves el mensaje \"el servidor no devolvió ningún contenido\", generalmente es señal de una desalineación entre los datos codificados, la ODD y la plantilla."
|
|
46
46
|
},
|
|
47
47
|
"browse": {
|
|
48
|
-
"description": "Utiliza esta aplicación para experimentar y probar varios ODDs
|
|
48
|
+
"description": "Utiliza esta aplicación para experimentar y probar varios ODDs creados a partir de diferentes instrucciones del modelo de procesamiento. Carga tus propios archivos y crea un ODD personalizado.",
|
|
49
49
|
"login": "para subir archivos o ver funciones administrativas (usuario predeterminado: 'tei-demo', contraseña: 'demo').",
|
|
50
|
+
"login-1": "Inicia sesión como ",
|
|
51
|
+
"login-2": "con contraseña",
|
|
52
|
+
"login-3": "para experimentar con tus propios archivos y ODDs",
|
|
50
53
|
"sort": "Ordenar por",
|
|
51
54
|
"filter": "Filtrar por",
|
|
52
55
|
"filterPlaceholder": "Filtro",
|
|
@@ -60,6 +63,9 @@
|
|
|
60
63
|
"confirmDeletion": "¿Seguro que quieres eliminar el archivo?",
|
|
61
64
|
"confirmDeletion_plural": "¿Seguro que quieres eliminar {{count}} archivos?",
|
|
62
65
|
"documents": "Documentos",
|
|
66
|
+
"documents-removed":"Documentos eliminados",
|
|
67
|
+
"document-not-found":"Documento no encontrado",
|
|
68
|
+
"document-remove-failed":"No se ha podido eliminar el documento",
|
|
63
69
|
"collections": "Colección local",
|
|
64
70
|
"dts": "Servicios de texto distribuidos (versión experimental)",
|
|
65
71
|
"test": {
|
|
@@ -75,9 +81,13 @@
|
|
|
75
81
|
"description": "Documentación (en Docbook XML)."
|
|
76
82
|
},
|
|
77
83
|
"markdown": {
|
|
78
|
-
"title": "
|
|
84
|
+
"title": "Ejemplo en Markdown",
|
|
79
85
|
"description": "Un ejemplo de uso de Markdown para generar contenido estático."
|
|
80
86
|
},
|
|
87
|
+
"annotate": {
|
|
88
|
+
"title": "Ejemplos de anotación",
|
|
89
|
+
"description": "Otro espacio de pruebas para anotar documentos."
|
|
90
|
+
},
|
|
81
91
|
"up": "Ir a la carpeta anterior"
|
|
82
92
|
},
|
|
83
93
|
"upload": {
|
|
@@ -109,13 +119,14 @@
|
|
|
109
119
|
"search": {
|
|
110
120
|
"search": "Buscar",
|
|
111
121
|
"reset": "Reestablecer",
|
|
112
|
-
"placeholder": "Escribe el término
|
|
122
|
+
"placeholder": "Escribe el término de búsqueda",
|
|
113
123
|
"sections": "Buscar en secciones",
|
|
114
124
|
"headings": "Buscar en títulos"
|
|
115
125
|
},
|
|
116
126
|
"dts": {
|
|
117
127
|
"endpoint": "Seleccionar punto final",
|
|
118
|
-
"note": "Experimental: acceder a otras ediciones que exponen la API DTS"
|
|
128
|
+
"note": "Experimental: acceder a otras ediciones que exponen la API DTS",
|
|
129
|
+
"requires-login":"Es necesario iniciar sesión"
|
|
119
130
|
},
|
|
120
131
|
"odd": {
|
|
121
132
|
"files": "Archivos ODD",
|
|
@@ -134,6 +145,9 @@
|
|
|
134
145
|
"save": "Guardar",
|
|
135
146
|
"saving": "Guardando...",
|
|
136
147
|
"saved": "Guardado",
|
|
148
|
+
"unsaved": "Hay cambios no guardados que se incluirán en la exportación. ¿Continuar de todos modos?",
|
|
149
|
+
"download": "Descargar ODD",
|
|
150
|
+
"save-as": "Guardar ODD en un directorio",
|
|
137
151
|
"denied": "Permiso denegado",
|
|
138
152
|
"denied-message": "No tienes permiso para guardar {{odd}}",
|
|
139
153
|
"reload": "Volver a cargar",
|
|
@@ -159,10 +173,11 @@
|
|
|
159
173
|
"predicate-placeholder": "[Definir otras condiciones que deben cumplirse (en xquery)]",
|
|
160
174
|
"link-with-or": "o",
|
|
161
175
|
"css-class-placeholder": "[Definir nombre de clase CSS (para CSS externo)]",
|
|
162
|
-
"custom-behaviour-placeholder": "[
|
|
176
|
+
"custom-behaviour-placeholder": "[Comportamiento personalizado]",
|
|
163
177
|
"template-placeholder": "[Definir plantilla de código para aplicar al contenido]",
|
|
164
178
|
"param-name-placeholder": "[Nombre del parámetro]",
|
|
165
|
-
"empty": "[Vacío]"
|
|
179
|
+
"empty": "[Vacío]",
|
|
180
|
+
"mode-placeholder": "[Modo de procesamiento: se pasa a los modelos siguientes]"
|
|
166
181
|
},
|
|
167
182
|
"css-source": "Abrir fichero CSS"
|
|
168
183
|
}
|
|
@@ -186,13 +201,13 @@
|
|
|
186
201
|
"index-text": "Crear por texto"
|
|
187
202
|
},
|
|
188
203
|
"view": {
|
|
189
|
-
"help": "
|
|
204
|
+
"help": "Elige lo que se muestra por defecto al navegar por el texto: vista por páginas o por divisiones completas. La vista por página exige que el TEI XML esté correctamente marcado con etiquetas <tei:pb>.",
|
|
190
205
|
"div": "Por divisiones (capítulo/sección...)",
|
|
191
206
|
"page": "Por páginas"
|
|
192
207
|
},
|
|
193
208
|
"label": "Vista predeterminada",
|
|
194
209
|
"template": {
|
|
195
|
-
"help": "
|
|
210
|
+
"help": "Elige la plantilla HTML que se utilizará por defecto",
|
|
196
211
|
"label": "Plantilla HTML"
|
|
197
212
|
},
|
|
198
213
|
"title": {
|
|
@@ -239,11 +254,45 @@
|
|
|
239
254
|
"reload": "Recargar fuente TEI",
|
|
240
255
|
"preview": "Vista previa de los resultados de la fusión",
|
|
241
256
|
"confirm-restore-title": "Confirmar restauración",
|
|
242
|
-
"restore": "Se han encontrado anotaciones
|
|
257
|
+
"restore": "Se han encontrado anotaciones en este documento hechas en una sesión anterior. ¿Quieres recargarlas?",
|
|
243
258
|
"confirm-reload-title": "Confirmar recarga",
|
|
244
259
|
"confirm-reload": "¿Descartar las anotaciones actuales y recargar la fuente?",
|
|
245
260
|
"modify": "Aplicar edición al texto base",
|
|
246
261
|
"modify-info": "Nota: esto no es una anotación, pero modificará el texto base cuando se fusione.",
|
|
247
|
-
"permission": "Permiso denegado: no
|
|
262
|
+
"permission": "Permiso denegado: no tienes permiso para guardar anotaciones.",
|
|
263
|
+
"ner": {
|
|
264
|
+
"title": "Extracción de entidades nombradas",
|
|
265
|
+
"description": "Intenta encontrar automáticamente entidades nombradas en el texto y marcarlas como anotaciones.",
|
|
266
|
+
"run": "Ejecutar",
|
|
267
|
+
"model": "Selecciona un modelo",
|
|
268
|
+
"denied": "Se han encontrado cambios no guardados: por favor, guárdalos o descártalos antes."
|
|
269
|
+
},
|
|
270
|
+
"confirm-discard-title": "Descartar",
|
|
271
|
+
"confirm-discard": "¿Descartar la lista de ocurrencias?",
|
|
272
|
+
"doc-count": "{{count}} de {{total}}"
|
|
273
|
+
},
|
|
274
|
+
"ner": {
|
|
275
|
+
"title": "Entrena un modelo de reconocimiento de entidades nombradas (NER)",
|
|
276
|
+
"not-found": "Esta función requiere que el servicio TEI Publisher NER esté en funcionamiento. No se ha podido contactar con el servicio.",
|
|
277
|
+
"found": "Se ha encontrado TEI Publisher NER con la versión spaCy",
|
|
278
|
+
"name-placeholder": "Nombre del modelo a crear",
|
|
279
|
+
"name": "Nombre",
|
|
280
|
+
"path": "Ruta",
|
|
281
|
+
"path-placeholder": "Ruta relativa al documento o colección",
|
|
282
|
+
"path-info": "Introduce la ruta a un documento o colección que se utilizará como entrada de entrenamiento. Debe ser relativa a la raíz de datos de TEI Publisher.",
|
|
283
|
+
"lang-info": "Puedes entrenar un nuevo modelo para una lengua o seleccionar un modelo existente para ampliarlo a continuación. Si no amplías un modelo existente, debes especificar un idioma. En caso contrario, déjalo vacío.",
|
|
284
|
+
"language-placeholder": "Lengua para la que se crea el modelo",
|
|
285
|
+
"language": "Lengua",
|
|
286
|
+
"language-error": "Se requiere una lengua o un modelo base",
|
|
287
|
+
"model": "Modelo base",
|
|
288
|
+
"model-placeholder": "Modelo base para ampliar o copiar",
|
|
289
|
+
"vectors": "Solo copiar vectores del modelo base",
|
|
290
|
+
"output": "Resultado del entrenamiento",
|
|
291
|
+
"prepare": "Datos de entrenamiento en preparación",
|
|
292
|
+
"start": "Ejecutar"
|
|
293
|
+
},
|
|
294
|
+
"timeline": {
|
|
295
|
+
"unknown": "sin fecha",
|
|
296
|
+
"clear": "Borrar selección de fecha"
|
|
248
297
|
}
|
|
249
298
|
}
|
package/package.json
CHANGED
package/src/authority/custom.js
CHANGED
|
@@ -91,8 +91,8 @@ export class PbAuthorityLookup extends pbMixin(LitElement) {
|
|
|
91
91
|
>
|
|
92
92
|
<iron-icon icon="icons:search" slot="prefix"></iron-icon>
|
|
93
93
|
${
|
|
94
|
-
this._authorities[this.type].editable ?
|
|
95
|
-
html`<paper-icon-button icon="icons:add" @click="${this._addEntity}" slot="suffix"></paper-icon-button>` :
|
|
94
|
+
this._authorities[this.type] && this._authorities[this.type].editable ?
|
|
95
|
+
html`<paper-icon-button icon="icons:add" @click="${this._addEntity}" title="${translate('annotations.add-entity')}" slot="suffix"></paper-icon-button>` :
|
|
96
96
|
null
|
|
97
97
|
}
|
|
98
98
|
</paper-input>
|
|
@@ -143,11 +143,12 @@ export class PbAuthorityLookup extends pbMixin(LitElement) {
|
|
|
143
143
|
<div><span class="register" part="register">${item.register}</span></div>
|
|
144
144
|
|
|
145
145
|
${
|
|
146
|
-
this._authorities[this.type].editable ?
|
|
146
|
+
this._authorities[this.type] && this._authorities[this.type].editable ?
|
|
147
147
|
html`<div class="icons">
|
|
148
148
|
<paper-icon-button
|
|
149
149
|
icon="editor:mode-edit"
|
|
150
150
|
@click="${() => this._editEntity(item)}"
|
|
151
|
+
title="${translate('annotations.edit-entity')}"
|
|
151
152
|
></paper-icon-button>
|
|
152
153
|
</div>` : null
|
|
153
154
|
}
|
package/src/pb-view-annotate.js
CHANGED
|
@@ -801,11 +801,12 @@ class PbViewAnnotate extends PbView {
|
|
|
801
801
|
typeInd.style.backgroundColor = `var(--pb-annotation-${type})`;
|
|
802
802
|
typeInd.style.color = `var(${color && color.isLight ? '--pb-color-primary' : '--pb-color-inverse'})`;
|
|
803
803
|
if (data[this.getKey(type)]) {
|
|
804
|
-
this.emitTo
|
|
804
|
+
this.emitTo('pb-annotation-detail', {
|
|
805
805
|
type,
|
|
806
806
|
id: data[this.getKey(type)],
|
|
807
807
|
container: info,
|
|
808
808
|
span,
|
|
809
|
+
ready: () => instance.setContent(wrapper)
|
|
809
810
|
});
|
|
810
811
|
} else {
|
|
811
812
|
// show properties as key/value table
|