@teipublisher/pb-components 3.0.0-next-4.11 → 3.0.0-next-4.12
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 +9 -0
- package/dist/pb-components-bundle.js +3 -3
- package/package.json +1 -1
- package/src/pb-authority-lookup.js +4 -0
- package/src/pb-view-annotate.js +43 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
# [3.0.0-next-4.12](https://github.com/eeditiones/tei-publisher-components/compare/v3.0.0-next-4.11...v3.0.0-next-4.12) (2026-02-24)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **pb-authority:** do not requery if the query is the same ([6f68836](https://github.com/eeditiones/tei-publisher-components/commit/6f68836fb8f2db9c143bbe276374bd6a8ff0e23c))
|
|
7
|
+
* **pb-authority:** never translate the contents of pb-view-annotate ([b80442b](https://github.com/eeditiones/tei-publisher-components/commit/b80442b77f1289063ebd74ebc528e93c99c8979e))
|
|
8
|
+
* **pb-view-annotate:** scroll marker into view instead of parent element ([b2fe85b](https://github.com/eeditiones/tei-publisher-components/commit/b2fe85b0a9880f76adcbdbc1e588fd550a972bb6))
|
|
9
|
+
|
|
1
10
|
# [3.0.0-next-4.11](https://github.com/eeditiones/tei-publisher-components/compare/v3.0.0-next-4.10...v3.0.0-next-4.11) (2026-02-17)
|
|
2
11
|
|
|
3
12
|
|
|
@@ -130,7 +130,7 @@ import{g as e,x as t,i as n,a as s,r,p as o,w as a,c as l,b as c,E as d,m as p,B
|
|
|
130
130
|
border-color: #999;
|
|
131
131
|
color: #999;
|
|
132
132
|
}
|
|
133
|
-
`}customElements.define("pb-demo-snippet",se);const re="3.0.0-next-4.11";class oe extends s{static get properties(){return Object.assign({version:{type:String,reflect:!0}},super.properties)}constructor(){super(),this.version=re}render(){return t`<span>${this.version?this.version:"unknown"}</span>`}createRenderRoot(){return this}}customElements.define("pb-version",oe);var ae="top",le="bottom",ce="right",de="left",pe="auto",ue=[ae,le,ce,de],he="start",ge="end",fe="clippingParents",me="viewport",be="popper",ve="reference",ye=ue.reduce(function(e,t){return e.concat([t+"-"+he,t+"-"+ge])},[]),_e=[].concat(ue,[pe]).reduce(function(e,t){return e.concat([t,t+"-"+he,t+"-"+ge])},[]),we=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function xe(e){return e?(e.nodeName||"").toLowerCase():null}function ke(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Ae(e){return e instanceof ke(e).Element||e instanceof Element}function Se(e){return e instanceof ke(e).HTMLElement||e instanceof HTMLElement}function Oe(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ke(e).ShadowRoot||e instanceof ShadowRoot)}function Ee(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var i=t.styles[e]||{},n=t.attributes[e]||{},s=t.elements[e];Se(s)&&xe(s)&&(Object.assign(s.style,i),Object.keys(n).forEach(function(e){var t=n[e];!1===t?s.removeAttribute(e):s.setAttribute(e,!0===t?"":t)}))})}function $e(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach(function(e){var n=t.elements[e],s=t.attributes[e]||{},r=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:i[e]).reduce(function(e,t){return e[t]="",e},{});Se(n)&&xe(n)&&(Object.assign(n.style,r),Object.keys(s).forEach(function(e){n.removeAttribute(e)}))})}}var Ce={name:"applyStyles",enabled:!0,phase:"write",fn:Ee,effect:$e,requires:["computeStyles"]};function Te(e){return e.split("-")[0]}var Ie=Math.max,Le=Math.min,Re=Math.round;function je(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Pe(){return!/^((?!chrome|android).)*safari/i.test(je())}function Ne(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=!1);var n=e.getBoundingClientRect(),s=1,r=1;t&&Se(e)&&(s=e.offsetWidth>0&&Re(n.width)/e.offsetWidth||1,r=e.offsetHeight>0&&Re(n.height)/e.offsetHeight||1);var o=(Ae(e)?ke(e):window).visualViewport,a=!Pe()&&i,l=(n.left+(a&&o?o.offsetLeft:0))/s,c=(n.top+(a&&o?o.offsetTop:0))/r,d=n.width/s,p=n.height/r;return{width:d,height:p,top:c,right:l+d,bottom:c+p,left:l,x:l,y:c}}function De(e){var t=Ne(e),i=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:n}}function Fe(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&Oe(i)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Be(e){return ke(e).getComputedStyle(e)}function Me(e){return["table","td","th"].indexOf(xe(e))>=0}function qe(e){return((Ae(e)?e.ownerDocument:e.document)||window.document).documentElement}function ze(e){return"html"===xe(e)?e:e.assignedSlot||e.parentNode||(Oe(e)?e.host:null)||qe(e)}function Ue(e){return Se(e)&&"fixed"!==Be(e).position?e.offsetParent:null}function He(e){var t=/firefox/i.test(je());if(/Trident/i.test(je())&&Se(e)&&"fixed"===Be(e).position)return null;var i=ze(e);for(Oe(i)&&(i=i.host);Se(i)&&["html","body"].indexOf(xe(i))<0;){var n=Be(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||t&&"filter"===n.willChange||t&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}function Ve(e){for(var t=ke(e),i=Ue(e);i&&Me(i)&&"static"===Be(i).position;)i=Ue(i);return i&&("html"===xe(i)||"body"===xe(i)&&"static"===Be(i).position)?t:i||He(e)||t}function We(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Ge(e,t,i){return Ie(e,Le(t,i))}function Ye(e,t,i){var n=Ge(e,t,i);return n>i?i:n}function Qe(){return{top:0,right:0,bottom:0,left:0}}function Ke(e){return Object.assign({},Qe(),e)}function Je(e,t){return t.reduce(function(t,i){return t[i]=e,t},{})}var Ze=function(e,t){return Ke("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Je(e,ue))};function Xe(e){var t,i=e.state,n=e.name,s=e.options,r=i.elements.arrow,o=i.modifiersData.popperOffsets,a=Te(i.placement),l=We(a),c=[de,ce].indexOf(a)>=0?"height":"width";if(r&&o){var d=Ze(s.padding,i),p=De(r),u="y"===l?ae:de,h="y"===l?le:ce,g=i.rects.reference[c]+i.rects.reference[l]-o[l]-i.rects.popper[c],f=o[l]-i.rects.reference[l],m=Ve(r),b=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,v=g/2-f/2,y=d[u],_=b-p[c]-d[h],w=b/2-p[c]/2+v,x=Ge(y,w,_),k=l;i.modifiersData[n]=((t={})[k]=x,t.centerOffset=x-w,t)}}function et(e){var t=e.state,i=e.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=t.elements.popper.querySelector(n)))&&Fe(t.elements.popper,n)&&(t.elements.arrow=n)}function tt(e){return e.split("-")[1]}var it={top:"auto",right:"auto",bottom:"auto",left:"auto"};function nt(e,t){var i=e.x,n=e.y,s=t.devicePixelRatio||1;return{x:Re(i*s)/s||0,y:Re(n*s)/s||0}}function st(e){var t,i=e.popper,n=e.popperRect,s=e.placement,r=e.variation,o=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,d=e.roundOffsets,p=e.isFixed,u=o.x,h=void 0===u?0:u,g=o.y,f=void 0===g?0:g,m="function"==typeof d?d({x:h,y:f}):{x:h,y:f};h=m.x,f=m.y;var b=o.hasOwnProperty("x"),v=o.hasOwnProperty("y"),y=de,_=ae,w=window;if(c){var x=Ve(i),k="clientHeight",A="clientWidth";if(x===ke(i)&&"static"!==Be(x=qe(i)).position&&"absolute"===a&&(k="scrollHeight",A="scrollWidth"),s===ae||(s===de||s===ce)&&r===ge)_=le,f-=(p&&x===w&&w.visualViewport?w.visualViewport.height:x[k])-n.height,f*=l?1:-1;if(s===de||(s===ae||s===le)&&r===ge)y=ce,h-=(p&&x===w&&w.visualViewport?w.visualViewport.width:x[A])-n.width,h*=l?1:-1}var S,O=Object.assign({position:a},c&&it),E=!0===d?nt({x:h,y:f},ke(i)):{x:h,y:f};return h=E.x,f=E.y,l?Object.assign({},O,((S={})[_]=v?"0":"",S[y]=b?"0":"",S.transform=(w.devicePixelRatio||1)<=1?"translate("+h+"px, "+f+"px)":"translate3d("+h+"px, "+f+"px, 0)",S)):Object.assign({},O,((t={})[_]=v?f+"px":"",t[y]=b?h+"px":"",t.transform="",t))}function rt(e){var t=e.state,i=e.options,n=i.gpuAcceleration,s=void 0===n||n,r=i.adaptive,o=void 0===r||r,a=i.roundOffsets,l=void 0===a||a,c={placement:Te(t.placement),variation:tt(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,st(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,st(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var ot={passive:!0};function at(e){var t=e.state,i=e.instance,n=e.options,s=n.scroll,r=void 0===s||s,o=n.resize,a=void 0===o||o,l=ke(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&c.forEach(function(e){e.addEventListener("scroll",i.update,ot)}),a&&l.addEventListener("resize",i.update,ot),function(){r&&c.forEach(function(e){e.removeEventListener("scroll",i.update,ot)}),a&&l.removeEventListener("resize",i.update,ot)}}var lt={left:"right",right:"left",bottom:"top",top:"bottom"};function ct(e){return e.replace(/left|right|bottom|top/g,function(e){return lt[e]})}var dt={start:"end",end:"start"};function pt(e){return e.replace(/start|end/g,function(e){return dt[e]})}function ut(e){var t=ke(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function ht(e){return Ne(qe(e)).left+ut(e).scrollLeft}function gt(e,t){var i=ke(e),n=qe(e),s=i.visualViewport,r=n.clientWidth,o=n.clientHeight,a=0,l=0;if(s){r=s.width,o=s.height;var c=Pe();(c||!c&&"fixed"===t)&&(a=s.offsetLeft,l=s.offsetTop)}return{width:r,height:o,x:a+ht(e),y:l}}function ft(e){var t,i=qe(e),n=ut(e),s=null==(t=e.ownerDocument)?void 0:t.body,r=Ie(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=Ie(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-n.scrollLeft+ht(e),l=-n.scrollTop;return"rtl"===Be(s||i).direction&&(a+=Ie(i.clientWidth,s?s.clientWidth:0)-r),{width:r,height:o,x:a,y:l}}function mt(e){var t=Be(e),i=t.overflow,n=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+s+n)}function bt(e){return["html","body","#document"].indexOf(xe(e))>=0?e.ownerDocument.body:Se(e)&&mt(e)?e:bt(ze(e))}function vt(e,t){var i;void 0===t&&(t=[]);var n=bt(e),s=n===(null==(i=e.ownerDocument)?void 0:i.body),r=ke(n),o=s?[r].concat(r.visualViewport||[],mt(n)?n:[]):n,a=t.concat(o);return s?a:a.concat(vt(ze(o)))}function yt(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function _t(e,t){var i=Ne(e,!1,"fixed"===t);return i.top=i.top+e.clientTop,i.left=i.left+e.clientLeft,i.bottom=i.top+e.clientHeight,i.right=i.left+e.clientWidth,i.width=e.clientWidth,i.height=e.clientHeight,i.x=i.left,i.y=i.top,i}function wt(e,t,i){return t===me?yt(gt(e,i)):Ae(t)?_t(t,i):yt(ft(qe(e)))}function xt(e){var t=vt(ze(e)),i=["absolute","fixed"].indexOf(Be(e).position)>=0&&Se(e)?Ve(e):e;return Ae(i)?t.filter(function(e){return Ae(e)&&Fe(e,i)&&"body"!==xe(e)}):[]}function kt(e,t,i,n){var s="clippingParents"===t?xt(e):[].concat(t),r=[].concat(s,[i]),o=r[0],a=r.reduce(function(t,i){var s=wt(e,i,n);return t.top=Ie(s.top,t.top),t.right=Le(s.right,t.right),t.bottom=Le(s.bottom,t.bottom),t.left=Ie(s.left,t.left),t},wt(e,o,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function At(e){var t,i=e.reference,n=e.element,s=e.placement,r=s?Te(s):null,o=s?tt(s):null,a=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(r){case ae:t={x:a,y:i.y-n.height};break;case le:t={x:a,y:i.y+i.height};break;case ce:t={x:i.x+i.width,y:l};break;case de:t={x:i.x-n.width,y:l};break;default:t={x:i.x,y:i.y}}var c=r?We(r):null;if(null!=c){var d="y"===c?"height":"width";switch(o){case he:t[c]=t[c]-(i[d]/2-n[d]/2);break;case ge:t[c]=t[c]+(i[d]/2-n[d]/2)}}return t}function St(e,t){void 0===t&&(t={});var i=t,n=i.placement,s=void 0===n?e.placement:n,r=i.strategy,o=void 0===r?e.strategy:r,a=i.boundary,l=void 0===a?fe:a,c=i.rootBoundary,d=void 0===c?me:c,p=i.elementContext,u=void 0===p?be:p,h=i.altBoundary,g=void 0!==h&&h,f=i.padding,m=void 0===f?0:f,b=Ke("number"!=typeof m?m:Je(m,ue)),v=u===be?ve:be,y=e.rects.popper,_=e.elements[g?v:u],w=kt(Ae(_)?_:_.contextElement||qe(e.elements.popper),l,d,o),x=Ne(e.elements.reference),k=At({reference:x,element:y,placement:s}),A=yt(Object.assign({},y,k)),S=u===be?A:x,O={top:w.top-S.top+b.top,bottom:S.bottom-w.bottom+b.bottom,left:w.left-S.left+b.left,right:S.right-w.right+b.right},E=e.modifiersData.offset;if(u===be&&E){var $=E[s];Object.keys(O).forEach(function(e){var t=[ce,le].indexOf(e)>=0?1:-1,i=[ae,le].indexOf(e)>=0?"y":"x";O[e]+=$[i]*t})}return O}function Ot(e,t){void 0===t&&(t={});var i=t,n=i.placement,s=i.boundary,r=i.rootBoundary,o=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=void 0===l?_e:l,d=tt(n),p=d?a?ye:ye.filter(function(e){return tt(e)===d}):ue,u=p.filter(function(e){return c.indexOf(e)>=0});0===u.length&&(u=p);var h=u.reduce(function(t,i){return t[i]=St(e,{placement:i,boundary:s,rootBoundary:r,padding:o})[Te(i)],t},{});return Object.keys(h).sort(function(e,t){return h[e]-h[t]})}function Et(e){if(Te(e)===pe)return[];var t=ct(e);return[pt(e),t,pt(t)]}function $t(e){var t=e.state,i=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var s=i.mainAxis,r=void 0===s||s,o=i.altAxis,a=void 0===o||o,l=i.fallbackPlacements,c=i.padding,d=i.boundary,p=i.rootBoundary,u=i.altBoundary,h=i.flipVariations,g=void 0===h||h,f=i.allowedAutoPlacements,m=t.options.placement,b=Te(m),v=l||(b===m||!g?[ct(m)]:Et(m)),y=[m].concat(v).reduce(function(e,i){return e.concat(Te(i)===pe?Ot(t,{placement:i,boundary:d,rootBoundary:p,padding:c,flipVariations:g,allowedAutoPlacements:f}):i)},[]),_=t.rects.reference,w=t.rects.popper,x=new Map,k=!0,A=y[0],S=0;S<y.length;S++){var O=y[S],E=Te(O),$=tt(O)===he,C=[ae,le].indexOf(E)>=0,T=C?"width":"height",I=St(t,{placement:O,boundary:d,rootBoundary:p,altBoundary:u,padding:c}),L=C?$?ce:de:$?le:ae;_[T]>w[T]&&(L=ct(L));var R=ct(L),j=[];if(r&&j.push(I[E]<=0),a&&j.push(I[L]<=0,I[R]<=0),j.every(function(e){return e})){A=O,k=!1;break}x.set(O,j)}if(k)for(var P=function(e){var t=y.find(function(t){var i=x.get(t);if(i)return i.slice(0,e).every(function(e){return e})});if(t)return A=t,"break"},N=g?3:1;N>0;N--){if("break"===P(N))break}t.placement!==A&&(t.modifiersData[n]._skip=!0,t.placement=A,t.reset=!0)}}function Ct(e,t,i){return void 0===i&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function Tt(e){return[ae,ce,le,de].some(function(t){return e[t]>=0})}function It(e){var t=e.state,i=e.name,n=t.rects.reference,s=t.rects.popper,r=t.modifiersData.preventOverflow,o=St(t,{elementContext:"reference"}),a=St(t,{altBoundary:!0}),l=Ct(o,n),c=Ct(a,s,r),d=Tt(l),p=Tt(c);t.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":p})}function Lt(e,t,i){var n=Te(e),s=[de,ae].indexOf(n)>=0?-1:1,r="function"==typeof i?i(Object.assign({},t,{placement:e})):i,o=r[0],a=r[1];return o=o||0,a=(a||0)*s,[de,ce].indexOf(n)>=0?{x:a,y:o}:{x:o,y:a}}function Rt(e){var t=e.state,i=e.options,n=e.name,s=i.offset,r=void 0===s?[0,0]:s,o=_e.reduce(function(e,i){return e[i]=Lt(i,t.rects,r),e},{}),a=o[t.placement],l=a.x,c=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=o}function jt(e){var t=e.state,i=e.name;t.modifiersData[i]=At({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}function Pt(e){return"x"===e?"y":"x"}function Nt(e){var t=e.state,i=e.options,n=e.name,s=i.mainAxis,r=void 0===s||s,o=i.altAxis,a=void 0!==o&&o,l=i.boundary,c=i.rootBoundary,d=i.altBoundary,p=i.padding,u=i.tether,h=void 0===u||u,g=i.tetherOffset,f=void 0===g?0:g,m=St(t,{boundary:l,rootBoundary:c,padding:p,altBoundary:d}),b=Te(t.placement),v=tt(t.placement),y=!v,_=We(b),w=Pt(_),x=t.modifiersData.popperOffsets,k=t.rects.reference,A=t.rects.popper,S="function"==typeof f?f(Object.assign({},t.rects,{placement:t.placement})):f,O="number"==typeof S?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),E=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,$={x:0,y:0};if(x){if(r){var C,T="y"===_?ae:de,I="y"===_?le:ce,L="y"===_?"height":"width",R=x[_],j=R+m[T],P=R-m[I],N=h?-A[L]/2:0,D=v===he?k[L]:A[L],F=v===he?-A[L]:-k[L],B=t.elements.arrow,M=h&&B?De(B):{width:0,height:0},q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Qe(),z=q[T],U=q[I],H=Ge(0,k[L],M[L]),V=y?k[L]/2-N-H-z-O.mainAxis:D-H-z-O.mainAxis,W=y?-k[L]/2+N+H+U+O.mainAxis:F+H+U+O.mainAxis,G=t.elements.arrow&&Ve(t.elements.arrow),Y=G?"y"===_?G.clientTop||0:G.clientLeft||0:0,Q=null!=(C=null==E?void 0:E[_])?C:0,K=R+W-Q,J=Ge(h?Le(j,R+V-Q-Y):j,R,h?Ie(P,K):P);x[_]=J,$[_]=J-R}if(a){var Z,X="x"===_?ae:de,ee="x"===_?le:ce,te=x[w],ie="y"===w?"height":"width",ne=te+m[X],se=te-m[ee],re=-1!==[ae,de].indexOf(b),oe=null!=(Z=null==E?void 0:E[w])?Z:0,pe=re?ne:te-k[ie]-A[ie]-oe+O.altAxis,ue=re?te+k[ie]+A[ie]-oe-O.altAxis:se,ge=h&&re?Ye(pe,te,ue):Ge(h?pe:ne,te,h?ue:se);x[w]=ge,$[w]=ge-te}t.modifiersData[n]=$}}function Dt(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Ft(e){return e!==ke(e)&&Se(e)?Dt(e):ut(e)}function Bt(e){var t=e.getBoundingClientRect(),i=Re(t.width)/e.offsetWidth||1,n=Re(t.height)/e.offsetHeight||1;return 1!==i||1!==n}function Mt(e,t,i){void 0===i&&(i=!1);var n=Se(t),s=Se(t)&&Bt(t),r=qe(t),o=Ne(e,s,i),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!i)&&(("body"!==xe(t)||mt(r))&&(a=Ft(t)),Se(t)?((l=Ne(t,!0)).x+=t.clientLeft,l.y+=t.clientTop):r&&(l.x=ht(r))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function qt(e){var t=new Map,i=new Set,n=[];function s(e){i.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!i.has(e)){var n=t.get(e);n&&s(n)}}),n.push(e)}return e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){i.has(e.name)||s(e)}),n}function zt(e){var t=qt(e);return we.reduce(function(e,i){return e.concat(t.filter(function(e){return e.phase===i}))},[])}function Ut(e){var t;return function(){return t||(t=new Promise(function(i){Promise.resolve().then(function(){t=void 0,i(e())})})),t}}function Ht(e){var t=e.reduce(function(e,t){var i=e[t.name];return e[t.name]=i?Object.assign({},i,t,{options:Object.assign({},i.options,t.options),data:Object.assign({},i.data,t.data)}):t,e},{});return Object.keys(t).map(function(e){return t[e]})}var Vt={placement:"bottom",modifiers:[],strategy:"absolute"};function Wt(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return!t.some(function(e){return!(e&&"function"==typeof e.getBoundingClientRect)})}function Gt(e){void 0===e&&(e={});var t=e,i=t.defaultModifiers,n=void 0===i?[]:i,s=t.defaultOptions,r=void 0===s?Vt:s;return function(e,t,i){void 0===i&&(i=r);var s={placement:"bottom",orderedModifiers:[],options:Object.assign({},Vt,r),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},o=[],a=!1,l={state:s,setOptions:function(i){var o="function"==typeof i?i(s.options):i;d(),s.options=Object.assign({},r,s.options,o),s.scrollParents={reference:Ae(e)?vt(e):e.contextElement?vt(e.contextElement):[],popper:vt(t)};var a=zt(Ht([].concat(n,s.options.modifiers)));return s.orderedModifiers=a.filter(function(e){return e.enabled}),c(),l.update()},forceUpdate:function(){if(!a){var e=s.elements,t=e.reference,i=e.popper;if(Wt(t,i)){s.rects={reference:Mt(t,Ve(i),"fixed"===s.options.strategy),popper:De(i)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach(function(e){return s.modifiersData[e.name]=Object.assign({},e.data)});for(var n=0;n<s.orderedModifiers.length;n++)if(!0!==s.reset){var r=s.orderedModifiers[n],o=r.fn,c=r.options,d=void 0===c?{}:c,p=r.name;"function"==typeof o&&(s=o({state:s,options:d,name:p,instance:l})||s)}else s.reset=!1,n=-1}}},update:Ut(function(){return new Promise(function(e){l.forceUpdate(),e(s)})}),destroy:function(){d(),a=!0}};if(!Wt(e,t))return l;function c(){s.orderedModifiers.forEach(function(e){var t=e.name,i=e.options,n=void 0===i?{}:i,r=e.effect;if("function"==typeof r){var a=r({state:s,name:t,instance:l,options:n}),c=function(){};o.push(a||c)}})}function d(){o.forEach(function(e){return e()}),o=[]}return l.setOptions(i).then(function(e){!a&&i.onFirstUpdate&&i.onFirstUpdate(e)}),l}}var Yt=Gt({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:at,data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:jt,data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:rt,data:{}},Ce,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Rt},{name:"flip",enabled:!0,phase:"main",fn:$t,requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:Nt,requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:Xe,effect:et,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:It}]}),Qt="tippy-box",Kt="tippy-content",Jt="tippy-backdrop",Zt="tippy-arrow",Xt="tippy-svg-arrow",ei={passive:!0,capture:!0},ti=function(){return document.body};function ii(e,t,i){if(Array.isArray(e)){var n=e[t];return n??(Array.isArray(i)?i[t]:i)}return e}function ni(e,t){var i={}.toString.call(e);return 0===i.indexOf("[object")&&i.indexOf(t+"]")>-1}function si(e,t){return"function"==typeof e?e.apply(void 0,t):e}function ri(e,t){return 0===t?e:function(n){clearTimeout(i),i=setTimeout(function(){e(n)},t)};var i}function oi(e){return e.split(/\s+/).filter(Boolean)}function ai(e){return[].concat(e)}function li(e,t){-1===e.indexOf(t)&&e.push(t)}function ci(e){return e.filter(function(t,i){return e.indexOf(t)===i})}function di(e){return e.split("-")[0]}function pi(e){return[].slice.call(e)}function ui(e){return Object.keys(e).reduce(function(t,i){return void 0!==e[i]&&(t[i]=e[i]),t},{})}function hi(){return document.createElement("div")}function gi(e){return["Element","Fragment"].some(function(t){return ni(e,t)})}function fi(e){return ni(e,"NodeList")}function mi(e){return ni(e,"MouseEvent")}function bi(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function vi(e){return gi(e)?[e]:fi(e)?pi(e):Array.isArray(e)?e:pi(document.querySelectorAll(e))}function yi(e,t){e.forEach(function(e){e&&(e.style.transitionDuration=t+"ms")})}function _i(e,t){e.forEach(function(e){e&&e.setAttribute("data-state",t)})}function wi(e){var t,i=ai(e)[0];return null!=i&&null!=(t=i.ownerDocument)&&t.body?i.ownerDocument:document}function xi(e,t){var i=t.clientX,n=t.clientY;return e.every(function(e){var t=e.popperRect,s=e.popperState,r=e.props.interactiveBorder,o=di(s.placement),a=s.modifiersData.offset;if(!a)return!0;var l="bottom"===o?a.top.y:0,c="top"===o?a.bottom.y:0,d="right"===o?a.left.x:0,p="left"===o?a.right.x:0,u=t.top-n+l>r,h=n-t.bottom-c>r,g=t.left-i+d>r,f=i-t.right-p>r;return u||h||g||f})}function ki(e,t,i){var n=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(t){e[n](t,i)})}function Ai(e,t){for(var i=t;i;){var n;if(e.contains(i))return!0;i=null==i.getRootNode||null==(n=i.getRootNode())?void 0:n.host}return!1}var Si={isTouch:!1},Oi=0;function Ei(){Si.isTouch||(Si.isTouch=!0,window.performance&&document.addEventListener("mousemove",$i))}function $i(){var e=performance.now();e-Oi<20&&(Si.isTouch=!1,document.removeEventListener("mousemove",$i)),Oi=e}function Ci(){var e=document.activeElement;if(bi(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function Ti(){document.addEventListener("touchstart",Ei,ei),window.addEventListener("blur",Ci)}var Ii=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto,Li={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Ri={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},ji=Object.assign({appendTo:ti,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},Li,Ri),Pi=Object.keys(ji),Ni=function(e){Object.keys(e).forEach(function(t){ji[t]=e[t]})};function Di(e){var t=(e.plugins||[]).reduce(function(t,i){var n,s=i.name,r=i.defaultValue;s&&(t[s]=void 0!==e[s]?e[s]:null!=(n=ji[s])?n:r);return t},{});return Object.assign({},e,t)}function Fi(e,t){var i=(t?Object.keys(Di(Object.assign({},ji,{plugins:t}))):Pi).reduce(function(t,i){var n=(e.getAttribute("data-tippy-"+i)||"").trim();if(!n)return t;if("content"===i)t[i]=n;else try{t[i]=JSON.parse(n)}catch(e){t[i]=n}return t},{});return i}function Bi(e,t){var i=Object.assign({},t,{content:si(t.content,[e])},t.ignoreAttributes?{}:Fi(e,t.plugins));return i.aria=Object.assign({},ji.aria,i.aria),i.aria={expanded:"auto"===i.aria.expanded?t.interactive:i.aria.expanded,content:"auto"===i.aria.content?t.interactive?null:"describedby":i.aria.content},i}var Mi=function(){return"innerHTML"};function qi(e,t){e[Mi()]=t}function zi(e){var t=hi();return!0===e?t.className=Zt:(t.className=Xt,gi(e)?t.appendChild(e):qi(t,e)),t}function Ui(e,t){gi(t.content)?(qi(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?qi(e,t.content):e.textContent=t.content)}function Hi(e){var t=e.firstElementChild,i=pi(t.children);return{box:t,content:i.find(function(e){return e.classList.contains(Kt)}),arrow:i.find(function(e){return e.classList.contains(Zt)||e.classList.contains(Xt)}),backdrop:i.find(function(e){return e.classList.contains(Jt)})}}function Vi(e){var t=hi(),i=hi();i.className=Qt,i.setAttribute("data-state","hidden"),i.setAttribute("tabindex","-1");var n=hi();function s(i,n){var s=Hi(t),r=s.box,o=s.content,a=s.arrow;n.theme?r.setAttribute("data-theme",n.theme):r.removeAttribute("data-theme"),"string"==typeof n.animation?r.setAttribute("data-animation",n.animation):r.removeAttribute("data-animation"),n.inertia?r.setAttribute("data-inertia",""):r.removeAttribute("data-inertia"),r.style.maxWidth="number"==typeof n.maxWidth?n.maxWidth+"px":n.maxWidth,n.role?r.setAttribute("role",n.role):r.removeAttribute("role"),i.content===n.content&&i.allowHTML===n.allowHTML||Ui(o,e.props),n.arrow?a?i.arrow!==n.arrow&&(r.removeChild(a),r.appendChild(zi(n.arrow))):r.appendChild(zi(n.arrow)):a&&r.removeChild(a)}return n.className=Kt,n.setAttribute("data-state","hidden"),Ui(n,e.props),t.appendChild(i),i.appendChild(n),s(e.props,e.props),{popper:t,onUpdate:s}}Vi.$$tippy=!0;var Wi=1,Gi=[],Yi=[];function Qi(e,t){var i,n,s,r,o,a,l,c=Bi(e,Object.assign({},ji,Di(ui(t)))),d=!1,p=!1,u=!1,h=!1,g=[],f=ri(K,c.interactiveDebounce),m=Wi++,b=null,v=ci(c.plugins),y={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},_={id:m,reference:e,popper:hi(),popperInstance:b,props:c,state:y,plugins:v,clearDelayTimeouts:le,setProps:ce,setContent:de,show:pe,hide:ue,hideWithInteractivity:he,enable:oe,disable:ae,unmount:ge,destroy:fe};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,e._tippy=_,x._tippy=_;var A=v.map(function(e){return e.fn(_)}),S=e.hasAttribute("aria-expanded");return G(),N(),R(),j("onCreate",[_]),c.showOnCreate&&se(),x.addEventListener("mouseenter",function(){_.props.interactive&&_.state.isVisible&&_.clearDelayTimeouts()}),x.addEventListener("mouseleave",function(){_.props.interactive&&_.props.trigger.indexOf("mouseenter")>=0&&T().addEventListener("mousemove",f)}),_;function O(){var e=_.props.touch;return Array.isArray(e)?e:[e,0]}function E(){return"hold"===O()[0]}function $(){var e;return!(null==(e=_.props.render)||!e.$$tippy)}function C(){return l||e}function T(){var e=C().parentNode;return e?wi(e):document}function I(){return Hi(x)}function L(e){return _.state.isMounted&&!_.state.isVisible||Si.isTouch||r&&"focus"===r.type?0:ii(_.props.delay,e?0:1,ji.delay)}function R(e){void 0===e&&(e=!1),x.style.pointerEvents=_.props.interactive&&!e?"":"none",x.style.zIndex=""+_.props.zIndex}function j(e,t,i){var n;(void 0===i&&(i=!0),A.forEach(function(i){i[e]&&i[e].apply(i,t)}),i)&&(n=_.props)[e].apply(n,t)}function P(){var t=_.props.aria;if(t.content){var i="aria-"+t.content,n=x.id;ai(_.props.triggerTarget||e).forEach(function(e){var t=e.getAttribute(i);if(_.state.isVisible)e.setAttribute(i,t?t+" "+n:n);else{var s=t&&t.replace(n,"").trim();s?e.setAttribute(i,s):e.removeAttribute(i)}})}}function N(){!S&&_.props.aria.expanded&&ai(_.props.triggerTarget||e).forEach(function(e){_.props.interactive?e.setAttribute("aria-expanded",_.state.isVisible&&e===C()?"true":"false"):e.removeAttribute("aria-expanded")})}function D(){T().removeEventListener("mousemove",f),Gi=Gi.filter(function(e){return e!==f})}function F(t){if(!Si.isTouch||!u&&"mousedown"!==t.type){var i=t.composedPath&&t.composedPath()[0]||t.target;if(!_.props.interactive||!Ai(x,i)){if(ai(_.props.triggerTarget||e).some(function(e){return Ai(e,i)})){if(Si.isTouch)return;if(_.state.isVisible&&_.props.trigger.indexOf("click")>=0)return}else j("onClickOutside",[_,t]);!0===_.props.hideOnClick&&(_.clearDelayTimeouts(),_.hide(),p=!0,setTimeout(function(){p=!1}),_.state.isMounted||z())}}}function B(){u=!0}function M(){u=!1}function q(){var e=T();e.addEventListener("mousedown",F,!0),e.addEventListener("touchend",F,ei),e.addEventListener("touchstart",M,ei),e.addEventListener("touchmove",B,ei)}function z(){var e=T();e.removeEventListener("mousedown",F,!0),e.removeEventListener("touchend",F,ei),e.removeEventListener("touchstart",M,ei),e.removeEventListener("touchmove",B,ei)}function U(e,t){V(e,function(){!_.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&t()})}function H(e,t){V(e,t)}function V(e,t){var i=I().box;function n(e){e.target===i&&(ki(i,"remove",n),t())}if(0===e)return t();ki(i,"remove",o),ki(i,"add",n),o=n}function W(t,i,n){void 0===n&&(n=!1),ai(_.props.triggerTarget||e).forEach(function(e){e.addEventListener(t,i,n),g.push({node:e,eventType:t,handler:i,options:n})})}function G(){E()&&(W("touchstart",Q,{passive:!0}),W("touchend",J,{passive:!0})),oi(_.props.trigger).forEach(function(e){if("manual"!==e)switch(W(e,Q),e){case"mouseenter":W("mouseleave",J);break;case"focus":W(Ii?"focusout":"blur",Z);break;case"focusin":W("focusout",Z)}})}function Y(){g.forEach(function(e){var t=e.node,i=e.eventType,n=e.handler,s=e.options;t.removeEventListener(i,n,s)}),g=[]}function Q(e){var t,i=!1;if(_.state.isEnabled&&!X(e)&&!p){var n="focus"===(null==(t=r)?void 0:t.type);r=e,l=e.currentTarget,N(),!_.state.isVisible&&mi(e)&&Gi.forEach(function(t){return t(e)}),"click"===e.type&&(_.props.trigger.indexOf("mouseenter")<0||d)&&!1!==_.props.hideOnClick&&_.state.isVisible?i=!0:se(e),"click"===e.type&&(d=!i),i&&!n&&re(e)}}function K(e){var t=e.target,i=C().contains(t)||x.contains(t);if("mousemove"!==e.type||!i){var n=ne().concat(x).map(function(e){var t,i=null==(t=e._tippy.popperInstance)?void 0:t.state;return i?{popperRect:e.getBoundingClientRect(),popperState:i,props:c}:null}).filter(Boolean);xi(n,e)&&(D(),re(e))}}function J(e){X(e)||_.props.trigger.indexOf("click")>=0&&d||(_.props.interactive?_.hideWithInteractivity(e):re(e))}function Z(e){_.props.trigger.indexOf("focusin")<0&&e.target!==C()||_.props.interactive&&e.relatedTarget&&x.contains(e.relatedTarget)||re(e)}function X(e){return!!Si.isTouch&&E()!==e.type.indexOf("touch")>=0}function ee(){te();var t=_.props,i=t.popperOptions,n=t.placement,s=t.offset,r=t.getReferenceClientRect,o=t.moveTransition,l=$()?Hi(x).arrow:null,c=r?{getBoundingClientRect:r,contextElement:r.contextElement||C()}:e,d={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if($()){var i=I().box;["placement","reference-hidden","escaped"].forEach(function(e){"placement"===e?i.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?i.setAttribute("data-"+e,""):i.removeAttribute("data-"+e)}),t.attributes.popper={}}}},p=[{name:"offset",options:{offset:s}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!o}},d];$()&&l&&p.push({name:"arrow",options:{element:l,padding:3}}),p.push.apply(p,(null==i?void 0:i.modifiers)||[]),_.popperInstance=Yt(c,x,Object.assign({},i,{placement:n,onFirstUpdate:a,modifiers:p}))}function te(){_.popperInstance&&(_.popperInstance.destroy(),_.popperInstance=null)}function ie(){var e,t=_.props.appendTo,i=C();(e=_.props.interactive&&t===ti||"parent"===t?i.parentNode:si(t,[i])).contains(x)||e.appendChild(x),_.state.isMounted=!0,ee()}function ne(){return pi(x.querySelectorAll("[data-tippy-root]"))}function se(e){_.clearDelayTimeouts(),e&&j("onTrigger",[_,e]),q();var t=L(!0),n=O(),s=n[0],r=n[1];Si.isTouch&&"hold"===s&&r&&(t=r),t?i=setTimeout(function(){_.show()},t):_.show()}function re(e){if(_.clearDelayTimeouts(),j("onUntrigger",[_,e]),_.state.isVisible){if(!(_.props.trigger.indexOf("mouseenter")>=0&&_.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&d)){var t=L(!1);t?n=setTimeout(function(){_.state.isVisible&&_.hide()},t):s=requestAnimationFrame(function(){_.hide()})}}else z()}function oe(){_.state.isEnabled=!0}function ae(){_.hide(),_.state.isEnabled=!1}function le(){clearTimeout(i),clearTimeout(n),cancelAnimationFrame(s)}function ce(t){if(!_.state.isDestroyed){j("onBeforeUpdate",[_,t]),Y();var i=_.props,n=Bi(e,Object.assign({},i,ui(t),{ignoreAttributes:!0}));_.props=n,G(),i.interactiveDebounce!==n.interactiveDebounce&&(D(),f=ri(K,n.interactiveDebounce)),i.triggerTarget&&!n.triggerTarget?ai(i.triggerTarget).forEach(function(e){e.removeAttribute("aria-expanded")}):n.triggerTarget&&e.removeAttribute("aria-expanded"),N(),R(),k&&k(i,n),_.popperInstance&&(ee(),ne().forEach(function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})),j("onAfterUpdate",[_,t])}}function de(e){_.setProps({content:e})}function pe(){var e=_.state.isVisible,t=_.state.isDestroyed,i=!_.state.isEnabled,n=Si.isTouch&&!_.props.touch,s=ii(_.props.duration,0,ji.duration);if(!(e||t||i||n||C().hasAttribute("disabled")||(j("onShow",[_],!1),!1===_.props.onShow(_)))){if(_.state.isVisible=!0,$()&&(x.style.visibility="visible"),R(),q(),_.state.isMounted||(x.style.transition="none"),$()){var r=I();yi([r.box,r.content],0)}a=function(){var e;if(_.state.isVisible&&!h){if(h=!0,x.offsetHeight,x.style.transition=_.props.moveTransition,$()&&_.props.animation){var t=I(),i=t.box,n=t.content;yi([i,n],s),_i([i,n],"visible")}P(),N(),li(Yi,_),null==(e=_.popperInstance)||e.forceUpdate(),j("onMount",[_]),_.props.animation&&$()&&H(s,function(){_.state.isShown=!0,j("onShown",[_])})}},ie()}}function ue(){var e=!_.state.isVisible,t=_.state.isDestroyed,i=!_.state.isEnabled,n=ii(_.props.duration,1,ji.duration);if(!(e||t||i)&&(j("onHide",[_],!1),!1!==_.props.onHide(_))){if(_.state.isVisible=!1,_.state.isShown=!1,h=!1,d=!1,$()&&(x.style.visibility="hidden"),D(),z(),R(!0),$()){var s=I(),r=s.box,o=s.content;_.props.animation&&(yi([r,o],n),_i([r,o],"hidden"))}P(),N(),_.props.animation?$()&&U(n,_.unmount):_.unmount()}}function he(e){T().addEventListener("mousemove",f),li(Gi,f),f(e)}function ge(){_.state.isVisible&&_.hide(),_.state.isMounted&&(te(),ne().forEach(function(e){e._tippy.unmount()}),x.parentNode&&x.parentNode.removeChild(x),Yi=Yi.filter(function(e){return e!==_}),_.state.isMounted=!1,j("onHidden",[_]))}function fe(){_.state.isDestroyed||(_.clearDelayTimeouts(),_.unmount(),Y(),delete e._tippy,_.state.isDestroyed=!0,j("onDestroy",[_]))}}function Ki(e,t){void 0===t&&(t={});var i=ji.plugins.concat(t.plugins||[]);Ti();var n=Object.assign({},t,{plugins:i}),s=vi(e).reduce(function(e,t){var i=t&&Qi(t,n);return i&&e.push(i),e},[]);return gi(e)?s[0]:s}function Ji(e){return e.replace(/(?:^\w|[A-Z]|\b\w)/g,(e,t)=>0===+e?"":0===t?e.toLowerCase():e.toUpperCase()).replace("-","")}Ki.defaultProps=ji,Ki.setDefaultProps=Ni,Ki.currentInput=Si,Object.assign({},Ce,{effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow)}}),Ki.setDefaultProps({render:Vi});const Zi='\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: clamp(\n calc(var(--pb-popover-font-size, 1rem) * var(--pb-min-zoom, 0.5)), \n calc(var(--pb-popover-font-size, 1rem) * var(--pb-zoom-factor)), \n calc(var(--pb-popover-font-size, 1rem) * var(--pb-max-zoom, 3.0))\n );\n line-height: calc(var(--pb-popover-line-height, 1.5) * var(--pb-zoom-factor));\n\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',Xi='\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',en="\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 }",tn="\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",nn="\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 sn=Object.freeze({__proto__:null,base:Zi,camelize:Ji,light:en,lightBorder:Xi,material:tn,translucent:nn});function rn(e,t,i){if(!e.querySelector(`#pb-popover-${t}`)){const n=e.nodeType===Node.DOCUMENT_NODE?document.head:e;console.log("Loading tippy styles for theme %s into %o",t,n);const s=document.createElement("style");s.type="text/css",s.id=`pb-popover-${t}`,s.innerHTML=i,n.appendChild(s)}}function on(e,t){if(rn(e,"base",Zi),t&&"none"!==t){const i=Ji(t),n=sn[i];n&&rn(e,i,n)}}class an extends(o(s)){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?t`<div class="hidden"><slot></slot></div>`:t`<span id="link" part="trigger" class="${this.persistent?"persistent":""}"
|
|
133
|
+
`}customElements.define("pb-demo-snippet",se);const re="3.0.0-next-4.12";class oe extends s{static get properties(){return Object.assign({version:{type:String,reflect:!0}},super.properties)}constructor(){super(),this.version=re}render(){return t`<span>${this.version?this.version:"unknown"}</span>`}createRenderRoot(){return this}}customElements.define("pb-version",oe);var ae="top",le="bottom",ce="right",de="left",pe="auto",ue=[ae,le,ce,de],he="start",ge="end",fe="clippingParents",me="viewport",be="popper",ve="reference",ye=ue.reduce(function(e,t){return e.concat([t+"-"+he,t+"-"+ge])},[]),_e=[].concat(ue,[pe]).reduce(function(e,t){return e.concat([t,t+"-"+he,t+"-"+ge])},[]),we=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function xe(e){return e?(e.nodeName||"").toLowerCase():null}function ke(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Ae(e){return e instanceof ke(e).Element||e instanceof Element}function Se(e){return e instanceof ke(e).HTMLElement||e instanceof HTMLElement}function Oe(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ke(e).ShadowRoot||e instanceof ShadowRoot)}function Ee(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var i=t.styles[e]||{},n=t.attributes[e]||{},s=t.elements[e];Se(s)&&xe(s)&&(Object.assign(s.style,i),Object.keys(n).forEach(function(e){var t=n[e];!1===t?s.removeAttribute(e):s.setAttribute(e,!0===t?"":t)}))})}function $e(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach(function(e){var n=t.elements[e],s=t.attributes[e]||{},r=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:i[e]).reduce(function(e,t){return e[t]="",e},{});Se(n)&&xe(n)&&(Object.assign(n.style,r),Object.keys(s).forEach(function(e){n.removeAttribute(e)}))})}}var Ce={name:"applyStyles",enabled:!0,phase:"write",fn:Ee,effect:$e,requires:["computeStyles"]};function Te(e){return e.split("-")[0]}var Ie=Math.max,Le=Math.min,Re=Math.round;function je(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Pe(){return!/^((?!chrome|android).)*safari/i.test(je())}function Ne(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=!1);var n=e.getBoundingClientRect(),s=1,r=1;t&&Se(e)&&(s=e.offsetWidth>0&&Re(n.width)/e.offsetWidth||1,r=e.offsetHeight>0&&Re(n.height)/e.offsetHeight||1);var o=(Ae(e)?ke(e):window).visualViewport,a=!Pe()&&i,l=(n.left+(a&&o?o.offsetLeft:0))/s,c=(n.top+(a&&o?o.offsetTop:0))/r,d=n.width/s,p=n.height/r;return{width:d,height:p,top:c,right:l+d,bottom:c+p,left:l,x:l,y:c}}function De(e){var t=Ne(e),i=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:n}}function Fe(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&Oe(i)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Be(e){return ke(e).getComputedStyle(e)}function Me(e){return["table","td","th"].indexOf(xe(e))>=0}function qe(e){return((Ae(e)?e.ownerDocument:e.document)||window.document).documentElement}function ze(e){return"html"===xe(e)?e:e.assignedSlot||e.parentNode||(Oe(e)?e.host:null)||qe(e)}function Ue(e){return Se(e)&&"fixed"!==Be(e).position?e.offsetParent:null}function He(e){var t=/firefox/i.test(je());if(/Trident/i.test(je())&&Se(e)&&"fixed"===Be(e).position)return null;var i=ze(e);for(Oe(i)&&(i=i.host);Se(i)&&["html","body"].indexOf(xe(i))<0;){var n=Be(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||t&&"filter"===n.willChange||t&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}function Ve(e){for(var t=ke(e),i=Ue(e);i&&Me(i)&&"static"===Be(i).position;)i=Ue(i);return i&&("html"===xe(i)||"body"===xe(i)&&"static"===Be(i).position)?t:i||He(e)||t}function We(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Ge(e,t,i){return Ie(e,Le(t,i))}function Ye(e,t,i){var n=Ge(e,t,i);return n>i?i:n}function Qe(){return{top:0,right:0,bottom:0,left:0}}function Ke(e){return Object.assign({},Qe(),e)}function Je(e,t){return t.reduce(function(t,i){return t[i]=e,t},{})}var Ze=function(e,t){return Ke("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Je(e,ue))};function Xe(e){var t,i=e.state,n=e.name,s=e.options,r=i.elements.arrow,o=i.modifiersData.popperOffsets,a=Te(i.placement),l=We(a),c=[de,ce].indexOf(a)>=0?"height":"width";if(r&&o){var d=Ze(s.padding,i),p=De(r),u="y"===l?ae:de,h="y"===l?le:ce,g=i.rects.reference[c]+i.rects.reference[l]-o[l]-i.rects.popper[c],f=o[l]-i.rects.reference[l],m=Ve(r),b=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,v=g/2-f/2,y=d[u],_=b-p[c]-d[h],w=b/2-p[c]/2+v,x=Ge(y,w,_),k=l;i.modifiersData[n]=((t={})[k]=x,t.centerOffset=x-w,t)}}function et(e){var t=e.state,i=e.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=t.elements.popper.querySelector(n)))&&Fe(t.elements.popper,n)&&(t.elements.arrow=n)}function tt(e){return e.split("-")[1]}var it={top:"auto",right:"auto",bottom:"auto",left:"auto"};function nt(e,t){var i=e.x,n=e.y,s=t.devicePixelRatio||1;return{x:Re(i*s)/s||0,y:Re(n*s)/s||0}}function st(e){var t,i=e.popper,n=e.popperRect,s=e.placement,r=e.variation,o=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,d=e.roundOffsets,p=e.isFixed,u=o.x,h=void 0===u?0:u,g=o.y,f=void 0===g?0:g,m="function"==typeof d?d({x:h,y:f}):{x:h,y:f};h=m.x,f=m.y;var b=o.hasOwnProperty("x"),v=o.hasOwnProperty("y"),y=de,_=ae,w=window;if(c){var x=Ve(i),k="clientHeight",A="clientWidth";if(x===ke(i)&&"static"!==Be(x=qe(i)).position&&"absolute"===a&&(k="scrollHeight",A="scrollWidth"),s===ae||(s===de||s===ce)&&r===ge)_=le,f-=(p&&x===w&&w.visualViewport?w.visualViewport.height:x[k])-n.height,f*=l?1:-1;if(s===de||(s===ae||s===le)&&r===ge)y=ce,h-=(p&&x===w&&w.visualViewport?w.visualViewport.width:x[A])-n.width,h*=l?1:-1}var S,O=Object.assign({position:a},c&&it),E=!0===d?nt({x:h,y:f},ke(i)):{x:h,y:f};return h=E.x,f=E.y,l?Object.assign({},O,((S={})[_]=v?"0":"",S[y]=b?"0":"",S.transform=(w.devicePixelRatio||1)<=1?"translate("+h+"px, "+f+"px)":"translate3d("+h+"px, "+f+"px, 0)",S)):Object.assign({},O,((t={})[_]=v?f+"px":"",t[y]=b?h+"px":"",t.transform="",t))}function rt(e){var t=e.state,i=e.options,n=i.gpuAcceleration,s=void 0===n||n,r=i.adaptive,o=void 0===r||r,a=i.roundOffsets,l=void 0===a||a,c={placement:Te(t.placement),variation:tt(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,st(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,st(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var ot={passive:!0};function at(e){var t=e.state,i=e.instance,n=e.options,s=n.scroll,r=void 0===s||s,o=n.resize,a=void 0===o||o,l=ke(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&c.forEach(function(e){e.addEventListener("scroll",i.update,ot)}),a&&l.addEventListener("resize",i.update,ot),function(){r&&c.forEach(function(e){e.removeEventListener("scroll",i.update,ot)}),a&&l.removeEventListener("resize",i.update,ot)}}var lt={left:"right",right:"left",bottom:"top",top:"bottom"};function ct(e){return e.replace(/left|right|bottom|top/g,function(e){return lt[e]})}var dt={start:"end",end:"start"};function pt(e){return e.replace(/start|end/g,function(e){return dt[e]})}function ut(e){var t=ke(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function ht(e){return Ne(qe(e)).left+ut(e).scrollLeft}function gt(e,t){var i=ke(e),n=qe(e),s=i.visualViewport,r=n.clientWidth,o=n.clientHeight,a=0,l=0;if(s){r=s.width,o=s.height;var c=Pe();(c||!c&&"fixed"===t)&&(a=s.offsetLeft,l=s.offsetTop)}return{width:r,height:o,x:a+ht(e),y:l}}function ft(e){var t,i=qe(e),n=ut(e),s=null==(t=e.ownerDocument)?void 0:t.body,r=Ie(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=Ie(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-n.scrollLeft+ht(e),l=-n.scrollTop;return"rtl"===Be(s||i).direction&&(a+=Ie(i.clientWidth,s?s.clientWidth:0)-r),{width:r,height:o,x:a,y:l}}function mt(e){var t=Be(e),i=t.overflow,n=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+s+n)}function bt(e){return["html","body","#document"].indexOf(xe(e))>=0?e.ownerDocument.body:Se(e)&&mt(e)?e:bt(ze(e))}function vt(e,t){var i;void 0===t&&(t=[]);var n=bt(e),s=n===(null==(i=e.ownerDocument)?void 0:i.body),r=ke(n),o=s?[r].concat(r.visualViewport||[],mt(n)?n:[]):n,a=t.concat(o);return s?a:a.concat(vt(ze(o)))}function yt(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function _t(e,t){var i=Ne(e,!1,"fixed"===t);return i.top=i.top+e.clientTop,i.left=i.left+e.clientLeft,i.bottom=i.top+e.clientHeight,i.right=i.left+e.clientWidth,i.width=e.clientWidth,i.height=e.clientHeight,i.x=i.left,i.y=i.top,i}function wt(e,t,i){return t===me?yt(gt(e,i)):Ae(t)?_t(t,i):yt(ft(qe(e)))}function xt(e){var t=vt(ze(e)),i=["absolute","fixed"].indexOf(Be(e).position)>=0&&Se(e)?Ve(e):e;return Ae(i)?t.filter(function(e){return Ae(e)&&Fe(e,i)&&"body"!==xe(e)}):[]}function kt(e,t,i,n){var s="clippingParents"===t?xt(e):[].concat(t),r=[].concat(s,[i]),o=r[0],a=r.reduce(function(t,i){var s=wt(e,i,n);return t.top=Ie(s.top,t.top),t.right=Le(s.right,t.right),t.bottom=Le(s.bottom,t.bottom),t.left=Ie(s.left,t.left),t},wt(e,o,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function At(e){var t,i=e.reference,n=e.element,s=e.placement,r=s?Te(s):null,o=s?tt(s):null,a=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(r){case ae:t={x:a,y:i.y-n.height};break;case le:t={x:a,y:i.y+i.height};break;case ce:t={x:i.x+i.width,y:l};break;case de:t={x:i.x-n.width,y:l};break;default:t={x:i.x,y:i.y}}var c=r?We(r):null;if(null!=c){var d="y"===c?"height":"width";switch(o){case he:t[c]=t[c]-(i[d]/2-n[d]/2);break;case ge:t[c]=t[c]+(i[d]/2-n[d]/2)}}return t}function St(e,t){void 0===t&&(t={});var i=t,n=i.placement,s=void 0===n?e.placement:n,r=i.strategy,o=void 0===r?e.strategy:r,a=i.boundary,l=void 0===a?fe:a,c=i.rootBoundary,d=void 0===c?me:c,p=i.elementContext,u=void 0===p?be:p,h=i.altBoundary,g=void 0!==h&&h,f=i.padding,m=void 0===f?0:f,b=Ke("number"!=typeof m?m:Je(m,ue)),v=u===be?ve:be,y=e.rects.popper,_=e.elements[g?v:u],w=kt(Ae(_)?_:_.contextElement||qe(e.elements.popper),l,d,o),x=Ne(e.elements.reference),k=At({reference:x,element:y,placement:s}),A=yt(Object.assign({},y,k)),S=u===be?A:x,O={top:w.top-S.top+b.top,bottom:S.bottom-w.bottom+b.bottom,left:w.left-S.left+b.left,right:S.right-w.right+b.right},E=e.modifiersData.offset;if(u===be&&E){var $=E[s];Object.keys(O).forEach(function(e){var t=[ce,le].indexOf(e)>=0?1:-1,i=[ae,le].indexOf(e)>=0?"y":"x";O[e]+=$[i]*t})}return O}function Ot(e,t){void 0===t&&(t={});var i=t,n=i.placement,s=i.boundary,r=i.rootBoundary,o=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=void 0===l?_e:l,d=tt(n),p=d?a?ye:ye.filter(function(e){return tt(e)===d}):ue,u=p.filter(function(e){return c.indexOf(e)>=0});0===u.length&&(u=p);var h=u.reduce(function(t,i){return t[i]=St(e,{placement:i,boundary:s,rootBoundary:r,padding:o})[Te(i)],t},{});return Object.keys(h).sort(function(e,t){return h[e]-h[t]})}function Et(e){if(Te(e)===pe)return[];var t=ct(e);return[pt(e),t,pt(t)]}function $t(e){var t=e.state,i=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var s=i.mainAxis,r=void 0===s||s,o=i.altAxis,a=void 0===o||o,l=i.fallbackPlacements,c=i.padding,d=i.boundary,p=i.rootBoundary,u=i.altBoundary,h=i.flipVariations,g=void 0===h||h,f=i.allowedAutoPlacements,m=t.options.placement,b=Te(m),v=l||(b===m||!g?[ct(m)]:Et(m)),y=[m].concat(v).reduce(function(e,i){return e.concat(Te(i)===pe?Ot(t,{placement:i,boundary:d,rootBoundary:p,padding:c,flipVariations:g,allowedAutoPlacements:f}):i)},[]),_=t.rects.reference,w=t.rects.popper,x=new Map,k=!0,A=y[0],S=0;S<y.length;S++){var O=y[S],E=Te(O),$=tt(O)===he,C=[ae,le].indexOf(E)>=0,T=C?"width":"height",I=St(t,{placement:O,boundary:d,rootBoundary:p,altBoundary:u,padding:c}),L=C?$?ce:de:$?le:ae;_[T]>w[T]&&(L=ct(L));var R=ct(L),j=[];if(r&&j.push(I[E]<=0),a&&j.push(I[L]<=0,I[R]<=0),j.every(function(e){return e})){A=O,k=!1;break}x.set(O,j)}if(k)for(var P=function(e){var t=y.find(function(t){var i=x.get(t);if(i)return i.slice(0,e).every(function(e){return e})});if(t)return A=t,"break"},N=g?3:1;N>0;N--){if("break"===P(N))break}t.placement!==A&&(t.modifiersData[n]._skip=!0,t.placement=A,t.reset=!0)}}function Ct(e,t,i){return void 0===i&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function Tt(e){return[ae,ce,le,de].some(function(t){return e[t]>=0})}function It(e){var t=e.state,i=e.name,n=t.rects.reference,s=t.rects.popper,r=t.modifiersData.preventOverflow,o=St(t,{elementContext:"reference"}),a=St(t,{altBoundary:!0}),l=Ct(o,n),c=Ct(a,s,r),d=Tt(l),p=Tt(c);t.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":p})}function Lt(e,t,i){var n=Te(e),s=[de,ae].indexOf(n)>=0?-1:1,r="function"==typeof i?i(Object.assign({},t,{placement:e})):i,o=r[0],a=r[1];return o=o||0,a=(a||0)*s,[de,ce].indexOf(n)>=0?{x:a,y:o}:{x:o,y:a}}function Rt(e){var t=e.state,i=e.options,n=e.name,s=i.offset,r=void 0===s?[0,0]:s,o=_e.reduce(function(e,i){return e[i]=Lt(i,t.rects,r),e},{}),a=o[t.placement],l=a.x,c=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=o}function jt(e){var t=e.state,i=e.name;t.modifiersData[i]=At({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}function Pt(e){return"x"===e?"y":"x"}function Nt(e){var t=e.state,i=e.options,n=e.name,s=i.mainAxis,r=void 0===s||s,o=i.altAxis,a=void 0!==o&&o,l=i.boundary,c=i.rootBoundary,d=i.altBoundary,p=i.padding,u=i.tether,h=void 0===u||u,g=i.tetherOffset,f=void 0===g?0:g,m=St(t,{boundary:l,rootBoundary:c,padding:p,altBoundary:d}),b=Te(t.placement),v=tt(t.placement),y=!v,_=We(b),w=Pt(_),x=t.modifiersData.popperOffsets,k=t.rects.reference,A=t.rects.popper,S="function"==typeof f?f(Object.assign({},t.rects,{placement:t.placement})):f,O="number"==typeof S?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),E=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,$={x:0,y:0};if(x){if(r){var C,T="y"===_?ae:de,I="y"===_?le:ce,L="y"===_?"height":"width",R=x[_],j=R+m[T],P=R-m[I],N=h?-A[L]/2:0,D=v===he?k[L]:A[L],F=v===he?-A[L]:-k[L],B=t.elements.arrow,M=h&&B?De(B):{width:0,height:0},q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Qe(),z=q[T],U=q[I],H=Ge(0,k[L],M[L]),V=y?k[L]/2-N-H-z-O.mainAxis:D-H-z-O.mainAxis,W=y?-k[L]/2+N+H+U+O.mainAxis:F+H+U+O.mainAxis,G=t.elements.arrow&&Ve(t.elements.arrow),Y=G?"y"===_?G.clientTop||0:G.clientLeft||0:0,Q=null!=(C=null==E?void 0:E[_])?C:0,K=R+W-Q,J=Ge(h?Le(j,R+V-Q-Y):j,R,h?Ie(P,K):P);x[_]=J,$[_]=J-R}if(a){var Z,X="x"===_?ae:de,ee="x"===_?le:ce,te=x[w],ie="y"===w?"height":"width",ne=te+m[X],se=te-m[ee],re=-1!==[ae,de].indexOf(b),oe=null!=(Z=null==E?void 0:E[w])?Z:0,pe=re?ne:te-k[ie]-A[ie]-oe+O.altAxis,ue=re?te+k[ie]+A[ie]-oe-O.altAxis:se,ge=h&&re?Ye(pe,te,ue):Ge(h?pe:ne,te,h?ue:se);x[w]=ge,$[w]=ge-te}t.modifiersData[n]=$}}function Dt(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Ft(e){return e!==ke(e)&&Se(e)?Dt(e):ut(e)}function Bt(e){var t=e.getBoundingClientRect(),i=Re(t.width)/e.offsetWidth||1,n=Re(t.height)/e.offsetHeight||1;return 1!==i||1!==n}function Mt(e,t,i){void 0===i&&(i=!1);var n=Se(t),s=Se(t)&&Bt(t),r=qe(t),o=Ne(e,s,i),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!i)&&(("body"!==xe(t)||mt(r))&&(a=Ft(t)),Se(t)?((l=Ne(t,!0)).x+=t.clientLeft,l.y+=t.clientTop):r&&(l.x=ht(r))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function qt(e){var t=new Map,i=new Set,n=[];function s(e){i.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!i.has(e)){var n=t.get(e);n&&s(n)}}),n.push(e)}return e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){i.has(e.name)||s(e)}),n}function zt(e){var t=qt(e);return we.reduce(function(e,i){return e.concat(t.filter(function(e){return e.phase===i}))},[])}function Ut(e){var t;return function(){return t||(t=new Promise(function(i){Promise.resolve().then(function(){t=void 0,i(e())})})),t}}function Ht(e){var t=e.reduce(function(e,t){var i=e[t.name];return e[t.name]=i?Object.assign({},i,t,{options:Object.assign({},i.options,t.options),data:Object.assign({},i.data,t.data)}):t,e},{});return Object.keys(t).map(function(e){return t[e]})}var Vt={placement:"bottom",modifiers:[],strategy:"absolute"};function Wt(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return!t.some(function(e){return!(e&&"function"==typeof e.getBoundingClientRect)})}function Gt(e){void 0===e&&(e={});var t=e,i=t.defaultModifiers,n=void 0===i?[]:i,s=t.defaultOptions,r=void 0===s?Vt:s;return function(e,t,i){void 0===i&&(i=r);var s={placement:"bottom",orderedModifiers:[],options:Object.assign({},Vt,r),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},o=[],a=!1,l={state:s,setOptions:function(i){var o="function"==typeof i?i(s.options):i;d(),s.options=Object.assign({},r,s.options,o),s.scrollParents={reference:Ae(e)?vt(e):e.contextElement?vt(e.contextElement):[],popper:vt(t)};var a=zt(Ht([].concat(n,s.options.modifiers)));return s.orderedModifiers=a.filter(function(e){return e.enabled}),c(),l.update()},forceUpdate:function(){if(!a){var e=s.elements,t=e.reference,i=e.popper;if(Wt(t,i)){s.rects={reference:Mt(t,Ve(i),"fixed"===s.options.strategy),popper:De(i)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach(function(e){return s.modifiersData[e.name]=Object.assign({},e.data)});for(var n=0;n<s.orderedModifiers.length;n++)if(!0!==s.reset){var r=s.orderedModifiers[n],o=r.fn,c=r.options,d=void 0===c?{}:c,p=r.name;"function"==typeof o&&(s=o({state:s,options:d,name:p,instance:l})||s)}else s.reset=!1,n=-1}}},update:Ut(function(){return new Promise(function(e){l.forceUpdate(),e(s)})}),destroy:function(){d(),a=!0}};if(!Wt(e,t))return l;function c(){s.orderedModifiers.forEach(function(e){var t=e.name,i=e.options,n=void 0===i?{}:i,r=e.effect;if("function"==typeof r){var a=r({state:s,name:t,instance:l,options:n}),c=function(){};o.push(a||c)}})}function d(){o.forEach(function(e){return e()}),o=[]}return l.setOptions(i).then(function(e){!a&&i.onFirstUpdate&&i.onFirstUpdate(e)}),l}}var Yt=Gt({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:at,data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:jt,data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:rt,data:{}},Ce,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Rt},{name:"flip",enabled:!0,phase:"main",fn:$t,requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:Nt,requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:Xe,effect:et,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:It}]}),Qt="tippy-box",Kt="tippy-content",Jt="tippy-backdrop",Zt="tippy-arrow",Xt="tippy-svg-arrow",ei={passive:!0,capture:!0},ti=function(){return document.body};function ii(e,t,i){if(Array.isArray(e)){var n=e[t];return n??(Array.isArray(i)?i[t]:i)}return e}function ni(e,t){var i={}.toString.call(e);return 0===i.indexOf("[object")&&i.indexOf(t+"]")>-1}function si(e,t){return"function"==typeof e?e.apply(void 0,t):e}function ri(e,t){return 0===t?e:function(n){clearTimeout(i),i=setTimeout(function(){e(n)},t)};var i}function oi(e){return e.split(/\s+/).filter(Boolean)}function ai(e){return[].concat(e)}function li(e,t){-1===e.indexOf(t)&&e.push(t)}function ci(e){return e.filter(function(t,i){return e.indexOf(t)===i})}function di(e){return e.split("-")[0]}function pi(e){return[].slice.call(e)}function ui(e){return Object.keys(e).reduce(function(t,i){return void 0!==e[i]&&(t[i]=e[i]),t},{})}function hi(){return document.createElement("div")}function gi(e){return["Element","Fragment"].some(function(t){return ni(e,t)})}function fi(e){return ni(e,"NodeList")}function mi(e){return ni(e,"MouseEvent")}function bi(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function vi(e){return gi(e)?[e]:fi(e)?pi(e):Array.isArray(e)?e:pi(document.querySelectorAll(e))}function yi(e,t){e.forEach(function(e){e&&(e.style.transitionDuration=t+"ms")})}function _i(e,t){e.forEach(function(e){e&&e.setAttribute("data-state",t)})}function wi(e){var t,i=ai(e)[0];return null!=i&&null!=(t=i.ownerDocument)&&t.body?i.ownerDocument:document}function xi(e,t){var i=t.clientX,n=t.clientY;return e.every(function(e){var t=e.popperRect,s=e.popperState,r=e.props.interactiveBorder,o=di(s.placement),a=s.modifiersData.offset;if(!a)return!0;var l="bottom"===o?a.top.y:0,c="top"===o?a.bottom.y:0,d="right"===o?a.left.x:0,p="left"===o?a.right.x:0,u=t.top-n+l>r,h=n-t.bottom-c>r,g=t.left-i+d>r,f=i-t.right-p>r;return u||h||g||f})}function ki(e,t,i){var n=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(t){e[n](t,i)})}function Ai(e,t){for(var i=t;i;){var n;if(e.contains(i))return!0;i=null==i.getRootNode||null==(n=i.getRootNode())?void 0:n.host}return!1}var Si={isTouch:!1},Oi=0;function Ei(){Si.isTouch||(Si.isTouch=!0,window.performance&&document.addEventListener("mousemove",$i))}function $i(){var e=performance.now();e-Oi<20&&(Si.isTouch=!1,document.removeEventListener("mousemove",$i)),Oi=e}function Ci(){var e=document.activeElement;if(bi(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function Ti(){document.addEventListener("touchstart",Ei,ei),window.addEventListener("blur",Ci)}var Ii=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto,Li={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Ri={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},ji=Object.assign({appendTo:ti,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},Li,Ri),Pi=Object.keys(ji),Ni=function(e){Object.keys(e).forEach(function(t){ji[t]=e[t]})};function Di(e){var t=(e.plugins||[]).reduce(function(t,i){var n,s=i.name,r=i.defaultValue;s&&(t[s]=void 0!==e[s]?e[s]:null!=(n=ji[s])?n:r);return t},{});return Object.assign({},e,t)}function Fi(e,t){var i=(t?Object.keys(Di(Object.assign({},ji,{plugins:t}))):Pi).reduce(function(t,i){var n=(e.getAttribute("data-tippy-"+i)||"").trim();if(!n)return t;if("content"===i)t[i]=n;else try{t[i]=JSON.parse(n)}catch(e){t[i]=n}return t},{});return i}function Bi(e,t){var i=Object.assign({},t,{content:si(t.content,[e])},t.ignoreAttributes?{}:Fi(e,t.plugins));return i.aria=Object.assign({},ji.aria,i.aria),i.aria={expanded:"auto"===i.aria.expanded?t.interactive:i.aria.expanded,content:"auto"===i.aria.content?t.interactive?null:"describedby":i.aria.content},i}var Mi=function(){return"innerHTML"};function qi(e,t){e[Mi()]=t}function zi(e){var t=hi();return!0===e?t.className=Zt:(t.className=Xt,gi(e)?t.appendChild(e):qi(t,e)),t}function Ui(e,t){gi(t.content)?(qi(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?qi(e,t.content):e.textContent=t.content)}function Hi(e){var t=e.firstElementChild,i=pi(t.children);return{box:t,content:i.find(function(e){return e.classList.contains(Kt)}),arrow:i.find(function(e){return e.classList.contains(Zt)||e.classList.contains(Xt)}),backdrop:i.find(function(e){return e.classList.contains(Jt)})}}function Vi(e){var t=hi(),i=hi();i.className=Qt,i.setAttribute("data-state","hidden"),i.setAttribute("tabindex","-1");var n=hi();function s(i,n){var s=Hi(t),r=s.box,o=s.content,a=s.arrow;n.theme?r.setAttribute("data-theme",n.theme):r.removeAttribute("data-theme"),"string"==typeof n.animation?r.setAttribute("data-animation",n.animation):r.removeAttribute("data-animation"),n.inertia?r.setAttribute("data-inertia",""):r.removeAttribute("data-inertia"),r.style.maxWidth="number"==typeof n.maxWidth?n.maxWidth+"px":n.maxWidth,n.role?r.setAttribute("role",n.role):r.removeAttribute("role"),i.content===n.content&&i.allowHTML===n.allowHTML||Ui(o,e.props),n.arrow?a?i.arrow!==n.arrow&&(r.removeChild(a),r.appendChild(zi(n.arrow))):r.appendChild(zi(n.arrow)):a&&r.removeChild(a)}return n.className=Kt,n.setAttribute("data-state","hidden"),Ui(n,e.props),t.appendChild(i),i.appendChild(n),s(e.props,e.props),{popper:t,onUpdate:s}}Vi.$$tippy=!0;var Wi=1,Gi=[],Yi=[];function Qi(e,t){var i,n,s,r,o,a,l,c=Bi(e,Object.assign({},ji,Di(ui(t)))),d=!1,p=!1,u=!1,h=!1,g=[],f=ri(K,c.interactiveDebounce),m=Wi++,b=null,v=ci(c.plugins),y={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},_={id:m,reference:e,popper:hi(),popperInstance:b,props:c,state:y,plugins:v,clearDelayTimeouts:le,setProps:ce,setContent:de,show:pe,hide:ue,hideWithInteractivity:he,enable:oe,disable:ae,unmount:ge,destroy:fe};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,e._tippy=_,x._tippy=_;var A=v.map(function(e){return e.fn(_)}),S=e.hasAttribute("aria-expanded");return G(),N(),R(),j("onCreate",[_]),c.showOnCreate&&se(),x.addEventListener("mouseenter",function(){_.props.interactive&&_.state.isVisible&&_.clearDelayTimeouts()}),x.addEventListener("mouseleave",function(){_.props.interactive&&_.props.trigger.indexOf("mouseenter")>=0&&T().addEventListener("mousemove",f)}),_;function O(){var e=_.props.touch;return Array.isArray(e)?e:[e,0]}function E(){return"hold"===O()[0]}function $(){var e;return!(null==(e=_.props.render)||!e.$$tippy)}function C(){return l||e}function T(){var e=C().parentNode;return e?wi(e):document}function I(){return Hi(x)}function L(e){return _.state.isMounted&&!_.state.isVisible||Si.isTouch||r&&"focus"===r.type?0:ii(_.props.delay,e?0:1,ji.delay)}function R(e){void 0===e&&(e=!1),x.style.pointerEvents=_.props.interactive&&!e?"":"none",x.style.zIndex=""+_.props.zIndex}function j(e,t,i){var n;(void 0===i&&(i=!0),A.forEach(function(i){i[e]&&i[e].apply(i,t)}),i)&&(n=_.props)[e].apply(n,t)}function P(){var t=_.props.aria;if(t.content){var i="aria-"+t.content,n=x.id;ai(_.props.triggerTarget||e).forEach(function(e){var t=e.getAttribute(i);if(_.state.isVisible)e.setAttribute(i,t?t+" "+n:n);else{var s=t&&t.replace(n,"").trim();s?e.setAttribute(i,s):e.removeAttribute(i)}})}}function N(){!S&&_.props.aria.expanded&&ai(_.props.triggerTarget||e).forEach(function(e){_.props.interactive?e.setAttribute("aria-expanded",_.state.isVisible&&e===C()?"true":"false"):e.removeAttribute("aria-expanded")})}function D(){T().removeEventListener("mousemove",f),Gi=Gi.filter(function(e){return e!==f})}function F(t){if(!Si.isTouch||!u&&"mousedown"!==t.type){var i=t.composedPath&&t.composedPath()[0]||t.target;if(!_.props.interactive||!Ai(x,i)){if(ai(_.props.triggerTarget||e).some(function(e){return Ai(e,i)})){if(Si.isTouch)return;if(_.state.isVisible&&_.props.trigger.indexOf("click")>=0)return}else j("onClickOutside",[_,t]);!0===_.props.hideOnClick&&(_.clearDelayTimeouts(),_.hide(),p=!0,setTimeout(function(){p=!1}),_.state.isMounted||z())}}}function B(){u=!0}function M(){u=!1}function q(){var e=T();e.addEventListener("mousedown",F,!0),e.addEventListener("touchend",F,ei),e.addEventListener("touchstart",M,ei),e.addEventListener("touchmove",B,ei)}function z(){var e=T();e.removeEventListener("mousedown",F,!0),e.removeEventListener("touchend",F,ei),e.removeEventListener("touchstart",M,ei),e.removeEventListener("touchmove",B,ei)}function U(e,t){V(e,function(){!_.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&t()})}function H(e,t){V(e,t)}function V(e,t){var i=I().box;function n(e){e.target===i&&(ki(i,"remove",n),t())}if(0===e)return t();ki(i,"remove",o),ki(i,"add",n),o=n}function W(t,i,n){void 0===n&&(n=!1),ai(_.props.triggerTarget||e).forEach(function(e){e.addEventListener(t,i,n),g.push({node:e,eventType:t,handler:i,options:n})})}function G(){E()&&(W("touchstart",Q,{passive:!0}),W("touchend",J,{passive:!0})),oi(_.props.trigger).forEach(function(e){if("manual"!==e)switch(W(e,Q),e){case"mouseenter":W("mouseleave",J);break;case"focus":W(Ii?"focusout":"blur",Z);break;case"focusin":W("focusout",Z)}})}function Y(){g.forEach(function(e){var t=e.node,i=e.eventType,n=e.handler,s=e.options;t.removeEventListener(i,n,s)}),g=[]}function Q(e){var t,i=!1;if(_.state.isEnabled&&!X(e)&&!p){var n="focus"===(null==(t=r)?void 0:t.type);r=e,l=e.currentTarget,N(),!_.state.isVisible&&mi(e)&&Gi.forEach(function(t){return t(e)}),"click"===e.type&&(_.props.trigger.indexOf("mouseenter")<0||d)&&!1!==_.props.hideOnClick&&_.state.isVisible?i=!0:se(e),"click"===e.type&&(d=!i),i&&!n&&re(e)}}function K(e){var t=e.target,i=C().contains(t)||x.contains(t);if("mousemove"!==e.type||!i){var n=ne().concat(x).map(function(e){var t,i=null==(t=e._tippy.popperInstance)?void 0:t.state;return i?{popperRect:e.getBoundingClientRect(),popperState:i,props:c}:null}).filter(Boolean);xi(n,e)&&(D(),re(e))}}function J(e){X(e)||_.props.trigger.indexOf("click")>=0&&d||(_.props.interactive?_.hideWithInteractivity(e):re(e))}function Z(e){_.props.trigger.indexOf("focusin")<0&&e.target!==C()||_.props.interactive&&e.relatedTarget&&x.contains(e.relatedTarget)||re(e)}function X(e){return!!Si.isTouch&&E()!==e.type.indexOf("touch")>=0}function ee(){te();var t=_.props,i=t.popperOptions,n=t.placement,s=t.offset,r=t.getReferenceClientRect,o=t.moveTransition,l=$()?Hi(x).arrow:null,c=r?{getBoundingClientRect:r,contextElement:r.contextElement||C()}:e,d={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if($()){var i=I().box;["placement","reference-hidden","escaped"].forEach(function(e){"placement"===e?i.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?i.setAttribute("data-"+e,""):i.removeAttribute("data-"+e)}),t.attributes.popper={}}}},p=[{name:"offset",options:{offset:s}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!o}},d];$()&&l&&p.push({name:"arrow",options:{element:l,padding:3}}),p.push.apply(p,(null==i?void 0:i.modifiers)||[]),_.popperInstance=Yt(c,x,Object.assign({},i,{placement:n,onFirstUpdate:a,modifiers:p}))}function te(){_.popperInstance&&(_.popperInstance.destroy(),_.popperInstance=null)}function ie(){var e,t=_.props.appendTo,i=C();(e=_.props.interactive&&t===ti||"parent"===t?i.parentNode:si(t,[i])).contains(x)||e.appendChild(x),_.state.isMounted=!0,ee()}function ne(){return pi(x.querySelectorAll("[data-tippy-root]"))}function se(e){_.clearDelayTimeouts(),e&&j("onTrigger",[_,e]),q();var t=L(!0),n=O(),s=n[0],r=n[1];Si.isTouch&&"hold"===s&&r&&(t=r),t?i=setTimeout(function(){_.show()},t):_.show()}function re(e){if(_.clearDelayTimeouts(),j("onUntrigger",[_,e]),_.state.isVisible){if(!(_.props.trigger.indexOf("mouseenter")>=0&&_.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&d)){var t=L(!1);t?n=setTimeout(function(){_.state.isVisible&&_.hide()},t):s=requestAnimationFrame(function(){_.hide()})}}else z()}function oe(){_.state.isEnabled=!0}function ae(){_.hide(),_.state.isEnabled=!1}function le(){clearTimeout(i),clearTimeout(n),cancelAnimationFrame(s)}function ce(t){if(!_.state.isDestroyed){j("onBeforeUpdate",[_,t]),Y();var i=_.props,n=Bi(e,Object.assign({},i,ui(t),{ignoreAttributes:!0}));_.props=n,G(),i.interactiveDebounce!==n.interactiveDebounce&&(D(),f=ri(K,n.interactiveDebounce)),i.triggerTarget&&!n.triggerTarget?ai(i.triggerTarget).forEach(function(e){e.removeAttribute("aria-expanded")}):n.triggerTarget&&e.removeAttribute("aria-expanded"),N(),R(),k&&k(i,n),_.popperInstance&&(ee(),ne().forEach(function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})),j("onAfterUpdate",[_,t])}}function de(e){_.setProps({content:e})}function pe(){var e=_.state.isVisible,t=_.state.isDestroyed,i=!_.state.isEnabled,n=Si.isTouch&&!_.props.touch,s=ii(_.props.duration,0,ji.duration);if(!(e||t||i||n||C().hasAttribute("disabled")||(j("onShow",[_],!1),!1===_.props.onShow(_)))){if(_.state.isVisible=!0,$()&&(x.style.visibility="visible"),R(),q(),_.state.isMounted||(x.style.transition="none"),$()){var r=I();yi([r.box,r.content],0)}a=function(){var e;if(_.state.isVisible&&!h){if(h=!0,x.offsetHeight,x.style.transition=_.props.moveTransition,$()&&_.props.animation){var t=I(),i=t.box,n=t.content;yi([i,n],s),_i([i,n],"visible")}P(),N(),li(Yi,_),null==(e=_.popperInstance)||e.forceUpdate(),j("onMount",[_]),_.props.animation&&$()&&H(s,function(){_.state.isShown=!0,j("onShown",[_])})}},ie()}}function ue(){var e=!_.state.isVisible,t=_.state.isDestroyed,i=!_.state.isEnabled,n=ii(_.props.duration,1,ji.duration);if(!(e||t||i)&&(j("onHide",[_],!1),!1!==_.props.onHide(_))){if(_.state.isVisible=!1,_.state.isShown=!1,h=!1,d=!1,$()&&(x.style.visibility="hidden"),D(),z(),R(!0),$()){var s=I(),r=s.box,o=s.content;_.props.animation&&(yi([r,o],n),_i([r,o],"hidden"))}P(),N(),_.props.animation?$()&&U(n,_.unmount):_.unmount()}}function he(e){T().addEventListener("mousemove",f),li(Gi,f),f(e)}function ge(){_.state.isVisible&&_.hide(),_.state.isMounted&&(te(),ne().forEach(function(e){e._tippy.unmount()}),x.parentNode&&x.parentNode.removeChild(x),Yi=Yi.filter(function(e){return e!==_}),_.state.isMounted=!1,j("onHidden",[_]))}function fe(){_.state.isDestroyed||(_.clearDelayTimeouts(),_.unmount(),Y(),delete e._tippy,_.state.isDestroyed=!0,j("onDestroy",[_]))}}function Ki(e,t){void 0===t&&(t={});var i=ji.plugins.concat(t.plugins||[]);Ti();var n=Object.assign({},t,{plugins:i}),s=vi(e).reduce(function(e,t){var i=t&&Qi(t,n);return i&&e.push(i),e},[]);return gi(e)?s[0]:s}function Ji(e){return e.replace(/(?:^\w|[A-Z]|\b\w)/g,(e,t)=>0===+e?"":0===t?e.toLowerCase():e.toUpperCase()).replace("-","")}Ki.defaultProps=ji,Ki.setDefaultProps=Ni,Ki.currentInput=Si,Object.assign({},Ce,{effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow)}}),Ki.setDefaultProps({render:Vi});const Zi='\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: clamp(\n calc(var(--pb-popover-font-size, 1rem) * var(--pb-min-zoom, 0.5)), \n calc(var(--pb-popover-font-size, 1rem) * var(--pb-zoom-factor)), \n calc(var(--pb-popover-font-size, 1rem) * var(--pb-max-zoom, 3.0))\n );\n line-height: calc(var(--pb-popover-line-height, 1.5) * var(--pb-zoom-factor));\n\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',Xi='\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',en="\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 }",tn="\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",nn="\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 sn=Object.freeze({__proto__:null,base:Zi,camelize:Ji,light:en,lightBorder:Xi,material:tn,translucent:nn});function rn(e,t,i){if(!e.querySelector(`#pb-popover-${t}`)){const n=e.nodeType===Node.DOCUMENT_NODE?document.head:e;console.log("Loading tippy styles for theme %s into %o",t,n);const s=document.createElement("style");s.type="text/css",s.id=`pb-popover-${t}`,s.innerHTML=i,n.appendChild(s)}}function on(e,t){if(rn(e,"base",Zi),t&&"none"!==t){const i=Ji(t),n=sn[i];n&&rn(e,i,n)}}class an extends(o(s)){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?t`<div class="hidden"><slot></slot></div>`:t`<span id="link" part="trigger" class="${this.persistent?"persistent":""}"
|
|
134
134
|
><slot name="default"><slot></slot></slot></span
|
|
135
135
|
><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=e(this,"--pb-popover-theme","none")),this.placement||(this.placement=e(this,"--pb-popover-placement","auto")),this.fallbackPlacement||(this.fallbackPlacement=e(this,"--pb-popover-fallback-placement",null)),this.persistent||(this.persistent=e(this,"--pb-popover-persistent",!1)),this.trigger||(this.trigger=e(this,"--pb-popover-trigger",null)),!this.touch){const t=e(this,"--pb-popover-touch","hold");this.touch="true"===t||t}}_injectStyles(){this._checkCSSProperties(),on(this.getRootNode(),this.theme)}_getContent(){if(this._content)return this._content;const e=this._getSlot();if(e){const t=document.createElement("div");return e.assignedNodes().forEach(e=>{t.appendChild(e.content?e.content.cloneNode(!0):e.cloneNode(!0))}),this._content=t,t}return null}_getSlot(){return this.for?this.shadowRoot.querySelector("slot"):this.shadowRoot.querySelector("[name=alternate]")}_registerMutationObserver(){const e=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}),e&&e.assignedNodes().forEach(e=>{this._observer.observe(e.content?e.content:e,{subtree:!0,childList:!0,characterData:!0})})}get alternate(){return this._getContent()}set alternate(e){this._content=e,this._tippy&&this._tippy.setContent(this._content)}command(e,t){"disable"===e&&(this.disabled=t,this._tippy&&(t?this._tippy.disable():this._tippy.enable()))}firstUpdated(){super.firstUpdated(),this._injectStyles(),this._registerMutationObserver(),this.trigger||(this.trigger=this.persistent?"click":"mouseenter");const e=this.getRootNode();let t;if(this.for?(t=e.getElementById(this.for),t||console.error("<pb-popover> target element %s not found",this.for)):t=this.shadowRoot.getElementById("link"),t){const i={allowHTML:!0,appendTo:e.nodeType===Node.DOCUMENT_NODE?document.body:e,placement:this.placement,interactive:!0,ignoreAttributes:!0,boundary:"viewport",maxWidth:"none",touch:this.touch,hideOnClick:!1,trigger:this.trigger};if(this.stopPropagation&&(i.onTrigger=(e,t)=>{t.stopPropagation()}),this.persistent&&(i.onClickOutside=(e,t)=>{e.hideWithInteractivity(t)}),this.theme&&"none"!==this.theme&&(i.theme=this.theme),this.fallbackPlacement){const e=this.fallbackPlacement.split(" ");i.popperOptions={modifiers:[{name:"flip",options:{fallbackPlacements:e}}]}}this.popupClass&&(i.onCreate=e=>{e.popper.classList.add(this.popupClass)}),i.onShow=e=>{this.remote?this._loadRemoteContent():e.setContent(this._getContent()),this.emitTo("pb-popover-show",{source:this,popup:e})},this._tippy=Ki(t,i)}}_loadRemoteContent(){const e=this.toAbsoluteURL(this.remote);fetch(e,{method:"GET",mode:"cors",credentials:"same-origin"}).then(e=>e.text()).then(e=>{this.alternate=e}).catch(e=>{console.error("<pb-popover> Error retrieving remote content: %o",e)})}static get styles(){return[n`
|
|
136
136
|
:host {
|
|
@@ -797,7 +797,7 @@ import{g as e,x as t,i as n,a as s,r,p as o,w as a,c as l,b as c,E as d,m as p,B
|
|
|
797
797
|
@response="${this._handleContent}"
|
|
798
798
|
@error="${this._handleError}"
|
|
799
799
|
></pb-fetch>
|
|
800
|
-
`]}}customElements.define("pb-view",Sl);const Ol=[0,100],El=[0,100],$l=e=>`${1===e.length?"0":""}${e}`,Cl=(e,t,i)=>Math.max(Math.min(e,i),t),Tl=(e,t)=>Math.floor(Math.random()*(t-e+1))+e,Il=(e,t,i)=>{const n=Tl(e,t);for(let s=0;s<(null==i?void 0:i.length);s++){const r=i[s];if(2===(null==r?void 0:r.length)&&n>=r[0]&&n<=r[1])return Il(e,t,i)}return n},Ll=e=>{const t=e.length;let i=0;for(let n=0;n<t;n++)i=(i<<5)-i+e.charCodeAt(n),i&=i;return i},Rl=(e,t)=>"number"==typeof t?t:e%Math.abs(t[1]-t[0])+t[0],jl=(e,t)=>"number"==typeof e?Cl(Math.abs(e),...t):1===e.length||e[0]===e[1]?Cl(Math.abs(e[0]),...t):[Math.abs(Cl(e[0],...t)),Cl(Math.abs(e[1]),...t)],Pl=(e,t,i)=>(i<0?i+=1:i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e),Nl=(e,t,i)=>{let n,s,r;if(e/=360,i/=100,0===(t/=100))n=s=r=i;else{const o=i<.5?i*(1+t):i+t-i*t,a=2*i-o;n=Pl(a,o,e+1/3),s=Pl(a,o,e),r=Pl(a,o,e-1/3)}return[Math.round(255*n),Math.round(255*s),Math.round(255*r)]},Dl=(e,t,i,n)=>(299*e+587*t+114*i)/1e3>=n,Fl=(e,t,i)=>`hsl(${e}, ${t}%, ${i}%)`,Bl=(e,t,i,n)=>"rgb"===n?`rgb(${e}, ${t}, ${i})`:`#${$l(e.toString(16))}${$l(t.toString(16))}${$l(i.toString(16))}`,Ml=(e,{format:t="hex",saturation:i=[50,55],lightness:n=[50,60],differencePoint:s=130}={})=>{const r=Math.abs(Ll(String(e))),o=Rl(r,[0,360]),a=Rl(r,jl(i,Ol)),l=Rl(r,jl(n,El)),[c,d,p]=Nl(o,a,l);return{color:"hsl"===t?Fl(o,a,l):Bl(c,d,p,t),isLight:Dl(c,d,p,s)}};function ql(e,t){let i=e;for(;i.parentNode!==t;)i=i.parentElement;return i}function zl(e){let t=e;t.nodeType===Node.TEXT_NODE&&(t=t.parentNode);const i=t.getAttribute("href");return i&&/^#fn_.*$/.test(i)}function Ul(e,t,i){const n=document.createTreeWalker(e);for(n.currentNode=t;n.previousNode();){const e=n.currentNode;e.nodeType===Node.ELEMENT_NODE||zl(e)||(i+=e.textContent.length)}return i}function Hl(e,t,i="start"){if(e.nodeType===Node.ELEMENT_NODE){const n=e.closest("[data-tei]");if(0===t)return{parent:n.getAttribute("data-tei"),offset:0};const s=n.childNodes[t];return{parent:n.getAttribute("data-tei"),offset:"end"===i?Ul(n,s,0)-1:Ul(n,s,0)}}const n=e.parentNode.closest("[data-tei]");if(n)return{parent:n.getAttribute("data-tei"),offset:Ul(n,e,t)};console.error("No container with data-tei found for %o",e.parentNode)}function Vl(e,t){let i=0,n=e.parentNode;for(;n&&n!==e.getRootNode();)n.classList.contains(t)&&(i+=1),n=n.parentNode;return i}function Wl(e,t){const i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);return i.currentNode=t,i.nextNode()?i.currentNode:t}function Gl(e,t){let i=t;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();)if(!zl(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 Yl(e,t,i,n=3){let s=t-1,r=0;for(;s>=0;){if(/[\p{P}\s]/.test(e.charAt(s))){for(;s>1&&/[\p{P}\s]/.test(e.charAt(s-1));)s-=1;if(r+=1,r===n)break}s-=1}let o=i+1;for(r=0;o<e.length;){if(/[\p{P}\s]/.test(e.charAt(o))){for(;o<e.length-1&&/[\p{P}\s]/.test(e.charAt(o+1));)o+=1;if(r+=1,r===n)break}o+=1}return`... ${e.substring(s,t)}<mark>${e.substring(t,i)}</mark>${e.substring(i,o+1)} ...`}function Ql(e){let t=e.parentElement;t.textContent.length<40&&(t=t.parentNode);const i=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let n=0,s=0;const r=[];for(;i.nextNode();)i.currentNode===e&&(s=n),n+=i.currentNode.textContent.length,r.push(i.currentNode.textContent);return[r.join(""),s]}function Kl(e){const t={};return Object.keys(e.properties).forEach(i=>{const n=e.properties[i];n&&n.length>0&&(t[i]=n)}),Object.assign(e,{properties:t})}Ml.random=({format:e="hex",saturation:t=[50,55],lightness:i=[50,60],differencePoint:n=130,excludeHue:s}={})=>{t=jl(t,Ol),i=jl(i,El);const r=s?Il(0,359,s):Tl(0,359),o="number"==typeof t?t:Tl(...t),a="number"==typeof i?i:Tl(...i),[l,c,d]=Nl(r,o,a);return{color:"hsl"===e?Fl(r,o,a):Bl(l,c,d,e),isLight:Dl(l,c,d,n)}};class Jl extends Sl{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=[],this._disabled=!1}connectedCallback(){super.connectedCallback(),this.fill=0;let e=!1;this._inHandler=!1,this._pendingCallback=null;const t=(e=10)=>{this._pendingCallback=setTimeout(()=>{this._selectionChanged()},e)};this._eventHandler=i=>{if("selectionchange"===i.type||this._inHandler)return;if("mousedown"===i.type&&(e=!0),"mouseup"===i.type&&(e=!1),e)return;this._cancelPendingCallback();const n="mouseup"===i.type?10:100;t(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",e=>this.addAnnotation(e.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.addEventListener("pb-disable",()=>{this._disabled=!0}),this.addEventListener("pb-enable",()=>{this._disabled=!1}),this._resizeHandler()}get annotations(){return this._ranges}set annotations(e){this._ranges=e,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 e=this._history.pop();this._clearMarkers(),this._ranges=JSON.parse(e),this._rangesMap.clear(),this._refresh(),this.emitTo("pb-annotations-changed",{ranges:this._ranges}),this.emitTo("pb-annotations-history",this._history)}clearHistory(e){this._history=e||[]}firstUpdated(){super.firstUpdated(),this.enableScrollbar(!1),on(this.shadowRoot,"light-border")}render(){return[...super.render(),t`<div id="marker-layer"></div>`]}zoom(e){super.zoom(e),window.requestAnimationFrame(()=>this.refreshMarkers())}getKey(e){return this.keyMap[e]||this.key}_resizeHandler(){let e=null;const t=()=>{e=setTimeout(()=>{e=null,this.refreshMarkers()},200)};window.addEventListener("resize",()=>{e||this._clearMarkers(),e&&clearTimeout(e),t()})}_refresh(e){super._refresh(e),e&&e.detail&&e.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(e,t=!1,i=!1){const n=this.shadowRoot.getElementById("view"),s=Array.from(n.querySelectorAll(`[data-tei="${e.context}"]`)).filter(e=>null===e.closest("pb-popover")&&"footnote"!==e.getAttribute("rel"))[0];if(!s)return null;const r=document.createRange(),o=Gl(s,e.start),a=Gl(s,e.end);if(!o||!a)return console.error("<pb-view-annotate> Invalid range for %o",s),null;if(console.log("<pb-view-annotate> Range before adjust: %o %o",o,a),o[1]===o[0].textContent.length){const e=Wl(s,o[0]);e===a[0]?(r.setStart(e,0),o[0]=e,o[1]=0):r.setStartBefore(o[0].nextSibling||e)}else o[0]!==a[0]&&0===o[1]?r.setStartBefore(ql(o[0],s)):r.setStart(o[0],o[1]);o[0]!==a[0]&&a[0].textContent.length-1===a[1]?r.setEndAfter(ql(a[0],s)):r.setEnd(a[0],a[1]),console.log("<pb-view-annotate> Range: %o",r);const l=document.createElement("span"),c=""===e.properties[this.getKey(e.type)]?"incomplete":"";l.className=`annotation annotation-${e.type} ${e.type} ${c} ${e.before?"before":""}`,l.dataset.type=e.type,l.dataset.annotation=JSON.stringify(e.properties);try{r.surroundContents(l)}catch(e){if(t)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,e),i||this.refreshMarkers(),l}updateAnnotations(e=!1){this._ranges.forEach(t=>{let i;switch(t.type){case"delete":i=this.shadowRoot.querySelector(`[data-tei="${t.node}"]`),i?this._deleteAnnotation(i):console.error("Annotation %s not found",t.context);break;case"modify":if(i=this.shadowRoot.querySelector(`[data-tei="${t.node}"]`),!i){console.error("<pb-view-annotate> Target node not found for %o",t.node);break}i.dataset.annotation=JSON.stringify(t.properties);break;default:this._updateAnnotation(t,e,!0)}}),window.requestAnimationFrame(()=>this.refreshMarkers())}_getSelection(){return this.shadowRoot.getSelection?this.shadowRoot.getSelection():window.getSelection()}_selectionChanged(){if(this._disabled)return;const e=this._getSelection(),t=this._selectedRange(e);if(t){let i=!1;const n=t.commonAncestorContainer;if(n.nodeType===Node.ELEMENT_NODE){if(t.startContainer.parentElement!==n){const e=ql(t.startContainer,n);t.setStartBefore(e),i=!0}if(t.endContainer.parentElement!==n){const e=ql(t.endContainer,n);t.setEndAfter(e),i=!0}}this._markSelection(t),this._currentSelection=t,console.log("<pb-view-annotate> selection: %o",t),i&&setTimeout(()=>{this._inHandler=!0;try{e.removeAllRanges(),e.addRange(t)}finally{this._inHandler=!1}},100),this.emitTo("pb-selection-changed",{hasContent:!0,range:t,selected:e.toString()})}else this._clearSelection(),this.emitTo("pb-selection-changed",{hasContent:!1})}_markSelection(e){const t=this.shadowRoot.getElementById("view").getBoundingClientRect(),i=this.shadowRoot.getElementById("marker-layer");this._clearSelection();const n=e.getClientRects();for(let e=0;e<n.length;e++){const s=n[e],r=document.createElement("div");r.className="selection-marker",r.style.position="absolute",r.style.left=s.left-t.left+"px",r.style.top=s.top-t.top+"px",r.style.width=`${s.width}px`,r.style.height=`${s.height}px`,r.style.backgroundColor="var(--pb-annotation-selection, #f9ea7678)",i.appendChild(r)}}_clearSelection(){const e=this.shadowRoot.getElementById("marker-layer");e.querySelectorAll(".selection-marker").forEach(t=>{e.removeChild(t)})}updateAnnotation(e,t=!1){e=Kl(e);const i=this._updateAnnotation(e,t);return i&&(this._ranges.push(e),this.emitTo("pb-annotations-changed",{type:e.type,text:e.text,ranges:this._ranges})),i}addAnnotation(e){const t=e.range||this._currentSelection;if(t.collapsed&&!e.before)return null;const i=Hl(t.startContainer,t.startOffset),n=Hl(t.endContainer,t.endOffset,"end"),s={context:i.parent,start:"after"===e.position?n.offset:i.offset,end:void 0===e||"before"===e.position?i.offset:n.offset,text:e.before?"":t.cloneContents().textContent,before:e.before};return e.type&&(s.type=e.type),e.properties&&(s.properties=e.properties),console.log("<pb-view-annotate> range adjusted: %o",s),this._ranges.push(Kl(s)),this.emitTo("pb-annotations-changed",{type:s.type,text:s.text,ranges:this._ranges}),this._checkAnnotationColor(s.type),this._updateAnnotation(s)}deleteAnnotation(e){if(e.dataset.tei){const t=this._ranges.findIndex(t=>"modify"===t.type&&t.node===e.dataset.tei);t>-1&&this._ranges.splice(t,1);const i=e.parentNode.closest("[data-tei]"),n={type:"delete",node:e.dataset.tei,context:i.dataset.tei};this._ranges.push(n)}else{const t=this._rangesMap.get(e);this._rangesMap.delete(e);const i=this._ranges.indexOf(t);console.log("<pb-view-annotate> deleting annotation %o",t),this._ranges.splice(i,1)}this._deleteAnnotation(e)}_deleteAnnotation(e){const t=document.createRange();for(let i=0;i<e.childNodes.length;i++){const n=e.childNodes[i].cloneNode(!0);e.parentNode.insertBefore(n,e),0===i&&t.setStartBefore(n),i===e.childNodes.length-1&&t.setEndAfter(n)}e.parentNode.removeChild(e),this.emitTo("pb-annotations-changed",{ranges:this._ranges}),window.requestAnimationFrame(()=>this.refreshMarkers()),this._inHandler=!0;try{const e=this._getSelection();e.removeAllRanges(),e.addRange(t)}catch(e){console.error("<pb-view-annotate> %s",e.message)}finally{this._inHandler=!1}}editAnnotation(e,t){if(e.dataset.tei){const i=e.closest("[data-tei]");let n=this._ranges.find(t=>"modify"===t.type&&t.node===e.dataset.tei);n||(n={type:"modify",node:e.dataset.tei,context:i.dataset.tei},this._ranges.push(n)),n.properties=t,n=Kl(n),this.emitTo("pb-annotations-changed",{ranges:this._ranges})}else{let i=this._rangesMap.get(e);i?(i.properties=t,i=Kl(i),this.emitTo("pb-annotations-changed",{ranges:this._ranges})):console.error("no range found for edit span %o",e)}const i=JSON.parse(e.dataset.annotation),n=Object.assign(i||{},t);e.dataset.annotation=JSON.stringify(n),""!==n[this.getKey(e.dataset.type)]&&e.classList.remove("incomplete")}_editAnnotation(e){this.editAnnotation(e.detail.target,e.detail.properties)}_selectedRange(e){if(!e||0===e.rangeCount)return null;if(e.anchorNode.getRootNode()!==this.shadowRoot)return null;const t=e.getRangeAt(0);return t.collapsed?null:t}_cancelPendingCallback(){this._pendingCallback&&(clearTimeout(this._pendingCallback),this._pendingCallback=null)}_createTooltip(e){if(e._tippy||!e.dataset.annotation)return;const t=document.createElement("div");t.className="annotation-popup";const i=document.createElement("div");i.className="info",t.appendChild(i);const n=document.createElement("div");n.className="toolbar";const s=document.createElement("span");if(s.className="annotation-type",n.appendChild(s),e.dataset.annotation){const t=document.createElement("pb-icon-button");t.setAttribute("icon","icons:create"),t.setAttribute("title",f("annotations.edit")),t.addEventListener("click",()=>{const t=JSON.parse(e.dataset.annotation),i=e.textContent;this.emitTo("pb-annotation-edit",{target:e,type:e.dataset.type,properties:t,text:i})}),n.appendChild(t)}const r=document.createElement("pb-icon-button");r.setAttribute("icon","icons:delete"),r.setAttribute("title",f("annotations.delete")),r.addEventListener("click",()=>{this.saveHistory(),this.deleteAnnotation(e)}),n.appendChild(r),t.appendChild(n);const o=this.shadowRoot.getElementById("view");Ki(e,{content:t,allowHTML:!0,interactive:!0,appendTo:o.nodeType===Node.DOCUMENT_NODE?document.body:o,theme:"light-border",hideOnClick:!1,maxWidth:"auto",trigger:"click",placement:"left",popperOptions:{modifiers:[{name:"flip",options:{fallbackPlacements:["right","top","bottom"]}}]},onTrigger:(n,r)=>{r.preventDefault(),r.stopPropagation();const{type:o}=e.dataset,a=JSON.parse(e.dataset.annotation)||{},l=this._annotationColors.get(o);if(s.innerHTML=o,s.style.backgroundColor=`var(--pb-annotation-${o})`,s.style.color=`var(${l&&l.isLight?"--pb-color-primary":"--pb-color-inverse"})`,a[this.getKey(o)])this.emitTo("pb-annotation-detail",{type:o,id:a[this.getKey(o)],container:i,span:e,ready:()=>n.setContent(t)});else{i.innerHTML="";const e=Object.keys(a);if(0===e.length){const e=document.createElement("p");e.innerHTML=f("annotations.no-properties"),i.appendChild(e)}else{const t=document.createElement("table");e.forEach(e=>{const i=document.createElement("tr"),n=document.createElement("td");n.innerHTML=e,i.appendChild(n);const s=document.createElement("td");s.innerHTML=JSON.stringify(a[e],null,2),i.appendChild(s),t.appendChild(i)}),i.appendChild(t)}}},onClickOutside:(e,t)=>{e.hideWithInteractivity(t)}})}_showMarker(e,t,i,n=0){const s=e.getClientRects(),{type:r}=e.dataset;if(!e.classList.contains("before"))for(let e=0;e<s.length;e++){const o=s[e],a=document.createElement("div");a.className=`marker annotation-${r}`,a.style.position="absolute",a.style.left=o.left-i.left+"px",a.style.top=`${o.top-i.top+o.height}px`,a.style.marginTop=`${n}px`,a.style.width=`${o.width}px`,a.style.height="3px",a.style.backgroundColor=`var(--pb-annotation-${r})`,a.part="annotation",t.appendChild(a)}this._createTooltip(e)}_clearMarkers(){this.shadowRoot.getElementById("marker-layer").innerHTML=""}refreshMarkers(){const e=this.shadowRoot.getElementById("view"),t=e.getBoundingClientRect(),i=this.shadowRoot.getElementById("marker-layer");i.style.display="none",this._clearMarkers(),e.querySelectorAll(".annotation").forEach(e=>{e._tippy&&e._tippy.destroy(),this._showMarker(e,i,t,5*Vl(e,"annotation"))}),i.style.display="block"}search(e,t){function i(e){let t=e.replace(/[/.?+*\\]/g,e=>`\\${e}`).replace(/[\s\n\t]+/g,"\\s+");return/^\w/.test(t)&&(t=`\\b${t}`),/\w$/.test(t)&&(t=`${t}\\b`),t}function n(e){return e.nodeType===Node.TEXT_NODE?NodeFilter.FILTER_ACCEPT:e.classList.contains("annotation-popup")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}n.acceptNode=n;const s=[];if(!t||0===t.length)return s;const r=t.filter(e=>e&&e.length>0).map(e=>i(e)).join("|");console.log(`<pb-view-annotate> Searching content for ${r}...`);const o=new RegExp(r,this.caseSensitive?"g":"gi"),a=document.createTreeWalker(this.shadowRoot.getElementById("view"),NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,n);for(;a.nextNode();){const t=a.currentNode,i=Array.from(t.textContent.matchAll(o));for(const n of i){const i=n.index+n[0].length;let r=!1,o=null;const a=t.parentNode.dataset.annotation,l=t.parentNode.dataset.type;if(a&&l){r=l===e,o=(JSON.parse(a)||{})[this.getKey(e)]}const c=Hl(t,n.index),d=Hl(t,i,"end"),[p,u]=Ql(t),h={annotated:r,context:c.parent,start:c.offset,end:d.offset,textNode:t,kwic:Yl(p,u+n.index,u+i)};h[this.getKey(e)]=o,s.push(h)}}return s}scrollTo(e){const t=this.shadowRoot.getElementById("view"),i=document.createRange();if(e.annotated)i.selectNode(e.textNode);else{const n=Array.from(t.querySelectorAll(`[data-tei="${e.context}"]`)).filter(e=>null===e.closest("pb-popover")&&"footnote"!==e.getAttribute("rel"))[0],s=Gl(n,e.start),r=Gl(n,e.end);i.setStart(s[0],s[1]),i.setEnd(r[0],r[1])}const n=t.getBoundingClientRect(),s=i.getBoundingClientRect();let r=t.querySelector("[part=highlight]");r||(r=document.createElement("div"),r.part="highlight",r.style.position="absolute",t.appendChild(r)),r.style.left=s.left-n.left-4+"px",r.style.top=s.top-n.top-4+"px",r.style.width=`${s.width+4}px`,r.style.height=`${s.height}px`,i.startContainer.parentNode.scrollIntoView(!0)}hideMarker(){const e=this.shadowRoot.getElementById("view").querySelector("[part=highlight]");e&&(e.style.top="-1000px")}_markIncompleteAnnotations(){this.shadowRoot.getElementById("view").querySelectorAll(".annotation.authority").forEach(e=>{if(e.dataset.type){const t=JSON.parse(e.dataset.annotation),i=this.getKey(e.dataset.type);t[i]&&0!==t[i].length?e.classList.remove("incomplete"):e.classList.add("incomplete")}})}_initAnnotationColors(){this._annotationColors=new Map;const e=new Set;this.shadowRoot.getElementById("view").querySelectorAll(".annotation").forEach(t=>{t.dataset.type&&e.add(t.dataset.type)}),e.forEach(e=>{this._annotationColors.set(e,Ml(`annotation-${e.repeat(4)}`,{saturation:70,lightness:[30,60]}))}),this.emitTo("pb-annotation-colors",{colors:this._annotationColors})}_checkAnnotationColor(e){this._annotationColors.has(e)||(this._annotationColors.set(e,Ml(`annotation-${e.repeat(4)}`,{saturation:70,lightness:[30,60]})),this._annotationStyles(),this.emitTo("pb-annotation-colors",{colors:this._annotationColors}))}_annotationStyles(){const e=this.shadowRoot.getElementById("view");let t=e.querySelector("_annotation-styles");t&&t.parentNode.removeChild(t);const i=[],n=[];this._annotationColors.forEach((e,t)=>{i.push(`--pb-annotation-${t}: ${e.color};`),i.push(`--pb-annotation-${t}-border: 2px solid var(--pb-annotation-${t});`),n.push(`\n .annotation-${t}::after {\n background-color: var(--pb-annotation-${t});\n border-color: var(--pb-annotation-${t});\n color: var(${e.isLight?"--pb-color-primary":"--pb-color-inverse"});\n }\n .annotation-${t}.incomplete::after {\n background: repeating-linear-gradient(\n 315deg,\n var(--pb-annotation-${t}),\n var(--pb-annotation-${t}) 5px,\n var(${e.isLight?"--pb-annotation-stripes-light":"--pb-annotation-stripes-dark"}) 5px,\n var(${e.isLight?"--pb-annotation-stripes-light":"--pb-annotation-stripes-dark"}) 10px\n );\n color: var(${e.isLight?"--pb-color-primary":"--pb-color-inverse"});\n }\n `)});const s=`\n :host {\n ${i.join("\n")}\n }\n\n ${n.join("\n")}\n `;t=document.createElement("style"),t.className="_annotation-styles",t.innerHTML=s,e.insertBefore(t,e.firstChild)}static get styles(){return[super.styles,n`
|
|
800
|
+
`]}}customElements.define("pb-view",Sl);const Ol=[0,100],El=[0,100],$l=e=>`${1===e.length?"0":""}${e}`,Cl=(e,t,i)=>Math.max(Math.min(e,i),t),Tl=(e,t)=>Math.floor(Math.random()*(t-e+1))+e,Il=(e,t,i)=>{const n=Tl(e,t);for(let s=0;s<(null==i?void 0:i.length);s++){const r=i[s];if(2===(null==r?void 0:r.length)&&n>=r[0]&&n<=r[1])return Il(e,t,i)}return n},Ll=e=>{const t=e.length;let i=0;for(let n=0;n<t;n++)i=(i<<5)-i+e.charCodeAt(n),i&=i;return i},Rl=(e,t)=>"number"==typeof t?t:e%Math.abs(t[1]-t[0])+t[0],jl=(e,t)=>"number"==typeof e?Cl(Math.abs(e),...t):1===e.length||e[0]===e[1]?Cl(Math.abs(e[0]),...t):[Math.abs(Cl(e[0],...t)),Cl(Math.abs(e[1]),...t)],Pl=(e,t,i)=>(i<0?i+=1:i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e),Nl=(e,t,i)=>{let n,s,r;if(e/=360,i/=100,0===(t/=100))n=s=r=i;else{const o=i<.5?i*(1+t):i+t-i*t,a=2*i-o;n=Pl(a,o,e+1/3),s=Pl(a,o,e),r=Pl(a,o,e-1/3)}return[Math.round(255*n),Math.round(255*s),Math.round(255*r)]},Dl=(e,t,i,n)=>(299*e+587*t+114*i)/1e3>=n,Fl=(e,t,i)=>`hsl(${e}, ${t}%, ${i}%)`,Bl=(e,t,i,n)=>"rgb"===n?`rgb(${e}, ${t}, ${i})`:`#${$l(e.toString(16))}${$l(t.toString(16))}${$l(i.toString(16))}`,Ml=(e,{format:t="hex",saturation:i=[50,55],lightness:n=[50,60],differencePoint:s=130}={})=>{const r=Math.abs(Ll(String(e))),o=Rl(r,[0,360]),a=Rl(r,jl(i,Ol)),l=Rl(r,jl(n,El)),[c,d,p]=Nl(o,a,l);return{color:"hsl"===t?Fl(o,a,l):Bl(c,d,p,t),isLight:Dl(c,d,p,s)}};function ql(e,t){let i=e;for(;i.parentNode!==t;)i=i.parentElement;return i}function zl(e){let t=e;t.nodeType===Node.TEXT_NODE&&(t=t.parentNode);const i=t.getAttribute("href");return i&&/^#fn_.*$/.test(i)}function Ul(e,t,i){const n=document.createTreeWalker(e);for(n.currentNode=t;n.previousNode();){const e=n.currentNode;e.nodeType===Node.ELEMENT_NODE||zl(e)||(i+=e.textContent.length)}return i}function Hl(e,t,i="start"){if(e.nodeType===Node.ELEMENT_NODE){const n=e.closest("[data-tei]");if(0===t)return{parent:n.getAttribute("data-tei"),offset:0};const s=n.childNodes[t];return{parent:n.getAttribute("data-tei"),offset:"end"===i?Ul(n,s,0)-1:Ul(n,s,0)}}const n=e.parentNode.closest("[data-tei]");if(n)return{parent:n.getAttribute("data-tei"),offset:Ul(n,e,t)};console.error("No container with data-tei found for %o",e.parentNode)}function Vl(e,t){let i=0,n=e.parentNode;for(;n&&n!==e.getRootNode();)n.classList.contains(t)&&(i+=1),n=n.parentNode;return i}function Wl(e,t){const i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);return i.currentNode=t,i.nextNode()?i.currentNode:t}function Gl(e,t){let i=t;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();)if(!zl(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 Yl(e,t,i,n=3){let s=t-1,r=0;for(;s>=0;){if(/[\p{P}\s]/.test(e.charAt(s))){for(;s>1&&/[\p{P}\s]/.test(e.charAt(s-1));)s-=1;if(r+=1,r===n)break}s-=1}let o=i+1;for(r=0;o<e.length;){if(/[\p{P}\s]/.test(e.charAt(o))){for(;o<e.length-1&&/[\p{P}\s]/.test(e.charAt(o+1));)o+=1;if(r+=1,r===n)break}o+=1}return`... ${e.substring(s,t)}<mark>${e.substring(t,i)}</mark>${e.substring(i,o+1)} ...`}function Ql(e){let t=e.parentElement;t.textContent.length<40&&(t=t.parentNode);const i=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let n=0,s=0;const r=[];for(;i.nextNode();)i.currentNode===e&&(s=n),n+=i.currentNode.textContent.length,r.push(i.currentNode.textContent);return[r.join(""),s]}function Kl(e){const t={};return Object.keys(e.properties).forEach(i=>{const n=e.properties[i];n&&n.length>0&&(t[i]=n)}),Object.assign(e,{properties:t})}Ml.random=({format:e="hex",saturation:t=[50,55],lightness:i=[50,60],differencePoint:n=130,excludeHue:s}={})=>{t=jl(t,Ol),i=jl(i,El);const r=s?Il(0,359,s):Tl(0,359),o="number"==typeof t?t:Tl(...t),a="number"==typeof i?i:Tl(...i),[l,c,d]=Nl(r,o,a);return{color:"hsl"===e?Fl(r,o,a):Bl(l,c,d,e),isLight:Dl(l,c,d,n)}};class Jl extends Sl{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=[],this._disabled=!1}connectedCallback(){super.connectedCallback(),this.fill=0,this.setAttribute("translate","no");let e=!1;this._inHandler=!1,this._pendingCallback=null;const t=(e=10)=>{this._pendingCallback=setTimeout(()=>{this._selectionChanged()},e)};this._eventHandler=i=>{if("selectionchange"===i.type||this._inHandler)return;if("mousedown"===i.type&&(e=!0),"mouseup"===i.type&&(e=!1),e)return;this._cancelPendingCallback();const n="mouseup"===i.type?10:100;t(n)},this._disconnectedSignal=new AbortController,document.addEventListener("selectionchange",this._eventHandler,{signal:this._disconnectedSignal.signal}),this.shadowRoot.addEventListener("mousedown",this._eventHandler,{signal:this._disconnectedSignal.signal}),this.shadowRoot.addEventListener("mouseup",this._eventHandler,{signal:this._disconnectedSignal.signal}),this.subscribeTo("pb-add-annotation",e=>this.addAnnotation(e.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.addEventListener("pb-disable",()=>{this._disabled=!0},{signal:this._disconnectedSignal.signal}),this.addEventListener("pb-enable",()=>{this._disabled=!1},{signal:this._disconnectedSignal.signal}),this._resizeHandler()}disconnectedCallback(){super.disconnectedCallback(),this._disconnectedSignal.abort()}get annotations(){return this._ranges}set annotations(e){this._ranges=e,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 e=this._history.pop();this._clearMarkers(),this._ranges=JSON.parse(e),this._rangesMap.clear(),this._refresh(),this.emitTo("pb-annotations-changed",{ranges:this._ranges}),this.emitTo("pb-annotations-history",this._history)}clearHistory(e){this._history=e||[]}firstUpdated(){super.firstUpdated(),this.enableScrollbar(!1),on(this.shadowRoot,"light-border")}render(){return[...super.render(),t`<div id="marker-layer"></div>`]}zoom(e){super.zoom(e),window.requestAnimationFrame(()=>this.refreshMarkers())}getKey(e){return this.keyMap[e]||this.key}_resizeHandler(){let e=null;const t=()=>{e=setTimeout(()=>{e=null,this.refreshMarkers()},200)};window.addEventListener("resize",()=>{e||this._clearMarkers(),e&&clearTimeout(e),t()})}_refresh(e){super._refresh(e),e&&e.detail&&e.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(e,t=!1,i=!1){const n=this.shadowRoot.getElementById("view"),s=Array.from(n.querySelectorAll(`[data-tei="${e.context}"]`)).filter(e=>null===e.closest("pb-popover")&&"footnote"!==e.getAttribute("rel"))[0];if(!s)return null;const r=document.createRange(),o=Gl(s,e.start),a=Gl(s,e.end);if(!o||!a)return console.error("<pb-view-annotate> Invalid range for %o",s),null;if(console.log("<pb-view-annotate> Range before adjust: %o %o",o,a),o[1]===o[0].textContent.length){const e=Wl(s,o[0]);e===a[0]?(r.setStart(e,0),o[0]=e,o[1]=0):r.setStartBefore(o[0].nextSibling||e)}else o[0]!==a[0]&&0===o[1]?r.setStartBefore(ql(o[0],s)):r.setStart(o[0],o[1]);o[0]!==a[0]&&a[0].textContent.length-1===a[1]?r.setEndAfter(ql(a[0],s)):r.setEnd(a[0],a[1]),console.log("<pb-view-annotate> Range: %o",r);const l=document.createElement("span"),c=""===e.properties[this.getKey(e.type)]?"incomplete":"";l.className=`annotation annotation-${e.type} ${e.type} ${c} ${e.before?"before":""}`,l.dataset.type=e.type,l.dataset.annotation=JSON.stringify(e.properties);try{r.surroundContents(l)}catch(e){if(t)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,e),i||this.refreshMarkers(),l}updateAnnotations(e=!1){this._ranges.forEach(t=>{let i;switch(t.type){case"delete":i=this.shadowRoot.querySelector(`[data-tei="${t.node}"]`),i?this._deleteAnnotation(i):console.error("Annotation %s not found",t.context);break;case"modify":if(i=this.shadowRoot.querySelector(`[data-tei="${t.node}"]`),!i){console.error("<pb-view-annotate> Target node not found for %o",t.node);break}i.dataset.annotation=JSON.stringify(t.properties);break;default:this._updateAnnotation(t,e,!0)}}),window.requestAnimationFrame(()=>this.refreshMarkers())}_getSelection(){return this.shadowRoot.getSelection?this.shadowRoot.getSelection():window.getSelection()}_selectionChanged(){if(this._disabled)return;const e=this._getSelection(),t=this._selectedRange(e);if(t){let i=!1;const n=t.commonAncestorContainer;if(n.nodeType===Node.ELEMENT_NODE){if(t.startContainer.parentElement!==n){const e=ql(t.startContainer,n);t.setStartBefore(e),i=!0}if(t.endContainer.parentElement!==n){const e=ql(t.endContainer,n);t.setEndAfter(e),i=!0}}this._markSelection(t),this._currentSelection=t,console.log("<pb-view-annotate> selection: %o",t),i&&setTimeout(()=>{this._inHandler=!0;try{e.removeAllRanges(),e.addRange(t)}finally{this._inHandler=!1}},100),this.emitTo("pb-selection-changed",{hasContent:!0,range:t,selected:e.toString()})}else this._clearSelection(),this.emitTo("pb-selection-changed",{hasContent:!1})}_markSelection(e){const t=this.shadowRoot.getElementById("view").getBoundingClientRect(),i=this.shadowRoot.getElementById("marker-layer");this._clearSelection();const n=e.getClientRects();for(let e=0;e<n.length;e++){const s=n[e],r=document.createElement("div");r.className="selection-marker",r.style.position="absolute",r.style.left=s.left-t.left+"px",r.style.top=s.top-t.top+"px",r.style.width=`${s.width}px`,r.style.height=`${s.height}px`,r.style.backgroundColor="var(--pb-annotation-selection, #f9ea7678)",i.appendChild(r)}}_clearSelection(){const e=this.shadowRoot.getElementById("marker-layer");e.querySelectorAll(".selection-marker").forEach(t=>{e.removeChild(t)})}updateAnnotation(e,t=!1){e=Kl(e);const i=this._updateAnnotation(e,t);return i&&(this._ranges.push(e),this.emitTo("pb-annotations-changed",{type:e.type,text:e.text,ranges:this._ranges})),i}addAnnotation(e){const t=e.range||this._currentSelection;if(t.collapsed&&!e.before)return null;const i=Hl(t.startContainer,t.startOffset),n=Hl(t.endContainer,t.endOffset,"end"),s={context:i.parent,start:"after"===e.position?n.offset:i.offset,end:void 0===e||"before"===e.position?i.offset:n.offset,text:e.before?"":t.cloneContents().textContent,before:e.before};return e.type&&(s.type=e.type),e.properties&&(s.properties=e.properties),console.log("<pb-view-annotate> range adjusted: %o",s),this._ranges.push(Kl(s)),this.emitTo("pb-annotations-changed",{type:s.type,text:s.text,ranges:this._ranges}),this._checkAnnotationColor(s.type),this._updateAnnotation(s)}deleteAnnotation(e){if(e.dataset.tei){const t=this._ranges.findIndex(t=>"modify"===t.type&&t.node===e.dataset.tei);t>-1&&this._ranges.splice(t,1);const i=e.parentNode.closest("[data-tei]"),n={type:"delete",node:e.dataset.tei,context:i.dataset.tei};this._ranges.push(n)}else{const t=this._rangesMap.get(e);this._rangesMap.delete(e);const i=this._ranges.indexOf(t);console.log("<pb-view-annotate> deleting annotation %o",t),this._ranges.splice(i,1)}this._deleteAnnotation(e)}_deleteAnnotation(e){const t=document.createRange();for(let i=0;i<e.childNodes.length;i++){const n=e.childNodes[i].cloneNode(!0);e.parentNode.insertBefore(n,e),0===i&&t.setStartBefore(n),i===e.childNodes.length-1&&t.setEndAfter(n)}e.parentNode.removeChild(e),this.emitTo("pb-annotations-changed",{ranges:this._ranges}),window.requestAnimationFrame(()=>this.refreshMarkers()),this._inHandler=!0;try{const e=this._getSelection();e.removeAllRanges(),e.addRange(t)}catch(e){console.error("<pb-view-annotate> %s",e.message)}finally{this._inHandler=!1}}editAnnotation(e,t){if(e.dataset.tei){const i=e.closest("[data-tei]");let n=this._ranges.find(t=>"modify"===t.type&&t.node===e.dataset.tei);n||(n={type:"modify",node:e.dataset.tei,context:i.dataset.tei},this._ranges.push(n)),n.properties=t,n=Kl(n),this.emitTo("pb-annotations-changed",{ranges:this._ranges})}else{let i=this._rangesMap.get(e);i?(i.properties=t,i=Kl(i),this.emitTo("pb-annotations-changed",{ranges:this._ranges})):console.error("no range found for edit span %o",e)}const i=JSON.parse(e.dataset.annotation),n=Object.assign(i||{},t);e.dataset.annotation=JSON.stringify(n),""!==n[this.getKey(e.dataset.type)]&&e.classList.remove("incomplete")}_editAnnotation(e){this.editAnnotation(e.detail.target,e.detail.properties)}_selectedRange(e){if(!e||0===e.rangeCount)return null;if(e.anchorNode.getRootNode()!==this.shadowRoot)return null;const t=e.getRangeAt(0);return t.collapsed?null:t}_cancelPendingCallback(){this._pendingCallback&&(clearTimeout(this._pendingCallback),this._pendingCallback=null)}_createTooltip(e){if(e._tippy||!e.dataset.annotation)return;const t=document.createElement("div");t.className="annotation-popup";const i=document.createElement("div");i.className="info",t.appendChild(i);const n=document.createElement("div");n.className="toolbar";const s=document.createElement("span");if(s.className="annotation-type",n.appendChild(s),e.dataset.annotation){const t=document.createElement("pb-icon-button");t.setAttribute("icon","icons:create"),t.setAttribute("title",f("annotations.edit")),t.addEventListener("click",()=>{const t=JSON.parse(e.dataset.annotation),i=e.textContent;this.emitTo("pb-annotation-edit",{target:e,type:e.dataset.type,properties:t,text:i})}),n.appendChild(t)}const r=document.createElement("pb-icon-button");r.setAttribute("icon","icons:delete"),r.setAttribute("title",f("annotations.delete")),r.addEventListener("click",()=>{this.saveHistory(),this.deleteAnnotation(e)}),n.appendChild(r),t.appendChild(n);const o=this.shadowRoot.getElementById("view");Ki(e,{content:t,allowHTML:!0,interactive:!0,appendTo:o.nodeType===Node.DOCUMENT_NODE?document.body:o,theme:"light-border",hideOnClick:!1,maxWidth:"auto",trigger:"click",placement:"left",popperOptions:{modifiers:[{name:"flip",options:{fallbackPlacements:["right","top","bottom"]}}]},onTrigger:(n,r)=>{r.preventDefault(),r.stopPropagation();const{type:o}=e.dataset,a=JSON.parse(e.dataset.annotation)||{},l=this._annotationColors.get(o);if(s.innerHTML=o,s.style.backgroundColor=`var(--pb-annotation-${o})`,s.style.color=`var(${l&&l.isLight?"--pb-color-primary":"--pb-color-inverse"})`,a[this.getKey(o)])this.emitTo("pb-annotation-detail",{type:o,id:a[this.getKey(o)],container:i,span:e,ready:()=>n.setContent(t)});else{i.innerHTML="";const e=Object.keys(a);if(0===e.length){const e=document.createElement("p");e.innerHTML=f("annotations.no-properties"),i.appendChild(e)}else{const t=document.createElement("table");e.forEach(e=>{const i=document.createElement("tr"),n=document.createElement("td");n.innerHTML=e,i.appendChild(n);const s=document.createElement("td");s.innerHTML=JSON.stringify(a[e],null,2),i.appendChild(s),t.appendChild(i)}),i.appendChild(t)}}},onClickOutside:(e,t)=>{e.hideWithInteractivity(t)}})}_showMarker(e,t,i,n=0){const s=e.getClientRects(),{type:r}=e.dataset;if(!e.classList.contains("before"))for(let e=0;e<s.length;e++){const o=s[e],a=document.createElement("div");a.className=`marker annotation-${r}`,a.style.position="absolute",a.style.left=o.left-i.left+"px",a.style.top=`${o.top-i.top+o.height}px`,a.style.marginTop=`${n}px`,a.style.width=`${o.width}px`,a.style.height="3px",a.style.backgroundColor=`var(--pb-annotation-${r})`,a.part="annotation",t.appendChild(a)}this._createTooltip(e)}_clearMarkers(){this.shadowRoot.getElementById("marker-layer").innerHTML=""}refreshMarkers(){const e=this.shadowRoot.getElementById("view"),t=e.getBoundingClientRect(),i=this.shadowRoot.getElementById("marker-layer");i.style.display="none",this._clearMarkers(),e.querySelectorAll(".annotation").forEach(e=>{e._tippy&&e._tippy.destroy(),this._showMarker(e,i,t,5*Vl(e,"annotation"))}),i.style.display="block"}search(e,t){function i(e){let t=e.replace(/[/.?+*\\]/g,e=>`\\${e}`).replace(/[\s\n\t]+/g,"\\s+");return/^\w/.test(t)&&(t=`\\b${t}`),/\w$/.test(t)&&(t=`${t}\\b`),t}function n(e){return e.nodeType===Node.TEXT_NODE?NodeFilter.FILTER_ACCEPT:e.classList.contains("annotation-popup")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}n.acceptNode=n;const s=[];if(!t||0===t.length)return s;const r=t.filter(e=>e&&e.length>0).map(e=>i(e)).join("|");console.log(`<pb-view-annotate> Searching content for ${r}...`);const o=new RegExp(r,this.caseSensitive?"g":"gi"),a=document.createTreeWalker(this.shadowRoot.getElementById("view"),NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,n);for(;a.nextNode();){const t=a.currentNode,i=Array.from(t.textContent.matchAll(o));for(const n of i){const i=n.index+n[0].length;let r=!1,o=null;const a=t.parentNode.dataset.annotation,l=t.parentNode.dataset.type;if(a&&l){r=l===e,o=(JSON.parse(a)||{})[this.getKey(e)]}const c=Hl(t,n.index),d=Hl(t,i,"end"),[p,u]=Ql(t),h={annotated:r,context:c.parent,start:c.offset,end:d.offset,textNode:t,kwic:Yl(p,u+n.index,u+i)};h[this.getKey(e)]=o,s.push(h)}}return s}scrollTo(e){const t=this.shadowRoot.getElementById("view"),i=document.createRange();if(e.annotated)i.selectNode(e.textNode);else{const n=Array.from(t.querySelectorAll(`[data-tei="${e.context}"]`)).filter(e=>null===e.closest("pb-popover")&&"footnote"!==e.getAttribute("rel"))[0],s=Gl(n,e.start),r=Gl(n,e.end);i.setStart(s[0],s[1]),i.setEnd(r[0],r[1])}const n=t.getBoundingClientRect(),s=i.getBoundingClientRect();let r=t.querySelector("[part=highlight]");r||(r=document.createElement("div"),r.part="highlight",r.style.position="absolute",t.appendChild(r)),r.style.left=s.left-n.left-4+"px",r.style.top=s.top-n.top-4+"px",r.style.width=`${s.width+4}px`,r.style.height=`${s.height}px`,r.scrollIntoView(!0)}hideMarker(){const e=this.shadowRoot.getElementById("view").querySelector("[part=highlight]");e&&(e.style.top="-1000px")}_markIncompleteAnnotations(){this.shadowRoot.getElementById("view").querySelectorAll(".annotation.authority").forEach(e=>{if(e.dataset.type){const t=JSON.parse(e.dataset.annotation),i=this.getKey(e.dataset.type);t[i]&&0!==t[i].length?e.classList.remove("incomplete"):e.classList.add("incomplete")}})}_initAnnotationColors(){this._annotationColors=new Map;const e=new Set;this.shadowRoot.getElementById("view").querySelectorAll(".annotation").forEach(t=>{t.dataset.type&&e.add(t.dataset.type)}),e.forEach(e=>{this._annotationColors.set(e,Ml(`annotation-${e.repeat(4)}`,{saturation:70,lightness:[30,60]}))}),this.emitTo("pb-annotation-colors",{colors:this._annotationColors})}_checkAnnotationColor(e){this._annotationColors.has(e)||(this._annotationColors.set(e,Ml(`annotation-${e.repeat(4)}`,{saturation:70,lightness:[30,60]})),this._annotationStyles(),this.emitTo("pb-annotation-colors",{colors:this._annotationColors}))}_annotationStyles(){const e=this.shadowRoot.getElementById("view");let t=e.querySelector("_annotation-styles");t&&t.parentNode.removeChild(t);const i=[],n=[];this._annotationColors.forEach((e,t)=>{i.push(`--pb-annotation-${t}: ${e.color};`),i.push(`--pb-annotation-${t}-border: 2px solid var(--pb-annotation-${t});`),n.push(`\n .annotation-${t}::after {\n background-color: var(--pb-annotation-${t});\n border-color: var(--pb-annotation-${t});\n color: var(${e.isLight?"--pb-color-primary":"--pb-color-inverse"});\n }\n .annotation-${t}.incomplete::after {\n background: repeating-linear-gradient(\n 315deg,\n var(--pb-annotation-${t}),\n var(--pb-annotation-${t}) 5px,\n var(${e.isLight?"--pb-annotation-stripes-light":"--pb-annotation-stripes-dark"}) 5px,\n var(${e.isLight?"--pb-annotation-stripes-light":"--pb-annotation-stripes-dark"}) 10px\n );\n color: var(${e.isLight?"--pb-color-primary":"--pb-color-inverse"});\n }\n `)});const s=`\n :host {\n ${i.join("\n")}\n }\n\n ${n.join("\n")}\n `;t=document.createElement("style"),t.className="_annotation-styles",t.innerHTML=s,e.insertBefore(t,e.firstChild)}static get styles(){return[super.styles,n`
|
|
801
801
|
.annotation-type {
|
|
802
802
|
display: inline-block;
|
|
803
803
|
text-align: right;
|
|
@@ -2703,7 +2703,7 @@ import{g as e,x as t,i as n,a as s,r,p as o,w as a,c as l,b as c,E as d,m as p,B
|
|
|
2703
2703
|
.occurrences {
|
|
2704
2704
|
background-color: var(--pb-color-focus, #f6a623);
|
|
2705
2705
|
}
|
|
2706
|
-
`}_select(e){const t=this._authorities[e.register],i={strings:e.strings,type:e.register,properties:{ref:e.id}};t?t.select(e).then(()=>this.emitTo("pb-authority-select",i)).catch(e=>this.emitTo("pb-authority-error",{status:e.message})):this.emitTo("pb-authority-select",i)}_editEntity(e){const t=this._authorities[e.register];t?t.select(e).then(()=>this.emitTo("pb-authority-edit-entity",{id:e.id,type:e.register})):this.emitTo("pb-authority-edit-entity",{id:e.id,type:e.register})}_queryChanged(e){this._results=[],this.query=e.target.value,this._query()}_query(){this.emitTo("pb-start-update"),this._authorities[this.type].query(this.query).then(e=>{this._occurrences(e.items).then(e=>{this._results=e}),this.emitTo("pb-end-update")})}_addEntity(){this.emitTo("pb-authority-new-entity",{query:this.query,type:this.type})}_occurrences(e){if(this.noOccurrences)return Promise.resolve(e);const t=new FormData;return t.append("register",this.type),e.forEach(e=>{t.append("id",e.id)}),new Promise(i=>{fetch(`${this.getEndpoint()}/api/annotations/occurrences`,{method:"POST",body:t}).then(e=>{if(e.ok)return e.json()}).then(t=>{e.forEach(e=>{t[e.id]?e.occurrences=t[e.id]:e.occurrences=0}),e.sort((e,t)=>{const i=t.occurrences-e.occurrences;return 0===i?"local"===e.provider&&"local"!==t.provider?-1:"local"===t.provider&&"local"!==e.provider?1:this.sortByLabel?e.label.localeCompare(t.label):0:i}),i(e)})})}}customElements.define("pb-authority-lookup",eu);class tu extends(o(s)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{data:{type:Object},documents:{type:Array},doc:{type:String},perPage:{type:Number,attribute:"per-page"},pattern:{type:String},first:{type:Number},sort:{type:String},target:{type:String,attribute:"target"}})}constructor(){super(),this.data={documents:[]},this.documents=[],this.first=1,this.doc=null,this.sort=null}static get styles(){return n`
|
|
2706
|
+
`}_select(e){const t=this._authorities[e.register],i={strings:e.strings,type:e.register,properties:{ref:e.id}};t?t.select(e).then(()=>this.emitTo("pb-authority-select",i)).catch(e=>this.emitTo("pb-authority-error",{status:e.message})):this.emitTo("pb-authority-select",i)}_editEntity(e){const t=this._authorities[e.register];t?t.select(e).then(()=>this.emitTo("pb-authority-edit-entity",{id:e.id,type:e.register})):this.emitTo("pb-authority-edit-entity",{id:e.id,type:e.register})}_queryChanged(e){this.query!==e.target.value&&(this._results=[],this.query=e.target.value,this._query())}_query(){this.emitTo("pb-start-update"),this._authorities[this.type].query(this.query).then(e=>{this._occurrences(e.items).then(e=>{this._results=e}),this.emitTo("pb-end-update")})}_addEntity(){this.emitTo("pb-authority-new-entity",{query:this.query,type:this.type})}_occurrences(e){if(this.noOccurrences)return Promise.resolve(e);const t=new FormData;return t.append("register",this.type),e.forEach(e=>{t.append("id",e.id)}),new Promise(i=>{fetch(`${this.getEndpoint()}/api/annotations/occurrences`,{method:"POST",body:t}).then(e=>{if(e.ok)return e.json()}).then(t=>{e.forEach(e=>{t[e.id]?e.occurrences=t[e.id]:e.occurrences=0}),e.sort((e,t)=>{const i=t.occurrences-e.occurrences;return 0===i?"local"===e.provider&&"local"!==t.provider?-1:"local"===t.provider&&"local"!==e.provider?1:this.sortByLabel?e.label.localeCompare(t.label):0:i}),i(e)})})}}customElements.define("pb-authority-lookup",eu);class tu extends(o(s)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{data:{type:Object},documents:{type:Array},doc:{type:String},perPage:{type:Number,attribute:"per-page"},pattern:{type:String},first:{type:Number},sort:{type:String},target:{type:String,attribute:"target"}})}constructor(){super(),this.data={documents:[]},this.documents=[],this.first=1,this.doc=null,this.sort=null}static get styles(){return n`
|
|
2707
2707
|
:host {
|
|
2708
2708
|
display: block;
|
|
2709
2709
|
max-width: 100%;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teipublisher/pb-components",
|
|
3
|
-
"version": "3.0.0-next-4.
|
|
3
|
+
"version": "3.0.0-next-4.12",
|
|
4
4
|
"description": "Collection of webcomponents underlying TEI Publisher",
|
|
5
5
|
"repository": "https://github.com/eeditiones/tei-publisher-components.git",
|
|
6
6
|
"main": "index.html",
|
|
@@ -346,6 +346,10 @@ export class PbAuthorityLookup extends themableMixin(pbMixin(LitElement)) {
|
|
|
346
346
|
}
|
|
347
347
|
|
|
348
348
|
_queryChanged(e) {
|
|
349
|
+
if (this.query === e.target.value) {
|
|
350
|
+
// Bogus onchange. No need to requery. A requery would only cause a flash of an empty result set
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
349
353
|
this._results = [];
|
|
350
354
|
this.query = e.target.value;
|
|
351
355
|
this._query();
|
package/src/pb-view-annotate.js
CHANGED
|
@@ -275,6 +275,10 @@ class PbViewAnnotate extends PbView {
|
|
|
275
275
|
// fill should always be 0 when doing annotations!!!
|
|
276
276
|
this.fill = 0;
|
|
277
277
|
|
|
278
|
+
// It is nonsense to (automatically) translate the contents of the annotation app. It will just
|
|
279
|
+
// break any offset mapping we ever want to do.
|
|
280
|
+
this.setAttribute('translate', 'no');
|
|
281
|
+
|
|
278
282
|
let isMouseDown = false;
|
|
279
283
|
|
|
280
284
|
this._inHandler = false;
|
|
@@ -322,9 +326,18 @@ class PbViewAnnotate extends PbView {
|
|
|
322
326
|
scheduleCallback(delay);
|
|
323
327
|
};
|
|
324
328
|
|
|
325
|
-
|
|
326
|
-
this.
|
|
327
|
-
|
|
329
|
+
// A controller for a signal that will fire when we are disconnected and we should clean up the event listeners
|
|
330
|
+
this._disconnectedSignal = new AbortController();
|
|
331
|
+
|
|
332
|
+
document.addEventListener('selectionchange', this._eventHandler, {
|
|
333
|
+
signal: this._disconnectedSignal.signal,
|
|
334
|
+
});
|
|
335
|
+
this.shadowRoot.addEventListener('mousedown', this._eventHandler, {
|
|
336
|
+
signal: this._disconnectedSignal.signal,
|
|
337
|
+
});
|
|
338
|
+
this.shadowRoot.addEventListener('mouseup', this._eventHandler, {
|
|
339
|
+
signal: this._disconnectedSignal.signal,
|
|
340
|
+
});
|
|
328
341
|
|
|
329
342
|
this.subscribeTo('pb-add-annotation', ev => this.addAnnotation(ev.detail));
|
|
330
343
|
this.subscribeTo('pb-edit-annotation', this._editAnnotation.bind(this));
|
|
@@ -336,16 +349,33 @@ class PbViewAnnotate extends PbView {
|
|
|
336
349
|
this.emitTo('pb-annotations-changed', { ranges: this._ranges, refresh: true });
|
|
337
350
|
});
|
|
338
351
|
|
|
339
|
-
this.addEventListener(
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
352
|
+
this.addEventListener(
|
|
353
|
+
'pb-disable',
|
|
354
|
+
() => {
|
|
355
|
+
this._disabled = true;
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
signal: this._disconnectedSignal.signal,
|
|
359
|
+
},
|
|
360
|
+
);
|
|
361
|
+
this.addEventListener(
|
|
362
|
+
'pb-enable',
|
|
363
|
+
() => {
|
|
364
|
+
this._disabled = false;
|
|
365
|
+
},
|
|
366
|
+
{ signal: this._disconnectedSignal.signal },
|
|
367
|
+
);
|
|
345
368
|
|
|
346
369
|
this._resizeHandler();
|
|
347
370
|
}
|
|
348
371
|
|
|
372
|
+
disconnectedCallback() {
|
|
373
|
+
super.disconnectedCallback();
|
|
374
|
+
|
|
375
|
+
// Remove any events that we had earlier.
|
|
376
|
+
this._disconnectedSignal.abort();
|
|
377
|
+
}
|
|
378
|
+
|
|
349
379
|
get annotations() {
|
|
350
380
|
return this._ranges;
|
|
351
381
|
}
|
|
@@ -1052,6 +1082,9 @@ class PbViewAnnotate extends PbView {
|
|
|
1052
1082
|
|
|
1053
1083
|
const rootRect = root.getBoundingClientRect();
|
|
1054
1084
|
const rect = range.getBoundingClientRect();
|
|
1085
|
+
/**
|
|
1086
|
+
* @type {HTMLElement}
|
|
1087
|
+
*/
|
|
1055
1088
|
let marker = root.querySelector('[part=highlight]');
|
|
1056
1089
|
if (!marker) {
|
|
1057
1090
|
marker = document.createElement('div');
|
|
@@ -1065,7 +1098,7 @@ class PbViewAnnotate extends PbView {
|
|
|
1065
1098
|
marker.style.width = `${rect.width + 4}px`;
|
|
1066
1099
|
marker.style.height = `${rect.height}px`;
|
|
1067
1100
|
|
|
1068
|
-
|
|
1101
|
+
marker.scrollIntoView(true);
|
|
1069
1102
|
}
|
|
1070
1103
|
|
|
1071
1104
|
hideMarker() {
|