@fluid-topics/ft-reader-content 1.0.57 → 1.0.59
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.
|
@@ -21,7 +21,7 @@ class FtReaderContent extends FtReaderComponent {
|
|
|
21
21
|
this.disableContextInteractions = false;
|
|
22
22
|
this.renderBeforeFirst = 5;
|
|
23
23
|
this.renderAfterLast = 10;
|
|
24
|
-
this.visibleTopicsDebouncer = new Debouncer(
|
|
24
|
+
this.visibleTopicsDebouncer = new Debouncer(50);
|
|
25
25
|
}
|
|
26
26
|
render() {
|
|
27
27
|
var _a;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
!function(t,e,i,s,r,n){var o=function(t,e,i,s){for(var r,n=arguments.length,o=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(r=t[l])&&(o=(n<3?r(o):n>3?r(e,i,o):r(e,i))||o);return n>3&&o&&Object.defineProperty(e,i,o),o};class
|
|
1
|
+
!function(t,e,i,s,r,n){var o;!function(t){t.FEEDBACK="FEEDBACK",t.RATING="RATING",t.PRINT="PRINT",t.BOOKMARK="BOOKMARK",t.COLLECTIONS="COLLECTIONS"}(o||(o={}));var l=function(t,e,i,s){for(var r,n=arguments.length,o=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(r=t[l])&&(o=(n<3?r(o):n>3?r(e,i,o):r(e,i))||o);return n>3&&o&&Object.defineProperty(e,i,o),o};class h extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}const a=Symbol("registerInterval");class d extends(function(t){var e;class i extends t{constructor(){super(...arguments),this[e]=0}setReaderStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"reader")}clearStateManager(){this.stateManager&&(this.removeStore("reader"),this.stateManager=void 0)}get service(){var t;return null===(t=this.stateManager)||void 0===t?void 0:t.service}connectedCallback(){super.connectedCallback(),this[a]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[a]):this.dispatchEvent(new h)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return e=a,l([s.state()],i.prototype,"stateManager",void 0),i}(e.FtLitElementRedux)){}const c=e.FtCssVariableFactory.create("--ft-infinite-scroll-padding","SIZE","0"),v=e.FtCssVariableFactory.create("--ft-infinite-scroll-items-gap","SIZE","4px"),u=e.FtCssVariableFactory.create("--ft-infinite-scroll-item-container-min-height","SIZE",".1px"),f=i.css`
|
|
2
2
|
.items-container {
|
|
3
3
|
position: relative;
|
|
4
|
-
padding: ${
|
|
4
|
+
padding: ${c};
|
|
5
5
|
outline: none;
|
|
6
6
|
}
|
|
7
7
|
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
By adding this gap we ensure that the previous item will be fully hidden
|
|
24
24
|
and even if its size changes, it will not impact the scroll offset
|
|
25
25
|
*/
|
|
26
|
-
margin-top: ${
|
|
26
|
+
margin-top: ${v};
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
.resizable:not(.rendered) {
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
.item-container, .resizable.rendered {
|
|
34
|
-
min-height: ${
|
|
34
|
+
min-height: ${u}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
.rendered {
|
|
38
38
|
display: flow-root;
|
|
39
39
|
}
|
|
40
|
-
`;var
|
|
40
|
+
`;var p=function(t,e,i,s){for(var r,n=arguments.length,o=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(r=t[l])&&(o=(n<3?r(o):n>3?r(e,i,o):r(e,i))||o);return n>3&&o&&Object.defineProperty(e,i,o),o};class b extends CustomEvent{constructor(t,e){super("visible-items-change",{detail:{visibleIndexes:t,visibleItems:e}})}}class m extends Event{constructor(){super("scrolled-to-target")}}class g extends e.FtLitElement{constructor(){super(...arguments),this.items=[],this.renderItem=()=>i.html``,this.getItemKey=(t,e)=>`${e} - ${JSON.stringify(t)}`,this.internalScroll=!1,this.renderBeforeFirst=1,this.renderAfterLast=1,this.visibleItems=[],this.scrolledToTarget=!1,this.alreadyRenderedIndexes=new Set,this.scrollDebouncer=new e.Debouncer(5),this.scrollDoneDebouncer=new e.Debouncer(10),this.onVisibilityChange=t=>{let e=new Set(this.visibleItems),i=new Set;for(let s of t){let t=+s.target.attributes.getNamedItem("data-item-index").value;s.intersectionRect.height>0?(e.add(t),i.add(t)):i.has(t)||e.delete(t)}this.visibleItems=[...e].sort(((t,e)=>t-e))},this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange),this.onResize=t=>{this.triggerFindScrollableParent();let e=this.searchFirstVisibleItem([...this.itemsContainer.children]),i=this.scrollable.scrollTop-this.getOffset(e);for(const e of t){const t=+e.target.parentElement.getAttribute("data-item-index");(this.alreadyRenderedIndexes.has(t)||e.target.classList.contains("rendered"))&&(e.target.parentElement.style.height=e.target.clientHeight+"px")}null!=e&&null!=i&&this.scrolledToTarget&&(this.scrollable.scrollTop=this.getOffset(e)+Math.min(i,e.clientHeight))},this.resizeObserver=new ResizeObserver(this.onResize),this.onMutation=()=>{[...this.itemsContainer.children].forEach((t=>{this.resizeObserver.observe(t.children.item(0)),this.intersectionObserver.observe(t)}))},this.mutationObserver=new MutationObserver(this.onMutation),this.resetVisibleItemsDebouncer=new e.Debouncer(10)}get scrollable(){var t;return null!==(t=this.internalScroll?this.internalScrollable:this.firstScrollableParent)&&void 0!==t?t:document.body}render(){return i.html`
|
|
41
41
|
<div class="items-container ${this.internalScroll?"scrollable":""}"
|
|
42
42
|
tabindex="-1"
|
|
43
43
|
@find-scrollable-parent=${this.findScrollableParent}>
|
|
@@ -51,16 +51,16 @@
|
|
|
51
51
|
${r?(()=>{const s=this.renderItem(t,e);return"string"==typeof s?i.html`${n.unsafeHTML(s)}`:s})():null}
|
|
52
52
|
</div>
|
|
53
53
|
</div>
|
|
54
|
-
`}resetScroll(){this.triggerFindScrollableParent(),this.intersectionObserver.disconnect(),this.resizeObserver.disconnect(),this.visibleItems=[],this.scrolledToTarget=!1,this.scrollDebouncer.run((()=>{var t;let e=null!==(t=this.scrollToIndex)&&void 0!==t?t:this.scrollToItem?this.items.indexOf(this.scrollToItem):-1;e>=this.items.length&&(e=-1);let i=this.getItem(e);this.scrollToTarget(i),this.scrollDoneDebouncer.run((()=>{this.onMutation(),this.scrolledToTarget=!0}))}))}getItem(t){var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(`#item-${t}`)}scrollToTarget(t){var e;if(t){let i=+(null!==(e=t.getAttribute("data-item-index"))&&void 0!==e?e:"0");this.scrollable&&0===i?this.scrollable.scrollTop=0:this.scrollable.scrollTop=this.getOffset(t)}}getOffset(t){var e;let i=0,s=t;for(;s&&s.offsetParent!==this.scrollable.offsetParent;)i+=s.offsetTop,s=s.offsetParent;return i+(null!==(e=null==s?void 0:s.offsetTop)&&void 0!==e?e:0)-this.scrollable.offsetTop}getBottomOffset(t){var e;return this.getOffset(t)+(null!==(e=null==t?void 0:t.clientHeight)&&void 0!==e?e:0)}appendItems(...t){this.items=[...this.items,...t]}prependItems(...t){this.items=[...t,...this.items]}connectedCallback(){super.connectedCallback(),setTimeout((()=>{this.triggerFindScrollableParent(),this.initIntersectionObserver(),this.mutationObserver.disconnect(),this.mutationObserver.observe(this.itemsContainer,{childList:!0})}),0)}initIntersectionObserver(){this.intersectionObserver.disconnect(),this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange,{root:this.scrollable,rootMargin:"-8px",threshold:[0,.01,.1,1]})}triggerFindScrollableParent(){var t;null===(t=this.itemsContainer)||void 0===t||t.dispatchEvent(new Event("find-scrollable-parent",{composed:!0}))}findScrollableParent(t){let e,i;t.stopPropagation();for(let s of t.composedPath()){const t=s,r=this.elementCanScroll(t);if(t.clientHeight&&t.clientHeight<t.scrollHeight&&r){e=t;break}r&&(i=t)}let s=e||i;s!==this.firstScrollableParent&&(this.firstScrollableParent=s,this.initIntersectionObserver(),this.resetScroll())}elementCanScroll(t){try{return["auto","scroll"].includes(getComputedStyle(t).overflowY)}catch(t){return!1}}searchFirstVisibleItem(t,e,i){if(e=null!=e?e:0,(i=null!=i?i:t.length-1)-e<=0)return t[e];const s=Math.floor((i-e)/2)+e;return this.getOffset(t[s])>this.scrollable.scrollTop?this.searchFirstVisibleItem(t,e,s-1):this.getBottomOffset(t[s])<this.scrollable.scrollTop?this.searchFirstVisibleItem(t,s+1,i):t[s]}disconnectedCallback(){super.disconnectedCallback(),this.intersectionObserver.disconnect(),this.resizeObserver.disconnect(),this.mutationObserver.disconnect()}firstUpdated(t){super.firstUpdated(t),this.resetScroll()}update(t){super.update(t),t.has("items")&&(this.alreadyRenderedIndexes=new Set),!t.has("scrollToItem")&&!t.has("scrollToIndex")||null==this.scrollToItem&&null==this.scrollToIndex||this.resetScroll()}updated(t){super.updated(t),(t.has("visibleItems")||t.has("items"))&&this.onVisibleItemsChange(),t.has("scrolledToTarget")&&this.scrolledToTarget&&(null!=this.scrollToItem||null!=this.scrollToIndex)&&this.dispatchEvent(new
|
|
55
|
-
`,
|
|
56
|
-
`;var
|
|
54
|
+
`}resetScroll(){this.triggerFindScrollableParent(),this.intersectionObserver.disconnect(),this.resizeObserver.disconnect(),this.visibleItems=[],this.scrolledToTarget=!1,this.scrollDebouncer.run((()=>{var t;let e=null!==(t=this.scrollToIndex)&&void 0!==t?t:this.scrollToItem?this.items.indexOf(this.scrollToItem):-1;e>=this.items.length&&(e=-1);let i=this.getItem(e);this.scrollToTarget(i),this.scrollDoneDebouncer.run((()=>{this.onMutation(),this.scrolledToTarget=!0}))}))}getItem(t){var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(`#item-${t}`)}scrollToTarget(t){var e;if(t){let i=+(null!==(e=t.getAttribute("data-item-index"))&&void 0!==e?e:"0");this.scrollable&&0===i?this.scrollable.scrollTop=0:this.scrollable.scrollTop=this.getOffset(t)}}getOffset(t){var e;let i=0,s=t;for(;s&&s.offsetParent!==this.scrollable.offsetParent;)i+=s.offsetTop,s=s.offsetParent;return i+(null!==(e=null==s?void 0:s.offsetTop)&&void 0!==e?e:0)-this.scrollable.offsetTop}getBottomOffset(t){var e;return this.getOffset(t)+(null!==(e=null==t?void 0:t.clientHeight)&&void 0!==e?e:0)}appendItems(...t){this.items=[...this.items,...t]}prependItems(...t){this.items=[...t,...this.items]}connectedCallback(){super.connectedCallback(),setTimeout((()=>{this.triggerFindScrollableParent(),this.initIntersectionObserver(),this.mutationObserver.disconnect(),this.mutationObserver.observe(this.itemsContainer,{childList:!0})}),0)}initIntersectionObserver(){this.intersectionObserver.disconnect(),this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange,{root:this.scrollable,rootMargin:"-8px",threshold:[0,.01,.1,1]})}triggerFindScrollableParent(){var t;null===(t=this.itemsContainer)||void 0===t||t.dispatchEvent(new Event("find-scrollable-parent",{composed:!0}))}findScrollableParent(t){let e,i;t.stopPropagation();for(let s of t.composedPath()){const t=s,r=this.elementCanScroll(t);if(t.clientHeight&&t.clientHeight<t.scrollHeight&&r){e=t;break}r&&(i=t)}let s=e||i;s!==this.firstScrollableParent&&(this.firstScrollableParent=s,this.initIntersectionObserver(),this.resetScroll())}elementCanScroll(t){try{return["auto","scroll"].includes(getComputedStyle(t).overflowY)}catch(t){return!1}}searchFirstVisibleItem(t,e,i){if(e=null!=e?e:0,(i=null!=i?i:t.length-1)-e<=0)return t[e];const s=Math.floor((i-e)/2)+e;return this.getOffset(t[s])>this.scrollable.scrollTop?this.searchFirstVisibleItem(t,e,s-1):this.getBottomOffset(t[s])<this.scrollable.scrollTop?this.searchFirstVisibleItem(t,s+1,i):t[s]}disconnectedCallback(){super.disconnectedCallback(),this.intersectionObserver.disconnect(),this.resizeObserver.disconnect(),this.mutationObserver.disconnect()}firstUpdated(t){super.firstUpdated(t),this.resetScroll()}update(t){super.update(t),t.has("items")&&(this.alreadyRenderedIndexes=new Set),!t.has("scrollToItem")&&!t.has("scrollToIndex")||null==this.scrollToItem&&null==this.scrollToIndex||this.resetScroll()}updated(t){super.updated(t),(t.has("visibleItems")||t.has("items"))&&this.onVisibleItemsChange(),t.has("scrolledToTarget")&&this.scrolledToTarget&&(null!=this.scrollToItem||null!=this.scrollToIndex)&&this.dispatchEvent(new m)}onVisibleItemsChange(){this.visibleItems.every(((t,e)=>null==this.visibleItems[e+1]||t+1===this.visibleItems[e+1]))||e.deepEqual(this.visibleItems,this.lastNotOkVisibleItems)?(this.resetVisibleItemsDebouncer.cancel(),this.dispatchEvent(new b(this.visibleItems,this.visibleItems.map((t=>this.items[t]))))):this.resetVisibleItemsDebouncer.run((()=>{this.lastNotOkVisibleItems=[...this.visibleItems],this.visibleItems=[],this.initIntersectionObserver(),this.onMutation()}))}}g.styles=f,p([s.property({type:Array})],g.prototype,"items",void 0),p([s.property({attribute:!1})],g.prototype,"renderItem",void 0),p([s.property({attribute:!1})],g.prototype,"getItemKey",void 0),p([s.property({type:Object})],g.prototype,"scrollToItem",void 0),p([s.property({type:Number})],g.prototype,"scrollToIndex",void 0),p([s.property({type:Boolean})],g.prototype,"internalScroll",void 0),p([s.property({type:Number})],g.prototype,"renderBeforeFirst",void 0),p([s.property({type:Number})],g.prototype,"renderAfterLast",void 0),p([s.state({hasChanged:(t,e)=>null!=t&&null==e||t.length!==e.length||t[0]!==e[0]})],g.prototype,"visibleItems",void 0),p([s.query(".scrollable")],g.prototype,"internalScrollable",void 0),p([s.query(".items-container")],g.prototype,"itemsContainer",void 0),p([s.state()],g.prototype,"scrolledToTarget",void 0),e.customElement("ft-infinite-scroll")(g);const I=i.css`
|
|
55
|
+
`,w=i.css`
|
|
56
|
+
`;var x=function(t,e,i,s){for(var r,n=arguments.length,o=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(r=t[l])&&(o=(n<3?r(o):n>3?r(e,i,o):r(e,i))||o);return n>3&&o&&Object.defineProperty(e,i,o),o};class $ extends d{constructor(){super(...arguments),this.disableContextInteractions=!1,this.registeredComponents=[]}render(){return i.html`
|
|
57
57
|
<article id=${this.tocId}>
|
|
58
58
|
<slot @register-ft-reader-topic-component=${this.registerComponent}></slot>
|
|
59
59
|
</article>
|
|
60
|
-
`}registerComponent(t){t.stopPropagation();const e=t.composedPath()[0];this.register(e)}register(t){this.registeredComponents.push(t),t.tocNode=this.tocNode,t.disableContextInteractions=this.disableContextInteractions}update(t){super.update(t),["mapId","tocId","stateManager"].some((e=>t.has(e)))&&this.setTocNode(),t.has("tocNode")&&this.registeredComponents.forEach((t=>t.tocNode=this.tocNode))}async setTocNode(){var t;this.tocNode=void 0,this.tocNode=this.mapId&&this.tocId?await(null===(t=this.service)||void 0===t?void 0:t.getTocNode(this.tocId)):void 0}disconnectedCallback(){super.disconnectedCallback(),this.registeredComponents=[]}}
|
|
60
|
+
`}registerComponent(t){t.stopPropagation();const e=t.composedPath()[0];this.register(e)}register(t){this.registeredComponents.push(t),t.tocNode=this.tocNode,t.disableContextInteractions=this.disableContextInteractions}update(t){super.update(t),["mapId","tocId","stateManager"].some((e=>t.has(e)))&&this.setTocNode(),t.has("tocNode")&&this.registeredComponents.forEach((t=>t.tocNode=this.tocNode))}async setTocNode(){var t;this.tocNode=void 0,this.tocNode=this.mapId&&this.tocId?await(null===(t=this.service)||void 0===t?void 0:t.getTocNode(this.tocId)):void 0}disconnectedCallback(){super.disconnectedCallback(),this.registeredComponents=[]}}$.styles=w,x([e.redux({selector:t=>{var e;return null===(e=t.map)||void 0===e?void 0:e.id}})],$.prototype,"mapId",void 0),x([s.property()],$.prototype,"tocId",void 0),x([s.property({type:Boolean})],$.prototype,"disableContextInteractions",void 0),x([s.state()],$.prototype,"tocNode",void 0),e.customElement("ft-reader-topic-context")($);var T=function(t,e,i,s){for(var r,n=arguments.length,o=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(r=t[l])&&(o=(n<3?r(o):n>3?r(e,i,o):r(e,i))||o);return n>3&&o&&Object.defineProperty(e,i,o),o};class y extends d{constructor(){super(...arguments),this.renderTopic=()=>i.html`
|
|
61
61
|
<ft-reader-topic-title></ft-reader-topic-title>
|
|
62
62
|
<ft-reader-topic-content></ft-reader-topic-content>
|
|
63
|
-
`,this.disableContextInteractions=!1,this.renderBeforeFirst=5,this.renderAfterLast=10,this.visibleTopicsDebouncer=new e.Debouncer(
|
|
63
|
+
`,this.disableContextInteractions=!1,this.renderBeforeFirst=5,this.renderAfterLast=10,this.visibleTopicsDebouncer=new e.Debouncer(50)}render(){var t;const e=(null===(t=this.currentPage)||void 0===t?void 0:t.topics)||[];return 0===e.length?i.nothing:i.html`
|
|
64
64
|
<ft-infinite-scroll class="ft-reader-content"
|
|
65
65
|
.items=${e}
|
|
66
66
|
.renderItem=${(t,e)=>this.renderTopicInContext(t,e)}
|
|
@@ -77,4 +77,4 @@
|
|
|
77
77
|
<ft-reader-topic-context tocId="${t}" ?disableContextInteractions=${this.disableContextInteractions}>
|
|
78
78
|
${this.renderTopic(t,e)}
|
|
79
79
|
</ft-reader-topic-context>
|
|
80
|
-
`}getScrollTarget(){var t,e,i,s,r;if(this.disableContextInteractions)return null;const n=null!==(s=null===(t=this.visibleTopics)||void 0===t?void 0:t.includes(null!==(i=null===(e=this.scrollTarget)||void 0===e?void 0:e.tocId)&&void 0!==i?i:""))&&void 0!==s&&s;return!(null===(r=this.scrollTarget)||void 0===r?void 0:r.tocId)||n&&null!=this.scrollTarget.section?null:this.scrollTarget.tocId}visibleTopicChange(t){this.disableContextInteractions||this.visibleTopicsDebouncer.run((()=>{var e;return null===(e=this.stateManager)||void 0===e?void 0:e.setVisibleTopics(t.detail.visibleItems)}))}onScrollDone(){var t,e;this.disableContextInteractions||(null===(t=this.scrollTarget)||void 0===t?void 0:t.section)||null===(e=this.stateManager)||void 0===e||e.scrollDone()}}y.elementDefinitions={"ft-infinite-scroll":
|
|
80
|
+
`}getScrollTarget(){var t,e,i,s,r;if(this.disableContextInteractions)return null;const n=null!==(s=null===(t=this.visibleTopics)||void 0===t?void 0:t.includes(null!==(i=null===(e=this.scrollTarget)||void 0===e?void 0:e.tocId)&&void 0!==i?i:""))&&void 0!==s&&s;return!(null===(r=this.scrollTarget)||void 0===r?void 0:r.tocId)||n&&null!=this.scrollTarget.section?null:this.scrollTarget.tocId}visibleTopicChange(t){this.disableContextInteractions||this.visibleTopicsDebouncer.run((()=>{var e;return null===(e=this.stateManager)||void 0===e?void 0:e.setVisibleTopics(t.detail.visibleItems)}))}onScrollDone(){var t,e;this.disableContextInteractions||(null===(t=this.scrollTarget)||void 0===t?void 0:t.section)||null===(e=this.stateManager)||void 0===e||e.scrollDone()}}y.elementDefinitions={"ft-infinite-scroll":g},y.styles=I,T([s.property()],y.prototype,"renderTopic",void 0),T([s.property({type:Boolean})],y.prototype,"disableContextInteractions",void 0),T([e.redux()],y.prototype,"currentPage",void 0),T([e.redux()],y.prototype,"scrollTarget",void 0),T([e.redux()],y.prototype,"visibleTopics",void 0),T([e.redux({selector:t=>{var e,i;return null!==(i=null===(e=t.configuration)||void 0===e?void 0:e.loadBeforeFirstVisibleTopic)&&void 0!==i?i:5}})],y.prototype,"renderBeforeFirst",void 0),T([e.redux({selector:t=>{var e,i;return null!==(i=null===(e=t.configuration)||void 0===e?void 0:e.loadAfterLastVisibleTopic)&&void 0!==i?i:5}})],y.prototype,"renderAfterLast",void 0),T([s.query(".ft-reader-content")],y.prototype,"container",void 0),e.customElement("ft-reader-content")(y),t.FtReaderContent=y,t.FtReaderContentCssVariables={},t.styles=I}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litRepeat,ftGlobals.litUnsafeHTML);
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* @see https://github.com/webcomponents/polyfills/tree/master/packages/scoped-custom-element-registry
|
|
16
16
|
*/
|
|
17
|
-
if(!ShadowRoot.prototype.createElement){const t=window.HTMLElement,e=window.customElements.define,i=window.customElements.get,s=window.customElements,n=new WeakMap,r=new WeakMap,o=new WeakMap,l=new WeakMap;let h;window.CustomElementRegistry=class{constructor(){this._definitionsByTag=new Map,this._definitionsByClass=new Map,this._whenDefinedPromises=new Map,this._awaitingUpgrade=new Map}define(t,n){if(t=t.toLowerCase(),void 0!==this._getDefinition(t))throw new DOMException(`Failed to execute 'define' on 'CustomElementRegistry': the name "${t}" has already been used with this registry`);if(void 0!==this._definitionsByClass.get(n))throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': this constructor has already been used with this registry");const l=n.prototype.attributeChangedCallback,h=new Set(n.observedAttributes||[]);
|
|
17
|
+
if(!ShadowRoot.prototype.createElement){const t=window.HTMLElement,e=window.customElements.define,i=window.customElements.get,s=window.customElements,n=new WeakMap,r=new WeakMap,o=new WeakMap,l=new WeakMap;let h;window.CustomElementRegistry=class{constructor(){this._definitionsByTag=new Map,this._definitionsByClass=new Map,this._whenDefinedPromises=new Map,this._awaitingUpgrade=new Map}define(t,n){if(t=t.toLowerCase(),void 0!==this._getDefinition(t))throw new DOMException(`Failed to execute 'define' on 'CustomElementRegistry': the name "${t}" has already been used with this registry`);if(void 0!==this._definitionsByClass.get(n))throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': this constructor has already been used with this registry");const l=n.prototype.attributeChangedCallback,h=new Set(n.observedAttributes||[]);d(n,h,l);const a={elementClass:n,connectedCallback:n.prototype.connectedCallback,disconnectedCallback:n.prototype.disconnectedCallback,adoptedCallback:n.prototype.adoptedCallback,attributeChangedCallback:l,formAssociated:n.formAssociated,formAssociatedCallback:n.prototype.formAssociatedCallback,formDisabledCallback:n.prototype.formDisabledCallback,formResetCallback:n.prototype.formResetCallback,formStateRestoreCallback:n.prototype.formStateRestoreCallback,observedAttributes:h};this._definitionsByTag.set(t,a),this._definitionsByClass.set(n,a);let c=i.call(s,t);c||(c=u(t),e.call(s,t,c)),this===window.customElements&&(o.set(n,a),a.standInClass=c);const p=this._awaitingUpgrade.get(t);if(p){this._awaitingUpgrade.delete(t);for(const t of p)r.delete(t),v(t,a,!0)}const f=this._whenDefinedPromises.get(t);return void 0!==f&&(f.resolve(n),this._whenDefinedPromises.delete(t)),n}upgrade(){b.push(this),s.upgrade.apply(s,arguments),b.pop()}get(t){const e=this._definitionsByTag.get(t);return e?.elementClass}_getDefinition(t){return this._definitionsByTag.get(t)}whenDefined(t){const e=this._getDefinition(t);if(void 0!==e)return Promise.resolve(e.elementClass);let i=this._whenDefinedPromises.get(t);return void 0===i&&(i={},i.promise=new Promise((t=>i.resolve=t)),this._whenDefinedPromises.set(t,i)),i.promise}_upgradeWhenDefined(t,e,i){let s=this._awaitingUpgrade.get(e);s||this._awaitingUpgrade.set(e,s=new Set),i?s.add(t):s.delete(t)}},window.HTMLElement=function(){let e=h;if(e)return h=void 0,e;const i=o.get(this.constructor);if(!i)throw new TypeError("Illegal constructor (custom element class must be registered with global customElements registry to be newable)");return e=Reflect.construct(t,[],i.standInClass),Object.setPrototypeOf(e,this.constructor.prototype),n.set(e,i),e},window.HTMLElement.prototype=t.prototype;const a=t=>t===document||t instanceof ShadowRoot,c=t=>{let e=t.getRootNode();if(!a(e)){const t=b[b.length-1];if(t instanceof CustomElementRegistry)return t;e=t.getRootNode(),a(e)||(e=l.get(e)?.getRootNode()||document)}return e.customElements},u=e=>class{static get formAssociated(){return!0}constructor(){const i=Reflect.construct(t,[],this.constructor);Object.setPrototypeOf(i,HTMLElement.prototype);const s=c(i)||window.customElements,n=s._getDefinition(e);return n?v(i,n):r.set(i,s),i}connectedCallback(){const t=n.get(this);t?t.connectedCallback&&t.connectedCallback.apply(this,arguments):r.get(this)._upgradeWhenDefined(this,e,!0)}disconnectedCallback(){const t=n.get(this);t?t.disconnectedCallback&&t.disconnectedCallback.apply(this,arguments):r.get(this)._upgradeWhenDefined(this,e,!1)}adoptedCallback(){const t=n.get(this);t?.adoptedCallback?.apply(this,arguments)}formAssociatedCallback(){const t=n.get(this);t&&t.formAssociated&&t?.formAssociatedCallback?.apply(this,arguments)}formDisabledCallback(){const t=n.get(this);t?.formAssociated&&t?.formDisabledCallback?.apply(this,arguments)}formResetCallback(){const t=n.get(this);t?.formAssociated&&t?.formResetCallback?.apply(this,arguments)}formStateRestoreCallback(){const t=n.get(this);t?.formAssociated&&t?.formStateRestoreCallback?.apply(this,arguments)}},d=(t,e,i)=>{if(0===e.size||void 0===i)return;const s=t.prototype.setAttribute;s&&(t.prototype.setAttribute=function(t,n){const r=t.toLowerCase();if(e.has(r)){const t=this.getAttribute(r);s.call(this,r,n),i.call(this,r,t,n)}else s.call(this,r,n)});const n=t.prototype.removeAttribute;n&&(t.prototype.removeAttribute=function(t){const s=t.toLowerCase();if(e.has(s)){const t=this.getAttribute(s);n.call(this,s),i.call(this,s,t,null)}else n.call(this,s)})},p=e=>{const i=Object.getPrototypeOf(e);if(i!==window.HTMLElement)return i===t||"HTMLElement"===i?.prototype?.constructor?.name?Object.setPrototypeOf(e,window.HTMLElement):p(i)},v=(t,e,i=!1)=>{Object.setPrototypeOf(t,e.elementClass.prototype),n.set(t,e),h=t;try{new e.elementClass}catch(t){p(e.elementClass),new e.elementClass}e.observedAttributes.forEach((i=>{t.hasAttribute(i)&&e.attributeChangedCallback.call(t,i,null,t.getAttribute(i))})),i&&e.connectedCallback&&t.isConnected&&e.connectedCallback.call(t)},f=Element.prototype.attachShadow;Element.prototype.attachShadow=function(t){const e=f.apply(this,arguments);return t.customElements&&(e.customElements=t.customElements),e};let b=[document];const m=(t,e,i=void 0)=>{const s=(i?Object.getPrototypeOf(i):t.prototype)[e];t.prototype[e]=function(){b.push(this);const t=s.apply(i||this,arguments);return void 0!==t&&l.set(t,this),b.pop(),t}};m(ShadowRoot,"createElement",document),m(ShadowRoot,"importNode",document),m(Element,"insertAdjacentHTML");const x=(t,e)=>{const i=Object.getOwnPropertyDescriptor(t.prototype,e);Object.defineProperty(t.prototype,e,{...i,set(t){b.push(this),i.set.call(this,t),b.pop()}})};if(x(Element,"innerHTML"),x(ShadowRoot,"innerHTML"),Object.defineProperty(window,"customElements",{value:new CustomElementRegistry,configurable:!0,writable:!0}),window.ElementInternals&&window.ElementInternals.prototype.setFormValue){const t=new WeakMap,e=HTMLElement.prototype.attachInternals,i=["setFormValue","setValidity","checkValidity","reportValidity"];HTMLElement.prototype.attachInternals=function(...i){const s=e.call(this,...i);return t.set(s,this),s},i.forEach((e=>{const i=window.ElementInternals.prototype,s=i[e];i[e]=function(...e){const i=t.get(this);if(!0!==n.get(i).formAssociated)throw new DOMException(`Failed to execute ${s} on 'ElementInternals': The target element is not a form-associated custom element.`);s?.call(this,...e)}}));class s extends Array{constructor(t){super(...t),this._elements=t}get value(){return this._elements.find((t=>!0===t.checked))?.value||""}}class r{constructor(t){const e=new Map;t.forEach(((t,i)=>{const s=t.getAttribute("name"),n=e.get(s)||[];this[+i]=t,n.push(t),e.set(s,n)})),this.length=t.length,e.forEach(((t,e)=>{t&&(1===t.length?this[e]=t[0]:this[e]=new s(t))}))}namedItem(t){return this[t]}}const o=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){const t=o.get.call(this,[]),e=[];for(const i of t){const t=n.get(i);t&&!0!==t.formAssociated||e.push(i)}return new r(e)}})}}try{window.customElements.define("custom-element",null)}catch(Xt){const t=window.customElements.define;window.customElements.define=(e,i,s)=>{if(null!==i)try{t.bind(window.customElements)(e,i,s)}catch(t){console.info(e,i,s,t)}}}class e{constructor(t=0){this.timeout=t,this.callbacks=[]}run(t,e){return this.callbacks=[t],this.debounce(e)}queue(t,e){return this.callbacks.push(t),this.debounce(e)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(t){return null==this.promise&&(this.promise=new Promise(((t,e)=>{this.resolvePromise=t,this.rejectPromise=e}))),this.clearTimeout(),this._debounce=window.setTimeout((()=>this.runCallbacks()),null!=t?t:this.timeout),this.promise}async runCallbacks(){var t,e;const i=[...this.callbacks];this.callbacks=[];const s=null!==(t=this.rejectPromise)&&void 0!==t?t:()=>null,n=null!==(e=this.resolvePromise)&&void 0!==e?e:()=>null;this.clearPromise();for(let t of i)try{await t()}catch(t){return void s(t)}n(!0)}clearTimeout(){null!=this._debounce&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}}
|
|
18
18
|
/**
|
|
19
19
|
* @license
|
|
20
20
|
* Copyright 2017 Google LLC
|
|
@@ -46,7 +46,7 @@ function r(t,e){return(({finisher:t,descriptor:e})=>(i,s)=>{var n;if(void 0===s)
|
|
|
46
46
|
* Copyright 2019 Google LLC
|
|
47
47
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
48
48
|
*/
|
|
49
|
-
const a=window,c=a.ShadowRoot&&(void 0===a.ShadyCSS||a.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,
|
|
49
|
+
const a=window,c=a.ShadowRoot&&(void 0===a.ShadyCSS||a.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,u=Symbol(),d=new WeakMap;let p=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==u)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(c&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=d.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&d.set(e,t))}return t}toString(){return this.cssText}};const v=t=>new p("string"==typeof t?t:t+"",void 0,u),f=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,s)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[s+1]),t[0]);return new p(i,t,u)},b=(t,e)=>{c?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const i=document.createElement("style"),s=a.litNonce;void 0!==s&&i.setAttribute("nonce",s),i.textContent=e.cssText,t.appendChild(i)}))},m=c?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return v(e)})(t):t
|
|
50
50
|
/**
|
|
51
51
|
* @license
|
|
52
52
|
* Copyright 2017 Google LLC
|
|
@@ -57,13 +57,13 @@ const a=window,c=a.ShadowRoot&&(void 0===a.ShadyCSS||a.ShadyCSS.nativeShadow)&&"
|
|
|
57
57
|
* Copyright 2017 Google LLC
|
|
58
58
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
59
59
|
*/
|
|
60
|
-
var E;$.finalized=!0,$.elementProperties=new Map,$.elementStyles=[],$.shadowRootOptions={mode:"open"},null==O||O({ReactiveElement:$}),(null!==(x=g.reactiveElementVersions)&&void 0!==x?x:g.reactiveElementVersions=[]).push("1.6.1");const R=window,M=R.trustedTypes,k=M?M.createPolicy("lit-html",{createHTML:t=>t}):void 0,U="$lit$",
|
|
60
|
+
var E;$.finalized=!0,$.elementProperties=new Map,$.elementStyles=[],$.shadowRootOptions={mode:"open"},null==O||O({ReactiveElement:$}),(null!==(x=g.reactiveElementVersions)&&void 0!==x?x:g.reactiveElementVersions=[]).push("1.6.1");const R=window,M=R.trustedTypes,k=M?M.createPolicy("lit-html",{createHTML:t=>t}):void 0,U="$lit$",I=`lit$${(Math.random()+"").slice(9)}$`,T="?"+I,A=`<${T}>`,F=document,j=()=>F.createComment(""),L=t=>null===t||"object"!=typeof t&&"function"!=typeof t,B=Array.isArray,_=t=>B(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]),W="[ \t\n\f\r]",K=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,P=/-->/g,D=/>/g,z=RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),H=/'/g,Z=/"/g,V=/^(?:script|style|textarea|title)$/i,J=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),q=Symbol.for("lit-noChange"),G=Symbol.for("lit-nothing"),X=new WeakMap,Q=F.createTreeWalker(F,129,null,!1),Y=(t,e)=>{const i=t.length-1,s=[];let n,r=2===e?"<svg>":"",o=K;for(let e=0;e<i;e++){const i=t[e];let l,h,a=-1,c=0;for(;c<i.length&&(o.lastIndex=c,h=o.exec(i),null!==h);)c=o.lastIndex,o===K?"!--"===h[1]?o=P:void 0!==h[1]?o=D:void 0!==h[2]?(V.test(h[2])&&(n=RegExp("</"+h[2],"g")),o=z):void 0!==h[3]&&(o=z):o===z?">"===h[0]?(o=null!=n?n:K,a=-1):void 0===h[1]?a=-2:(a=o.lastIndex-h[2].length,l=h[1],o=void 0===h[3]?z:'"'===h[3]?Z:H):o===Z||o===H?o=z:o===P||o===D?o=K:(o=z,n=void 0);const u=o===z&&t[e+1].startsWith("/>")?" ":"";r+=o===K?i+A:a>=0?(s.push(l),i.slice(0,a)+U+i.slice(a)+I+u):i+I+(-2===a?(s.push(void 0),e):u)}const l=r+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==k?k.createHTML(l):l,s]};class tt{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let n=0,r=0;const o=t.length-1,l=this.parts,[h,a]=Y(t,e);if(this.el=tt.createElement(h,i),Q.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(s=Q.nextNode())&&l.length<o;){if(1===s.nodeType){if(s.hasAttributes()){const t=[];for(const e of s.getAttributeNames())if(e.endsWith(U)||e.startsWith(I)){const i=a[r++];if(t.push(e),void 0!==i){const t=s.getAttribute(i.toLowerCase()+U).split(I),e=/([.?@])?(.*)/.exec(i);l.push({type:1,index:n,name:e[2],strings:t,ctor:"."===e[1]?rt:"?"===e[1]?lt:"@"===e[1]?ht:nt})}else l.push({type:6,index:n})}for(const e of t)s.removeAttribute(e)}if(V.test(s.tagName)){const t=s.textContent.split(I),e=t.length-1;if(e>0){s.textContent=M?M.emptyScript:"";for(let i=0;i<e;i++)s.append(t[i],j()),Q.nextNode(),l.push({type:2,index:++n});s.append(t[e],j())}}}else if(8===s.nodeType)if(s.data===T)l.push({type:2,index:n});else{let t=-1;for(;-1!==(t=s.data.indexOf(I,t+1));)l.push({type:7,index:n}),t+=I.length-1}n++}}static createElement(t,e){const i=F.createElement("template");return i.innerHTML=t,i}}function et(t,e,i=t,s){var n,r,o,l;if(e===q)return e;let h=void 0!==s?null===(n=i._$Co)||void 0===n?void 0:n[s]:i._$Cl;const a=L(e)?void 0:e._$litDirective$;return(null==h?void 0:h.constructor)!==a&&(null===(r=null==h?void 0:h._$AO)||void 0===r||r.call(h,!1),void 0===a?h=void 0:(h=new a(t),h._$AT(t,i,s)),void 0!==s?(null!==(o=(l=i)._$Co)&&void 0!==o?o:l._$Co=[])[s]=h:i._$Cl=h),void 0!==h&&(e=et(t,h._$AS(t,e.values),h,s)),e}class it{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var e;const{el:{content:i},parts:s}=this._$AD,n=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:F).importNode(i,!0);Q.currentNode=n;let r=Q.nextNode(),o=0,l=0,h=s[0];for(;void 0!==h;){if(o===h.index){let e;2===h.type?e=new st(r,r.nextSibling,this,t):1===h.type?e=new h.ctor(r,h.name,h.strings,this,t):6===h.type&&(e=new at(r,this,t)),this._$AV.push(e),h=s[++l]}o!==(null==h?void 0:h.index)&&(r=Q.nextNode(),o++)}return n}v(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class st{constructor(t,e,i,s){var n;this.type=2,this._$AH=G,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cp=null===(n=null==s?void 0:s.isConnected)||void 0===n||n}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===(null==t?void 0:t.nodeType)&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=et(this,t,e),L(t)?t===G||null==t||""===t?(this._$AH!==G&&this._$AR(),this._$AH=G):t!==this._$AH&&t!==q&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):_(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==G&&L(this._$AH)?this._$AA.nextSibling.data=t:this.$(F.createTextNode(t)),this._$AH=t}g(t){var e;const{values:i,_$litType$:s}=t,n="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=tt.createElement(s.h,this.options)),s);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===n)this._$AH.v(i);else{const t=new it(n,this),e=t.u(this.options);t.v(i),this.$(e),this._$AH=t}}_$AC(t){let e=X.get(t.strings);return void 0===e&&X.set(t.strings,e=new tt(t)),e}T(t){B(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const n of t)s===e.length?e.push(i=new st(this.k(j()),this.k(j()),this,this.options)):i=e[s],i._$AI(n),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cp=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class nt{constructor(t,e,i,s,n){this.type=1,this._$AH=G,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=n,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=G}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,s){const n=this.strings;let r=!1;if(void 0===n)t=et(this,t,e,0),r=!L(t)||t!==this._$AH&&t!==q,r&&(this._$AH=t);else{const s=t;let o,l;for(t=n[0],o=0;o<n.length-1;o++)l=et(this,s[i+o],e,o),l===q&&(l=this._$AH[o]),r||(r=!L(l)||l!==this._$AH[o]),l===G?t=G:t!==G&&(t+=(null!=l?l:"")+n[o+1]),this._$AH[o]=l}r&&!s&&this.j(t)}j(t){t===G?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class rt extends nt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===G?void 0:t}}const ot=M?M.emptyScript:"";class lt extends nt{constructor(){super(...arguments),this.type=4}j(t){t&&t!==G?this.element.setAttribute(this.name,ot):this.element.removeAttribute(this.name)}}class ht extends nt{constructor(t,e,i,s,n){super(t,e,i,s,n),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=et(this,t,e,0))&&void 0!==i?i:G)===q)return;const s=this._$AH,n=t===G&&s!==G||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==G&&(s===G||n);n&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class at{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){et(this,t)}}const ct={O:U,P:I,A:T,C:1,M:Y,L:it,D:_,R:et,I:st,V:nt,H:lt,N:ht,U:rt,F:at},ut=R.litHtmlPolyfillSupport;null==ut||ut(tt,st),(null!==(E=R.litHtmlVersions)&&void 0!==E?E:R.litHtmlVersions=[]).push("2.7.3");
|
|
61
61
|
/**
|
|
62
62
|
* @license
|
|
63
63
|
* Copyright 2017 Google LLC
|
|
64
64
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
65
65
|
*/
|
|
66
|
-
var ut,pt;let vt=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{var s,n;const r=null!==(s=null==i?void 0:i.renderBefore)&&void 0!==s?s:e;let o=r._$litPart$;if(void 0===o){const t=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:null;r._$litPart$=o=new st(e.insertBefore(j(),t),t,void 0,null!=i?i:{})}return o._$AI(t),o})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return q}};vt.finalized=!0,vt._$litElement$=!0,null===(ut=globalThis.litElementHydrateSupport)||void 0===ut||ut.call(globalThis,{LitElement:vt});const ft=globalThis.litElementPolyfillSupport;null==ft||ft({LitElement:vt}),(null!==(pt=globalThis.litElementVersions)&&void 0!==pt?pt:globalThis.litElementVersions=[]).push("3.3.2");class bt{static create(t,e,i){let s=t=>v(null!=t?t:i),n=f`var(${v(t)}, ${s(i)})`;return n.name=t,n.category=e,n.defaultValue=i,n.defaultCssValue=s,n.get=e=>f`var(${v(t)}, ${s(e)})`,n.breadcrumb=()=>[],n.lastResortDefaultValue=()=>i,n}static extend(t,e,i){let s=t=>e.get(null!=t?t:i),n=f`var(${v(t)}, ${s(i)})`;return n.name=t,n.category=e.category,n.fallbackVariable=e,n.defaultValue=i,n.defaultCssValue=s,n.get=e=>f`var(${v(t)}, ${s(e)})`,n.breadcrumb=()=>[e.name,...e.breadcrumb()],n.lastResortDefaultValue=()=>i,n}static external(t,e){let i=e=>t.fallbackVariable?t.fallbackVariable.get(null!=e?e:t.defaultValue):v(null!=e?e:t.defaultValue),s=f`var(${v(t.name)}, ${i(t.defaultValue)})`;return s.name=t.name,s.category=t.category,s.fallbackVariable=t.fallbackVariable,s.defaultValue=t.defaultValue,s.context=e,s.defaultCssValue=i,s.get=e=>f`var(${v(t.name)}, ${i(e)})`,s.breadcrumb=()=>t.fallbackVariable?[t.fallbackVariable.name,...t.fallbackVariable.breadcrumb()]:[],s.lastResortDefaultValue=()=>{var e,i;return null!==(e=t.defaultValue)&&void 0!==e?e:null===(i=t.fallbackVariable)||void 0===i?void 0:i.lastResortDefaultValue()},s}}bt.create("--ft-color-primary","COLOR","#2196F3"),bt.create("--ft-color-primary-variant","COLOR","#1976D2"),bt.create("--ft-color-secondary","COLOR","#FFCC80"),bt.create("--ft-color-secondary-variant","COLOR","#F57C00"),bt.create("--ft-color-surface","COLOR","#FFFFFF"),bt.create("--ft-color-content","COLOR","rgba(0, 0, 0, 0.87)"),bt.create("--ft-color-error","COLOR","#B00020"),bt.create("--ft-color-outline","COLOR","rgba(0, 0, 0, 0.14)"),bt.create("--ft-color-opacity-high","NUMBER","1"),bt.create("--ft-color-opacity-medium","NUMBER","0.74"),bt.create("--ft-color-opacity-disabled","NUMBER","0.38"),bt.create("--ft-color-on-primary","COLOR","#FFFFFF"),bt.create("--ft-color-on-primary-high","COLOR","#FFFFFF"),bt.create("--ft-color-on-primary-medium","COLOR","rgba(255, 255, 255, 0.74)"),bt.create("--ft-color-on-primary-disabled","COLOR","rgba(255, 255, 255, 0.38)"),bt.create("--ft-color-on-secondary","COLOR","#FFFFFF"),bt.create("--ft-color-on-secondary-high","COLOR","#FFFFFF"),bt.create("--ft-color-on-secondary-medium","COLOR","rgba(255, 255, 255, 0.74)"),bt.create("--ft-color-on-secondary-disabled","COLOR","rgba(255, 255, 255, 0.38)"),bt.create("--ft-color-on-surface","COLOR","rgba(0, 0, 0, 0.87)"),bt.create("--ft-color-on-surface-high","COLOR","rgba(0, 0, 0, 0.87)"),bt.create("--ft-color-on-surface-medium","COLOR","rgba(0, 0, 0, 0.60)"),bt.create("--ft-color-on-surface-disabled","COLOR","rgba(0, 0, 0, 0.38)"),bt.create("--ft-opacity-content-on-surface-disabled","NUMBER","0"),bt.create("--ft-opacity-content-on-surface-enable","NUMBER","0"),bt.create("--ft-opacity-content-on-surface-hover","NUMBER","0.04"),bt.create("--ft-opacity-content-on-surface-focused","NUMBER","0.12"),bt.create("--ft-opacity-content-on-surface-pressed","NUMBER","0.10"),bt.create("--ft-opacity-content-on-surface-selected","NUMBER","0.08"),bt.create("--ft-opacity-content-on-surface-dragged","NUMBER","0.08"),bt.create("--ft-opacity-primary-on-surface-disabled","NUMBER","0"),bt.create("--ft-opacity-primary-on-surface-enable","NUMBER","0"),bt.create("--ft-opacity-primary-on-surface-hover","NUMBER","0.04"),bt.create("--ft-opacity-primary-on-surface-focused","NUMBER","0.12"),bt.create("--ft-opacity-primary-on-surface-pressed","NUMBER","0.10"),bt.create("--ft-opacity-primary-on-surface-selected","NUMBER","0.08"),bt.create("--ft-opacity-primary-on-surface-dragged","NUMBER","0.08"),bt.create("--ft-opacity-surface-on-primary-disabled","NUMBER","0"),bt.create("--ft-opacity-surface-on-primary-enable","NUMBER","0"),bt.create("--ft-opacity-surface-on-primary-hover","NUMBER","0.04"),bt.create("--ft-opacity-surface-on-primary-focused","NUMBER","0.12"),bt.create("--ft-opacity-surface-on-primary-pressed","NUMBER","0.10"),bt.create("--ft-opacity-surface-on-primary-selected","NUMBER","0.08"),bt.create("--ft-opacity-surface-on-primary-dragged","NUMBER","0.08"),bt.create("--ft-elevation-00","UNKNOWN","0px 0px 0px 0px rgba(0, 0, 0, 0), 0px 0px 0px 0px rgba(0, 0, 0, 0), 0px 0px 0px 0px rgba(0, 0, 0, 0)"),bt.create("--ft-elevation-01","UNKNOWN","0px 1px 4px 0px rgba(0, 0, 0, 0.06), 0px 1px 2px 0px rgba(0, 0, 0, 0.14), 0px 0px 1px 0px rgba(0, 0, 0, 0.06)"),bt.create("--ft-elevation-02","UNKNOWN","0px 4px 10px 0px rgba(0, 0, 0, 0.06), 0px 2px 5px 0px rgba(0, 0, 0, 0.14), 0px 0px 1px 0px rgba(0, 0, 0, 0.06)"),bt.create("--ft-elevation-03","UNKNOWN","0px 6px 13px 0px rgba(0, 0, 0, 0.06), 0px 3px 7px 0px rgba(0, 0, 0, 0.14), 0px 1px 2px 0px rgba(0, 0, 0, 0.06)"),bt.create("--ft-elevation-04","UNKNOWN","0px 8px 16px 0px rgba(0, 0, 0, 0.06), 0px 4px 9px 0px rgba(0, 0, 0, 0.14), 0px 2px 3px 0px rgba(0, 0, 0, 0.06)"),bt.create("--ft-elevation-06","UNKNOWN","0px 12px 22px 0px rgba(0, 0, 0, 0.06), 0px 6px 13px 0px rgba(0, 0, 0, 0.14), 0px 4px 5px 0px rgba(0, 0, 0, 0.06)"),bt.create("--ft-elevation-08","UNKNOWN","0px 16px 28px 0px rgba(0, 0, 0, 0.06), 0px 8px 17px 0px rgba(0, 0, 0, 0.14), 0px 6px 7px 0px rgba(0, 0, 0, 0.06)"),bt.create("--ft-elevation-12","UNKNOWN","0px 22px 40px 0px rgba(0, 0, 0, 0.06), 0px 12px 23px 0px rgba(0, 0, 0, 0.14), 0px 10px 11px 0px rgba(0, 0, 0, 0.06)"),bt.create("--ft-elevation-16","UNKNOWN","0px 28px 52px 0px rgba(0, 0, 0, 0.06), 0px 16px 29px 0px rgba(0, 0, 0, 0.14), 0px 14px 15px 0px rgba(0, 0, 0, 0.06)"),bt.create("--ft-elevation-24","UNKNOWN","0px 40px 76px 0px rgba(0, 0, 0, 0.06), 0px 24px 41px 0px rgba(0, 0, 0, 0.14), 0px 22px 23px 0px rgba(0, 0, 0, 0.06)"),bt.create("--ft-border-radius-S","SIZE","4px"),bt.create("--ft-border-radius-M","SIZE","8px"),bt.create("--ft-border-radius-L","SIZE","12px"),bt.create("--ft-border-radius-XL","SIZE","16px"),bt.create("--ft-title-font","UNKNOWN","Ubuntu, system-ui, sans-serif"),bt.create("--ft-content-font","UNKNOWN","'Open Sans', system-ui, sans-serif"),bt.create("--ft-transition-duration","UNKNOWN","250ms"),bt.create("--ft-transition-timing-function","UNKNOWN","ease-in-out");class mt extends vt{createRenderRoot(){const t=this.constructor;t.elementDefinitions&&!t.registry&&(t.registry=new CustomElementRegistry,Object.entries(t.elementDefinitions).forEach((([e,i])=>t.registry.define(e,i))));const e={...t.shadowRootOptions,customElements:t.registry},i=this.renderOptions.creationScope=this.attachShadow(e);return b(i,t.elementStyles),i}}var xt,gt=function(t,e,i,s){for(var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(n=t[l])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o};const wt=Symbol("constructorPrototype"),yt=Symbol("constructorName"),Ot=Symbol("exportpartsDebouncer");class St extends mt{constructor(){super(),this[xt]=new e(5),this[yt]=this.constructor.name,this[wt]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[yt]&&Object.setPrototypeOf(this,this[wt])}updated(t){super.updated(t),setTimeout((()=>{this.contentAvailableCallback(t),this.scheduleExportpartsUpdate()}),0)}contentAvailableCallback(t){var e,i;if((null!==(i=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelectorAll(".ft-lit-element--custom-stylesheet"))&&void 0!==i?i:[]).forEach((t=>t.remove())),this.customStylesheet){const t=document.createElement("style");t.classList.add("ft-lit-element--custom-stylesheet"),t.innerHTML=this.customStylesheet,this.shadowRoot.append(t)}}scheduleExportpartsUpdate(){this[Ot].run((()=>{var t;(null===(t=this.exportpartsPrefix)||void 0===t?void 0:t.trim())?this.setExportpartsAttribute([this.exportpartsPrefix]):null!=this.exportpartsPrefixes&&this.exportpartsPrefixes.length>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)}))}setExportpartsAttribute(t){var e,i,s,n,r,o;const l=t=>null!=t&&t.trim().length>0,h=t.filter(l).map((t=>t.trim()));if(0===h.length)return void this.removeAttribute("exportparts");const a=new Set;for(let t of null!==(i=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelectorAll("[part],[exportparts]"))&&void 0!==i?i:[]){const e=null!==(n=null===(s=t.getAttribute("part"))||void 0===s?void 0:s.split(" "))&&void 0!==n?n:[],i=null!==(o=null===(r=t.getAttribute("exportparts"))||void 0===r?void 0:r.split(",").map((t=>t.split(":")[1])))&&void 0!==o?o:[];new Array(...e,...i).filter(l).map((t=>t.trim())).forEach((t=>a.add(t)))}if(0===a.size)return void this.removeAttribute("exportparts");const c=[...a.values()].flatMap((t=>h.map((e=>`${t}:${e}--${t}`))));this.setAttribute("exportparts",[...this.part,...c].join(", "))}}function Ct(t){var e;return null!==(e=null==t?void 0:t.isFtReduxStore)&&void 0!==e&&e}var Nt,$t,Et;xt=Ot,gt([s()],St.prototype,"exportpartsPrefix",void 0),gt([function(t,e){const i=()=>JSON.parse(JSON.stringify(t));return s({type:Object,converter:{fromAttribute:t=>{if(null==t)return i();try{return JSON.parse(t)}catch{return i()}},toAttribute:t=>JSON.stringify(t)},hasChanged:(t,e)=>!l(t,e),...null!=e?e:{}})}([])],St.prototype,"exportpartsPrefixes",void 0),gt([s()],St.prototype,"customStylesheet",void 0),f`
|
|
66
|
+
var dt,pt;let vt=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{var s,n;const r=null!==(s=null==i?void 0:i.renderBefore)&&void 0!==s?s:e;let o=r._$litPart$;if(void 0===o){const t=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:null;r._$litPart$=o=new st(e.insertBefore(j(),t),t,void 0,null!=i?i:{})}return o._$AI(t),o})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return q}};vt.finalized=!0,vt._$litElement$=!0,null===(dt=globalThis.litElementHydrateSupport)||void 0===dt||dt.call(globalThis,{LitElement:vt});const ft=globalThis.litElementPolyfillSupport;null==ft||ft({LitElement:vt}),(null!==(pt=globalThis.litElementVersions)&&void 0!==pt?pt:globalThis.litElementVersions=[]).push("3.3.2");class bt{static create(t,e,i){let s=t=>v(null!=t?t:i),n=f`var(${v(t)}, ${s(i)})`;return n.name=t,n.category=e,n.defaultValue=i,n.defaultCssValue=s,n.get=e=>f`var(${v(t)}, ${s(e)})`,n.breadcrumb=()=>[],n.lastResortDefaultValue=()=>i,n}static extend(t,e,i){let s=t=>e.get(null!=t?t:i),n=f`var(${v(t)}, ${s(i)})`;return n.name=t,n.category=e.category,n.fallbackVariable=e,n.defaultValue=i,n.defaultCssValue=s,n.get=e=>f`var(${v(t)}, ${s(e)})`,n.breadcrumb=()=>[e.name,...e.breadcrumb()],n.lastResortDefaultValue=()=>i,n}static external(t,e){let i=e=>t.fallbackVariable?t.fallbackVariable.get(null!=e?e:t.defaultValue):v(null!=e?e:t.defaultValue),s=f`var(${v(t.name)}, ${i(t.defaultValue)})`;return s.name=t.name,s.category=t.category,s.fallbackVariable=t.fallbackVariable,s.defaultValue=t.defaultValue,s.context=e,s.defaultCssValue=i,s.get=e=>f`var(${v(t.name)}, ${i(e)})`,s.breadcrumb=()=>t.fallbackVariable?[t.fallbackVariable.name,...t.fallbackVariable.breadcrumb()]:[],s.lastResortDefaultValue=()=>{var e,i;return null!==(e=t.defaultValue)&&void 0!==e?e:null===(i=t.fallbackVariable)||void 0===i?void 0:i.lastResortDefaultValue()},s}}bt.create("--ft-color-primary","COLOR","#2196F3"),bt.create("--ft-color-primary-variant","COLOR","#1976D2"),bt.create("--ft-color-secondary","COLOR","#FFCC80"),bt.create("--ft-color-secondary-variant","COLOR","#F57C00"),bt.create("--ft-color-surface","COLOR","#FFFFFF"),bt.create("--ft-color-content","COLOR","rgba(0, 0, 0, 0.87)"),bt.create("--ft-color-error","COLOR","#B00020"),bt.create("--ft-color-outline","COLOR","rgba(0, 0, 0, 0.14)"),bt.create("--ft-color-opacity-high","NUMBER","1"),bt.create("--ft-color-opacity-medium","NUMBER","0.74"),bt.create("--ft-color-opacity-disabled","NUMBER","0.38"),bt.create("--ft-color-on-primary","COLOR","#FFFFFF"),bt.create("--ft-color-on-primary-high","COLOR","#FFFFFF"),bt.create("--ft-color-on-primary-medium","COLOR","rgba(255, 255, 255, 0.74)"),bt.create("--ft-color-on-primary-disabled","COLOR","rgba(255, 255, 255, 0.38)"),bt.create("--ft-color-on-secondary","COLOR","#FFFFFF"),bt.create("--ft-color-on-secondary-high","COLOR","#FFFFFF"),bt.create("--ft-color-on-secondary-medium","COLOR","rgba(255, 255, 255, 0.74)"),bt.create("--ft-color-on-secondary-disabled","COLOR","rgba(255, 255, 255, 0.38)"),bt.create("--ft-color-on-surface","COLOR","rgba(0, 0, 0, 0.87)"),bt.create("--ft-color-on-surface-high","COLOR","rgba(0, 0, 0, 0.87)"),bt.create("--ft-color-on-surface-medium","COLOR","rgba(0, 0, 0, 0.60)"),bt.create("--ft-color-on-surface-disabled","COLOR","rgba(0, 0, 0, 0.38)"),bt.create("--ft-opacity-content-on-surface-disabled","NUMBER","0"),bt.create("--ft-opacity-content-on-surface-enable","NUMBER","0"),bt.create("--ft-opacity-content-on-surface-hover","NUMBER","0.04"),bt.create("--ft-opacity-content-on-surface-focused","NUMBER","0.12"),bt.create("--ft-opacity-content-on-surface-pressed","NUMBER","0.10"),bt.create("--ft-opacity-content-on-surface-selected","NUMBER","0.08"),bt.create("--ft-opacity-content-on-surface-dragged","NUMBER","0.08"),bt.create("--ft-opacity-primary-on-surface-disabled","NUMBER","0"),bt.create("--ft-opacity-primary-on-surface-enable","NUMBER","0"),bt.create("--ft-opacity-primary-on-surface-hover","NUMBER","0.04"),bt.create("--ft-opacity-primary-on-surface-focused","NUMBER","0.12"),bt.create("--ft-opacity-primary-on-surface-pressed","NUMBER","0.10"),bt.create("--ft-opacity-primary-on-surface-selected","NUMBER","0.08"),bt.create("--ft-opacity-primary-on-surface-dragged","NUMBER","0.08"),bt.create("--ft-opacity-surface-on-primary-disabled","NUMBER","0"),bt.create("--ft-opacity-surface-on-primary-enable","NUMBER","0"),bt.create("--ft-opacity-surface-on-primary-hover","NUMBER","0.04"),bt.create("--ft-opacity-surface-on-primary-focused","NUMBER","0.12"),bt.create("--ft-opacity-surface-on-primary-pressed","NUMBER","0.10"),bt.create("--ft-opacity-surface-on-primary-selected","NUMBER","0.08"),bt.create("--ft-opacity-surface-on-primary-dragged","NUMBER","0.08"),bt.create("--ft-elevation-00","UNKNOWN","0px 0px 0px 0px rgba(0, 0, 0, 0), 0px 0px 0px 0px rgba(0, 0, 0, 0), 0px 0px 0px 0px rgba(0, 0, 0, 0)"),bt.create("--ft-elevation-01","UNKNOWN","0px 1px 4px 0px rgba(0, 0, 0, 0.06), 0px 1px 2px 0px rgba(0, 0, 0, 0.14), 0px 0px 1px 0px rgba(0, 0, 0, 0.06)"),bt.create("--ft-elevation-02","UNKNOWN","0px 4px 10px 0px rgba(0, 0, 0, 0.06), 0px 2px 5px 0px rgba(0, 0, 0, 0.14), 0px 0px 1px 0px rgba(0, 0, 0, 0.06)"),bt.create("--ft-elevation-03","UNKNOWN","0px 6px 13px 0px rgba(0, 0, 0, 0.06), 0px 3px 7px 0px rgba(0, 0, 0, 0.14), 0px 1px 2px 0px rgba(0, 0, 0, 0.06)"),bt.create("--ft-elevation-04","UNKNOWN","0px 8px 16px 0px rgba(0, 0, 0, 0.06), 0px 4px 9px 0px rgba(0, 0, 0, 0.14), 0px 2px 3px 0px rgba(0, 0, 0, 0.06)"),bt.create("--ft-elevation-06","UNKNOWN","0px 12px 22px 0px rgba(0, 0, 0, 0.06), 0px 6px 13px 0px rgba(0, 0, 0, 0.14), 0px 4px 5px 0px rgba(0, 0, 0, 0.06)"),bt.create("--ft-elevation-08","UNKNOWN","0px 16px 28px 0px rgba(0, 0, 0, 0.06), 0px 8px 17px 0px rgba(0, 0, 0, 0.14), 0px 6px 7px 0px rgba(0, 0, 0, 0.06)"),bt.create("--ft-elevation-12","UNKNOWN","0px 22px 40px 0px rgba(0, 0, 0, 0.06), 0px 12px 23px 0px rgba(0, 0, 0, 0.14), 0px 10px 11px 0px rgba(0, 0, 0, 0.06)"),bt.create("--ft-elevation-16","UNKNOWN","0px 28px 52px 0px rgba(0, 0, 0, 0.06), 0px 16px 29px 0px rgba(0, 0, 0, 0.14), 0px 14px 15px 0px rgba(0, 0, 0, 0.06)"),bt.create("--ft-elevation-24","UNKNOWN","0px 40px 76px 0px rgba(0, 0, 0, 0.06), 0px 24px 41px 0px rgba(0, 0, 0, 0.14), 0px 22px 23px 0px rgba(0, 0, 0, 0.06)"),bt.create("--ft-border-radius-S","SIZE","4px"),bt.create("--ft-border-radius-M","SIZE","8px"),bt.create("--ft-border-radius-L","SIZE","12px"),bt.create("--ft-border-radius-XL","SIZE","16px"),bt.create("--ft-title-font","UNKNOWN","Ubuntu, system-ui, sans-serif"),bt.create("--ft-content-font","UNKNOWN","'Open Sans', system-ui, sans-serif"),bt.create("--ft-transition-duration","UNKNOWN","250ms"),bt.create("--ft-transition-timing-function","UNKNOWN","ease-in-out");class mt extends vt{createRenderRoot(){const t=this.constructor;t.elementDefinitions&&!t.registry&&(t.registry=new CustomElementRegistry,Object.entries(t.elementDefinitions).forEach((([e,i])=>t.registry.define(e,i))));const e={...t.shadowRootOptions,customElements:t.registry},i=this.renderOptions.creationScope=this.attachShadow(e);return b(i,t.elementStyles),i}}var xt,gt=function(t,e,i,s){for(var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(n=t[l])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o};const wt=Symbol("constructorPrototype"),yt=Symbol("constructorName"),Ot=Symbol("exportpartsDebouncer");class St extends mt{constructor(){super(),this[xt]=new e(5),this[yt]=this.constructor.name,this[wt]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[yt]&&Object.setPrototypeOf(this,this[wt])}updated(t){super.updated(t),setTimeout((()=>{this.contentAvailableCallback(t),this.scheduleExportpartsUpdate()}),0)}contentAvailableCallback(t){var e,i;if((null!==(i=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelectorAll(".ft-lit-element--custom-stylesheet"))&&void 0!==i?i:[]).forEach((t=>t.remove())),this.customStylesheet){const t=document.createElement("style");t.classList.add("ft-lit-element--custom-stylesheet"),t.innerHTML=this.customStylesheet,this.shadowRoot.append(t)}}scheduleExportpartsUpdate(){this[Ot].run((()=>{var t;(null===(t=this.exportpartsPrefix)||void 0===t?void 0:t.trim())?this.setExportpartsAttribute([this.exportpartsPrefix]):null!=this.exportpartsPrefixes&&this.exportpartsPrefixes.length>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)}))}setExportpartsAttribute(t){var e,i,s,n,r,o;const l=t=>null!=t&&t.trim().length>0,h=t.filter(l).map((t=>t.trim()));if(0===h.length)return void this.removeAttribute("exportparts");const a=new Set;for(let t of null!==(i=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelectorAll("[part],[exportparts]"))&&void 0!==i?i:[]){const e=null!==(n=null===(s=t.getAttribute("part"))||void 0===s?void 0:s.split(" "))&&void 0!==n?n:[],i=null!==(o=null===(r=t.getAttribute("exportparts"))||void 0===r?void 0:r.split(",").map((t=>t.split(":")[1])))&&void 0!==o?o:[];new Array(...e,...i).filter(l).map((t=>t.trim())).forEach((t=>a.add(t)))}if(0===a.size)return void this.removeAttribute("exportparts");const c=[...a.values()].flatMap((t=>h.map((e=>`${t}:${e}--${t}`))));this.setAttribute("exportparts",[...this.part,...c].join(", "))}}function Ct(t){var e;return null!==(e=null==t?void 0:t.isFtReduxStore)&&void 0!==e&&e}var Nt,$t,Et;xt=Ot,gt([s()],St.prototype,"exportpartsPrefix",void 0),gt([function(t,e){const i=()=>JSON.parse(JSON.stringify(t));return s({type:Object,converter:{fromAttribute:t=>{if(null==t)return i();try{return JSON.parse(t)}catch{return i()}},toAttribute:t=>JSON.stringify(t)},hasChanged:(t,e)=>!l(t,e),...null!=e?e:{}})}([])],St.prototype,"exportpartsPrefixes",void 0),gt([s()],St.prototype,"customStylesheet",void 0),f`
|
|
67
67
|
.ft-no-text-select {
|
|
68
68
|
-webkit-touch-callout: none;
|
|
69
69
|
-webkit-user-select: none;
|
|
@@ -95,17 +95,17 @@ var ut,pt;let vt=class extends ${constructor(){super(...arguments),this.renderOp
|
|
|
95
95
|
display: inline-block;
|
|
96
96
|
width: 0;
|
|
97
97
|
}
|
|
98
|
-
`;const Rt=Symbol("internalReduxEventsUnsubscribers"),Mt=Symbol("internalStoresUnsubscribers"),kt=Symbol("internalStores");class Ut extends St{constructor(){super(...arguments),this[Nt]=new Map,this[$t]=new Map,this[Et]=[]}update(t){var e;super.update(t),(null===(e=this.reduxReactiveProperties)||void 0===e?void 0:e.some((e=>t.has(e))))&&this.updateFromStores()}getUnnamedStore(){if(this[kt].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[kt].values()][0]}getStore(t){return null==t?this.getUnnamedStore():this[kt].get(t)}addStore(t,e){var i;e=null!==(i=null!=e?e:Ct(t)?t.name:void 0)&&void 0!==i?i:"default-store",this.unsubscribeFromStore(e),this.setupStore(e,t)}removeStore(t){const e="string"==typeof t?t:t.name;this.unsubscribeFromStore(e),this[kt].delete(e)}setupStore(t,e){this[kt].set(t,e),this.subscribeToStore(t,e),this.updateFromStores()}setupStores(){this.unsubscribeFromStores(),this[kt].forEach(((t,e)=>this.subscribeToStore(e,t))),this.updateFromStores()}updateFromStores(){this.reduxProperties&&this.reduxProperties.forEach(((t,e)=>{const i=this.constructor.getPropertyOptions(e);if(!(null==i?void 0:i.attribute)||!this.hasAttribute("string"==typeof(null==i?void 0:i.attribute)?i.attribute:e)){const i=this.getStore(t.store);i&&(t.store?this[Mt].has(t.store):this[Mt].size>0)&&(this[e]=t.selector(i.getState(),this))}}))}subscribeToStore(t,e){var i;this[Mt].set(t,e.subscribe((()=>this.updateFromStores()))),Ct(e)&&e.eventBus&&(null===(i=this.reduxEventListeners)||void 0===i||i.forEach(((t,i)=>{if("function"==typeof this[i]&&(!t.store||e.name===t.store)){const s=t=>this[i](t);e.eventBus.addEventListener(t.eventName,s),this[Rt].push((()=>e.eventBus.removeEventListener(t.eventName,s)))}}))),this.onStoreAvailable(t)}unsubscribeFromStores(){this[Mt].forEach(((t,e)=>this.unsubscribeFromStore(e))),this[Rt].forEach((t=>t())),this[Rt]=[]}unsubscribeFromStore(t){this[Mt].has(t)&&this[Mt].get(t)(),this[Mt].delete(t)}onStoreAvailable(t){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}Nt=Mt,$t=kt,Et=Rt,window.ftReduxStores||(window.ftReduxStores={});const
|
|
98
|
+
`;const Rt=Symbol("internalReduxEventsUnsubscribers"),Mt=Symbol("internalStoresUnsubscribers"),kt=Symbol("internalStores");class Ut extends St{constructor(){super(...arguments),this[Nt]=new Map,this[$t]=new Map,this[Et]=[]}update(t){var e;super.update(t),(null===(e=this.reduxReactiveProperties)||void 0===e?void 0:e.some((e=>t.has(e))))&&this.updateFromStores()}getUnnamedStore(){if(this[kt].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[kt].values()][0]}getStore(t){return null==t?this.getUnnamedStore():this[kt].get(t)}addStore(t,e){var i;e=null!==(i=null!=e?e:Ct(t)?t.name:void 0)&&void 0!==i?i:"default-store",this.unsubscribeFromStore(e),this.setupStore(e,t)}removeStore(t){const e="string"==typeof t?t:t.name;this.unsubscribeFromStore(e),this[kt].delete(e)}setupStore(t,e){this[kt].set(t,e),this.subscribeToStore(t,e),this.updateFromStores()}setupStores(){this.unsubscribeFromStores(),this[kt].forEach(((t,e)=>this.subscribeToStore(e,t))),this.updateFromStores()}updateFromStores(){this.reduxProperties&&this.reduxProperties.forEach(((t,e)=>{const i=this.constructor.getPropertyOptions(e);if(!(null==i?void 0:i.attribute)||!this.hasAttribute("string"==typeof(null==i?void 0:i.attribute)?i.attribute:e)){const i=this.getStore(t.store);i&&(t.store?this[Mt].has(t.store):this[Mt].size>0)&&(this[e]=t.selector(i.getState(),this))}}))}subscribeToStore(t,e){var i;this[Mt].set(t,e.subscribe((()=>this.updateFromStores()))),Ct(e)&&e.eventBus&&(null===(i=this.reduxEventListeners)||void 0===i||i.forEach(((t,i)=>{if("function"==typeof this[i]&&(!t.store||e.name===t.store)){const s=t=>this[i](t);e.eventBus.addEventListener(t.eventName,s),this[Rt].push((()=>e.eventBus.removeEventListener(t.eventName,s)))}}))),this.onStoreAvailable(t)}unsubscribeFromStores(){this[Mt].forEach(((t,e)=>this.unsubscribeFromStore(e))),this[Rt].forEach((t=>t())),this[Rt]=[]}unsubscribeFromStore(t){this[Mt].has(t)&&this[Mt].get(t)(),this[Mt].delete(t)}onStoreAvailable(t){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}Nt=Mt,$t=kt,Et=Rt,window.ftReduxStores||(window.ftReduxStores={});const It=t=>{const e=null!=t?t:{};return(t,i)=>{var n;const r={hasChanged:(t,e)=>!l(t,e),attribute:!1,...e};s(r)(t,i);const o=t;o.reduxProperties=o.reduxProperties||new Map,o.reduxProperties.set(i,{selector:null!==(n=e.selector)&&void 0!==n?n:t=>t[i],store:e.store})}};var Tt,At,Ft;navigator.vendor&&navigator.vendor.match(/apple/i)||(null===(At=null===(Tt=window.safari)||void 0===Tt?void 0:Tt.pushNotification)||void 0===At||At.toString()),function(t){t.FEEDBACK="FEEDBACK",t.RATING="RATING",t.PRINT="PRINT",t.BOOKMARK="BOOKMARK",t.COLLECTIONS="COLLECTIONS"}(Ft||(Ft={}));var jt=function(t,e,i,s){for(var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(n=t[l])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o};class Lt extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}const Bt=Symbol("registerInterval");class _t extends(function(t){var e;class i extends t{constructor(){super(...arguments),this[e]=0}setReaderStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"reader")}clearStateManager(){this.stateManager&&(this.removeStore("reader"),this.stateManager=void 0)}get service(){var t;return null===(t=this.stateManager)||void 0===t?void 0:t.service}connectedCallback(){super.connectedCallback(),this[Bt]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[Bt]):this.dispatchEvent(new Lt)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return e=Bt,jt([n()],i.prototype,"stateManager",void 0),i}(Ut)){}
|
|
99
99
|
/**
|
|
100
100
|
* @license
|
|
101
101
|
* Copyright 2017 Google LLC
|
|
102
102
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
103
|
-
*/const
|
|
103
|
+
*/const Wt=2,Kt=t=>(...e)=>({_$litDirective$:t,values:e});class Pt{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}
|
|
104
104
|
/**
|
|
105
105
|
* @license
|
|
106
106
|
* Copyright 2020 Google LLC
|
|
107
107
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
108
|
-
*/const{I:
|
|
108
|
+
*/const{I:Dt}=ct,zt=()=>document.createComment(""),Ht=(t,e,i)=>{var s;const n=t._$AA.parentNode,r=void 0===e?t._$AB:e._$AA;if(void 0===i){const e=n.insertBefore(zt(),r),s=n.insertBefore(zt(),r);i=new Dt(e,s,t,t.options)}else{const e=i._$AB.nextSibling,o=i._$AM,l=o!==t;if(l){let e;null===(s=i._$AQ)||void 0===s||s.call(i,t),i._$AM=t,void 0!==i._$AP&&(e=t._$AU)!==o._$AU&&i._$AP(e)}if(e!==r||l){let t=i._$AA;for(;t!==e;){const e=t.nextSibling;n.insertBefore(t,r),t=e}}}return i},Zt=(t,e,i=t)=>(t._$AI(e,i),t),Vt={},Jt=t=>{var e;null===(e=t._$AP)||void 0===e||e.call(t,!1,!0);let i=t._$AA;const s=t._$AB.nextSibling;for(;i!==s;){const t=i.nextSibling;i.remove(),i=t}},qt=(t,e,i)=>{const s=new Map;for(let n=e;n<=i;n++)s.set(t[n],n);return s},Gt=Kt(class extends Pt{constructor(t){if(super(t),t.type!==Wt)throw Error("repeat() can only be used in text expressions")}dt(t,e,i){let s;void 0===i?i=e:void 0!==e&&(s=e);const n=[],r=[];let o=0;for(const e of t)n[o]=s?s(e,o):o,r[o]=i(e,o),o++;return{values:r,keys:n}}render(t,e,i){return this.dt(t,e,i).values}update(t,[e,i,s]){var n;const r=(t=>t._$AH)(t),{values:o,keys:l}=this.dt(e,i,s);if(!Array.isArray(r))return this.ht=l,o;const h=null!==(n=this.ht)&&void 0!==n?n:this.ht=[],a=[];let c,u,d=0,p=r.length-1,v=0,f=o.length-1;for(;d<=p&&v<=f;)if(null===r[d])d++;else if(null===r[p])p--;else if(h[d]===l[v])a[v]=Zt(r[d],o[v]),d++,v++;else if(h[p]===l[f])a[f]=Zt(r[p],o[f]),p--,f--;else if(h[d]===l[f])a[f]=Zt(r[d],o[f]),Ht(t,a[f+1],r[d]),d++,f--;else if(h[p]===l[v])a[v]=Zt(r[p],o[v]),Ht(t,r[d],r[p]),p--,v++;else if(void 0===c&&(c=qt(l,v,f),u=qt(h,d,p)),c.has(h[d]))if(c.has(h[p])){const e=u.get(l[v]),i=void 0!==e?r[e]:null;if(null===i){const e=Ht(t,r[d]);Zt(e,o[v]),a[v]=e}else a[v]=Zt(i,o[v]),Ht(t,r[d],i),r[e]=null;v++}else Jt(r[p]),p--;else Jt(r[d]),d++;for(;v<=f;){const e=Ht(t,a[f+1]);Zt(e,o[v]),a[v++]=e}for(;d<=p;){const t=r[d++];null!==t&&Jt(t)}return this.ht=l,((t,e=Vt)=>{t._$AH=e})(t,a),q}});
|
|
109
109
|
/**
|
|
110
110
|
* @license
|
|
111
111
|
* Copyright 2017 Google LLC
|
|
@@ -116,10 +116,10 @@ var ut,pt;let vt=class extends ${constructor(){super(...arguments),this.renderOp
|
|
|
116
116
|
* Copyright 2017 Google LLC
|
|
117
117
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
118
118
|
*/
|
|
119
|
-
class Xt extends
|
|
119
|
+
class Xt extends Pt{constructor(t){if(super(t),this.et=G,t.type!==Wt)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===G||null==t)return this.ft=void 0,this.et=t;if(t===q)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.et)return this.ft;this.et=t;const e=[t];return e.raw=e,this.ft={_$litType$:this.constructor.resultType,strings:e,values:[]}}}Xt.directiveName="unsafeHTML",Xt.resultType=1;const Qt=Kt(Xt),Yt=bt.create("--ft-infinite-scroll-padding","SIZE","0"),te=bt.create("--ft-infinite-scroll-items-gap","SIZE","4px"),ee=bt.create("--ft-infinite-scroll-item-container-min-height","SIZE",".1px"),ie=f`
|
|
120
120
|
.items-container {
|
|
121
121
|
position: relative;
|
|
122
|
-
padding: ${
|
|
122
|
+
padding: ${Yt};
|
|
123
123
|
outline: none;
|
|
124
124
|
}
|
|
125
125
|
|
|
@@ -141,7 +141,7 @@ class Xt extends Kt{constructor(t){if(super(t),this.et=X,t.type!==_t)throw Error
|
|
|
141
141
|
By adding this gap we ensure that the previous item will be fully hidden
|
|
142
142
|
and even if its size changes, it will not impact the scroll offset
|
|
143
143
|
*/
|
|
144
|
-
margin-top: ${
|
|
144
|
+
margin-top: ${te};
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
.resizable:not(.rendered) {
|
|
@@ -149,36 +149,36 @@ class Xt extends Kt{constructor(t){if(super(t),this.et=X,t.type!==_t)throw Error
|
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
.item-container, .resizable.rendered {
|
|
152
|
-
min-height: ${
|
|
152
|
+
min-height: ${ee}
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
.rendered {
|
|
156
156
|
display: flow-root;
|
|
157
157
|
}
|
|
158
|
-
`;var
|
|
158
|
+
`;var se=function(t,e,i,s){for(var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(n=t[l])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o};class ne extends CustomEvent{constructor(t,e){super("visible-items-change",{detail:{visibleIndexes:t,visibleItems:e}})}}class re extends Event{constructor(){super("scrolled-to-target")}}class oe extends St{constructor(){super(...arguments),this.items=[],this.renderItem=()=>J``,this.getItemKey=(t,e)=>`${e} - ${JSON.stringify(t)}`,this.internalScroll=!1,this.renderBeforeFirst=1,this.renderAfterLast=1,this.visibleItems=[],this.scrolledToTarget=!1,this.alreadyRenderedIndexes=new Set,this.scrollDebouncer=new e(5),this.scrollDoneDebouncer=new e(10),this.onVisibilityChange=t=>{let e=new Set(this.visibleItems),i=new Set;for(let s of t){let t=+s.target.attributes.getNamedItem("data-item-index").value;s.intersectionRect.height>0?(e.add(t),i.add(t)):i.has(t)||e.delete(t)}this.visibleItems=[...e].sort(((t,e)=>t-e))},this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange),this.onResize=t=>{this.triggerFindScrollableParent();let e=this.searchFirstVisibleItem([...this.itemsContainer.children]),i=this.scrollable.scrollTop-this.getOffset(e);for(const e of t){const t=+e.target.parentElement.getAttribute("data-item-index");(this.alreadyRenderedIndexes.has(t)||e.target.classList.contains("rendered"))&&(e.target.parentElement.style.height=e.target.clientHeight+"px")}null!=e&&null!=i&&this.scrolledToTarget&&(this.scrollable.scrollTop=this.getOffset(e)+Math.min(i,e.clientHeight))},this.resizeObserver=new ResizeObserver(this.onResize),this.onMutation=()=>{[...this.itemsContainer.children].forEach((t=>{this.resizeObserver.observe(t.children.item(0)),this.intersectionObserver.observe(t)}))},this.mutationObserver=new MutationObserver(this.onMutation),this.resetVisibleItemsDebouncer=new e(10)}get scrollable(){var t;return null!==(t=this.internalScroll?this.internalScrollable:this.firstScrollableParent)&&void 0!==t?t:document.body}render(){return J`
|
|
159
159
|
<div class="items-container ${this.internalScroll?"scrollable":""}"
|
|
160
160
|
tabindex="-1"
|
|
161
161
|
@find-scrollable-parent=${this.findScrollableParent}>
|
|
162
|
-
${
|
|
162
|
+
${Gt(this.items,((t,e)=>this.getItemKey(t,e)),((t,e)=>this.renderItemContainer(t,e)))}
|
|
163
163
|
</div>
|
|
164
164
|
`}renderItemContainer(t,e){const i=this.scrolledToTarget&&this.visibleItems.includes(e),s=this.alreadyRenderedIndexes.has(e)||this.scrolledToTarget&&e>=this.visibleItems[0]-this.renderBeforeFirst&&e<=(null!=(n=this.visibleItems)?n:[])[(null!=n?n:[]).length-1]+this.renderAfterLast;var n;s&&this.alreadyRenderedIndexes.add(e);return J`
|
|
165
165
|
<div id="item-${e}"
|
|
166
166
|
class="item-container ${i?"visible":""}"
|
|
167
167
|
data-item-index="${e}">
|
|
168
168
|
<div class="resizable ${i?"visible":""} ${s?"rendered":""}">
|
|
169
|
-
${s?(()=>{const i=this.renderItem(t,e);return"string"==typeof i?J`${
|
|
169
|
+
${s?(()=>{const i=this.renderItem(t,e);return"string"==typeof i?J`${Qt(i)}`:i})():null}
|
|
170
170
|
</div>
|
|
171
171
|
</div>
|
|
172
|
-
`}resetScroll(){this.triggerFindScrollableParent(),this.intersectionObserver.disconnect(),this.resizeObserver.disconnect(),this.visibleItems=[],this.scrolledToTarget=!1,this.scrollDebouncer.run((()=>{var t;let e=null!==(t=this.scrollToIndex)&&void 0!==t?t:this.scrollToItem?this.items.indexOf(this.scrollToItem):-1;e>=this.items.length&&(e=-1);let i=this.getItem(e);this.scrollToTarget(i),this.scrollDoneDebouncer.run((()=>{this.onMutation(),this.scrolledToTarget=!0}))}))}getItem(t){var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(`#item-${t}`)}scrollToTarget(t){var e;if(t){let i=+(null!==(e=t.getAttribute("data-item-index"))&&void 0!==e?e:"0");this.scrollable&&0===i?this.scrollable.scrollTop=0:this.scrollable.scrollTop=this.getOffset(t)}}getOffset(t){var e;let i=0,s=t;for(;s&&s.offsetParent!==this.scrollable.offsetParent;)i+=s.offsetTop,s=s.offsetParent;return i+(null!==(e=null==s?void 0:s.offsetTop)&&void 0!==e?e:0)-this.scrollable.offsetTop}getBottomOffset(t){var e;return this.getOffset(t)+(null!==(e=null==t?void 0:t.clientHeight)&&void 0!==e?e:0)}appendItems(...t){this.items=[...this.items,...t]}prependItems(...t){this.items=[...t,...this.items]}connectedCallback(){super.connectedCallback(),setTimeout((()=>{this.triggerFindScrollableParent(),this.initIntersectionObserver(),this.mutationObserver.disconnect(),this.mutationObserver.observe(this.itemsContainer,{childList:!0})}),0)}initIntersectionObserver(){this.intersectionObserver.disconnect(),this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange,{root:this.scrollable,rootMargin:"-8px",threshold:[0,.01,.1,1]})}triggerFindScrollableParent(){var t;null===(t=this.itemsContainer)||void 0===t||t.dispatchEvent(new Event("find-scrollable-parent",{composed:!0}))}findScrollableParent(t){let e,i;t.stopPropagation();for(let s of t.composedPath()){const t=s,n=this.elementCanScroll(t);if(t.clientHeight&&t.clientHeight<t.scrollHeight&&n){e=t;break}n&&(i=t)}let s=e||i;s!==this.firstScrollableParent&&(this.firstScrollableParent=s,this.initIntersectionObserver(),this.resetScroll())}elementCanScroll(t){try{return["auto","scroll"].includes(getComputedStyle(t).overflowY)}catch(t){return!1}}searchFirstVisibleItem(t,e,i){if(e=null!=e?e:0,(i=null!=i?i:t.length-1)-e<=0)return t[e];const s=Math.floor((i-e)/2)+e;return this.getOffset(t[s])>this.scrollable.scrollTop?this.searchFirstVisibleItem(t,e,s-1):this.getBottomOffset(t[s])<this.scrollable.scrollTop?this.searchFirstVisibleItem(t,s+1,i):t[s]}disconnectedCallback(){super.disconnectedCallback(),this.intersectionObserver.disconnect(),this.resizeObserver.disconnect(),this.mutationObserver.disconnect()}firstUpdated(t){super.firstUpdated(t),this.resetScroll()}update(t){super.update(t),t.has("items")&&(this.alreadyRenderedIndexes=new Set),!t.has("scrollToItem")&&!t.has("scrollToIndex")||null==this.scrollToItem&&null==this.scrollToIndex||this.resetScroll()}updated(t){super.updated(t),(t.has("visibleItems")||t.has("items"))&&this.onVisibleItemsChange(),t.has("scrolledToTarget")&&this.scrolledToTarget&&(null!=this.scrollToItem||null!=this.scrollToIndex)&&this.dispatchEvent(new
|
|
173
|
-
`,
|
|
174
|
-
`;var
|
|
172
|
+
`}resetScroll(){this.triggerFindScrollableParent(),this.intersectionObserver.disconnect(),this.resizeObserver.disconnect(),this.visibleItems=[],this.scrolledToTarget=!1,this.scrollDebouncer.run((()=>{var t;let e=null!==(t=this.scrollToIndex)&&void 0!==t?t:this.scrollToItem?this.items.indexOf(this.scrollToItem):-1;e>=this.items.length&&(e=-1);let i=this.getItem(e);this.scrollToTarget(i),this.scrollDoneDebouncer.run((()=>{this.onMutation(),this.scrolledToTarget=!0}))}))}getItem(t){var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(`#item-${t}`)}scrollToTarget(t){var e;if(t){let i=+(null!==(e=t.getAttribute("data-item-index"))&&void 0!==e?e:"0");this.scrollable&&0===i?this.scrollable.scrollTop=0:this.scrollable.scrollTop=this.getOffset(t)}}getOffset(t){var e;let i=0,s=t;for(;s&&s.offsetParent!==this.scrollable.offsetParent;)i+=s.offsetTop,s=s.offsetParent;return i+(null!==(e=null==s?void 0:s.offsetTop)&&void 0!==e?e:0)-this.scrollable.offsetTop}getBottomOffset(t){var e;return this.getOffset(t)+(null!==(e=null==t?void 0:t.clientHeight)&&void 0!==e?e:0)}appendItems(...t){this.items=[...this.items,...t]}prependItems(...t){this.items=[...t,...this.items]}connectedCallback(){super.connectedCallback(),setTimeout((()=>{this.triggerFindScrollableParent(),this.initIntersectionObserver(),this.mutationObserver.disconnect(),this.mutationObserver.observe(this.itemsContainer,{childList:!0})}),0)}initIntersectionObserver(){this.intersectionObserver.disconnect(),this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange,{root:this.scrollable,rootMargin:"-8px",threshold:[0,.01,.1,1]})}triggerFindScrollableParent(){var t;null===(t=this.itemsContainer)||void 0===t||t.dispatchEvent(new Event("find-scrollable-parent",{composed:!0}))}findScrollableParent(t){let e,i;t.stopPropagation();for(let s of t.composedPath()){const t=s,n=this.elementCanScroll(t);if(t.clientHeight&&t.clientHeight<t.scrollHeight&&n){e=t;break}n&&(i=t)}let s=e||i;s!==this.firstScrollableParent&&(this.firstScrollableParent=s,this.initIntersectionObserver(),this.resetScroll())}elementCanScroll(t){try{return["auto","scroll"].includes(getComputedStyle(t).overflowY)}catch(t){return!1}}searchFirstVisibleItem(t,e,i){if(e=null!=e?e:0,(i=null!=i?i:t.length-1)-e<=0)return t[e];const s=Math.floor((i-e)/2)+e;return this.getOffset(t[s])>this.scrollable.scrollTop?this.searchFirstVisibleItem(t,e,s-1):this.getBottomOffset(t[s])<this.scrollable.scrollTop?this.searchFirstVisibleItem(t,s+1,i):t[s]}disconnectedCallback(){super.disconnectedCallback(),this.intersectionObserver.disconnect(),this.resizeObserver.disconnect(),this.mutationObserver.disconnect()}firstUpdated(t){super.firstUpdated(t),this.resetScroll()}update(t){super.update(t),t.has("items")&&(this.alreadyRenderedIndexes=new Set),!t.has("scrollToItem")&&!t.has("scrollToIndex")||null==this.scrollToItem&&null==this.scrollToIndex||this.resetScroll()}updated(t){super.updated(t),(t.has("visibleItems")||t.has("items"))&&this.onVisibleItemsChange(),t.has("scrolledToTarget")&&this.scrolledToTarget&&(null!=this.scrollToItem||null!=this.scrollToIndex)&&this.dispatchEvent(new re)}onVisibleItemsChange(){const t=this.visibleItems.every(((t,e)=>null==this.visibleItems[e+1]||t+1===this.visibleItems[e+1]));t||l(this.visibleItems,this.lastNotOkVisibleItems)?(this.resetVisibleItemsDebouncer.cancel(),this.dispatchEvent(new ne(this.visibleItems,this.visibleItems.map((t=>this.items[t]))))):this.resetVisibleItemsDebouncer.run((()=>{this.lastNotOkVisibleItems=[...this.visibleItems],this.visibleItems=[],this.initIntersectionObserver(),this.onMutation()}))}}oe.styles=ie,se([s({type:Array})],oe.prototype,"items",void 0),se([s({attribute:!1})],oe.prototype,"renderItem",void 0),se([s({attribute:!1})],oe.prototype,"getItemKey",void 0),se([s({type:Object})],oe.prototype,"scrollToItem",void 0),se([s({type:Number})],oe.prototype,"scrollToIndex",void 0),se([s({type:Boolean})],oe.prototype,"internalScroll",void 0),se([s({type:Number})],oe.prototype,"renderBeforeFirst",void 0),se([s({type:Number})],oe.prototype,"renderAfterLast",void 0),se([n({hasChanged:(t,e)=>null!=t&&null==e||t.length!==e.length||t[0]!==e[0]})],oe.prototype,"visibleItems",void 0),se([r(".scrollable")],oe.prototype,"internalScrollable",void 0),se([r(".items-container")],oe.prototype,"itemsContainer",void 0),se([n()],oe.prototype,"scrolledToTarget",void 0),h("ft-infinite-scroll")(oe);const le=f`
|
|
173
|
+
`,he=f`
|
|
174
|
+
`;var ae=function(t,e,i,s){for(var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(n=t[l])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o};class ce extends _t{constructor(){super(...arguments),this.disableContextInteractions=!1,this.registeredComponents=[]}render(){return J`
|
|
175
175
|
<article id=${this.tocId}>
|
|
176
176
|
<slot @register-ft-reader-topic-component=${this.registerComponent}></slot>
|
|
177
177
|
</article>
|
|
178
|
-
`}registerComponent(t){t.stopPropagation();const e=t.composedPath()[0];this.register(e)}register(t){this.registeredComponents.push(t),t.tocNode=this.tocNode,t.disableContextInteractions=this.disableContextInteractions}update(t){super.update(t),["mapId","tocId","stateManager"].some((e=>t.has(e)))&&this.setTocNode(),t.has("tocNode")&&this.registeredComponents.forEach((t=>t.tocNode=this.tocNode))}async setTocNode(){var t;this.tocNode=void 0,this.tocNode=this.mapId&&this.tocId?await(null===(t=this.service)||void 0===t?void 0:t.getTocNode(this.tocId)):void 0}disconnectedCallback(){super.disconnectedCallback(),this.registeredComponents=[]}}
|
|
178
|
+
`}registerComponent(t){t.stopPropagation();const e=t.composedPath()[0];this.register(e)}register(t){this.registeredComponents.push(t),t.tocNode=this.tocNode,t.disableContextInteractions=this.disableContextInteractions}update(t){super.update(t),["mapId","tocId","stateManager"].some((e=>t.has(e)))&&this.setTocNode(),t.has("tocNode")&&this.registeredComponents.forEach((t=>t.tocNode=this.tocNode))}async setTocNode(){var t;this.tocNode=void 0,this.tocNode=this.mapId&&this.tocId?await(null===(t=this.service)||void 0===t?void 0:t.getTocNode(this.tocId)):void 0}disconnectedCallback(){super.disconnectedCallback(),this.registeredComponents=[]}}ce.styles=he,ae([It({selector:t=>{var e;return null===(e=t.map)||void 0===e?void 0:e.id}})],ce.prototype,"mapId",void 0),ae([s()],ce.prototype,"tocId",void 0),ae([s({type:Boolean})],ce.prototype,"disableContextInteractions",void 0),ae([n()],ce.prototype,"tocNode",void 0),h("ft-reader-topic-context")(ce);var ue=function(t,e,i,s){for(var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(n=t[l])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o};class de extends _t{constructor(){super(...arguments),this.renderTopic=()=>J`
|
|
179
179
|
<ft-reader-topic-title></ft-reader-topic-title>
|
|
180
180
|
<ft-reader-topic-content></ft-reader-topic-content>
|
|
181
|
-
`,this.disableContextInteractions=!1,this.renderBeforeFirst=5,this.renderAfterLast=10,this.visibleTopicsDebouncer=new e(
|
|
181
|
+
`,this.disableContextInteractions=!1,this.renderBeforeFirst=5,this.renderAfterLast=10,this.visibleTopicsDebouncer=new e(50)}render(){var t;const e=(null===(t=this.currentPage)||void 0===t?void 0:t.topics)||[];return 0===e.length?G:J`
|
|
182
182
|
<ft-infinite-scroll class="ft-reader-content"
|
|
183
183
|
.items=${e}
|
|
184
184
|
.renderItem=${(t,e)=>this.renderTopicInContext(t,e)}
|
|
@@ -195,4 +195,4 @@ class Xt extends Kt{constructor(t){if(super(t),this.et=X,t.type!==_t)throw Error
|
|
|
195
195
|
<ft-reader-topic-context tocId="${t}" ?disableContextInteractions=${this.disableContextInteractions}>
|
|
196
196
|
${this.renderTopic(t,e)}
|
|
197
197
|
</ft-reader-topic-context>
|
|
198
|
-
`}getScrollTarget(){var t,e,i,s,n;if(this.disableContextInteractions)return null;const r=null!==(s=null===(t=this.visibleTopics)||void 0===t?void 0:t.includes(null!==(i=null===(e=this.scrollTarget)||void 0===e?void 0:e.tocId)&&void 0!==i?i:""))&&void 0!==s&&s;return!(null===(n=this.scrollTarget)||void 0===n?void 0:n.tocId)||r&&null!=this.scrollTarget.section?null:this.scrollTarget.tocId}visibleTopicChange(t){this.disableContextInteractions||this.visibleTopicsDebouncer.run((()=>{var e;return null===(e=this.stateManager)||void 0===e?void 0:e.setVisibleTopics(t.detail.visibleItems)}))}onScrollDone(){var t,e;this.disableContextInteractions||(null===(t=this.scrollTarget)||void 0===t?void 0:t.section)||null===(e=this.stateManager)||void 0===e||e.scrollDone()}}de.elementDefinitions={"ft-infinite-scroll":
|
|
198
|
+
`}getScrollTarget(){var t,e,i,s,n;if(this.disableContextInteractions)return null;const r=null!==(s=null===(t=this.visibleTopics)||void 0===t?void 0:t.includes(null!==(i=null===(e=this.scrollTarget)||void 0===e?void 0:e.tocId)&&void 0!==i?i:""))&&void 0!==s&&s;return!(null===(n=this.scrollTarget)||void 0===n?void 0:n.tocId)||r&&null!=this.scrollTarget.section?null:this.scrollTarget.tocId}visibleTopicChange(t){this.disableContextInteractions||this.visibleTopicsDebouncer.run((()=>{var e;return null===(e=this.stateManager)||void 0===e?void 0:e.setVisibleTopics(t.detail.visibleItems)}))}onScrollDone(){var t,e;this.disableContextInteractions||(null===(t=this.scrollTarget)||void 0===t?void 0:t.section)||null===(e=this.stateManager)||void 0===e||e.scrollDone()}}de.elementDefinitions={"ft-infinite-scroll":oe},de.styles=le,ue([s()],de.prototype,"renderTopic",void 0),ue([s({type:Boolean})],de.prototype,"disableContextInteractions",void 0),ue([It()],de.prototype,"currentPage",void 0),ue([It()],de.prototype,"scrollTarget",void 0),ue([It()],de.prototype,"visibleTopics",void 0),ue([It({selector:t=>{var e,i;return null!==(i=null===(e=t.configuration)||void 0===e?void 0:e.loadBeforeFirstVisibleTopic)&&void 0!==i?i:5}})],de.prototype,"renderBeforeFirst",void 0),ue([It({selector:t=>{var e,i;return null!==(i=null===(e=t.configuration)||void 0===e?void 0:e.loadAfterLastVisibleTopic)&&void 0!==i?i:5}})],de.prototype,"renderAfterLast",void 0),ue([r(".ft-reader-content")],de.prototype,"container",void 0),h("ft-reader-content")(de),t.FtReaderContent=de,t.FtReaderContentCssVariables={},t.styles=le}({});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-reader-content",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.59",
|
|
4
4
|
"description": "Main content for integrated reader",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-infinite-scroll": "1.0.
|
|
23
|
-
"@fluid-topics/ft-reader-topic-content": "1.0.
|
|
24
|
-
"@fluid-topics/ft-reader-topic-context": "1.0.
|
|
25
|
-
"@fluid-topics/ft-reader-topic-title": "1.0.
|
|
26
|
-
"@fluid-topics/ft-wc-utils": "1.0.
|
|
22
|
+
"@fluid-topics/ft-infinite-scroll": "1.0.59",
|
|
23
|
+
"@fluid-topics/ft-reader-topic-content": "1.0.59",
|
|
24
|
+
"@fluid-topics/ft-reader-topic-context": "1.0.59",
|
|
25
|
+
"@fluid-topics/ft-reader-topic-title": "1.0.59",
|
|
26
|
+
"@fluid-topics/ft-wc-utils": "1.0.59",
|
|
27
27
|
"lit": "2.7.2"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "9412dc7c29ebc722b1b133bba63b1744f4bfdf60"
|
|
30
30
|
}
|