@teipublisher/pb-components 1.30.1 → 1.30.2

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 CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.30.2](https://github.com/eeditiones/tei-publisher-components/compare/v1.30.1...v1.30.2) (2021-12-12)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **pb-view-annotate:** do not throw errors when batch-applying annotations ([5432c64](https://github.com/eeditiones/tei-publisher-components/commit/5432c64812276047eabf6fad0d0b96435c10669d))
7
+
1
8
  ## [1.30.1](https://github.com/eeditiones/tei-publisher-components/compare/v1.30.0...v1.30.1) (2021-12-04)
2
9
 
3
10
 
@@ -507,7 +507,7 @@ const W=n`
507
507
  border-color: #999;
508
508
  color: #999;
509
509
  }
510
- `}}customElements.define("pb-demo-snippet",Z);class Q{static subscribe(t,e,n,i=!1){e&&!Array.isArray(e)&&(e=[e]);const r=document.addEventListener(t,t=>{(e||t.detail&&t.detail.key)&&!(e&&t.detail&&t.detail.key&&e.indexOf(t.detail.key)>-1)||n&&n(t,r)},{once:i})}static subscribeOnce(t,e=null){return e&&!Array.isArray(e)&&(e=[e]),new Promise(n=>{document.addEventListener(t,t=>{(e||t.detail&&t.detail.key)&&!(e&&t.detail&&t.detail.key&&e.indexOf(t.detail.key)>-1)||n(t)},{once:!0})})}static emit(t,e=null,n=null){const i=n||{};e&&(i.key=e);const r=new CustomEvent(t,{detail:i});document.dispatchEvent(r)}}window.pbEvents||(window.pbEvents=Q);const Y="1.30.1";class J extends V{static get properties(){return Object.assign({version:{type:String,reflect:!0}},super.properties)}constructor(){super(),this.version=Y}connectedCallback(){if(super.connectedCallback(),!this.version){const t=O("../package.json");fetch(t).then(t=>t.json()).then(t=>{this.version=t.version})}}render(){return $`<span>${this.version?this.version:"unknown"}</span>`}createRenderRoot(){return this}}customElements.define("pb-version",J);var tt="top",et="bottom",nt="right",it="left",rt="auto",ot=[tt,et,nt,it],at="start",st="end",lt="clippingParents",ct="viewport",ht="popper",pt="reference",dt=ot.reduce((function(t,e){return t.concat([e+"-"+at,e+"-"+st])}),[]),ut=[].concat(ot,[rt]).reduce((function(t,e){return t.concat([e,e+"-"+at,e+"-"+st])}),[]),gt=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function ft(t){return t?(t.nodeName||"").toLowerCase():null}function mt(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function vt(t){return t instanceof mt(t).Element||t instanceof Element}function bt(t){return t instanceof mt(t).HTMLElement||t instanceof HTMLElement}function yt(t){return"undefined"!=typeof ShadowRoot&&(t instanceof mt(t).ShadowRoot||t instanceof ShadowRoot)}function _t(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var n=e.styles[t]||{},i=e.attributes[t]||{},r=e.elements[t];bt(r)&&ft(r)&&(Object.assign(r.style,n),Object.keys(i).forEach((function(t){var e=i[t];!1===e?r.removeAttribute(t):r.setAttribute(t,!0===e?"":e)})))}))}function wt(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach((function(t){var i=e.elements[t],r=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});bt(i)&&ft(i)&&(Object.assign(i.style,o),Object.keys(r).forEach((function(t){i.removeAttribute(t)})))}))}}var xt={name:"applyStyles",enabled:!0,phase:"write",fn:_t,effect:wt,requires:["computeStyles"]};function kt(t){return t.split("-")[0]}function zt(t){var e=t.getBoundingClientRect();return{width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left,x:e.left,y:e.top}}function At(t){var e=zt(t),n=t.offsetWidth,i=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:i}}function St(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&yt(n)){var i=e;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Ct(t){return mt(t).getComputedStyle(t)}function Et(t){return["table","td","th"].indexOf(ft(t))>=0}function Mt(t){return((vt(t)?t.ownerDocument:t.document)||window.document).documentElement}function Lt(t){return"html"===ft(t)?t:t.assignedSlot||t.parentNode||(yt(t)?t.host:null)||Mt(t)}function Ht(t){return bt(t)&&"fixed"!==Ct(t).position?t.offsetParent:null}function Tt(t){var e=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&bt(t)&&"fixed"===Ct(t).position)return null;for(var n=Lt(t);bt(n)&&["html","body"].indexOf(ft(n))<0;){var i=Ct(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||e&&"filter"===i.willChange||e&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}function Vt(t){for(var e=mt(t),n=Ht(t);n&&Et(n)&&"static"===Ct(n).position;)n=Ht(n);return n&&("html"===ft(n)||"body"===ft(n)&&"static"===Ct(n).position)?e:n||Tt(t)||e}function $t(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}var Ot=Math.max,Pt=Math.min,Rt=Math.round;function It(t,e,n){return Ot(t,Pt(e,n))}function Nt(){return{top:0,right:0,bottom:0,left:0}}function Ft(t){return Object.assign({},Nt(),t)}function Bt(t,e){return e.reduce((function(e,n){return e[n]=t,e}),{})}var Dt=function(t,e){return Ft("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Bt(t,ot))};function jt(t){var e,n=t.state,i=t.name,r=t.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=kt(n.placement),l=$t(s),c=[it,nt].indexOf(s)>=0?"height":"width";if(o&&a){var h=Dt(r.padding,n),p=At(o),d="y"===l?tt:it,u="y"===l?et:nt,g=n.rects.reference[c]+n.rects.reference[l]-a[l]-n.rects.popper[c],f=a[l]-n.rects.reference[l],m=Vt(o),v=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,b=g/2-f/2,y=h[d],_=v-p[c]-h[u],w=v/2-p[c]/2+b,x=It(y,w,_),k=l;n.modifiersData[i]=((e={})[k]=x,e.centerOffset=x-w,e)}}function qt(t){var e=t.state,n=t.options.element,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"!=typeof i||(i=e.elements.popper.querySelector(i)))&&St(e.elements.popper,i)&&(e.elements.arrow=i)}var Ut={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Wt(t){var e=t.x,n=t.y,i=window.devicePixelRatio||1;return{x:Rt(Rt(e*i)/i)||0,y:Rt(Rt(n*i)/i)||0}}function Gt(t){var e,n=t.popper,i=t.popperRect,r=t.placement,o=t.offsets,a=t.position,s=t.gpuAcceleration,l=t.adaptive,c=t.roundOffsets,h=!0===c?Wt(o):"function"==typeof c?c(o):o,p=h.x,d=void 0===p?0:p,u=h.y,g=void 0===u?0:u,f=o.hasOwnProperty("x"),m=o.hasOwnProperty("y"),v=it,b=tt,y=window;if(l){var _=Vt(n),w="clientHeight",x="clientWidth";_===mt(n)&&"static"!==Ct(_=Mt(n)).position&&(w="scrollHeight",x="scrollWidth"),_=_,r===tt&&(b=et,g-=_[w]-i.height,g*=s?1:-1),r===it&&(v=nt,d-=_[x]-i.width,d*=s?1:-1)}var k,z=Object.assign({position:a},l&&Ut);return s?Object.assign({},z,((k={})[b]=m?"0":"",k[v]=f?"0":"",k.transform=(y.devicePixelRatio||1)<2?"translate("+d+"px, "+g+"px)":"translate3d("+d+"px, "+g+"px, 0)",k)):Object.assign({},z,((e={})[b]=m?g+"px":"",e[v]=f?d+"px":"",e.transform="",e))}function Xt(t){var e=t.state,n=t.options,i=n.gpuAcceleration,r=void 0===i||i,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,l=void 0===s||s,c={placement:kt(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,Gt(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,Gt(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var Kt={passive:!0};function Zt(t){var e=t.state,n=t.instance,i=t.options,r=i.scroll,o=void 0===r||r,a=i.resize,s=void 0===a||a,l=mt(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach((function(t){t.addEventListener("scroll",n.update,Kt)})),s&&l.addEventListener("resize",n.update,Kt),function(){o&&c.forEach((function(t){t.removeEventListener("scroll",n.update,Kt)})),s&&l.removeEventListener("resize",n.update,Kt)}}var Qt={left:"right",right:"left",bottom:"top",top:"bottom"};function Yt(t){return t.replace(/left|right|bottom|top/g,(function(t){return Qt[t]}))}var Jt={start:"end",end:"start"};function te(t){return t.replace(/start|end/g,(function(t){return Jt[t]}))}function ee(t){var e=mt(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ne(t){return zt(Mt(t)).left+ee(t).scrollLeft}function ie(t){var e=mt(t),n=Mt(t),i=e.visualViewport,r=n.clientWidth,o=n.clientHeight,a=0,s=0;return i&&(r=i.width,o=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=i.offsetLeft,s=i.offsetTop)),{width:r,height:o,x:a+ne(t),y:s}}function re(t){var e,n=Mt(t),i=ee(t),r=null==(e=t.ownerDocument)?void 0:e.body,o=Ot(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=Ot(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),s=-i.scrollLeft+ne(t),l=-i.scrollTop;return"rtl"===Ct(r||n).direction&&(s+=Ot(n.clientWidth,r?r.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function oe(t){var e=Ct(t),n=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function ae(t){return["html","body","#document"].indexOf(ft(t))>=0?t.ownerDocument.body:bt(t)&&oe(t)?t:ae(Lt(t))}function se(t,e){var n;void 0===e&&(e=[]);var i=ae(t),r=i===(null==(n=t.ownerDocument)?void 0:n.body),o=mt(i),a=r?[o].concat(o.visualViewport||[],oe(i)?i:[]):i,s=e.concat(a);return r?s:s.concat(se(Lt(a)))}function le(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function ce(t){var e=zt(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}function he(t,e){return e===ct?le(ie(t)):bt(e)?ce(e):le(re(Mt(t)))}function pe(t){var e=se(Lt(t)),n=["absolute","fixed"].indexOf(Ct(t).position)>=0&&bt(t)?Vt(t):t;return vt(n)?e.filter((function(t){return vt(t)&&St(t,n)&&"body"!==ft(t)})):[]}function de(t,e,n){var i="clippingParents"===e?pe(t):[].concat(e),r=[].concat(i,[n]),o=r[0],a=r.reduce((function(e,n){var i=he(t,n);return e.top=Ot(i.top,e.top),e.right=Pt(i.right,e.right),e.bottom=Pt(i.bottom,e.bottom),e.left=Ot(i.left,e.left),e}),he(t,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ue(t){return t.split("-")[1]}function ge(t){var e,n=t.reference,i=t.element,r=t.placement,o=r?kt(r):null,a=r?ue(r):null,s=n.x+n.width/2-i.width/2,l=n.y+n.height/2-i.height/2;switch(o){case tt:e={x:s,y:n.y-i.height};break;case et:e={x:s,y:n.y+n.height};break;case nt:e={x:n.x+n.width,y:l};break;case it:e={x:n.x-i.width,y:l};break;default:e={x:n.x,y:n.y}}var c=o?$t(o):null;if(null!=c){var h="y"===c?"height":"width";switch(a){case at:e[c]=e[c]-(n[h]/2-i[h]/2);break;case st:e[c]=e[c]+(n[h]/2-i[h]/2)}}return e}function fe(t,e){void 0===e&&(e={});var n=e,i=n.placement,r=void 0===i?t.placement:i,o=n.boundary,a=void 0===o?lt:o,s=n.rootBoundary,l=void 0===s?ct:s,c=n.elementContext,h=void 0===c?ht:c,p=n.altBoundary,d=void 0!==p&&p,u=n.padding,g=void 0===u?0:u,f=Ft("number"!=typeof g?g:Bt(g,ot)),m=h===ht?pt:ht,v=t.elements.reference,b=t.rects.popper,y=t.elements[d?m:h],_=de(vt(y)?y:y.contextElement||Mt(t.elements.popper),a,l),w=zt(v),x=ge({reference:w,element:b,strategy:"absolute",placement:r}),k=le(Object.assign({},b,x)),z=h===ht?k:w,A={top:_.top-z.top+f.top,bottom:z.bottom-_.bottom+f.bottom,left:_.left-z.left+f.left,right:z.right-_.right+f.right},S=t.modifiersData.offset;if(h===ht&&S){var C=S[r];Object.keys(A).forEach((function(t){var e=[nt,et].indexOf(t)>=0?1:-1,n=[tt,et].indexOf(t)>=0?"y":"x";A[t]+=C[n]*e}))}return A}function me(t,e){void 0===e&&(e={});var n=e,i=n.placement,r=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?ut:l,h=ue(i),p=h?s?dt:dt.filter((function(t){return ue(t)===h})):ot,d=p.filter((function(t){return c.indexOf(t)>=0}));0===d.length&&(d=p);var u=d.reduce((function(e,n){return e[n]=fe(t,{placement:n,boundary:r,rootBoundary:o,padding:a})[kt(n)],e}),{});return Object.keys(u).sort((function(t,e){return u[t]-u[e]}))}function ve(t){if(kt(t)===rt)return[];var e=Yt(t);return[te(t),e,te(e)]}function be(t){var e=t.state,n=t.options,i=t.name;if(!e.modifiersData[i]._skip){for(var r=n.mainAxis,o=void 0===r||r,a=n.altAxis,s=void 0===a||a,l=n.fallbackPlacements,c=n.padding,h=n.boundary,p=n.rootBoundary,d=n.altBoundary,u=n.flipVariations,g=void 0===u||u,f=n.allowedAutoPlacements,m=e.options.placement,v=kt(m),b=l||(v===m||!g?[Yt(m)]:ve(m)),y=[m].concat(b).reduce((function(t,n){return t.concat(kt(n)===rt?me(e,{placement:n,boundary:h,rootBoundary:p,padding:c,flipVariations:g,allowedAutoPlacements:f}):n)}),[]),_=e.rects.reference,w=e.rects.popper,x=new Map,k=!0,z=y[0],A=0;A<y.length;A++){var S=y[A],C=kt(S),E=ue(S)===at,M=[tt,et].indexOf(C)>=0,L=M?"width":"height",H=fe(e,{placement:S,boundary:h,rootBoundary:p,altBoundary:d,padding:c}),T=M?E?nt:it:E?et:tt;_[L]>w[L]&&(T=Yt(T));var V=Yt(T),$=[];if(o&&$.push(H[C]<=0),s&&$.push(H[T]<=0,H[V]<=0),$.every((function(t){return t}))){z=S,k=!1;break}x.set(S,$)}if(k)for(var O=function(t){var e=y.find((function(e){var n=x.get(e);if(n)return n.slice(0,t).every((function(t){return t}))}));if(e)return z=e,"break"},P=g?3:1;P>0;P--){if("break"===O(P))break}e.placement!==z&&(e.modifiersData[i]._skip=!0,e.placement=z,e.reset=!0)}}function ye(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function _e(t){return[tt,nt,et,it].some((function(e){return t[e]>=0}))}function we(t){var e=t.state,n=t.name,i=e.rects.reference,r=e.rects.popper,o=e.modifiersData.preventOverflow,a=fe(e,{elementContext:"reference"}),s=fe(e,{altBoundary:!0}),l=ye(a,i),c=ye(s,r,o),h=_e(l),p=_e(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:p},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":p})}function xe(t,e,n){var i=kt(t),r=[it,tt].indexOf(i)>=0?-1:1,o="function"==typeof n?n(Object.assign({},e,{placement:t})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*r,[it,nt].indexOf(i)>=0?{x:s,y:a}:{x:a,y:s}}function ke(t){var e=t.state,n=t.options,i=t.name,r=n.offset,o=void 0===r?[0,0]:r,a=ut.reduce((function(t,n){return t[n]=xe(n,e.rects,o),t}),{}),s=a[e.placement],l=s.x,c=s.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[i]=a}function ze(t){var e=t.state,n=t.name;e.modifiersData[n]=ge({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}function Ae(t){return"x"===t?"y":"x"}function Se(t){var e=t.state,n=t.options,i=t.name,r=n.mainAxis,o=void 0===r||r,a=n.altAxis,s=void 0!==a&&a,l=n.boundary,c=n.rootBoundary,h=n.altBoundary,p=n.padding,d=n.tether,u=void 0===d||d,g=n.tetherOffset,f=void 0===g?0:g,m=fe(e,{boundary:l,rootBoundary:c,padding:p,altBoundary:h}),v=kt(e.placement),b=ue(e.placement),y=!b,_=$t(v),w=Ae(_),x=e.modifiersData.popperOffsets,k=e.rects.reference,z=e.rects.popper,A="function"==typeof f?f(Object.assign({},e.rects,{placement:e.placement})):f,S={x:0,y:0};if(x){if(o||s){var C="y"===_?tt:it,E="y"===_?et:nt,M="y"===_?"height":"width",L=x[_],H=x[_]+m[C],T=x[_]-m[E],V=u?-z[M]/2:0,$=b===at?k[M]:z[M],O=b===at?-z[M]:-k[M],P=e.elements.arrow,R=u&&P?At(P):{width:0,height:0},I=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Nt(),N=I[C],F=I[E],B=It(0,k[M],R[M]),D=y?k[M]/2-V-B-N-A:$-B-N-A,j=y?-k[M]/2+V+B+F+A:O+B+F+A,q=e.elements.arrow&&Vt(e.elements.arrow),U=q?"y"===_?q.clientTop||0:q.clientLeft||0:0,W=e.modifiersData.offset?e.modifiersData.offset[e.placement][_]:0,G=x[_]+D-W-U,X=x[_]+j-W;if(o){var K=It(u?Pt(H,G):H,L,u?Ot(T,X):T);x[_]=K,S[_]=K-L}if(s){var Z="x"===_?tt:it,Q="x"===_?et:nt,Y=x[w],J=Y+m[Z],rt=Y-m[Q],ot=It(u?Pt(J,G):J,Y,u?Ot(rt,X):rt);x[w]=ot,S[w]=ot-Y}}e.modifiersData[i]=S}}function Ce(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Ee(t){return t!==mt(t)&&bt(t)?Ce(t):ee(t)}function Me(t,e,n){void 0===n&&(n=!1);var i=Mt(e),r=zt(t),o=bt(e),a={scrollLeft:0,scrollTop:0},s={x:0,y:0};return(o||!o&&!n)&&(("body"!==ft(e)||oe(i))&&(a=Ee(e)),bt(e)?((s=zt(e)).x+=e.clientLeft,s.y+=e.clientTop):i&&(s.x=ne(i))),{x:r.left+a.scrollLeft-s.x,y:r.top+a.scrollTop-s.y,width:r.width,height:r.height}}function Le(t){var e=new Map,n=new Set,i=[];function r(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!n.has(t)){var i=e.get(t);i&&r(i)}})),i.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||r(t)})),i}function He(t){var e=Le(t);return gt.reduce((function(t,n){return t.concat(e.filter((function(t){return t.phase===n})))}),[])}function Te(t){var e;return function(){return e||(e=new Promise((function(n){Promise.resolve().then((function(){e=void 0,n(t())}))}))),e}}function Ve(t){var e=t.reduce((function(t,e){var n=t[e.name];return t[e.name]=n?Object.assign({},n,e,{options:Object.assign({},n.options,e.options),data:Object.assign({},n.data,e.data)}):e,t}),{});return Object.keys(e).map((function(t){return e[t]}))}var $e={placement:"bottom",modifiers:[],strategy:"absolute"};function Oe(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function Pe(t){void 0===t&&(t={});var e=t,n=e.defaultModifiers,i=void 0===n?[]:n,r=e.defaultOptions,o=void 0===r?$e:r;return function(t,e,n){void 0===n&&(n=o);var r={placement:"bottom",orderedModifiers:[],options:Object.assign({},$e,o),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},a=[],s=!1,l={state:r,setOptions:function(n){h(),r.options=Object.assign({},o,r.options,n),r.scrollParents={reference:vt(t)?se(t):t.contextElement?se(t.contextElement):[],popper:se(e)};var a=He(Ve([].concat(i,r.options.modifiers)));return r.orderedModifiers=a.filter((function(t){return t.enabled})),c(),l.update()},forceUpdate:function(){if(!s){var t=r.elements,e=t.reference,n=t.popper;if(Oe(e,n)){r.rects={reference:Me(e,Vt(n),"fixed"===r.options.strategy),popper:At(n)},r.reset=!1,r.placement=r.options.placement,r.orderedModifiers.forEach((function(t){return r.modifiersData[t.name]=Object.assign({},t.data)}));for(var i=0;i<r.orderedModifiers.length;i++)if(!0!==r.reset){var o=r.orderedModifiers[i],a=o.fn,c=o.options,h=void 0===c?{}:c,p=o.name;"function"==typeof a&&(r=a({state:r,options:h,name:p,instance:l})||r)}else r.reset=!1,i=-1}}},update:Te((function(){return new Promise((function(t){l.forceUpdate(),t(r)}))})),destroy:function(){h(),s=!0}};if(!Oe(t,e))return l;function c(){r.orderedModifiers.forEach((function(t){var e=t.name,n=t.options,i=void 0===n?{}:n,o=t.effect;if("function"==typeof o){var s=o({state:r,name:e,instance:l,options:i}),c=function(){};a.push(s||c)}}))}function h(){a.forEach((function(t){return t()})),a=[]}return l.setOptions(n).then((function(t){!s&&n.onFirstUpdate&&n.onFirstUpdate(t)})),l}}var Re=Pe({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Zt,data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:ze,data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Xt,data:{}},xt,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:ke},{name:"flip",enabled:!0,phase:"main",fn:be,requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:Se,requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:jt,effect:qt,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:we}]}),Ie="tippy-box",Ne="tippy-content",Fe="tippy-backdrop",Be="tippy-arrow",De="tippy-svg-arrow",je={passive:!0,capture:!0};function qe(t,e,n){if(Array.isArray(t)){var i=t[e];return null==i?Array.isArray(n)?n[e]:n:i}return t}function Ue(t,e){var n={}.toString.call(t);return 0===n.indexOf("[object")&&n.indexOf(e+"]")>-1}function We(t,e){return"function"==typeof t?t.apply(void 0,e):t}function Ge(t,e){return 0===e?t:function(i){clearTimeout(n),n=setTimeout((function(){t(i)}),e)};var n}function Xe(t){return t.split(/\s+/).filter(Boolean)}function Ke(t){return[].concat(t)}function Ze(t,e){-1===t.indexOf(e)&&t.push(e)}function Qe(t){return t.filter((function(e,n){return t.indexOf(e)===n}))}function Ye(t){return t.split("-")[0]}function Je(t){return[].slice.call(t)}function tn(t){return Object.keys(t).reduce((function(e,n){return void 0!==t[n]&&(e[n]=t[n]),e}),{})}function en(){return document.createElement("div")}function nn(t){return["Element","Fragment"].some((function(e){return Ue(t,e)}))}function rn(t){return Ue(t,"NodeList")}function on(t){return Ue(t,"MouseEvent")}function an(t){return!(!t||!t._tippy||t._tippy.reference!==t)}function sn(t){return nn(t)?[t]:rn(t)?Je(t):Array.isArray(t)?t:Je(document.querySelectorAll(t))}function ln(t,e){t.forEach((function(t){t&&(t.style.transitionDuration=e+"ms")}))}function cn(t,e){t.forEach((function(t){t&&t.setAttribute("data-state",e)}))}function hn(t){var e,n=Ke(t)[0];return(null==n||null==(e=n.ownerDocument)?void 0:e.body)?n.ownerDocument:document}function pn(t,e){var n=e.clientX,i=e.clientY;return t.every((function(t){var e=t.popperRect,r=t.popperState,o=t.props.interactiveBorder,a=Ye(r.placement),s=r.modifiersData.offset;if(!s)return!0;var l="bottom"===a?s.top.y:0,c="top"===a?s.bottom.y:0,h="right"===a?s.left.x:0,p="left"===a?s.right.x:0,d=e.top-i+l>o,u=i-e.bottom-c>o,g=e.left-n+h>o,f=n-e.right-p>o;return d||u||g||f}))}function dn(t,e,n){var i=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(e){t[i](e,n)}))}var un={isTouch:!1},gn=0;function fn(){un.isTouch||(un.isTouch=!0,window.performance&&document.addEventListener("mousemove",mn))}function mn(){var t=performance.now();t-gn<20&&(un.isTouch=!1,document.removeEventListener("mousemove",mn)),gn=t}function vn(){var t=document.activeElement;if(an(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function bn(){document.addEventListener("touchstart",fn,je),window.addEventListener("blur",vn)}var yn="undefined"!=typeof window&&"undefined"!=typeof document?navigator.userAgent:"",_n=/MSIE |Trident\//.test(yn),wn={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},xn={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},kn=Object.assign({appendTo:function(){return document.body},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},wn,{},xn),zn=Object.keys(kn),An=function(t){Object.keys(t).forEach((function(e){kn[e]=t[e]}))};function Sn(t){var e=(t.plugins||[]).reduce((function(e,n){var i=n.name,r=n.defaultValue;return i&&(e[i]=void 0!==t[i]?t[i]:r),e}),{});return Object.assign({},t,{},e)}function Cn(t,e){return(e?Object.keys(Sn(Object.assign({},kn,{plugins:e}))):zn).reduce((function(e,n){var i=(t.getAttribute("data-tippy-"+n)||"").trim();if(!i)return e;if("content"===n)e[n]=i;else try{e[n]=JSON.parse(i)}catch(t){e[n]=i}return e}),{})}function En(t,e){var n=Object.assign({},e,{content:We(e.content,[t])},e.ignoreAttributes?{}:Cn(t,e.plugins));return n.aria=Object.assign({},kn.aria,{},n.aria),n.aria={expanded:"auto"===n.aria.expanded?e.interactive:n.aria.expanded,content:"auto"===n.aria.content?e.interactive?null:"describedby":n.aria.content},n}var Mn=function(){return"innerHTML"};function Ln(t,e){t[Mn()]=e}function Hn(t){var e=en();return!0===t?e.className=Be:(e.className=De,nn(t)?e.appendChild(t):Ln(e,t)),e}function Tn(t,e){nn(e.content)?(Ln(t,""),t.appendChild(e.content)):"function"!=typeof e.content&&(e.allowHTML?Ln(t,e.content):t.textContent=e.content)}function Vn(t){var e=t.firstElementChild,n=Je(e.children);return{box:e,content:n.find((function(t){return t.classList.contains(Ne)})),arrow:n.find((function(t){return t.classList.contains(Be)||t.classList.contains(De)})),backdrop:n.find((function(t){return t.classList.contains(Fe)}))}}function $n(t){var e=en(),n=en();n.className=Ie,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var i=en();function r(n,i){var r=Vn(e),o=r.box,a=r.content,s=r.arrow;i.theme?o.setAttribute("data-theme",i.theme):o.removeAttribute("data-theme"),"string"==typeof i.animation?o.setAttribute("data-animation",i.animation):o.removeAttribute("data-animation"),i.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof i.maxWidth?i.maxWidth+"px":i.maxWidth,i.role?o.setAttribute("role",i.role):o.removeAttribute("role"),n.content===i.content&&n.allowHTML===i.allowHTML||Tn(a,t.props),i.arrow?s?n.arrow!==i.arrow&&(o.removeChild(s),o.appendChild(Hn(i.arrow))):o.appendChild(Hn(i.arrow)):s&&o.removeChild(s)}return i.className=Ne,i.setAttribute("data-state","hidden"),Tn(i,t.props),e.appendChild(n),n.appendChild(i),r(t.props,t.props),{popper:e,onUpdate:r}}$n.$$tippy=!0;var On=1,Pn=[],Rn=[];function In(t,e){var n,i,r,o,a,s,l,c=En(t,Object.assign({},kn,{},Sn(tn(e)))),h=!1,p=!1,d=!1,u=!1,g=[],f=Ge(Z,c.interactiveDebounce),m=On++,v=null,b=Qe(c.plugins),y={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},_={id:m,reference:t,popper:en(),popperInstance:v,props:c,state:y,plugins:b,clearDelayTimeouts:lt,setProps:ct,setContent:ht,show:pt,hide:dt,hideWithInteractivity:ut,enable:at,disable:st,unmount:gt,destroy:ft};if(!c.render)return _;var w=c.render(_),x=w.popper,k=w.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+_.id,_.popper=x,t._tippy=_,x._tippy=_;var z=b.map((function(t){return t.fn(_)})),A=t.hasAttribute("aria-expanded");return G(),P(),V(),$("onCreate",[_]),c.showOnCreate&&rt(),x.addEventListener("mouseenter",(function(){_.props.interactive&&_.state.isVisible&&_.clearDelayTimeouts()})),x.addEventListener("mouseleave",(function(t){_.props.interactive&&_.props.trigger.indexOf("mouseenter")>=0&&(L().addEventListener("mousemove",f),f(t))})),_;function S(){var t=_.props.touch;return Array.isArray(t)?t:[t,0]}function C(){return"hold"===S()[0]}function E(){var t;return!!(null==(t=_.props.render)?void 0:t.$$tippy)}function M(){return l||t}function L(){var t=M().parentNode;return t?hn(t):document}function H(){return Vn(x)}function T(t){return _.state.isMounted&&!_.state.isVisible||un.isTouch||o&&"focus"===o.type?0:qe(_.props.delay,t?0:1,kn.delay)}function V(){x.style.pointerEvents=_.props.interactive&&_.state.isVisible?"":"none",x.style.zIndex=""+_.props.zIndex}function $(t,e,n){var i;(void 0===n&&(n=!0),z.forEach((function(n){n[t]&&n[t].apply(void 0,e)})),n)&&(i=_.props)[t].apply(i,e)}function O(){var e=_.props.aria;if(e.content){var n="aria-"+e.content,i=x.id;Ke(_.props.triggerTarget||t).forEach((function(t){var e=t.getAttribute(n);if(_.state.isVisible)t.setAttribute(n,e?e+" "+i:i);else{var r=e&&e.replace(i,"").trim();r?t.setAttribute(n,r):t.removeAttribute(n)}}))}}function P(){!A&&_.props.aria.expanded&&Ke(_.props.triggerTarget||t).forEach((function(t){_.props.interactive?t.setAttribute("aria-expanded",_.state.isVisible&&t===M()?"true":"false"):t.removeAttribute("aria-expanded")}))}function R(){L().removeEventListener("mousemove",f),Pn=Pn.filter((function(t){return t!==f}))}function I(t){if(!(un.isTouch&&(d||"mousedown"===t.type)||_.props.interactive&&x.contains(t.target))){if(M().contains(t.target)){if(un.isTouch)return;if(_.state.isVisible&&_.props.trigger.indexOf("click")>=0)return}else $("onClickOutside",[_,t]);!0===_.props.hideOnClick&&(_.clearDelayTimeouts(),_.hide(),p=!0,setTimeout((function(){p=!1})),_.state.isMounted||D())}}function N(){d=!0}function F(){d=!1}function B(){var t=L();t.addEventListener("mousedown",I,!0),t.addEventListener("touchend",I,je),t.addEventListener("touchstart",F,je),t.addEventListener("touchmove",N,je)}function D(){var t=L();t.removeEventListener("mousedown",I,!0),t.removeEventListener("touchend",I,je),t.removeEventListener("touchstart",F,je),t.removeEventListener("touchmove",N,je)}function j(t,e){U(t,(function(){!_.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&e()}))}function q(t,e){U(t,e)}function U(t,e){var n=H().box;function i(t){t.target===n&&(dn(n,"remove",i),e())}if(0===t)return e();dn(n,"remove",a),dn(n,"add",i),a=i}function W(e,n,i){void 0===i&&(i=!1),Ke(_.props.triggerTarget||t).forEach((function(t){t.addEventListener(e,n,i),g.push({node:t,eventType:e,handler:n,options:i})}))}function G(){C()&&(W("touchstart",K,{passive:!0}),W("touchend",Q,{passive:!0})),Xe(_.props.trigger).forEach((function(t){if("manual"!==t)switch(W(t,K),t){case"mouseenter":W("mouseleave",Q);break;case"focus":W(_n?"focusout":"blur",Y);break;case"focusin":W("focusout",Y)}}))}function X(){g.forEach((function(t){var e=t.node,n=t.eventType,i=t.handler,r=t.options;e.removeEventListener(n,i,r)})),g=[]}function K(t){var e,n=!1;if(_.state.isEnabled&&!J(t)&&!p){var i="focus"===(null==(e=o)?void 0:e.type);o=t,l=t.currentTarget,P(),!_.state.isVisible&&on(t)&&Pn.forEach((function(e){return e(t)})),"click"===t.type&&(_.props.trigger.indexOf("mouseenter")<0||h)&&!1!==_.props.hideOnClick&&_.state.isVisible?n=!0:rt(t),"click"===t.type&&(h=!n),n&&!i&&ot(t)}}function Z(t){var e=t.target,n=M().contains(e)||x.contains(e);"mousemove"===t.type&&n||pn(it().concat(x).map((function(t){var e,n=null==(e=t._tippy.popperInstance)?void 0:e.state;return n?{popperRect:t.getBoundingClientRect(),popperState:n,props:c}:null})).filter(Boolean),t)&&(R(),ot(t))}function Q(t){J(t)||_.props.trigger.indexOf("click")>=0&&h||(_.props.interactive?_.hideWithInteractivity(t):ot(t))}function Y(t){_.props.trigger.indexOf("focusin")<0&&t.target!==M()||_.props.interactive&&t.relatedTarget&&x.contains(t.relatedTarget)||ot(t)}function J(t){return!!un.isTouch&&C()!==t.type.indexOf("touch")>=0}function tt(){et();var e=_.props,n=e.popperOptions,i=e.placement,r=e.offset,o=e.getReferenceClientRect,a=e.moveTransition,l=E()?Vn(x).arrow:null,c=o?{getBoundingClientRect:o,contextElement:o.contextElement||M()}:t,h=[{name:"offset",options:{offset:r}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var e=t.state;if(E()){var n=H().box;["placement","reference-hidden","escaped"].forEach((function(t){"placement"===t?n.setAttribute("data-placement",e.placement):e.attributes.popper["data-popper-"+t]?n.setAttribute("data-"+t,""):n.removeAttribute("data-"+t)})),e.attributes.popper={}}}}];E()&&l&&h.push({name:"arrow",options:{element:l,padding:3}}),h.push.apply(h,(null==n?void 0:n.modifiers)||[]),_.popperInstance=Re(c,x,Object.assign({},n,{placement:i,onFirstUpdate:s,modifiers:h}))}function et(){_.popperInstance&&(_.popperInstance.destroy(),_.popperInstance=null)}function nt(){var t,e=_.props.appendTo,n=M();(t=_.props.interactive&&e===kn.appendTo||"parent"===e?n.parentNode:We(e,[n])).contains(x)||t.appendChild(x),tt()}function it(){return Je(x.querySelectorAll("[data-tippy-root]"))}function rt(t){_.clearDelayTimeouts(),t&&$("onTrigger",[_,t]),B();var e=T(!0),i=S(),r=i[0],o=i[1];un.isTouch&&"hold"===r&&o&&(e=o),e?n=setTimeout((function(){_.show()}),e):_.show()}function ot(t){if(_.clearDelayTimeouts(),$("onUntrigger",[_,t]),_.state.isVisible){if(!(_.props.trigger.indexOf("mouseenter")>=0&&_.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&h)){var e=T(!1);e?i=setTimeout((function(){_.state.isVisible&&_.hide()}),e):r=requestAnimationFrame((function(){_.hide()}))}}else D()}function at(){_.state.isEnabled=!0}function st(){_.hide(),_.state.isEnabled=!1}function lt(){clearTimeout(n),clearTimeout(i),cancelAnimationFrame(r)}function ct(e){if(!_.state.isDestroyed){$("onBeforeUpdate",[_,e]),X();var n=_.props,i=En(t,Object.assign({},_.props,{},e,{ignoreAttributes:!0}));_.props=i,G(),n.interactiveDebounce!==i.interactiveDebounce&&(R(),f=Ge(Z,i.interactiveDebounce)),n.triggerTarget&&!i.triggerTarget?Ke(n.triggerTarget).forEach((function(t){t.removeAttribute("aria-expanded")})):i.triggerTarget&&t.removeAttribute("aria-expanded"),P(),V(),k&&k(n,i),_.popperInstance&&(tt(),it().forEach((function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)}))),$("onAfterUpdate",[_,e])}}function ht(t){_.setProps({content:t})}function pt(){var t=_.state.isVisible,e=_.state.isDestroyed,n=!_.state.isEnabled,i=un.isTouch&&!_.props.touch,r=qe(_.props.duration,0,kn.duration);if(!(t||e||n||i||M().hasAttribute("disabled")||($("onShow",[_],!1),!1===_.props.onShow(_)))){if(_.state.isVisible=!0,E()&&(x.style.visibility="visible"),V(),B(),_.state.isMounted||(x.style.transition="none"),E()){var o=H();ln([o.box,o.content],0)}s=function(){var t;if(_.state.isVisible&&!u){if(u=!0,x.offsetHeight,x.style.transition=_.props.moveTransition,E()&&_.props.animation){var e=H(),n=e.box,i=e.content;ln([n,i],r),cn([n,i],"visible")}O(),P(),Ze(Rn,_),null==(t=_.popperInstance)||t.forceUpdate(),_.state.isMounted=!0,$("onMount",[_]),_.props.animation&&E()&&q(r,(function(){_.state.isShown=!0,$("onShown",[_])}))}},nt()}}function dt(){var t=!_.state.isVisible,e=_.state.isDestroyed,n=!_.state.isEnabled,i=qe(_.props.duration,1,kn.duration);if(!(t||e||n)&&($("onHide",[_],!1),!1!==_.props.onHide(_))){if(_.state.isVisible=!1,_.state.isShown=!1,u=!1,h=!1,E()&&(x.style.visibility="hidden"),R(),D(),V(),E()){var r=H(),o=r.box,a=r.content;_.props.animation&&(ln([o,a],i),cn([o,a],"hidden"))}O(),P(),_.props.animation?E()&&j(i,_.unmount):_.unmount()}}function ut(t){L().addEventListener("mousemove",f),Ze(Pn,f),f(t)}function gt(){_.state.isVisible&&_.hide(),_.state.isMounted&&(et(),it().forEach((function(t){t._tippy.unmount()})),x.parentNode&&x.parentNode.removeChild(x),Rn=Rn.filter((function(t){return t!==_})),_.state.isMounted=!1,$("onHidden",[_]))}function ft(){_.state.isDestroyed||(_.clearDelayTimeouts(),_.unmount(),X(),delete t._tippy,_.state.isDestroyed=!0,$("onDestroy",[_]))}}function Nn(t,e){void 0===e&&(e={});var n=kn.plugins.concat(e.plugins||[]);bn();var i=Object.assign({},e,{plugins:n}),r=sn(t).reduce((function(t,e){var n=e&&In(e,i);return n&&t.push(n),t}),[]);return nn(t)?r[0]:r}Nn.defaultProps=kn,Nn.setDefaultProps=An,Nn.currentInput=un;Object.assign({},xt,{effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow)}});function Fn(t){return t.replace(/(?:^\w|[A-Z]|\b\w)/g,(t,e)=>0==+t?"":0===e?t.toLowerCase():t.toUpperCase()).replace("-","")}Nn.setDefaultProps({render:$n});const Bn='\n .tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n }\n\n .tippy-iOS {\n cursor: pointer!important;\n -webkit-tap-highlight-color: transparent\n }\n\n [data-tippy-root] {\n max-width: calc(100vw - 10px)\n }\n\n .tippy-box {\n position: relative;\n background-color: #333;\n color: #fff;\n border-radius: 4px;\n font-size: var(--pb-popover-font-size, var(--pb-base-font-size, 14px));\n line-height: var(--pb-popover-line-height, var(--pb-base-line-height, 1.4));\n text-align: left;\n font-style: normal;\n font-weight: normal;\n outline: 0;\n transition-property: transform, visibility, opacity\n }\n\n .tippy-box[data-placement^=top]>.tippy-arrow {\n bottom: 0\n }\n\n .tippy-box[data-placement^=top]>.tippy-arrow:before {\n bottom: -7px;\n left: 0;\n border-width: 8px 8px 0;\n border-top-color: initial;\n transform-origin: center top\n }\n\n .tippy-box[data-placement^=bottom]>.tippy-arrow {\n top: 0\n }\n\n .tippy-box[data-placement^=bottom]>.tippy-arrow:before {\n top: -7px;\n left: 0;\n border-width: 0 8px 8px;\n border-bottom-color: initial;\n transform-origin: center bottom\n }\n\n .tippy-box[data-placement^=left]>.tippy-arrow {\n right: 0\n }\n\n .tippy-box[data-placement^=left]>.tippy-arrow:before {\n border-width: 8px 0 8px 8px;\n border-left-color: initial;\n right: -7px;\n transform-origin: center left\n }\n\n .tippy-box[data-placement^=right]>.tippy-arrow {\n left: 0\n }\n\n .tippy-box[data-placement^=right]>.tippy-arrow:before {\n left: -7px;\n border-width: 8px 8px 8px 0;\n border-right-color: initial;\n transform-origin: center right\n }\n\n .tippy-box[data-inertia][data-state=visible] {\n transition-timing-function: cubic-bezier(.54, 1.5, .38, 1.11)\n }\n\n .tippy-arrow {\n width: 16px;\n height: 16px;\n color: #333\n }\n\n .tippy-arrow:before {\n content: "";\n position: absolute;\n border-color: transparent;\n border-style: solid\n }\n\n .tippy-content {\n position: relative;\n padding: 5px 9px;\n z-index: 1;\n overflow: auto;\n max-height: var(--pb-popover-max-height, calc(100vh - 60px));\n min-height: var(--pb-popover-min-height, auto);\n max-width: var(--pb-popover-max-width, auto);\n min-width: var(--pb-popover-min-width, auto);\n color: var(--pb-popover-color);\n }\n',Dn='\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',jn="\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 }",qn="\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",Un="\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 Wn=Object.freeze({__proto__:null,camelize:Fn,base:Bn,lightBorder:Dn,light:jn,material:qn,translucent:Un});function Gn(t,e,n){if(!t.querySelector("#pb-popover-"+e)){const i=t.nodeType===Node.DOCUMENT_NODE?document.head:t;console.log("Loading tippy styles for theme %s into %o",e,i);const r=document.createElement("style");r.type="text/css",r.id="pb-popover-"+e,r.innerHTML=n,i.appendChild(r)}}function Xn(t,e){if(Gn(t,"base",Bn),e&&"none"!==e){const n=Fn(e),i=Wn[n];i&&Gn(t,n,i)}}class Kn extends(R(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{for:{type:String},theme:{type:String},placement:{type:String},fallbackPlacement:{type:String,attribute:"fallback-placement"},persistent:{type:Boolean},trigger:{type:String},popupClass:{type:String,attribute:"popup-class"},remote:{type:String}})}constructor(){super(),this.persistent=!1,this.trigger=null,this.for=null,this.theme=null,this.placement=null,this.fallbackPlacement=null,this.popupClass=null,this._tippy=null,this._content=null}render(){return this.for?$`<div class="hidden"><slot></slot></div>`:$`<span id="link" part="trigger" class="${this.persistent?"persistent":""}"><slot name="default"><slot></slot></slot></span><span class="hidden"><slot name="alternate"></slot></span>`}disconnectedCallback(){super.disconnectedCallback(),this._tippy&&this._tippy.destroy(),this._observer&&this._observer.disconnect()}_checkCSSProperties(){this.theme||"none"===this.theme||(this.theme=this._getCSSProperty("--pb-popover-theme","none")),this.placement||(this.placement=this._getCSSProperty("--pb-popover-placement","auto")),this.fallbackPlacement||(this.fallbackPlacement=this._getCSSProperty("--pb-popover-fallback-placement",null)),this.persistent||(this.persistent=this._getCSSProperty("--pb-popover-persistent",!1)),this.trigger||(this.trigger=this._getCSSProperty("--pb-popover-trigger",null))}_getCSSProperty(t,e){const n=getComputedStyle(this).getPropertyValue(t);if(n)try{return JSON.parse(n)}catch(t){return e}return e}_injectStyles(){this._checkCSSProperties(),Xn(this.getRootNode(),this.theme)}_getContent(){if(this._content)return this._content;const t=this._getSlot();if(t){const e=document.createElement("div");return t.assignedNodes().forEach(t=>{e.appendChild(t.content?t.content.cloneNode(!0):t.cloneNode(!0))}),this._content=e,e}return null}_getSlot(){return this.for?this.shadowRoot.querySelector("slot"):this.shadowRoot.querySelector("[name=alternate]")}_registerMutationObserver(){const t=this._getSlot();this._observer=new MutationObserver(()=>{this.alternate=this._getContent(),console.log("alternate changed"),this.emitTo("pb-popover-changed",this.alternate)}),this._observer.observe(this,{subtree:!0,childList:!0,characterData:!0}),t&&t.assignedNodes().forEach(t=>{this._observer.observe(t.content?t.content:t,{subtree:!0,childList:!0,characterData:!0})})}get alternate(){return this._getContent()}set alternate(t){this._content=t,this._tippy&&this._tippy.setContent(this._content)}command(t,e){"disable"===t&&(this.disabled=e,this._tippy&&(e?this._tippy.disable():this._tippy.enable()))}firstUpdated(){super.firstUpdated(),this._injectStyles(),this._registerMutationObserver(),this.trigger||(this.trigger=this.persistent?"click":"mouseenter");const t=this.getRootNode();let e;if(this.for?(e=t.getElementById(this.for),e||console.error("<pb-popover> target element %s not found",this.for)):e=this.shadowRoot.getElementById("link"),e){const n={allowHTML:!0,appendTo:t.nodeType===Node.DOCUMENT_NODE?document.body:t,placement:this.placement,interactive:!0,ignoreAttributes:!0,boundary:"viewport",maxWidth:"none",touch:"hold",hideOnClick:!1,trigger:this.trigger};if(this.persistent&&(n.onClickOutside=(t,e)=>{t.hideWithInteractivity(e)}),this.theme&&"none"!==this.theme&&(n.theme=this.theme),this.fallbackPlacement){const t=this.fallbackPlacement.split(" ");n.popperOptions={modifiers:[{name:"flip",options:{fallbackPlacements:t}}]}}this.popupClass&&(n.onCreate=t=>{t.popper.classList.add(this.popupClass)}),n.onShow=t=>{this.remote?this._loadRemoteContent():t.setContent(this._getContent()),this.emitTo("pb-popover-show",{source:this})},this._tippy=Nn(e,n)}}_loadRemoteContent(){const t=this.toAbsoluteURL(this.remote);fetch(t,{method:"GET",mode:"cors",credentials:"same-origin"}).then(t=>t.text()).then(t=>{this.alternate=t}).catch(t=>{console.error("<pb-popover> Error retrieving remote content: %o",t)})}static get styles(){return[P`
510
+ `}}customElements.define("pb-demo-snippet",Z);class Q{static subscribe(t,e,n,i=!1){e&&!Array.isArray(e)&&(e=[e]);const r=document.addEventListener(t,t=>{(e||t.detail&&t.detail.key)&&!(e&&t.detail&&t.detail.key&&e.indexOf(t.detail.key)>-1)||n&&n(t,r)},{once:i})}static subscribeOnce(t,e=null){return e&&!Array.isArray(e)&&(e=[e]),new Promise(n=>{document.addEventListener(t,t=>{(e||t.detail&&t.detail.key)&&!(e&&t.detail&&t.detail.key&&e.indexOf(t.detail.key)>-1)||n(t)},{once:!0})})}static emit(t,e=null,n=null){const i=n||{};e&&(i.key=e);const r=new CustomEvent(t,{detail:i});document.dispatchEvent(r)}}window.pbEvents||(window.pbEvents=Q);const Y="1.30.2";class J extends V{static get properties(){return Object.assign({version:{type:String,reflect:!0}},super.properties)}constructor(){super(),this.version=Y}connectedCallback(){if(super.connectedCallback(),!this.version){const t=O("../package.json");fetch(t).then(t=>t.json()).then(t=>{this.version=t.version})}}render(){return $`<span>${this.version?this.version:"unknown"}</span>`}createRenderRoot(){return this}}customElements.define("pb-version",J);var tt="top",et="bottom",nt="right",it="left",rt="auto",ot=[tt,et,nt,it],at="start",st="end",lt="clippingParents",ct="viewport",ht="popper",pt="reference",dt=ot.reduce((function(t,e){return t.concat([e+"-"+at,e+"-"+st])}),[]),ut=[].concat(ot,[rt]).reduce((function(t,e){return t.concat([e,e+"-"+at,e+"-"+st])}),[]),gt=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function ft(t){return t?(t.nodeName||"").toLowerCase():null}function mt(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function vt(t){return t instanceof mt(t).Element||t instanceof Element}function bt(t){return t instanceof mt(t).HTMLElement||t instanceof HTMLElement}function yt(t){return"undefined"!=typeof ShadowRoot&&(t instanceof mt(t).ShadowRoot||t instanceof ShadowRoot)}function _t(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var n=e.styles[t]||{},i=e.attributes[t]||{},r=e.elements[t];bt(r)&&ft(r)&&(Object.assign(r.style,n),Object.keys(i).forEach((function(t){var e=i[t];!1===e?r.removeAttribute(t):r.setAttribute(t,!0===e?"":e)})))}))}function wt(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach((function(t){var i=e.elements[t],r=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});bt(i)&&ft(i)&&(Object.assign(i.style,o),Object.keys(r).forEach((function(t){i.removeAttribute(t)})))}))}}var xt={name:"applyStyles",enabled:!0,phase:"write",fn:_t,effect:wt,requires:["computeStyles"]};function kt(t){return t.split("-")[0]}function zt(t){var e=t.getBoundingClientRect();return{width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left,x:e.left,y:e.top}}function At(t){var e=zt(t),n=t.offsetWidth,i=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:i}}function St(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&yt(n)){var i=e;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Ct(t){return mt(t).getComputedStyle(t)}function Et(t){return["table","td","th"].indexOf(ft(t))>=0}function Mt(t){return((vt(t)?t.ownerDocument:t.document)||window.document).documentElement}function Lt(t){return"html"===ft(t)?t:t.assignedSlot||t.parentNode||(yt(t)?t.host:null)||Mt(t)}function Ht(t){return bt(t)&&"fixed"!==Ct(t).position?t.offsetParent:null}function Tt(t){var e=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&bt(t)&&"fixed"===Ct(t).position)return null;for(var n=Lt(t);bt(n)&&["html","body"].indexOf(ft(n))<0;){var i=Ct(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||e&&"filter"===i.willChange||e&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}function Vt(t){for(var e=mt(t),n=Ht(t);n&&Et(n)&&"static"===Ct(n).position;)n=Ht(n);return n&&("html"===ft(n)||"body"===ft(n)&&"static"===Ct(n).position)?e:n||Tt(t)||e}function $t(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}var Ot=Math.max,Pt=Math.min,Rt=Math.round;function It(t,e,n){return Ot(t,Pt(e,n))}function Nt(){return{top:0,right:0,bottom:0,left:0}}function Ft(t){return Object.assign({},Nt(),t)}function Bt(t,e){return e.reduce((function(e,n){return e[n]=t,e}),{})}var Dt=function(t,e){return Ft("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Bt(t,ot))};function jt(t){var e,n=t.state,i=t.name,r=t.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=kt(n.placement),l=$t(s),c=[it,nt].indexOf(s)>=0?"height":"width";if(o&&a){var h=Dt(r.padding,n),p=At(o),d="y"===l?tt:it,u="y"===l?et:nt,g=n.rects.reference[c]+n.rects.reference[l]-a[l]-n.rects.popper[c],f=a[l]-n.rects.reference[l],m=Vt(o),v=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,b=g/2-f/2,y=h[d],_=v-p[c]-h[u],w=v/2-p[c]/2+b,x=It(y,w,_),k=l;n.modifiersData[i]=((e={})[k]=x,e.centerOffset=x-w,e)}}function qt(t){var e=t.state,n=t.options.element,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"!=typeof i||(i=e.elements.popper.querySelector(i)))&&St(e.elements.popper,i)&&(e.elements.arrow=i)}var Ut={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Wt(t){var e=t.x,n=t.y,i=window.devicePixelRatio||1;return{x:Rt(Rt(e*i)/i)||0,y:Rt(Rt(n*i)/i)||0}}function Gt(t){var e,n=t.popper,i=t.popperRect,r=t.placement,o=t.offsets,a=t.position,s=t.gpuAcceleration,l=t.adaptive,c=t.roundOffsets,h=!0===c?Wt(o):"function"==typeof c?c(o):o,p=h.x,d=void 0===p?0:p,u=h.y,g=void 0===u?0:u,f=o.hasOwnProperty("x"),m=o.hasOwnProperty("y"),v=it,b=tt,y=window;if(l){var _=Vt(n),w="clientHeight",x="clientWidth";_===mt(n)&&"static"!==Ct(_=Mt(n)).position&&(w="scrollHeight",x="scrollWidth"),_=_,r===tt&&(b=et,g-=_[w]-i.height,g*=s?1:-1),r===it&&(v=nt,d-=_[x]-i.width,d*=s?1:-1)}var k,z=Object.assign({position:a},l&&Ut);return s?Object.assign({},z,((k={})[b]=m?"0":"",k[v]=f?"0":"",k.transform=(y.devicePixelRatio||1)<2?"translate("+d+"px, "+g+"px)":"translate3d("+d+"px, "+g+"px, 0)",k)):Object.assign({},z,((e={})[b]=m?g+"px":"",e[v]=f?d+"px":"",e.transform="",e))}function Xt(t){var e=t.state,n=t.options,i=n.gpuAcceleration,r=void 0===i||i,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,l=void 0===s||s,c={placement:kt(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,Gt(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,Gt(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var Kt={passive:!0};function Zt(t){var e=t.state,n=t.instance,i=t.options,r=i.scroll,o=void 0===r||r,a=i.resize,s=void 0===a||a,l=mt(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach((function(t){t.addEventListener("scroll",n.update,Kt)})),s&&l.addEventListener("resize",n.update,Kt),function(){o&&c.forEach((function(t){t.removeEventListener("scroll",n.update,Kt)})),s&&l.removeEventListener("resize",n.update,Kt)}}var Qt={left:"right",right:"left",bottom:"top",top:"bottom"};function Yt(t){return t.replace(/left|right|bottom|top/g,(function(t){return Qt[t]}))}var Jt={start:"end",end:"start"};function te(t){return t.replace(/start|end/g,(function(t){return Jt[t]}))}function ee(t){var e=mt(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ne(t){return zt(Mt(t)).left+ee(t).scrollLeft}function ie(t){var e=mt(t),n=Mt(t),i=e.visualViewport,r=n.clientWidth,o=n.clientHeight,a=0,s=0;return i&&(r=i.width,o=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=i.offsetLeft,s=i.offsetTop)),{width:r,height:o,x:a+ne(t),y:s}}function re(t){var e,n=Mt(t),i=ee(t),r=null==(e=t.ownerDocument)?void 0:e.body,o=Ot(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=Ot(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),s=-i.scrollLeft+ne(t),l=-i.scrollTop;return"rtl"===Ct(r||n).direction&&(s+=Ot(n.clientWidth,r?r.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function oe(t){var e=Ct(t),n=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function ae(t){return["html","body","#document"].indexOf(ft(t))>=0?t.ownerDocument.body:bt(t)&&oe(t)?t:ae(Lt(t))}function se(t,e){var n;void 0===e&&(e=[]);var i=ae(t),r=i===(null==(n=t.ownerDocument)?void 0:n.body),o=mt(i),a=r?[o].concat(o.visualViewport||[],oe(i)?i:[]):i,s=e.concat(a);return r?s:s.concat(se(Lt(a)))}function le(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function ce(t){var e=zt(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}function he(t,e){return e===ct?le(ie(t)):bt(e)?ce(e):le(re(Mt(t)))}function pe(t){var e=se(Lt(t)),n=["absolute","fixed"].indexOf(Ct(t).position)>=0&&bt(t)?Vt(t):t;return vt(n)?e.filter((function(t){return vt(t)&&St(t,n)&&"body"!==ft(t)})):[]}function de(t,e,n){var i="clippingParents"===e?pe(t):[].concat(e),r=[].concat(i,[n]),o=r[0],a=r.reduce((function(e,n){var i=he(t,n);return e.top=Ot(i.top,e.top),e.right=Pt(i.right,e.right),e.bottom=Pt(i.bottom,e.bottom),e.left=Ot(i.left,e.left),e}),he(t,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ue(t){return t.split("-")[1]}function ge(t){var e,n=t.reference,i=t.element,r=t.placement,o=r?kt(r):null,a=r?ue(r):null,s=n.x+n.width/2-i.width/2,l=n.y+n.height/2-i.height/2;switch(o){case tt:e={x:s,y:n.y-i.height};break;case et:e={x:s,y:n.y+n.height};break;case nt:e={x:n.x+n.width,y:l};break;case it:e={x:n.x-i.width,y:l};break;default:e={x:n.x,y:n.y}}var c=o?$t(o):null;if(null!=c){var h="y"===c?"height":"width";switch(a){case at:e[c]=e[c]-(n[h]/2-i[h]/2);break;case st:e[c]=e[c]+(n[h]/2-i[h]/2)}}return e}function fe(t,e){void 0===e&&(e={});var n=e,i=n.placement,r=void 0===i?t.placement:i,o=n.boundary,a=void 0===o?lt:o,s=n.rootBoundary,l=void 0===s?ct:s,c=n.elementContext,h=void 0===c?ht:c,p=n.altBoundary,d=void 0!==p&&p,u=n.padding,g=void 0===u?0:u,f=Ft("number"!=typeof g?g:Bt(g,ot)),m=h===ht?pt:ht,v=t.elements.reference,b=t.rects.popper,y=t.elements[d?m:h],_=de(vt(y)?y:y.contextElement||Mt(t.elements.popper),a,l),w=zt(v),x=ge({reference:w,element:b,strategy:"absolute",placement:r}),k=le(Object.assign({},b,x)),z=h===ht?k:w,A={top:_.top-z.top+f.top,bottom:z.bottom-_.bottom+f.bottom,left:_.left-z.left+f.left,right:z.right-_.right+f.right},S=t.modifiersData.offset;if(h===ht&&S){var C=S[r];Object.keys(A).forEach((function(t){var e=[nt,et].indexOf(t)>=0?1:-1,n=[tt,et].indexOf(t)>=0?"y":"x";A[t]+=C[n]*e}))}return A}function me(t,e){void 0===e&&(e={});var n=e,i=n.placement,r=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?ut:l,h=ue(i),p=h?s?dt:dt.filter((function(t){return ue(t)===h})):ot,d=p.filter((function(t){return c.indexOf(t)>=0}));0===d.length&&(d=p);var u=d.reduce((function(e,n){return e[n]=fe(t,{placement:n,boundary:r,rootBoundary:o,padding:a})[kt(n)],e}),{});return Object.keys(u).sort((function(t,e){return u[t]-u[e]}))}function ve(t){if(kt(t)===rt)return[];var e=Yt(t);return[te(t),e,te(e)]}function be(t){var e=t.state,n=t.options,i=t.name;if(!e.modifiersData[i]._skip){for(var r=n.mainAxis,o=void 0===r||r,a=n.altAxis,s=void 0===a||a,l=n.fallbackPlacements,c=n.padding,h=n.boundary,p=n.rootBoundary,d=n.altBoundary,u=n.flipVariations,g=void 0===u||u,f=n.allowedAutoPlacements,m=e.options.placement,v=kt(m),b=l||(v===m||!g?[Yt(m)]:ve(m)),y=[m].concat(b).reduce((function(t,n){return t.concat(kt(n)===rt?me(e,{placement:n,boundary:h,rootBoundary:p,padding:c,flipVariations:g,allowedAutoPlacements:f}):n)}),[]),_=e.rects.reference,w=e.rects.popper,x=new Map,k=!0,z=y[0],A=0;A<y.length;A++){var S=y[A],C=kt(S),E=ue(S)===at,M=[tt,et].indexOf(C)>=0,L=M?"width":"height",H=fe(e,{placement:S,boundary:h,rootBoundary:p,altBoundary:d,padding:c}),T=M?E?nt:it:E?et:tt;_[L]>w[L]&&(T=Yt(T));var V=Yt(T),$=[];if(o&&$.push(H[C]<=0),s&&$.push(H[T]<=0,H[V]<=0),$.every((function(t){return t}))){z=S,k=!1;break}x.set(S,$)}if(k)for(var O=function(t){var e=y.find((function(e){var n=x.get(e);if(n)return n.slice(0,t).every((function(t){return t}))}));if(e)return z=e,"break"},P=g?3:1;P>0;P--){if("break"===O(P))break}e.placement!==z&&(e.modifiersData[i]._skip=!0,e.placement=z,e.reset=!0)}}function ye(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function _e(t){return[tt,nt,et,it].some((function(e){return t[e]>=0}))}function we(t){var e=t.state,n=t.name,i=e.rects.reference,r=e.rects.popper,o=e.modifiersData.preventOverflow,a=fe(e,{elementContext:"reference"}),s=fe(e,{altBoundary:!0}),l=ye(a,i),c=ye(s,r,o),h=_e(l),p=_e(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:p},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":p})}function xe(t,e,n){var i=kt(t),r=[it,tt].indexOf(i)>=0?-1:1,o="function"==typeof n?n(Object.assign({},e,{placement:t})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*r,[it,nt].indexOf(i)>=0?{x:s,y:a}:{x:a,y:s}}function ke(t){var e=t.state,n=t.options,i=t.name,r=n.offset,o=void 0===r?[0,0]:r,a=ut.reduce((function(t,n){return t[n]=xe(n,e.rects,o),t}),{}),s=a[e.placement],l=s.x,c=s.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[i]=a}function ze(t){var e=t.state,n=t.name;e.modifiersData[n]=ge({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}function Ae(t){return"x"===t?"y":"x"}function Se(t){var e=t.state,n=t.options,i=t.name,r=n.mainAxis,o=void 0===r||r,a=n.altAxis,s=void 0!==a&&a,l=n.boundary,c=n.rootBoundary,h=n.altBoundary,p=n.padding,d=n.tether,u=void 0===d||d,g=n.tetherOffset,f=void 0===g?0:g,m=fe(e,{boundary:l,rootBoundary:c,padding:p,altBoundary:h}),v=kt(e.placement),b=ue(e.placement),y=!b,_=$t(v),w=Ae(_),x=e.modifiersData.popperOffsets,k=e.rects.reference,z=e.rects.popper,A="function"==typeof f?f(Object.assign({},e.rects,{placement:e.placement})):f,S={x:0,y:0};if(x){if(o||s){var C="y"===_?tt:it,E="y"===_?et:nt,M="y"===_?"height":"width",L=x[_],H=x[_]+m[C],T=x[_]-m[E],V=u?-z[M]/2:0,$=b===at?k[M]:z[M],O=b===at?-z[M]:-k[M],P=e.elements.arrow,R=u&&P?At(P):{width:0,height:0},I=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Nt(),N=I[C],F=I[E],B=It(0,k[M],R[M]),D=y?k[M]/2-V-B-N-A:$-B-N-A,j=y?-k[M]/2+V+B+F+A:O+B+F+A,q=e.elements.arrow&&Vt(e.elements.arrow),U=q?"y"===_?q.clientTop||0:q.clientLeft||0:0,W=e.modifiersData.offset?e.modifiersData.offset[e.placement][_]:0,G=x[_]+D-W-U,X=x[_]+j-W;if(o){var K=It(u?Pt(H,G):H,L,u?Ot(T,X):T);x[_]=K,S[_]=K-L}if(s){var Z="x"===_?tt:it,Q="x"===_?et:nt,Y=x[w],J=Y+m[Z],rt=Y-m[Q],ot=It(u?Pt(J,G):J,Y,u?Ot(rt,X):rt);x[w]=ot,S[w]=ot-Y}}e.modifiersData[i]=S}}function Ce(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Ee(t){return t!==mt(t)&&bt(t)?Ce(t):ee(t)}function Me(t,e,n){void 0===n&&(n=!1);var i=Mt(e),r=zt(t),o=bt(e),a={scrollLeft:0,scrollTop:0},s={x:0,y:0};return(o||!o&&!n)&&(("body"!==ft(e)||oe(i))&&(a=Ee(e)),bt(e)?((s=zt(e)).x+=e.clientLeft,s.y+=e.clientTop):i&&(s.x=ne(i))),{x:r.left+a.scrollLeft-s.x,y:r.top+a.scrollTop-s.y,width:r.width,height:r.height}}function Le(t){var e=new Map,n=new Set,i=[];function r(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!n.has(t)){var i=e.get(t);i&&r(i)}})),i.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||r(t)})),i}function He(t){var e=Le(t);return gt.reduce((function(t,n){return t.concat(e.filter((function(t){return t.phase===n})))}),[])}function Te(t){var e;return function(){return e||(e=new Promise((function(n){Promise.resolve().then((function(){e=void 0,n(t())}))}))),e}}function Ve(t){var e=t.reduce((function(t,e){var n=t[e.name];return t[e.name]=n?Object.assign({},n,e,{options:Object.assign({},n.options,e.options),data:Object.assign({},n.data,e.data)}):e,t}),{});return Object.keys(e).map((function(t){return e[t]}))}var $e={placement:"bottom",modifiers:[],strategy:"absolute"};function Oe(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function Pe(t){void 0===t&&(t={});var e=t,n=e.defaultModifiers,i=void 0===n?[]:n,r=e.defaultOptions,o=void 0===r?$e:r;return function(t,e,n){void 0===n&&(n=o);var r={placement:"bottom",orderedModifiers:[],options:Object.assign({},$e,o),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},a=[],s=!1,l={state:r,setOptions:function(n){h(),r.options=Object.assign({},o,r.options,n),r.scrollParents={reference:vt(t)?se(t):t.contextElement?se(t.contextElement):[],popper:se(e)};var a=He(Ve([].concat(i,r.options.modifiers)));return r.orderedModifiers=a.filter((function(t){return t.enabled})),c(),l.update()},forceUpdate:function(){if(!s){var t=r.elements,e=t.reference,n=t.popper;if(Oe(e,n)){r.rects={reference:Me(e,Vt(n),"fixed"===r.options.strategy),popper:At(n)},r.reset=!1,r.placement=r.options.placement,r.orderedModifiers.forEach((function(t){return r.modifiersData[t.name]=Object.assign({},t.data)}));for(var i=0;i<r.orderedModifiers.length;i++)if(!0!==r.reset){var o=r.orderedModifiers[i],a=o.fn,c=o.options,h=void 0===c?{}:c,p=o.name;"function"==typeof a&&(r=a({state:r,options:h,name:p,instance:l})||r)}else r.reset=!1,i=-1}}},update:Te((function(){return new Promise((function(t){l.forceUpdate(),t(r)}))})),destroy:function(){h(),s=!0}};if(!Oe(t,e))return l;function c(){r.orderedModifiers.forEach((function(t){var e=t.name,n=t.options,i=void 0===n?{}:n,o=t.effect;if("function"==typeof o){var s=o({state:r,name:e,instance:l,options:i}),c=function(){};a.push(s||c)}}))}function h(){a.forEach((function(t){return t()})),a=[]}return l.setOptions(n).then((function(t){!s&&n.onFirstUpdate&&n.onFirstUpdate(t)})),l}}var Re=Pe({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Zt,data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:ze,data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Xt,data:{}},xt,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:ke},{name:"flip",enabled:!0,phase:"main",fn:be,requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:Se,requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:jt,effect:qt,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:we}]}),Ie="tippy-box",Ne="tippy-content",Fe="tippy-backdrop",Be="tippy-arrow",De="tippy-svg-arrow",je={passive:!0,capture:!0};function qe(t,e,n){if(Array.isArray(t)){var i=t[e];return null==i?Array.isArray(n)?n[e]:n:i}return t}function Ue(t,e){var n={}.toString.call(t);return 0===n.indexOf("[object")&&n.indexOf(e+"]")>-1}function We(t,e){return"function"==typeof t?t.apply(void 0,e):t}function Ge(t,e){return 0===e?t:function(i){clearTimeout(n),n=setTimeout((function(){t(i)}),e)};var n}function Xe(t){return t.split(/\s+/).filter(Boolean)}function Ke(t){return[].concat(t)}function Ze(t,e){-1===t.indexOf(e)&&t.push(e)}function Qe(t){return t.filter((function(e,n){return t.indexOf(e)===n}))}function Ye(t){return t.split("-")[0]}function Je(t){return[].slice.call(t)}function tn(t){return Object.keys(t).reduce((function(e,n){return void 0!==t[n]&&(e[n]=t[n]),e}),{})}function en(){return document.createElement("div")}function nn(t){return["Element","Fragment"].some((function(e){return Ue(t,e)}))}function rn(t){return Ue(t,"NodeList")}function on(t){return Ue(t,"MouseEvent")}function an(t){return!(!t||!t._tippy||t._tippy.reference!==t)}function sn(t){return nn(t)?[t]:rn(t)?Je(t):Array.isArray(t)?t:Je(document.querySelectorAll(t))}function ln(t,e){t.forEach((function(t){t&&(t.style.transitionDuration=e+"ms")}))}function cn(t,e){t.forEach((function(t){t&&t.setAttribute("data-state",e)}))}function hn(t){var e,n=Ke(t)[0];return(null==n||null==(e=n.ownerDocument)?void 0:e.body)?n.ownerDocument:document}function pn(t,e){var n=e.clientX,i=e.clientY;return t.every((function(t){var e=t.popperRect,r=t.popperState,o=t.props.interactiveBorder,a=Ye(r.placement),s=r.modifiersData.offset;if(!s)return!0;var l="bottom"===a?s.top.y:0,c="top"===a?s.bottom.y:0,h="right"===a?s.left.x:0,p="left"===a?s.right.x:0,d=e.top-i+l>o,u=i-e.bottom-c>o,g=e.left-n+h>o,f=n-e.right-p>o;return d||u||g||f}))}function dn(t,e,n){var i=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(e){t[i](e,n)}))}var un={isTouch:!1},gn=0;function fn(){un.isTouch||(un.isTouch=!0,window.performance&&document.addEventListener("mousemove",mn))}function mn(){var t=performance.now();t-gn<20&&(un.isTouch=!1,document.removeEventListener("mousemove",mn)),gn=t}function vn(){var t=document.activeElement;if(an(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function bn(){document.addEventListener("touchstart",fn,je),window.addEventListener("blur",vn)}var yn="undefined"!=typeof window&&"undefined"!=typeof document?navigator.userAgent:"",_n=/MSIE |Trident\//.test(yn),wn={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},xn={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},kn=Object.assign({appendTo:function(){return document.body},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},wn,{},xn),zn=Object.keys(kn),An=function(t){Object.keys(t).forEach((function(e){kn[e]=t[e]}))};function Sn(t){var e=(t.plugins||[]).reduce((function(e,n){var i=n.name,r=n.defaultValue;return i&&(e[i]=void 0!==t[i]?t[i]:r),e}),{});return Object.assign({},t,{},e)}function Cn(t,e){return(e?Object.keys(Sn(Object.assign({},kn,{plugins:e}))):zn).reduce((function(e,n){var i=(t.getAttribute("data-tippy-"+n)||"").trim();if(!i)return e;if("content"===n)e[n]=i;else try{e[n]=JSON.parse(i)}catch(t){e[n]=i}return e}),{})}function En(t,e){var n=Object.assign({},e,{content:We(e.content,[t])},e.ignoreAttributes?{}:Cn(t,e.plugins));return n.aria=Object.assign({},kn.aria,{},n.aria),n.aria={expanded:"auto"===n.aria.expanded?e.interactive:n.aria.expanded,content:"auto"===n.aria.content?e.interactive?null:"describedby":n.aria.content},n}var Mn=function(){return"innerHTML"};function Ln(t,e){t[Mn()]=e}function Hn(t){var e=en();return!0===t?e.className=Be:(e.className=De,nn(t)?e.appendChild(t):Ln(e,t)),e}function Tn(t,e){nn(e.content)?(Ln(t,""),t.appendChild(e.content)):"function"!=typeof e.content&&(e.allowHTML?Ln(t,e.content):t.textContent=e.content)}function Vn(t){var e=t.firstElementChild,n=Je(e.children);return{box:e,content:n.find((function(t){return t.classList.contains(Ne)})),arrow:n.find((function(t){return t.classList.contains(Be)||t.classList.contains(De)})),backdrop:n.find((function(t){return t.classList.contains(Fe)}))}}function $n(t){var e=en(),n=en();n.className=Ie,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var i=en();function r(n,i){var r=Vn(e),o=r.box,a=r.content,s=r.arrow;i.theme?o.setAttribute("data-theme",i.theme):o.removeAttribute("data-theme"),"string"==typeof i.animation?o.setAttribute("data-animation",i.animation):o.removeAttribute("data-animation"),i.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof i.maxWidth?i.maxWidth+"px":i.maxWidth,i.role?o.setAttribute("role",i.role):o.removeAttribute("role"),n.content===i.content&&n.allowHTML===i.allowHTML||Tn(a,t.props),i.arrow?s?n.arrow!==i.arrow&&(o.removeChild(s),o.appendChild(Hn(i.arrow))):o.appendChild(Hn(i.arrow)):s&&o.removeChild(s)}return i.className=Ne,i.setAttribute("data-state","hidden"),Tn(i,t.props),e.appendChild(n),n.appendChild(i),r(t.props,t.props),{popper:e,onUpdate:r}}$n.$$tippy=!0;var On=1,Pn=[],Rn=[];function In(t,e){var n,i,r,o,a,s,l,c=En(t,Object.assign({},kn,{},Sn(tn(e)))),h=!1,p=!1,d=!1,u=!1,g=[],f=Ge(Z,c.interactiveDebounce),m=On++,v=null,b=Qe(c.plugins),y={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},_={id:m,reference:t,popper:en(),popperInstance:v,props:c,state:y,plugins:b,clearDelayTimeouts:lt,setProps:ct,setContent:ht,show:pt,hide:dt,hideWithInteractivity:ut,enable:at,disable:st,unmount:gt,destroy:ft};if(!c.render)return _;var w=c.render(_),x=w.popper,k=w.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+_.id,_.popper=x,t._tippy=_,x._tippy=_;var z=b.map((function(t){return t.fn(_)})),A=t.hasAttribute("aria-expanded");return G(),P(),V(),$("onCreate",[_]),c.showOnCreate&&rt(),x.addEventListener("mouseenter",(function(){_.props.interactive&&_.state.isVisible&&_.clearDelayTimeouts()})),x.addEventListener("mouseleave",(function(t){_.props.interactive&&_.props.trigger.indexOf("mouseenter")>=0&&(L().addEventListener("mousemove",f),f(t))})),_;function S(){var t=_.props.touch;return Array.isArray(t)?t:[t,0]}function C(){return"hold"===S()[0]}function E(){var t;return!!(null==(t=_.props.render)?void 0:t.$$tippy)}function M(){return l||t}function L(){var t=M().parentNode;return t?hn(t):document}function H(){return Vn(x)}function T(t){return _.state.isMounted&&!_.state.isVisible||un.isTouch||o&&"focus"===o.type?0:qe(_.props.delay,t?0:1,kn.delay)}function V(){x.style.pointerEvents=_.props.interactive&&_.state.isVisible?"":"none",x.style.zIndex=""+_.props.zIndex}function $(t,e,n){var i;(void 0===n&&(n=!0),z.forEach((function(n){n[t]&&n[t].apply(void 0,e)})),n)&&(i=_.props)[t].apply(i,e)}function O(){var e=_.props.aria;if(e.content){var n="aria-"+e.content,i=x.id;Ke(_.props.triggerTarget||t).forEach((function(t){var e=t.getAttribute(n);if(_.state.isVisible)t.setAttribute(n,e?e+" "+i:i);else{var r=e&&e.replace(i,"").trim();r?t.setAttribute(n,r):t.removeAttribute(n)}}))}}function P(){!A&&_.props.aria.expanded&&Ke(_.props.triggerTarget||t).forEach((function(t){_.props.interactive?t.setAttribute("aria-expanded",_.state.isVisible&&t===M()?"true":"false"):t.removeAttribute("aria-expanded")}))}function R(){L().removeEventListener("mousemove",f),Pn=Pn.filter((function(t){return t!==f}))}function I(t){if(!(un.isTouch&&(d||"mousedown"===t.type)||_.props.interactive&&x.contains(t.target))){if(M().contains(t.target)){if(un.isTouch)return;if(_.state.isVisible&&_.props.trigger.indexOf("click")>=0)return}else $("onClickOutside",[_,t]);!0===_.props.hideOnClick&&(_.clearDelayTimeouts(),_.hide(),p=!0,setTimeout((function(){p=!1})),_.state.isMounted||D())}}function N(){d=!0}function F(){d=!1}function B(){var t=L();t.addEventListener("mousedown",I,!0),t.addEventListener("touchend",I,je),t.addEventListener("touchstart",F,je),t.addEventListener("touchmove",N,je)}function D(){var t=L();t.removeEventListener("mousedown",I,!0),t.removeEventListener("touchend",I,je),t.removeEventListener("touchstart",F,je),t.removeEventListener("touchmove",N,je)}function j(t,e){U(t,(function(){!_.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&e()}))}function q(t,e){U(t,e)}function U(t,e){var n=H().box;function i(t){t.target===n&&(dn(n,"remove",i),e())}if(0===t)return e();dn(n,"remove",a),dn(n,"add",i),a=i}function W(e,n,i){void 0===i&&(i=!1),Ke(_.props.triggerTarget||t).forEach((function(t){t.addEventListener(e,n,i),g.push({node:t,eventType:e,handler:n,options:i})}))}function G(){C()&&(W("touchstart",K,{passive:!0}),W("touchend",Q,{passive:!0})),Xe(_.props.trigger).forEach((function(t){if("manual"!==t)switch(W(t,K),t){case"mouseenter":W("mouseleave",Q);break;case"focus":W(_n?"focusout":"blur",Y);break;case"focusin":W("focusout",Y)}}))}function X(){g.forEach((function(t){var e=t.node,n=t.eventType,i=t.handler,r=t.options;e.removeEventListener(n,i,r)})),g=[]}function K(t){var e,n=!1;if(_.state.isEnabled&&!J(t)&&!p){var i="focus"===(null==(e=o)?void 0:e.type);o=t,l=t.currentTarget,P(),!_.state.isVisible&&on(t)&&Pn.forEach((function(e){return e(t)})),"click"===t.type&&(_.props.trigger.indexOf("mouseenter")<0||h)&&!1!==_.props.hideOnClick&&_.state.isVisible?n=!0:rt(t),"click"===t.type&&(h=!n),n&&!i&&ot(t)}}function Z(t){var e=t.target,n=M().contains(e)||x.contains(e);"mousemove"===t.type&&n||pn(it().concat(x).map((function(t){var e,n=null==(e=t._tippy.popperInstance)?void 0:e.state;return n?{popperRect:t.getBoundingClientRect(),popperState:n,props:c}:null})).filter(Boolean),t)&&(R(),ot(t))}function Q(t){J(t)||_.props.trigger.indexOf("click")>=0&&h||(_.props.interactive?_.hideWithInteractivity(t):ot(t))}function Y(t){_.props.trigger.indexOf("focusin")<0&&t.target!==M()||_.props.interactive&&t.relatedTarget&&x.contains(t.relatedTarget)||ot(t)}function J(t){return!!un.isTouch&&C()!==t.type.indexOf("touch")>=0}function tt(){et();var e=_.props,n=e.popperOptions,i=e.placement,r=e.offset,o=e.getReferenceClientRect,a=e.moveTransition,l=E()?Vn(x).arrow:null,c=o?{getBoundingClientRect:o,contextElement:o.contextElement||M()}:t,h=[{name:"offset",options:{offset:r}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var e=t.state;if(E()){var n=H().box;["placement","reference-hidden","escaped"].forEach((function(t){"placement"===t?n.setAttribute("data-placement",e.placement):e.attributes.popper["data-popper-"+t]?n.setAttribute("data-"+t,""):n.removeAttribute("data-"+t)})),e.attributes.popper={}}}}];E()&&l&&h.push({name:"arrow",options:{element:l,padding:3}}),h.push.apply(h,(null==n?void 0:n.modifiers)||[]),_.popperInstance=Re(c,x,Object.assign({},n,{placement:i,onFirstUpdate:s,modifiers:h}))}function et(){_.popperInstance&&(_.popperInstance.destroy(),_.popperInstance=null)}function nt(){var t,e=_.props.appendTo,n=M();(t=_.props.interactive&&e===kn.appendTo||"parent"===e?n.parentNode:We(e,[n])).contains(x)||t.appendChild(x),tt()}function it(){return Je(x.querySelectorAll("[data-tippy-root]"))}function rt(t){_.clearDelayTimeouts(),t&&$("onTrigger",[_,t]),B();var e=T(!0),i=S(),r=i[0],o=i[1];un.isTouch&&"hold"===r&&o&&(e=o),e?n=setTimeout((function(){_.show()}),e):_.show()}function ot(t){if(_.clearDelayTimeouts(),$("onUntrigger",[_,t]),_.state.isVisible){if(!(_.props.trigger.indexOf("mouseenter")>=0&&_.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&h)){var e=T(!1);e?i=setTimeout((function(){_.state.isVisible&&_.hide()}),e):r=requestAnimationFrame((function(){_.hide()}))}}else D()}function at(){_.state.isEnabled=!0}function st(){_.hide(),_.state.isEnabled=!1}function lt(){clearTimeout(n),clearTimeout(i),cancelAnimationFrame(r)}function ct(e){if(!_.state.isDestroyed){$("onBeforeUpdate",[_,e]),X();var n=_.props,i=En(t,Object.assign({},_.props,{},e,{ignoreAttributes:!0}));_.props=i,G(),n.interactiveDebounce!==i.interactiveDebounce&&(R(),f=Ge(Z,i.interactiveDebounce)),n.triggerTarget&&!i.triggerTarget?Ke(n.triggerTarget).forEach((function(t){t.removeAttribute("aria-expanded")})):i.triggerTarget&&t.removeAttribute("aria-expanded"),P(),V(),k&&k(n,i),_.popperInstance&&(tt(),it().forEach((function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)}))),$("onAfterUpdate",[_,e])}}function ht(t){_.setProps({content:t})}function pt(){var t=_.state.isVisible,e=_.state.isDestroyed,n=!_.state.isEnabled,i=un.isTouch&&!_.props.touch,r=qe(_.props.duration,0,kn.duration);if(!(t||e||n||i||M().hasAttribute("disabled")||($("onShow",[_],!1),!1===_.props.onShow(_)))){if(_.state.isVisible=!0,E()&&(x.style.visibility="visible"),V(),B(),_.state.isMounted||(x.style.transition="none"),E()){var o=H();ln([o.box,o.content],0)}s=function(){var t;if(_.state.isVisible&&!u){if(u=!0,x.offsetHeight,x.style.transition=_.props.moveTransition,E()&&_.props.animation){var e=H(),n=e.box,i=e.content;ln([n,i],r),cn([n,i],"visible")}O(),P(),Ze(Rn,_),null==(t=_.popperInstance)||t.forceUpdate(),_.state.isMounted=!0,$("onMount",[_]),_.props.animation&&E()&&q(r,(function(){_.state.isShown=!0,$("onShown",[_])}))}},nt()}}function dt(){var t=!_.state.isVisible,e=_.state.isDestroyed,n=!_.state.isEnabled,i=qe(_.props.duration,1,kn.duration);if(!(t||e||n)&&($("onHide",[_],!1),!1!==_.props.onHide(_))){if(_.state.isVisible=!1,_.state.isShown=!1,u=!1,h=!1,E()&&(x.style.visibility="hidden"),R(),D(),V(),E()){var r=H(),o=r.box,a=r.content;_.props.animation&&(ln([o,a],i),cn([o,a],"hidden"))}O(),P(),_.props.animation?E()&&j(i,_.unmount):_.unmount()}}function ut(t){L().addEventListener("mousemove",f),Ze(Pn,f),f(t)}function gt(){_.state.isVisible&&_.hide(),_.state.isMounted&&(et(),it().forEach((function(t){t._tippy.unmount()})),x.parentNode&&x.parentNode.removeChild(x),Rn=Rn.filter((function(t){return t!==_})),_.state.isMounted=!1,$("onHidden",[_]))}function ft(){_.state.isDestroyed||(_.clearDelayTimeouts(),_.unmount(),X(),delete t._tippy,_.state.isDestroyed=!0,$("onDestroy",[_]))}}function Nn(t,e){void 0===e&&(e={});var n=kn.plugins.concat(e.plugins||[]);bn();var i=Object.assign({},e,{plugins:n}),r=sn(t).reduce((function(t,e){var n=e&&In(e,i);return n&&t.push(n),t}),[]);return nn(t)?r[0]:r}Nn.defaultProps=kn,Nn.setDefaultProps=An,Nn.currentInput=un;Object.assign({},xt,{effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow)}});function Fn(t){return t.replace(/(?:^\w|[A-Z]|\b\w)/g,(t,e)=>0==+t?"":0===e?t.toLowerCase():t.toUpperCase()).replace("-","")}Nn.setDefaultProps({render:$n});const Bn='\n .tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n }\n\n .tippy-iOS {\n cursor: pointer!important;\n -webkit-tap-highlight-color: transparent\n }\n\n [data-tippy-root] {\n max-width: calc(100vw - 10px)\n }\n\n .tippy-box {\n position: relative;\n background-color: #333;\n color: #fff;\n border-radius: 4px;\n font-size: var(--pb-popover-font-size, var(--pb-base-font-size, 14px));\n line-height: var(--pb-popover-line-height, var(--pb-base-line-height, 1.4));\n text-align: left;\n font-style: normal;\n font-weight: normal;\n outline: 0;\n transition-property: transform, visibility, opacity\n }\n\n .tippy-box[data-placement^=top]>.tippy-arrow {\n bottom: 0\n }\n\n .tippy-box[data-placement^=top]>.tippy-arrow:before {\n bottom: -7px;\n left: 0;\n border-width: 8px 8px 0;\n border-top-color: initial;\n transform-origin: center top\n }\n\n .tippy-box[data-placement^=bottom]>.tippy-arrow {\n top: 0\n }\n\n .tippy-box[data-placement^=bottom]>.tippy-arrow:before {\n top: -7px;\n left: 0;\n border-width: 0 8px 8px;\n border-bottom-color: initial;\n transform-origin: center bottom\n }\n\n .tippy-box[data-placement^=left]>.tippy-arrow {\n right: 0\n }\n\n .tippy-box[data-placement^=left]>.tippy-arrow:before {\n border-width: 8px 0 8px 8px;\n border-left-color: initial;\n right: -7px;\n transform-origin: center left\n }\n\n .tippy-box[data-placement^=right]>.tippy-arrow {\n left: 0\n }\n\n .tippy-box[data-placement^=right]>.tippy-arrow:before {\n left: -7px;\n border-width: 8px 8px 8px 0;\n border-right-color: initial;\n transform-origin: center right\n }\n\n .tippy-box[data-inertia][data-state=visible] {\n transition-timing-function: cubic-bezier(.54, 1.5, .38, 1.11)\n }\n\n .tippy-arrow {\n width: 16px;\n height: 16px;\n color: #333\n }\n\n .tippy-arrow:before {\n content: "";\n position: absolute;\n border-color: transparent;\n border-style: solid\n }\n\n .tippy-content {\n position: relative;\n padding: 5px 9px;\n z-index: 1;\n overflow: auto;\n max-height: var(--pb-popover-max-height, calc(100vh - 60px));\n min-height: var(--pb-popover-min-height, auto);\n max-width: var(--pb-popover-max-width, auto);\n min-width: var(--pb-popover-min-width, auto);\n color: var(--pb-popover-color);\n }\n',Dn='\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',jn="\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 }",qn="\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",Un="\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 Wn=Object.freeze({__proto__:null,camelize:Fn,base:Bn,lightBorder:Dn,light:jn,material:qn,translucent:Un});function Gn(t,e,n){if(!t.querySelector("#pb-popover-"+e)){const i=t.nodeType===Node.DOCUMENT_NODE?document.head:t;console.log("Loading tippy styles for theme %s into %o",e,i);const r=document.createElement("style");r.type="text/css",r.id="pb-popover-"+e,r.innerHTML=n,i.appendChild(r)}}function Xn(t,e){if(Gn(t,"base",Bn),e&&"none"!==e){const n=Fn(e),i=Wn[n];i&&Gn(t,n,i)}}class Kn extends(R(V)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{for:{type:String},theme:{type:String},placement:{type:String},fallbackPlacement:{type:String,attribute:"fallback-placement"},persistent:{type:Boolean},trigger:{type:String},popupClass:{type:String,attribute:"popup-class"},remote:{type:String}})}constructor(){super(),this.persistent=!1,this.trigger=null,this.for=null,this.theme=null,this.placement=null,this.fallbackPlacement=null,this.popupClass=null,this._tippy=null,this._content=null}render(){return this.for?$`<div class="hidden"><slot></slot></div>`:$`<span id="link" part="trigger" class="${this.persistent?"persistent":""}"><slot name="default"><slot></slot></slot></span><span class="hidden"><slot name="alternate"></slot></span>`}disconnectedCallback(){super.disconnectedCallback(),this._tippy&&this._tippy.destroy(),this._observer&&this._observer.disconnect()}_checkCSSProperties(){this.theme||"none"===this.theme||(this.theme=this._getCSSProperty("--pb-popover-theme","none")),this.placement||(this.placement=this._getCSSProperty("--pb-popover-placement","auto")),this.fallbackPlacement||(this.fallbackPlacement=this._getCSSProperty("--pb-popover-fallback-placement",null)),this.persistent||(this.persistent=this._getCSSProperty("--pb-popover-persistent",!1)),this.trigger||(this.trigger=this._getCSSProperty("--pb-popover-trigger",null))}_getCSSProperty(t,e){const n=getComputedStyle(this).getPropertyValue(t);if(n)try{return JSON.parse(n)}catch(t){return e}return e}_injectStyles(){this._checkCSSProperties(),Xn(this.getRootNode(),this.theme)}_getContent(){if(this._content)return this._content;const t=this._getSlot();if(t){const e=document.createElement("div");return t.assignedNodes().forEach(t=>{e.appendChild(t.content?t.content.cloneNode(!0):t.cloneNode(!0))}),this._content=e,e}return null}_getSlot(){return this.for?this.shadowRoot.querySelector("slot"):this.shadowRoot.querySelector("[name=alternate]")}_registerMutationObserver(){const t=this._getSlot();this._observer=new MutationObserver(()=>{this.alternate=this._getContent(),console.log("alternate changed"),this.emitTo("pb-popover-changed",this.alternate)}),this._observer.observe(this,{subtree:!0,childList:!0,characterData:!0}),t&&t.assignedNodes().forEach(t=>{this._observer.observe(t.content?t.content:t,{subtree:!0,childList:!0,characterData:!0})})}get alternate(){return this._getContent()}set alternate(t){this._content=t,this._tippy&&this._tippy.setContent(this._content)}command(t,e){"disable"===t&&(this.disabled=e,this._tippy&&(e?this._tippy.disable():this._tippy.enable()))}firstUpdated(){super.firstUpdated(),this._injectStyles(),this._registerMutationObserver(),this.trigger||(this.trigger=this.persistent?"click":"mouseenter");const t=this.getRootNode();let e;if(this.for?(e=t.getElementById(this.for),e||console.error("<pb-popover> target element %s not found",this.for)):e=this.shadowRoot.getElementById("link"),e){const n={allowHTML:!0,appendTo:t.nodeType===Node.DOCUMENT_NODE?document.body:t,placement:this.placement,interactive:!0,ignoreAttributes:!0,boundary:"viewport",maxWidth:"none",touch:"hold",hideOnClick:!1,trigger:this.trigger};if(this.persistent&&(n.onClickOutside=(t,e)=>{t.hideWithInteractivity(e)}),this.theme&&"none"!==this.theme&&(n.theme=this.theme),this.fallbackPlacement){const t=this.fallbackPlacement.split(" ");n.popperOptions={modifiers:[{name:"flip",options:{fallbackPlacements:t}}]}}this.popupClass&&(n.onCreate=t=>{t.popper.classList.add(this.popupClass)}),n.onShow=t=>{this.remote?this._loadRemoteContent():t.setContent(this._getContent()),this.emitTo("pb-popover-show",{source:this})},this._tippy=Nn(e,n)}}_loadRemoteContent(){const t=this.toAbsoluteURL(this.remote);fetch(t,{method:"GET",mode:"cors",credentials:"same-origin"}).then(t=>t.text()).then(t=>{this.alternate=t}).catch(t=>{console.error("<pb-popover> Error retrieving remote content: %o",t)})}static get styles(){return[P`
511
511
  :host {
512
512
  display: inline;
513
513
  }
@@ -1219,7 +1219,7 @@ e({_template:n`
1219
1219
  with-credentials
1220
1220
  @response="${this._handleContent}"
1221
1221
  @error="${this._handleError}"></iron-ajax>
1222
- `]}}customElements.define("pb-view",va);const ba=[0,100],ya=[0,100],_a=t=>`${1===t.length?"0":""}${t}`,wa=(t,e,n)=>Math.max(Math.min(t,n),e),xa=(t,e)=>Math.floor(Math.random()*(e-t+1))+t,ka=t=>{const e=t.length;let n=0;for(let i=0;i<e;i++)n=(n<<5)-n+t.charCodeAt(i),n&=n;return n},za=(t,e)=>"number"==typeof e?e:t%Math.abs(e[1]-e[0])+e[0],Aa=(t,e)=>"number"==typeof t?wa(Math.abs(t),...e):1===t.length||t[0]===t[1]?wa(Math.abs(t[0]),...e):[Math.abs(wa(t[0],...e)),wa(Math.abs(t[1]),...e)],Sa=(t,e,n)=>(n<0?n+=1:n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t),Ca=(t,e,n)=>{let i,r,o;if(t/=360,n/=100,0===(e/=100))i=r=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,s=2*n-a;i=Sa(s,a,t+1/3),r=Sa(s,a,t),o=Sa(s,a,t-1/3)}return[Math.round(255*i),Math.round(255*r),Math.round(255*o)]},Ea=(t,e,n,i)=>(299*t+587*e+114*n)/1e3>=i,Ma=(t,e,n)=>`hsl(${t}, ${e}%, ${n}%)`,La=(t,e,n,i)=>{switch(i){case"rgb":return`rgb(${t}, ${e}, ${n})`;case"hex":default:return`#${_a(t.toString(16))}${_a(e.toString(16))}${_a(n.toString(16))}`}},Ha=(t,{format:e="hex",saturation:n=[50,55],lightness:i=[50,60],differencePoint:r=130}={})=>{const o=Math.abs(ka(String(t))),a=za(o,[0,360]),s=za(o,Aa(n,ba)),l=za(o,Aa(i,ya)),[c,h,p]=Ca(a,s,l);return{color:"hsl"===e?Ma(a,s,l):La(c,h,p,e),isLight:Ea(c,h,p,r)}};function Ta(t,e){let n=t;for(;n.parentNode!==e;)n=n.parentElement;return n}function Va(t){let e=t;e.nodeType===Node.TEXT_NODE&&(e=e.parentNode);const n=e.getAttribute("href");return n&&/^#fn_.*$/.test(n)}function $a(t,e,n){const i=document.createTreeWalker(t);for(i.currentNode=e;i.previousNode();){const t=i.currentNode;t.nodeType===Node.ELEMENT_NODE||Va(t)||(n+=t.textContent.length)}return n}function Oa(t,e,n="start"){if(t.nodeType===Node.ELEMENT_NODE){const i=t.closest("[data-tei]");if(0===e)return{parent:i.getAttribute("data-tei"),offset:0};const r=i.childNodes[e];return{parent:i.getAttribute("data-tei"),offset:"end"===n?$a(i,r,0)-1:$a(i,r,0)}}const i=t.parentNode.closest("[data-tei]");if(i)return{parent:i.getAttribute("data-tei"),offset:$a(i,t,e)};console.error("No container with data-tei found for %o",t.parentNode)}function Pa(t,e){let n=0,i=t.parentNode;for(;i&&i!==t.getRootNode();)i.classList.contains(e)&&(n+=1),i=i.parentNode;return n}function Ra(t,e){const n=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);return n.currentNode=e,n.nextNode()?n.currentNode:e}function Ia(t,e){let n=e;const i=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;i.nextNode();)if(!Va(i.currentNode)&&i.currentNode.textContent.length>0){if(n-i.currentNode.textContent.length<=0)return[i.currentNode,n];n-=i.currentNode.textContent.length}return null}function Na(t,e,n,i=3){let r=e-1,o=0;for(;r>=0;){if(/[\p{P}\s]/.test(t.charAt(r))){for(;r>1&&/[\p{P}\s]/.test(t.charAt(r-1));)r-=1;if(o+=1,o===i)break}r-=1}let a=n+1;for(o=0;a<t.length;){if(/[\p{P}\s]/.test(t.charAt(a))){for(;a<t.length-1&&/[\p{P}\s]/.test(t.charAt(a+1));)a+=1;if(o+=1,o===i)break}a+=1}return`... ${t.substring(r,e)}<mark>${t.substring(e,n)}</mark>${t.substring(n,a+1)} ...`}function Fa(t){let e=t.parentElement;e.textContent.length<40&&(e=e.parentNode);const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let i=0,r=0;const o=[];for(;n.nextNode();)n.currentNode===t&&(r=i),i+=n.currentNode.textContent.length,o.push(n.currentNode.textContent);return[o.join(""),r]}function Ba(t){const e={};return Object.keys(t.properties).forEach(n=>{const i=t.properties[n];i&&i.length>0&&(e[n]=i)}),Object.assign(t,{properties:e})}Ha.random=({format:t="hex",saturation:e=[50,55],lightness:n=[50,60],differencePoint:i=130}={})=>{e=Aa(e,ba),n=Aa(n,ya);const r=xa(0,360),o="number"==typeof e?e:xa(...e),a="number"==typeof n?n:xa(...n),[s,l,c]=Ca(r,o,a);return{color:"hsl"===t?Ma(r,o,a):La(s,l,c,t),isLight:Ea(s,l,c,i)}};class Da extends va{static get properties(){return Object.assign({key:{type:String},caseSensitive:{type:Boolean}},super.properties)}constructor(){super(),this.key="ref",this.caseSensitive=!1,this._ranges=[],this._rangesMap=new Map,this._history=[]}connectedCallback(){super.connectedCallback();let t=!1;this._inHandler=!1,this._pendingCallback=null;const e=(t=10)=>{this._pendingCallback=setTimeout(()=>{this._selectionChanged()},t)};this._eventHandler=n=>{if("selectionchange"===n.type&&this._inHandler)return;if("mousedown"===n.type&&(t=!0),"mouseup"===n.type&&(t=!1),t)return;this._cancelPendingCallback();const i="mouseup"===n.type?10:100;e(i)},document.addEventListener("selectionchange",this._eventHandler.bind(this)),this.shadowRoot.addEventListener("mousedown",this._eventHandler.bind(this)),this.shadowRoot.addEventListener("mouseup",this._eventHandler.bind(this)),this.subscribeTo("pb-add-annotation",t=>this.addAnnotation(t.detail)),this.subscribeTo("pb-edit-annotation",this._editAnnotation.bind(this)),this.subscribeTo("pb-refresh",()=>{this._ranges=[],this._rangesMap.clear(),this._currentSelection=null,this._clearMarkers(),this.emitTo("pb-annotations-changed",{ranges:this._ranges,refresh:!0})}),this._resizeHandler()}get annotations(){return this._ranges}set annotations(t){this._ranges=t,this.updateAnnotations(),this._initAnnotationColors(),this._annotationStyles()}saveHistory(){this._history.push(JSON.stringify(this._ranges)),this.emitTo("pb-annotations-history",this._history)}getHistory(){return this._history}popHistory(){if(0===this._history.length)return void console.warn("<pb-view-annotate> history is empty");this._scrollTop=this.scrollTop;const t=this._history.pop();this._clearMarkers(),this._ranges=JSON.parse(t),this._rangesMap.clear(),this._refresh(),this.emitTo("pb-annotations-changed",{ranges:this._ranges}),this.emitTo("pb-annotations-history",this._history)}clearHistory(t){this._history=t||[]}firstUpdated(){super.firstUpdated(),this.enableScrollbar(!1),Xn(this.shadowRoot,"light-border")}render(){return[...super.render(),$`<div id="marker-layer"></div>`]}zoom(t){super.zoom(t),window.requestAnimationFrame(()=>this.refreshMarkers())}_resizeHandler(){let t=null;const e=()=>{t=setTimeout(()=>{t=null,this.refreshMarkers()},200)};window.addEventListener("resize",()=>{t||this._clearMarkers(),t&&clearTimeout(t),e()})}_refresh(t){super._refresh(t),t&&t.detail&&t.detail.preserveScroll&&(this._scrollTop=this.scrollTop)}_handleContent(){super._handleContent(),this.updateComplete.then(()=>setTimeout(()=>{this._initAnnotationColors(),this._annotationStyles(),this.updateAnnotations(),this._scrollTop&&(this.scrollTop=this._scrollTop,this._scrollTop=void 0)},300))}_updateAnnotation(t,e=!1){const n=this.shadowRoot.getElementById("view"),i=Array.from(n.querySelectorAll(`[data-tei="${t.context}"]`)).filter(t=>null===t.closest("pb-popover")&&"footnote"!==t.getAttribute("rel"))[0];if(!i)return null;const r=document.createRange(),o=Ia(i,t.start),a=Ia(i,t.end);if(!o||!a)return console.error("<pb-view-annotate> Invalid range for %o",i),null;if(console.log("<pb-view-annotate> Range before adjust: %o %o",o,a),o[1]===o[0].textContent.length){const t=Ra(i,o[0]);t===a[0]?(r.setStart(t,0),o[0]=t,o[1]=0):r.setStartBefore(o[0].nextSibling||t)}else o[0]!==a[0]&&0===o[1]?r.setStartBefore(Ta(o[0],i)):r.setStart(o[0],o[1]);o[0]!==a[0]&&a[0].textContent.length-1===a[1]?r.setEndAfter(Ta(a[0],i)):r.setEnd(a[0],a[1]),console.log("<pb-view-annotate> Range: %o",r);const s=document.createElement("span"),l=""===t.properties[this.key]?"incomplete":"";s.className=`annotation annotation-${t.type} ${t.type} ${l}`,s.dataset.type=t.type,s.dataset.annotation=JSON.stringify(t.properties);try{r.surroundContents(s)}catch(t){throw new Error("An error occurred. The annotation may not be displayed. You should consider saving and reloading the document.")}return this._rangesMap.set(s,t),e||this.refreshMarkers(),s}updateAnnotations(){this._ranges.forEach(t=>{let e;switch(t.type){case"delete":e=this.shadowRoot.querySelector(`[data-tei="${t.node}"]`),e?this._deleteAnnotation(e):console.error("Annotation %s not found",t.context);break;case"modify":e=this.shadowRoot.querySelector(`[data-tei="${t.node}"]`),e.dataset.annotation=JSON.stringify(t.properties);break;default:this._updateAnnotation(t,!0)}}),window.requestAnimationFrame(()=>this.refreshMarkers())}_getSelection(){return this.shadowRoot.getSelection?this.shadowRoot.getSelection():window.getSelection()}_selectionChanged(){const t=this._getSelection(),e=this._selectedRange(t);if(e){let n=!1;const i=e.commonAncestorContainer;if(i.nodeType===Node.ELEMENT_NODE){if(e.startContainer.parentElement!==i){const t=Ta(e.startContainer,i);e.setStartBefore(t),n=!0}if(e.endContainer.parentElement!==i){const t=Ta(e.endContainer,i);e.setEndAfter(t),n=!0}}this._currentSelection=e,console.log("<pb-view-annotate> selection: %o",e),n&&(this._inHandler=!0,setTimeout(()=>{t.removeAllRanges(),t.addRange(e),this.inHandler=!1},100)),this.emitTo("pb-selection-changed",{hasContent:!0,range:e})}else this.emitTo("pb-selection-changed",{hasContent:!1})}updateAnnotation(t,e=!1){t=Ba(t);const n=this._updateAnnotation(t,e);return n&&(this._ranges.push(t),this.emitTo("pb-annotations-changed",{type:t.type,text:t.text,ranges:this._ranges})),n}addAnnotation(t){const e=t.range||this._currentSelection,n=Oa(e.startContainer,e.startOffset),i=Oa(e.endContainer,e.endOffset,"end"),r={context:n.parent,start:n.offset,end:i.offset,text:e.cloneContents().textContent};return t.type&&(r.type=t.type),t.properties&&(r.properties=t.properties),console.log("<pb-view-annotate> range adjusted: %o",r),this._ranges.push(Ba(r)),this.emitTo("pb-annotations-changed",{type:r.type,text:r.text,ranges:this._ranges}),this._checkAnnotationColor(r.type),this._updateAnnotation(r)}deleteAnnotation(t){if(t.dataset.tei){const e=this._ranges.findIndex(e=>"modify"===e.type&&e.node===t.dataset.tei);e>-1&&this._ranges.splice(e,1);const n=t.parentNode.closest("[data-tei]"),i={type:"delete",node:t.dataset.tei,context:n.dataset.tei};this._ranges.push(i)}else{const e=this._rangesMap.get(t);this._rangesMap.delete(t);const n=this._ranges.indexOf(e);console.log("<pb-view-annotate> deleting annotation %o",e),this._ranges.splice(n,1)}this._deleteAnnotation(t)}_deleteAnnotation(t){const e=document.createRange();for(let n=0;n<t.childNodes.length;n++){const i=t.childNodes[n].cloneNode(!0);t.parentNode.insertBefore(i,t),0===n&&e.setStartBefore(i),n===t.childNodes.length-1&&e.setEndAfter(i)}t.parentNode.removeChild(t),this.emitTo("pb-annotations-changed",{ranges:this._ranges}),window.requestAnimationFrame(()=>this.refreshMarkers());const n=this._getSelection();n.removeAllRanges(),n.addRange(e)}editAnnotation(t,e){if("edit"===t.dataset.type){let n=this._rangesMap.get(t);n?(n.properties=e,n=Ba(n),this.emitTo("pb-annotations-changed",{ranges:this._ranges})):console.error("no range found for edit span %o",t)}else if(t.dataset.tei){const n=t.closest("[data-tei]");let i=this._ranges.find(e=>"modify"===e.type&&e.node===t.dataset.tei);i||(i={type:"modify",node:t.dataset.tei,context:n.dataset.tei},this._ranges.push(i)),i.properties=e,i=Ba(i),this.emitTo("pb-annotations-changed",{ranges:this._ranges})}const n=JSON.parse(t.dataset.annotation),i=Object.assign(n||{},e);t.dataset.annotation=JSON.stringify(i),""!==i[this.key]&&t.classList.remove("incomplete")}_editAnnotation(t){this.editAnnotation(t.detail.target,t.detail.properties)}_selectedRange(t){if(!t||0===t.rangeCount)return null;if(t.anchorNode.getRootNode()!==this.shadowRoot)return null;const e=t.getRangeAt(0);return e.collapsed?null:e}_cancelPendingCallback(){this._pendingCallback&&(clearTimeout(this._pendingCallback),this._pendingCallback=null)}_createTooltip(t){if(t._tippy||!t.dataset.annotation)return;const e=document.createElement("div");e.className="annotation-popup";const n=document.createElement("div");n.className="info",e.appendChild(n);const i=document.createElement("div");i.className="toolbar";const r=document.createElement("span");if(r.className="annotation-type",i.appendChild(r),t.dataset.annotation){const e=document.createElement("paper-icon-button");e.setAttribute("icon","icons:create"),e.setAttribute("title",a("annotations.edit")),e.addEventListener("click",()=>{const e=JSON.parse(t.dataset.annotation);this.emitTo("pb-annotation-edit",Object.assign({},{target:t,type:t.dataset.type,properties:e}))}),i.appendChild(e)}const o=document.createElement("paper-icon-button");o.setAttribute("icon","icons:delete"),o.setAttribute("title",a("annotations.delete")),o.addEventListener("click",()=>{this.saveHistory(),this.deleteAnnotation(t)}),i.appendChild(o),e.appendChild(i);const s=this.shadowRoot.getElementById("view");Nn(t,{content:e,allowHTML:!0,interactive:!0,appendTo:s.nodeType===Node.DOCUMENT_NODE?document.body:s,theme:"light-border",hideOnClick:!1,maxWidth:"auto",trigger:"click",placement:"left",popperOptions:{modifiers:[{name:"flip",options:{fallbackPlacements:["right","top","bottom"]}}]},onTrigger:(e,i)=>{i.preventDefault(),i.stopPropagation();const o=t.dataset.type,s=JSON.parse(t.dataset.annotation)||{},l=this._annotationColors.get(o);if(r.innerHTML=o,r.style.backgroundColor=`var(--pb-annotation-${o})`,r.style.color=`var(${l&&l.isLight?"--pb-color-primary":"--pb-color-inverse"})`,s[this.key])this.emitTo("pb-annotation-detail",{type:o,id:s[this.key],container:n,span:t});else{n.innerHTML="";const t=Object.keys(s);if(0===t.length){const t=document.createElement("p");t.innerHTML=a("annotations.no-properties"),n.appendChild(t)}else{const e=document.createElement("table");t.forEach(t=>{const n=document.createElement("tr"),i=document.createElement("td");i.innerHTML=t,n.appendChild(i);const r=document.createElement("td");r.innerHTML=JSON.stringify(s[t],null,2),n.appendChild(r),e.appendChild(n)}),n.appendChild(e)}}},onClickOutside:(t,e)=>{t.hideWithInteractivity(e)}})}_showMarker(t,e,n,i=0){const r=t.getClientRects(),o=t.dataset.type;for(let t=0;t<r.length;t++){const a=r[t],s=document.createElement("div");s.className="marker annotation-"+o,s.style.position="absolute",s.style.left=a.left-n.left+"px",s.style.top=a.top-n.top+a.height+"px",s.style.marginTop=i+"px",s.style.width=a.width+"px",s.style.height="3px",s.style.backgroundColor=`var(--pb-annotation-${o})`,s.part="annotation",e.appendChild(s)}this._createTooltip(t)}_clearMarkers(){this.shadowRoot.getElementById("marker-layer").innerHTML=""}refreshMarkers(){const t=this.shadowRoot.getElementById("view"),e=t.getBoundingClientRect(),n=this.shadowRoot.getElementById("marker-layer");n.style.display="none",this._clearMarkers(),t.querySelectorAll(".annotation").forEach(t=>{t._tippy&&t._tippy.destroy(),this._showMarker(t,n,e,5*Pa(t,"annotation"))}),n.style.display="block"}search(t,e){function n(t){let e=t.replace(/[/.?+*\\]/g,t=>"\\"+t).replace(/[\s\n\t]+/g,"\\s+");return/^\w/.test(e)&&(e="\\b"+e),/\w$/.test(e)&&(e+="\\b"),e}function i(t){return t.nodeType===Node.TEXT_NODE?NodeFilter.FILTER_ACCEPT:t.classList.contains("annotation-popup")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}i.acceptNode=i;const r=[];if(!e||0===e.length)return r;const o=e.filter(t=>t&&t.length>0).map(t=>n(t)).join("|");console.log(`<pb-view-annotate> Searching content for ${o}...`);const a=new RegExp(o,this.caseSensitive?"g":"gi"),s=document.createTreeWalker(this.shadowRoot.getElementById("view"),NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,i);for(;s.nextNode();){let e=s.currentNode;const n=Array.from(e.textContent.matchAll(a));for(const i of n){const n=i.index+i[0].length;let o=!1,a=null;const s=e.parentNode.dataset.annotation,l=e.parentNode.dataset.type;if(s&&l){const e=JSON.parse(s)||{};o=l===t,a=e[this.key]}const c=Oa(e,i.index),h=Oa(e,n,"end"),[p,d]=Fa(e),u={annotated:o,context:c.parent,start:c.offset,end:h.offset,textNode:e,kwic:Na(p,d+i.index,d+n)};u[this.key]=a,r.push(u)}}return r}scrollTo(t){const e=this.shadowRoot.getElementById("view"),n=document.createRange();if(t.annotated)n.selectNode(t.textNode);else{const i=Array.from(e.querySelectorAll(`[data-tei="${t.context}"]`)).filter(t=>null===t.closest("pb-popover")&&"footnote"!==t.getAttribute("rel"))[0],r=Ia(i,t.start),o=Ia(i,t.end);n.setStart(r[0],r[1]),n.setEnd(o[0],o[1])}const i=e.getBoundingClientRect(),r=n.getBoundingClientRect();let o=e.querySelector("[part=highlight]");o||(o=document.createElement("div"),o.part="highlight",o.style.position="absolute",e.appendChild(o)),o.style.left=r.left-i.left-4+"px",o.style.top=r.top-i.top-4+"px",o.style.width=r.width+4+"px",o.style.height=r.height+"px",n.startContainer.parentNode.scrollIntoView(!0)}hideMarker(){const t=this.shadowRoot.getElementById("view").querySelector("[part=highlight]");t&&(t.style.top="-1000px")}_initAnnotationColors(){this._annotationColors=new Map;const t=new Set;this.shadowRoot.getElementById("view").querySelectorAll(".annotation").forEach(e=>{e.dataset.type&&t.add(e.dataset.type)}),t.forEach(t=>{this._annotationColors.set(t,Ha("annotation-"+t.repeat(4),{saturation:70,lightness:[30,60]}))}),this.emitTo("pb-annotation-colors",{colors:this._annotationColors})}_checkAnnotationColor(t){this._annotationColors.has(t)||(this._annotationColors.set(t,Ha("annotation-"+t.repeat(4),{saturation:70,lightness:[30,60]})),this._annotationStyles(),this.emitTo("pb-annotation-colors",{colors:this._annotationColors}))}_annotationStyles(){const t=this.shadowRoot.getElementById("view");let e=t.querySelector("_annotation-styles");e&&e.parentNode.removeChild(e);const n=[],i=[];this._annotationColors.forEach((t,e)=>{n.push(`--pb-annotation-${e}: ${t.color};`),n.push(`--pb-annotation-${e}-border: 2px solid var(--pb-annotation-${e});`),i.push(`\n .annotation-${e}::after {\n background-color: var(--pb-annotation-${e});\n border-color: var(--pb-annotation-${e});\n color: var(${t.isLight?"--pb-color-primary":"--pb-color-inverse"});\n }\n .annotation-${e}.incomplete::after {\n background: repeating-linear-gradient(\n 315deg,\n var(--pb-annotation-${e}),\n var(--pb-annotation-${e}) 5px,\n var(${t.isLight?"--pb-annotation-stripes-light":"--pb-annotation-stripes-dark"}) 5px,\n var(${t.isLight?"--pb-annotation-stripes-light":"--pb-annotation-stripes-dark"}) 10px\n );\n color: var(${t.isLight?"--pb-color-primary":"--pb-color-inverse"});\n }\n `)});const r=`\n :host {\n ${n.join("\n")}\n }\n\n ${i.join("\n")}\n `;e=document.createElement("style"),e.className="_annotation-styles",e.innerHTML=r,t.appendChild(e)}static get styles(){return[super.styles,P`
1222
+ `]}}customElements.define("pb-view",va);const ba=[0,100],ya=[0,100],_a=t=>`${1===t.length?"0":""}${t}`,wa=(t,e,n)=>Math.max(Math.min(t,n),e),xa=(t,e)=>Math.floor(Math.random()*(e-t+1))+t,ka=t=>{const e=t.length;let n=0;for(let i=0;i<e;i++)n=(n<<5)-n+t.charCodeAt(i),n&=n;return n},za=(t,e)=>"number"==typeof e?e:t%Math.abs(e[1]-e[0])+e[0],Aa=(t,e)=>"number"==typeof t?wa(Math.abs(t),...e):1===t.length||t[0]===t[1]?wa(Math.abs(t[0]),...e):[Math.abs(wa(t[0],...e)),wa(Math.abs(t[1]),...e)],Sa=(t,e,n)=>(n<0?n+=1:n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t),Ca=(t,e,n)=>{let i,r,o;if(t/=360,n/=100,0===(e/=100))i=r=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,s=2*n-a;i=Sa(s,a,t+1/3),r=Sa(s,a,t),o=Sa(s,a,t-1/3)}return[Math.round(255*i),Math.round(255*r),Math.round(255*o)]},Ea=(t,e,n,i)=>(299*t+587*e+114*n)/1e3>=i,Ma=(t,e,n)=>`hsl(${t}, ${e}%, ${n}%)`,La=(t,e,n,i)=>{switch(i){case"rgb":return`rgb(${t}, ${e}, ${n})`;case"hex":default:return`#${_a(t.toString(16))}${_a(e.toString(16))}${_a(n.toString(16))}`}},Ha=(t,{format:e="hex",saturation:n=[50,55],lightness:i=[50,60],differencePoint:r=130}={})=>{const o=Math.abs(ka(String(t))),a=za(o,[0,360]),s=za(o,Aa(n,ba)),l=za(o,Aa(i,ya)),[c,h,p]=Ca(a,s,l);return{color:"hsl"===e?Ma(a,s,l):La(c,h,p,e),isLight:Ea(c,h,p,r)}};function Ta(t,e){let n=t;for(;n.parentNode!==e;)n=n.parentElement;return n}function Va(t){let e=t;e.nodeType===Node.TEXT_NODE&&(e=e.parentNode);const n=e.getAttribute("href");return n&&/^#fn_.*$/.test(n)}function $a(t,e,n){const i=document.createTreeWalker(t);for(i.currentNode=e;i.previousNode();){const t=i.currentNode;t.nodeType===Node.ELEMENT_NODE||Va(t)||(n+=t.textContent.length)}return n}function Oa(t,e,n="start"){if(t.nodeType===Node.ELEMENT_NODE){const i=t.closest("[data-tei]");if(0===e)return{parent:i.getAttribute("data-tei"),offset:0};const r=i.childNodes[e];return{parent:i.getAttribute("data-tei"),offset:"end"===n?$a(i,r,0)-1:$a(i,r,0)}}const i=t.parentNode.closest("[data-tei]");if(i)return{parent:i.getAttribute("data-tei"),offset:$a(i,t,e)};console.error("No container with data-tei found for %o",t.parentNode)}function Pa(t,e){let n=0,i=t.parentNode;for(;i&&i!==t.getRootNode();)i.classList.contains(e)&&(n+=1),i=i.parentNode;return n}function Ra(t,e){const n=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);return n.currentNode=e,n.nextNode()?n.currentNode:e}function Ia(t,e){let n=e;const i=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;i.nextNode();)if(!Va(i.currentNode)&&i.currentNode.textContent.length>0){if(n-i.currentNode.textContent.length<=0)return[i.currentNode,n];n-=i.currentNode.textContent.length}return null}function Na(t,e,n,i=3){let r=e-1,o=0;for(;r>=0;){if(/[\p{P}\s]/.test(t.charAt(r))){for(;r>1&&/[\p{P}\s]/.test(t.charAt(r-1));)r-=1;if(o+=1,o===i)break}r-=1}let a=n+1;for(o=0;a<t.length;){if(/[\p{P}\s]/.test(t.charAt(a))){for(;a<t.length-1&&/[\p{P}\s]/.test(t.charAt(a+1));)a+=1;if(o+=1,o===i)break}a+=1}return`... ${t.substring(r,e)}<mark>${t.substring(e,n)}</mark>${t.substring(n,a+1)} ...`}function Fa(t){let e=t.parentElement;e.textContent.length<40&&(e=e.parentNode);const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let i=0,r=0;const o=[];for(;n.nextNode();)n.currentNode===t&&(r=i),i+=n.currentNode.textContent.length,o.push(n.currentNode.textContent);return[o.join(""),r]}function Ba(t){const e={};return Object.keys(t.properties).forEach(n=>{const i=t.properties[n];i&&i.length>0&&(e[n]=i)}),Object.assign(t,{properties:e})}Ha.random=({format:t="hex",saturation:e=[50,55],lightness:n=[50,60],differencePoint:i=130}={})=>{e=Aa(e,ba),n=Aa(n,ya);const r=xa(0,360),o="number"==typeof e?e:xa(...e),a="number"==typeof n?n:xa(...n),[s,l,c]=Ca(r,o,a);return{color:"hsl"===t?Ma(r,o,a):La(s,l,c,t),isLight:Ea(s,l,c,i)}};class Da extends va{static get properties(){return Object.assign({key:{type:String},caseSensitive:{type:Boolean}},super.properties)}constructor(){super(),this.key="ref",this.caseSensitive=!1,this._ranges=[],this._rangesMap=new Map,this._history=[]}connectedCallback(){super.connectedCallback();let t=!1;this._inHandler=!1,this._pendingCallback=null;const e=(t=10)=>{this._pendingCallback=setTimeout(()=>{this._selectionChanged()},t)};this._eventHandler=n=>{if("selectionchange"===n.type&&this._inHandler)return;if("mousedown"===n.type&&(t=!0),"mouseup"===n.type&&(t=!1),t)return;this._cancelPendingCallback();const i="mouseup"===n.type?10:100;e(i)},document.addEventListener("selectionchange",this._eventHandler.bind(this)),this.shadowRoot.addEventListener("mousedown",this._eventHandler.bind(this)),this.shadowRoot.addEventListener("mouseup",this._eventHandler.bind(this)),this.subscribeTo("pb-add-annotation",t=>this.addAnnotation(t.detail)),this.subscribeTo("pb-edit-annotation",this._editAnnotation.bind(this)),this.subscribeTo("pb-refresh",()=>{this._ranges=[],this._rangesMap.clear(),this._currentSelection=null,this._clearMarkers(),this.emitTo("pb-annotations-changed",{ranges:this._ranges,refresh:!0})}),this._resizeHandler()}get annotations(){return this._ranges}set annotations(t){this._ranges=t,this.updateAnnotations(!0),this._initAnnotationColors(),this._annotationStyles()}saveHistory(){this._history.push(JSON.stringify(this._ranges)),this.emitTo("pb-annotations-history",this._history)}getHistory(){return this._history}popHistory(){if(0===this._history.length)return void console.warn("<pb-view-annotate> history is empty");this._scrollTop=this.scrollTop;const t=this._history.pop();this._clearMarkers(),this._ranges=JSON.parse(t),this._rangesMap.clear(),this._refresh(),this.emitTo("pb-annotations-changed",{ranges:this._ranges}),this.emitTo("pb-annotations-history",this._history)}clearHistory(t){this._history=t||[]}firstUpdated(){super.firstUpdated(),this.enableScrollbar(!1),Xn(this.shadowRoot,"light-border")}render(){return[...super.render(),$`<div id="marker-layer"></div>`]}zoom(t){super.zoom(t),window.requestAnimationFrame(()=>this.refreshMarkers())}_resizeHandler(){let t=null;const e=()=>{t=setTimeout(()=>{t=null,this.refreshMarkers()},200)};window.addEventListener("resize",()=>{t||this._clearMarkers(),t&&clearTimeout(t),e()})}_refresh(t){super._refresh(t),t&&t.detail&&t.detail.preserveScroll&&(this._scrollTop=this.scrollTop)}_handleContent(){super._handleContent(),this.updateComplete.then(()=>setTimeout(()=>{this._initAnnotationColors(),this._annotationStyles(),this.updateAnnotations(),this._scrollTop&&(this.scrollTop=this._scrollTop,this._scrollTop=void 0)},300))}_updateAnnotation(t,e=!1,n=!1){const i=this.shadowRoot.getElementById("view"),r=Array.from(i.querySelectorAll(`[data-tei="${t.context}"]`)).filter(t=>null===t.closest("pb-popover")&&"footnote"!==t.getAttribute("rel"))[0];if(!r)return null;const o=document.createRange(),a=Ia(r,t.start),s=Ia(r,t.end);if(!a||!s)return console.error("<pb-view-annotate> Invalid range for %o",r),null;if(console.log("<pb-view-annotate> Range before adjust: %o %o",a,s),a[1]===a[0].textContent.length){const t=Ra(r,a[0]);t===s[0]?(o.setStart(t,0),a[0]=t,a[1]=0):o.setStartBefore(a[0].nextSibling||t)}else a[0]!==s[0]&&0===a[1]?o.setStartBefore(Ta(a[0],r)):o.setStart(a[0],a[1]);a[0]!==s[0]&&s[0].textContent.length-1===s[1]?o.setEndAfter(Ta(s[0],r)):o.setEnd(s[0],s[1]),console.log("<pb-view-annotate> Range: %o",o);const l=document.createElement("span"),c=""===t.properties[this.key]?"incomplete":"";l.className=`annotation annotation-${t.type} ${t.type} ${c}`,l.dataset.type=t.type,l.dataset.annotation=JSON.stringify(t.properties);try{o.surroundContents(l)}catch(t){if(e)return null;throw new Error("An error occurred. The annotation may not be displayed. You should consider saving and reloading the document.")}return this._rangesMap.set(l,t),n||this.refreshMarkers(),l}updateAnnotations(t=!1){this._ranges.forEach(e=>{let n;switch(e.type){case"delete":n=this.shadowRoot.querySelector(`[data-tei="${e.node}"]`),n?this._deleteAnnotation(n):console.error("Annotation %s not found",e.context);break;case"modify":n=this.shadowRoot.querySelector(`[data-tei="${e.node}"]`),n.dataset.annotation=JSON.stringify(e.properties);break;default:this._updateAnnotation(e,t,!0)}}),window.requestAnimationFrame(()=>this.refreshMarkers())}_getSelection(){return this.shadowRoot.getSelection?this.shadowRoot.getSelection():window.getSelection()}_selectionChanged(){const t=this._getSelection(),e=this._selectedRange(t);if(e){let n=!1;const i=e.commonAncestorContainer;if(i.nodeType===Node.ELEMENT_NODE){if(e.startContainer.parentElement!==i){const t=Ta(e.startContainer,i);e.setStartBefore(t),n=!0}if(e.endContainer.parentElement!==i){const t=Ta(e.endContainer,i);e.setEndAfter(t),n=!0}}this._currentSelection=e,console.log("<pb-view-annotate> selection: %o",e),n&&(this._inHandler=!0,setTimeout(()=>{t.removeAllRanges(),t.addRange(e),this.inHandler=!1},100)),this.emitTo("pb-selection-changed",{hasContent:!0,range:e})}else this.emitTo("pb-selection-changed",{hasContent:!1})}updateAnnotation(t,e=!1){t=Ba(t);const n=this._updateAnnotation(t,e);return n&&(this._ranges.push(t),this.emitTo("pb-annotations-changed",{type:t.type,text:t.text,ranges:this._ranges})),n}addAnnotation(t){const e=t.range||this._currentSelection,n=Oa(e.startContainer,e.startOffset),i=Oa(e.endContainer,e.endOffset,"end"),r={context:n.parent,start:n.offset,end:i.offset,text:e.cloneContents().textContent};return t.type&&(r.type=t.type),t.properties&&(r.properties=t.properties),console.log("<pb-view-annotate> range adjusted: %o",r),this._ranges.push(Ba(r)),this.emitTo("pb-annotations-changed",{type:r.type,text:r.text,ranges:this._ranges}),this._checkAnnotationColor(r.type),this._updateAnnotation(r)}deleteAnnotation(t){if(t.dataset.tei){const e=this._ranges.findIndex(e=>"modify"===e.type&&e.node===t.dataset.tei);e>-1&&this._ranges.splice(e,1);const n=t.parentNode.closest("[data-tei]"),i={type:"delete",node:t.dataset.tei,context:n.dataset.tei};this._ranges.push(i)}else{const e=this._rangesMap.get(t);this._rangesMap.delete(t);const n=this._ranges.indexOf(e);console.log("<pb-view-annotate> deleting annotation %o",e),this._ranges.splice(n,1)}this._deleteAnnotation(t)}_deleteAnnotation(t){const e=document.createRange();for(let n=0;n<t.childNodes.length;n++){const i=t.childNodes[n].cloneNode(!0);t.parentNode.insertBefore(i,t),0===n&&e.setStartBefore(i),n===t.childNodes.length-1&&e.setEndAfter(i)}t.parentNode.removeChild(t),this.emitTo("pb-annotations-changed",{ranges:this._ranges}),window.requestAnimationFrame(()=>this.refreshMarkers());const n=this._getSelection();n.removeAllRanges(),n.addRange(e)}editAnnotation(t,e){if("edit"===t.dataset.type){let n=this._rangesMap.get(t);n?(n.properties=e,n=Ba(n),this.emitTo("pb-annotations-changed",{ranges:this._ranges})):console.error("no range found for edit span %o",t)}else if(t.dataset.tei){const n=t.closest("[data-tei]");let i=this._ranges.find(e=>"modify"===e.type&&e.node===t.dataset.tei);i||(i={type:"modify",node:t.dataset.tei,context:n.dataset.tei},this._ranges.push(i)),i.properties=e,i=Ba(i),this.emitTo("pb-annotations-changed",{ranges:this._ranges})}const n=JSON.parse(t.dataset.annotation),i=Object.assign(n||{},e);t.dataset.annotation=JSON.stringify(i),""!==i[this.key]&&t.classList.remove("incomplete")}_editAnnotation(t){this.editAnnotation(t.detail.target,t.detail.properties)}_selectedRange(t){if(!t||0===t.rangeCount)return null;if(t.anchorNode.getRootNode()!==this.shadowRoot)return null;const e=t.getRangeAt(0);return e.collapsed?null:e}_cancelPendingCallback(){this._pendingCallback&&(clearTimeout(this._pendingCallback),this._pendingCallback=null)}_createTooltip(t){if(t._tippy||!t.dataset.annotation)return;const e=document.createElement("div");e.className="annotation-popup";const n=document.createElement("div");n.className="info",e.appendChild(n);const i=document.createElement("div");i.className="toolbar";const r=document.createElement("span");if(r.className="annotation-type",i.appendChild(r),t.dataset.annotation){const e=document.createElement("paper-icon-button");e.setAttribute("icon","icons:create"),e.setAttribute("title",a("annotations.edit")),e.addEventListener("click",()=>{const e=JSON.parse(t.dataset.annotation);this.emitTo("pb-annotation-edit",Object.assign({},{target:t,type:t.dataset.type,properties:e}))}),i.appendChild(e)}const o=document.createElement("paper-icon-button");o.setAttribute("icon","icons:delete"),o.setAttribute("title",a("annotations.delete")),o.addEventListener("click",()=>{this.saveHistory(),this.deleteAnnotation(t)}),i.appendChild(o),e.appendChild(i);const s=this.shadowRoot.getElementById("view");Nn(t,{content:e,allowHTML:!0,interactive:!0,appendTo:s.nodeType===Node.DOCUMENT_NODE?document.body:s,theme:"light-border",hideOnClick:!1,maxWidth:"auto",trigger:"click",placement:"left",popperOptions:{modifiers:[{name:"flip",options:{fallbackPlacements:["right","top","bottom"]}}]},onTrigger:(e,i)=>{i.preventDefault(),i.stopPropagation();const o=t.dataset.type,s=JSON.parse(t.dataset.annotation)||{},l=this._annotationColors.get(o);if(r.innerHTML=o,r.style.backgroundColor=`var(--pb-annotation-${o})`,r.style.color=`var(${l&&l.isLight?"--pb-color-primary":"--pb-color-inverse"})`,s[this.key])this.emitTo("pb-annotation-detail",{type:o,id:s[this.key],container:n,span:t});else{n.innerHTML="";const t=Object.keys(s);if(0===t.length){const t=document.createElement("p");t.innerHTML=a("annotations.no-properties"),n.appendChild(t)}else{const e=document.createElement("table");t.forEach(t=>{const n=document.createElement("tr"),i=document.createElement("td");i.innerHTML=t,n.appendChild(i);const r=document.createElement("td");r.innerHTML=JSON.stringify(s[t],null,2),n.appendChild(r),e.appendChild(n)}),n.appendChild(e)}}},onClickOutside:(t,e)=>{t.hideWithInteractivity(e)}})}_showMarker(t,e,n,i=0){const r=t.getClientRects(),o=t.dataset.type;for(let t=0;t<r.length;t++){const a=r[t],s=document.createElement("div");s.className="marker annotation-"+o,s.style.position="absolute",s.style.left=a.left-n.left+"px",s.style.top=a.top-n.top+a.height+"px",s.style.marginTop=i+"px",s.style.width=a.width+"px",s.style.height="3px",s.style.backgroundColor=`var(--pb-annotation-${o})`,s.part="annotation",e.appendChild(s)}this._createTooltip(t)}_clearMarkers(){this.shadowRoot.getElementById("marker-layer").innerHTML=""}refreshMarkers(){const t=this.shadowRoot.getElementById("view"),e=t.getBoundingClientRect(),n=this.shadowRoot.getElementById("marker-layer");n.style.display="none",this._clearMarkers(),t.querySelectorAll(".annotation").forEach(t=>{t._tippy&&t._tippy.destroy(),this._showMarker(t,n,e,5*Pa(t,"annotation"))}),n.style.display="block"}search(t,e){function n(t){let e=t.replace(/[/.?+*\\]/g,t=>"\\"+t).replace(/[\s\n\t]+/g,"\\s+");return/^\w/.test(e)&&(e="\\b"+e),/\w$/.test(e)&&(e+="\\b"),e}function i(t){return t.nodeType===Node.TEXT_NODE?NodeFilter.FILTER_ACCEPT:t.classList.contains("annotation-popup")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}i.acceptNode=i;const r=[];if(!e||0===e.length)return r;const o=e.filter(t=>t&&t.length>0).map(t=>n(t)).join("|");console.log(`<pb-view-annotate> Searching content for ${o}...`);const a=new RegExp(o,this.caseSensitive?"g":"gi"),s=document.createTreeWalker(this.shadowRoot.getElementById("view"),NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,i);for(;s.nextNode();){let e=s.currentNode;const n=Array.from(e.textContent.matchAll(a));for(const i of n){const n=i.index+i[0].length;let o=!1,a=null;const s=e.parentNode.dataset.annotation,l=e.parentNode.dataset.type;if(s&&l){const e=JSON.parse(s)||{};o=l===t,a=e[this.key]}const c=Oa(e,i.index),h=Oa(e,n,"end"),[p,d]=Fa(e),u={annotated:o,context:c.parent,start:c.offset,end:h.offset,textNode:e,kwic:Na(p,d+i.index,d+n)};u[this.key]=a,r.push(u)}}return r}scrollTo(t){const e=this.shadowRoot.getElementById("view"),n=document.createRange();if(t.annotated)n.selectNode(t.textNode);else{const i=Array.from(e.querySelectorAll(`[data-tei="${t.context}"]`)).filter(t=>null===t.closest("pb-popover")&&"footnote"!==t.getAttribute("rel"))[0],r=Ia(i,t.start),o=Ia(i,t.end);n.setStart(r[0],r[1]),n.setEnd(o[0],o[1])}const i=e.getBoundingClientRect(),r=n.getBoundingClientRect();let o=e.querySelector("[part=highlight]");o||(o=document.createElement("div"),o.part="highlight",o.style.position="absolute",e.appendChild(o)),o.style.left=r.left-i.left-4+"px",o.style.top=r.top-i.top-4+"px",o.style.width=r.width+4+"px",o.style.height=r.height+"px",n.startContainer.parentNode.scrollIntoView(!0)}hideMarker(){const t=this.shadowRoot.getElementById("view").querySelector("[part=highlight]");t&&(t.style.top="-1000px")}_initAnnotationColors(){this._annotationColors=new Map;const t=new Set;this.shadowRoot.getElementById("view").querySelectorAll(".annotation").forEach(e=>{e.dataset.type&&t.add(e.dataset.type)}),t.forEach(t=>{this._annotationColors.set(t,Ha("annotation-"+t.repeat(4),{saturation:70,lightness:[30,60]}))}),this.emitTo("pb-annotation-colors",{colors:this._annotationColors})}_checkAnnotationColor(t){this._annotationColors.has(t)||(this._annotationColors.set(t,Ha("annotation-"+t.repeat(4),{saturation:70,lightness:[30,60]})),this._annotationStyles(),this.emitTo("pb-annotation-colors",{colors:this._annotationColors}))}_annotationStyles(){const t=this.shadowRoot.getElementById("view");let e=t.querySelector("_annotation-styles");e&&e.parentNode.removeChild(e);const n=[],i=[];this._annotationColors.forEach((t,e)=>{n.push(`--pb-annotation-${e}: ${t.color};`),n.push(`--pb-annotation-${e}-border: 2px solid var(--pb-annotation-${e});`),i.push(`\n .annotation-${e}::after {\n background-color: var(--pb-annotation-${e});\n border-color: var(--pb-annotation-${e});\n color: var(${t.isLight?"--pb-color-primary":"--pb-color-inverse"});\n }\n .annotation-${e}.incomplete::after {\n background: repeating-linear-gradient(\n 315deg,\n var(--pb-annotation-${e}),\n var(--pb-annotation-${e}) 5px,\n var(${t.isLight?"--pb-annotation-stripes-light":"--pb-annotation-stripes-dark"}) 5px,\n var(${t.isLight?"--pb-annotation-stripes-light":"--pb-annotation-stripes-dark"}) 10px\n );\n color: var(${t.isLight?"--pb-color-primary":"--pb-color-inverse"});\n }\n `)});const r=`\n :host {\n ${n.join("\n")}\n }\n\n ${i.join("\n")}\n `;e=document.createElement("style"),e.className="_annotation-styles",e.innerHTML=r,t.appendChild(e)}static get styles(){return[super.styles,P`
1223
1223
  .annotation-type {
1224
1224
  display: inline-block;
1225
1225
  text-align: right;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teipublisher/pb-components",
3
- "version": "1.30.1",
3
+ "version": "1.30.2",
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",
@@ -323,7 +323,7 @@ class PbViewAnnotate extends PbView {
323
323
 
324
324
  set annotations(annoData) {
325
325
  this._ranges = annoData;
326
- this.updateAnnotations();
326
+ this.updateAnnotations(true);
327
327
  this._initAnnotationColors();
328
328
  this._annotationStyles();
329
329
  }
@@ -413,7 +413,7 @@ class PbViewAnnotate extends PbView {
413
413
  }, 300));
414
414
  }
415
415
 
416
- _updateAnnotation(teiRange, batch = false) {
416
+ _updateAnnotation(teiRange, silent = false, batch = false) {
417
417
  const view = this.shadowRoot.getElementById('view');
418
418
  const context = Array.from(view.querySelectorAll(`[data-tei="${teiRange.context}"]`)).filter(
419
419
  node => node.closest('pb-popover') === null && node.getAttribute('rel') !== 'footnote',
@@ -467,6 +467,9 @@ class PbViewAnnotate extends PbView {
467
467
  try {
468
468
  range.surroundContents(span);
469
469
  } catch (e) {
470
+ if (silent) {
471
+ return null;
472
+ }
470
473
  throw new Error('An error occurred. The annotation may not be displayed. You should consider saving and reloading the document.');
471
474
  }
472
475
  this._rangesMap.set(span, teiRange);
@@ -478,7 +481,7 @@ class PbViewAnnotate extends PbView {
478
481
  return span;
479
482
  }
480
483
 
481
- updateAnnotations() {
484
+ updateAnnotations(silent = false) {
482
485
  this._ranges.forEach((teiRange) => {
483
486
  let span;
484
487
  switch (teiRange.type) {
@@ -495,7 +498,7 @@ class PbViewAnnotate extends PbView {
495
498
  span.dataset.annotation = JSON.stringify(teiRange.properties);
496
499
  break;
497
500
  default:
498
- this._updateAnnotation(teiRange, true);
501
+ this._updateAnnotation(teiRange, silent, true);
499
502
  break;
500
503
  }
501
504
  });