@fluid-topics/ft-search-result-context 1.0.53 → 1.0.55
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.
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
color: inherit;
|
|
4
4
|
text-decoration: inherit;
|
|
5
5
|
}
|
|
6
|
-
`;var s,o,u,a,h,c,f,l,E,A,d;!function(t){!function(n){var r={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(r.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],e=ArrayBuffer.isView||function(t){return t&&i.indexOf(Object.prototype.toString.call(t))>-1};function s(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 o(t){return"string"!=typeof t&&(t=String(t)),t}function u(t){var n={next:function(){var n=t.shift();return{done:void 0===n,value:n}}};return r.iterable&&(n[Symbol.iterator]=function(){return n}),n}function a(t){this.map={},t instanceof a?t.forEach((function(t,n){this.append(n,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(n){this.append(n,t[n])}),this)}function h(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function c(t){return new Promise((function(n,r){t.onload=function(){n(t.result)},t.onerror=function(){r(t.error)}}))}function f(t){var n=new FileReader,r=c(n);return n.readAsArrayBuffer(t),r}function l(t){if(t.slice)return t.slice(0);var n=new Uint8Array(t.byteLength);return n.set(new Uint8Array(t)),n.buffer}function E(){return this.bodyUsed=!1,this._initBody=function(t){var n;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:r.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:r.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():r.arrayBuffer&&r.blob&&((n=t)&&DataView.prototype.isPrototypeOf(n))?(this._bodyArrayBuffer=l(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):r.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||e(t))?this._bodyArrayBuffer=l(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):r.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r.blob&&(this.blob=function(){var t=h(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?h(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(f)}),this.text=function(){var t,n,r,i=h(this);if(i)return i;if(this._bodyBlob)return t=this._bodyBlob,n=new FileReader,r=c(n),n.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var n=new Uint8Array(t),r=new Array(n.length),i=0;i<n.length;i++)r[i]=String.fromCharCode(n[i]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},r.formData&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}a.prototype.append=function(t,n){t=s(t),n=o(n);var r=this.map[t];this.map[t]=r?r+", "+n:n},a.prototype.delete=function(t){delete this.map[s(t)]},a.prototype.get=function(t){return t=s(t),this.has(t)?this.map[t]:null},a.prototype.has=function(t){return this.map.hasOwnProperty(s(t))},a.prototype.set=function(t,n){this.map[s(t)]=o(n)},a.prototype.forEach=function(t,n){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(n,this.map[r],r,this)},a.prototype.keys=function(){var t=[];return this.forEach((function(n,r){t.push(r)})),u(t)},a.prototype.values=function(){var t=[];return this.forEach((function(n){t.push(n)})),u(t)},a.prototype.entries=function(){var t=[];return this.forEach((function(n,r){t.push([r,n])})),u(t)},r.iterable&&(a.prototype[Symbol.iterator]=a.prototype.entries);var A=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function d(t,n){var r,i,e=(n=n||{}).body;if(t instanceof d){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,n.headers||(this.headers=new a(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,e||null==t._bodyInit||(e=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=n.credentials||this.credentials||"same-origin",!n.headers&&this.headers||(this.headers=new a(n.headers)),this.method=(r=n.method||this.method||"GET",i=r.toUpperCase(),A.indexOf(i)>-1?i:r),this.mode=n.mode||this.mode||null,this.signal=n.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&e)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(e)}function w(t){var n=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),i=r.shift().replace(/\+/g," "),e=r.join("=").replace(/\+/g," ");n.append(decodeURIComponent(i),decodeURIComponent(e))}})),n}function R(t,n){n||(n={}),this.type="default",this.status=void 0===n.status?200:n.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in n?n.statusText:"OK",this.headers=new a(n.headers),this.url=n.url||"",this._initBody(t)}d.prototype.clone=function(){return new d(this,{body:this._bodyInit})},E.call(d.prototype),E.call(R.prototype),R.prototype.clone=function(){return new R(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new a(this.headers),url:this.url})},R.error=function(){var t=new R(null,{status:0,statusText:""});return t.type="error",t};var T=[301,302,303,307,308];R.redirect=function(t,n){if(-1===T.indexOf(n))throw new RangeError("Invalid status code");return new R(null,{status:n,headers:{location:t}})},n.DOMException=t.DOMException;try{new n.DOMException}catch(t){n.DOMException=function(t,n){this.message=t,this.name=n;var r=Error(t);this.stack=r.stack},n.DOMException.prototype=Object.create(Error.prototype),n.DOMException.prototype.constructor=n.DOMException}function b(t,i){return new Promise((function(e,s){var o=new d(t,i);if(o.signal&&o.signal.aborted)return s(new n.DOMException("Aborted","AbortError"));var u=new XMLHttpRequest;function h(){u.abort()}u.onload=function(){var t,n,r={status:u.status,statusText:u.statusText,headers:(t=u.getAllResponseHeaders()||"",n=new a,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),i=r.shift().trim();if(i){var e=r.join(":").trim();n.append(i,e)}})),n)};r.url="responseURL"in u?u.responseURL:r.headers.get("X-Request-URL");var i="response"in u?u.response:u.responseText;e(new R(i,r))},u.onerror=function(){s(new TypeError("Network request failed"))},u.ontimeout=function(){s(new TypeError("Network request failed"))},u.onabort=function(){s(new n.DOMException("Aborted","AbortError"))},u.open(o.method,o.url,!0),"include"===o.credentials?u.withCredentials=!0:"omit"===o.credentials&&(u.withCredentials=!1),"responseType"in u&&r.blob&&(u.responseType="blob"),o.headers.forEach((function(t,n){u.setRequestHeader(n,t)})),o.signal&&(o.signal.addEventListener("abort",h),u.onreadystatechange=function(){4===u.readyState&&o.signal.removeEventListener("abort",h)}),u.send(void 0===o._bodyInit?null:o._bodyInit)}))}b.polyfill=!0,t.fetch||(t.fetch=b,t.Headers=a,t.Request=d,t.Response=R),n.Headers=a,n.Request=d,n.Response=R,n.fetch=b,Object.defineProperty(n,"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"}(s||(s={})),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"}(o||(o={})),function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"}(u||(u={})),function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"}(a||(a={})),function(t){t.ASC="ASC",t.DESC="DESC"}(h||(h={})),function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"}(c||(c={})),function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK"}(f||(f={})),function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"}(l||(l={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"}(E||(E={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"}(A||(A={})),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.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"}(d||(d={})),d.PERSONAL_BOOK_SHARE_USER,d.PERSONAL_BOOK_USER,d.HTML_EXPORT_USER,d.PERSONAL_BOOK_USER,d.PDF_EXPORT_USER,d.PERSONAL_BOOK_USER,d.KHUB_ADMIN,d.CONTENT_PUBLISHER,d.ADMIN,d.KHUB_ADMIN,d.USERS_ADMIN,d.PORTAL_ADMIN,d.DEVELOPER,d.BETA_USER,d.DEBUG_USER;var w=function(t,n,r,i){for(var e,s=arguments.length,o=s<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,r):i,u=t.length-1;u>=0;u--)(e=t[u])&&(o=(s<3?e(o):s>3?e(n,r,o):e(n,r))||o);return s>3&&o&&Object.defineProperty(n,r,o),o};class R extends CustomEvent{constructor(t,n){super("ft-search-result-click",{detail:{result:t,rank:n},bubbles:!0,composed:!0})}}class T extends n.FtLitElement{constructor(){super(...arguments),this.index=0,this.registeredComponents=[]}render(){return r.html`
|
|
6
|
+
`;var s,o,u,a,h,c,f,l,E,A,d,R;!function(t){!function(n){var r={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(r.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],e=ArrayBuffer.isView||function(t){return t&&i.indexOf(Object.prototype.toString.call(t))>-1};function s(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 o(t){return"string"!=typeof t&&(t=String(t)),t}function u(t){var n={next:function(){var n=t.shift();return{done:void 0===n,value:n}}};return r.iterable&&(n[Symbol.iterator]=function(){return n}),n}function a(t){this.map={},t instanceof a?t.forEach((function(t,n){this.append(n,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(n){this.append(n,t[n])}),this)}function h(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function c(t){return new Promise((function(n,r){t.onload=function(){n(t.result)},t.onerror=function(){r(t.error)}}))}function f(t){var n=new FileReader,r=c(n);return n.readAsArrayBuffer(t),r}function l(t){if(t.slice)return t.slice(0);var n=new Uint8Array(t.byteLength);return n.set(new Uint8Array(t)),n.buffer}function E(){return this.bodyUsed=!1,this._initBody=function(t){var n;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:r.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:r.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():r.arrayBuffer&&r.blob&&((n=t)&&DataView.prototype.isPrototypeOf(n))?(this._bodyArrayBuffer=l(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):r.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||e(t))?this._bodyArrayBuffer=l(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):r.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r.blob&&(this.blob=function(){var t=h(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?h(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(f)}),this.text=function(){var t,n,r,i=h(this);if(i)return i;if(this._bodyBlob)return t=this._bodyBlob,n=new FileReader,r=c(n),n.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var n=new Uint8Array(t),r=new Array(n.length),i=0;i<n.length;i++)r[i]=String.fromCharCode(n[i]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},r.formData&&(this.formData=function(){return this.text().then(R)}),this.json=function(){return this.text().then(JSON.parse)},this}a.prototype.append=function(t,n){t=s(t),n=o(n);var r=this.map[t];this.map[t]=r?r+", "+n:n},a.prototype.delete=function(t){delete this.map[s(t)]},a.prototype.get=function(t){return t=s(t),this.has(t)?this.map[t]:null},a.prototype.has=function(t){return this.map.hasOwnProperty(s(t))},a.prototype.set=function(t,n){this.map[s(t)]=o(n)},a.prototype.forEach=function(t,n){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(n,this.map[r],r,this)},a.prototype.keys=function(){var t=[];return this.forEach((function(n,r){t.push(r)})),u(t)},a.prototype.values=function(){var t=[];return this.forEach((function(n){t.push(n)})),u(t)},a.prototype.entries=function(){var t=[];return this.forEach((function(n,r){t.push([r,n])})),u(t)},r.iterable&&(a.prototype[Symbol.iterator]=a.prototype.entries);var A=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function d(t,n){var r,i,e=(n=n||{}).body;if(t instanceof d){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,n.headers||(this.headers=new a(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,e||null==t._bodyInit||(e=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=n.credentials||this.credentials||"same-origin",!n.headers&&this.headers||(this.headers=new a(n.headers)),this.method=(r=n.method||this.method||"GET",i=r.toUpperCase(),A.indexOf(i)>-1?i:r),this.mode=n.mode||this.mode||null,this.signal=n.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&e)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(e)}function R(t){var n=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),i=r.shift().replace(/\+/g," "),e=r.join("=").replace(/\+/g," ");n.append(decodeURIComponent(i),decodeURIComponent(e))}})),n}function w(t,n){n||(n={}),this.type="default",this.status=void 0===n.status?200:n.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in n?n.statusText:"OK",this.headers=new a(n.headers),this.url=n.url||"",this._initBody(t)}d.prototype.clone=function(){return new d(this,{body:this._bodyInit})},E.call(d.prototype),E.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new a(this.headers),url:this.url})},w.error=function(){var t=new w(null,{status:0,statusText:""});return t.type="error",t};var T=[301,302,303,307,308];w.redirect=function(t,n){if(-1===T.indexOf(n))throw new RangeError("Invalid status code");return new w(null,{status:n,headers:{location:t}})},n.DOMException=t.DOMException;try{new n.DOMException}catch(t){n.DOMException=function(t,n){this.message=t,this.name=n;var r=Error(t);this.stack=r.stack},n.DOMException.prototype=Object.create(Error.prototype),n.DOMException.prototype.constructor=n.DOMException}function b(t,i){return new Promise((function(e,s){var o=new d(t,i);if(o.signal&&o.signal.aborted)return s(new n.DOMException("Aborted","AbortError"));var u=new XMLHttpRequest;function h(){u.abort()}u.onload=function(){var t,n,r={status:u.status,statusText:u.statusText,headers:(t=u.getAllResponseHeaders()||"",n=new a,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),i=r.shift().trim();if(i){var e=r.join(":").trim();n.append(i,e)}})),n)};r.url="responseURL"in u?u.responseURL:r.headers.get("X-Request-URL");var i="response"in u?u.response:u.responseText;e(new w(i,r))},u.onerror=function(){s(new TypeError("Network request failed"))},u.ontimeout=function(){s(new TypeError("Network request failed"))},u.onabort=function(){s(new n.DOMException("Aborted","AbortError"))},u.open(o.method,o.url,!0),"include"===o.credentials?u.withCredentials=!0:"omit"===o.credentials&&(u.withCredentials=!1),"responseType"in u&&r.blob&&(u.responseType="blob"),o.headers.forEach((function(t,n){u.setRequestHeader(n,t)})),o.signal&&(o.signal.addEventListener("abort",h),u.onreadystatechange=function(){4===u.readyState&&o.signal.removeEventListener("abort",h)}),u.send(void 0===o._bodyInit?null:o._bodyInit)}))}b.polyfill=!0,t.fetch||(t.fetch=b,t.Headers=a,t.Request=d,t.Response=w),n.Headers=a,n.Request=d,n.Response=w,n.fetch=b,Object.defineProperty(n,"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"}(s||(s={})),function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"}(o||(o={})),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"}(u||(u={})),function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"}(a||(a={})),function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"}(h||(h={})),function(t){t.ASC="ASC",t.DESC="DESC"}(c||(c={})),function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"}(f||(f={})),function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK"}(l||(l={})),function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"}(E||(E={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"}(A||(A={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"}(d||(d={})),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.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"}(R||(R={})),R.PERSONAL_BOOK_SHARE_USER,R.PERSONAL_BOOK_USER,R.HTML_EXPORT_USER,R.PERSONAL_BOOK_USER,R.PDF_EXPORT_USER,R.PERSONAL_BOOK_USER,R.KHUB_ADMIN,R.CONTENT_PUBLISHER,R.ADMIN,R.KHUB_ADMIN,R.USERS_ADMIN,R.PORTAL_ADMIN,R.DEVELOPER,R.BETA_USER,R.DEBUG_USER;var w=function(t,n,r,i){for(var e,s=arguments.length,o=s<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,r):i,u=t.length-1;u>=0;u--)(e=t[u])&&(o=(s<3?e(o):s>3?e(n,r,o):e(n,r))||o);return s>3&&o&&Object.defineProperty(n,r,o),o};class T extends CustomEvent{constructor(t,n){super("ft-search-result-click",{detail:{result:t,rank:n},bubbles:!0,composed:!0})}}class b extends n.FtLitElement{constructor(){super(...arguments),this.index=0,this.registeredComponents=[]}render(){return r.html`
|
|
7
7
|
<a href="${this.url}" @click=${this.onResultClick}>
|
|
8
8
|
<slot @register-ft-search-result-component=${this.registerComponent}></slot>
|
|
9
9
|
</a>
|
|
10
|
-
`}get url(){var t;switch(null===(t=this.result)||void 0===t?void 0:t.type){case
|
|
10
|
+
`}get url(){var t;switch(null===(t=this.result)||void 0===t?void 0:t.type){case d.MAP:return this.result.map.readerUrl;case d.DOCUMENT:return this.result.document.viewerUrl;case d.TOPIC:return this.result.topic.readerUrl}return""}onResultClick(){this.dispatchEvent(new T(this.result,this.index+1))}registerComponent(t){t.stopPropagation();const n=t.composedPath()[0];this.register(n)}register(t){this.registeredComponents.push(t),t.result=this.result}updated(t){super.updated(t),t.has("result")&&this.registeredComponents.forEach((t=>t.result=this.result))}disconnectedCallback(){super.disconnectedCallback(),this.registeredComponents=[]}}b.elementDefinitions={},b.styles=e,w([i.property({attribute:!1})],b.prototype,"result",void 0),w([i.property()],b.prototype,"index",void 0),n.customElement("ft-search-result-context")(b),t.FtSearchResultContext=b,t.FtSearchResultContextCssVariables={},t.SearchResultClickEvent=T,t.styles=e}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators);
|
|
@@ -41,7 +41,7 @@ const o=window,a=o.ShadowRoot&&(void 0===o.ShadyCSS||o.ShadyCSS.nativeShadow)&&"
|
|
|
41
41
|
* Copyright 2017 Google LLC
|
|
42
42
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
43
43
|
*/
|
|
44
|
-
var R;O.finalized=!0,O.elementProperties=new Map,O.elementStyles=[],O.shadowRootOptions={mode:"open"},null==m||m({ReactiveElement:O}),(null!==(v=b.reactiveElementVersions)&&void 0!==v?v:b.reactiveElementVersions=[]).push("1.6.1");const S=window,N=S.trustedTypes,A=N?N.createPolicy("lit-html",{createHTML:t=>t}):void 0,C="$lit$",U=`lit$${(Math.random()+"").slice(9)}$`,T="?"+U,M=`<${T}>`,L=document,_=()=>L.createComment(""),
|
|
44
|
+
var R;O.finalized=!0,O.elementProperties=new Map,O.elementStyles=[],O.shadowRootOptions={mode:"open"},null==m||m({ReactiveElement:O}),(null!==(v=b.reactiveElementVersions)&&void 0!==v?v:b.reactiveElementVersions=[]).push("1.6.1");const S=window,N=S.trustedTypes,A=N?N.createPolicy("lit-html",{createHTML:t=>t}):void 0,C="$lit$",U=`lit$${(Math.random()+"").slice(9)}$`,T="?"+U,M=`<${T}>`,L=document,_=()=>L.createComment(""),F=t=>null===t||"object"!=typeof t&&"function"!=typeof t,k=Array.isArray,$="[ \t\n\f\r]",j=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,B=/-->/g,P=/>/g,D=RegExp(`>|${$}(?:([^\\s"'>=/]+)(${$}*=${$}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),I=/'/g,H=/"/g,K=/^(?:script|style|textarea|title)$/i,W=(t=>(i,...e)=>({_$litType$:t,strings:i,values:e}))(1),G=Symbol.for("lit-noChange"),z=Symbol.for("lit-nothing"),V=new WeakMap,q=L.createTreeWalker(L,129,null,!1),J=(t,i)=>{const e=t.length-1,s=[];let n,r=2===i?"<svg>":"",o=j;for(let i=0;i<e;i++){const e=t[i];let a,h,c=-1,l=0;for(;l<e.length&&(o.lastIndex=l,h=o.exec(e),null!==h);)l=o.lastIndex,o===j?"!--"===h[1]?o=B:void 0!==h[1]?o=P:void 0!==h[2]?(K.test(h[2])&&(n=RegExp("</"+h[2],"g")),o=D):void 0!==h[3]&&(o=D):o===D?">"===h[0]?(o=null!=n?n:j,c=-1):void 0===h[1]?c=-2:(c=o.lastIndex-h[2].length,a=h[1],o=void 0===h[3]?D:'"'===h[3]?H:I):o===H||o===I?o=D:o===B||o===P?o=j:(o=D,n=void 0);const u=o===D&&t[i+1].startsWith("/>")?" ":"";r+=o===j?e+M:c>=0?(s.push(a),e.slice(0,c)+C+e.slice(c)+U+u):e+U+(-2===c?(s.push(void 0),i):u)}const a=r+(t[e]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==A?A.createHTML(a):a,s]};class X{constructor({strings:t,_$litType$:i},e){let s;this.parts=[];let n=0,r=0;const o=t.length-1,a=this.parts,[h,c]=J(t,i);if(this.el=X.createElement(h,e),q.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(s=q.nextNode())&&a.length<o;){if(1===s.nodeType){if(s.hasAttributes()){const t=[];for(const i of s.getAttributeNames())if(i.endsWith(C)||i.startsWith(U)){const e=c[r++];if(t.push(i),void 0!==e){const t=s.getAttribute(e.toLowerCase()+C).split(U),i=/([.?@])?(.*)/.exec(e);a.push({type:1,index:n,name:i[2],strings:t,ctor:"."===i[1]?it:"?"===i[1]?st:"@"===i[1]?nt:tt})}else a.push({type:6,index:n})}for(const i of t)s.removeAttribute(i)}if(K.test(s.tagName)){const t=s.textContent.split(U),i=t.length-1;if(i>0){s.textContent=N?N.emptyScript:"";for(let e=0;e<i;e++)s.append(t[e],_()),q.nextNode(),a.push({type:2,index:++n});s.append(t[i],_())}}}else if(8===s.nodeType)if(s.data===T)a.push({type:2,index:n});else{let t=-1;for(;-1!==(t=s.data.indexOf(U,t+1));)a.push({type:7,index:n}),t+=U.length-1}n++}}static createElement(t,i){const e=L.createElement("template");return e.innerHTML=t,e}}function Z(t,i,e=t,s){var n,r,o,a;if(i===G)return i;let h=void 0!==s?null===(n=e._$Co)||void 0===n?void 0:n[s]:e._$Cl;const c=F(i)?void 0:i._$litDirective$;return(null==h?void 0:h.constructor)!==c&&(null===(r=null==h?void 0:h._$AO)||void 0===r||r.call(h,!1),void 0===c?h=void 0:(h=new c(t),h._$AT(t,e,s)),void 0!==s?(null!==(o=(a=e)._$Co)&&void 0!==o?o:a._$Co=[])[s]=h:e._$Cl=h),void 0!==h&&(i=Z(t,h._$AS(t,i.values),h,s)),i}class Y{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var i;const{el:{content:e},parts:s}=this._$AD,n=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:L).importNode(e,!0);q.currentNode=n;let r=q.nextNode(),o=0,a=0,h=s[0];for(;void 0!==h;){if(o===h.index){let i;2===h.type?i=new Q(r,r.nextSibling,this,t):1===h.type?i=new h.ctor(r,h.name,h.strings,this,t):6===h.type&&(i=new rt(r,this,t)),this._$AV.push(i),h=s[++a]}o!==(null==h?void 0:h.index)&&(r=q.nextNode(),o++)}return n}v(t){let i=0;for(const e of this._$AV)void 0!==e&&(void 0!==e.strings?(e._$AI(t,e,i),i+=e.strings.length-2):e._$AI(t[i])),i++}}class Q{constructor(t,i,e,s){var n;this.type=2,this._$AH=z,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=e,this.options=s,this._$Cp=null===(n=null==s?void 0:s.isConnected)||void 0===n||n}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===(null==t?void 0:t.nodeType)&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=Z(this,t,i),F(t)?t===z||null==t||""===t?(this._$AH!==z&&this._$AR(),this._$AH=z):t!==this._$AH&&t!==G&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>k(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(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!==z&&F(this._$AH)?this._$AA.nextSibling.data=t:this.$(L.createTextNode(t)),this._$AH=t}g(t){var i;const{values:e,_$litType$:s}=t,n="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=X.createElement(s.h,this.options)),s);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===n)this._$AH.v(e);else{const t=new Y(n,this),i=t.u(this.options);t.v(e),this.$(i),this._$AH=t}}_$AC(t){let i=V.get(t.strings);return void 0===i&&V.set(t.strings,i=new X(t)),i}T(t){k(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let e,s=0;for(const n of t)s===i.length?i.push(e=new Q(this.k(_()),this.k(_()),this,this.options)):e=i[s],e._$AI(n),s++;s<i.length&&(this._$AR(e&&e._$AB.nextSibling,s),i.length=s)}_$AR(t=this._$AA.nextSibling,i){var e;for(null===(e=this._$AP)||void 0===e||e.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cp=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class tt{constructor(t,i,e,s,n){this.type=1,this._$AH=z,this._$AN=void 0,this.element=t,this.name=i,this._$AM=s,this.options=n,e.length>2||""!==e[0]||""!==e[1]?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=z}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,e,s){const n=this.strings;let r=!1;if(void 0===n)t=Z(this,t,i,0),r=!F(t)||t!==this._$AH&&t!==G,r&&(this._$AH=t);else{const s=t;let o,a;for(t=n[0],o=0;o<n.length-1;o++)a=Z(this,s[e+o],i,o),a===G&&(a=this._$AH[o]),r||(r=!F(a)||a!==this._$AH[o]),a===z?t=z:t!==z&&(t+=(null!=a?a:"")+n[o+1]),this._$AH[o]=a}r&&!s&&this.j(t)}j(t){t===z?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class it extends tt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===z?void 0:t}}const et=N?N.emptyScript:"";class st extends tt{constructor(){super(...arguments),this.type=4}j(t){t&&t!==z?this.element.setAttribute(this.name,et):this.element.removeAttribute(this.name)}}class nt extends tt{constructor(t,i,e,s,n){super(t,i,e,s,n),this.type=5}_$AI(t,i=this){var e;if((t=null!==(e=Z(this,t,i,0))&&void 0!==e?e:z)===G)return;const s=this._$AH,n=t===z&&s!==z||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==z&&(s===z||n);n&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,e;"function"==typeof this._$AH?this._$AH.call(null!==(e=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==e?e:this.element,t):this._$AH.handleEvent(t)}}class rt{constructor(t,i,e){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(t){Z(this,t)}}const ot=S.litHtmlPolyfillSupport;null==ot||ot(X,Q),(null!==(R=S.litHtmlVersions)&&void 0!==R?R:S.litHtmlVersions=[]).push("2.7.3");
|
|
45
45
|
/**
|
|
46
46
|
* @license
|
|
47
47
|
* Copyright 2017 Google LLC
|
|
@@ -84,8 +84,8 @@ var at,ht;class ct extends O{constructor(){super(...arguments),this.renderOption
|
|
|
84
84
|
color: inherit;
|
|
85
85
|
text-decoration: inherit;
|
|
86
86
|
}
|
|
87
|
-
`;var Et,Ot,Rt,St,Nt,At,Ct,Ut,Tt,Mt,Lt;!function(t){!function(i){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 s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],n=ArrayBuffer.isView||function(t){return t&&s.indexOf(Object.prototype.toString.call(t))>-1};function r(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 o(t){return"string"!=typeof t&&(t=String(t)),t}function a(t){var i={next:function(){var i=t.shift();return{done:void 0===i,value:i}}};return e.iterable&&(i[Symbol.iterator]=function(){return i}),i}function h(t){this.map={},t instanceof h?t.forEach((function(t,i){this.append(i,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(i){this.append(i,t[i])}),this)}function c(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function l(t){return new Promise((function(i,e){t.onload=function(){i(t.result)},t.onerror=function(){e(t.error)}}))}function u(t){var i=new FileReader,e=l(i);return i.readAsArrayBuffer(t),e}function d(t){if(t.slice)return t.slice(0);var i=new Uint8Array(t.byteLength);return i.set(new Uint8Array(t)),i.buffer}function f(){return this.bodyUsed=!1,this._initBody=function(t){var i;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&&((i=t)&&DataView.prototype.isPrototypeOf(i))?(this._bodyArrayBuffer=d(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):e.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||n(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=c(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?c(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(u)}),this.text=function(){var t,i,e,s=c(this);if(s)return s;if(this._bodyBlob)return t=this._bodyBlob,i=new FileReader,e=l(i),i.readAsText(t),e;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var i=new Uint8Array(t),e=new Array(i.length),s=0;s<i.length;s++)e[s]=String.fromCharCode(i[s]);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(b)}),this.json=function(){return this.text().then(JSON.parse)},this}h.prototype.append=function(t,i){t=r(t),i=o(i);var e=this.map[t];this.map[t]=e?e+", "+i:i},h.prototype.delete=function(t){delete this.map[r(t)]},h.prototype.get=function(t){return t=r(t),this.has(t)?this.map[t]:null},h.prototype.has=function(t){return this.map.hasOwnProperty(r(t))},h.prototype.set=function(t,i){this.map[r(t)]=o(i)},h.prototype.forEach=function(t,i){for(var e in this.map)this.map.hasOwnProperty(e)&&t.call(i,this.map[e],e,this)},h.prototype.keys=function(){var t=[];return this.forEach((function(i,e){t.push(e)})),a(t)},h.prototype.values=function(){var t=[];return this.forEach((function(i){t.push(i)})),a(t)},h.prototype.entries=function(){var t=[];return this.forEach((function(i,e){t.push([e,i])})),a(t)},e.iterable&&(h.prototype[Symbol.iterator]=h.prototype.entries);var p=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function v(t,i){var e,s,n=(i=i||{}).body;if(t instanceof v){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,i.headers||(this.headers=new h(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,n||null==t._bodyInit||(n=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=i.credentials||this.credentials||"same-origin",!i.headers&&this.headers||(this.headers=new h(i.headers)),this.method=(e=i.method||this.method||"GET",s=e.toUpperCase(),p.indexOf(s)>-1?s:e),this.mode=i.mode||this.mode||null,this.signal=i.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function b(t){var i=new FormData;return t.trim().split("&").forEach((function(t){if(t){var e=t.split("="),s=e.shift().replace(/\+/g," "),n=e.join("=").replace(/\+/g," ");i.append(decodeURIComponent(s),decodeURIComponent(n))}})),i}function w(t,i){i||(i={}),this.type="default",this.status=void 0===i.status?200:i.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in i?i.statusText:"OK",this.headers=new h(i.headers),this.url=i.url||"",this._initBody(t)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},f.call(v.prototype),f.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},w.error=function(){var t=new w(null,{status:0,statusText:""});return t.type="error",t};var y=[301,302,303,307,308];w.redirect=function(t,i){if(-1===y.indexOf(i))throw new RangeError("Invalid status code");return new w(null,{status:i,headers:{location:t}})},i.DOMException=t.DOMException;try{new i.DOMException}catch(t){i.DOMException=function(t,i){this.message=t,this.name=i;var e=Error(t);this.stack=e.stack},i.DOMException.prototype=Object.create(Error.prototype),i.DOMException.prototype.constructor=i.DOMException}function m(t,s){return new Promise((function(n,r){var o=new v(t,s);if(o.signal&&o.signal.aborted)return r(new i.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function c(){a.abort()}a.onload=function(){var t,i,e={status:a.status,statusText:a.statusText,headers:(t=a.getAllResponseHeaders()||"",i=new h,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var e=t.split(":"),s=e.shift().trim();if(s){var n=e.join(":").trim();i.append(s,n)}})),i)};e.url="responseURL"in a?a.responseURL:e.headers.get("X-Request-URL");var s="response"in a?a.response:a.responseText;n(new w(s,e))},a.onerror=function(){r(new TypeError("Network request failed"))},a.ontimeout=function(){r(new TypeError("Network request failed"))},a.onabort=function(){r(new i.DOMException("Aborted","AbortError"))},a.open(o.method,o.url,!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&e.blob&&(a.responseType="blob"),o.headers.forEach((function(t,i){a.setRequestHeader(i,t)})),o.signal&&(o.signal.addEventListener("abort",c),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",c)}),a.send(void 0===o._bodyInit?null:o._bodyInit)}))}m.polyfill=!0,t.fetch||(t.fetch=m,t.Headers=h,t.Request=v,t.Response=w),i.Headers=h,i.Request=v,i.Response=w,i.fetch=m,Object.defineProperty(i,"i",{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"}(Et||(Et={})),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"}(Ot||(Ot={})),function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"}(Rt||(Rt={})),function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"}(St||(St={})),function(t){t.ASC="ASC",t.DESC="DESC"}(Nt||(Nt={})),function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"}(At||(At={})),function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK"}(Ct||(Ct={})),function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"}(Ut||(Ut={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"}(Tt||(Tt={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"}(Mt||(Mt={})),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.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"}(Lt||(Lt={})),Lt.PERSONAL_BOOK_SHARE_USER,Lt.PERSONAL_BOOK_USER,Lt.HTML_EXPORT_USER,Lt.PERSONAL_BOOK_USER,Lt.PDF_EXPORT_USER,Lt.PERSONAL_BOOK_USER,Lt.KHUB_ADMIN,Lt.CONTENT_PUBLISHER,Lt.ADMIN,Lt.KHUB_ADMIN,Lt.USERS_ADMIN,Lt.PORTAL_ADMIN,Lt.DEVELOPER,Lt.BETA_USER,Lt.DEBUG_USER;var _t,kt=function(t,i,e,s){for(var n,r=arguments.length,o=r<3?i:null===s?s=Object.getOwnPropertyDescriptor(i,e):s,a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(i,e,o):n(i,e))||o);return r>3&&o&&Object.defineProperty(i,e,o),o};class Ft extends CustomEvent{constructor(t,i){super("ft-search-result-click",{detail:{result:t,rank:i},bubbles:!0,composed:!0})}}class $t extends yt{constructor(){super(...arguments),this.index=0,this.registeredComponents=[]}render(){return W`
|
|
87
|
+
`;var Et,Ot,Rt,St,Nt,At,Ct,Ut,Tt,Mt,Lt,_t;!function(t){!function(i){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 s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],n=ArrayBuffer.isView||function(t){return t&&s.indexOf(Object.prototype.toString.call(t))>-1};function r(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 o(t){return"string"!=typeof t&&(t=String(t)),t}function a(t){var i={next:function(){var i=t.shift();return{done:void 0===i,value:i}}};return e.iterable&&(i[Symbol.iterator]=function(){return i}),i}function h(t){this.map={},t instanceof h?t.forEach((function(t,i){this.append(i,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(i){this.append(i,t[i])}),this)}function c(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function l(t){return new Promise((function(i,e){t.onload=function(){i(t.result)},t.onerror=function(){e(t.error)}}))}function u(t){var i=new FileReader,e=l(i);return i.readAsArrayBuffer(t),e}function d(t){if(t.slice)return t.slice(0);var i=new Uint8Array(t.byteLength);return i.set(new Uint8Array(t)),i.buffer}function f(){return this.bodyUsed=!1,this._initBody=function(t){var i;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&&((i=t)&&DataView.prototype.isPrototypeOf(i))?(this._bodyArrayBuffer=d(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):e.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||n(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=c(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?c(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(u)}),this.text=function(){var t,i,e,s=c(this);if(s)return s;if(this._bodyBlob)return t=this._bodyBlob,i=new FileReader,e=l(i),i.readAsText(t),e;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var i=new Uint8Array(t),e=new Array(i.length),s=0;s<i.length;s++)e[s]=String.fromCharCode(i[s]);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(b)}),this.json=function(){return this.text().then(JSON.parse)},this}h.prototype.append=function(t,i){t=r(t),i=o(i);var e=this.map[t];this.map[t]=e?e+", "+i:i},h.prototype.delete=function(t){delete this.map[r(t)]},h.prototype.get=function(t){return t=r(t),this.has(t)?this.map[t]:null},h.prototype.has=function(t){return this.map.hasOwnProperty(r(t))},h.prototype.set=function(t,i){this.map[r(t)]=o(i)},h.prototype.forEach=function(t,i){for(var e in this.map)this.map.hasOwnProperty(e)&&t.call(i,this.map[e],e,this)},h.prototype.keys=function(){var t=[];return this.forEach((function(i,e){t.push(e)})),a(t)},h.prototype.values=function(){var t=[];return this.forEach((function(i){t.push(i)})),a(t)},h.prototype.entries=function(){var t=[];return this.forEach((function(i,e){t.push([e,i])})),a(t)},e.iterable&&(h.prototype[Symbol.iterator]=h.prototype.entries);var p=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function v(t,i){var e,s,n=(i=i||{}).body;if(t instanceof v){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,i.headers||(this.headers=new h(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,n||null==t._bodyInit||(n=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=i.credentials||this.credentials||"same-origin",!i.headers&&this.headers||(this.headers=new h(i.headers)),this.method=(e=i.method||this.method||"GET",s=e.toUpperCase(),p.indexOf(s)>-1?s:e),this.mode=i.mode||this.mode||null,this.signal=i.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function b(t){var i=new FormData;return t.trim().split("&").forEach((function(t){if(t){var e=t.split("="),s=e.shift().replace(/\+/g," "),n=e.join("=").replace(/\+/g," ");i.append(decodeURIComponent(s),decodeURIComponent(n))}})),i}function w(t,i){i||(i={}),this.type="default",this.status=void 0===i.status?200:i.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in i?i.statusText:"OK",this.headers=new h(i.headers),this.url=i.url||"",this._initBody(t)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},f.call(v.prototype),f.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},w.error=function(){var t=new w(null,{status:0,statusText:""});return t.type="error",t};var y=[301,302,303,307,308];w.redirect=function(t,i){if(-1===y.indexOf(i))throw new RangeError("Invalid status code");return new w(null,{status:i,headers:{location:t}})},i.DOMException=t.DOMException;try{new i.DOMException}catch(t){i.DOMException=function(t,i){this.message=t,this.name=i;var e=Error(t);this.stack=e.stack},i.DOMException.prototype=Object.create(Error.prototype),i.DOMException.prototype.constructor=i.DOMException}function m(t,s){return new Promise((function(n,r){var o=new v(t,s);if(o.signal&&o.signal.aborted)return r(new i.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function c(){a.abort()}a.onload=function(){var t,i,e={status:a.status,statusText:a.statusText,headers:(t=a.getAllResponseHeaders()||"",i=new h,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var e=t.split(":"),s=e.shift().trim();if(s){var n=e.join(":").trim();i.append(s,n)}})),i)};e.url="responseURL"in a?a.responseURL:e.headers.get("X-Request-URL");var s="response"in a?a.response:a.responseText;n(new w(s,e))},a.onerror=function(){r(new TypeError("Network request failed"))},a.ontimeout=function(){r(new TypeError("Network request failed"))},a.onabort=function(){r(new i.DOMException("Aborted","AbortError"))},a.open(o.method,o.url,!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&e.blob&&(a.responseType="blob"),o.headers.forEach((function(t,i){a.setRequestHeader(i,t)})),o.signal&&(o.signal.addEventListener("abort",c),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",c)}),a.send(void 0===o._bodyInit?null:o._bodyInit)}))}m.polyfill=!0,t.fetch||(t.fetch=m,t.Headers=h,t.Request=v,t.Response=w),i.Headers=h,i.Request=v,i.Response=w,i.fetch=m,Object.defineProperty(i,"i",{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"}(Et||(Et={})),function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"}(Ot||(Ot={})),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"}(Rt||(Rt={})),function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"}(St||(St={})),function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"}(Nt||(Nt={})),function(t){t.ASC="ASC",t.DESC="DESC"}(At||(At={})),function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"}(Ct||(Ct={})),function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK"}(Ut||(Ut={})),function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"}(Tt||(Tt={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"}(Mt||(Mt={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"}(Lt||(Lt={})),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.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"}(_t||(_t={})),_t.PERSONAL_BOOK_SHARE_USER,_t.PERSONAL_BOOK_USER,_t.HTML_EXPORT_USER,_t.PERSONAL_BOOK_USER,_t.PDF_EXPORT_USER,_t.PERSONAL_BOOK_USER,_t.KHUB_ADMIN,_t.CONTENT_PUBLISHER,_t.ADMIN,_t.KHUB_ADMIN,_t.USERS_ADMIN,_t.PORTAL_ADMIN,_t.DEVELOPER,_t.BETA_USER,_t.DEBUG_USER;var Ft,kt=function(t,i,e,s){for(var n,r=arguments.length,o=r<3?i:null===s?s=Object.getOwnPropertyDescriptor(i,e):s,a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(i,e,o):n(i,e))||o);return r>3&&o&&Object.defineProperty(i,e,o),o};class $t extends CustomEvent{constructor(t,i){super("ft-search-result-click",{detail:{result:t,rank:i},bubbles:!0,composed:!0})}}class jt extends yt{constructor(){super(...arguments),this.index=0,this.registeredComponents=[]}render(){return W`
|
|
88
88
|
<a href="${this.url}" @click=${this.onResultClick}>
|
|
89
89
|
<slot @register-ft-search-result-component=${this.registerComponent}></slot>
|
|
90
90
|
</a>
|
|
91
|
-
`}get url(){var t;switch(null===(t=this.result)||void 0===t?void 0:t.type){case
|
|
91
|
+
`}get url(){var t;switch(null===(t=this.result)||void 0===t?void 0:t.type){case Lt.MAP:return this.result.map.readerUrl;case Lt.DOCUMENT:return this.result.document.viewerUrl;case Lt.TOPIC:return this.result.topic.readerUrl}return""}onResultClick(){this.dispatchEvent(new $t(this.result,this.index+1))}registerComponent(t){t.stopPropagation();const i=t.composedPath()[0];this.register(i)}register(t){this.registeredComponents.push(t),t.result=this.result}updated(t){super.updated(t),t.has("result")&&this.registeredComponents.forEach((t=>t.result=this.result))}disconnectedCallback(){super.disconnectedCallback(),this.registeredComponents=[]}}jt.elementDefinitions={},jt.styles=gt,kt([s({attribute:!1})],jt.prototype,"result",void 0),kt([s()],jt.prototype,"index",void 0),(Ft="ft-search-result-context",t=>{window.customElements.get(Ft)||window.customElements.define(Ft,t)})(jt),t.FtSearchResultContext=jt,t.FtSearchResultContextCssVariables={},t.SearchResultClickEvent=$t,t.styles=gt}({});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-search-result-context",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.55",
|
|
4
4
|
"description": "Search result context for integrated search component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-wc-utils": "1.0.
|
|
22
|
+
"@fluid-topics/ft-wc-utils": "1.0.55",
|
|
23
23
|
"lit": "2.7.2"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@fluid-topics/public-api": "1.0.
|
|
26
|
+
"@fluid-topics/public-api": "1.0.45"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "4eca32ed1fec3fd25b6d76b26895a6318cfa8ca2"
|
|
29
29
|
}
|