replaywebpage 2.4.3 → 2.4.5
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/adblock/adblock.gz +0 -0
- package/dist/electron.js +6 -6
- package/dist/index.js +2 -2
- package/dist/preload.js +10 -10
- package/dist/sw.js +10 -10
- package/dist/types/pages.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/pages.ts +4 -0
- package/sw.js +10 -10
- package/ui.js +2 -2
package/dist/index.js
CHANGED
|
@@ -66,7 +66,7 @@ class unsafe_html_e extends directive_i{constructor(e){if(super(e),this.it=T,e.t
|
|
|
66
66
|
* Copyright 2017 Google LLC
|
|
67
67
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
68
68
|
*/
|
|
69
|
-
class unsafe_svg_t extends unsafe_html_e{}unsafe_svg_t.directiveName="unsafeSVG",unsafe_svg_t.resultType=2;const unsafe_svg_o=directive_e(unsafe_svg_t),style_map_n="important",style_map_i=" !"+style_map_n,style_map_o=directive_e(class extends directive_i{constructor(e){if(super(e),e.type!==directive_t.ATTRIBUTE||"style"!==e.name||e.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce((t,i)=>{const o=e[i];return null==o?t:t+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${o};`},"")}update(e,[t]){const{style:i}=e.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(t)),this.render(t);for(const e of this.ft)null==t[e]&&(this.ft.delete(e),e.includes("-")?i.removeProperty(e):i[e]=null);for(const e in t){const o=t[e];if(null!=o){this.ft.add(e);const t="string"==typeof o&&o.endsWith(style_map_i);e.includes("-")||t?i.setProperty(e,t?o.slice(0,-11):o,t?style_map_n:""):i[e]=o}}return w}});var main=__webpack_require__(989),_a;const apiPrefix="./w/api",replayPrefix="./w",allCss=r(main.A);function wrapCss(e){return[allCss,e]}const IS_APP=window.IS_APP||(null===(_a=window.electron)||void 0===_a?void 0:_a.IS_APP)||window.matchMedia("(display-mode: standalone)").matches,VERSION="2.4.
|
|
69
|
+
class unsafe_svg_t extends unsafe_html_e{}unsafe_svg_t.directiveName="unsafeSVG",unsafe_svg_t.resultType=2;const unsafe_svg_o=directive_e(unsafe_svg_t),style_map_n="important",style_map_i=" !"+style_map_n,style_map_o=directive_e(class extends directive_i{constructor(e){if(super(e),e.type!==directive_t.ATTRIBUTE||"style"!==e.name||e.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce((t,i)=>{const o=e[i];return null==o?t:t+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${o};`},"")}update(e,[t]){const{style:i}=e.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(t)),this.render(t);for(const e of this.ft)null==t[e]&&(this.ft.delete(e),e.includes("-")?i.removeProperty(e):i[e]=null);for(const e in t){const o=t[e];if(null!=o){this.ft.add(e);const t="string"==typeof o&&o.endsWith(style_map_i);e.includes("-")||t?i.setProperty(e,t?o.slice(0,-11):o,t?style_map_n:""):i[e]=o}}return w}});var main=__webpack_require__(989),_a;const apiPrefix="./w/api",replayPrefix="./w",allCss=r(main.A);function wrapCss(e){return[allCss,e]}const IS_APP=window.IS_APP||(null===(_a=window.electron)||void 0===_a?void 0:_a.IS_APP)||window.matchMedia("(display-mode: standalone)").matches,VERSION="2.4.5";function clickOnSpacebarPress(e){" "==e.key&&(e.preventDefault(),e.target.click())}function updateFaviconLinks(e){const t=document.querySelector("head"),i=document.querySelectorAll("link[rel*='icon']");for(const e of i)t.removeChild(e);for(const i of e.icons){const e=document.createElement("link");e.rel=i.rel,e.href=i.href,t.appendChild(e)}}class FaIcon extends lit_element_s{constructor(){super(),this.size="1.1em",this.width=null,this.height=null}static get properties(){return{svg:{type:String},size:{type:String},width:{type:String},height:{type:String}}}static get styles(){return i`
|
|
70
70
|
:host {
|
|
71
71
|
display: inline-block;
|
|
72
72
|
padding: 0;
|
|
@@ -2361,7 +2361,7 @@ function*map_o(e,t){if(void 0!==e){let i=0;for(const o of e)yield t(o,i++)}}cons
|
|
|
2361
2361
|
|
|
2362
2362
|
${this.extraMsg&&x` <p class="extra-msg">(${this.extraMsg})</p> `}
|
|
2363
2363
|
</div>`:x``}
|
|
2364
|
-
`}onAskPermission(){var e;return __awaiter(this,void 0,void 0,function*(){"granted"===(yield null===(e=this.fileHandle)||void 0===e?void 0:e.requestPermission({mode:"read"}))&&this.doLoad()})}}__decorate([property_n({type:String})],Loader.prototype,"sourceUrl",void 0),__decorate([property_n({type:Object})],Loader.prototype,"loadInfo",void 0),__decorate([property_n({type:String})],Loader.prototype,"state",void 0),__decorate([property_n({type:Number})],Loader.prototype,"progress",void 0),__decorate([property_n({type:Number})],Loader.prototype,"percent",void 0),__decorate([property_n({type:Number})],Loader.prototype,"currentSize",void 0),__decorate([property_n({type:Number})],Loader.prototype,"totalSize",void 0),__decorate([property_n({type:String})],Loader.prototype,"error",void 0),__decorate([property_n({type:Number})],Loader.prototype,"total",void 0),__decorate([property_n({type:String})],Loader.prototype,"status",void 0),__decorate([property_n({type:String})],Loader.prototype,"coll",void 0),__decorate([property_n({type:String})],Loader.prototype,"embed",void 0),__decorate([property_n({type:Boolean})],Loader.prototype,"tryFileHandle",void 0),__decorate([property_n({type:Boolean})],Loader.prototype,"errorAllowRetry",void 0),__decorate([property_n({type:String})],Loader.prototype,"extraMsg",void 0),__decorate([property_n({type:String})],Loader.prototype,"swName",void 0),customElements.define("wr-loader",Loader);var dist=__webpack_require__(563),dist_default=__webpack_require__.n(dist),flexsearch_bundle=__webpack_require__(112);const angle_down='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">\x3c!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --\x3e<path d="M143 352.3L7 216.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.2 9.4-24.4 9.4-33.8 0z"/></svg>',solid_edit='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512">\x3c!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --\x3e<path d="M402.6 83.2l90.2 90.2c3.8 3.8 3.8 10 0 13.8L274.4 405.6l-92.8 10.3c-12.4 1.4-22.9-9.1-21.5-21.5l10.3-92.8L388.8 83.2c3.8-3.8 10-3.8 13.8 0zm162-22.9l-48.8-48.8c-15.2-15.2-39.9-15.2-55.2 0l-35.4 35.4c-3.8 3.8-3.8 10 0 13.8l90.2 90.2c3.8 3.8 10 3.8 13.8 0l35.4-35.4c15.2-15.3 15.2-40 0-55.2zM384 346.2V448H64V128h229.8c3.2 0 6.2-1.3 8.5-3.5l40-40c7.6-7.6 2.2-20.5-8.5-20.5H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V306.2c0-10.7-12.9-16-20.5-8.5l-40 40c-2.2 2.3-3.5 5.3-3.5 8.5z"/></svg>',DYNAMIC_PAGE_SIZE=25;class Pages extends lit_element_s{constructor(){super(...arguments),this.filteredPages=[],this.sortedPages=[],this.query="",this.flex=null,this.textPages=null,this.newQuery=null,this.loading=!1,this.updatingSearch=!1,this.showAllPages=!1,this.hasExtraPages=!1,this.currList=0,this.active=!1,this.editable=!1,this.changeNeeded=!1,this.selectedPages=new Set,this.menuActive=!1,this.sortKey="date",this.sortDesc=!0,this.isSidebar=!1,this.url="",this.ts="",this.editing=!1,this.toDeletePages=null,this.toDeletePage=null,this.collInfo=null,this.allSelected=!1,this.defaultKey="",this.dynamicPagesQuery=!1,this.totalPages=0,this.dynamicPageCount=1,this.skipScrollMore=!1}static get sortKeys(){return[{key:"",name:"Best Match"},{key:"title",name:"Title"},{key:"date",name:"Date"}]}_timedUpdate(){null!==this.newQuery&&(this.query=this.newQuery,this.newQuery=null,this.filter())}updated(e){return __awaiter(this,void 0,void 0,function*(){if(e.has("collInfo")?this.updateTextSearch():(e.has("query")||e.has("currList")||e.has("showAllPages"))&&this.filter(),e.has("active")&&this.active&&this.changeNeeded&&this.filter(),e.has("query")){this.query?(this.sortKey="",this.sortDesc=!1):(this.sortKey="date",this.sortDesc=!0);const e=this.renderRoot.querySelector("wr-sorter");e&&(e.sortKey=this.sortKey,e.sortDesc=this.sortDesc)}if(e.has("sortedPages")&&this.isSidebar){const e=this.renderRoot.querySelector(".current");if(e){const t={behavior:"smooth",block:"nearest",inline:"nearest"};setTimeout(()=>e.scrollIntoView(t),100)}}})}onChangeQuery(e){this.newQuery=e.currentTarget.value,this._ival&&window.clearTimeout(this._ival),this._ival=window.setTimeout(()=>this._timedUpdate(),250)}filter(){return __awaiter(this,void 0,void 0,function*(){if(this.loading)return;if(this.active||(this.changeNeeded=!0),this.loading=!0,this.flex&&this.query&&this.textPages){const e=yield this.flex.searchAsync(this.query,25);this.filteredPages=e.map(e=>this.textPages[e])}else this.showAllPages&&this.hasExtraPages?this.filteredPages=[...this.textPages]:this.dynamicPagesQuery||(this.filteredPages=[...this.collInfo.pages]);if(this.totalPages=this.filteredPages.length,this.dynamicPagesQuery){if(this.query)this.hasExtraPages=!1;else{const e=this.collInfo.pages.filter(e=>e.isSeed||e.seed);this.filteredPages=this.showAllPages||!e.length?[...this.collInfo.pages]:e,this.hasExtraPages=e.length<this.collInfo.pages.length}this.dynamicPageCount=1,yield this.addDynamicPages()}0!==this.currList&&(yield this.filterCurated());for(const e of this.filteredPages){const{timestamp:t,date:i}=getPageDateTS(e);e.timestamp=t,e.date=i}this.loading=!1,this.changeNeeded=!1;const e={query:this.query,currList:this.currList};this.sendChangeEvent(e)})}addDynamicPages(){return __awaiter(this,void 0,void 0,function*(){const e=new URLSearchParams;this.query&&e.set("search",this.query),e.set("page",this.dynamicPageCount+""),e.set("pageSize",DYNAMIC_PAGE_SIZE+"");const t=yield fetch(`${this.collInfo.apiPrefix}/pages?${e.toString()}`),i=yield t.json();if(!i.pages)return;i.pages.length||(this.skipScrollMore=!0);const o=new Set;this.filteredPages.forEach(e=>o.add(e.id));const n=[];for(const{id:e,url:t,title:r,mime:a,status:s,ts:l,favIconUrl:c,waczhash:d,isSeed:h,size:u}of i.pages){if(o.has(e))continue;if(!this.showAllPages&&this.hasExtraPages&&!this.query&&!h)continue;let i,p;"string"==typeof l?(p=new Date(l),i=new Date(l).getTime()):(i=l,p=new Date(i));const f={id:e,url:t,title:r,mime:a,status:s,ts:i,favIconUrl:c,waczhash:d,timestamp:getTS(p.toISOString()),size:u,date:p};n.push(f)}n.length&&(this.filteredPages=[...this.filteredPages,...n]),this.totalPages=this.filteredPages.length})}filterCurated(){return __awaiter(this,void 0,void 0,function*(){const e=yield fetch(`${this.collInfo.apiPrefix}/curated/${this.currList}`),t=(yield e.json()).curated;this.filteredPages=t})}sendChangeEvent(e){this.dispatchEvent(new CustomEvent("coll-tab-nav",{detail:{data:e}}))}addPages(e){var t;const i=new flexsearch_bundle.Index;return this.flex=i,this.textPages=e,this.dynamicPagesQuery||(this.hasExtraPages=Boolean(this.textPages&&(null===(t=this.collInfo)||void 0===t?void 0:t.pages)&&this.textPages.length>this.collInfo.pages.length)),this.collInfo&&(this.dynamicPagesQuery=this.collInfo.canQueryPages||!1),Promise.all(e.map((e,t)=>{let o=e.url;return e.title&&(o+=" "+e.title),e.text&&(o+=" "+e.text),i.addAsync(t,o)}))}updateTextSearch(){var e,t,i,o;return __awaiter(this,void 0,void 0,function*(){if(this.updatingSearch)return;this.updatingSearch=!0;let n=0;try{const l=yield caches.open("cache:"+this.collInfo.coll),c=`${this.collInfo.apiPrefix}/textIndex`;let d=yield l.match(c);d&&Number(d.headers.get("Content-Length"))||(d=yield fetch(c),200===d.status&&Number(d.headers.get("Content-Length"))&&l.put(c,d.clone()));const h=[];try{for(var r,a=!0,s=__asyncValues(dist_default()(d.body.getReader()));r=yield s.next(),!(e=r.done);a=!0){o=r.value,a=!1;const e=o;e.url&&(e.id=++n,h.push(e))}}catch(e){t={error:e}}finally{try{a||e||!(i=s.return)||(yield i.call(s))}finally{if(t)throw t.error}}yield this.addPages(h)}catch(e){console.warn(e)}finally{0===n&&(yield this.addPages(this.collInfo.pages)),this.updatingSearch=!1}yield this.filter()})}static get styles(){return wrapCss(i`
|
|
2364
|
+
`}onAskPermission(){var e;return __awaiter(this,void 0,void 0,function*(){"granted"===(yield null===(e=this.fileHandle)||void 0===e?void 0:e.requestPermission({mode:"read"}))&&this.doLoad()})}}__decorate([property_n({type:String})],Loader.prototype,"sourceUrl",void 0),__decorate([property_n({type:Object})],Loader.prototype,"loadInfo",void 0),__decorate([property_n({type:String})],Loader.prototype,"state",void 0),__decorate([property_n({type:Number})],Loader.prototype,"progress",void 0),__decorate([property_n({type:Number})],Loader.prototype,"percent",void 0),__decorate([property_n({type:Number})],Loader.prototype,"currentSize",void 0),__decorate([property_n({type:Number})],Loader.prototype,"totalSize",void 0),__decorate([property_n({type:String})],Loader.prototype,"error",void 0),__decorate([property_n({type:Number})],Loader.prototype,"total",void 0),__decorate([property_n({type:String})],Loader.prototype,"status",void 0),__decorate([property_n({type:String})],Loader.prototype,"coll",void 0),__decorate([property_n({type:String})],Loader.prototype,"embed",void 0),__decorate([property_n({type:Boolean})],Loader.prototype,"tryFileHandle",void 0),__decorate([property_n({type:Boolean})],Loader.prototype,"errorAllowRetry",void 0),__decorate([property_n({type:String})],Loader.prototype,"extraMsg",void 0),__decorate([property_n({type:String})],Loader.prototype,"swName",void 0),customElements.define("wr-loader",Loader);var dist=__webpack_require__(563),dist_default=__webpack_require__.n(dist),flexsearch_bundle=__webpack_require__(112);const angle_down='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">\x3c!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --\x3e<path d="M143 352.3L7 216.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.2 9.4-24.4 9.4-33.8 0z"/></svg>',solid_edit='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512">\x3c!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --\x3e<path d="M402.6 83.2l90.2 90.2c3.8 3.8 3.8 10 0 13.8L274.4 405.6l-92.8 10.3c-12.4 1.4-22.9-9.1-21.5-21.5l10.3-92.8L388.8 83.2c3.8-3.8 10-3.8 13.8 0zm162-22.9l-48.8-48.8c-15.2-15.2-39.9-15.2-55.2 0l-35.4 35.4c-3.8 3.8-3.8 10 0 13.8l90.2 90.2c3.8 3.8 10 3.8 13.8 0l35.4-35.4c15.2-15.3 15.2-40 0-55.2zM384 346.2V448H64V128h229.8c3.2 0 6.2-1.3 8.5-3.5l40-40c7.6-7.6 2.2-20.5-8.5-20.5H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V306.2c0-10.7-12.9-16-20.5-8.5l-40 40c-2.2 2.3-3.5 5.3-3.5 8.5z"/></svg>',DYNAMIC_PAGE_SIZE=25;class Pages extends lit_element_s{constructor(){super(...arguments),this.filteredPages=[],this.sortedPages=[],this.query="",this.flex=null,this.textPages=null,this.newQuery=null,this.loading=!1,this.updatingSearch=!1,this.showAllPages=!1,this.hasExtraPages=!1,this.currList=0,this.active=!1,this.editable=!1,this.changeNeeded=!1,this.selectedPages=new Set,this.menuActive=!1,this.sortKey="date",this.sortDesc=!0,this.isSidebar=!1,this.url="",this.ts="",this.editing=!1,this.toDeletePages=null,this.toDeletePage=null,this.collInfo=null,this.allSelected=!1,this.defaultKey="",this.dynamicPagesQuery=!1,this.totalPages=0,this.dynamicPageCount=1,this.skipScrollMore=!1}static get sortKeys(){return[{key:"",name:"Best Match"},{key:"title",name:"Title"},{key:"date",name:"Date"}]}_timedUpdate(){null!==this.newQuery&&(this.query=this.newQuery,this.newQuery=null,this.filter())}updated(e){return __awaiter(this,void 0,void 0,function*(){if(e.has("collInfo")?this.updateTextSearch():(e.has("query")||e.has("currList")||e.has("showAllPages"))&&this.filter(),e.has("active")&&this.active&&this.changeNeeded&&this.filter(),e.has("query")){this.query?(this.sortKey="",this.sortDesc=!1):(this.sortKey="date",this.sortDesc=!0);const e=this.renderRoot.querySelector("wr-sorter");e&&(e.sortKey=this.sortKey,e.sortDesc=this.sortDesc)}if(e.has("sortedPages")&&this.isSidebar){const e=this.renderRoot.querySelector(".current");if(e){const t={behavior:"smooth",block:"nearest",inline:"nearest"};setTimeout(()=>e.scrollIntoView(t),100)}}})}onChangeQuery(e){this.newQuery=e.currentTarget.value,this._ival&&window.clearTimeout(this._ival),this._ival=window.setTimeout(()=>this._timedUpdate(),250)}filter(){return __awaiter(this,void 0,void 0,function*(){if(this.loading)return;if(this.active||(this.changeNeeded=!0),this.loading=!0,this.flex&&this.query&&this.textPages){const e=yield this.flex.searchAsync(this.query,25);this.filteredPages=e.map(e=>this.textPages[e])}else this.showAllPages&&this.hasExtraPages?this.filteredPages=[...this.textPages]:this.dynamicPagesQuery||(this.filteredPages=[...this.collInfo.pages]);if(this.totalPages=this.filteredPages.length,this.dynamicPagesQuery){if(this.query)this.hasExtraPages=!1;else{const e=this.collInfo.pages.filter(e=>e.isSeed||e.seed);this.filteredPages=this.showAllPages||!e.length?[...this.collInfo.pages]:e,this.hasExtraPages=e.length<this.collInfo.pages.length}this.dynamicPageCount=1,yield this.addDynamicPages()}0!==this.currList&&(yield this.filterCurated());for(const e of this.filteredPages){const{timestamp:t,date:i}=getPageDateTS(e);e.timestamp=t,e.date=i}this.loading=!1,this.changeNeeded=!1;const e={query:this.query,currList:this.currList};this.sendChangeEvent(e)})}addDynamicPages(){return __awaiter(this,void 0,void 0,function*(){const e=new URLSearchParams;this.query&&e.set("search",this.query),e.set("page",this.dynamicPageCount+""),e.set("pageSize",DYNAMIC_PAGE_SIZE+"");const t=yield fetch(`${this.collInfo.apiPrefix}/pages?${e.toString()}`),i=yield t.json();if(!i.pages)return;i.pages.length||(this.skipScrollMore=!0);const o=new Set;this.filteredPages.forEach(e=>o.add(e.id));const n=[];for(const{id:e,url:t,title:r,mime:a,status:s,ts:l,favIconUrl:c,waczhash:d,isSeed:h,size:u}of i.pages){if(o.has(e))continue;if(!this.showAllPages&&this.hasExtraPages&&!this.query&&!h)continue;let i,p;"string"==typeof l?(p=new Date(l),i=new Date(l).getTime()):(i=l,p=new Date(i));const f={id:e,url:t,title:r,mime:a,status:s,ts:i,favIconUrl:c,waczhash:d,timestamp:getTS(p.toISOString()),size:u,date:p};n.push(f)}n.length&&(this.filteredPages=[...this.filteredPages,...n]),this.totalPages=this.filteredPages.length})}filterCurated(){return __awaiter(this,void 0,void 0,function*(){const e=yield fetch(`${this.collInfo.apiPrefix}/curated/${this.currList}`),t=(yield e.json()).curated;this.filteredPages=t})}sendChangeEvent(e){this.dispatchEvent(new CustomEvent("coll-tab-nav",{detail:{data:e}}))}addPages(e){var t;const i=new flexsearch_bundle.Index;return this.flex=i,this.textPages=e,this.dynamicPagesQuery||(this.hasExtraPages=Boolean(this.textPages&&(null===(t=this.collInfo)||void 0===t?void 0:t.pages)&&this.textPages.length>this.collInfo.pages.length)),this.collInfo&&(this.dynamicPagesQuery=this.collInfo.canQueryPages||!1),Promise.all(e.map((e,t)=>{let o=e.url;return e.title&&(o+=" "+e.title),e.text&&(o+=" "+e.text),i.addAsync(t,o)}))}updateTextSearch(){var e,t,i,o;return __awaiter(this,void 0,void 0,function*(){if(this.updatingSearch)return;this.updatingSearch=!0;let n=0;try{const l=yield caches.open("cache:"+this.collInfo.coll),c=`${this.collInfo.apiPrefix}/textIndex`;let d=yield l.match(c);d&&Number(d.headers.get("Content-Length"))||(d=yield fetch(c),200===d.status&&Number(d.headers.get("Content-Length"))&&l.put(c,d.clone()));const h=[];try{for(var r,a=!0,s=__asyncValues(dist_default()(d.body.getReader()));r=yield s.next(),!(e=r.done);a=!0){o=r.value,a=!1;const e=o;e.url&&(e.id=++n,"string"==typeof e.ts&&(e.ts=new Date(e.ts).getTime()),h.push(e))}}catch(e){t={error:e}}finally{try{a||e||!(i=s.return)||(yield i.call(s))}finally{if(t)throw t.error}}yield this.addPages(h)}catch(e){console.warn(e)}finally{0===n&&(yield this.addPages(this.collInfo.pages)),this.updatingSearch=!1}yield this.filter()})}static get styles(){return wrapCss(i`
|
|
2365
2365
|
:host {
|
|
2366
2366
|
width: 100%;
|
|
2367
2367
|
flex: 1 1 auto;
|