@fluid-topics/ft-reader-metadata 1.1.38 → 1.1.40

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.
@@ -29,14 +29,14 @@ class FtReaderMetadata extends FtReaderComponent {
29
29
  if (this.key && this.useForSwitchingToRelatives) {
30
30
  readerStateManager.registerMetadataForSwitchToRelatives(this.key);
31
31
  }
32
- (_a = this.stateManager) === null || _a === void 0 ? void 0 : _a.store.eventBus.addEventListener("clustering-helper-created", this.setRelatives);
32
+ (_a = this.stateManager) === null || _a === void 0 ? void 0 : _a.store.eventBus.addEventListener("clustering-helper-created", () => this.setRelatives());
33
33
  }
34
34
  render() {
35
35
  return html `
36
36
  <ft-tooltip part="tooltip"
37
37
  class="${this.multiLine ? "ft-reader-metadata-multi-line" : ""}"
38
38
  text="${this.tooltipText}">
39
- ${this.useForSwitchingToRelatives && this.metadata && this.metadata.values.length > 0
39
+ ${this.useForSwitchingToRelatives && this.metadata && this.metadata.values.length > 0 && this.relatives.length > 0
40
40
  ? this.renderSwitchToRelatives()
41
41
  : html `
42
42
  <ft-chip part="chip" ?multiLine=${this.multiLine}>
@@ -1105,11 +1105,11 @@ const V=Symbol.for(""),X=t=>{if(t?.r===V)return t?._$litStatic$},q=t=>({_$litSta
1105
1105
  <slot></slot>
1106
1106
  </ft-typography>
1107
1107
  </div>
1108
- `}}var Gi,Mi,ji,Yi,Vi,Xi,qi,Ji,Qi,tr,or,er,ir,rr,nr,ar,lr,cr;function sr(t){var o,e,i,r,n;if(function(t){var o,e,i,r,n;return(null!==(r=null!==(e=null===(o=t.map)||void 0===o?void 0:o.openMode)&&void 0!==e?e:null===(i=t.topic)||void 0===i?void 0:i.openMode)&&void 0!==r?r:null===(n=t.document)||void 0===n?void 0:n.openMode)===ir.EXTERNAL}(t))return null!==(r=null!==(e=null===(o=t.map)||void 0===o?void 0:o.originUrl)&&void 0!==e?e:null===(i=t.topic)||void 0===i?void 0:i.originUrl)&&void 0!==r?r:null===(n=t.document)||void 0===n?void 0:n.originUrl;switch(t.type){case nr.MAP:return t.map.readerUrl;case nr.DOCUMENT:return t.document.viewerUrl;case nr.TOPIC:return t.topic.readerUrl}return""}_i.elementDefinitions={"ft-typography":vo},_i.styles=Pi,o.customElement("ft-floating-menu")(Fi),o.customElement("ftds-floating-menu")(Ti),o.customElement("ft-floating-menu-item")(Zi),o.customElement("ft-floating-menu-label")(_i),function(t){!function(o){var e={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(e.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],r=ArrayBuffer.isView||function(t){return t&&i.indexOf(Object.prototype.toString.call(t))>-1};function n(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function a(t){return"string"!=typeof t&&(t=String(t)),t}function l(t){var o={next:function(){var o=t.shift();return{done:void 0===o,value:o}}};return e.iterable&&(o[Symbol.iterator]=function(){return o}),o}function c(t){this.map={},t instanceof c?t.forEach((function(t,o){this.append(o,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(o){this.append(o,t[o])}),this)}function s(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function p(t){return new Promise((function(o,e){t.onload=function(){o(t.result)},t.onerror=function(){e(t.error)}}))}function f(t){var o=new FileReader,e=p(o);return o.readAsArrayBuffer(t),e}function d(t){if(t.slice)return t.slice(0);var o=new Uint8Array(t.byteLength);return o.set(new Uint8Array(t)),o.buffer}function h(){return this.bodyUsed=!1,this._initBody=function(t){var o;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:e.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:e.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:e.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():e.arrayBuffer&&e.blob&&((o=t)&&DataView.prototype.isPrototypeOf(o))?(this._bodyArrayBuffer=d(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):e.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||r(t))?this._bodyArrayBuffer=d(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):e.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},e.blob&&(this.blob=function(){var t=s(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?s(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(f)}),this.text=function(){var t,o,e,i=s(this);if(i)return i;if(this._bodyBlob)return t=this._bodyBlob,o=new FileReader,e=p(o),o.readAsText(t),e;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var o=new Uint8Array(t),e=new Array(o.length),i=0;i<o.length;i++)e[i]=String.fromCharCode(o[i]);return e.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},e.formData&&(this.formData=function(){return this.text().then(y)}),this.json=function(){return this.text().then(JSON.parse)},this}c.prototype.append=function(t,o){t=n(t),o=a(o);var e=this.map[t];this.map[t]=e?e+", "+o:o},c.prototype.delete=function(t){delete this.map[n(t)]},c.prototype.get=function(t){return t=n(t),this.has(t)?this.map[t]:null},c.prototype.has=function(t){return this.map.hasOwnProperty(n(t))},c.prototype.set=function(t,o){this.map[n(t)]=a(o)},c.prototype.forEach=function(t,o){for(var e in this.map)this.map.hasOwnProperty(e)&&t.call(o,this.map[e],e,this)},c.prototype.keys=function(){var t=[];return this.forEach((function(o,e){t.push(e)})),l(t)},c.prototype.values=function(){var t=[];return this.forEach((function(o){t.push(o)})),l(t)},c.prototype.entries=function(){var t=[];return this.forEach((function(o,e){t.push([e,o])})),l(t)},e.iterable&&(c.prototype[Symbol.iterator]=c.prototype.entries);var u=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function g(t,o){var e,i,r=(o=o||{}).body;if(t instanceof g){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,o.headers||(this.headers=new c(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,r||null==t._bodyInit||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=o.credentials||this.credentials||"same-origin",!o.headers&&this.headers||(this.headers=new c(o.headers)),this.method=(e=o.method||this.method||"GET",i=e.toUpperCase(),u.indexOf(i)>-1?i:e),this.mode=o.mode||this.mode||null,this.signal=o.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function y(t){var o=new FormData;return t.trim().split("&").forEach((function(t){if(t){var e=t.split("="),i=e.shift().replace(/\+/g," "),r=e.join("=").replace(/\+/g," ");o.append(decodeURIComponent(i),decodeURIComponent(r))}})),o}function b(t,o){o||(o={}),this.type="default",this.status=void 0===o.status?200:o.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in o?o.statusText:"OK",this.headers=new c(o.headers),this.url=o.url||"",this._initBody(t)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},h.call(g.prototype),h.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},b.error=function(){var t=new b(null,{status:0,statusText:""});return t.type="error",t};var m=[301,302,303,307,308];b.redirect=function(t,o){if(-1===m.indexOf(o))throw new RangeError("Invalid status code");return new b(null,{status:o,headers:{location:t}})},o.DOMException=t.DOMException;try{new o.DOMException}catch(t){o.DOMException=function(t,o){this.message=t,this.name=o;var e=Error(t);this.stack=e.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function x(t,i){return new Promise((function(r,n){var a=new g(t,i);if(a.signal&&a.signal.aborted)return n(new o.DOMException("Aborted","AbortError"));var l=new XMLHttpRequest;function s(){l.abort()}l.onload=function(){var t,o,e={status:l.status,statusText:l.statusText,headers:(t=l.getAllResponseHeaders()||"",o=new c,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var e=t.split(":"),i=e.shift().trim();if(i){var r=e.join(":").trim();o.append(i,r)}})),o)};e.url="responseURL"in l?l.responseURL:e.headers.get("X-Request-URL");var i="response"in l?l.response:l.responseText;r(new b(i,e))},l.onerror=function(){n(new TypeError("Network request failed"))},l.ontimeout=function(){n(new TypeError("Network request failed"))},l.onabort=function(){n(new o.DOMException("Aborted","AbortError"))},l.open(a.method,a.url,!0),"include"===a.credentials?l.withCredentials=!0:"omit"===a.credentials&&(l.withCredentials=!1),"responseType"in l&&e.blob&&(l.responseType="blob"),a.headers.forEach((function(t,o){l.setRequestHeader(o,t)})),a.signal&&(a.signal.addEventListener("abort",s),l.onreadystatechange=function(){4===l.readyState&&a.signal.removeEventListener("abort",s)}),l.send(void 0===a._bodyInit?null:a._bodyInit)}))}x.polyfill=!0,t.fetch||(t.fetch=x,t.Headers=c,t.Request=g,t.Response=b),o.Headers=c,o.Request=g,o.Response=b,o.fetch=x,Object.defineProperty(o,"t",{value:!0})}({})}("undefined"!=typeof self?self:void 0),function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"}(Gi||(Gi={})),function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"}(Mi||(Mi={})),function(t){t.THIRD_PARTY="THIRD_PARTY",t.OFF_THE_GRID="OFF_THE_GRID",t.CONTENT_PACKAGER="CONTENT_PACKAGER",t.PAGES="PAGES",t.DESIGNED_READER="DESIGNED_READER"}(ji||(ji={})),function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"}(Yi||(Yi={})),function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"}(Vi||(Vi={})),function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"}(Xi||(Xi={})),function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"}(qi||(qi={})),function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"}(Ji||(Ji={})),function(t){t.ASC="ASC",t.DESC="DESC"}(Qi||(Qi={})),function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"}(tr||(tr={})),function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"}(or||(or={})),function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK"}(er||(er={})),function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"}(ir||(ir={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"}(rr||(rr={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"}(nr||(nr={})),function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS"}(ar||(ar={})),function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.GENERATIVE_AI_USER="GENERATIVE_AI_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN",t.DEVELOPER="DEVELOPER"}(lr||(lr={})),function(t){t.VALID="VALID",t.INVALID="INVALID"}(cr||(cr={})),lr.PERSONAL_BOOK_SHARE_USER,lr.PERSONAL_BOOK_USER,lr.HTML_EXPORT_USER,lr.PERSONAL_BOOK_USER,lr.PDF_EXPORT_USER,lr.PERSONAL_BOOK_USER,lr.KHUB_ADMIN,lr.CONTENT_PUBLISHER,lr.ADMIN,lr.KHUB_ADMIN,lr.USERS_ADMIN,lr.PORTAL_ADMIN,lr.DEVELOPER,lr.BETA_USER,lr.DEBUG_USER;var pr=function(t,o,e,i){for(var r,n=arguments.length,a=n<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,l=t.length-1;l>=0;l--)(r=t[l])&&(a=(n<3?r(a):n>3?r(o,e,a):r(o,e))||a);return n>3&&a&&Object.defineProperty(o,e,a),a};class fr extends d{constructor(){super(...arguments),this.multiLine=!1,this.useForSwitchingToRelatives=!1,this.editorMode=!1,this.relatives=[]}setReaderStateManager(t){var o;super.setReaderStateManager(t),this.key&&this.useForSwitchingToRelatives&&t.registerMetadataForSwitchToRelatives(this.key),null===(o=this.stateManager)||void 0===o||o.store.eventBus.addEventListener("clustering-helper-created",this.setRelatives)}render(){return e.html`
1108
+ `}}var Gi,Mi,ji,Yi,Vi,Xi,qi,Ji,Qi,tr,or,er,ir,rr,nr,ar,lr,cr;function sr(t){var o,e,i,r,n;if(function(t){var o,e,i,r,n;return(null!==(r=null!==(e=null===(o=t.map)||void 0===o?void 0:o.openMode)&&void 0!==e?e:null===(i=t.topic)||void 0===i?void 0:i.openMode)&&void 0!==r?r:null===(n=t.document)||void 0===n?void 0:n.openMode)===ir.EXTERNAL}(t))return null!==(r=null!==(e=null===(o=t.map)||void 0===o?void 0:o.originUrl)&&void 0!==e?e:null===(i=t.topic)||void 0===i?void 0:i.originUrl)&&void 0!==r?r:null===(n=t.document)||void 0===n?void 0:n.originUrl;switch(t.type){case nr.MAP:return t.map.readerUrl;case nr.DOCUMENT:return t.document.viewerUrl;case nr.TOPIC:return t.topic.readerUrl}return""}_i.elementDefinitions={"ft-typography":vo},_i.styles=Pi,o.customElement("ft-floating-menu")(Fi),o.customElement("ftds-floating-menu")(Ti),o.customElement("ft-floating-menu-item")(Zi),o.customElement("ft-floating-menu-label")(_i),function(t){!function(o){var e={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(e.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],r=ArrayBuffer.isView||function(t){return t&&i.indexOf(Object.prototype.toString.call(t))>-1};function n(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function a(t){return"string"!=typeof t&&(t=String(t)),t}function l(t){var o={next:function(){var o=t.shift();return{done:void 0===o,value:o}}};return e.iterable&&(o[Symbol.iterator]=function(){return o}),o}function c(t){this.map={},t instanceof c?t.forEach((function(t,o){this.append(o,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(o){this.append(o,t[o])}),this)}function s(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function p(t){return new Promise((function(o,e){t.onload=function(){o(t.result)},t.onerror=function(){e(t.error)}}))}function f(t){var o=new FileReader,e=p(o);return o.readAsArrayBuffer(t),e}function d(t){if(t.slice)return t.slice(0);var o=new Uint8Array(t.byteLength);return o.set(new Uint8Array(t)),o.buffer}function h(){return this.bodyUsed=!1,this._initBody=function(t){var o;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:e.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:e.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:e.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():e.arrayBuffer&&e.blob&&((o=t)&&DataView.prototype.isPrototypeOf(o))?(this._bodyArrayBuffer=d(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):e.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||r(t))?this._bodyArrayBuffer=d(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):e.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},e.blob&&(this.blob=function(){var t=s(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?s(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(f)}),this.text=function(){var t,o,e,i=s(this);if(i)return i;if(this._bodyBlob)return t=this._bodyBlob,o=new FileReader,e=p(o),o.readAsText(t),e;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var o=new Uint8Array(t),e=new Array(o.length),i=0;i<o.length;i++)e[i]=String.fromCharCode(o[i]);return e.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},e.formData&&(this.formData=function(){return this.text().then(y)}),this.json=function(){return this.text().then(JSON.parse)},this}c.prototype.append=function(t,o){t=n(t),o=a(o);var e=this.map[t];this.map[t]=e?e+", "+o:o},c.prototype.delete=function(t){delete this.map[n(t)]},c.prototype.get=function(t){return t=n(t),this.has(t)?this.map[t]:null},c.prototype.has=function(t){return this.map.hasOwnProperty(n(t))},c.prototype.set=function(t,o){this.map[n(t)]=a(o)},c.prototype.forEach=function(t,o){for(var e in this.map)this.map.hasOwnProperty(e)&&t.call(o,this.map[e],e,this)},c.prototype.keys=function(){var t=[];return this.forEach((function(o,e){t.push(e)})),l(t)},c.prototype.values=function(){var t=[];return this.forEach((function(o){t.push(o)})),l(t)},c.prototype.entries=function(){var t=[];return this.forEach((function(o,e){t.push([e,o])})),l(t)},e.iterable&&(c.prototype[Symbol.iterator]=c.prototype.entries);var u=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function g(t,o){var e,i,r=(o=o||{}).body;if(t instanceof g){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,o.headers||(this.headers=new c(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,r||null==t._bodyInit||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=o.credentials||this.credentials||"same-origin",!o.headers&&this.headers||(this.headers=new c(o.headers)),this.method=(e=o.method||this.method||"GET",i=e.toUpperCase(),u.indexOf(i)>-1?i:e),this.mode=o.mode||this.mode||null,this.signal=o.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function y(t){var o=new FormData;return t.trim().split("&").forEach((function(t){if(t){var e=t.split("="),i=e.shift().replace(/\+/g," "),r=e.join("=").replace(/\+/g," ");o.append(decodeURIComponent(i),decodeURIComponent(r))}})),o}function b(t,o){o||(o={}),this.type="default",this.status=void 0===o.status?200:o.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in o?o.statusText:"OK",this.headers=new c(o.headers),this.url=o.url||"",this._initBody(t)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},h.call(g.prototype),h.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},b.error=function(){var t=new b(null,{status:0,statusText:""});return t.type="error",t};var m=[301,302,303,307,308];b.redirect=function(t,o){if(-1===m.indexOf(o))throw new RangeError("Invalid status code");return new b(null,{status:o,headers:{location:t}})},o.DOMException=t.DOMException;try{new o.DOMException}catch(t){o.DOMException=function(t,o){this.message=t,this.name=o;var e=Error(t);this.stack=e.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function x(t,i){return new Promise((function(r,n){var a=new g(t,i);if(a.signal&&a.signal.aborted)return n(new o.DOMException("Aborted","AbortError"));var l=new XMLHttpRequest;function s(){l.abort()}l.onload=function(){var t,o,e={status:l.status,statusText:l.statusText,headers:(t=l.getAllResponseHeaders()||"",o=new c,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var e=t.split(":"),i=e.shift().trim();if(i){var r=e.join(":").trim();o.append(i,r)}})),o)};e.url="responseURL"in l?l.responseURL:e.headers.get("X-Request-URL");var i="response"in l?l.response:l.responseText;r(new b(i,e))},l.onerror=function(){n(new TypeError("Network request failed"))},l.ontimeout=function(){n(new TypeError("Network request failed"))},l.onabort=function(){n(new o.DOMException("Aborted","AbortError"))},l.open(a.method,a.url,!0),"include"===a.credentials?l.withCredentials=!0:"omit"===a.credentials&&(l.withCredentials=!1),"responseType"in l&&e.blob&&(l.responseType="blob"),a.headers.forEach((function(t,o){l.setRequestHeader(o,t)})),a.signal&&(a.signal.addEventListener("abort",s),l.onreadystatechange=function(){4===l.readyState&&a.signal.removeEventListener("abort",s)}),l.send(void 0===a._bodyInit?null:a._bodyInit)}))}x.polyfill=!0,t.fetch||(t.fetch=x,t.Headers=c,t.Request=g,t.Response=b),o.Headers=c,o.Request=g,o.Response=b,o.fetch=x,Object.defineProperty(o,"t",{value:!0})}({})}("undefined"!=typeof self?self:void 0),function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"}(Gi||(Gi={})),function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"}(Mi||(Mi={})),function(t){t.THIRD_PARTY="THIRD_PARTY",t.OFF_THE_GRID="OFF_THE_GRID",t.CONTENT_PACKAGER="CONTENT_PACKAGER",t.PAGES="PAGES",t.DESIGNED_READER="DESIGNED_READER"}(ji||(ji={})),function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"}(Yi||(Yi={})),function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"}(Vi||(Vi={})),function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"}(Xi||(Xi={})),function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"}(qi||(qi={})),function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"}(Ji||(Ji={})),function(t){t.ASC="ASC",t.DESC="DESC"}(Qi||(Qi={})),function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"}(tr||(tr={})),function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"}(or||(or={})),function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK"}(er||(er={})),function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"}(ir||(ir={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"}(rr||(rr={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"}(nr||(nr={})),function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS"}(ar||(ar={})),function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.GENERATIVE_AI_USER="GENERATIVE_AI_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN",t.DEVELOPER="DEVELOPER"}(lr||(lr={})),function(t){t.VALID="VALID",t.INVALID="INVALID"}(cr||(cr={})),lr.PERSONAL_BOOK_SHARE_USER,lr.PERSONAL_BOOK_USER,lr.HTML_EXPORT_USER,lr.PERSONAL_BOOK_USER,lr.PDF_EXPORT_USER,lr.PERSONAL_BOOK_USER,lr.KHUB_ADMIN,lr.CONTENT_PUBLISHER,lr.ADMIN,lr.KHUB_ADMIN,lr.USERS_ADMIN,lr.PORTAL_ADMIN,lr.DEVELOPER,lr.BETA_USER,lr.DEBUG_USER;var pr=function(t,o,e,i){for(var r,n=arguments.length,a=n<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,l=t.length-1;l>=0;l--)(r=t[l])&&(a=(n<3?r(a):n>3?r(o,e,a):r(o,e))||a);return n>3&&a&&Object.defineProperty(o,e,a),a};class fr extends d{constructor(){super(...arguments),this.multiLine=!1,this.useForSwitchingToRelatives=!1,this.editorMode=!1,this.relatives=[]}setReaderStateManager(t){var o;super.setReaderStateManager(t),this.key&&this.useForSwitchingToRelatives&&t.registerMetadataForSwitchToRelatives(this.key),null===(o=this.stateManager)||void 0===o||o.store.eventBus.addEventListener("clustering-helper-created",(()=>this.setRelatives()))}render(){return e.html`
1109
1109
  <ft-tooltip part="tooltip"
1110
1110
  class="${this.multiLine?"ft-reader-metadata-multi-line":""}"
1111
1111
  text="${this.tooltipText}">
1112
- ${this.useForSwitchingToRelatives&&this.metadata&&this.metadata.values.length>0?this.renderSwitchToRelatives():e.html`
1112
+ ${this.useForSwitchingToRelatives&&this.metadata&&this.metadata.values.length>0&&this.relatives.length>0?this.renderSwitchToRelatives():e.html`
1113
1113
  <ft-chip part="chip" ?multiLine=${this.multiLine}>
1114
1114
  ${this.renderContent()}
1115
1115
  </ft-chip>
@@ -1256,11 +1256,11 @@ class en extends Tr{constructor(t){if(super(t),this.et=ot,t.type!==Mr)throw Erro
1256
1256
  * @license
1257
1257
  * Copyright 2017 Google LLC
1258
1258
  * SPDX-License-Identifier: BSD-3-Clause
1259
- */var Aa=function(t,o,e,i){for(var r,n=arguments.length,a=n<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(o,e,a):r(o,e))||a);return n>3&&a&&Object.defineProperty(o,e,a),a};class Ka extends fi{constructor(){super(...arguments),this.multiLine=!1,this.useForSwitchingToRelatives=!1,this.editorMode=!1,this.relatives=[]}setReaderStateManager(t){var o;super.setReaderStateManager(t),this.key&&this.useForSwitchingToRelatives&&t.registerMetadataForSwitchToRelatives(this.key),null===(o=this.stateManager)||void 0===o||o.store.eventBus.addEventListener("clustering-helper-created",this.setRelatives)}render(){return no`
1259
+ */var Aa=function(t,o,e,i){for(var r,n=arguments.length,a=n<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(o,e,a):r(o,e))||a);return n>3&&a&&Object.defineProperty(o,e,a),a};class Ka extends fi{constructor(){super(...arguments),this.multiLine=!1,this.useForSwitchingToRelatives=!1,this.editorMode=!1,this.relatives=[]}setReaderStateManager(t){var o;super.setReaderStateManager(t),this.key&&this.useForSwitchingToRelatives&&t.registerMetadataForSwitchToRelatives(this.key),null===(o=this.stateManager)||void 0===o||o.store.eventBus.addEventListener("clustering-helper-created",(()=>this.setRelatives()))}render(){return no`
1260
1260
  <ft-tooltip part="tooltip"
1261
1261
  class="${this.multiLine?"ft-reader-metadata-multi-line":""}"
1262
1262
  text="${this.tooltipText}">
1263
- ${this.useForSwitchingToRelatives&&this.metadata&&this.metadata.values.length>0?this.renderSwitchToRelatives():no`
1263
+ ${this.useForSwitchingToRelatives&&this.metadata&&this.metadata.values.length>0&&this.relatives.length>0?this.renderSwitchToRelatives():no`
1264
1264
  <ft-chip part="chip" ?multiLine=${this.multiLine}>
1265
1265
  ${this.renderContent()}
1266
1266
  </ft-chip>
@@ -1,4 +1,5 @@
1
1
  export interface FtReaderMetadataProperties {
2
2
  key?: string;
3
3
  editorMode?: boolean;
4
+ useForSwitchingToRelatives?: boolean;
4
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-reader-metadata",
3
- "version": "1.1.38",
3
+ "version": "1.1.40",
4
4
  "description": "Metadata for integrated reader",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,13 +19,13 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-chip": "1.1.38",
23
- "@fluid-topics/ft-floating-menu": "1.1.38",
24
- "@fluid-topics/ft-reader-context": "1.1.38",
25
- "@fluid-topics/ft-ripple": "1.1.38",
26
- "@fluid-topics/ft-tooltip": "1.1.38",
27
- "@fluid-topics/ft-wc-utils": "1.1.38",
22
+ "@fluid-topics/ft-chip": "1.1.40",
23
+ "@fluid-topics/ft-floating-menu": "1.1.40",
24
+ "@fluid-topics/ft-reader-context": "1.1.40",
25
+ "@fluid-topics/ft-ripple": "1.1.40",
26
+ "@fluid-topics/ft-tooltip": "1.1.40",
27
+ "@fluid-topics/ft-wc-utils": "1.1.40",
28
28
  "lit": "3.1.0"
29
29
  },
30
- "gitHead": "d4b337b18935ad7a7d9f20e856f84e92225a9192"
30
+ "gitHead": "ef5d1fb82ff388535e7a81aa3e8ffdb53c7591b4"
31
31
  }