diff --git a/pr/pr-426/assets/main.5f904dad.js b/pr/pr-426/assets/main.5f904dad.js new file mode 100644 index 000000000..fa65c9a56 --- /dev/null +++ b/pr/pr-426/assets/main.5f904dad.js @@ -0,0 +1,6593 @@ +var Cn=Object.defineProperty,kn=Object.defineProperties;var Tn=Object.getOwnPropertyDescriptors;var ms=Object.getOwnPropertySymbols;var En=Object.prototype.hasOwnProperty,Mn=Object.prototype.propertyIsEnumerable;var gs=(a,e,t)=>e in a?Cn(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,q=(a,e)=>{for(var t in e||(e={}))En.call(e,t)&&gs(a,t,e[t]);if(ms)for(var t of ms(e))Mn.call(e,t)&&gs(a,t,e[t]);return a},ne=(a,e)=>kn(a,Tn(e));import Zo from"https://esm.archive.org/dayjs@1.11.10";import zn from"https://esm.archive.org/dayjs@1.9.4/esm/plugin/customParseFormat";const Pn=function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const n of s.addedNodes)n.tagName==="LINK"&&n.rel==="modulepreload"&&i(n)}).observe(document,{childList:!0,subtree:!0});function t(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerpolicy&&(s.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?s.credentials="include":o.crossorigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(o){if(o.ep)return;o.ep=!0;const s=t(o);fetch(o.href,s)}};Pn();function r(a,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(a,e,t,i);else for(var l=a.length-1;l>=0;l--)(n=a[l])&&(s=(o<3?n(s):o>3?n(e,t,s):n(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s}function An(a,e,t,i){function o(s){return s instanceof t?s:new t(function(n){n(s)})}return new(t||(t=Promise))(function(s,n){function l(f){try{p(i.next(f))}catch(m){n(m)}}function d(f){try{p(i.throw(f))}catch(m){n(m)}}function p(f){f.done?s(f.value):o(f.value).then(l,d)}p((i=i.apply(a,e||[])).next())})}class Ln{constructor(e){var t,i,o,s;this.ARCHIVE_ANALYTICS_VERSION=2,this.DEFAULT_SERVICE="ao_2",this.NO_SAMPLING_SERVICE="ao_no_sampling",this.DEFAULT_IMAGE_URL="https://analytics.archive.org/0.gif",this.defaultService=(t=e==null?void 0:e.defaultService)!==null&&t!==void 0?t:this.DEFAULT_SERVICE,this.imageUrl=(i=e==null?void 0:e.imageUrl)!==null&&i!==void 0?i:this.DEFAULT_IMAGE_URL,this.imageContainer=(o=e==null?void 0:e.imageContainer)!==null&&o!==void 0?o:document.body,this.requireImagePing=(s=e==null?void 0:e.requireImagePing)!==null&&s!==void 0?s:!1}sendPing(e){const t=this.generateTrackingUrl(e).toString();if(this.requireImagePing){this.sendPingViaImage(t);return}const i=navigator.sendBeacon&&navigator.sendBeacon.bind(navigator);try{i(t)}catch{this.sendPingViaImage(t)}}sendEvent(e){const t=e.label&&e.label.trim().length>0?e.label:window.location.pathname,i=q({kind:"event",ec:e.category,ea:e.action,el:t,cache_bust:Math.random()},e.eventConfiguration);this.sendPing(i)}sendEventNoSampling(e){const t=e.eventConfiguration||{};t.service=this.NO_SAMPLING_SERVICE;const i=e;i.eventConfiguration=t,this.sendEvent(i)}sendPingViaImage(e){const t=new Image(1,1);t.src=e,t.alt="",this.imageContainer.appendChild(t)}generateTrackingUrl(e){var t;const i=e!=null?e:{};i.service=(t=i.service)!==null&&t!==void 0?t:this.defaultService;const o=new URL(this.imageUrl),s=Object.keys(i);return s.forEach(n=>{const l=i[n];o.searchParams.append(n,l)}),o.searchParams.append("version",`${this.ARCHIVE_ANALYTICS_VERSION}`),o.searchParams.append("count",`${s.length+2}`),o}}function g(a){let e,t,i;return typeof a=="object"?(e=a.hashFunction,t=a.expiring,i=a.tags):e=a,(o,s,n)=>{if(n.value!=null)n.value=bs(n.value,e,t,i);else if(n.get!=null)n.get=bs(n.get,e,t,i);else throw"Only put a Memoize() decorator on a method or get accessor."}}const So=new Map;function bs(a,e,t=0,i){const o=Symbol("__memoized_map__");return function(...s){let n;this.hasOwnProperty(o)||Object.defineProperty(this,o,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let l=this[o];if(Array.isArray(i))for(const d of i)So.has(d)?So.get(d).push(l):So.set(d,[l]);if(e||s.length>0||t>0){let d;e===!0?d=s.map(m=>m.toString()).join("!"):e?d=e.apply(this,s):d=s[0];const p=`${d}__timestamp`;let f=!1;if(t>0)if(!l.has(p))f=!0;else{let m=l.get(p);f=Date.now()-m>t}l.has(d)&&!f?n=l.get(d):(n=a.apply(this,s),l.set(d,n),t>0&&l.set(p,Date.now()))}else{const d=this;l.has(d)?n=l.get(d):(n=a.apply(this,s),l.set(d,n))}return n}}class Jo{parseValue(e){return typeof e=="string"&&(e==="false"||e==="0")?!1:Boolean(e)}}Jo.shared=new Jo;class Hi{parseValue(e){if(typeof e=="number")return e;if(typeof e=="boolean")return;const t=parseFloat(e);if(!Number.isNaN(t))return t}}Hi.shared=new Hi;class ea{parseValue(e){return Hi.shared.parseValue(e)}}ea.shared=new ea;class ta{parseValue(e){return this.parseJSDate(e)||this.parseBracketDate(e)}parseBracketDate(e){if(typeof e!="string")return;const t=e.match(/\[([0-9]{4})\]/);if(!(!t||t.length<2))return this.parseJSDate(t[1])}parseJSDate(e){if(typeof e!="string")return;let t=e;t.match(/^[0-9]{4}-[0-9]{2}-[0-9]{2}\s{1}[0-9]{2}:[0-9]{2}:[0-9]{2}$/)&&(t=t.replace(" ","T"));const i=Date.parse(t);if(Number.isNaN(i))return;let o=new Date(t);return(t.indexOf("Z")>-1||t.indexOf("+")>-1||t.match(/^[0-9]{4}$/)||t.match(/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/)||t.match(/^.*?-[0-9]{2}:[0-9]{2}$/)||t.match(/^.*?-[0-9]{4}$/))&&(o=new Date(o.getTime()+o.getTimezoneOffset()*1e3*60)),o}}ta.shared=new ta;class ia{parseValue(e){if(typeof e=="number")return e;if(typeof e=="boolean")return;const t=e.split(":");let i;return t.length===1?i=this.parseNumberFormat(t[0]):i=this.parseColonSeparatedFormat(t),i}parseNumberFormat(e){let t=parseFloat(e);return Number.isNaN(t)&&(t=void 0),t}parseColonSeparatedFormat(e){let t=!1;const i=e.map((o,s)=>{const n=parseFloat(o);if(Number.isNaN(n))return t=!0,0;const l=e.length-1-s,d=60**l;return n*Math.floor(d)}).reduce((o,s)=>o+s,0);return t?void 0:i}}ia.shared=new ia;class oa{parseValue(e){if(typeof e=="string")return e}}oa.shared=new oa;class Dn{constructor(e,t){this.separators=[";",","],this.parser=e,t&&t.separators&&(this.separators=t.separators)}parseValue(e){const t=String(e);let i=[];for(const o of this.separators)if(i=t.split(o),i.length>1)break;return this.parseListValues(i)}parseListValues(e){const i=e.map(s=>s.trim()).map(s=>this.parser.parseValue(s)),o=[];return i.forEach(s=>{s!==void 0&&o.push(s)}),o}}class aa{parseValue(e){if(typeof e=="string")return e}}aa.shared=new aa;class Vi{parseValue(e){return String(e)}}Vi.shared=new Vi;class De{constructor(e,t){this.parser=e,this.rawValue=t}get values(){return this.parseRawValue()}get value(){return this.values[0]}parseRawValue(){if(this.rawValue===void 0)return[];const e=Array.isArray(this.rawValue)?this.rawValue:[this.rawValue],t=[];return e.forEach(i=>{const o=this.parser.parseValue(i);Array.isArray(o)?t.push(...o):o!==void 0&&t.push(o)}),t}}r([g()],De.prototype,"values",null);r([g()],De.prototype,"value",null);class vt extends De{constructor(e){super(Jo.shared,e)}}class V extends De{constructor(e){super(ta.shared,e)}}class $o extends De{constructor(e){super(ia.shared,e)}}class N extends De{constructor(e){super(Hi.shared,e)}}class $ extends De{constructor(e){super(Vi.shared,e)}}class Rn extends De{constructor(e){super(aa.shared,e)}}class Wi extends De{constructor(e){super(ea.shared,e)}}class xi extends De{constructor(e){super(oa.shared,e)}}class Fn extends De{constructor(e,t){super(t,e)}}class Bn extends Fn{constructor(e){const t=new Dn(Vi.shared);super(e,t)}}class M{constructor(e){this.rawMetadata=e}get identifier(){var e;return(e=this.rawMetadata)===null||e===void 0?void 0:e.identifier}get addeddate(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.addeddate?new V(this.rawMetadata.addeddate):void 0}get audio_codec(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.audio_codec?new $(this.rawMetadata.audio_codec):void 0}get audio_sample_rate(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.audio_sample_rate?new N(this.rawMetadata.audio_sample_rate):void 0}get avg_rating(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.avg_rating?new N(this.rawMetadata.avg_rating):void 0}get collection(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.collection?new $(this.rawMetadata.collection):void 0}get collections_raw(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.collections_raw?new $(this.rawMetadata.collections_raw):void 0}get collection_size(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.collection_size?new Wi(this.rawMetadata.collection_size):void 0}get contributor(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.contributor?new $(this.rawMetadata.contributor):void 0}get coverage(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.coverage?new $(this.rawMetadata.coverage):void 0}get creator(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.creator?new $(this.rawMetadata.creator):void 0}get date(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.date?new V(this.rawMetadata.date):void 0}get description(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.description?new $(this.rawMetadata.description):void 0}get downloads(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.downloads?new N(this.rawMetadata.downloads):void 0}get duration(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.duration?new $o(this.rawMetadata.duration):void 0}get"external-identifier"(){var e,t;return!((e=this.rawMetadata)===null||e===void 0)&&e["external-identifier"]?new $((t=this.rawMetadata)===null||t===void 0?void 0:t["external-identifier"]):void 0}get files_count(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.files_count?new N(this.rawMetadata.files_count):void 0}get indexdate(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.indexdate?new V(this.rawMetadata.indexdate):void 0}get isbn(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.isbn?new $(this.rawMetadata.isbn):void 0}get issue(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.issue?new $(this.rawMetadata.issue):void 0}get item_count(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.item_count?new N(this.rawMetadata.item_count):void 0}get item_size(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.item_size?new Wi(this.rawMetadata.item_size):void 0}get language(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.language?new $(this.rawMetadata.language):void 0}get length(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.length?new $o(this.rawMetadata.length):void 0}get lineage(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.lineage?new $(this.rawMetadata.lineage):void 0}get month(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.month?new N(this.rawMetadata.month):void 0}get mediatype(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.mediatype?new xi(this.rawMetadata.mediatype):void 0}get noindex(){var e;return((e=this.rawMetadata)===null||e===void 0?void 0:e.noindex)!=null?new vt(this.rawMetadata.noindex):void 0}get notes(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.notes?new $(this.rawMetadata.notes):void 0}get num_favorites(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.num_favorites?new N(this.rawMetadata.num_favorites):void 0}get num_reviews(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.num_reviews?new N(this.rawMetadata.num_reviews):void 0}get openlibrary_edition(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.openlibrary_edition?new $(this.rawMetadata.openlibrary_edition):void 0}get openlibrary_work(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.openlibrary_work?new $(this.rawMetadata.openlibrary_work):void 0}get page_progression(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.page_progression?new Rn(this.rawMetadata.page_progression):void 0}get partner(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.partner?new $(this.rawMetadata.partner):void 0}get ppi(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.ppi?new N(this.rawMetadata.ppi):void 0}get publicdate(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.publicdate?new V(this.rawMetadata.publicdate):void 0}get publisher(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.publisher?new $(this.rawMetadata.publisher):void 0}get reviewdate(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.reviewdate?new V(this.rawMetadata.reviewdate):void 0}get runtime(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.runtime?new $o(this.rawMetadata.runtime):void 0}get scanner(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.scanner?new $(this.rawMetadata.scanner):void 0}get source(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.source?new $(this.rawMetadata.source):void 0}get start_localtime(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.start_localtime?new V(this.rawMetadata.start_localtime):void 0}get start_time(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.start_time?new V(this.rawMetadata.start_time):void 0}get stop_time(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.stop_time?new V(this.rawMetadata.stop_time):void 0}get subject(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.subject?new Bn(this.rawMetadata.subject):void 0}get taper(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.taper?new $(this.rawMetadata.taper):void 0}get title(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.title?new $(this.rawMetadata.title):void 0}get transferer(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.transferer?new $(this.rawMetadata.transferer):void 0}get track(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.track?new N(this.rawMetadata.track):void 0}get type(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.type?new $(this.rawMetadata.type):void 0}get uploader(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.uploader?new $(this.rawMetadata.uploader):void 0}get utc_offset(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.utc_offset?new N(this.rawMetadata.utc_offset):void 0}get venue(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.venue?new $(this.rawMetadata.venue):void 0}get volume(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.volume?new $(this.rawMetadata.volume):void 0}get week(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.week?new N(this.rawMetadata.week):void 0}get year(){var e;return!((e=this.rawMetadata)===null||e===void 0)&&e.year?new V(this.rawMetadata.year):void 0}get query(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.query?new $(this.rawMetadata.fields.query):void 0}get date_favorited(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.date_favorited?new V(this.rawMetadata.fields.date_favorited):void 0}get __href__(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.__href__?new $(this.rawMetadata.fields.__href__):void 0}}r([g()],M.prototype,"addeddate",null);r([g()],M.prototype,"audio_codec",null);r([g()],M.prototype,"audio_sample_rate",null);r([g()],M.prototype,"avg_rating",null);r([g()],M.prototype,"collection",null);r([g()],M.prototype,"collections_raw",null);r([g()],M.prototype,"collection_size",null);r([g()],M.prototype,"contributor",null);r([g()],M.prototype,"coverage",null);r([g()],M.prototype,"creator",null);r([g()],M.prototype,"date",null);r([g()],M.prototype,"description",null);r([g()],M.prototype,"downloads",null);r([g()],M.prototype,"duration",null);r([g()],M.prototype,"external-identifier",null);r([g()],M.prototype,"files_count",null);r([g()],M.prototype,"indexdate",null);r([g()],M.prototype,"isbn",null);r([g()],M.prototype,"issue",null);r([g()],M.prototype,"item_count",null);r([g()],M.prototype,"item_size",null);r([g()],M.prototype,"language",null);r([g()],M.prototype,"length",null);r([g()],M.prototype,"lineage",null);r([g()],M.prototype,"month",null);r([g()],M.prototype,"mediatype",null);r([g()],M.prototype,"noindex",null);r([g()],M.prototype,"notes",null);r([g()],M.prototype,"num_favorites",null);r([g()],M.prototype,"num_reviews",null);r([g()],M.prototype,"openlibrary_edition",null);r([g()],M.prototype,"openlibrary_work",null);r([g()],M.prototype,"page_progression",null);r([g()],M.prototype,"partner",null);r([g()],M.prototype,"ppi",null);r([g()],M.prototype,"publicdate",null);r([g()],M.prototype,"publisher",null);r([g()],M.prototype,"reviewdate",null);r([g()],M.prototype,"runtime",null);r([g()],M.prototype,"scanner",null);r([g()],M.prototype,"source",null);r([g()],M.prototype,"start_localtime",null);r([g()],M.prototype,"start_time",null);r([g()],M.prototype,"stop_time",null);r([g()],M.prototype,"subject",null);r([g()],M.prototype,"taper",null);r([g()],M.prototype,"title",null);r([g()],M.prototype,"transferer",null);r([g()],M.prototype,"track",null);r([g()],M.prototype,"type",null);r([g()],M.prototype,"uploader",null);r([g()],M.prototype,"utc_offset",null);r([g()],M.prototype,"venue",null);r([g()],M.prototype,"volume",null);r([g()],M.prototype,"week",null);r([g()],M.prototype,"year",null);r([g()],M.prototype,"query",null);r([g()],M.prototype,"date_favorited",null);r([g()],M.prototype,"__href__",null);class O{constructor(e){this.rawMetadata=e}get identifier(){var e,t;return(t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0?void 0:t.identifier}get addeddate(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.addeddate?new V(this.rawMetadata.fields.addeddate):void 0}get avg_rating(){var e,t;return((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0?void 0:t.avg_rating)!=null?new N(this.rawMetadata.fields.avg_rating):void 0}get collection(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.collection?new $(this.rawMetadata.fields.collection):void 0}get collection_files_count(){var e,t;return((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0?void 0:t.collection_files_count)!=null?new N(this.rawMetadata.fields.collection_files_count):void 0}get collection_size(){var e,t;return((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0?void 0:t.collection_size)!=null?new Wi(this.rawMetadata.fields.collection_size):void 0}get creator(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.creator?new $(this.rawMetadata.fields.creator):void 0}get date(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.date?new V(this.rawMetadata.fields.date):void 0}get description(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.description?new $(this.rawMetadata.fields.description):void 0}get downloads(){var e,t;return((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0?void 0:t.downloads)!=null?new N(this.rawMetadata.fields.downloads):void 0}get files_count(){var e,t;return((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0?void 0:t.files_count)!=null?new N(this.rawMetadata.fields.files_count):void 0}get genre(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.genre?new $(this.rawMetadata.fields.genre):void 0}get indexflag(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.indexflag?new $(this.rawMetadata.fields.indexflag):void 0}get issue(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.issue?new $(this.rawMetadata.fields.issue):void 0}get item_count(){var e,t;return((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0?void 0:t.item_count)!=null?new N(this.rawMetadata.fields.item_count):void 0}get item_size(){var e,t;return((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0?void 0:t.item_size)!=null?new Wi(this.rawMetadata.fields.item_size):void 0}get language(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.language?new $(this.rawMetadata.fields.language):void 0}get lending___available_to_borrow(){var e,t;return((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0?void 0:t.lending___available_to_borrow)!=null?new vt(this.rawMetadata.fields.lending___available_to_borrow):void 0}get lending___available_to_browse(){var e,t;return((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0?void 0:t.lending___available_to_browse)!=null?new vt(this.rawMetadata.fields.lending___available_to_browse):void 0}get lending___available_to_waitlist(){var e,t;return((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0?void 0:t.lending___available_to_waitlist)!=null?new vt(this.rawMetadata.fields.lending___available_to_waitlist):void 0}get lending___status(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.lending___status?new $(this.rawMetadata.fields.lending___status):void 0}get licenseurl(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.licenseurl?new $(this.rawMetadata.fields.licenseurl):void 0}get mediatype(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.mediatype?new xi(this.rawMetadata.fields.mediatype):void 0}get month(){var e,t;return((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0?void 0:t.month)!=null?new N(this.rawMetadata.fields.month):void 0}get noindex(){var e,t;return((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0?void 0:t.noindex)!=null?new vt(this.rawMetadata.fields.noindex):void 0}get num_favorites(){var e,t;return((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0?void 0:t.num_favorites)!=null?new N(this.rawMetadata.fields.num_favorites):void 0}get num_reviews(){var e,t;return((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0?void 0:t.num_reviews)!=null?new N(this.rawMetadata.fields.num_reviews):void 0}get publicdate(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.publicdate?new V(this.rawMetadata.fields.publicdate):void 0}get reviewdate(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.reviewdate?new V(this.rawMetadata.fields.reviewdate):void 0}get review(){var e;const t=(e=this.rawMetadata)===null||e===void 0?void 0:e.review;return t?{body:t.reviewbody,title:t.reviewtitle,author:t.reviewer,authorItem:t.reviewer_itemname,updatedate:new Date(t.reviewdate),createdate:new Date(t.createdate),stars:Number(t.stars)||0,__href__:t.__href__}:void 0}get source(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.source?new $(this.rawMetadata.fields.source):void 0}get subject(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.subject?new $(this.rawMetadata.fields.subject):void 0}get title(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.title?new $(this.rawMetadata.fields.title):void 0}get type(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.type?new $(this.rawMetadata.fields.type):void 0}get volume(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.volume?new $(this.rawMetadata.fields.volume):void 0}get week(){var e,t;return((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0?void 0:t.week)!=null?new N(this.rawMetadata.fields.week):void 0}get year(){var e,t;return((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0?void 0:t.year)!=null?new N(this.rawMetadata.fields.year):void 0}}r([g()],O.prototype,"addeddate",null);r([g()],O.prototype,"avg_rating",null);r([g()],O.prototype,"collection",null);r([g()],O.prototype,"collection_files_count",null);r([g()],O.prototype,"collection_size",null);r([g()],O.prototype,"creator",null);r([g()],O.prototype,"date",null);r([g()],O.prototype,"description",null);r([g()],O.prototype,"downloads",null);r([g()],O.prototype,"files_count",null);r([g()],O.prototype,"genre",null);r([g()],O.prototype,"indexflag",null);r([g()],O.prototype,"issue",null);r([g()],O.prototype,"item_count",null);r([g()],O.prototype,"item_size",null);r([g()],O.prototype,"language",null);r([g()],O.prototype,"lending___available_to_borrow",null);r([g()],O.prototype,"lending___available_to_browse",null);r([g()],O.prototype,"lending___available_to_waitlist",null);r([g()],O.prototype,"lending___status",null);r([g()],O.prototype,"licenseurl",null);r([g()],O.prototype,"mediatype",null);r([g()],O.prototype,"month",null);r([g()],O.prototype,"noindex",null);r([g()],O.prototype,"num_favorites",null);r([g()],O.prototype,"num_reviews",null);r([g()],O.prototype,"publicdate",null);r([g()],O.prototype,"reviewdate",null);r([g()],O.prototype,"review",null);r([g()],O.prototype,"source",null);r([g()],O.prototype,"subject",null);r([g()],O.prototype,"title",null);r([g()],O.prototype,"type",null);r([g()],O.prototype,"volume",null);r([g()],O.prototype,"week",null);r([g()],O.prototype,"year",null);class Y{constructor(e){this.rawMetadata=e}get identifier(){var e,t;return(t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0?void 0:t.identifier}get highlight(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.highlight)===null||t===void 0)&&t.text?new $(this.rawMetadata.highlight.text):void 0}get addeddate(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.addeddate?new V(this.rawMetadata.fields.addeddate):void 0}get avg_rating(){var e,t;return((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0?void 0:t.avg_rating)!=null?new N(this.rawMetadata.fields.avg_rating):void 0}get collection(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.collection?new $(this.rawMetadata.fields.collection):void 0}get created_on(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.created_on?new V(this.rawMetadata.fields.created_on):void 0}get creator(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.creator?new $(this.rawMetadata.fields.creator):void 0}get date(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.date?new V(this.rawMetadata.fields.date):void 0}get description(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.description?new $(this.rawMetadata.fields.description):void 0}get downloads(){var e,t;return((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0?void 0:t.downloads)!=null?new N(this.rawMetadata.fields.downloads):void 0}get filename(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.filename?new $(this.rawMetadata.fields.filename):void 0}get file_basename(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.file_basename?new $(this.rawMetadata.fields.file_basename):void 0}get file_creation_mtime(){var e,t;return((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0?void 0:t.file_creation_mtime)!=null?new N(this.rawMetadata.fields.file_creation_mtime):void 0}get issue(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.issue?new $(this.rawMetadata.fields.issue):void 0}get mediatype(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.mediatype?new xi(this.rawMetadata.fields.mediatype):void 0}get page_num(){var e,t;return((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0?void 0:t.page_num)!=null?new N(this.rawMetadata.fields.page_num):void 0}get publicdate(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.publicdate?new V(this.rawMetadata.fields.publicdate):void 0}get result_in_subfile(){var e,t;return((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0?void 0:t.result_in_subfile)!=null?new vt(this.rawMetadata.fields.result_in_subfile):void 0}get reviewdate(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.reviewdate?new V(this.rawMetadata.fields.reviewdate):void 0}get source(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.source?new $(this.rawMetadata.fields.source):void 0}get subject(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.subject?new $(this.rawMetadata.fields.subject):void 0}get title(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.title?new $(this.rawMetadata.fields.title):void 0}get updated_on(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.updated_on?new V(this.rawMetadata.fields.updated_on):void 0}get year(){var e,t;return((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0?void 0:t.year)!=null?new N(this.rawMetadata.fields.year):void 0}get __href__(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.__href__?new $(this.rawMetadata.fields.__href__):void 0}}r([g()],Y.prototype,"highlight",null);r([g()],Y.prototype,"addeddate",null);r([g()],Y.prototype,"avg_rating",null);r([g()],Y.prototype,"collection",null);r([g()],Y.prototype,"created_on",null);r([g()],Y.prototype,"creator",null);r([g()],Y.prototype,"date",null);r([g()],Y.prototype,"description",null);r([g()],Y.prototype,"downloads",null);r([g()],Y.prototype,"filename",null);r([g()],Y.prototype,"file_basename",null);r([g()],Y.prototype,"file_creation_mtime",null);r([g()],Y.prototype,"issue",null);r([g()],Y.prototype,"mediatype",null);r([g()],Y.prototype,"page_num",null);r([g()],Y.prototype,"publicdate",null);r([g()],Y.prototype,"result_in_subfile",null);r([g()],Y.prototype,"reviewdate",null);r([g()],Y.prototype,"source",null);r([g()],Y.prototype,"subject",null);r([g()],Y.prototype,"title",null);r([g()],Y.prototype,"updated_on",null);r([g()],Y.prototype,"year",null);r([g()],Y.prototype,"__href__",null);var K;(function(a){a[a.COUNT=0]="COUNT",a[a.ALPHABETICAL=1]="ALPHABETICAL",a[a.NUMERIC=2]="NUMERIC"})(K||(K={}));class Cr{constructor(e){this.buckets=e.buckets,this.doc_count_error_upper_bound=e.doc_count_error_upper_bound,this.sum_other_doc_count=e.sum_other_doc_count,this.first_bucket_key=e.first_bucket_key,this.last_bucket_key=e.last_bucket_key,this.number_buckets=e.number_buckets,this.interval=e.interval}getSortedBuckets(e){const t=[...this.buckets];if(this.isRawNumberBuckets(t))return t;const i=new Intl.Collator;switch(e){case K.ALPHABETICAL:return t.sort((o,s)=>i.compare(o.key.toString(),s.key.toString()));case K.NUMERIC:return t.sort((o,s)=>Number(s.key)-Number(o.key));case K.COUNT:default:return t}}isRawNumberBuckets(e){return typeof this.buckets[0]=="number"}}r([g()],Cr.prototype,"getSortedBuckets",null);class Si{constructor(e){this.rawMetadata=e}get identifier(){var e;return(e=this.rawMetadata)===null||e===void 0?void 0:e.fields.query}get title(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.title?new $(this.rawMetadata.fields.title):void 0}get query(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.query?new $(this.rawMetadata.fields.query):void 0}get date_favorited(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.date_favorited?new V(this.rawMetadata.fields.date_favorited):void 0}get __href__(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.__href__?new $(this.rawMetadata.fields.__href__):void 0}}r([g()],Si.prototype,"title",null);r([g()],Si.prototype,"query",null);r([g()],Si.prototype,"date_favorited",null);r([g()],Si.prototype,"__href__",null);class oo{constructor(e){this.rawMetadata=e}get identifier(){var e,t;return(t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0?void 0:t.url}get mediatype(){return new xi("web")}get title(){var e,t,i;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.url?new $((i=this.rawMetadata.fields)===null||i===void 0?void 0:i.url):void 0}get capture_dates(){var e,t,i;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.capture_dates?new V((i=this.rawMetadata.fields)===null||i===void 0?void 0:i.capture_dates):void 0}get __href__(){var e,t,i;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.__href__?new $((i=this.rawMetadata.fields)===null||i===void 0?void 0:i.__href__):void 0}}r([g()],oo.prototype,"title",null);r([g()],oo.prototype,"capture_dates",null);r([g()],oo.prototype,"__href__",null);class X{constructor(e){this.rawMetadata=e}get identifier(){var e,t;return(t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0?void 0:t.identifier}get highlight(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.highlight)===null||t===void 0)&&t.text?new $(this.rawMetadata.highlight.text):void 0}get addeddate(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.addeddate?new V(this.rawMetadata.fields.addeddate):void 0}get avg_rating(){var e,t,i;const o=(t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0?void 0:t.avg_rating;return o||o===0?new N((i=this.rawMetadata)===null||i===void 0?void 0:i.fields.avg_rating):void 0}get collection(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.collection?new $(this.rawMetadata.fields.collection):void 0}get created_on(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.created_on?new V(this.rawMetadata.fields.created_on):void 0}get creator(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.creator?new $(this.rawMetadata.fields.creator):void 0}get date(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.date?new V(this.rawMetadata.fields.date):void 0}get description(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.description?new $(this.rawMetadata.fields.description):void 0}get downloads(){var e,t,i;const o=(t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0?void 0:t.downloads;return o||o===0?new N((i=this.rawMetadata)===null||i===void 0?void 0:i.fields.downloads):void 0}get filename(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.filename?new $(this.rawMetadata.fields.filename):void 0}get file_basename(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.file_basename?new $(this.rawMetadata.fields.file_basename):void 0}get file_creation_mtime(){var e,t,i;const o=(t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0?void 0:t.file_creation_mtime;return o||o===0?new N((i=this.rawMetadata)===null||i===void 0?void 0:i.fields.file_creation_mtime):void 0}get issue(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.issue?new $(this.rawMetadata.fields.issue):void 0}get mediatype(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.mediatype?new xi(this.rawMetadata.fields.mediatype):void 0}get publicdate(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.publicdate?new V(this.rawMetadata.fields.publicdate):void 0}get result_in_subfile(){var e,t,i;const o=(t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0?void 0:t.result_in_subfile;return o||o===!1?new vt((i=this.rawMetadata)===null||i===void 0?void 0:i.fields.result_in_subfile):void 0}get reviewdate(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.reviewdate?new V(this.rawMetadata.fields.reviewdate):void 0}get source(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.source?new $(this.rawMetadata.fields.source):void 0}get subject(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.subject?new $(this.rawMetadata.fields.subject):void 0}get title(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.title?new $(this.rawMetadata.fields.title):void 0}get updated_on(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.updated_on?new V(this.rawMetadata.fields.updated_on):void 0}get year(){var e,t,i;const o=(t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0?void 0:t.year;return o||o===0?new N((i=this.rawMetadata)===null||i===void 0?void 0:i.fields.year):void 0}get start(){var e,t,i;const o=(t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0?void 0:t.start;return o||o===0?new $((i=this.rawMetadata)===null||i===void 0?void 0:i.fields.start):void 0}get __href__(){var e,t;return!((t=(e=this.rawMetadata)===null||e===void 0?void 0:e.fields)===null||t===void 0)&&t.__href__?new $(this.rawMetadata.fields.__href__):void 0}}r([g()],X.prototype,"highlight",null);r([g()],X.prototype,"addeddate",null);r([g()],X.prototype,"avg_rating",null);r([g()],X.prototype,"collection",null);r([g()],X.prototype,"created_on",null);r([g()],X.prototype,"creator",null);r([g()],X.prototype,"date",null);r([g()],X.prototype,"description",null);r([g()],X.prototype,"downloads",null);r([g()],X.prototype,"filename",null);r([g()],X.prototype,"file_basename",null);r([g()],X.prototype,"file_creation_mtime",null);r([g()],X.prototype,"issue",null);r([g()],X.prototype,"mediatype",null);r([g()],X.prototype,"publicdate",null);r([g()],X.prototype,"result_in_subfile",null);r([g()],X.prototype,"reviewdate",null);r([g()],X.prototype,"source",null);r([g()],X.prototype,"subject",null);r([g()],X.prototype,"title",null);r([g()],X.prototype,"updated_on",null);r([g()],X.prototype,"year",null);r([g()],X.prototype,"start",null);r([g()],X.prototype,"__href__",null);const On=["loans","waitlist","loan_history"];function In(a){const e=a.slice(0,4),t=a.slice(4,6),i=a.slice(6,8),o=a.slice(8,10),s=a.slice(10,12),n=a.slice(12,14);return`${e}-${t}-${i}T${o}:${s}:${n}Z`}function Un(a){var e;const t=[];for(const i of a){if(!(!((e=i.captures)===null||e===void 0)&&e.length))continue;const o=encodeURIComponent(i.url),s=`https://web.archive.org/web/${i.captures[0]}/${o}`;t.push({hit_type:"web_archive",fields:{url:i.url,capture_dates:i.captures.map(n=>In(n)),__href__:s}})}return t}class Pa{constructor(e,t){var i,o,s,n,l,d,p,f,m,y,w,x,C,A;this.schema=t,this.schemaHitType=t==null?void 0:t.hit_type;let F;e!=null&&e.page_elements&&(this.pageElements=e.page_elements,F=Object.values(this.pageElements)[0]);let R=(i=e==null?void 0:e.hits)===null||i===void 0?void 0:i.hits;this.totalResults=(s=(o=e==null?void 0:e.hits)===null||o===void 0?void 0:o.total)!==null&&s!==void 0?s:0,this.returnedCount=(l=(n=e==null?void 0:e.hits)===null||n===void 0?void 0:n.returned)!==null&&l!==void 0?l:0,!(R!=null&&R.length)&&((d=this.pageElements)===null||d===void 0?void 0:d.service___fts)?(this.totalResults=0,this.returnedCount=0,this.handleFederatedPageElements()):!(R!=null&&R.length)&&((p=F==null?void 0:F.hits)===null||p===void 0?void 0:p.hits)?(R=F.hits.hits,this.totalResults=(f=F.hits.total)!==null&&f!==void 0?f:0,this.returnedCount=(m=F.hits.returned)!==null&&m!==void 0?m:0):!((y=this.pageElements)===null||y===void 0)&&y.lending?R=this.handleLendingPageElement():!((w=this.pageElements)===null||w===void 0)&&w.web_archives&&(R=this.handleWebArchivesPageElement()),this.results=this.formatHits(R);let W=e==null?void 0:e.aggregations;!(this.aggregations&&Object.keys(this.aggregations).length>0)&&(F==null?void 0:F.aggregations)&&(W=F.aggregations),W&&this.buildAggregations(W),e!=null&&e.collection_titles&&(this.collectionTitles=(x=e.collection_titles)!==null&&x!==void 0?x:{}),e!=null&&e.collection_extra_info&&(this.collectionExtraInfo=(C=e.collection_extra_info)!==null&&C!==void 0?C:null),e!=null&&e.account_extra_info&&(this.accountExtraInfo=(A=e.account_extra_info)!==null&&A!==void 0?A:null)}formatHits(e){var t;return(t=e==null?void 0:e.map(i=>{var o;return Pa.createResult((o=i.hit_type)!==null&&o!==void 0?o:this.schemaHitType,i)}))!==null&&t!==void 0?t:[]}buildAggregations(e){this.aggregations=Object.entries(e).reduce((t,[i,o])=>(t[i]=new Cr(o),t),{})}handleLendingPageElement(){var e,t;const i=(e=this.pageElements)===null||e===void 0?void 0:e.lending,o=(t=i.loans)!==null&&t!==void 0?t:[];this.totalResults=o.length,this.returnedCount=this.totalResults;for(const s of On)i[s]=this.formatHits(i[s]);return o}handleWebArchivesPageElement(){var e;const t=Un((e=this.pageElements)===null||e===void 0?void 0:e.web_archives);return this.totalResults=t.length,this.returnedCount=this.totalResults,t}handleFederatedPageElements(){var e,t,i,o;const s=["service___fts","service___tvs","service___rcs","service___whisper"];for(const n of s){const l=this.removeServicePrefix(n);this.federatedResults?this.federatedResults[n]=[]:this.federatedResults={[l]:[]};const d=(t=(e=this.pageElements)===null||e===void 0?void 0:e[n])===null||t===void 0?void 0:t.hits;d!=null&&d.hits&&(this.federatedResults[l]=this.formatHits(d==null?void 0:d.hits)),this.totalResults+=(i=d==null?void 0:d.total)!==null&&i!==void 0?i:0,this.returnedCount+=(o=d==null?void 0:d.returned)!==null&&o!==void 0?o:0}}removeServicePrefix(e){return e.split("___")[1]}static createResult(e,t){switch(e){case"item":return new O(t);case"text":case"asr_text":return new Y(t);case"favorited_search":return new Si(t);case"web_archive":return new oo(t);case"tv_clip":return new X(t);default:return new O(t)}}}class Nn{constructor(e){this.clientParameters=e.client_parameters,this.backendRequests=e.backend_requests,this.kind=e.kind}}class Hn{constructor(e){var t,i,o;this.rawResponse=e,this.request=new Nn(e.request),this.responseHeader=(t=e.response)===null||t===void 0?void 0:t.header,this.sessionContext=e.session_context,this.response=new Pa((i=e.response)===null||i===void 0?void 0:i.body,(o=e.response)===null||o===void 0?void 0:o.hit_schema)}}class ao{static aggregateSearchParamsAsString(e){if(e.omit)return"false";if(e.advancedParams){const t=e.advancedParams.map(o=>({terms:o}));return JSON.stringify(t)}if(e.simpleParams)return e.simpleParams.join(",")}static sortParamsAsString(e){return`${e.field}:${e.direction}`}static filterParamsAsString(e){return JSON.stringify(e)}static generateURLSearchParams(e){const t=new URLSearchParams;if(t.append("user_query",e.query),e.pageType&&t.append("page_type",String(e.pageType)),e.pageTarget&&t.append("page_target",String(e.pageTarget)),e.pageElements&&e.pageElements.length>0){const s=`[${e.pageElements.map(n=>`"${n}"`).join(",")}]`;t.append("page_elements",s)}if(e.rows!=null&&t.append("hits_per_page",String(e.rows)),e.page!=null&&t.append("page",String(e.page)),e.fields&&e.fields.length>0&&t.append("fields",e.fields.join(",")),e.filters&&Object.keys(e.filters).length>0){const o=this.filterParamsAsString(e.filters);o&&o!=="{}"&&t.append("filter_map",o)}if(e.sort&&e.sort.length>0){const o=e.sort.map(s=>this.sortParamsAsString(s));t.append("sort",o.join(","))}const i=e.aggregations;if(i){const o=this.aggregateSearchParamsAsString(i);o&&t.append("aggregations",o)}if(e.aggregationsSize!=null&&t.append("aggregations_size",String(e.aggregationsSize)),e.debugging&&t.append("debugging","true"),e.uid&&t.append("uid",e.uid),e.includeClientUrl!==!1){const o=window.location.href.slice(0,400);e.query.length<=1e3&&t.append("client_url",o)}return t}}var di;(function(a){a.networkError="SearchService.NetworkError",a.itemNotFound="SearchService.ItemNotFound",a.decodingError="SearchService.DecodingError",a.searchEngineError="SearchService.SearchEngineError"})(di||(di={}));class Vn extends Error{constructor(e,t,i){super(t),this.name=e,this.type=e,this.details=i}}const ys={reCache:JSON.stringify({recompute:!0}),noCache:JSON.stringify({bypass:!0}),dontCache:JSON.stringify({no_compute:!0})};class so{constructor(e){var t,i;this.baseUrl=(t=e==null?void 0:e.baseUrl)!==null&&t!==void 0?t:"archive.org",(e==null?void 0:e.includeCredentials)!==void 0?this.includeCredentials=e.includeCredentials:this.includeCredentials=window.location.href.match(/^https?:\/\/.*archive\.org(:[0-9]+)?/)!==null;const o=new URL(window.location.href).searchParams,s=o.get("scope"),n=o.get("verbose"),l=o.get("debugging"),d=o.get("cacheDebug");let p="";for(const f of Object.keys(ys))if(o.get(f)){p=ys[f];break}p=(i=o.get("caching"))!==null&&i!==void 0?i:p,(e==null?void 0:e.caching)!==void 0?this.cachingFlags=e.caching:p&&(this.cachingFlags=p),(e==null?void 0:e.debuggingEnabled)!==void 0?this.debuggingEnabled=e.debuggingEnabled:(l||d)&&(this.debuggingEnabled=!0),(e==null?void 0:e.scope)!==void 0?this.requestScope=e.scope:s&&(this.requestScope=s),(e==null?void 0:e.verbose)!==void 0?this.verbose=e.verbose:n&&(this.verbose=!!n)}async fetchUrl(e,t){var i,o;const s=new URL(e);this.requestScope&&s.searchParams.set("scope",this.requestScope),this.cachingFlags&&s.searchParams.set("caching",this.cachingFlags);let n;try{const l=(i=t==null?void 0:t.requestOptions)!==null&&i!==void 0?i:{credentials:this.includeCredentials?"include":"same-origin"};n=await fetch(s.href,l)}catch(l){const d=l instanceof Error?l.message:typeof l=="string"?l:"Unknown error";return this.getErrorResult(di.networkError,d)}try{const l=await n.json();this.verbose&&this.printResponse(l),l.debugging&&this.printDebuggingInfo(l);const d=(o=l.response)===null||o===void 0?void 0:o.error;return d?this.getErrorResult(di.searchEngineError,d.message,d.forensics):{success:l}}catch(l){const d=l instanceof Error?l.message:typeof l=="string"?l:"Unknown error";return this.getErrorResult(di.decodingError,d)}}getErrorResult(e,t,i){return{error:new Vn(e,t,i)}}printResponse(e){var t,i,o,s,n;try{const l=JSON.parse(JSON.stringify(e)),d=(o=(i=(t=l==null?void 0:l.response)===null||t===void 0?void 0:t.body)===null||i===void 0?void 0:i.hits)===null||o===void 0?void 0:o.hits;if(Array.isArray(d)&&d.length>1){const f=[];f.push(d[0]),f.push(`*** ${d.length-1} hits omitted ***`),l.response.body.hits.hits=f}const p=(n=(s=l==null?void 0:l.response)===null||s===void 0?void 0:s.body)===null||n===void 0?void 0:n.aggregations;p&&Object.entries(p).forEach(([f,m])=>{var y,w,x,C;if(((w=(y=m)===null||y===void 0?void 0:y.buckets)===null||w===void 0?void 0:w.length)>0){const A=JSON.parse(JSON.stringify(m));A.buckets=`*** ${(C=(x=A.buckets)===null||x===void 0?void 0:x.length)!==null&&C!==void 0?C:0} buckets omitted ***`,l.response.body.aggregations[f]=A}}),console.log("***** RESPONSE RECEIVED *****"),console.groupCollapsed("Response"),console.log(JSON.stringify(l,null,2)),console.groupEnd()}catch(l){console.error("Error printing search response:",l)}}printDebuggingInfo(e){var t,i;const o=e.debugging,s=(t=o.messages)!==null&&t!==void 0?t:[],n=(i=o.data)!==null&&i!==void 0?i:{};console.log("***** BEGIN DEBUGGING *****"),console.log("Full response:"),console.log(JSON.stringify(e,null,2)),console.group("Debug messages");for(const l of s)console.log(l);console.groupEnd(),console.group("Debug data");for(const[l,d]of Object.entries(n))console.log(l,d);console.groupEnd(),console.log("***** END DEBUGGING *****")}}class Wn extends so{constructor(e){var t;super(e),this.servicePath=(t=e==null?void 0:e.servicePath)!==null&&t!==void 0?t:"/services/search/beta/page_production"}async performSearch(e){this.debuggingEnabled&&e.debugging===void 0&&(e.debugging=!0);const i=ao.generateURLSearchParams(e).toString(),o=`https://${this.baseUrl}${this.servicePath}/?${i}`;return this.fetchUrl(o)}}class jn extends so{constructor(e){var t;super(e),this.servicePath=(t=e==null?void 0:e.servicePath)!==null&&t!==void 0?t:"/services/search/beta/page_production"}async performSearch(e){this.debuggingEnabled&&e.debugging===void 0&&(e.debugging=!0);const i=ao.generateURLSearchParams(e).toString(),o=`https://${this.baseUrl}${this.servicePath}/?service_backend=fts&${i}`;return this.fetchUrl(o)}}class qn extends so{constructor(e){var t;super(e),this.servicePath=(t=e==null?void 0:e.servicePath)!==null&&t!==void 0?t:"/services/search/beta/page_production"}async performSearch(e){this.debuggingEnabled&&e.debugging===void 0&&(e.debugging=!0);const i=ao.generateURLSearchParams(e).toString(),o=`https://${this.baseUrl}${this.servicePath}/?service_backend=rcs&${i}`;return this.fetchUrl(o)}}var le;(function(a){a[a.METADATA=0]="METADATA",a[a.FULLTEXT=1]="FULLTEXT",a[a.RADIO=3]="RADIO",a[a.FEDERATED=4]="FEDERATED"})(le||(le={}));class Qn extends so{constructor(e){var t;super(e),this.servicePath=(t=e==null?void 0:e.servicePath)!==null&&t!==void 0?t:"/services/search/beta/page_production"}async performSearch(e){this.debuggingEnabled&&e.debugging===void 0&&(e.debugging=!0);const i=ao.generateURLSearchParams(e).toString(),o=`https://${this.baseUrl}${this.servicePath}/?page_type=simple_federation&${i}`;return this.fetchUrl(o)}}class Ue{constructor(e={}){this.backendOptions=e}async search(e,t=le.METADATA){const o=await Ue.getBackendForSearchType(t,this.backendOptions).performSearch(e);return o.error?o:{success:new Hn(o.success)}}static getBackendForSearchType(e,t={}){switch(e){case le.FULLTEXT:return new jn(t);case le.RADIO:return new qn(t);case le.FEDERATED:return new Qn(t);case le.METADATA:default:return new Wn(t)}}}Ue.default=new Ue;r([g((a,e={})=>{const{includeCredentials:t=!1,verbose:i=!1,scope:o="",baseUrl:s=""}=e;return`${a};${t};${i};${o};${s}`})],Ue,"getBackendForSearchType",null);var tt;(function(a){a.INCLUDE="inc",a.EXCLUDE="exc",a.GREATER_THAN="gt",a.GREATER_OR_EQUAL="gte",a.LESS_THAN="lt",a.LESS_OR_EQUAL="lte"})(tt||(tt={}));class Gn{constructor(){this.filterMap={}}addFilter(e,t,i){if(this.filterMap[e]||(this.filterMap[e]={}),this.filterMap[e][t]){const o=[].concat(this.filterMap[e][t],i);this.filterMap[e][t]=Array.from(new Set(o))}else this.filterMap[e][t]=i;return this}removeSingleFilter(e,t,i){var o;if(!(!((o=this.filterMap[e])===null||o===void 0)&&o[t]))return this;const s=[].concat(this.filterMap[e][t]),n=s.indexOf(i);return n>=0&&s.splice(n,1),this.filterMap[e][t]=s.length===1?s[0]:s,s.length===0&&delete this.filterMap[e][t],this.deleteFieldIfEmpty(e),this}removeFilters(e,t){return this.filterMap[e]?(delete this.filterMap[e][t],this.deleteFieldIfEmpty(e),this):this}deleteFieldIfEmpty(e){const t=this.filterMap[e];t&&Object.keys(t).length===0&&delete this.filterMap[e]}setFilterMap(e){return this.filterMap=q({},e),this}mergeFilterMap(e){for(const[t,i]of Object.entries(e))for(const[o,s]of Object.entries(i))if(Array.isArray(s))for(const n of s)this.addFilter(t,o,n);else this.addFilter(t,o,s);return this}build(){return this.filterMap}}/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Aa=window.ShadowRoot&&(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,La=Symbol(),ws=new Map;class kr{constructor(e,t){if(this._$cssResult$=!0,t!==La)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){let e=ws.get(this.cssText);return Aa&&e===void 0&&(ws.set(this.cssText,e=new CSSStyleSheet),e.replaceSync(this.cssText)),e}toString(){return this.cssText}}const Kn=a=>new kr(typeof a=="string"?a:a+"",La),v=(a,...e)=>{const t=a.length===1?a[0]:e.reduce((i,o,s)=>i+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+a[s+1],a[0]);return new kr(t,La)},Yn=(a,e)=>{Aa?a.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet):e.forEach(t=>{const i=document.createElement("style"),o=window.litNonce;o!==void 0&&i.setAttribute("nonce",o),i.textContent=t.cssText,a.appendChild(i)})},_s=Aa?a=>a:a=>a instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return Kn(t)})(a):a;/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var Co;const xs=window.trustedTypes,Xn=xs?xs.emptyScript:"",Ss=window.reactiveElementPolyfillSupport,sa={toAttribute(a,e){switch(e){case Boolean:a=a?Xn:null;break;case Object:case Array:a=a==null?a:JSON.stringify(a)}return a},fromAttribute(a,e){let t=a;switch(e){case Boolean:t=a!==null;break;case Number:t=a===null?null:Number(a);break;case Object:case Array:try{t=JSON.parse(a)}catch{t=null}}return t}},Tr=(a,e)=>e!==a&&(e==e||a==a),ko={attribute:!0,type:String,converter:sa,reflect:!1,hasChanged:Tr};class Mt extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o()}static addInitializer(e){var t;(t=this.l)!==null&&t!==void 0||(this.l=[]),this.l.push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach((t,i)=>{const o=this._$Eh(i,t);o!==void 0&&(this._$Eu.set(o,i),e.push(o))}),e}static createProperty(e,t=ko){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const i=typeof e=="symbol"?Symbol():"__"+e,o=this.getPropertyDescriptor(e,i,t);o!==void 0&&Object.defineProperty(this.prototype,e,o)}}static getPropertyDescriptor(e,t,i){return{get(){return this[t]},set(o){const s=this[e];this[t]=o,this.requestUpdate(e,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||ko}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),this.elementProperties=new Map(e.elementProperties),this._$Eu=new Map,this.hasOwnProperty("properties")){const t=this.properties,i=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const o of i)this.createProperty(o,t[o])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const o of i)t.unshift(_s(o))}else e!==void 0&&t.push(_s(e));return t}static _$Eh(e,t){const i=t.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}o(){var e;this._$Ep=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$Em(),this.requestUpdate(),(e=this.constructor.l)===null||e===void 0||e.forEach(t=>t(this))}addController(e){var t,i;((t=this._$Eg)!==null&&t!==void 0?t:this._$Eg=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((i=e.hostConnected)===null||i===void 0||i.call(e))}removeController(e){var t;(t=this._$Eg)===null||t===void 0||t.splice(this._$Eg.indexOf(e)>>>0,1)}_$Em(){this.constructor.elementProperties.forEach((e,t)=>{this.hasOwnProperty(t)&&(this._$Et.set(t,this[t]),delete this[t])})}createRenderRoot(){var e;const t=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return Yn(t,this.constructor.elementStyles),t}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$Eg)===null||e===void 0||e.forEach(t=>{var i;return(i=t.hostConnected)===null||i===void 0?void 0:i.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$Eg)===null||e===void 0||e.forEach(t=>{var i;return(i=t.hostDisconnected)===null||i===void 0?void 0:i.call(t)})}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$ES(e,t,i=ko){var o,s;const n=this.constructor._$Eh(e,i);if(n!==void 0&&i.reflect===!0){const l=((s=(o=i.converter)===null||o===void 0?void 0:o.toAttribute)!==null&&s!==void 0?s:sa.toAttribute)(t,i.type);this._$Ei=e,l==null?this.removeAttribute(n):this.setAttribute(n,l),this._$Ei=null}}_$AK(e,t){var i,o,s;const n=this.constructor,l=n._$Eu.get(e);if(l!==void 0&&this._$Ei!==l){const d=n.getPropertyOptions(l),p=d.converter,f=(s=(o=(i=p)===null||i===void 0?void 0:i.fromAttribute)!==null&&o!==void 0?o:typeof p=="function"?p:null)!==null&&s!==void 0?s:sa.fromAttribute;this._$Ei=l,this[l]=f(t,d.type),this._$Ei=null}}requestUpdate(e,t,i){let o=!0;e!==void 0&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||Tr)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),i.reflect===!0&&this._$Ei!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,i))):o=!1),!this.isUpdatePending&&o&&(this._$Ep=this._$E_())}async _$E_(){this.isUpdatePending=!0;try{await this._$Ep}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Et&&(this._$Et.forEach((o,s)=>this[s]=o),this._$Et=void 0);let t=!1;const i=this._$AL;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),(e=this._$Eg)===null||e===void 0||e.forEach(o=>{var s;return(s=o.hostUpdate)===null||s===void 0?void 0:s.call(o)}),this.update(i)):this._$EU()}catch(o){throw t=!1,this._$EU(),o}t&&this._$AE(i)}willUpdate(e){}_$AE(e){var t;(t=this._$Eg)===null||t===void 0||t.forEach(i=>{var o;return(o=i.hostUpdated)===null||o===void 0?void 0:o.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Ep}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((t,i)=>this._$ES(i,this[i],t)),this._$EC=void 0),this._$EU()}updated(e){}firstUpdated(e){}}Mt.finalized=!0,Mt.elementProperties=new Map,Mt.elementStyles=[],Mt.shadowRootOptions={mode:"open"},Ss==null||Ss({ReactiveElement:Mt}),((Co=globalThis.reactiveElementVersions)!==null&&Co!==void 0?Co:globalThis.reactiveElementVersions=[]).push("1.3.2");/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var To;const Dt=globalThis.trustedTypes,$s=Dt?Dt.createPolicy("lit-html",{createHTML:a=>a}):void 0,Ye=`lit$${(Math.random()+"").slice(9)}$`,Da="?"+Ye,Zn=`<${Da}>`,Rt=document,pi=(a="")=>Rt.createComment(a),ui=a=>a===null||typeof a!="object"&&typeof a!="function",Er=Array.isArray,Mr=a=>{var e;return Er(a)||typeof((e=a)===null||e===void 0?void 0:e[Symbol.iterator])=="function"},ei=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Cs=/-->/g,ks=/>/g,ct=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,Ts=/'/g,Es=/"/g,zr=/^(?:script|style|textarea|title)$/i,Pr=a=>(e,...t)=>({_$litType$:a,strings:e,values:t}),c=Pr(1),U=Pr(2),Ce=Symbol.for("lit-noChange"),b=Symbol.for("lit-nothing"),Ms=new WeakMap,Bi=(a,e,t)=>{var i,o;const s=(i=t==null?void 0:t.renderBefore)!==null&&i!==void 0?i:e;let n=s._$litPart$;if(n===void 0){const l=(o=t==null?void 0:t.renderBefore)!==null&&o!==void 0?o:null;s._$litPart$=n=new Wt(e.insertBefore(pi(),l),l,void 0,t!=null?t:{})}return n._$AI(a),n},Pt=Rt.createTreeWalker(Rt,129,null,!1),Ar=(a,e)=>{const t=a.length-1,i=[];let o,s=e===2?"":"",n=ei;for(let d=0;d"?(n=o!=null?o:ei,y=-1):m[1]===void 0?y=-2:(y=n.lastIndex-m[2].length,f=m[1],n=m[3]===void 0?ct:m[3]==='"'?Es:Ts):n===Es||n===Ts?n=ct:n===Cs||n===ks?n=ei:(n=ct,o=void 0);const x=n===ct&&a[d+1].startsWith("/>")?" ":"";s+=n===ei?p+Zn:y>=0?(i.push(f),p.slice(0,y)+"$lit$"+p.slice(y)+Ye+x):p+Ye+(y===-2?(i.push(void 0),d):x)}const l=s+(a[t]||"")+(e===2?"":"");if(!Array.isArray(a)||!a.hasOwnProperty("raw"))throw Error("invalid template strings array");return[$s!==void 0?$s.createHTML(l):l,i]};class fi{constructor({strings:e,_$litType$:t},i){let o;this.parts=[];let s=0,n=0;const l=e.length-1,d=this.parts,[p,f]=Ar(e,t);if(this.el=fi.createElement(p,i),Pt.currentNode=this.el.content,t===2){const m=this.el.content,y=m.firstChild;y.remove(),m.append(...y.childNodes)}for(;(o=Pt.nextNode())!==null&&d.length0){o.textContent=Dt?Dt.emptyScript:"";for(let w=0;w2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=b}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,i,o){const s=this.strings;let n=!1;if(s===void 0)e=yt(this,e,t,0),n=!ui(e)||e!==this._$AH&&e!==Ce,n&&(this._$AH=e);else{const l=e;let d,p;for(e=s[0],d=0;de=>typeof e=="function"?((t,i)=>(window.customElements.define(t,i),i))(a,e):((t,i)=>{const{kind:o,elements:s}=i;return{kind:o,elements:s,finisher(n){window.customElements.define(t,n)}}})(a,e);/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const tl=(a,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?ne(q({},e),{finisher(t){t.createProperty(e.key,a)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(t){t.createProperty(e.key,a)}};function h(a){return(e,t)=>t!==void 0?((i,o,s)=>{o.constructor.createProperty(s,i)})(a,e,t):tl(a,e)}/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */function P(a){return h(ne(q({},a),{state:!0}))}/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Or=({finisher:a,descriptor:e})=>(t,i)=>{var o;if(i===void 0){const s=(o=t.originalKey)!==null&&o!==void 0?o:t.key,n=e!=null?{kind:"method",placement:"prototype",key:s,descriptor:e(t.key)}:ne(q({},t),{key:s});return a!=null&&(n.finisher=function(l){a(l,s)}),n}{const s=t.constructor;e!==void 0&&Object.defineProperty(t,i,e(i)),a==null||a(s,i)}};/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */function G(a,e){return Or({descriptor:t=>{const i={get(){var o,s;return(s=(o=this.renderRoot)===null||o===void 0?void 0:o.querySelector(a))!==null&&s!==void 0?s:null},enumerable:!0,configurable:!0};if(e){const o=typeof t=="symbol"?Symbol():"__"+t;i.get=function(){var s,n;return this[o]===void 0&&(this[o]=(n=(s=this.renderRoot)===null||s===void 0?void 0:s.querySelector(a))!==null&&n!==void 0?n:null),this[o]}}return i}})}/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */function il(a){return Or({descriptor:e=>({get(){var t,i;return(i=(t=this.renderRoot)===null||t===void 0?void 0:t.querySelectorAll(a))!==null&&i!==void 0?i:[]},enumerable:!0,configurable:!0})})}/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var zo;((zo=window.HTMLSlotElement)===null||zo===void 0?void 0:zo.prototype.assignedElements)!=null;class ol{constructor(){this.resizeObserver=new ResizeObserver(e=>{window.requestAnimationFrame(()=>{for(const t of e){const i=this.resizeHandlers.get(t.target);i==null||i.forEach(o=>{o.handleResize(t)})}})}),this.resizeHandlers=new Map}shutdown(){this.resizeHandlers.forEach((e,t)=>{this.resizeObserver.unobserve(t)}),this.resizeHandlers.clear()}addObserver(e){var t;const i=(t=this.resizeHandlers.get(e.target))!==null&&t!==void 0?t:new Set;i.add(e.handler),this.resizeHandlers.set(e.target,i),this.resizeObserver.observe(e.target,e.options)}removeObserver(e){const t=this.resizeHandlers.get(e.target);!t||(t.delete(e.handler),t.size===0&&(this.resizeObserver.unobserve(e.target),this.resizeHandlers.delete(e.target)))}}/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Ie={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Ci=a=>(...e)=>({_$litDirective$:a,values:e});class ki{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Ft=Ci(class extends ki{constructor(a){var e;if(super(a),a.type!==Ie.ATTRIBUTE||a.name!=="class"||((e=a.strings)===null||e===void 0?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(a){return" "+Object.keys(a).filter(e=>a[e]).join(" ")+" "}update(a,[e]){var t,i;if(this.et===void 0){this.et=new Set,a.strings!==void 0&&(this.st=new Set(a.strings.join(" ").split(/\s/).filter(s=>s!=="")));for(const s in e)e[s]&&!(!((t=this.st)===null||t===void 0)&&t.has(s))&&this.et.add(s);return this.render(e)}const o=a.element.classList;this.et.forEach(s=>{s in e||(o.remove(s),this.et.delete(s))});for(const s in e){const n=!!e[s];n===this.et.has(s)||((i=this.st)===null||i===void 0?void 0:i.has(s))||(n?(o.add(s),this.et.add(s)):(o.remove(s),this.et.delete(s)))}return Ce}});/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const al=(a,...e)=>({strTag:!0,strings:a,values:e}),ut=al,sl=a=>typeof a!="string"&&"strTag"in a,rl=(a,e,t)=>{let i=a[0];for(let o=1;osl(a)?rl(a.strings,a.values):a;/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */class ll{constructor(){this.settled=!1,this.promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}resolve(e){this.settled=!0,this._resolve(e)}reject(e){this.settled=!0,this._reject(e)}}/** + * @license + * Copyright 2014 Travis Webb + * SPDX-License-Identifier: MIT + */for(let a=0;a<256;a++)(a>>4&15).toString(16)+(a&15).toString(16);/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */let dl=new ll;dl.resolve();/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */let k=nl;/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const{H:cl}=el,Ir=a=>a.strings===void 0,As=()=>document.createComment(""),ti=(a,e,t)=>{var i;const o=a._$AA.parentNode,s=e===void 0?a._$AB:e._$AA;if(t===void 0){const n=o.insertBefore(As(),s),l=o.insertBefore(As(),s);t=new cl(n,l,a,a.options)}else{const n=t._$AB.nextSibling,l=t._$AM,d=l!==a;if(d){let p;(i=t._$AQ)===null||i===void 0||i.call(t,a),t._$AM=a,t._$AP!==void 0&&(p=a._$AU)!==l._$AU&&t._$AP(p)}if(n!==s||d){let p=t._$AA;for(;p!==n;){const f=p.nextSibling;o.insertBefore(p,s),p=f}}}return t},ht=(a,e,t=a)=>(a._$AI(e,t),a),hl={},Ur=(a,e=hl)=>a._$AH=e,pl=a=>a._$AH,Po=a=>{var e;(e=a._$AP)===null||e===void 0||e.call(a,!1,!0);let t=a._$AA;const i=a._$AB.nextSibling;for(;t!==i;){const o=t.nextSibling;t.remove(),t=o}};/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Ls=(a,e,t)=>{const i=new Map;for(let o=e;o<=t;o++)i.set(a[o],o);return i},Ra=Ci(class extends ki{constructor(a){if(super(a),a.type!==Ie.CHILD)throw Error("repeat() can only be used in text expressions")}dt(a,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);const o=[],s=[];let n=0;for(const l of a)o[n]=i?i(l,n):n,s[n]=t(l,n),n++;return{values:s,keys:o}}render(a,e,t){return this.dt(a,e,t).values}update(a,[e,t,i]){var o;const s=pl(a),{values:n,keys:l}=this.dt(e,t,i);if(!Array.isArray(s))return this.ut=l,n;const d=(o=this.ut)!==null&&o!==void 0?o:this.ut=[],p=[];let f,m,y=0,w=s.length-1,x=0,C=n.length-1;for(;y<=w&&x<=C;)if(s[y]===null)y++;else if(s[w]===null)w--;else if(d[y]===l[x])p[x]=ht(s[y],n[x]),y++,x++;else if(d[w]===l[C])p[C]=ht(s[w],n[C]),w--,C--;else if(d[y]===l[C])p[C]=ht(s[y],n[C]),ti(a,p[C+1],s[y]),y++,C--;else if(d[w]===l[x])p[x]=ht(s[w],n[x]),ti(a,s[y],s[w]),w--,x++;else if(f===void 0&&(f=Ls(l,x,C),m=Ls(d,y,w)),f.has(d[y]))if(f.has(d[w])){const A=m.get(l[x]),F=A!==void 0?s[A]:null;if(F===null){const R=ti(a,s[y]);ht(R,n[x]),p[x]=R}else p[x]=ht(F,n[x]),ti(a,s[y],F),s[A]=null;x++}else Po(s[w]),w--;else Po(s[y]),y++;for(;x<=C;){const A=ti(a,p[C+1]);ht(A,n[x]),p[x++]=A}for(;y<=w;){const A=s[y++];A!==null&&Po(A)}return this.ut=l,Ur(a,p),Ce}});function Li(a,e,t){return Array.from({length:(e-a)/t+1},(i,o)=>a+o*t)}let Ze=class extends D{constructor(){super(...arguments),this.itemCount=0,this.scrollOptimizationsDisabled=!1,this.intersectionObserver=new IntersectionObserver(e=>{e.forEach(t=>{if(t.target===this.sentinel){t.isIntersecting&&this.dispatchEvent(new Event("scrollThresholdReached"));return}const o=t.target.dataset.cellIndex;if(!o)return;const s=parseInt(o,10);t.isIntersecting?this.visibleCellIndices.add(s):this.visibleCellIndices.delete(s)}),this.scrollOptimizationsDisabled||this.processVisibleCells()}),this.renderedCellIndices=new Set,this.visibleCellIndices=new Set,this.placeholderCellIndices=new Set}reload(){Li(0,Math.max(0,this.itemCount-1),1).forEach(t=>this.removeCell(t)),this.renderedCellIndices.clear(),this.visibleCellIndices.clear(),this.placeholderCellIndices.clear(),this.setupObservations()}refreshCell(e){this.removeCell(e),this.bufferRange.includes(e)&&this.renderCellBuffer([e])}refreshAllVisibleCells(){this.bufferRange.forEach(e=>this.removeCell(e)),this.renderCellBuffer(this.bufferRange)}scrollToCell(e,t){const i=this.cellContainers[e];if(!i)return!1;const o=t?"smooth":"auto";return i.scrollIntoView({behavior:o}),!0}getVisibleCellIndices(){return Array.from(this.visibleCellIndices)}updated(e){(e.has("itemCount")||e.has("scrollOptimizationsDisabled"))&&this.setupObservations()}disconnectedCallback(){this.intersectionObserver.disconnect()}setupObservations(){this.setupIntersectionObserver()}setupIntersectionObserver(){this.intersectionObserver.disconnect(),this.sentinel&&this.intersectionObserver.observe(this.sentinel),this.scrollOptimizationsDisabled?(Li(0,Math.max(0,this.itemCount-1),1).forEach(t=>this.visibleCellIndices.add(t)),this.processVisibleCells()):this.cellContainers.forEach(e=>this.intersectionObserver.observe(e))}render(){var e;const t=this.itemCount-1,i=Li(0,t,1),o=(e=this.ariaLandmarkLabel)!==null&&e!==void 0?e:b;return c` +
+ + ${Ra(i,s=>s,s=>c` +
this.cellSelected(n,s)} + @keyup=${n=>{n.key==="Enter"&&this.cellSelected(n,s)}} + >
+ `)} + +
+ `}cellSelected(e,t){const i=new CustomEvent("cellSelected",{detail:{index:t,originalEvent:e}});this.dispatchEvent(i)}get bufferRange(){const e=Math.max(10,this.visibleCellIndices.size),t=this.visibleCellIndices.size===0,i=Math.min(...this.visibleCellIndices),o=Math.max(...this.visibleCellIndices),s=t?0:Math.max(i-e,0),n=t?e:Math.min(o+e,this.itemCount-1);return Li(s,n,1)}processVisibleCells(){const e=Array.from(this.visibleCellIndices),{bufferRange:t}=this;this.renderCellBuffer(t),this.removeCellsOutsideBufferRange(t);const i=new CustomEvent("visibleCellsChanged",{detail:{visibleCellIndices:e}});this.dispatchEvent(i)}renderCellBuffer(e){e.forEach(t=>{var i;if(this.renderedCellIndices.has(t))return;const o=this.cellContainerForIndex(t);if(!o)return;const s=(i=this.cellProvider)===null||i===void 0?void 0:i.cellForIndex(t);if(o.style.height="auto",s)Bi(s,o),this.renderedCellIndices.add(t),this.placeholderCellIndices.delete(t);else{if(this.placeholderCellIndices.has(t))return;Bi(this.placeholderCellTemplate,o),this.placeholderCellIndices.add(t)}})}removeCellsOutsideBufferRange(e){Array.from(this.renderedCellIndices).filter(i=>!e.includes(i)).forEach(i=>{this.removeCell(i)})}removeCell(e){const t=this.cellContainerForIndex(e);if(!t)return;const i=t.offsetHeight;t.style.height=`${i}px`,Bi(b,t),this.renderedCellIndices.delete(e)}cellContainerForIndex(e){var t;return(t=this.shadowRoot)===null||t===void 0?void 0:t.querySelector(`.cell-container[data-cell-index="${e}"]`)}static get styles(){const e=v`var(--infiniteScrollerSentinelDistanceFromEnd, 200rem)`,t=v`var(--infiniteScrollerRowGap, 1.7rem)`,i=v`var(--infiniteScrollerColGap, 1.7rem)`,o=v`var(--infiniteScrollerCellMinWidth, 16rem)`,s=v`var(--infiniteScrollerCellMaxWidth, 1fr)`,n=v`var(--infiniteScrollerCellMinHeight, 22.5rem)`,l=v`var(--infiniteScrollerCellMaxHeight, none)`,d=v`var(--infiniteScrollerCellOutline, 0)`;return v` + #container { + position: relative; + display: flex; + flex-wrap: wrap; + grid-row-gap: ${t}; + row-gap: ${t}; + grid-column-gap: ${i}; + column-gap: ${i}; + } + + @supports (display: grid) { + #container { + display: grid; + flex-wrap: nowrap; + grid-template-columns: repeat( + auto-fill, + minmax(${o}, ${s}) + ); + } + } + + .cell-container { + outline: ${d}; + min-height: ${n}; + max-height: ${l}; + min-width: ${o}; + max-width: ${s}; + } + + @supports (display: grid) { + /* the grid takes care of the width */ + .cell-container { + min-width: auto; + max-width: none; + } + } + + #sentinel { + position: absolute; + height: ${e}; + bottom: 0; + left: 0; + right: 0; + z-index: -1; + /** + Chrome and Firefox try to maintain scroll position when the page increases and + decreases in size, but the scroll position is being focused on the sentinel + so it's causing the "load more" event to keep firing because it thinks the + user has scrolled to the sentinel. "overflow-anchor: none" prevents that anchoring + */ + overflow-anchor: none; + } + `}};r([h({type:Number})],Ze.prototype,"itemCount",void 0);r([h({type:Object})],Ze.prototype,"cellProvider",void 0);r([h({type:Object})],Ze.prototype,"placeholderCellTemplate",void 0);r([h({type:Boolean})],Ze.prototype,"scrollOptimizationsDisabled",void 0);r([h({type:String})],Ze.prototype,"ariaLandmarkLabel",void 0);r([G("#sentinel")],Ze.prototype,"sentinel",void 0);r([il(".cell-container")],Ze.prototype,"cellContainers",void 0);Ze=r([L("infinite-scroller")],Ze);function ul(a){return a==null?void 0:a.replace(/%22%22(?!%22%22)(.+?)%22%22/g,"%22$1%22")}function fl(a){var e,t,i;return((e=a==null?void 0:a.rawMetadata)===null||e===void 0?void 0:e.hit_type)==="favorited_search"?"search":(i=(t=a.mediatype)===null||t===void 0?void 0:t.value)!==null&&i!==void 0?i:"data"}const vl=U` + + + + + + Log in to view this item + +`,ml=U` + + + Content may be inappropriate + +`,gl={"login-required":k("Log in to view this item"),"content-warning":k("Content may be inappropriate")},Nr={"login-required":vl,"content-warning":ml};class ji{constructor(e){var t,i,o,s,n,l,d,p,f,m,y,w,x,C,A,F,R,W,B,Z,he,ze,ee,me,Re,Se,rt,nt,lt,jt,qt,Qt,_t,Gt,xt,ie;const Kt=this.getFlags(e);this.averageRating=(t=e.avg_rating)===null||t===void 0?void 0:t.value,this.captureDates=(i=e.capture_dates)===null||i===void 0?void 0:i.values,this.checked=!1,this.collections=(s=(o=e.collection)===null||o===void 0?void 0:o.values)!==null&&s!==void 0?s:[],this.collectionFilesCount=(l=(n=e.collection_files_count)===null||n===void 0?void 0:n.value)!==null&&l!==void 0?l:0,this.collectionSize=(p=(d=e.collection_size)===null||d===void 0?void 0:d.value)!==null&&p!==void 0?p:0,this.commentCount=(m=(f=e.num_reviews)===null||f===void 0?void 0:f.value)!==null&&m!==void 0?m:0,this.creator=(y=e.creator)===null||y===void 0?void 0:y.value,this.creators=(x=(w=e.creator)===null||w===void 0?void 0:w.values)!==null&&x!==void 0?x:[],this.dateAdded=(C=e.addeddate)===null||C===void 0?void 0:C.value,this.dateArchived=(A=e.publicdate)===null||A===void 0?void 0:A.value,this.datePublished=(F=e.date)===null||F===void 0?void 0:F.value,this.dateReviewed=(R=e.reviewdate)===null||R===void 0?void 0:R.value,this.description=(W=e.description)===null||W===void 0?void 0:W.values.join(` +`),this.favCount=(Z=(B=e.num_favorites)===null||B===void 0?void 0:B.value)!==null&&Z!==void 0?Z:0,this.href=ul((ze=(he=e.review)===null||he===void 0?void 0:he.__href__)!==null&&ze!==void 0?ze:(ee=e.__href__)===null||ee===void 0?void 0:ee.value),this.identifier=ji.cleanIdentifier(e.identifier),this.issue=(me=e.issue)===null||me===void 0?void 0:me.value,this.itemCount=(Se=(Re=e.item_count)===null||Re===void 0?void 0:Re.value)!==null&&Se!==void 0?Se:0,this.mediatype=fl(e),this.review=e.review,this.snippets=(nt=(rt=e.highlight)===null||rt===void 0?void 0:rt.values)!==null&&nt!==void 0?nt:[],this.source=(lt=e.source)===null||lt===void 0?void 0:lt.value,this.subjects=(qt=(jt=e.subject)===null||jt===void 0?void 0:jt.values)!==null&&qt!==void 0?qt:[],this.title=(_t=(Qt=e.title)===null||Qt===void 0?void 0:Qt.value)!==null&&_t!==void 0?_t:"",this.volume=(Gt=e.volume)===null||Gt===void 0?void 0:Gt.value,this.viewCount=(xt=e.downloads)===null||xt===void 0?void 0:xt.value,this.weeklyViewCount=(ie=e.week)===null||ie===void 0?void 0:ie.value,this.loginRequired=Kt.loginRequired,this.contentWarning=Kt.contentWarning}clone(){const e=new ji({});return e.averageRating=this.averageRating,e.captureDates=this.captureDates,e.checked=this.checked,e.collections=this.collections,e.collectionFilesCount=this.collectionFilesCount,e.collectionSize=this.collectionSize,e.commentCount=this.commentCount,e.creator=this.creator,e.creators=this.creators,e.dateStr=this.dateStr,e.dateAdded=this.dateAdded,e.dateArchived=this.dateArchived,e.datePublished=this.datePublished,e.dateReviewed=this.dateReviewed,e.description=this.description,e.favCount=this.favCount,e.href=this.href,e.identifier=this.identifier,e.issue=this.issue,e.itemCount=this.itemCount,e.mediatype=this.mediatype,e.snippets=this.snippets,e.source=this.source,e.subjects=this.subjects,e.title=this.title,e.volume=this.volume,e.viewCount=this.viewCount,e.weeklyViewCount=this.weeklyViewCount,e.loginRequired=this.loginRequired,e.contentWarning=this.contentWarning,e}getFlags(e){var t,i,o,s;const n={loginRequired:!1,contentWarning:!1};if(((t=e.collection)===null||t===void 0?void 0:t.values.length)&&((i=e.mediatype)===null||i===void 0?void 0:i.value)!=="collection"){for(const l of(s=(o=e.collection)===null||o===void 0?void 0:o.values)!==null&&s!==void 0?s:[])if(l==="loggedin"&&(n.loginRequired=!0,n.contentWarning)||l==="no-preview"&&(n.contentWarning=!0,n.loginRequired))break}return n}static cleanIdentifier(e){var t;const i=(t=e==null?void 0:e.indexOf("|"))!==null&&t!==void 0?t:-1;return i>0?e==null?void 0:e.slice(0,i):e}}var S;(function(a){a.default="default",a.unrecognized="unrecognized",a.relevance="relevance",a.alltimeview="alltimeview",a.weeklyview="weeklyview",a.title="title",a.date="date",a.datearchived="datearchived",a.datereviewed="datereviewed",a.dateadded="dateadded",a.datefavorited="datefavorited",a.creator="creator"})(S||(S={}));const we={[S.default]:{field:S.default,defaultSortDirection:null,canSetDirection:!1,shownInSortBar:!1,shownInURL:!1,handledBySearchService:!1,displayName:"",urlNames:["",null,void 0]},[S.unrecognized]:{field:S.unrecognized,defaultSortDirection:null,canSetDirection:!0,shownInSortBar:!1,shownInURL:!1,handledBySearchService:!0,displayName:"",urlNames:[]},[S.relevance]:{field:S.relevance,defaultSortDirection:null,canSetDirection:!1,shownInSortBar:!0,shownInURL:!1,handledBySearchService:!1,displayName:"Relevance",urlNames:["_score"]},[S.alltimeview]:{field:S.alltimeview,defaultSortDirection:"desc",canSetDirection:!0,shownInSortBar:!0,shownInURL:!0,handledBySearchService:!0,searchServiceKey:"downloads",displayName:"All-time views",urlNames:["downloads"]},[S.weeklyview]:{field:S.weeklyview,defaultSortDirection:"desc",canSetDirection:!0,shownInSortBar:!0,shownInURL:!0,handledBySearchService:!0,searchServiceKey:"week",displayName:"Weekly views",urlNames:["week"]},[S.title]:{field:S.title,defaultSortDirection:"asc",canSetDirection:!0,shownInSortBar:!0,shownInURL:!0,handledBySearchService:!0,searchServiceKey:"titleSorter",displayName:"Title",urlNames:["title","titleSorter"]},[S.date]:{field:S.date,defaultSortDirection:"desc",canSetDirection:!0,shownInSortBar:!0,shownInURL:!0,handledBySearchService:!0,searchServiceKey:"date",displayName:"Date published",urlNames:["date"]},[S.datearchived]:{field:S.datearchived,defaultSortDirection:"desc",canSetDirection:!0,shownInSortBar:!0,shownInURL:!0,handledBySearchService:!0,searchServiceKey:"publicdate",displayName:"Date archived",urlNames:["publicdate"]},[S.datereviewed]:{field:S.datereviewed,defaultSortDirection:"desc",canSetDirection:!0,shownInSortBar:!0,shownInURL:!0,handledBySearchService:!0,searchServiceKey:"reviewdate",displayName:"Date reviewed",urlNames:["reviewdate"]},[S.dateadded]:{field:S.dateadded,defaultSortDirection:"desc",canSetDirection:!0,shownInSortBar:!0,shownInURL:!0,handledBySearchService:!0,searchServiceKey:"addeddate",displayName:"Date added",urlNames:["addeddate"]},[S.datefavorited]:{field:S.datefavorited,defaultSortDirection:"desc",canSetDirection:!1,shownInSortBar:!0,shownInURL:!1,handledBySearchService:!1,searchServiceKey:"favoritedate",displayName:"Date favorited",urlNames:["favoritedate"]},[S.creator]:{field:S.creator,defaultSortDirection:"asc",canSetDirection:!0,shownInSortBar:!0,shownInURL:!0,handledBySearchService:!0,searchServiceKey:"creatorSorter",displayName:"Creator",urlNames:["creator","creatorSorter"]}};function Hr(a){var e;return(e=Object.values(we).find(t=>t.urlNames.some(i=>a===i)))!==null&&e!==void 0?e:we[S.unrecognized]}const bl={uploads:S.datearchived,reviews:S.datereviewed,collections:S.datearchived,web_archives:S.datearchived},yl={title:"firstTitle",creator:"firstCreator"},Xe=()=>({subject:{},lending:{},mediatype:{},language:{},creator:{},collection:{},year:{}}),wl=["mediatype","year","subject","collection","creator","language"],qi={subject:"Subject",lending:"Availability",mediatype:"Media Type",language:"Language",creator:"Creator",collection:"Collection",year:"Year"},Qi={subject:K.COUNT,lending:K.COUNT,mediatype:K.COUNT,language:K.COUNT,creator:K.COUNT,collection:K.COUNT,year:K.NUMERIC},_l={subject:K.ALPHABETICAL,lending:K.ALPHABETICAL,mediatype:K.ALPHABETICAL,language:K.ALPHABETICAL,creator:K.ALPHABETICAL,collection:K.ALPHABETICAL,year:K.NUMERIC},xl={is_lendable:!0,is_borrowable:!1,available_to_borrow:!0,is_browsable:!1,available_to_browse:!1,is_readable:!0,available_to_waitlist:!1},Ds={is_lendable:"Lending Library",available_to_borrow:"Borrow 14 Days",is_readable:"Always Available"},ro={deemphasize:!0,community:!0,stream_only:!0,samples_only:!0,test_collection:!0,printdisabled:!0,"openlibrary-ol":!0,nationalemergencylibrary:!0,china:!0,americana:!0,toronto:!0};/*! typescript-cookie v1.0.3 | MIT */const Vr=a=>encodeURIComponent(a).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),Wr=a=>encodeURIComponent(a).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent),Fa=decodeURIComponent,Ba=a=>(a[0]==='"'&&(a=a.slice(1,-1)),a.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent));function Sl(a){return a=Object.assign({},a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires!=null&&(a.expires=a.expires.toUTCString()),Object.entries(a).filter(([e,t])=>t!=null&&t!==!1).map(([e,t])=>t===!0?`; ${e}`:`; ${e}=${t.split(";")[0]}`).join("")}function jr(a,e,t){const i=/(?:^|; )([^=]*)=([^;]*)/g,o={};let s;for(;(s=i.exec(document.cookie))!=null;)try{const n=t(s[1]);if(o[n]=e(s[2],n),a===n)break}catch{}return a!=null?o[a]:o}const Rs=Object.freeze({decodeName:Fa,decodeValue:Ba,encodeName:Vr,encodeValue:Wr}),Oa=Object.freeze({path:"/"});function Gi(a,e,t=Oa,{encodeValue:i=Wr,encodeName:o=Vr}={}){return document.cookie=`${o(a)}=${i(e,a)}${Sl(t)}`}function ra(a,{decodeValue:e=Ba,decodeName:t=Fa}={}){return jr(a,e,t)}function $l({decodeValue:a=Ba,decodeName:e=Fa}={}){return jr(void 0,a,e)}function Cl(a,e=Oa){Gi(a,"",Object.assign({},e,{expires:-1}))}function na(a,e){const t={set:function(o,s,n){return Gi(o,s,Object.assign({},this.attributes,n),{encodeValue:this.converter.write})},get:function(o){if(arguments.length===0)return $l(this.converter.read);if(o!=null)return ra(o,this.converter.read)},remove:function(o,s){Cl(o,Object.assign({},this.attributes,s))},withAttributes:function(o){return na(this.converter,Object.assign({},this.attributes,o))},withConverter:function(o){return na(Object.assign({},this.converter,o),this.attributes)}},i={attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(a)}};return Object.create(t,i)}na({read:Rs.decodeValue,write:Rs.encodeValue},Oa);function kl(a,e){return a===e?!0:a.length!==e.length?!1:a.every((t,i)=>t===e[i])}class Tl{constructor(e){this.cookieDomain=".archive.org",this.cookieExpiration=30,this.cookiePath="/",this.context=e.context}persistState(e,t=!1){e.displayMode&&this.persistViewStateToCookies(e.displayMode),this.persistQueryStateToUrl(e,t)}getRestorationState(){const e=this.loadQueryStateFromUrl(),t=this.loadTileViewStateFromCookies();return e.displayMode=t,e}persistViewStateToCookies(e){const t=e==="grid"?"tiles":"lists";Gi(`view-${this.context}`,t,{domain:this.cookieDomain,expires:this.cookieExpiration,path:this.cookiePath});const i=e==="list-detail"?"showdetails":"";Gi(`showdetails-${this.context}`,i,{domain:this.cookieDomain,expires:this.cookieExpiration,path:this.cookiePath})}loadTileViewStateFromCookies(){const e=ra(`view-${this.context}`),t=ra(`showdetails-${this.context}`);return e==="tiles"||e===void 0?"grid":t==="showdetails"?"list-detail":"list-compact"}persistQueryStateToUrl(e,t=!1){var i,o,s;const n=new URL(window.location.href),l=new URLSearchParams(n.searchParams),d=this.removeRecognizedParams(n.searchParams);let p=!1;if(e.baseQuery&&d.set("query",e.baseQuery),e.searchType===le.FULLTEXT?d.set("sin","TXT"):e.searchType===le.RADIO&&d.set("sin","RADIO"),l.get("sin")===""&&(l.delete("sin"),p=!0),e.currentPage&&(e.currentPage>1?d.set("page",e.currentPage.toString()):d.delete("page")),e.selectedSort){const y=we[e.selectedSort];let w=this.sortDirectionPrefix(e.sortDirection);if(y.field===S.unrecognized){const x=(i=l.get("sort"))!==null&&i!==void 0?i:"",{field:C,direction:A}=this.getSortFieldAndDirection(x);e.sortDirection||(w=this.sortDirectionPrefix(A)),C?d.set("sort",`${w}${C}`):d.set("sort",x)}else if(y.shownInURL){const x=y.urlNames[0];d.set("sort",`${w}${x}`)}}if(e.selectedFacets)for(const[y,w]of Object.entries(e.selectedFacets)){const x=Object.entries(w);if(x.length!==0)for(const[C,A]of x){const F=A.state==="hidden",R=`${y}:"${C}"`;F?d.append("not[]",R):d.append("and[]",R)}}e.minSelectedDate&&e.maxSelectedDate&&d.append("and[]",`year:[${e.minSelectedDate} TO ${e.maxSelectedDate}]`),e.titleQuery&&d.append("and[]",e.titleQuery),e.creatorQuery&&d.append("and[]",e.creatorQuery);let f=t?"replaceState":"pushState";const m=this.paramsMatch(l,d,["sin","sort","and[]","not[]"]);if(m&&this.paramsMatch(l,d,["query"])){if(p)d.delete("sin");else if(this.paramsMatch(l,d,["page"]))return;f="replaceState"}else m&&this.hasLegacyParam(l)&&(f="replaceState");(s=(o=window.history)[f])===null||s===void 0||s.call(o,{query:e.baseQuery,searchType:e.searchType,page:e.currentPage,sort:{field:e.selectedSort,direction:e.sortDirection},minDate:e.minSelectedDate,maxDate:e.maxSelectedDate,facets:e.selectedFacets},"",n)}loadQueryStateFromUrl(){var e;const t=new URL(window.location.href),i=t.searchParams.get("sin"),o=t.searchParams.get("page"),s=t.searchParams.get("query"),n=t.searchParams.get("sort"),l=t.searchParams.getAll("and[]"),d=t.searchParams.getAll("not[]");for(const[m,y]of t.searchParams.entries())/and\[\d+\]/.test(m)?l.push(y):/not\[\d+\]/.test(m)&&d.push(y);const p=(e=t.searchParams.get("q"))!==null&&e!==void 0?e:t.searchParams.get("search"),f={selectedFacets:Xe()};switch(s?f.baseQuery=s:p&&(f.baseQuery=p),i){case"TXT":f.searchType=le.FULLTEXT;break;case"RADIO":f.searchType=le.RADIO;break;default:f.searchType=le.METADATA;break}if(o){const m=parseInt(o,10);f.currentPage=m}else f.currentPage=1;if(n){const{field:m,direction:y}=this.getSortFieldAndDirection(n),w=Hr(m);f.selectedSort=w.field,["asc","desc"].includes(y)&&(f.sortDirection=y)}return l&&l.forEach(m=>{let[y,w]=m.split(":");if(y=y.replace(/Sorter$/,""),y.startsWith("-")){d.push(m.slice(1));return}switch(y){case"year":{const[x,C]=w.split(" TO ");x&&C?(f.minSelectedDate=x.substring(1,x.length),f.maxSelectedDate=C.substring(0,C.length-1)):this.setSelectedFacetState(f.selectedFacets,y,w,"selected");break}case"firstTitle":f.selectedTitleFilter=w;break;case"firstCreator":f.selectedCreatorFilter=w;break;default:this.setSelectedFacetState(f.selectedFacets,y,w,"selected")}}),d&&d.forEach(m=>{const[y,w]=m.split(":");this.setSelectedFacetState(f.selectedFacets,y,w,"hidden")}),f}getSortFieldAndDirection(e){const t=e.indexOf(" ")>-1;let i,o;return t?[i,o]=e.split(" "):(i=e.startsWith("-")?e.slice(1):e,o=e.startsWith("-")?"desc":"asc"),{field:i,direction:o}}sortDirectionPrefix(e){return e==="desc"?"-":""}stripQuotes(e){return e.startsWith('"')&&e.endsWith('"')?e.substring(1,e.length-1):e}paramsMatch(e,t,i){return i.every(o=>kl(e.getAll(o).sort(),t.getAll(o).sort()))}removeRecognizedParams(e){e.delete("query"),e.delete("sin"),e.delete("page"),e.delete("sort"),e.delete("and[]"),e.delete("not[]");for(const t of e.keys())/(and|not)\[\d+\]/.test(t)&&e.delete(t);return e.delete("q"),e.delete("search"),e}hasLegacyParam(e){return e.has("q")||e.has("search")}setSelectedFacetState(e,t,i,o){var s;const n=e[t];if(!n)return;const l=this.stripQuotes(i);(s=n[l])!==null&&s!==void 0||(n[l]=this.getDefaultBucket(i)),n[l].state=o}getDefaultBucket(e){return{key:e,count:0,state:"none"}}}const la=["forum_posts","lending","web_archives"],El=new TextEncoder;async function qr(a){const e=await crypto.subtle.digest("SHA-1",El.encode(a));return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")}const Ae=window.location&&(window.location.hostname==="localhost"||window.location.host.match(/^(www|cat)-[a-z0-9]+\.archive\.org$/)||window.location.host.match(/\.code\.archive\.org$/)||window.location.host.match(/\.dev\.archive\.org$/)||window.location.host.match(/^ia-petabox-/)||window.location.host.match(/^local\.archive\.org/)||window.location.host.match(/^internetarchive\.github\.io$/))?console.log.bind(console):()=>{};class Ml{constructor(e,t=50){this.host=e,this.pageSize=t,this.pages={},this.offset=0,this.numTileModels=0,this.fetchesInProgress=new Set,this.previousQueryKey="",this.searchResultsLoading=!1,this.facetsLoading=!1,this.facetsReadyToLoad=!1,this.suppressFetches=!1,this.totalResults=0,this.endOfDataReached=!1,this.queryInitialized=!1,this.collectionTitles=new Map,this.parentCollections=[],this.prefixFilterCountMap={},this._initialSearchCompletePromise=Promise.resolve(!0),this.checkAllTiles=()=>{this.map(i=>{const o=i.clone();return o.checked=!0,o})},this.uncheckAllTiles=()=>{this.map(i=>{const o=i.clone();return o.checked=!1,o})},this.removeCheckedTiles=()=>{const{checkedTileModels:i,uncheckedTileModels:o}=this,s=i.length;if(s===0)return;this.offset+=s;const n={};let l=Math.floor(this.offset/this.pageSize)+1,d=this.offset%this.pageSize;for(let p=1;p<=l;p+=1){const f=this.offset-this.pageSize*(p-1),m=Math.min(this.pageSize,f);n[p]=Array(m).fill(void 0)}for(const p of o)n[l]||(n[l]=[]),n[l].push(p),d+=1,d>=this.pageSize&&(l+=1,d=0);this.pages=n,this.numTileModels-=s,this.totalResults-=s,this.host.setTileCount(this.size),this.host.setTotalResultCount(this.totalResults),this.requestHostUpdate(),this.refreshVisibleResults()}}get initialSearchComplete(){return this._initialSearchCompletePromise}hostConnected(){this.setSearchResultsLoading(this.searchResultsLoading),this.setFacetsLoading(this.facetsLoading)}hostUpdate(){if(!this.activeOnHost||(this.setSearchResultsLoading(this.searchResultsLoading),this.setFacetsLoading(this.facetsLoading),!this.host.searchService)||!(this.pageFetchQueryKey!==this.previousQueryKey))return;const t=!this.host.baseQuery;!(this.canPerformSearch||t)||(this.activeOnHost&&this.host.emitQueryStateChanged(),this.handleQueryChange())}get activeOnHost(){return this.host.dataSource===this}get size(){return this.numTileModels}reset(){Ae("Resetting CB data source"),this.pages={},this.aggregations={},this.yearHistogramAggregation=void 0,this.pageElements=void 0,this.parentCollections=[],this.previousQueryKey="",this.queryErrorMessage=void 0,this.offset=0,this.numTileModels=0,this.endOfDataReached=!1,this.queryInitialized=!1,this.facetsLoading=!1,this.fetchesInProgress.clear(),this.setTotalResultCount(0),this.requestHostUpdate()}resetPages(){Object.keys(this.pages).lengthn>=e&&n<=e+i)&&this.refreshVisibleResults()}getPage(e){return this.pages[e]}getAllPages(){return this.pages}hasPage(e){return!!this.pages[e]}getTileModelAt(e){var t,i;const o=e+this.offset,s=Math.floor(o/this.pageSize)+1,n=o%this.pageSize;let l=1,d=0;for(;d<=o;){if(!this.pages[l])return(t=this.pages[s])===null||t===void 0?void 0:t[n];if(d+this.pages[l].length>o)return this.pages[l][o-d];d+=this.pages[l].length,l+=1}return(i=this.pages[s])===null||i===void 0?void 0:i[n]}indexOf(e){return Object.values(this.pages).flat().indexOf(e)-this.offset}getPageSize(){return this.pageSize}setPageSize(e){this.reset(),this.pageSize=e}setTotalResultCount(e){this.totalResults=e,this.activeOnHost&&this.host.setTotalResultCount(e)}setFetchesSuppressed(e){this.suppressFetches=e}async handleQueryChange(){if(this.suppressFetches)return;this.reset();let e;this._initialSearchCompletePromise=new Promise(t=>{e=t}),this.queryInitialized=!0,await Promise.all([this.doInitialPageFetch(),this.canFetchFacets?this.fetchFacets():null]),e(!0)}async handleFacetReadinessChange(e){const t=!this.facetsReadyToLoad&&e;this.facetsReadyToLoad=e,t&&this.canFetchFacets&&this.fetchFacets()}get canFetchFacets(){var e;if(this.host.facetLoadStrategy==="off"||la.includes(this.host.profileElement)||this.host.facetLoadStrategy!=="eager"&&!this.facetsReadyToLoad)return!1;const t=Object.keys((e=this.aggregations)!==null&&e!==void 0?e:{}).length>0;return!(this.facetsLoading||t)}map(e){!Object.keys(this.pages).length||(this.pages=Object.fromEntries(Object.entries(this.pages).map(([t,i])=>[t,i.map((o,s,n)=>o&&e(o,s,n))])),this.requestHostUpdate(),this.refreshVisibleResults())}get checkedTileModels(){return this.getFilteredTileModels(e=>e.checked)}get uncheckedTileModels(){return this.getFilteredTileModels(e=>!e.checked)}getFilteredTileModels(e){return Object.values(this.pages).flat().filter((t,i,o)=>t?e(t,i,o):!1)}get canPerformSearch(){var e;if(!this.host.searchService)return!1;const i=!!((e=this.host.baseQuery)===null||e===void 0?void 0:e.trim()),o=!!this.host.withinCollection,s=!!this.host.withinProfile,n=!!this.host.profileElement,l=this.host.searchType===le.METADATA;return i||o&&l||s&&n&&l}setSearchResultsLoading(e){this.searchResultsLoading=e,this.activeOnHost&&this.host.setSearchResultsLoading(e)}setFacetsLoading(e){this.facetsLoading=e,this.activeOnHost&&this.host.setFacetsLoading(e)}requestHostUpdate(){this.activeOnHost&&this.host.requestUpdate()}refreshVisibleResults(){this.activeOnHost&&this.host.refreshVisibleResults()}get pageFetchQueryKey(){var e,t,i;const o=`pf;${this.host.withinProfile}--pe;${this.host.profileElement}`,s=(e=this.host.withinCollection)!==null&&e!==void 0?e:o,n=(t=this.host.selectedSort)!==null&&t!==void 0?t:"none",l=(i=this.host.sortDirection)!==null&&i!==void 0?i:"none";return`fq:${this.fullQuery}-pt:${s}-st:${this.host.searchType}-sf:${n}-sd:${l}`}get facetFetchQueryKey(){var e;const t=`pf;${this.host.withinProfile}--pe;${this.host.profileElement}`,i=(e=this.host.withinCollection)!==null&&e!==void 0?e:t;return`fq:${this.fullQuery}-pt:${i}-st:${this.host.searchType}`}get filterMap(){const e=new Gn;if(this.host.minSelectedDate&&e.addFilter("year",this.host.minSelectedDate,tt.GREATER_OR_EQUAL),this.host.maxSelectedDate&&e.addFilter("year",this.host.maxSelectedDate,tt.LESS_OR_EQUAL),this.host.selectedFacets)for(const[i,o]of Object.entries(this.host.selectedFacets)){const{name:s,values:n}=this.prepareFacetForFetch(i,o);for(const[l,d]of Object.entries(n)){let p;d.state==="selected"?p=tt.INCLUDE:d.state==="hidden"&&(p=tt.EXCLUDE),p&&e.addFilter(s,l,p)}}return this.host.selectedTitleFilter&&e.addFilter("firstTitle",this.host.selectedTitleFilter,tt.INCLUDE),this.host.selectedCreatorFilter&&e.addFilter("firstCreator",this.host.selectedCreatorFilter,tt.INCLUDE),e.build()}async requestUID(e,t){var i;const o=JSON.stringify({pageType:e.pageType,pageTarget:e.pageTarget,query:e.query,fields:e.fields,filters:e.filters,sort:e.sort,searchType:this.host.searchType}),s=(await qr(o)).slice(0,20),n=(await this.host.getSessionId()).slice(0,20),l=(i=e.page)!==null&&i!==void 0?i:0,d=t.charAt(0),p=Date.now();return`R:${s}-S:${n}-P:${l}-K:${d}-T:${p}`}get pageSpecifierParams(){return this.host.withinCollection?{pageType:"collection_details",pageTarget:this.host.withinCollection}:this.host.withinProfile?{pageType:"account_details",pageTarget:this.host.withinProfile,pageElements:this.host.profileElement?[this.host.profileElement]:[]}:null}get fullQuery(){var e,t;let i=(t=(e=this.host.baseQuery)===null||e===void 0?void 0:e.trim())!==null&&t!==void 0?t:"";const{facetQuery:o,dateRangeQueryClause:s,sortFilterQueries:n}=this;return o&&(i+=` AND ${o}`),s&&(i+=` AND ${s}`),n&&(i+=` AND ${n}`),i.trim()}get facetQuery(){var e;if(!this.host.selectedFacets)return;const t=[];for(const[i,o]of Object.entries(this.host.selectedFacets))t.push(this.buildFacetClause(i,o));return(e=this.joinFacetClauses(t))===null||e===void 0?void 0:e.trim()}get dateRangeQueryClause(){if(!(!this.host.minSelectedDate||!this.host.maxSelectedDate))return`year:[${this.host.minSelectedDate} TO ${this.host.maxSelectedDate}]`}get sortFilterQueries(){return[this.titleQuery,this.creatorQuery].filter(t=>t).join(" AND ")}get titleQuery(){return this.host.selectedTitleFilter?`firstTitle:${this.host.selectedTitleFilter}`:void 0}get creatorQuery(){return this.host.selectedCreatorFilter?`firstCreator:${this.host.selectedCreatorFilter}`:void 0}buildFacetClause(e,t){const{name:i,values:o}=this.prepareFacetForFetch(e,t),s=Object.entries(o);if(s.length===0)return"";const n=[];for(const[d,p]of s){const f=p.state==="hidden"?"-":"";n.push(`${f}"${d}"`)}const l=n.join(" OR ");return`${i}:(${l})`}prepareFacetForFetch(e,t){let[i,o]=[e,t];return e==="lending"&&(i="lending___status"),{name:i,values:o}}joinFacetClauses(e){const t=e.filter(i=>i.length>0);return t.length>0?`(${t.join(" AND ")})`:void 0}async fetchFacets(){var e,t,i,o,s,n,l,d,p;const f=(e=this.host.baseQuery)===null||e===void 0?void 0:e.trim();if(!this.canPerformSearch)return;const{facetFetchQueryKey:m}=this;if(this.fetchesInProgress.has(m))return;this.fetchesInProgress.add(m),this.setFacetsLoading(!0);const y=this.host.sortParam?[this.host.sortParam]:[],w=ne(q({},this.pageSpecifierParams),{query:f||"",rows:0,filters:this.filterMap,aggregationsSize:10});w.uid=await this.requestUID(ne(q({},w),{sort:y}),"aggregations");const x=await((t=this.host.searchService)===null||t===void 0?void 0:t.search(w,this.host.searchType)),C=x==null?void 0:x.success,A=!this.fetchesInProgress.has(m);if(this.fetchesInProgress.delete(m),A)return;if(!C){const W=(i=x==null?void 0:x.error)===null||i===void 0?void 0:i.message,B=(s=(o=x==null?void 0:x.error)===null||o===void 0?void 0:o.details)===null||s===void 0?void 0:s.message;!W&&!B&&((l=(n=window==null?void 0:window.Sentry)===null||n===void 0?void 0:n.captureMessage)===null||l===void 0||l.call(n,"Missing or malformed facet response from backend","error")),this.setFacetsLoading(!1);return}const{aggregations:F,collectionTitles:R}=C.response;if(this.aggregations=F,R)for(const[W,B]of Object.entries(R))this.collectionTitles.set(W,B);this.yearHistogramAggregation=(p=(d=C==null?void 0:C.response)===null||d===void 0?void 0:d.aggregations)===null||p===void 0?void 0:p.year_histogram,this.setFacetsLoading(!1),this.requestHostUpdate()}async doInitialPageFetch(){this.setSearchResultsLoading(!0),await this.fetchPage(this.host.initialPageNumber,2)}async fetchPage(e,t=1){var i,o,s,n,l,d,p,f,m;const y=(i=this.host.baseQuery)===null||i===void 0?void 0:i.trim();if(!this.canPerformSearch||this.hasPage(e)||this.endOfDataReached)return;let w=e===1?t:1;const x=this.pageSize*w,{pageFetchQueryKey:C}=this,A=`${C}-p:${e}`;if(this.fetchesInProgress.has(A))return;for(let ee=0;ee0){if(ze)for(const[me,Re]of Object.entries(ze))this.collectionTitles.set(me,Re);const ee=["lending","web_archives"].includes(this.host.profileElement);ee&&(w=Math.ceil(he.length/this.pageSize),this.endOfDataReached=!0,this.activeOnHost&&this.host.setTileCount(this.totalResults));for(let me=0;me=this.totalResults||he.length===0)&&(this.endOfDataReached=!0,this.activeOnHost&&this.host.setTileCount(this.size)),this.setSearchResultsLoading(!1),this.requestHostUpdate()}addFetchedResultsToDataSource(e,t,i=!0){const o=[];t==null||t.forEach(s=>{!s.identifier||o.push(new ji(s))}),this.addPage(e,o),i&&this.refreshVisibleResults()}async fetchPrefixFilterBuckets(e){var t,i,o,s,n,l,d;const p=(t=this.host.baseQuery)===null||t===void 0?void 0:t.trim();if(!this.canPerformSearch)return[];const f=yl[e],m=this.host.sortParam?[this.host.sortParam]:[],y=ne(q({},this.pageSpecifierParams),{query:p||"",rows:0,filters:this.filterMap,aggregations:{simpleParams:[f]},aggregationsSize:26});y.uid=await this.requestUID(ne(q({},y),{sort:m}),"aggregations");const w=await((i=this.host.searchService)===null||i===void 0?void 0:i.search(y,this.host.searchType));return(d=(l=(n=(s=(o=w==null?void 0:w.success)===null||o===void 0?void 0:o.response)===null||s===void 0?void 0:s.aggregations)===null||n===void 0?void 0:n[f])===null||l===void 0?void 0:l.buckets)!==null&&d!==void 0?d:[]}async updatePrefixFilterCounts(e){const{facetFetchQueryKey:t}=this,i=await this.fetchPrefixFilterBuckets(e);t===this.facetFetchQueryKey&&(this.prefixFilterCountMap=q({},this.prefixFilterCountMap),this.prefixFilterCountMap[e]=i.reduce((s,n)=>(s[n.key.toUpperCase()]=n.doc_count,s),{}),this.requestHostUpdate())}async updatePrefixFiltersForCurrentSort(){if(["title","creator"].includes(this.host.selectedSort)){const e=this.host.selectedSort;this.prefixFilterCountMap[e]||this.updatePrefixFilterCounts(e)}}refreshLetterCounts(){Object.keys(this.prefixFilterCountMap).length>0&&(this.prefixFilterCountMap={}),this.updatePrefixFiltersForCurrentSort(),this.requestHostUpdate()}}var Ne;(function(a){a.default="collection-browser"})(Ne||(Ne={}));var te;(function(a){a.sortBy="sortBy",a.filterByCreator="filterByCreator",a.filterByTitle="filterByTitle",a.displayMode="displayMode",a.loadDesktopView="loadDesktopView",a.loadMobileView="loadMobileView",a.facetSelected="facetSelected",a.facetDeselected="facetDeselected",a.facetNegativeSelected="facetNegativeSelected",a.facetNegativeDeselected="facetNegativeDeselected",a.mobileFacetsToggled="mobileFacetsToggled",a.partOfCollectionClicked="partOfCollectionClicked",a.histogramChanged="histogramChanged",a.histogramChangedFromModal="histogramChangedFromModal",a.histogramExpanded="histogramExpanded",a.resultSelected="resultSelected",a.moreFacetsPageChange="moreFacetsPageChange",a.showMoreFacetsModal="showMoreFacetsModal",a.closeMoreFacetsModal="closeMoreFacetsModal",a.applyMoreFacetsModal="applyMoreFacetsModal"})(te||(te={}));var da=U` +`;const et=v` + .sr-only { + position: absolute !important; + width: 1px !important; + height: 1px !important; + margin: -1px !important; + padding: 0 !important; + border: 0 !important; + overflow: hidden !important; + white-space: nowrap !important; + clip: rect(1px, 1px, 1px, 1px) !important; + -webkit-clip-path: inset(50%) !important; + clip-path: inset(50%) !important; + user-select: none !important; + } +`;/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const zl=(a,e,t)=>{for(const i of e)if(i[0]===a)return(0,i[1])();return t==null?void 0:t()};var Pl=U` + +`,Di=U` + +`,Oe;let ke=Oe=class extends D{constructor(){super(...arguments),this.placeholderType=null,this.detailMessage=""}render(){return this.placeholderType?c`${this.placeholderTemplate}`:b}get placeholderTemplate(){return c` +
+ ${zl(this.placeholderType,[["empty-query",()=>this.emptyQueryTemplate],["empty-collection",()=>this.emptyCollectionTemplate],["no-results",()=>this.noResultsTemplate],["query-error",()=>this.queryErrorTemplate],["collection-error",()=>this.collectionErrorTemplate]])} +
+ `}get emptyQueryTemplate(){return c` +

+ ${Oe.MESSAGE_EMPTY_QUERY} +

+
${Pl}
+ `}get emptyCollectionTemplate(){return c` +

+ ${Oe.MESSAGE_NO_VIEWABLE_MEMBERS} +

+
${Di}
+ `}get noResultsTemplate(){return c` +

+ ${this.isCollection?Oe.MESSAGE_NO_COLLECTION_RESULTS:Oe.MESSAGE_NO_SEARCH_RESULTS} +

+
${Di}
+ `}get queryErrorTemplate(){return c` +

+ ${Oe.MESSAGE_QUERY_ERROR} +

+
${Di}
+

+ ${Oe.QUERY_ERROR_DETAILS_MESSAGE} ${this.detailMessage} +

+ `}get collectionErrorTemplate(){return c` +

+ ${Oe.MESSAGE_COLLECTION_ERROR} +

+
${Di}
+

+ ${Oe.QUERY_ERROR_DETAILS_MESSAGE} ${this.detailMessage} +

+ `}static get styles(){return v` + :host { + text-align: center; + width: 100%; + } + + a { + text-decoration: none; + } + a:link { + color: var(--ia-theme-link-color, #4b64ff); + } + a:hover { + text-decoration: underline; + } + + .placeholder { + display: block; + } + + .desktop svg { + max-height: 40rem; + } + .desktop .title, + .desktop .error-details { + margin: 4rem 0; + } + + .mobile svg { + max-height: 20rem; + } + .mobile .title, + .mobile .error-details { + margin: 2rem 0.5; + } + + .error-details { + font-size: 1.2rem; + word-break: break-word; + } + `}};ke.MESSAGE_EMPTY_QUERY=k('To begin searching, enter a search term in the box above and hit "Go".');ke.MESSAGE_NO_SEARCH_RESULTS=k("Your search did not match any items in the Archive. Try different keywords or a more general search.");ke.MESSAGE_NO_COLLECTION_RESULTS=k("Your search did not match any items in this collection. Try different keywords or a more general search.");ke.MESSAGE_NO_VIEWABLE_MEMBERS=k("This collection contains no viewable items.");ke.MESSAGE_QUERY_ERROR=k(c`The search engine + encountered an error, which might be related to your search query. + + Tips for constructing search queries. + `);ke.MESSAGE_COLLECTION_ERROR=k(c`The search engine + encountered an error while loading this collection. If the problem persists, + please let us know at + info@archive.org.`);ke.QUERY_ERROR_DETAILS_MESSAGE=k("Error details:");r([h({type:String})],ke.prototype,"placeholderType",void 0);r([h({type:Boolean})],ke.prototype,"isMobileView",void 0);r([h({type:Boolean})],ke.prototype,"isCollection",void 0);r([h({type:String})],ke.prototype,"detailMessage",void 0);ke=Oe=r([L("empty-placeholder")],ke);/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Ia=a=>a!=null?a:b,Qr=U` + + + +`;var ca;(function(a){a[a.bytes=0]="bytes",a[a.kilobytes=1]="kilobytes",a[a.megabytes=2]="megabytes",a[a.gigabytes=3]="gigabytes",a[a.terabytes=4]="terabytes",a[a.petabytes=5]="petabytes",a[a.exabytes=6]="exabytes",a[a.zettabytes=7]="zettabytes",a[a.yottabytes=8]="yottabytes"})(ca||(ca={}));function Al(a,e,t=" "){let i=a;if(i===void 0)return b;let o=0;for(;i>1024;)i/=1024,o+=1;const s=10**e;i=Math.round(i*s)/s;let n=ca[o];return n=i===1?n.slice(0,-1):n,`${i.toLocaleString()+t+n}`}const Ll=v`var(--tileBackgroundColor, #ffffff)`,Dl=v`var(--tileCornerRadius, 4px)`,no=v` + /* Include .sr-only styles for all tiles */ + ${et} + + .container { + background-color: ${Ll}; + border: 1px #2c2c2c; + border-radius: ${Dl}; + box-shadow: 1px 1px 2px 0; + box-sizing: border-box; + height: 100%; + display: flex; + flex-direction: column; + width: 100%; + } + + image-block { + display: block; + position: relative; + text-align: center; + } + + .tile-details { + display: flex; + flex-direction: column; + height: 100%; + row-gap: 10px; + font-family: 'Helvetica Neue', ui-sans-serif, system-ui, sans-serif; + } + + .item-info { + display: flex; + flex-direction: column; + row-gap: 5px; + flex-grow: 1; + } + + #title { + padding: 0 5px; + } + + .created-by, + .date-sorted-by, + .volume-issue, + .archivist-since { + display: flex; + justify-content: left; + align-items: flex-start; + padding: 0 5px; + } + + .truncated { + flex: 1; + color: #2c2c2c; + min-width: 0; /* Important for long words! */ + text-align: left; + line-height: 15px; + text-overflow: ellipsis; + overflow: hidden; + word-wrap: break-word; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; + } + + h4.truncated { + display: -webkit-box; + margin: 0px; + line-height: 15px; + font-size: 14px; + font-weight: 500; + padding-bottom: 1px; + } + + span { + display: -webkit-box; + font-size: 1.4rem; + line-height: 15px; + overflow: hidden; + word-wrap: break-word; + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; + padding-bottom: 1px; + } + + .container:hover > .tile-details > .item-info > #title > .truncated { + text-decoration: underline; + } + + /** this is a workaround for Safari 15 where the hover effects are not working */ + #title:hover > .truncated { + text-decoration: underline; + } + + .info-button { + position: absolute; + right: 10px; + top: 10px; + margin: 0; + padding: 0; + border: none; + border-radius: 50%; + display: flex; + justify-content: center; + align-items: center; + background: rgba(220, 220, 220, 0.5); + color: white; + font-size: 2rem; + font-weight: bold; + line-height: 1; + text-shadow: black 1px 1px 3px; + overflow: visible; + aspect-ratio: 1 / 1; + z-index: 1; + } + + .hidden { + display: none; + } +`;function vi(a,e="short",t="en-US"){if(!a)return"";const i={};switch(e){case"year-only":return`${a.getUTCFullYear()}`;case"short":i.month="short",i.year="numeric";break;case"long":i.year="numeric",i.month="short",i.day="2-digit";break}return new Intl.DateTimeFormat(t,i).format(a)}class Fs{constructor(e={}){var t;this.model=e.model,this.baseNavigationUrl=e.baseNavigationUrl,this.collectionPagePath=(t=e.collectionPagePath)!==null&&t!==void 0?t:"/details/",this.sortParam=e.sortParam,this.creatorFilter=e.creatorFilter}get firstCreatorMatchingFilter(){var e,t;let i;if(this.creatorFilter&&((e=this.model)===null||e===void 0?void 0:e.creators.length)){const o=this.creatorFilter;i=this.model.creators.find(s=>s.normalize("NFD").replace(/[^A-Z]+/gi,"").toUpperCase().startsWith(o))}return i!=null?i:(t=this.model)===null||t===void 0?void 0:t.creator}get accountLabel(){var e;return!((e=this.model)===null||e===void 0)&&e.dateAdded?k(ut`Archivist since ${this.model.dateAdded.getFullYear()}`):""}get dateLabel(){var e;switch((e=this.sortParam)===null||e===void 0?void 0:e.field){case"publicdate":return k("Archived");case"reviewdate":return k("Reviewed");case"addeddate":return k("Added");case"date":return k("Published");default:return""}}itemPageUrl(e,t=!1){if(!e||this.baseNavigationUrl==null)return b;const i=t?this.collectionPagePath:"/details/";return`${this.baseNavigationUrl}${i}${e}`}webArchivesCaptureLink(e,t){const o=`https://web.archive.org/web/${t.toISOString().replace(/[TZ:-]/g,"").replace(/\..*/,"")}/${encodeURIComponent(e)}`,s=vi(t,"long");return c` ${s} `}}class ce extends D{constructor(){super(...arguments),this.sortParam=null,this.defaultSortParam=null,this.loggedIn=!1,this.displayValueProvider=new Fs}willUpdate(e){var t,i;(e.has("model")||e.has("baseNavigationUrl")||e.has("collectionPagePath")||e.has("sortParam")||e.has("defaultSortParam")||e.has("creatorFilter"))&&(this.displayValueProvider=new Fs({model:this.model,baseNavigationUrl:this.baseNavigationUrl,collectionPagePath:this.collectionPagePath,sortParam:(i=(t=this.sortParam)!==null&&t!==void 0?t:this.defaultSortParam)!==null&&i!==void 0?i:void 0,creatorFilter:this.creatorFilter}))}}r([h({type:Object})],ce.prototype,"model",void 0);r([h({type:Number})],ce.prototype,"currentWidth",void 0);r([h({type:Number})],ce.prototype,"currentHeight",void 0);r([h({type:String})],ce.prototype,"baseNavigationUrl",void 0);r([h({type:String})],ce.prototype,"baseImageUrl",void 0);r([h({type:String})],ce.prototype,"collectionPagePath",void 0);r([h({type:Object})],ce.prototype,"sortParam",void 0);r([h({type:Object})],ce.prototype,"defaultSortParam",void 0);r([h({type:String})],ce.prototype,"creatorFilter",void 0);r([h({type:Number})],ce.prototype,"mobileBreakpoint",void 0);r([h({type:Boolean})],ce.prototype,"loggedIn",void 0);let ha=class extends D{render(){return c`
${this.iconTemplate}
`}get iconTemplate(){var e;return this.type?c`${(e=Nr[this.type])!==null&&e!==void 0?e:b}`:b}static get styles(){return v` + :host { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 100%; + z-index: 2; + background-color: rgb(255, 254, 203); + display: flex; + justify-content: center; + border: 1px solid #2c2c2c; + } + + .icon-overlay { + height: 20px; + width: 20px; + padding: 2px; + padding: 2px; + } + + :host(.list-detail) .icon-overlay { + height: 20px; + width: 20px; + } + :host(.list-compact) .icon-overlay { + height: 15px; + width: 15px; + } + `}};r([h({type:String})],ha.prototype,"type",void 0);ha=r([L("icon-overlay")],ha);let pa=class extends D{render(){return c` +
+
${this.iconTemplate}
+

${this.textTemplate}

+
+ `}get iconTemplate(){var e;return this.type?c`${(e=Nr[this.type])!==null&&e!==void 0?e:b}`:b}get textTemplate(){var e;return this.type?c`${(e=gl[this.type])!==null&&e!==void 0?e:b}`:b}static get styles(){return v` + :host { + align-items: center; + display: flex; + } + + .overlay { + border: 1px solid #2c2c2c; + border-radius: 1px; + position: absolute; + right: 0; + left: 0; + top: 50%; + transform: translate(0px, -50%); + width: auto; + height: auto; + padding: 5px; + background-color: #fffecb; + display: flex; + align-items: center; + border-radius: 1px; + } + + .icon-overlay { + width: 40px; + height: 40px; + display: inherit; + } + .text-overlay { + margin: 0; + vertical-align: bottom; + padding-left: 5px; + text-align: center; + color: #2c2c2c; + font-size: 1.4rem; + line-height: 2rem; + } + `}};r([h({type:String})],pa.prototype,"type",void 0);pa=r([L("text-overlay")],pa);let ot=class extends D{constructor(){super(...arguments),this.isCompactTile=!1,this.isListTile=!1,this.loggedIn=!1,this.viewSize="desktop"}render(){var e;return!((e=this.model)===null||e===void 0)&&e.identifier?c` +
+ + + ${this.textOverlayTemplate} ${this.iconOverlayTemplate} +
+ `:b}get baseClass(){var e,t;return{container:!0,list:this.isListTile&&!this.isCompactTile,"list-compact":this.isListTile&&this.isCompactTile,collection:((e=this.model)===null||e===void 0?void 0:e.mediatype)==="collection",[this.viewSize]:!0,"search-image":((t=this.model)===null||t===void 0?void 0:t.mediatype)==="search"}}get iconOverlayTemplate(){if(!this.isListTile)return b;const{overlayType:e}=this;return e?c` + + + `:b}get textOverlayTemplate(){if(this.isListTile)return b;const{overlayType:e}=this;return e?c` `:b}get overlayType(){var e,t;if(((e=this.model)===null||e===void 0?void 0:e.loginRequired)&&!this.loggedIn)return"login-required";if(!((t=this.model)===null||t===void 0)&&t.contentWarning)return"content-warning"}static get styles(){const e=v`var(--imageBlockBackgroundColor, #f1f1f4)`;return v` + div { + display: flex; + justify-content: center; + position: relative; + background-color: ${e}; + border-radius: 4px; + } + + .grid { + height: var(--imgBlockHeight, 16rem); + flex: 1; + position: initial; + padding: 5px; + border-radius: 4px 4px 0 0; + } + + .collection.grid, + .grid.search-image { + display: block; + } + + /** tile-list view */ + .list { + border-radius: 0; + background-color: var(--imageBlockListBackgroundColor, #ebebee); + box-shadow: 1px 1px 2px rgb(0, 0, 0, 0.2); + } + + .list.desktop { + width: 100px; + max-width: 100%; + height: 100px; + max-width: 100%; + display: inline-block; + position: relative; + text-align: center; + } + + .list.mobile { + width: var(--image-width, 90px); + height: 90px; + } + + /** tile-list-compact view */ + .container.list-compact { + display: block; + text-align: center; + } + + .list-compact.desktop { + width: 45px; + height: 45px; + } + + .list-compact.mobile { + width: 30px; + height: 30px; + } + `}};r([h({type:String})],ot.prototype,"baseImageUrl",void 0);r([h({type:Boolean})],ot.prototype,"isCompactTile",void 0);r([h({type:Boolean})],ot.prototype,"isListTile",void 0);r([h({type:Boolean})],ot.prototype,"loggedIn",void 0);r([h({type:Object})],ot.prototype,"model",void 0);r([h({type:String})],ot.prototype,"viewSize",void 0);ot=r([L("image-block")],ot);let ua=class extends ce{constructor(){super(...arguments),this.showInfoButton=!1}render(){return c` +
+ ${this.infoButtonTemplate} +
+
+ ${this.getImageBlockTemplate} ${this.getTitleTemplate} +
+
+ + ${this.getTileStatsTemplate} +
+ `}get getImageBlockTemplate(){return c` + + + `}get getTitleTemplate(){var e;return c`
+

${(e=this.model)===null||e===void 0?void 0:e.title}

+
`}get getTileStatsTemplate(){return c` +
+
${Qr}
+ +
+ ${this.getItemsTemplate} ${this.getSizeTemplate} +
+
+ `}get getItemsTemplate(){var e,t;const i=(t=(e=this.model)===null||e===void 0?void 0:e.itemCount)===null||t===void 0?void 0:t.toLocaleString();return c`${i} item${Number(i)!==1?"s":""}`}get getSizeTemplate(){var e,t;const i=(t=(e=this.model)===null||e===void 0?void 0:e.collectionSize)!==null&&t!==void 0?t:0;return i?c`${Al(i,1)}`:""}get infoButtonTemplate(){return this.showInfoButton?c``:b}infoButtonPressed(e){e.preventDefault();const t=new CustomEvent("infoButtonPressed",{detail:{x:e.clientX,y:e.clientY}});this.dispatchEvent(t)}static get styles(){const e=v`var(--tileBorderColor, #555555)`,t=v`var(--tileBackgroundColor, #666666)`,i=v`#fff`;return[no,v` + .container { + background-color: ${t}; + border: 1px solid ${e}; + } + + .item-info { + flex-grow: initial; + } + + h4.truncated { + color: ${i}; + } + + #item-mediatype svg { + filter: invert(100%); + height: 2.5rem; + align-items: baseline; + } + + .container:hover > #title { + text-decoration: underline; + } + + /* this is a workaround for Safari 15 where the hover effects are not working */ + image-block:hover > #title { + text-decoration: underline; + } + + #item-stats { + display: flex; + padding: 0 5px 5px; + align-items: center; + } + + #stats-row { + display: flex; + align-items: baseline; + color: ${i}; + flex-direction: column; + margin-left: 10px; + } + `]}};r([h({type:Boolean})],ua.prototype,"showInfoButton",void 0);ua=r([L("collection-tile")],ua);/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */function*gt(a,e){if(a!==void 0){let t=0;for(const i of a)yield e(i,t++)}}function Rl(a){return new Date(a.getTime()-a.getTimezoneOffset()*1e3*60)}function Ua(a){return a?Rl(a).toISOString().endsWith("-01-01T00:00:00.000Z"):!1}const Gr=c` + + + +`,Fl=c` + + + +`;let Bt=class extends D{constructor(){super(...arguments),this.title="",this.body="",this.starRating=0,this.viewSize="desktop"}render(){return!this.title&&!this.body&&!this.starRating?b:c` +
+
+ ${this.starsTemplate} +

${this.title}

+

${this.body}

+
+
+ `}get starsTemplate(){if(this.starRating<=0)return b;const e=Math.min(5,this.starRating),t=Math.min(5,5-this.starRating);return c` +
+ ${this.starRating} ${k("out of 5 stars")} + ${Array(e).fill(this.filledStarTemplate)} + ${Array(t).fill(this.unfilledStarTemplate)} +
+ `}get filledStarTemplate(){return c``}get unfilledStarTemplate(){return c` + + `}static get styles(){return[et,v` + .review-container { + display: flex; + flex-direction: row; + flex-wrap: wrap; + width: calc(100% - 10px); + border: 1px solid #ccc; + margin-top: var(--containerTopMargin, 10px); + margin-left: var(--containerLeftMargin, 0px); + padding: 5px; + box-sizing: border-box; + } + + .review-title, + .review-body { + display: -webkit-box; + font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; + overflow: hidden; + overflow-wrap: break-word; + word-break: break-word; + -webkit-line-clamp: var(--maxLines, 3); + -webkit-box-orient: vertical; + margin: 0; + } + + .review-title { + font-size: 1.4rem; + line-height: 2rem; + max-height: 6rem; + } + + .review-title > a[href] { + color: inherit; + text-decoration: none; + } + + .review-title > a[href]:hover { + text-decoration: underline; + } + + .review-body { + font-size: 1rem; + line-height: 1.4rem; + max-height: 4.2rem; + } + + .star-rating svg { + width: 10px; + height: 10px; + } + + .unfilled-star { + fill: #ccc; + } + + .list { + margin: 0; + padding-left: 5px; + } + `]}};r([h({type:String})],Bt.prototype,"title",void 0);r([h({type:String})],Bt.prototype,"body",void 0);r([h({type:Number})],Bt.prototype,"starRating",void 0);r([h({type:String})],Bt.prototype,"viewSize",void 0);Bt=r([L("review-block")],Bt);/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */function*Oi(a,e){const t=typeof e=="function";if(a!==void 0){let i=-1;for(const o of a)i>-1&&(yield t?e(i):e),i++,yield o}}let Ki=class extends D{constructor(){super(...arguments),this.snippets=[],this.viewSize="desktop"}render(){var e;return!((e=this.snippets)===null||e===void 0)&&e.length?c` +
+
+ ${this.ellipsisJoinedSnippets} +
+
+ `:c`${b}`}get ellipsisJoinedSnippets(){return c` + … ${Oi(this.snippetTemplates,c` … `)} … + `}get snippetTemplates(){var e;return(e=this.snippets)===null||e===void 0?void 0:e.map(t=>{const i=t.matchAll(/{{{(.+?)}}}/gs),o=[];let s=0;for(const n of i)n.index!=null&&(o.push(c` + ${t.slice(s,n.index)} + ${n[1]} + `),s=n.index+n[0].length);return o.push(c`${t.slice(s)}`),c`${o}`})}static get styles(){return v` + .container { + display: flex; + flex-direction: row; + flex-wrap: wrap; + width: calc(100% - 10px); + border-left: 5px solid #194880; + margin-top: var(--containerTopMargin, 10px); + margin-left: var(--containerLeftMargin, 0px); + border-radius: 3px; + box-sizing: border-box; + } + + .snippet-view { + display: -webkit-box; + font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; + font-size: 14px; + overflow: hidden; + overflow-wrap: break-word; + -webkit-line-clamp: var(--maxLines, 3); + -webkit-box-orient: vertical; + margin-left: 5px; + } + + .grid { + font-size: 1.2rem; + line-height: 1.5rem; + } + + .list { + margin: 0; + padding-left: 15px; + font-size: 1.4rem; + line-height: 2rem; + + /* + * Safari doesn't always respect the line-clamping rules, + * so we add this to ensure these fields still get truncated. + */ + max-height: 6rem; + } + + mark { + /* blue, 20% transparency */ + background-color: #0000ff33; + color: inherit; + } + `}};r([h({type:Array})],Ki.prototype,"snippets",void 0);r([h({type:String})],Ki.prototype,"viewSize",void 0);Ki=r([L("text-snippet-block")],Ki);const Bl=v` + .drop-shadow { + overflow: hidden; + height: 100%; + } + + .list-box { + overflow: hidden; + box-sizing: border-box; + display: inline-block; + position: relative; + } + + .list-box img { + border-radius: 0; + } + + .contain { + object-fit: contain; + object-position: center; + height: 100%; + width: 100%; + } + + .cover { + object-fit: cover; + } + + .blur { + filter: blur(15px); + box-shadow: 1px 1px 2px 0; + } + + .account-image { + object-fit: cover; + background-position: 50% 50%; + border-radius: 50%; + width: 160px; + height: 160px; + } + + :not(.list-box) > .collection-image { + object-fit: cover; + border-radius: 8px; + width: 100%; + height: 160px; + } + + .list-box.search-image svg { + margin: 10px; + } +`,Ol=v` + .waveform { + mix-blend-mode: screen; + position: relative; + height: 62.5%; + top: 50%; + transform: translateY(-50%); + } + + .waveform-grad0 { + background: linear-gradient( + hsl(300, 80%, 55%), + hsl(330, 80%, 33%) 35%, + hsl(330, 80%, 22%) 70%, + hsl(0, 0%, 0%) + ); + } + + .waveform-grad1 { + background: linear-gradient( + hsl(200, 80%, 55%), + hsl(230, 80%, 33%) 35%, + hsl(230, 80%, 22%) 70%, + hsl(0, 0%, 0%) + ); + } + + .waveform-grad2 { + background: linear-gradient( + hsl(160, 80%, 55%), + hsl(190, 80%, 33%) 35%, + hsl(190, 80%, 22%) 70%, + hsl(0, 0%, 0%) + ); + } + + .waveform-grad3 { + background: linear-gradient( + hsl(250, 80%, 55%), + hsl(280, 80%, 33%) 35%, + hsl(280, 80%, 22%) 70%, + hsl(0, 0%, 0%) + ); + } + + .waveform-grad4 { + background: linear-gradient( + hsl(280, 80%, 55%), + hsl(310, 80%, 33%) 35%, + hsl(310, 80%, 22%) 70%, + hsl(0, 0%, 0%) + ); + } + + .waveform-grad5 { + background: linear-gradient( + hsl(340, 80%, 55%), + hsl(0, 80%, 33%) 35%, + hsl(0, 80%, 22%) 70%, + hsl(0, 0%, 0%) + ); + } +`,Kr=U` + + + +`;let He=class extends D{constructor(){super(...arguments),this.isListTile=!1,this.isCompactTile=!1,this.loggedIn=!1,this.isWaveform=!1,this.isNotFound=!1}render(){return c` +
${this.imageTemplate}
+ `}get imageTemplate(){var e;return((e=this.model)===null||e===void 0?void 0:e.mediatype)==="search"?c`${Kr}`:c` + + `}get imageSrc(){var e,t;if(this.isNotFound)return this.notFoundSrc;if(((e=this.model)===null||e===void 0?void 0:e.captureDates)&&this.model.identifier)try{const i=new URL(this.model.identifier),o=encodeURIComponent(i.hostname);return this.baseImageUrl?`https://web.archive.org/thumb/${o}?generate=1`:b}catch{return`${this.baseImageUrl}/images/notfound.png`}return this.baseImageUrl&&((t=this.model)===null||t===void 0?void 0:t.identifier)?`${this.baseImageUrl}/services/img/${this.model.identifier}`:b}get notFoundSrc(){return this.baseImageUrl?`${this.baseImageUrl}/images/notfound.png`:b}get hashBasedGradient(){var e;return!((e=this.model)===null||e===void 0)&&e.identifier?`waveform-grad${this.hashStrToInt(this.model.identifier)%6}`:"waveform-grad0"}hashStrToInt(e){return e.split("").reduce((t,i)=>t+i.charCodeAt(0),0)}get itemBaseClass(){var e;return{"drop-shadow":!0,"list-box":this.isListTile,"search-image":((e=this.model)===null||e===void 0?void 0:e.mediatype)==="search",[this.hashBasedGradient]:this.isWaveform}}get itemImageClass(){var e,t,i;const o=((e=this.model)===null||e===void 0?void 0:e.contentWarning)||((t=this.model)===null||t===void 0?void 0:t.loginRequired);return{contain:!this.isCompactTile&&!this.isWaveform,cover:this.isCompactTile,blur:o||!1,waveform:this.isWaveform,"account-image":this.isAccountImage,"collection-image":((i=this.model)===null||i===void 0?void 0:i.mediatype)==="collection"}}get isAccountImage(){var e;return((e=this.model)===null||e===void 0?void 0:e.mediatype)==="account"&&!this.isCompactTile&&!this.isListTile}onLoad(){var e,t;(((e=this.model)===null||e===void 0?void 0:e.mediatype)==="audio"||((t=this.model)===null||t===void 0?void 0:t.mediatype)==="etree")&&this.baseImage.naturalWidth/this.baseImage.naturalHeight===4&&(this.isWaveform=!0)}onError(){this.isNotFound=!0}static get styles(){return[Bl,Ol,v` + img { + height: var(--imgHeight, 16rem); + width: var(--imgWidth, 16rem); + } + + .search-image { + display: flex; + align-items: center; + justify-content: center; + background: rgb(245, 245, 247); + border-radius: 4px; + } + + svg { + height: 10rem; + width: 10rem; + } + `]}};r([h({type:Object})],He.prototype,"model",void 0);r([h({type:String})],He.prototype,"baseImageUrl",void 0);r([h({type:Boolean})],He.prototype,"isListTile",void 0);r([h({type:Boolean})],He.prototype,"isCompactTile",void 0);r([h({type:Boolean})],He.prototype,"loggedIn",void 0);r([P()],He.prototype,"isWaveform",void 0);r([P()],He.prototype,"isNotFound",void 0);r([G("img")],He.prototype,"baseImage",void 0);He=r([L("item-image")],He);const Il=U` + + + Icon of a person + +`,Ul=U` + + + Icon of a speaker + +`,Nl=U` + + icon/data(folder) + + + + + +`,Hl=U` + + + +`,Vl=U` + + + +`,Bs=U` + + + Icon of a film + +`,Wl=U` + + icon/radio + + + + + +`,jl=U` + + + +`,ql=U` + + + +`,Ql=U` + + + +`,Gl=U` + + + +`,Kl=U` + + + +`,Yr={account:{color:"#000000",icon:Il,text:"Account"},audio:{color:"#00adef",icon:Ul,text:"Audio"},collection:{color:"#4666ff",icon:Qr,text:"Collection"},data:{color:"#333333",icon:Nl,text:"Data"},etree:{color:"#00adef",icon:Hl,text:"E-tree"},film:{color:"#bf1b2c",icon:Bs,text:"Film"},image:{color:"#aa99c9",icon:Vl,text:"Image"},movies:{color:"#f1644b",icon:Bs,text:"Movie"},radio:{color:"#8fdaef",icon:Wl,text:"Radio"},software:{color:"#9ecc4f",icon:jl,text:"Software"},texts:{color:"#faab3c",icon:ql,text:"Text"},tv:{color:"#f1644b",icon:Ql,text:"TV"},video:{color:"#f1644b",icon:Gl,text:"Video"},web:{color:"#ffcd27",icon:Kl,text:"Web"},search:{color:"#000000",icon:Kr,text:"Search"}};let mi=class extends D{constructor(){super(...arguments),this.showText=!1}get displayMediatype(){var e,t;const i=["tvnews","tvarchive","television"],o=["radio","radioprogram"];return this.mediatype==="movies"&&((e=this.collections)===null||e===void 0?void 0:e.some(s=>i.indexOf(s)>=0))?"tv":this.mediatype==="audio"&&((t=this.collections)===null||t===void 0?void 0:t.some(s=>o.indexOf(s)>=0))?"radio":this.mediatype||""}render(){const e=Yr[this.displayMediatype];return e?c` +
+ ${e.icon} +

${e.text}

+
+ `:c``}static get styles(){return v` + #icon { + height: var(--iconHeight, 25px); + } + + .status-text { + font-size: 14px; + color: #2c2c2c; + margin: auto; + display: block; + text-align: var(--iconTextAlign, center); + } + + #icon.hide-text p { + display: none; + } + + svg { + height: var(--iconHeight, 10px); + width: var(--iconWidth, 10px); + pointer-events: none; + } + + .fill-color { + fill: var(--iconFillColor, '#000000'); + } + `}};r([h({type:String})],mi.prototype,"mediatype",void 0);r([h({type:Array})],mi.prototype,"collections",void 0);r([h({type:Boolean})],mi.prototype,"showText",void 0);mi=r([L("mediatype-icon")],mi);const Yl=U` + + + Icon of a speech bubble + +`,Xl=U` + + + Icon of an arrow pointing upwards + +`,Zl=U` + + + Eye icon + +`;function Jl(a,e){let t=1;return a>=1e9?t=1e9:a>=1e6?t=1e6:a>=1e3&&e==="short"&&(t=1e3),t}function ed(a=0,e){const t=a/e,i=t<10;let o=0;return i?o=Math.round((t+Number.EPSILON)*10)/10:o=Math.round(t),o}function td(a,e,t,i){switch(e){case 1e9:return k(t==="short"?ut`${a}B`:ut`${a} billion`);case 1e6:return k(t==="short"?ut`${a}M`:ut`${a} million`);case 1e3:return k(t==="short"?ut`${a}K`:ut`${a} thousand`);default:return new Intl.NumberFormat(i).format(a)}}function ci(a,e="long",t="short",i="en-US"){const o=a!=null?a:-1;if(o<0)return"";const s=Jl(o,e),n=ed(o,s);return td(n,s,t,i)}let at=class extends D{render(){var e,t,i,o,s;const n=ci(this.favCount,"short","short"),l=ci(this.commentCount,"short","short"),d=this.mediatype==="account"?`${(e=this.itemCount)!==null&&e!==void 0?e:0} uploads`:`${(t=this.viewCount)!==null&&t!==void 0?t:0} ${(i=this.viewLabel)!==null&&i!==void 0?i:"all-time views"}`;return c` +
+

+ ${this.mediatype==="account"?"Account Stats":"Item Stats"} +

+
    +
  • +

    ${k("Mediatype:")}

    + +
  • +
  • + ${this.mediatype==="account"?Xl:Zl} +

    + + ${this.mediatype==="account"?k("Uploads:"):k("Views:")} + + ${ci(this.mediatype==="account"?(o=this.itemCount)!==null&&o!==void 0?o:0:(s=this.viewCount)!==null&&s!==void 0?s:0,"short","short")} +

    +
  • +
  • + ${Gr} +

    + ${k("Favorites:")} + ${n} +

    +
  • +
  • + ${Yl} +

    + ${k("Reviews:")} + ${l} +

    +
  • +
+
+ `}static get styles(){return[et,v` + mediatype-icon { + --iconHeight: 25px; + --iconWidth: 25px; + } + + ul { + all: unset; // unset all property values + list-style-type: none; // remove default list-style + } + + li { + list-style-type: none; // remove default list-style + } + + svg { + height: 13px; + width: 13px; + display: block; + margin: auto; + pointer-events: none; + } + + /* Make the reviews icon slightly smaller/lower, for even visual weight */ + .reviews svg { + height: 11px; + width: 11px; + margin-top: 2px; + } + + .item-stats { + height: 30px; + padding-left: 5px; + padding-right: 5px; + font-family: 'Helvetica Neue', ui-sans-serif, system-ui, sans-serif; + text-align: center; + } + + #stats-row { + display: flex; + justify-content: space-between; + flex-wrap: wrap; + width: 100%; + padding-bottom: 5px; + } + + .col { + min-width: 15px; + max-width: 25%; + height: 25px; + } + + .status-text { + font-size: 14px; + height: 15px; + color: #2c2c2c; + line-height: 17px; + margin: auto; + display: block; + text-align: center; + } + `]}};r([h({type:String})],at.prototype,"mediatype",void 0);r([h({type:Number})],at.prototype,"itemCount",void 0);r([h({type:Number})],at.prototype,"viewCount",void 0);r([h({type:String})],at.prototype,"viewLabel",void 0);r([h({type:Number})],at.prototype,"favCount",void 0);r([h({type:Number})],at.prototype,"commentCount",void 0);at=r([L("tile-stats")],at);let fa=class extends ce{constructor(){super(...arguments),this.showInfoButton=!1}render(){var e,t,i,o,s,n,l;const d=(e=this.model)===null||e===void 0?void 0:e.title,p=(t=this.sortParam)!==null&&t!==void 0?t:this.defaultSortParam,[f,m]=(p==null?void 0:p.field)==="week"?[(i=this.model)===null||i===void 0?void 0:i.weeklyViewCount,"weekly views"]:[(o=this.model)===null||o===void 0?void 0:o.viewCount,"all-time views"];return c` +
+ ${this.infoButtonTemplate} +
+
+ ${this.imageBlockTemplate} + +
+

+ ${d} +

+
+ + ${this.volumeIssueTemplate} + ${this.isSortedByDate?this.sortedDateInfoTemplate:this.creatorTemplate} + ${this.webArchivesCaptureDatesTemplate} ${this.textSnippetsTemplate} + ${this.reviewBlockTemplate} +
+ + + +
+
+ `}get creatorTemplate(){const e=this.displayValueProvider.firstCreatorMatchingFilter;return e?c` +
+ + by ${e} + +
+ `:b}get imageBlockTemplate(){return c` + + + `}get sortedDateInfoTemplate(){var e,t,i,o,s;let n,l="long";switch((e=this.effectiveSort)===null||e===void 0?void 0:e.field){case"date":{const d=(t=this.model)===null||t===void 0?void 0:t.datePublished;n={field:"published",value:d},Ua(d)&&(l="year-only");break}case"reviewdate":n={field:"reviewed",value:(i=this.model)===null||i===void 0?void 0:i.dateReviewed};break;case"addeddate":n={field:"added",value:(o=this.model)===null||o===void 0?void 0:o.dateAdded};break;case"publicdate":n={field:"archived",value:(s=this.model)===null||s===void 0?void 0:s.dateArchived};break}return n!=null&&n.value?c` +
+ + ${n==null?void 0:n.field} ${vi(n==null?void 0:n.value,l)} + +
+ `:b}get infoButtonTemplate(){return this.showInfoButton?c``:b}get reviewBlockTemplate(){var e;if(!(!((e=this.model)===null||e===void 0)&&e.review))return b;const{title:t,body:i,stars:o}=this.model.review;return c` + + + `}get textSnippetsTemplate(){var e;return this.hasSnippets?c` + + + `:b}get volumeIssueTemplate(){var e,t,i,o;return!(!((e=this.model)===null||e===void 0)&&e.volume)||!(!((t=this.model)===null||t===void 0)&&t.issue)?b:c` +
+ + Volume ${(i=this.model)===null||i===void 0?void 0:i.volume}, Issue ${(o=this.model)===null||o===void 0?void 0:o.issue} + +
+ `}get webArchivesCaptureDatesTemplate(){var e;return!(!((e=this.model)===null||e===void 0)&&e.captureDates)||!this.model.title?b:c` +
    + ${gt(this.model.captureDates,t=>c`
  • + ${this.displayValueProvider.webArchivesCaptureLink(this.model.title,t)} +
  • `)} +
+ `}get isSortedByDate(){var e;return["date","reviewdate","addeddate","publicdate"].includes((e=this.effectiveSort)===null||e===void 0?void 0:e.field)}get effectiveSort(){var e;return(e=this.sortParam)!==null&&e!==void 0?e:this.defaultSortParam}get hasSnippets(){var e,t;return!!(!((t=(e=this.model)===null||e===void 0?void 0:e.snippets)===null||t===void 0)&&t.length)}infoButtonPressed(e){e.preventDefault();const t=new CustomEvent("infoButtonPressed",{detail:{x:e.clientX,y:e.clientY}});this.dispatchEvent(t)}static get styles(){const e=v`var(--tileBorderColor, #dddddd)`;return[no,v` + a:link { + text-decoration: none; + color: var(--ia-theme-link-color, #4b64ff); + } + a:hover { + text-decoration: underline; + } + + .container { + border: 1px solid ${e}; + } + + .capture-dates { + margin: 0; + padding: 0 5px; + list-style-type: none; + } + + review-block, + text-snippet-block { + --containerLeftMargin: 5px; + --containerTopMargin: 5px; + } + + /** + * iOS Safari long-press on tiles (to bring up hover pane) + * gets messy without this + */ + @media screen and (pointer: coarse) and (hover: none) { + .container { + -webkit-touch-callout: none; + } + + .truncated { + -webkit-touch-callout: default; + } + } + `]}};r([h({type:Boolean})],fa.prototype,"showInfoButton",void 0);fa=r([L("item-tile")],fa);let va=class extends ce{constructor(){super(...arguments),this.showInfoButton=!1}render(){return c` +
+ ${this.infoButtonTemplate} +
+
+ ${this.getAvatarTemplate} ${this.getTitleTemplate} + ${this.getArchivistTemplate} +
+ ${this.getTileStatsTemplate} +
+
+ `}get getAvatarTemplate(){return c` + + + `}get getTitleTemplate(){var e;return c`
+

${(e=this.model)===null||e===void 0?void 0:e.identifier}

+
`}get getArchivistTemplate(){return c`
+ ${this.displayValueProvider.accountLabel} +
`}get getTileStatsTemplate(){var e,t,i,o;return c` + `}get infoButtonTemplate(){return this.showInfoButton?c``:b}infoButtonPressed(e){e.preventDefault();const t=new CustomEvent("infoButtonPressed",{detail:{x:e.clientX,y:e.clientY}});this.dispatchEvent(t)}static get styles(){const e=v`var(--tileBorderColor, #dddddd)`;return[no,v` + .container { + border: 1px solid ${e}; + } + `]}};r([h({type:Boolean})],va.prototype,"showInfoButton",void 0);va=r([L("account-tile")],va);let ma=class extends ce{constructor(){super(...arguments),this.showInfoButton=!1}render(){return c` +
+
+
+ ${this.getImageBlockTemplate} ${this.getTitleTemplate} +
+
+
+ `}get getImageBlockTemplate(){return c` + + + `}get getTitleTemplate(){var e;return c`
+

${(e=this.model)===null||e===void 0?void 0:e.title}

+
`}static get styles(){const e=v`var(--tileBorderColor, #555555)`,t=v`var(--tileBackgroundColor, #666666)`,i=v`#fff`;return[no,v` + .container { + background-color: ${t}; + border: 1px solid ${e}; + } + + .item-info { + flex-grow: initial; + } + + h4.truncated { + color: ${i}; + -webkit-line-clamp: 4; + } + + .container:hover > #title { + text-decoration: underline; + } + + /* this is a workaround for Safari 15 where the hover effects are not working */ + image-block:hover > #title { + text-decoration: underline; + } + `]}};r([h({type:Boolean})],ma.prototype,"showInfoButton",void 0);ma=r([L("search-tile")],ma);/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */class ga extends ki{constructor(e){if(super(e),this.it=b,e.type!==Ie.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===b||e==null)return this.ft=void 0,this.it=e;if(e===Ce)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this.ft;this.it=e;const t=[e];return t.raw=t,this.ft={_$litType$:this.constructor.resultType,strings:t,values:[]}}}ga.directiveName="unsafeHTML",ga.resultType=1;const id=Ci(ga);/*! @license DOMPurify 3.1.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.7/LICENSE */const{entries:Xr,setPrototypeOf:Os,isFrozen:od,getPrototypeOf:ad,getOwnPropertyDescriptor:sd}=Object;let{freeze:_e,seal:Me,create:Zr}=Object,{apply:ba,construct:ya}=typeof Reflect!="undefined"&&Reflect;_e||(_e=function(e){return e});Me||(Me=function(e){return e});ba||(ba=function(e,t,i){return e.apply(t,i)});ya||(ya=function(e,t){return new e(...t)});const Ri=Te(Array.prototype.forEach),Is=Te(Array.prototype.pop),ii=Te(Array.prototype.push),Ii=Te(String.prototype.toLowerCase),Ao=Te(String.prototype.toString),Us=Te(String.prototype.match),oi=Te(String.prototype.replace),rd=Te(String.prototype.indexOf),nd=Te(String.prototype.trim),Pe=Te(Object.prototype.hasOwnProperty),ye=Te(RegExp.prototype.test),ai=ld(TypeError);function Te(a){return function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),o=1;o2&&arguments[2]!==void 0?arguments[2]:Ii;Os&&Os(a,null);let i=e.length;for(;i--;){let o=e[i];if(typeof o=="string"){const s=t(o);s!==o&&(od(e)||(e[i]=s),o=s)}a[o]=!0}return a}function dd(a){for(let e=0;e/gm),fd=Me(/\${[\w\W]*}/gm),vd=Me(/^data-[\-\w.\u00B7-\uFFFF]/),md=Me(/^aria-[\-\w]+$/),Jr=Me(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),gd=Me(/^(?:\w+script|data):/i),bd=Me(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),en=Me(/^html$/i),yd=Me(/^[a-z][.\w]*(-[.\w]+)+$/i);var js=Object.freeze({__proto__:null,MUSTACHE_EXPR:pd,ERB_EXPR:ud,TMPLIT_EXPR:fd,DATA_ATTR:vd,ARIA_ATTR:md,IS_ALLOWED_URI:Jr,IS_SCRIPT_OR_DATA:gd,ATTR_WHITESPACE:bd,DOCTYPE_NAME:en,CUSTOM_ELEMENT:yd});const ri={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},wd=function(){return typeof window=="undefined"?null:window},_d=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(i=t.getAttribute(o));const s="dompurify"+(i?"#"+i:"");try{return e.createPolicy(s,{createHTML(n){return n},createScriptURL(n){return n}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}};function tn(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:wd();const e=z=>tn(z);if(e.version="3.1.7",e.removed=[],!a||!a.document||a.document.nodeType!==ri.document)return e.isSupported=!1,e;let{document:t}=a;const i=t,o=i.currentScript,{DocumentFragment:s,HTMLTemplateElement:n,Node:l,Element:d,NodeFilter:p,NamedNodeMap:f=a.NamedNodeMap||a.MozNamedAttrMap,HTMLFormElement:m,DOMParser:y,trustedTypes:w}=a,x=d.prototype,C=si(x,"cloneNode"),A=si(x,"remove"),F=si(x,"nextSibling"),R=si(x,"childNodes"),W=si(x,"parentNode");if(typeof n=="function"){const z=t.createElement("template");z.content&&z.content.ownerDocument&&(t=z.content.ownerDocument)}let B,Z="";const{implementation:he,createNodeIterator:ze,createDocumentFragment:ee,getElementsByTagName:me}=t,{importNode:Re}=i;let Se={};e.isSupported=typeof Xr=="function"&&typeof W=="function"&&he&&he.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:rt,ERB_EXPR:nt,TMPLIT_EXPR:lt,DATA_ATTR:jt,ARIA_ATTR:qt,IS_SCRIPT_OR_DATA:Qt,ATTR_WHITESPACE:_t,CUSTOM_ELEMENT:Gt}=js;let{IS_ALLOWED_URI:xt}=js,ie=null;const Kt=I({},[...Ns,...Lo,...Do,...Ro,...Hs]);let pe=null;const ja=I({},[...Vs,...Fo,...Ws,...Fi]);let ae=Object.seal(Zr(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Yt=null,uo=null,qa=!0,fo=!0,Qa=!1,Ga=!0,St=!1,vo=!0,dt=!1,mo=!1,go=!1,$t=!1,Ei=!1,Mi=!1,Ka=!0,Ya=!1;const gn="user-content-";let bo=!0,Xt=!1,Ct={},kt=null;const Xa=I({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Za=null;const Ja=I({},["audio","video","img","source","image","track"]);let yo=null;const es=I({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),zi="http://www.w3.org/1998/Math/MathML",Pi="http://www.w3.org/2000/svg",Qe="http://www.w3.org/1999/xhtml";let Tt=Qe,wo=!1,_o=null;const bn=I({},[zi,Pi,Qe],Ao);let Zt=null;const yn=["application/xhtml+xml","text/html"],wn="text/html";let ue=null,Et=null;const _n=t.createElement("form"),ts=function(u){return u instanceof RegExp||u instanceof Function},xo=function(){let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Et&&Et===u)){if((!u||typeof u!="object")&&(u={}),u=ft(u),Zt=yn.indexOf(u.PARSER_MEDIA_TYPE)===-1?wn:u.PARSER_MEDIA_TYPE,ue=Zt==="application/xhtml+xml"?Ao:Ii,ie=Pe(u,"ALLOWED_TAGS")?I({},u.ALLOWED_TAGS,ue):Kt,pe=Pe(u,"ALLOWED_ATTR")?I({},u.ALLOWED_ATTR,ue):ja,_o=Pe(u,"ALLOWED_NAMESPACES")?I({},u.ALLOWED_NAMESPACES,Ao):bn,yo=Pe(u,"ADD_URI_SAFE_ATTR")?I(ft(es),u.ADD_URI_SAFE_ATTR,ue):es,Za=Pe(u,"ADD_DATA_URI_TAGS")?I(ft(Ja),u.ADD_DATA_URI_TAGS,ue):Ja,kt=Pe(u,"FORBID_CONTENTS")?I({},u.FORBID_CONTENTS,ue):Xa,Yt=Pe(u,"FORBID_TAGS")?I({},u.FORBID_TAGS,ue):{},uo=Pe(u,"FORBID_ATTR")?I({},u.FORBID_ATTR,ue):{},Ct=Pe(u,"USE_PROFILES")?u.USE_PROFILES:!1,qa=u.ALLOW_ARIA_ATTR!==!1,fo=u.ALLOW_DATA_ATTR!==!1,Qa=u.ALLOW_UNKNOWN_PROTOCOLS||!1,Ga=u.ALLOW_SELF_CLOSE_IN_ATTR!==!1,St=u.SAFE_FOR_TEMPLATES||!1,vo=u.SAFE_FOR_XML!==!1,dt=u.WHOLE_DOCUMENT||!1,$t=u.RETURN_DOM||!1,Ei=u.RETURN_DOM_FRAGMENT||!1,Mi=u.RETURN_TRUSTED_TYPE||!1,go=u.FORCE_BODY||!1,Ka=u.SANITIZE_DOM!==!1,Ya=u.SANITIZE_NAMED_PROPS||!1,bo=u.KEEP_CONTENT!==!1,Xt=u.IN_PLACE||!1,xt=u.ALLOWED_URI_REGEXP||Jr,Tt=u.NAMESPACE||Qe,ae=u.CUSTOM_ELEMENT_HANDLING||{},u.CUSTOM_ELEMENT_HANDLING&&ts(u.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ae.tagNameCheck=u.CUSTOM_ELEMENT_HANDLING.tagNameCheck),u.CUSTOM_ELEMENT_HANDLING&&ts(u.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ae.attributeNameCheck=u.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),u.CUSTOM_ELEMENT_HANDLING&&typeof u.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ae.allowCustomizedBuiltInElements=u.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),St&&(fo=!1),Ei&&($t=!0),Ct&&(ie=I({},Hs),pe=[],Ct.html===!0&&(I(ie,Ns),I(pe,Vs)),Ct.svg===!0&&(I(ie,Lo),I(pe,Fo),I(pe,Fi)),Ct.svgFilters===!0&&(I(ie,Do),I(pe,Fo),I(pe,Fi)),Ct.mathMl===!0&&(I(ie,Ro),I(pe,Ws),I(pe,Fi))),u.ADD_TAGS&&(ie===Kt&&(ie=ft(ie)),I(ie,u.ADD_TAGS,ue)),u.ADD_ATTR&&(pe===ja&&(pe=ft(pe)),I(pe,u.ADD_ATTR,ue)),u.ADD_URI_SAFE_ATTR&&I(yo,u.ADD_URI_SAFE_ATTR,ue),u.FORBID_CONTENTS&&(kt===Xa&&(kt=ft(kt)),I(kt,u.FORBID_CONTENTS,ue)),bo&&(ie["#text"]=!0),dt&&I(ie,["html","head","body"]),ie.table&&(I(ie,["tbody"]),delete Yt.tbody),u.TRUSTED_TYPES_POLICY){if(typeof u.TRUSTED_TYPES_POLICY.createHTML!="function")throw ai('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof u.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ai('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');B=u.TRUSTED_TYPES_POLICY,Z=B.createHTML("")}else B===void 0&&(B=_d(w,o)),B!==null&&typeof Z=="string"&&(Z=B.createHTML(""));_e&&_e(u),Et=u}},is=I({},["mi","mo","mn","ms","mtext"]),os=I({},["annotation-xml"]),xn=I({},["title","style","font","a","script"]),as=I({},[...Lo,...Do,...cd]),ss=I({},[...Ro,...hd]),Sn=function(u){let _=W(u);(!_||!_.tagName)&&(_={namespaceURI:Tt,tagName:"template"});const E=Ii(u.tagName),j=Ii(_.tagName);return _o[u.namespaceURI]?u.namespaceURI===Pi?_.namespaceURI===Qe?E==="svg":_.namespaceURI===zi?E==="svg"&&(j==="annotation-xml"||is[j]):Boolean(as[E]):u.namespaceURI===zi?_.namespaceURI===Qe?E==="math":_.namespaceURI===Pi?E==="math"&&os[j]:Boolean(ss[E]):u.namespaceURI===Qe?_.namespaceURI===Pi&&!os[j]||_.namespaceURI===zi&&!is[j]?!1:!ss[E]&&(xn[E]||!as[E]):!!(Zt==="application/xhtml+xml"&&_o[u.namespaceURI]):!1},Fe=function(u){ii(e.removed,{element:u});try{W(u).removeChild(u)}catch{A(u)}},Ai=function(u,_){try{ii(e.removed,{attribute:_.getAttributeNode(u),from:_})}catch{ii(e.removed,{attribute:null,from:_})}if(_.removeAttribute(u),u==="is"&&!pe[u])if($t||Ei)try{Fe(_)}catch{}else try{_.setAttribute(u,"")}catch{}},rs=function(u){let _=null,E=null;if(go)u=""+u;else{const fe=Us(u,/^[\r\n\t ]+/);E=fe&&fe[0]}Zt==="application/xhtml+xml"&&Tt===Qe&&(u=''+u+"");const j=B?B.createHTML(u):u;if(Tt===Qe)try{_=new y().parseFromString(j,Zt)}catch{}if(!_||!_.documentElement){_=he.createDocument(Tt,"template",null);try{_.documentElement.innerHTML=wo?Z:j}catch{}}const ge=_.body||_.documentElement;return u&&E&&ge.insertBefore(t.createTextNode(E),ge.childNodes[0]||null),Tt===Qe?me.call(_,dt?"html":"body")[0]:dt?_.documentElement:ge},ns=function(u){return ze.call(u.ownerDocument||u,u,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},ls=function(u){return u instanceof m&&(typeof u.nodeName!="string"||typeof u.textContent!="string"||typeof u.removeChild!="function"||!(u.attributes instanceof f)||typeof u.removeAttribute!="function"||typeof u.setAttribute!="function"||typeof u.namespaceURI!="string"||typeof u.insertBefore!="function"||typeof u.hasChildNodes!="function")},ds=function(u){return typeof l=="function"&&u instanceof l},Ge=function(u,_,E){!Se[u]||Ri(Se[u],j=>{j.call(e,_,E,Et)})},cs=function(u){let _=null;if(Ge("beforeSanitizeElements",u,null),ls(u))return Fe(u),!0;const E=ue(u.nodeName);if(Ge("uponSanitizeElement",u,{tagName:E,allowedTags:ie}),u.hasChildNodes()&&!ds(u.firstElementChild)&&ye(/<[/\w]/g,u.innerHTML)&&ye(/<[/\w]/g,u.textContent)||u.nodeType===ri.progressingInstruction||vo&&u.nodeType===ri.comment&&ye(/<[/\w]/g,u.data))return Fe(u),!0;if(!ie[E]||Yt[E]){if(!Yt[E]&&ps(E)&&(ae.tagNameCheck instanceof RegExp&&ye(ae.tagNameCheck,E)||ae.tagNameCheck instanceof Function&&ae.tagNameCheck(E)))return!1;if(bo&&!kt[E]){const j=W(u)||u.parentNode,ge=R(u)||u.childNodes;if(ge&&j){const fe=ge.length;for(let $e=fe-1;$e>=0;--$e){const Be=C(ge[$e],!0);Be.__removalCount=(u.__removalCount||0)+1,j.insertBefore(Be,F(u))}}}return Fe(u),!0}return u instanceof d&&!Sn(u)||(E==="noscript"||E==="noembed"||E==="noframes")&&ye(/<\/no(script|embed|frames)/i,u.innerHTML)?(Fe(u),!0):(St&&u.nodeType===ri.text&&(_=u.textContent,Ri([rt,nt,lt],j=>{_=oi(_,j," ")}),u.textContent!==_&&(ii(e.removed,{element:u.cloneNode()}),u.textContent=_)),Ge("afterSanitizeElements",u,null),!1)},hs=function(u,_,E){if(Ka&&(_==="id"||_==="name")&&(E in t||E in _n))return!1;if(!(fo&&!uo[_]&&ye(jt,_))){if(!(qa&&ye(qt,_))){if(!pe[_]||uo[_]){if(!(ps(u)&&(ae.tagNameCheck instanceof RegExp&&ye(ae.tagNameCheck,u)||ae.tagNameCheck instanceof Function&&ae.tagNameCheck(u))&&(ae.attributeNameCheck instanceof RegExp&&ye(ae.attributeNameCheck,_)||ae.attributeNameCheck instanceof Function&&ae.attributeNameCheck(_))||_==="is"&&ae.allowCustomizedBuiltInElements&&(ae.tagNameCheck instanceof RegExp&&ye(ae.tagNameCheck,E)||ae.tagNameCheck instanceof Function&&ae.tagNameCheck(E))))return!1}else if(!yo[_]){if(!ye(xt,oi(E,_t,""))){if(!((_==="src"||_==="xlink:href"||_==="href")&&u!=="script"&&rd(E,"data:")===0&&Za[u])){if(!(Qa&&!ye(Qt,oi(E,_t,"")))){if(E)return!1}}}}}}return!0},ps=function(u){return u!=="annotation-xml"&&Us(u,Gt)},us=function(u){Ge("beforeSanitizeAttributes",u,null);const{attributes:_}=u;if(!_)return;const E={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:pe};let j=_.length;for(;j--;){const ge=_[j],{name:fe,namespaceURI:$e,value:Be}=ge,Jt=ue(fe);let be=fe==="value"?Be:nd(Be);if(E.attrName=Jt,E.attrValue=be,E.keepAttr=!0,E.forceKeepAttr=void 0,Ge("uponSanitizeAttribute",u,E),be=E.attrValue,E.forceKeepAttr||(Ai(fe,u),!E.keepAttr))continue;if(!Ga&&ye(/\/>/i,be)){Ai(fe,u);continue}St&&Ri([rt,nt,lt],vs=>{be=oi(be,vs," ")});const fs=ue(u.nodeName);if(!!hs(fs,Jt,be)){if(Ya&&(Jt==="id"||Jt==="name")&&(Ai(fe,u),be=gn+be),vo&&ye(/((--!?|])>)|<\/(style|title)/i,be)){Ai(fe,u);continue}if(B&&typeof w=="object"&&typeof w.getAttributeType=="function"&&!$e)switch(w.getAttributeType(fs,Jt)){case"TrustedHTML":{be=B.createHTML(be);break}case"TrustedScriptURL":{be=B.createScriptURL(be);break}}try{$e?u.setAttributeNS($e,fe,be):u.setAttribute(fe,be),ls(u)?Fe(u):Is(e.removed)}catch{}}}Ge("afterSanitizeAttributes",u,null)},$n=function z(u){let _=null;const E=ns(u);for(Ge("beforeSanitizeShadowDOM",u,null);_=E.nextNode();)Ge("uponSanitizeShadowNode",_,null),!cs(_)&&(_.content instanceof s&&z(_.content),us(_));Ge("afterSanitizeShadowDOM",u,null)};return e.sanitize=function(z){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_=null,E=null,j=null,ge=null;if(wo=!z,wo&&(z=""),typeof z!="string"&&!ds(z))if(typeof z.toString=="function"){if(z=z.toString(),typeof z!="string")throw ai("dirty is not a string, aborting")}else throw ai("toString is not a function");if(!e.isSupported)return z;if(mo||xo(u),e.removed=[],typeof z=="string"&&(Xt=!1),Xt){if(z.nodeName){const Be=ue(z.nodeName);if(!ie[Be]||Yt[Be])throw ai("root node is forbidden and cannot be sanitized in-place")}}else if(z instanceof l)_=rs(""),E=_.ownerDocument.importNode(z,!0),E.nodeType===ri.element&&E.nodeName==="BODY"||E.nodeName==="HTML"?_=E:_.appendChild(E);else{if(!$t&&!St&&!dt&&z.indexOf("<")===-1)return B&&Mi?B.createHTML(z):z;if(_=rs(z),!_)return $t?null:Mi?Z:""}_&&go&&Fe(_.firstChild);const fe=ns(Xt?z:_);for(;j=fe.nextNode();)cs(j)||(j.content instanceof s&&$n(j.content),us(j));if(Xt)return z;if($t){if(Ei)for(ge=ee.call(_.ownerDocument);_.firstChild;)ge.appendChild(_.firstChild);else ge=_;return(pe.shadowroot||pe.shadowrootmode)&&(ge=Re.call(i,ge,!0)),ge}let $e=dt?_.outerHTML:_.innerHTML;return dt&&ie["!doctype"]&&_.ownerDocument&&_.ownerDocument.doctype&&_.ownerDocument.doctype.name&&ye(en,_.ownerDocument.doctype.name)&&($e=" +`+$e),St&&Ri([rt,nt,lt],Be=>{$e=oi($e,Be," ")}),B&&Mi?B.createHTML($e):$e},e.setConfig=function(){let z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};xo(z),mo=!0},e.clearConfig=function(){Et=null,mo=!1},e.isValidAttribute=function(z,u,_){Et||xo({});const E=ue(z),j=ue(u);return hs(E,j,_)},e.addHook=function(z,u){typeof u=="function"&&(Se[z]=Se[z]||[],ii(Se[z],u))},e.removeHook=function(z){if(Se[z])return Is(Se[z])},e.removeHooks=function(z){Se[z]&&(Se[z]=[])},e.removeAllHooks=function(){Se={}},e}var Ui=tn();let Yi=class extends ce{constructor(){super(...arguments),this.collectionLinks=[]}render(){return c` +
+ ${this.classSize==="mobile"?this.mobileTemplate:this.desktopTemplate} +
+ `}get mobileTemplate(){return c` +
+
${this.imageBlockTemplate}
+
+
+
${this.titleTemplate}
+ ${this.iconRightTemplate} +
+
+
+
${this.detailsTemplate}
+ `}get desktopTemplate(){return c` +
${this.imageBlockTemplate}
+
+
+
${this.titleTemplate}
+ ${this.iconRightTemplate} +
+ ${this.detailsTemplate} +
+ `}get imageBlockTemplate(){if(!this.model)return b;const e=this.model.mediatype==="collection",t=this.displayValueProvider.itemPageUrl(this.model.identifier,e);return c` + + + `}get detailsTemplate(){return c` + ${this.itemLineTemplate} ${this.creatorTemplate} +
+ ${this.datePublishedTemplate} ${this.dateSortByTemplate} + ${this.webArchivesCaptureDatesTemplate} +
+
+ ${this.viewsTemplate} ${this.ratingTemplate} ${this.reviewsTemplate} +
+ ${this.topicsTemplate} ${this.collectionsTemplate} + ${this.descriptionTemplate} ${this.textSnippetsTemplate} + ${this.reviewBlockTemplate} + `}get iconRightTemplate(){var e,t;return c` + + + + + `}get titleTemplate(){var e,t,i;return!((e=this.model)===null||e===void 0)&&e.title?!((t=this.model)===null||t===void 0)&&t.href?c`${(i=this.model.title)!==null&&i!==void 0?i:this.model.identifier}`:this.detailsLink(this.model.identifier,this.model.title,this.model.mediatype==="collection"):b}get itemLineTemplate(){const e=this.sourceTemplate,t=this.volumeTemplate,i=this.issueTemplate;return!e&&!t&&!i?b:c`
${e} ${t} ${i}
`}get sourceTemplate(){var e;return!((e=this.model)===null||e===void 0)&&e.source?c` + + `:b}get volumeTemplate(){var e;return this.metadataTemplate((e=this.model)===null||e===void 0?void 0:e.volume,k("Volume"))}get issueTemplate(){var e;return this.metadataTemplate((e=this.model)===null||e===void 0?void 0:e.issue,k("Issue"))}get creatorTemplate(){var e,t,i;return((e=this.model)===null||e===void 0?void 0:e.mediatype)==="account"?c` + + `:!(!((i=this.model)===null||i===void 0)&&i.creators)||this.model.creators.length===0?b:c` + + `}get datePublishedTemplate(){var e;const t=(e=this.model)===null||e===void 0?void 0:e.datePublished;let i="long";return Ua(t)&&(i="year-only"),this.metadataTemplate(vi(t,i),k("Published"))}get dateSortByTemplate(){return this.effectiveSort&&(this.effectiveSort.field==="addeddate"||this.effectiveSort.field==="reviewdate"||this.effectiveSort.field==="publicdate")?this.metadataTemplate(vi(this.date,"long"),this.displayValueProvider.dateLabel):b}get viewsTemplate(){var e,t,i,o;const s=((e=this.effectiveSort)===null||e===void 0?void 0:e.field)==="week"?(t=this.model)===null||t===void 0?void 0:t.weeklyViewCount:(i=this.model)===null||i===void 0?void 0:i.viewCount;return s==null?b:((o=this.model)===null||o===void 0?void 0:o.mediatype)==="search"?this.metadataTemplate("(Favorited search query)",""):this.metadataTemplate(`${ci(s,this.formatSize)}`,k("Views"))}get ratingTemplate(){var e;return this.metadataTemplate((e=this.model)===null||e===void 0?void 0:e.averageRating,k("Avg Rating"))}get reviewsTemplate(){var e;return this.metadataTemplate((e=this.model)===null||e===void 0?void 0:e.commentCount,k("Reviews"))}get topicsTemplate(){var e;return!(!((e=this.model)===null||e===void 0)&&e.subjects)||this.model.subjects.length===0?b:c` + + `}get collectionsTemplate(){return!this.collectionLinks||this.collectionLinks.length===0?b:c` + + `}get descriptionTemplate(){var e,t,i;return this.metadataTemplate(id(Ui.sanitize((i=(t=(e=this.model)===null||e===void 0?void 0:e.description)===null||t===void 0?void 0:t.replace(/\n/g," "))!==null&&i!==void 0?i:"")),"","description")}get reviewBlockTemplate(){var e;if(!(!((e=this.model)===null||e===void 0)&&e.review))return b;const{title:t,body:i,stars:o}=this.model.review;return c` + + + `}get textSnippetsTemplate(){var e;return this.hasSnippets?c``:b}get hasSnippets(){var e,t;return!!(!((t=(e=this.model)===null||e===void 0?void 0:e.snippets)===null||t===void 0)&&t.length)}get webArchivesCaptureDatesTemplate(){var e;return!(!((e=this.model)===null||e===void 0)&&e.captureDates)||!this.model.title?b:c` +
    + ${gt(this.model.captureDates,t=>c`
  • + ${this.displayValueProvider.webArchivesCaptureLink(this.model.title,t)} +
  • `)} +
+ `}metadataTemplate(e,t="",i){return e?c` + + `:b}labelTemplate(e){return c` ${e?c`${e}: `:b}`}searchLink(e,t){if(!e||!t)return b;const i=encodeURIComponent(`${e}:"${t}"`);return c` + ${Ui.sanitize(t)}`}detailsLink(e,t,i=!1){if(!e)return b;const o=t!=null?t:e,s=this.displayValueProvider.itemPageUrl(e,i);return c` ${Ui.sanitize(o)} `}get mediatypeURL(){var e;if(this.baseNavigationUrl===void 0||!(!((e=this.model)===null||e===void 0)&&e.mediatype))return b;switch(this.model.mediatype){case"collection":return`${this.baseNavigationUrl}/search?query=mediatype:collection&sort=-downloads`;case"account":return b;default:return this.displayValueProvider.itemPageUrl(this.model.mediatype,!0)}}updated(e){(e.has("model")||e.has("collectionTitles"))&&this.buildCollectionLinks()}async buildCollectionLinks(){var e,t,i;if(!(!((e=this.model)===null||e===void 0)&&e.collections)||this.model.collections.length===0)return;this.collectionLinks=[];const o=[];for(const s of this.model.collections)!ro[s]&&!s.startsWith("fav-")&&o.push(this.detailsLink(s,(i=(t=this.collectionTitles)===null||t===void 0?void 0:t.get(s))!==null&&i!==void 0?i:s,!0));this.collectionLinks=o}get date(){var e,t,i,o,s;switch((e=this.effectiveSort)===null||e===void 0?void 0:e.field){case"date":return(t=this.model)===null||t===void 0?void 0:t.datePublished;case"reviewdate":return(i=this.model)===null||i===void 0?void 0:i.dateReviewed;case"addeddate":return(o=this.model)===null||o===void 0?void 0:o.dateAdded;default:return(s=this.model)===null||s===void 0?void 0:s.dateArchived}}get effectiveSort(){var e;return(e=this.sortParam)!==null&&e!==void 0?e:this.defaultSortParam}get classSize(){return this.mobileBreakpoint&&this.currentWidth&&this.currentWidth a { + display: inline-block; + } + + #icon { + padding-top: 5px; + } + + #description { + padding-top: 10px; + } + + /* Top level container */ + #list-line { + display: flex; + } + + #list-line.mobile { + flex-direction: column; + } + + #list-line.desktop { + column-gap: 10px; + } + + #list-line-top { + display: flex; + column-gap: 7px; + } + + #list-line-bottom { + padding-top: 4px; + } + + #list-line-right, + #list-line-top, + #list-line-bottom { + width: 100%; + } + + /* + * If the container becomes very tiny, don't let the thumbnail side take + * up too much space. Shouldn't make a difference on ordinary viewport sizes. + */ + #list-line-left { + max-width: 25%; + + display: flex; + flex-direction: column; + row-gap: 5px; + } + + div a:hover { + text-decoration: underline; + } + + /* Lines containing multiple div as row */ + #item-line, + #dates-line, + #views-line, + #title-line { + display: flex; + flex-direction: row; + column-gap: 10px; + } + + /* + * With the exception of the title line, allow these to wrap if + * the space becomes too small to accommodate them together. + * + * The title line is excluded because it contains the mediatype icon + * which we don't want to wrap. + */ + #item-line, + #dates-line, + #views-line { + flex-wrap: wrap; + } + + .capture-dates { + margin: 0; + padding: 0; + list-style-type: none; + } + + .capture-dates a:link { + text-decoration: none; + color: var(--ia-theme-link-color, #4b64ff); + } + .capture-dates a:hover { + text-decoration: underline; + } + `}};r([h({type:Object})],Yi.prototype,"collectionTitles",void 0);r([P()],Yi.prototype,"collectionLinks",void 0);Yi=r([L("tile-list")],Yi);let Ve=class extends D{constructor(){super(...arguments),this.loggedIn=!1}render(){return c` +
+ ${this.headerTemplate} +
+ +
+
+ `}get headerTemplate(){var e,t,i,o;if(((e=this.model)===null||e===void 0?void 0:e.collections.length)===0)return b;let s="",n="";for(const l of((t=this.model)===null||t===void 0?void 0:t.collections)||[])if(!ro[l]&&!l.startsWith("fav-")){s=(o=(i=this.collectionTitles)===null||i===void 0?void 0:i.get(l))!==null&&o!==void 0?o:l,n=l;break}return n?c` + + `:b}static get styles(){const e=v`var(--hoverPaneHeaderBGColor, #edf0ff)`,t=v`var(--ia-theme-link-color, #4b64ff)`,i=v`var(--ia-theme-base-font-family, "Helvetica Neue", Helvetica, Arial, sans-serif);`;return v` + :host { + visibility: hidden; + opacity: 0; + transform: translateY(8px); + transition: opacity 0.1s ease-in, transform 0.1s ease-in; + --image-width: auto; + } + + :host(.visible) { + visibility: visible; + } + + :host(.fade-in) { + opacity: 1; + transform: translateY(0); + } + + @media (prefers-reduced-motion: reduce) { + :host { + transition-duration: 0.001s !important; /* Imperceptibly fast */ + } + } + + #container { + width: max-content; + max-width: min(45vw, 600px); + border: 1px solid #ddd; + border-radius: 4px; + box-shadow: 4px 4px 8px 0 rgba(0, 0, 0, 0.8); + background: white; + } + + @media screen and (max-width: 600px) { + #container { + max-width: 80vw; + } + } + + /* main tile-list container */ + #hover-tile-list { + padding: 10px; + } + + /* header on hover panel to show collection icon and title */ + #list-line-header { + background: ${e}; + } + #list-line-header a { + display: flex; + align-items: center; + column-gap: 5px; + height: 3.4rem; + padding: 0 10px; + width: fit-content; + font-size: 1.4rem; + color: ${t}; + font-family: ${i}; + text-decoration: none; + width: auto; + } + #list-line-header a span { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + #list-line-header a:hover { + text-decoration: underline; + } + #list-line-header a img { + width: 30px; + max-height: 30px; + } + `}};r([h({type:Object})],Ve.prototype,"model",void 0);r([h({type:String})],Ve.prototype,"baseNavigationUrl",void 0);r([h({type:String})],Ve.prototype,"baseImageUrl",void 0);r([h({type:Boolean})],Ve.prototype,"loggedIn",void 0);r([h({type:Object})],Ve.prototype,"sortParam",void 0);r([h({type:Number})],Ve.prototype,"mobileBreakpoint",void 0);r([h({type:Number})],Ve.prototype,"currentWidth",void 0);r([h({type:Object})],Ve.prototype,"collectionTitles",void 0);Ve=r([L("tile-hover-pane")],Ve);let qs=class extends ce{render(){var e,t,i,o,s,n;return c` +
+ + + ${Ui.sanitize((t=(e=this.model)===null||e===void 0?void 0:e.title)!==null&&t!==void 0?t:"")} +
+ ${((i=this.model)===null||i===void 0?void 0:i.mediatype)==="account"?this.displayValueProvider.accountLabel:this.creator} +
+
${vi(this.date,this.dateFormatSize)}
+
+ + +
+
${ci((n=this.views)!==null&&n!==void 0?n:0,this.formatSize)}
+
+ `}get href(){var e;return!(!((e=this.model)===null||e===void 0)&&e.identifier)||this.baseNavigationUrl==null?b:this.model.href?`${this.baseNavigationUrl}${this.model.href}`:this.displayValueProvider.itemPageUrl(this.model.identifier,this.model.mediatype==="collection")}get creator(){var e;return(e=this.displayValueProvider.firstCreatorMatchingFilter)!==null&&e!==void 0?e:b}get date(){var e,t,i,o,s;switch((e=this.effectiveSort)===null||e===void 0?void 0:e.field){case"publicdate":return(t=this.model)===null||t===void 0?void 0:t.dateArchived;case"reviewdate":return(i=this.model)===null||i===void 0?void 0:i.dateReviewed;case"addeddate":return(o=this.model)===null||o===void 0?void 0:o.dateAdded;default:return(s=this.model)===null||s===void 0?void 0:s.datePublished}}get views(){var e,t,i;return((e=this.effectiveSort)===null||e===void 0?void 0:e.field)==="week"?(t=this.model)===null||t===void 0?void 0:t.weeklyViewCount:(i=this.model)===null||i===void 0?void 0:i.viewCount}get effectiveSort(){var e;return(e=this.sortParam)!==null&&e!==void 0?e:this.defaultSortParam}get classSize(){return this.mobileBreakpoint&&this.currentWidth&&this.currentWidth +
+
${k("Title")}
+
${k("Creator")}
+
+ ${this.displayValueProvider.dateLabel||k("Published")} +
+
${k("Type")}
+
${k("Views")}
+ + `}get classSize(){return this.mobileBreakpoint&&this.currentWidth&&this.currentWidthMath.max(e,Math.min(a,t));class xd{constructor(e,t={}){var i,o,s,n,l,d,p;this.host=e,this.mobileBreakpoint=600,this.offsetX=-10,this.offsetY=15,this.showDelay=300,this.hideDelay=100,this.longPressDelay=600,this.enableLongPress=!1,this.hoverPaneState="hidden",this.forceTouchBackdrop=!1,this.lastPointerClientPos={x:0,y:0},this.handleMouseEnter=f=>{this.handleMouseMove(f)},this.handleMouseMove=f=>{var m;clearTimeout(this.hideTimer),this.hoverPaneState==="fading-out"&&(this.hoverPaneState="shown",(m=this.hoverPane)===null||m===void 0||m.classList.add("fade-in")),this.hoverPaneState==="hidden"&&(this.restartShowHoverPaneTimer(),this.lastPointerClientPos={x:f.clientX,y:f.clientY})},this.handleMouseLeave=()=>{clearTimeout(this.showTimer),clearTimeout(this.hideTimer),this.hoverPaneState!=="hidden"&&(this.hideTimer=window.setTimeout(()=>{this.fadeOutHoverPane()},this.hideDelay))},this.handleTouchStart=f=>{clearTimeout(this.longPressTimer),f.touches.length===1&&(this.longPressTimer=window.setTimeout(()=>{this.hoverPaneState==="hidden"&&this.showHoverPane()},this.longPressDelay),this.lastPointerClientPos={x:f.touches[0].clientX,y:f.touches[0].clientY})},this.handleLongPressCancel=()=>{clearTimeout(this.longPressTimer)},this.handleContextMenu=f=>{f.preventDefault()},this.handleBackdropInteraction=f=>{this.hoverPaneState!=="hidden"&&this.fadeOutHoverPane(),f.stopPropagation()},this.mobileBreakpoint=(i=t.mobileBreakpoint)!==null&&i!==void 0?i:this.mobileBreakpoint,this.offsetX=(o=t.offsetX)!==null&&o!==void 0?o:this.offsetX,this.offsetY=(s=t.offsetY)!==null&&s!==void 0?s:this.offsetY,this.showDelay=(n=t.showDelay)!==null&&n!==void 0?n:this.showDelay,this.hideDelay=(l=t.hideDelay)!==null&&l!==void 0?l:this.hideDelay,this.longPressDelay=(d=t.longPressDelay)!==null&&d!==void 0?d:this.longPressDelay,this.enableLongPress=(p=t.enableLongPress)!==null&&p!==void 0?p:this.enableLongPress,this.host.addController(this)}hostConnected(){this.attachListeners()}hostDisconnected(){this.detachListeners()}hostUpdated(){this.hoverPane=this.host.getHoverPane(),this.hoverPaneProps=this.host.getHoverPaneProps()}getTemplate(){var e,t,i,o,s,n;return this.shouldRenderHoverPane?c` ${this.touchBackdropTemplate} + `:b}toggleHoverPane(e){var t;this.hoverPaneState==="shown"?(this.fadeOutHoverPane(),this.forceTouchBackdrop=!1):(this.lastPointerClientPos=e.coords,this.forceTouchBackdrop=(t=e.enableTouchBackdrop)!==null&&t!==void 0?t:!1,this.showHoverPane())}get touchBackdropTemplate(){return this.showTouchBackdrop?c`
e.stopPropagation()} + @mousemove=${e=>e.stopPropagation()} + @mouseleave=${e=>e.stopPropagation()} + >
`:b}get showTouchBackdrop(){return this.isTouchEnabled&&this.enableLongPress||this.forceTouchBackdrop}get isMobileView(){return!!this.mobileBreakpoint&&window.innerWidthwindow.innerWidth/2,s=this.lastPointerClientPos.y>window.innerHeight/2,n=(e=this.hoverPane)===null||e===void 0?void 0:e.getBoundingClientRect();n&&(o&&(t-=n.width),s&&(i-=n.height),t+=(o?-1:1)*this.offsetX,i+=(s?-1:1)*this.offsetY,this.isMobileView&&(t=Gs(t,20,window.innerWidth-n.width-20),i=Gs(i,20,window.innerHeight-n.height-20)));const l=this.host.getBoundingClientRect();return t-=l.left,i-=l.top,{left:t,top:i}}attachListeners(){this.isHoverEnabled&&(this.host.addEventListener("mouseenter",this.handleMouseEnter),this.host.addEventListener("mousemove",this.handleMouseMove),this.host.addEventListener("mouseleave",this.handleMouseLeave)),this.isTouchEnabled&&this.enableLongPress&&(this.host.addEventListener("touchstart",this.handleTouchStart),this.host.addEventListener("touchmove",this.handleLongPressCancel),this.host.addEventListener("touchend",this.handleLongPressCancel),this.host.addEventListener("touchcancel",this.handleLongPressCancel),this.host.addEventListener("contextmenu",this.handleContextMenu))}detachListeners(){this.host.removeEventListener("mouseenter",this.handleMouseEnter),this.host.removeEventListener("mousemove",this.handleMouseMove),this.host.removeEventListener("mouseleave",this.handleMouseLeave),this.host.removeEventListener("touchstart",this.handleTouchStart),this.host.removeEventListener("touchmove",this.handleLongPressCancel),this.host.removeEventListener("touchend",this.handleLongPressCancel),this.host.removeEventListener("touchcancel",this.handleLongPressCancel),this.host.removeEventListener("contextmenu",this.handleContextMenu)}restartShowHoverPaneTimer(){clearTimeout(this.showTimer),this.showTimer=window.setTimeout(()=>{this.showHoverPane()},this.showDelay)}async showHoverPane(){var e;this.hoverPaneState="shown",this.host.requestUpdate(),await this.host.updateComplete,await new Promise(t=>{requestAnimationFrame(t)}),this.repositionHoverPane(),(e=this.hoverPane)===null||e===void 0||e.classList.add("visible","fade-in")}fadeOutHoverPane(){var e;this.hoverPaneState="fading-out",(e=this.hoverPane)===null||e===void 0||e.classList.remove("fade-in"),clearTimeout(this.hideTimer),this.hideTimer=window.setTimeout(()=>{this.hoverPaneState="hidden",this.host.requestUpdate()},100)}repositionHoverPane(){if(!this.hoverPane)return;const{top:e,left:t}=this.hoverPaneDesiredOffsets;this.hoverPane.style.top=`${e}px`,this.hoverPane.style.left=`${t}px`}}var wa;let Le=wa=class extends ce{constructor(){super(...arguments),this.isManageView=!1,this.enableHoverPane=!1,this.manageCheckTitle=k("Remove this item from the list")}render(){var e,t;const i=this.tileDisplayMode==="grid",o=(t=(e=this.hoverPaneController)===null||e===void 0?void 0:e.getTemplate())!==null&&t!==void 0?t:b;return c` +
+ ${this.tileDisplayMode==="list-header"?this.headerTemplate:this.tileTemplate} + ${this.manageCheckTemplate} ${o} +
+ `}firstUpdated(){this.shouldPrepareHoverPane&&(this.hoverPaneController=new xd(this,{mobileBreakpoint:this.mobileBreakpoint,enableLongPress:!1}))}get headerTemplate(){const{currentWidth:e,sortParam:t,defaultSortParam:i,mobileBreakpoint:o}=this;return c` + + + `}get tileTemplate(){return c` + ${this.tileDisplayMode==="list-detail"?this.tile:this.linkTileTemplate} + `}get linkTileTemplate(){var e,t,i;return c` + + ${this.tile} + + `}get linkTileHref(){var e;return!(!((e=this.model)===null||e===void 0)&&e.identifier)||this.baseNavigationUrl==null?b:this.model.href?`${this.baseNavigationUrl}${this.model.href}`:this.displayValueProvider.itemPageUrl(this.model.identifier,this.model.mediatype==="collection")}get manageCheckTemplate(){var e;return!this.isManageView||this.tileDisplayMode!=="grid"?b:c` +
+ +
+ `}get shouldPrepareHoverPane(){var e,t;return this.enableHoverPane&&!!this.tileDisplayMode&&wa.HOVER_PANE_DISPLAY_MODES[this.tileDisplayMode]&&((e=this.model)===null||e===void 0?void 0:e.mediatype)!=="search"&&!(!((t=this.model)===null||t===void 0)&&t.captureDates)}get isHoverEnabled(){return window.matchMedia("(hover: hover)").matches}getHoverPane(){return this.hoverPane}getHoverPaneProps(){return this}handleResize(e){this.currentWidth=e.contentRect.width,this.currentHeight=e.contentRect.height}disconnectedCallback(){this.stopResizeObservation(this.resizeObserver)}stopResizeObservation(e){e==null||e.removeObserver({handler:this,target:this.container})}startResizeObservation(){var e;this.stopResizeObservation(this.resizeObserver),(e=this.resizeObserver)===null||e===void 0||e.addObserver({handler:this,target:this.container})}updated(e){if(e.has("resizeObserver")){const t=e.get("resizeObserver");this.stopResizeObservation(t),this.startResizeObservation()}}handleLinkClicked(e){this.isManageView&&(e.preventDefault(),this.model&&(this.model.checked=!this.model.checked)),this.dispatchEvent(new CustomEvent("resultSelected",{detail:this.model}))}handleLinkContextMenu(e){this.isManageView&&this.linkTileHref!==b&&(e.preventDefault(),window.open(this.linkTileHref,"_blank"))}tileInfoButtonPressed(e){var t;(t=this.hoverPaneController)===null||t===void 0||t.toggleHoverPane({coords:e.detail,enableTouchBackdrop:!0})}get tile(){const{model:e,collectionPagePath:t,baseNavigationUrl:i,currentWidth:o,currentHeight:s,sortParam:n,creatorFilter:l,mobileBreakpoint:d,defaultSortParam:p}=this;if(!e)return b;switch(this.tileDisplayMode){case"grid":switch(e.mediatype){case"collection":return c` + `;case"account":return c` + `;case"search":return c` + `;default:return c` + `}case"list-compact":return c` + `;case"list-detail":return c` + `;default:return b}}static get styles(){return v` + :host { + display: block; + height: 100%; + } + + collection-tile { + --tileBorderColor: #555555; + --tileBackgroundColor: #666666; + --imageBlockBackgroundColor: #666666; + } + + account-tile { + --tileBorderColor: #dddddd; + --imageBlockBackgroundColor: #fcf5e6; + } + + item-tile { + --tileBorderColor: #dddddd; + --imageBlockBackgroundColor: #f1f1f4; + } + + search-tile { + --tileBorderColor: #555555; + --tileBackgroundColor: #666666; + --imageBlockBackgroundColor: #666666; + --iconFillColor: #2c2c2c; + } + + #container { + position: relative; + height: 100%; + border-radius: 4px; + } + + #container.hoverable:hover { + box-shadow: 0 0 6px 2px rgba(8, 8, 32, 0.8); + transition: box-shadow 0.1s ease; + } + + a { + display: block; + height: 100%; + color: unset; + text-decoration: none; + transition: transform 0.05s ease; + } + + a :first-child { + display: block; + height: 100%; + } + + .manage-check { + position: absolute; + right: 0; + top: 0; + border: 5px solid #2c2c2c; + border-radius: 3px; + background-color: #2c2c2c; + z-index: 1; + } + + .manage-check > input[type='checkbox'] { + display: block; + margin: 0; + } + + #touch-backdrop { + position: fixed; + width: 100vw; + height: 100vh; + top: 0; + left: 0; + z-index: 2; + background: transparent; + } + + tile-hover-pane { + position: absolute; + top: 0; + left: -9999px; + z-index: 2; + } + `}};Le.HOVER_PANE_DISPLAY_MODES={grid:!0,"list-compact":!0,"list-detail":!1,"list-header":!1};r([h({type:String})],Le.prototype,"tileDisplayMode",void 0);r([h({type:Boolean})],Le.prototype,"isManageView",void 0);r([h({type:Object})],Le.prototype,"resizeObserver",void 0);r([h({type:Object})],Le.prototype,"collectionTitles",void 0);r([h({type:Boolean})],Le.prototype,"enableHoverPane",void 0);r([h({type:String})],Le.prototype,"manageCheckTitle",void 0);r([G("#container")],Le.prototype,"container",void 0);r([G("tile-hover-pane")],Le.prototype,"hoverPane",void 0);Le=wa=r([L("tile-dispatcher")],Le);let Ks=class extends D{render(){return c`
`}static get styles(){return v` + :host { + display: block; + height: 100%; + } + + #container { + background: linear-gradient(to right bottom, #dddddd, #d8d8d8); + border-radius: var(--tileCornerRadius, 4px); + background-size: 100% 100%; + display: block; + height: 100%; + } + `}};Ks=r([L("collection-browser-loading-tile")],Ks);/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Ni=window,Na=Ni.ShadowRoot&&(Ni.ShadyCSS===void 0||Ni.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,on=Symbol(),Ys=new WeakMap;class Sd{constructor(e,t,i){if(this._$cssResult$=!0,i!==on)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(Na&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=Ys.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Ys.set(t,e))}return e}toString(){return this.cssText}}const $d=a=>new Sd(typeof a=="string"?a:a+"",void 0,on),Cd=(a,e)=>{Na?a.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet):e.forEach(t=>{const i=document.createElement("style"),o=Ni.litNonce;o!==void 0&&i.setAttribute("nonce",o),i.textContent=t.cssText,a.appendChild(i)})},Xs=Na?a=>a:a=>a instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return $d(t)})(a):a;/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var Bo;const Xi=window,Zs=Xi.trustedTypes,kd=Zs?Zs.emptyScript:"",Js=Xi.reactiveElementPolyfillSupport,_a={toAttribute(a,e){switch(e){case Boolean:a=a?kd:null;break;case Object:case Array:a=a==null?a:JSON.stringify(a)}return a},fromAttribute(a,e){let t=a;switch(e){case Boolean:t=a!==null;break;case Number:t=a===null?null:Number(a);break;case Object:case Array:try{t=JSON.parse(a)}catch{t=null}}return t}},an=(a,e)=>e!==a&&(e==e||a==a),Oo={attribute:!0,type:String,converter:_a,reflect:!1,hasChanged:an},xa="finalized";class ni extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var t;this.finalize(),((t=this.h)!==null&&t!==void 0?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach((t,i)=>{const o=this._$Ep(i,t);o!==void 0&&(this._$Ev.set(o,i),e.push(o))}),e}static createProperty(e,t=Oo){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const i=typeof e=="symbol"?Symbol():"__"+e,o=this.getPropertyDescriptor(e,i,t);o!==void 0&&Object.defineProperty(this.prototype,e,o)}}static getPropertyDescriptor(e,t,i){return{get(){return this[t]},set(o){const s=this[e];this[t]=o,this.requestUpdate(e,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||Oo}static finalize(){if(this.hasOwnProperty(xa))return!1;this[xa]=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,i=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const o of i)this.createProperty(o,t[o])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const o of i)t.unshift(Xs(o))}else e!==void 0&&t.push(Xs(e));return t}static _$Ep(e,t){const i=t.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(t=>t(this))}addController(e){var t,i;((t=this._$ES)!==null&&t!==void 0?t:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((i=e.hostConnected)===null||i===void 0||i.call(e))}removeController(e){var t;(t=this._$ES)===null||t===void 0||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])})}createRenderRoot(){var e;const t=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return Cd(t,this.constructor.elementStyles),t}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(t=>{var i;return(i=t.hostConnected)===null||i===void 0?void 0:i.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(t=>{var i;return(i=t.hostDisconnected)===null||i===void 0?void 0:i.call(t)})}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EO(e,t,i=Oo){var o;const s=this.constructor._$Ep(e,i);if(s!==void 0&&i.reflect===!0){const n=(((o=i.converter)===null||o===void 0?void 0:o.toAttribute)!==void 0?i.converter:_a).toAttribute(t,i.type);this._$El=e,n==null?this.removeAttribute(s):this.setAttribute(s,n),this._$El=null}}_$AK(e,t){var i;const o=this.constructor,s=o._$Ev.get(e);if(s!==void 0&&this._$El!==s){const n=o.getPropertyOptions(s),l=typeof n.converter=="function"?{fromAttribute:n.converter}:((i=n.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?n.converter:_a;this._$El=s,this[s]=l.fromAttribute(t,n.type),this._$El=null}}requestUpdate(e,t,i){let o=!0;e!==void 0&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||an)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),i.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,i))):o=!1),!this.isUpdatePending&&o&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((o,s)=>this[s]=o),this._$Ei=void 0);let t=!1;const i=this._$AL;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),(e=this._$ES)===null||e===void 0||e.forEach(o=>{var s;return(s=o.hostUpdate)===null||s===void 0?void 0:s.call(o)}),this.update(i)):this._$Ek()}catch(o){throw t=!1,this._$Ek(),o}t&&this._$AE(i)}willUpdate(e){}_$AE(e){var t;(t=this._$ES)===null||t===void 0||t.forEach(i=>{var o;return(o=i.hostUpdated)===null||o===void 0?void 0:o.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((t,i)=>this._$EO(i,this[i],t)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}}ni[xa]=!0,ni.elementProperties=new Map,ni.elementStyles=[],ni.shadowRootOptions={mode:"open"},Js==null||Js({ReactiveElement:ni}),((Bo=Xi.reactiveElementVersions)!==null&&Bo!==void 0?Bo:Xi.reactiveElementVersions=[]).push("1.6.3");/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var Io;const Zi=window,Ot=Zi.trustedTypes,er=Ot?Ot.createPolicy("lit-html",{createHTML:a=>a}):void 0,Sa="$lit$",it=`lit$${(Math.random()+"").slice(9)}$`,sn="?"+it,Td=`<${sn}>`,wt=document,gi=()=>wt.createComment(""),bi=a=>a===null||typeof a!="object"&&typeof a!="function",rn=Array.isArray,Ed=a=>rn(a)||typeof(a==null?void 0:a[Symbol.iterator])=="function",Uo=`[ +\f\r]`,li=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,tr=/-->/g,ir=/>/g,pt=RegExp(`>|${Uo}(?:([^\\s"'>=/]+)(${Uo}*=${Uo}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),or=/'/g,ar=/"/g,nn=/^(?:script|style|textarea|title)$/i,ln=a=>(e,...t)=>({_$litType$:a,strings:e,values:t}),Ee=ln(1),dn=ln(2),It=Symbol.for("lit-noChange"),oe=Symbol.for("lit-nothing"),sr=new WeakMap,mt=wt.createTreeWalker(wt,129,null,!1);function cn(a,e){if(!Array.isArray(a)||!a.hasOwnProperty("raw"))throw Error("invalid template strings array");return er!==void 0?er.createHTML(e):e}const Md=(a,e)=>{const t=a.length-1,i=[];let o,s=e===2?"":"",n=li;for(let l=0;l"?(n=o!=null?o:li,m=-1):f[1]===void 0?m=-2:(m=n.lastIndex-f[2].length,p=f[1],n=f[3]===void 0?pt:f[3]==='"'?ar:or):n===ar||n===or?n=pt:n===tr||n===ir?n=li:(n=pt,o=void 0);const w=n===pt&&a[l+1].startsWith("/>")?" ":"";s+=n===li?d+Td:m>=0?(i.push(p),d.slice(0,m)+Sa+d.slice(m)+it+w):d+it+(m===-2?(i.push(void 0),l):w)}return[cn(a,s+(a[t]||"")+(e===2?"":"")),i]};class yi{constructor({strings:e,_$litType$:t},i){let o;this.parts=[];let s=0,n=0;const l=e.length-1,d=this.parts,[p,f]=Md(e,t);if(this.el=yi.createElement(p,i),mt.currentNode=this.el.content,t===2){const m=this.el.content,y=m.firstChild;y.remove(),m.append(...y.childNodes)}for(;(o=mt.nextNode())!==null&&d.length0){o.textContent=Ot?Ot.emptyScript:"";for(let w=0;w2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=oe}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,i,o){const s=this.strings;let n=!1;if(s===void 0)e=Ut(this,e,t,0),n=!bi(e)||e!==this._$AH&&e!==It,n&&(this._$AH=e);else{const l=e;let d,p;for(e=s[0],d=0;d{var i,o;const s=(i=t==null?void 0:t.renderBefore)!==null&&i!==void 0?i:e;let n=s._$litPart$;if(n===void 0){const l=(o=t==null?void 0:t.renderBefore)!==null&&o!==void 0?o:null;s._$litPart$=n=new Ti(e.insertBefore(gi(),l),l,void 0,t!=null?t:{})}return n._$AI(a),n};/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Ha=window.ShadowRoot&&(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Va=Symbol(),nr=new Map;class hn{constructor(e,t){if(this._$cssResult$=!0,t!==Va)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){let e=nr.get(this.cssText);return Ha&&e===void 0&&(nr.set(this.cssText,e=new CSSStyleSheet),e.replaceSync(this.cssText)),e}toString(){return this.cssText}}const Bd=a=>new hn(typeof a=="string"?a:a+"",Va),Ke=(a,...e)=>{const t=a.length===1?a[0]:e.reduce((i,o,s)=>i+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+a[s+1],a[0]);return new hn(t,Va)},Od=(a,e)=>{Ha?a.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet):e.forEach(t=>{const i=document.createElement("style"),o=window.litNonce;o!==void 0&&i.setAttribute("nonce",o),i.textContent=t.cssText,a.appendChild(i)})},lr=Ha?a=>a:a=>a instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return Bd(t)})(a):a;/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var No;const dr=window.trustedTypes,Id=dr?dr.emptyScript:"",cr=window.reactiveElementPolyfillSupport,$a={toAttribute(a,e){switch(e){case Boolean:a=a?Id:null;break;case Object:case Array:a=a==null?a:JSON.stringify(a)}return a},fromAttribute(a,e){let t=a;switch(e){case Boolean:t=a!==null;break;case Number:t=a===null?null:Number(a);break;case Object:case Array:try{t=JSON.parse(a)}catch{t=null}}return t}},pn=(a,e)=>e!==a&&(e==e||a==a),Ho={attribute:!0,type:String,converter:$a,reflect:!1,hasChanged:pn};class zt extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o()}static addInitializer(e){var t;(t=this.l)!==null&&t!==void 0||(this.l=[]),this.l.push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach((t,i)=>{const o=this._$Eh(i,t);o!==void 0&&(this._$Eu.set(o,i),e.push(o))}),e}static createProperty(e,t=Ho){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const i=typeof e=="symbol"?Symbol():"__"+e,o=this.getPropertyDescriptor(e,i,t);o!==void 0&&Object.defineProperty(this.prototype,e,o)}}static getPropertyDescriptor(e,t,i){return{get(){return this[t]},set(o){const s=this[e];this[t]=o,this.requestUpdate(e,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||Ho}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),this.elementProperties=new Map(e.elementProperties),this._$Eu=new Map,this.hasOwnProperty("properties")){const t=this.properties,i=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const o of i)this.createProperty(o,t[o])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const o of i)t.unshift(lr(o))}else e!==void 0&&t.push(lr(e));return t}static _$Eh(e,t){const i=t.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}o(){var e;this._$Ep=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$Em(),this.requestUpdate(),(e=this.constructor.l)===null||e===void 0||e.forEach(t=>t(this))}addController(e){var t,i;((t=this._$Eg)!==null&&t!==void 0?t:this._$Eg=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((i=e.hostConnected)===null||i===void 0||i.call(e))}removeController(e){var t;(t=this._$Eg)===null||t===void 0||t.splice(this._$Eg.indexOf(e)>>>0,1)}_$Em(){this.constructor.elementProperties.forEach((e,t)=>{this.hasOwnProperty(t)&&(this._$Et.set(t,this[t]),delete this[t])})}createRenderRoot(){var e;const t=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return Od(t,this.constructor.elementStyles),t}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$Eg)===null||e===void 0||e.forEach(t=>{var i;return(i=t.hostConnected)===null||i===void 0?void 0:i.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$Eg)===null||e===void 0||e.forEach(t=>{var i;return(i=t.hostDisconnected)===null||i===void 0?void 0:i.call(t)})}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$ES(e,t,i=Ho){var o,s;const n=this.constructor._$Eh(e,i);if(n!==void 0&&i.reflect===!0){const l=((s=(o=i.converter)===null||o===void 0?void 0:o.toAttribute)!==null&&s!==void 0?s:$a.toAttribute)(t,i.type);this._$Ei=e,l==null?this.removeAttribute(n):this.setAttribute(n,l),this._$Ei=null}}_$AK(e,t){var i,o,s;const n=this.constructor,l=n._$Eu.get(e);if(l!==void 0&&this._$Ei!==l){const d=n.getPropertyOptions(l),p=d.converter,f=(s=(o=(i=p)===null||i===void 0?void 0:i.fromAttribute)!==null&&o!==void 0?o:typeof p=="function"?p:null)!==null&&s!==void 0?s:$a.fromAttribute;this._$Ei=l,this[l]=f(t,d.type),this._$Ei=null}}requestUpdate(e,t,i){let o=!0;e!==void 0&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||pn)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),i.reflect===!0&&this._$Ei!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,i))):o=!1),!this.isUpdatePending&&o&&(this._$Ep=this._$E_())}async _$E_(){this.isUpdatePending=!0;try{await this._$Ep}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Et&&(this._$Et.forEach((o,s)=>this[s]=o),this._$Et=void 0);let t=!1;const i=this._$AL;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),(e=this._$Eg)===null||e===void 0||e.forEach(o=>{var s;return(s=o.hostUpdate)===null||s===void 0?void 0:s.call(o)}),this.update(i)):this._$EU()}catch(o){throw t=!1,this._$EU(),o}t&&this._$AE(i)}willUpdate(e){}_$AE(e){var t;(t=this._$Eg)===null||t===void 0||t.forEach(i=>{var o;return(o=i.hostUpdated)===null||o===void 0?void 0:o.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Ep}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((t,i)=>this._$ES(i,this[i],t)),this._$EC=void 0),this._$EU()}updated(e){}firstUpdated(e){}}zt.finalized=!0,zt.elementProperties=new Map,zt.elementStyles=[],zt.shadowRootOptions={mode:"open"},cr==null||cr({ReactiveElement:zt}),((No=globalThis.reactiveElementVersions)!==null&&No!==void 0?No:globalThis.reactiveElementVersions=[]).push("1.3.2");/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var Vo,Wo;class At extends zt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;const i=super.createRenderRoot();return(e=(t=this.renderOptions).renderBefore)!==null&&e!==void 0||(t.renderBefore=i.firstChild),i}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Fd(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return It}}At.finalized=!0,At._$litElement$=!0,(Vo=globalThis.litElementHydrateSupport)===null||Vo===void 0||Vo.call(globalThis,{LitElement:At});const hr=globalThis.litElementPolyfillSupport;hr==null||hr({LitElement:At});((Wo=globalThis.litElementVersions)!==null&&Wo!==void 0?Wo:globalThis.litElementVersions=[]).push("3.3.3");/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const un=a=>e=>typeof e=="function"?((t,i)=>(customElements.define(t,i),i))(a,e):((t,i)=>{const{kind:o,elements:s}=i;return{kind:o,elements:s,finisher(n){customElements.define(t,n)}}})(a,e);/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Ud=(a,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?ne(q({},e),{finisher(t){t.createProperty(e.key,a)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(t){t.createProperty(e.key,a)}},Nd=(a,e,t)=>{e.constructor.createProperty(t,a)};function xe(a){return(e,t)=>t!==void 0?Nd(a,e,t):Ud(a,e)}/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var jo;((jo=window.HTMLSlotElement)===null||jo===void 0?void 0:jo.prototype.assignedElements)!=null;/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const pr=a=>a!=null?a:oe;var Hd=dn` + +`,Vd=dn` + +`;let ve=class extends At{constructor(){super(...arguments),this.open=!1,this.isDisabled=!1,this.displayCaret=!1,this.closeOnSelect=!1,this.openViaButton=!0,this.openViaCaret=!0,this.includeSelectedOption=!1,this.selectedOption="",this.options=[],this.optionGroup="options",this.optionSelected=()=>{},this.isCustomList=!1,this.hasCustomClickHandler=!1,this.closeOnEscape=!1,this.closeOnBackdropClick=!1,this.boundKeyboardListener=e=>{switch(e.key){case"Escape":case"Esc":this.closeOptions();break}},this.closeOptions=e=>{e&&e.type==="click"&&e.stopPropagation(),this.open=!1},this.handlingCaretClick=!1}async firstUpdated(){await new Promise(e=>setTimeout(e,0)),this.addEventListener("closeDropdown",this.closeOptions)}disconnectedCallback(){var e;(e=super.disconnectedCallback)===null||e===void 0||e.call(this),this.removeKeyboardListener()}setupKeyboardListener(){this.closeOnEscape&&document.addEventListener("keydown",this.boundKeyboardListener)}removeKeyboardListener(){this.closeOnEscape&&document.removeEventListener("keydown",this.boundKeyboardListener)}get dropdownState(){return this.open?(this.setupKeyboardListener(),"open"):(this.removeKeyboardListener(),"closed")}toggleOptions(){this.open=!this.open}mainButtonClicked(){if(this.handlingCaretClick){this.handlingCaretClick=!1;return}this.openViaButton&&this.toggleOptions()}caretInteracted(){this.openViaCaret&&this.toggleOptions()}caretClicked(){this.handlingCaretClick=!0,this.caretInteracted()}caretKeyDown(e){(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.caretInteracted())}renderOption(e){const{label:t,url:i=void 0,id:o}=e;let s;const n=this.selectedOption===o?"selected":"";return i?s=Ee`this.optionClicked(l,e)} + >${t}`:s=Ee``,Ee`
  • ${s}
  • `}optionClicked(e,t){var i;e.stopPropagation(),this.selectedOption!==t.id&&(this.selectedOption=t.id,this.dispatchEvent(new CustomEvent("optionSelected",{detail:{option:t}})),(i=t.selectedHandler)===null||i===void 0||i.call(t,t)),this.closeOnSelect&&this.closeOptions()}get availableOptions(){return this.includeSelectedOption?this.options:this.options.filter(e=>this.selectedOption!==e.id)}get caretTemplate(){if(!this.displayCaret)return Ee``;const e=this.openViaCaret&&!this.openViaButton?"0":void 0,t=this.openViaCaret?"button":void 0;return Ee` + + + ${Hd} + + + ${Vd} + + + `}get dropdownTemplate(){return this.isCustomList?Ee``:Ee`${this.availableOptions.map(e=>this.renderOption(e))}`}get backdropTemplate(){return this.closeOnBackdropClick?this.open?Ee` + + `:Ee``:Ee``}render(){return Ee` +
    + + + + + ${this.backdropTemplate} +
    + `}static get styles(){const e=Ke`var(--dropdownBorderWidth, 1px)`,t=Ke`var(--dropdownBorderRadius, 4px)`,i=Ke`var(--dropdownBorderColor, #fff)`,o=Ke`var(--dropdownBgColor, #333)`,s=Ke`var(--dropdownTextColor, #fff)`,n=Ke`var(--dropdownHoverBgColor, rgba(255, 255, 255, 0.3))`,l=Ke`var(--dropdownSelectedBgColor, #fff)`;return Ke` + :host { + display: inline; + color: ${s}; + } + + svg.caret-up-svg, + svg.caret-down-svg, + ::slotted(svg.caret-up-svg), + ::slotted(svg.caret-down-svg) { + fill: var(--dropdownCaretColor, #fff); + vertical-align: middle; + } + + button.click-main { + background: transparent; + color: inherit; + padding: var(--dropdownMainButtonPadding, 0px); + border: var(--dropdownMainButtonBorder, none); + border-radius: var(--dropdownMainButtonBorderRadius, none); + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + align-content: center; + flex-wrap: nowrap; + flex-direction: var(--dropdownMainButtonFlexDirection, row); + z-index: var(--dropdownListZIndex, 2); + } + + button.click-main:disabled { + pointer-events: none; + cursor: not-allowed; + opacity: 0.5; + /* Disable text selection on disabled button */ + -webkit-user-select: none; /* Safari */ + -ms-user-select: none; /* IE 10 and IE 11 */ + user-select: none; /* Standard syntax */ + } + + button.click-main:hover { + background-color: var(--dropdownMainButtonHoverBgColor, inherit); + } + + button.click-main:focus, + button.click-main:focus-visible { + background-color: var(--dropdownMainButtonFocusBgColor, inherit); + } + + button.click-main:active { + background-color: var(--dropdownMainButtonActiveBgColor, inherit); + } + + button slot[name='dropdown-label'] { + /* Set var to 0px for column layout */ + padding-right: var(--buttonSlotPaddingRight, 5px); + display: inline-block; + } + + .ia-dropdown-group { + width: inherit; + height: inherit; + position: relative; + } + + .sr-only { + border: 0 !important; + clip: rect(1px, 1px, 1px, 1px) !important; + -webkit-clip-path: inset(50%) !important; + clip-path: inset(50%) !important; + height: 1px !important; + margin: -1px !important; + overflow: hidden !important; + padding: 0 !important; + position: absolute !important; + width: 1px !important; + white-space: nowrap !important; + } + + .caret { + /* Maintain centered caret position but with a full-height clickable region */ + display: flex; + align-self: stretch; + align-items: center; + padding: var(--caretPadding, 0px); + } + + .caret svg { + height: var(--caretHeight, 10px); + width: var(--caretWidth, 20px); + } + + #dropdown-backdrop { + position: fixed; + top: 0; + left: 0; + width: 100vw; + height: 100vh; + background-color: transparent; + z-index: 1; + } + + ul { + z-index: var(--dropdownListZIndex, 2); + } + + ul.dropdown-main.closed { + visibility: hidden; + height: 1px; + width: 1px; + } + + ul.dropdown-main { + position: var(--dropdownListPosition, absolute); + list-style: none; + margin: var(--dropdownOffsetTop, 5px) 0 0 0; + padding: 0; + color: ${s}; + background: ${o}; + + font-size: var(--dropdownFontSize, inherit); + + border-top: var(--dropdownBorderTopWidth, ${e}); + border-right: var(--dropdownBorderRightWidth, ${e}); + border-bottom: var(--dropdownBorderBottomWidth, ${e}); + border-left: var(--dropdownBorderLeftWidth, ${e}); + /* Must be after border-width settings for specificity */ + border-style: solid; + border-color: ${i}; + + border-radius: var( + --dropdownBorderTopLeftRadius, + ${t} + ) + var(--dropdownBorderTopRightRadius, ${t}) + var(--dropdownBorderBottomRightRadius, ${t}) + var(--dropdownBorderBottomLeftRadius, ${t}); + + white-space: var(--dropdownWhiteSpace, normal); + + /* Prevent top/bottom inner li from overlapping inner border */ + overflow: hidden; + } + + ul.dropdown-main li:hover { + background-color: ${n}; + color: var(--dropdownHoverTextColor, #fff); + list-style: none; + cursor: pointer; + } + + ul.dropdown-main li:hover:first-child { + border-top-color: ${n}; + } + + ul.dropdown-main li:hover:last-child { + border-bottom-color: ${n}; + } + + ul.dropdown-main li:hover:not(:first-child) { + border-top: 0.5px solid var(--dropdownHoverTopBottomBorderColor, #333); + } + ul.dropdown-main li:hover:not(:last-child) { + border-bottom: 0.5px solid + var(--dropdownHoverTopBottomBorderColor, #333); + } + + ul.dropdown-main li.selected:last-child { + border-bottom-color: ${l}; + } + + ul.dropdown-main li.selected:first-child { + border-top-color: ${l}; + } + + ul.dropdown-main li:hover > *, + ul.dropdown-main li:focus-within > * { + background-color: ${n}; + color: var(--dropdownHoverTextColor, #fff); + } + + ul.dropdown-main li.selected > * { + background-color: ${l}; + color: var(--dropdownSelectedTextColor, #2c2c2c); + } + + ul.dropdown-main li { + background: ${o}; + list-style: none; + height: 30px; + cursor: pointer; + border-bottom: 0.5px solid ${o}; + border-top: 0.5px solid ${o}; + } + + ul.dropdown-main li button { + background: none; + color: inherit; + border: none; + font: inherit; + cursor: pointer; + outline: inherit; + } + + ul.dropdown-main li a { + text-decoration: none; + display: block; + box-sizing: border-box; + } + + ul.dropdown-main li:first-child { + border-top-left-radius: var(--dropdownBorderTopLeftRadius, 4px); + border-top-right-radius: var(--dropdownBorderTopRightRadius, 4px); + } + + ul.dropdown-main li:last-child { + border-bottom-right-radius: var(--dropdownBorderBottomRightRadius, 4px); + border-bottom-left-radius: var(--dropdownBorderBottomLeftRadius, 4px); + } + + /* cover the list with the label */ + ul.dropdown-main li > * > :first-child { + margin: 0; + display: flex; + align-items: center; + justify-content: flex-start; + align-content: center; + flex-wrap: nowrap; + height: 100%; + padding: var(--dropdownItemPaddingTop, 5px) + var(--dropdownItemPaddingRight, 10px) + var(--dropdownItemPaddingBottom, 5px) + var(--dropdownItemPaddingLeft, 10px); + box-sizing: border-box; + } + + ul.dropdown-main li > * { + width: 100%; + height: inherit; + color: ${s}; + background: transparent; + padding: 0; + } + `}};r([xe({type:Boolean,reflect:!0})],ve.prototype,"open",void 0);r([xe({type:Boolean,reflect:!0})],ve.prototype,"isDisabled",void 0);r([xe({type:Boolean})],ve.prototype,"displayCaret",void 0);r([xe({type:Boolean})],ve.prototype,"closeOnSelect",void 0);r([xe({type:Boolean})],ve.prototype,"openViaButton",void 0);r([xe({type:Boolean})],ve.prototype,"openViaCaret",void 0);r([xe({type:Boolean})],ve.prototype,"includeSelectedOption",void 0);r([xe({type:String})],ve.prototype,"selectedOption",void 0);r([xe({attribute:!1})],ve.prototype,"options",void 0);r([xe({type:String})],ve.prototype,"optionGroup",void 0);r([xe({attribute:!1})],ve.prototype,"optionSelected",void 0);r([xe({type:Boolean,reflect:!0})],ve.prototype,"isCustomList",void 0);r([xe({type:Boolean,reflect:!0})],ve.prototype,"hasCustomClickHandler",void 0);r([xe({type:Boolean,reflect:!0})],ve.prototype,"closeOnEscape",void 0);r([xe({type:Boolean,reflect:!0})],ve.prototype,"closeOnBackdropClick",void 0);ve=r([un("ia-dropdown")],ve);let Ca=class extends At{render(){return Ee` +
    + + +
    + `}};Ca.styles=Ke` + :host { + display: block; + width: 100%; + height: 100%; + position: relative; + } + + :host(.invert-icon-at-hover:hover) slot[name='icon'] { + filter: invert(1); + } + + :host(.selected) { + background-color: var(--selectedBgColor, #fff); + color: var(--selectedTextColor, #2c2c2c); + } + + :host(.invert-icon-at-selected.selected) slot[name='icon'] { + filter: invert(1); + } + + div.icon-label-container { + display: flex; + width: 100%; + align-items: center; + justify-content: flex-start; + align-content: center; + flex-wrap: nowrap; + flex-direction: var(--iconLabelFlexDirection, row); + height: 100%; + } + + slot[name='icon'] { + width: var(--iconWidth, 20px); + margin-right: var(--iconLabelGutterWidth, 10px); + display: flex; + align-items: center; + justify-content: flex-start; + align-content: center; + flex-wrap: nowrap; + white-space: nowrap; + height: 100%; + } + + /* https://css-tricks.com/flexbox-truncated-text/ */ + ::slotted(div.truncate) { + display: flex; + width: var(--labelWidth, 100%); + text-align: left; + word-wrap: break-word; /* Important for long words! */ + overflow: hidden; + text-overflow: ellipsis; + min-width: 0; + } + + @supports not (-webkit-line-clamp: 2) { + ::slotted(div.truncate) { + min-width: 0; + } + } + @supports (-webkit-line-clamp: 2) { + ::slotted(div.truncate) { + min-width: 0; + display: -webkit-box; + overflow-wrap: break-word; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + /* Fixed line-height needed to fit unicode and emojis + https://stackoverflow.com/a/67807146 + */ + line-height: 1.2em; + /* max-height needed for Safari browser */ + max-height: var(--labelTruncateHeight, 30px); + max-width: var(--labelWidth, 100%); + } + } + `;Ca=r([un("ia-icon-label")],Ca);let ka=class extends D{constructor(){super(...arguments),this.numResults=0}render(){return c` + + `}static get styles(){const e=v`var(--tooltipArrowSize, 5px)`,t=v`var(--tooltipArrowOffset, 0px)`;return v` + #tooltip-container { + width: max-content; + max-width: 200px; + pointer-events: none; + } + + #arrow { + position: relative; + left: calc(50% + ${t}); + top: 0; + width: 0; + height: 0; + margin-top: calc(-1 * ${e}); + margin-left: calc(-1 * ${e}); + border: ${e} solid transparent; + border-bottom-color: black; + } + + #tooltip-text { + padding: 3px 8px; + border-radius: 4px; + background-color: #000; + color: white; + font-size: 1.2rem; + text-align: center; + text-decoration: none; + } + `}};r([h({type:Number})],ka.prototype,"numResults",void 0);ka=r([L("alpha-bar-tooltip")],ka);let Je=class extends D{constructor(){super(...arguments),this.selectedLetter=null,this.tooltipShown=!1,this.alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("")}get selectedUppercaseLetter(){var e;return(e=this.selectedLetter)===null||e===void 0?void 0:e.toUpperCase()}render(){var e;return c` +
    +
      + ${this.alphabet.map(t=>c` +
    • + ${this.letterButtonTemplate(t)} + ${this.tooltipTemplate(t)} +
    • + `)} +
    +
    + `}letterButtonTemplate(e){var t,i,o;const s=`${e}: ${(i=(t=this.letterCounts)===null||t===void 0?void 0:t[e])!==null&&i!==void 0?i:0} results`;return c` + + `}tooltipTemplate(e){var t,i;return this.hoveredLetter!==e?b:this.tooltipShown?c``:b}letterClicked(e){e===this.selectedUppercaseLetter?this.selectedLetter=null:this.selectedLetter=e,this.dispatchEvent(new CustomEvent("letterChanged",{detail:{selectedLetter:this.selectedUppercaseLetter}}))}async handleMouseMove(e){var t,i;const o=e.target;if(o&&!this.tooltipShown){const s=(i=(t=o.textContent)===null||t===void 0?void 0:t.trim())!==null&&i!==void 0?i:void 0;this.tooltipShown=!0,this.hoveredLetter=s,await this.updateComplete,await new Promise(n=>{setTimeout(n,0)}),this.tooltip&&this.tooltip.dataset.letter===s&&this.positionTooltip(o)}}handleMouseLeave(){this.tooltipShown=!1,this.hoveredLetter=void 0}positionTooltip(e){if(!this.tooltip)return;const t=this.tooltip.clientWidth;let o=e.clientWidth/2-t/2;const s=getComputedStyle(document.body),n=parseFloat(s.getPropertyValue("margin-left")),l=parseFloat(s.getPropertyValue("margin-right")),d=document.body.clientWidth+n+l,f=e.getBoundingClientRect().left+o,m=f+t,y=1;let w;fd-y&&(w=m-d+y),w&&(o-=w,this.tooltip.style.setProperty("--tooltipArrowOffset",`${w}px`)),this.tooltip.style.left=`${o}px`,this.tooltip.classList.add("fade-in")}};Je.styles=v` + h1 { + font-size: 1.2rem; + } + + #container { + background-color: #ddd; + color: #333; + box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5); + } + + ul { + list-style: none; + display: flex; + margin: 0; + padding: 0.5rem 1rem; + justify-content: space-between; + } + + ul li { + position: relative; + flex: 1; + text-align: center; + max-width: 2.5rem; + border-radius: 4px; + } + + li:hover:not(.selected) button:not(:disabled) { + background-color: #c0c0c0; + } + + button { + display: flex; + justify-content: center; + align-items: center; + aspect-ratio: 1 / 1; + } + + button { + width: 100%; + height: 100%; + color: #333; + appearance: none; + background: none; + border: none; + border-radius: 4px; + font-family: inherit; + font-size: 1.2rem; + cursor: pointer; + } + + button:disabled { + color: #aaa; + cursor: default; + } + + .selected { + background-color: #2c2c2c; + } + + .selected button { + color: white; + } + + alpha-bar-tooltip { + position: absolute; + top: 100%; + left: -9999px; + margin-top: 3px; + z-index: 1; + + opacity: 0; + transition: opacity 0.2s ease; + } + + alpha-bar-tooltip.fade-in { + opacity: 1; + } + + /* Make alphabet bar a 2-row container in small screen widths */ + @media screen and (max-width: 768px) { + ul { + display: grid; + grid-template-columns: repeat(13, 1fr); + } + } + `;r([h({type:String})],Je.prototype,"selectedLetter",void 0);r([h({type:Object})],Je.prototype,"letterCounts",void 0);r([h({type:String})],Je.prototype,"ariaLandmarkLabel",void 0);r([P()],Je.prototype,"tooltipShown",void 0);r([P()],Je.prototype,"hoveredLetter",void 0);r([G("alpha-bar-tooltip")],Je.prototype,"tooltip",void 0);Je=r([L("alpha-bar")],Je);const Wd=c` + + + + + + +`,jd=c` + + + + + + +`,qd=c` + + + + + + +`,Qd=U` + +`,Gd=U` + +`,Kd=U` + +`;let Q=class extends D{constructor(){super(...arguments),this.defaultSortDirection=null,this.defaultSortField=S.relevance,this.sortDirection=null,this.selectedSort=S.default,this.selectedTitleFilter=null,this.selectedCreatorFilter=null,this.showRelevance=!0,this.showDateFavorited=!1,this.enableSortOptionsSlot=!1,this.suppressDisplayModes=!1,this.lastSelectedViewSort=S.weeklyview,this.lastSelectedDateSort=this.defaultDateSortField,this.alphaSelectorVisible=null,this.dropdownBackdropVisible=!1,this.desktopSortContainerWidth=0,this.selectorBarContainerWidth=0,this.boundSortBarSelectorEscapeListener=e=>{e.key==="Escape"&&this.closeDropdowns()}}render(){return c` +
    +
    + +
    + ${this.enableSortOptionsSlot?c``:c` +
    + ${this.sortDirectionSelectorTemplate} +
    + ${k("Sort by:")} +
    + ${this.mobileSortSelectorTemplate} + ${this.desktopSortSelectorTemplate} +
    + `} +
    + + + ${this.suppressDisplayModes?b:c`
    + ${this.displayOptionTemplate} +
    `} +
    + + ${this.dropdownBackdropVisible?this.dropdownBackdrop:b} + ${this.alphaBarTemplate} +
    + `}willUpdate(e){if(e.has("selectedSort")||e.has("defaultSortField")){if(this.selectedSort&&this.selectedSort!==S.default&&this.sortDirection===null){const t=we[this.finalizedSortField];this.sortDirection=t.defaultSortDirection}this.viewOptionSelected?this.lastSelectedViewSort=this.finalizedSortField:this.dateOptionSelected&&(this.lastSelectedDateSort=this.finalizedSortField)}e.has("showDateFavorited")&&e.get("showDateFavorited")!==this.showDateFavorited&&(this.lastSelectedDateSort=this.defaultDateSortField)}updated(e){if(e.has("displayMode")&&this.displayModeChanged(),e.has("selectedTitleFilter")&&this.selectedTitleFilter&&(this.alphaSelectorVisible="title"),e.has("selectedCreatorFilter")&&this.selectedCreatorFilter&&(this.alphaSelectorVisible="creator"),e.has("dropdownBackdropVisible")&&this.setupEscapeListeners(),e.has("resizeObserver")||e.has("enableSortOptionsSlot")){const t=e.get("resizeObserver");t&&this.disconnectResizeObserver(t),this.setupResizeObserver()}}setupEscapeListeners(){this.dropdownBackdropVisible?document.addEventListener("keydown",this.boundSortBarSelectorEscapeListener):document.removeEventListener("keydown",this.boundSortBarSelectorEscapeListener)}connectedCallback(){var e;(e=super.connectedCallback)===null||e===void 0||e.call(this),this.setupResizeObserver()}disconnectedCallback(){this.resizeObserver&&this.disconnectResizeObserver(this.resizeObserver)}disconnectResizeObserver(e){this.sortSelectorContainer&&e.removeObserver({target:this.sortSelectorContainer,handler:this}),this.desktopSortContainer&&e.removeObserver({target:this.desktopSortContainer,handler:this})}setupResizeObserver(){!this.resizeObserver||(this.sortSelectorContainer&&this.resizeObserver.addObserver({target:this.sortSelectorContainer,handler:this}),this.desktopSortContainer&&this.resizeObserver.addObserver({target:this.desktopSortContainer,handler:this}))}handleResize(e){e.target===this.desktopSortContainer?this.desktopSortContainerWidth=e.contentRect.width:e.target===this.sortSelectorContainer&&(this.selectorBarContainerWidth=e.contentRect.width)}get mobileSelectorVisible(){return this.selectorBarContainerWidth-10 + ${t} + ${this.sortDirectionIcon} + + `}get sortDirectionIcon(){return this.canChangeSortDirection?c` +
    + ${this.finalizedSortDirection==="asc"?Wd:jd} +
    + `:c`
    ${qd}
    `}get desktopSortSelectorTemplate(){return c` +
    +
      + ${this.showRelevance?c`
    • + ${this.getSortDisplayOption(S.relevance,{onClick:()=>{this.dropdownBackdropVisible=!1,this.finalizedSortField!==S.relevance&&(this.clearAlphaBarFilters(),this.setSelectedSort(S.relevance))}})} +
    • `:b} +
    • ${this.viewsDropdownTemplate}
    • +
    • + ${this.getSortDisplayOption(S.title,{onClick:()=>{this.dropdownBackdropVisible=!1,this.finalizedSortField!==S.title&&(this.alphaSelectorVisible="title",this.selectedCreatorFilter=null,this.setSelectedSort(S.title),this.emitCreatorLetterChangedEvent())}})} +
    • +
    • ${this.dateDropdownTemplate}
    • +
    • + ${this.getSortDisplayOption(S.creator,{onClick:()=>{this.dropdownBackdropVisible=!1,this.finalizedSortField!==S.creator&&(this.alphaSelectorVisible="creator",this.selectedTitleFilter=null,this.setSelectedSort(S.creator),this.emitTitleLetterChangedEvent())}})} +
    • +
    +
    + `}get mobileSortSelectorTemplate(){const e=Object.values(we).filter(t=>t.shownInSortBar).filter(t=>this.showRelevance||t.field!==S.relevance).filter(t=>this.showDateFavorited||t.field!==S.datefavorited);return c` +
    + ${this.getSortDropdown({displayName:c`${we[this.finalizedSortField].displayName}`,id:"mobile-dropdown",selected:!0,dropdownOptions:e.map(t=>this.getDropdownOption(t.field)),selectedOption:this.finalizedSortField,onOptionSelected:this.mobileSortChanged,onDropdownClick:()=>{this.dropdownBackdropVisible=this.mobileDropdown.open,this.mobileDropdown.classList.toggle("open",this.mobileDropdown.open)}})} +
    + `}getSortDisplayOption(e,t){var i,o;const s=(i=t==null?void 0:t.selected)!==null&&i!==void 0?i:this.finalizedSortField===e,n=(o=t==null?void 0:t.displayName)!==null&&o!==void 0?o:we[e].displayName;return c` + + `}getSortDropdown(e){var t,i,o,s,n;return c` + + {var d;(l.key==="Enter"||l.key===" ")&&((d=e.onLabelInteraction)===null||d===void 0||d.call(e,l))}:b} + > + ${e.displayName} + + + `}getDropdownOption(e){return{id:e,selectedHandler:()=>{this.selectDropdownSortField(e)},label:c` + + ${we[e].displayName} + + `}}dropdownOptionSelected(e){this.dropdownBackdropVisible=!1,this.clearAlphaBarFilters();const t=e.detail.option.id;this.setSelectedSort(t),this.viewOptionSelected?this.lastSelectedViewSort=t:this.dateOptionSelected&&(this.lastSelectedDateSort=t)}get viewsDropdownTemplate(){return this.getSortDropdown({displayName:c`${this.viewSortDisplayName}`,id:"views-dropdown",selected:this.viewOptionSelected,dropdownOptions:[this.getDropdownOption(S.weeklyview),this.getDropdownOption(S.alltimeview)],selectedOption:this.viewOptionSelected?this.finalizedSortField:"",onOptionSelected:this.dropdownOptionSelected,onDropdownClick:()=>{this.dateDropdown.open=!1,this.dropdownBackdropVisible=this.viewsDropdown.open,this.viewsDropdown.classList.toggle("open",this.viewsDropdown.open)},onLabelInteraction:e=>{!this.viewsDropdown.open&&!this.viewOptionSelected&&(e.stopPropagation(),this.clearAlphaBarFilters(),this.setSelectedSort(this.lastSelectedViewSort))}})}get dateDropdownTemplate(){return this.getSortDropdown({displayName:c`${this.dateSortDisplayName}`,id:"date-dropdown",selected:this.dateOptionSelected,dropdownOptions:[...this.showDateFavorited?[this.getDropdownOption(S.datefavorited)]:[],this.getDropdownOption(S.date),this.getDropdownOption(S.datearchived),this.getDropdownOption(S.datereviewed),this.getDropdownOption(S.dateadded)],selectedOption:this.dateOptionSelected?this.finalizedSortField:"",onOptionSelected:this.dropdownOptionSelected,onDropdownClick:()=>{this.viewsDropdown.open=!1,this.dropdownBackdropVisible=this.dateDropdown.open,this.dateDropdown.classList.toggle("open",this.dateDropdown.open)},onLabelInteraction:e=>{!this.dateDropdown.open&&!this.dateOptionSelected&&(e.stopPropagation(),this.clearAlphaBarFilters(),this.setSelectedSort(this.lastSelectedDateSort))}})}mobileSortChanged(e){this.dropdownBackdropVisible=!1;const t=e.detail.option.id;this.setSelectedSort(t),this.alphaSelectorVisible=null,t!=="title"&&this.selectedTitleFilter&&(this.selectedTitleFilter=null,this.emitTitleLetterChangedEvent()),t!=="creator"&&this.selectedCreatorFilter&&(this.selectedCreatorFilter=null,this.emitCreatorLetterChangedEvent())}get displayOptionTemplate(){return c` +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    + `}get dropdownBackdrop(){return c` +
    + `}closeDropdowns(){this.dropdownBackdropVisible=!1;const e=[this.viewsDropdown,this.dateDropdown,this.mobileDropdown];for(const t of e)t.open=!1,t.classList.remove("open")}selectDropdownSortField(e){this.dropdownBackdropVisible=!1,this.setSelectedSort(e)}clearAlphaBarFilters(){this.alphaSelectorVisible=null,this.selectedTitleFilter=null,this.selectedCreatorFilter=null,this.emitTitleLetterChangedEvent(),this.emitCreatorLetterChangedEvent()}setSortDirection(e){this.sortDirection=e,this.emitSortChangedEvent()}toggleSortDirection(){this.setSortDirection(this.finalizedSortDirection==="desc"?"asc":"desc")}handleSortDirectionClicked(){!this.sortDirection&&this.defaultSortField&&this.defaultSortDirection&&(this.selectedSort=this.defaultSortField,this.sortDirection=this.defaultSortDirection),this.toggleSortDirection()}setSelectedSort(e){this.selectedSort=e;const t=we[e];this.sortDirection=t.defaultSortDirection,this.emitSortChangedEvent()}get finalizedSortField(){return this.selectedSort===S.default?this.defaultSortField:this.selectedSort}get finalizedSortDirection(){return this.sortDirection===null?this.defaultSortDirection:this.sortDirection}get canChangeSortDirection(){return we[this.finalizedSortField].canSetDirection}get dateOptionSelected(){return[S.datefavorited,S.datearchived,S.date,S.datereviewed,S.dateadded].includes(this.finalizedSortField)}get viewOptionSelected(){return[S.alltimeview,S.weeklyview].includes(this.finalizedSortField)}get defaultDateSortField(){return this.showDateFavorited?S.datefavorited:S.date}get dateSortDisplayName(){return we[this.lastSelectedDateSort].displayName}get viewSortDisplayName(){return we[this.lastSelectedViewSort].displayName}get titleSelectorBar(){var e;return c` `}get creatorSelectorBar(){var e;return c` `}titleLetterChanged(e){var t;this.selectedTitleFilter=(t=e.detail.selectedLetter)!==null&&t!==void 0?t:null,this.emitTitleLetterChangedEvent()}creatorLetterChanged(e){var t;this.selectedCreatorFilter=(t=e.detail.selectedLetter)!==null&&t!==void 0?t:null,this.emitCreatorLetterChangedEvent()}emitTitleLetterChangedEvent(){const e=new CustomEvent("titleLetterChanged",{detail:{selectedLetter:this.selectedTitleFilter}});this.dispatchEvent(e)}emitCreatorLetterChangedEvent(){const e=new CustomEvent("creatorLetterChanged",{detail:{selectedLetter:this.selectedCreatorFilter}});this.dispatchEvent(e)}displayModeChanged(){const e=new CustomEvent("displayModeChanged",{detail:{displayMode:this.displayMode}});this.dispatchEvent(e)}emitSortChangedEvent(){const e=new CustomEvent("sortChanged",{detail:{selectedSort:this.selectedSort,sortDirection:this.sortDirection}});this.dispatchEvent(e)}static get styles(){return[et,v` + #container { + position: relative; + } + + #sort-bar { + display: flex; + justify-content: flex-start; + align-items: center; + border-bottom: 1px solid #2c2c2c; + font-size: 1.4rem; + } + + #sort-options { + display: flex; + align-items: center; + flex-grow: 1; + } + + ul { + list-style: none; + display: flex; + align-items: center; + margin: 0; + padding: 0; + } + + li { + padding: 0; + } + + .sort-by-text { + margin-right: 5px; + font-weight: bold; + white-space: nowrap; + } + + .sort-direction-container { + display: flex; + align-self: stretch; + flex: 0; + margin: 0 5px; + } + + .sort-direction-selector { + padding: 0; + border: none; + appearance: none; + background: transparent; + cursor: pointer; + } + + .sort-direction-selector:disabled { + cursor: default; + } + + .sort-direction-icon { + display: flex; + align-items: center; + background: none; + color: inherit; + border: none; + padding: 0; + outline: inherit; + width: 14px; + height: 14px; + } + + .sort-direction-icon > svg { + flex: 1; + } + + #date-sort-selector, + #view-sort-selector { + position: absolute; + left: 150px; + top: 45px; + + z-index: 1; + padding: 1rem; + background-color: white; + border-radius: 2.5rem; + border: 1px solid #404142; + } + + #sort-selector-container { + flex: 1; + display: flex; + justify-content: flex-start; + align-items: center; + } + + #desktop-sort-container, + #mobile-sort-container { + display: flex; + justify-content: flex-start; + align-items: center; + } + + /* + we move the desktop sort selector offscreen instead of display: none + because we need to observe the width of it vs its container to determine + if it's wide enough to display the desktop version and if you display: none, + the width becomes 0 + */ + #desktop-sort-container.hidden { + position: absolute; + top: -9999px; + left: -9999px; + visibility: hidden; + } + + #mobile-sort-container.hidden { + display: none; + } + + #sort-selector-backdrop { + position: fixed; + top: 0; + left: 0; + width: 100vw; + height: 100vh; + z-index: 1; + background-color: transparent; + } + + #desktop-sort-selector { + display: inline-flex; + } + + #desktop-sort-selector li { + display: flex; + align-items: center; + padding-left: 5px; + padding-right: 5px; + } + + #desktop-sort-selector li a { + padding: 0 5px; + text-decoration: none; + color: #333; + line-height: 2; + } + + #desktop-sort-selector li button { + padding: 0px 5px; + border: none; + background: none; + font-family: inherit; + font-size: inherit; + color: #333; + line-height: 2; + cursor: pointer; + appearance: none; + } + + #desktop-sort-selector li button.selected { + font-weight: bold; + } + + /** + * Fix to not shift the sort-bar options when get selected + */ + #desktop-sort-selector li button::before, + #desktop-sort-selector .dropdown-label::before { + display: block; + content: attr(data-title); + font-weight: bold; + height: 0; + overflow: hidden; + visibility: hidden; + } + + #display-style-selector { + flex: 0; + } + + #display-style-selector button { + background: none; + color: inherit; + border: none; + appearance: none; + cursor: pointer; + -webkit-appearance: none; + fill: #bbbbbb; + } + + #display-style-selector button.active { + fill: var(--ia-theme-primary-text-color, #2c2c2c); + } + + #display-style-selector button svg { + width: 24px; + height: 24px; + } + + ia-dropdown { + --dropdownTextColor: white; + --dropdownOffsetTop: 0; + --dropdownBorderTopWidth: 0; + --dropdownBorderTopLeftRadius: 0; + --dropdownBorderTopRightRadius: 0; + --dropdownWhiteSpace: nowrap; + --dropdownListZIndex: 2; + --dropdownCaretColor: var(--ia-theme-primary-text-color, #2c2c2c); + --dropdownSelectedTextColor: white; + --dropdownSelectedBgColor: rgba(255, 255, 255, 0.3); + --dropdownHoverBgColor: rgba(255, 255, 255, 0.3); + --caretHeight: 9px; + --caretWidth: 12px; + --caretPadding: 0 5px 0 0; + } + ia-dropdown.selected .dropdown-label { + font-weight: bold; + } + ia-dropdown.open { + z-index: 2; + } + + .dropdown-label { + display: inline-block; + height: 100%; + padding-left: 5px; + font-size: 1.4rem; + font-family: var(--ia-theme-base-font-family); + line-height: 2; + color: var(--ia-theme-primary-text-color, #2c2c2c); + white-space: nowrap; + user-select: none; + } + `]}};r([h({type:String})],Q.prototype,"displayMode",void 0);r([h({type:String})],Q.prototype,"defaultSortDirection",void 0);r([h({type:String})],Q.prototype,"defaultSortField",void 0);r([h({type:String})],Q.prototype,"sortDirection",void 0);r([h({type:String})],Q.prototype,"selectedSort",void 0);r([h({type:String})],Q.prototype,"selectedTitleFilter",void 0);r([h({type:String})],Q.prototype,"selectedCreatorFilter",void 0);r([h({type:Boolean})],Q.prototype,"showRelevance",void 0);r([h({type:Boolean})],Q.prototype,"showDateFavorited",void 0);r([h({type:Boolean,reflect:!0})],Q.prototype,"enableSortOptionsSlot",void 0);r([h({type:Boolean,reflect:!0})],Q.prototype,"suppressDisplayModes",void 0);r([h({type:Object})],Q.prototype,"prefixFilterCountMap",void 0);r([h({type:Object})],Q.prototype,"resizeObserver",void 0);r([P()],Q.prototype,"lastSelectedViewSort",void 0);r([P()],Q.prototype,"lastSelectedDateSort",void 0);r([P()],Q.prototype,"alphaSelectorVisible",void 0);r([P()],Q.prototype,"dropdownBackdropVisible",void 0);r([P()],Q.prototype,"desktopSortContainerWidth",void 0);r([P()],Q.prototype,"selectorBarContainerWidth",void 0);r([G("#desktop-sort-container")],Q.prototype,"desktopSortContainer",void 0);r([G("#sort-selector-container")],Q.prototype,"sortSelectorContainer",void 0);r([G("#views-dropdown")],Q.prototype,"viewsDropdown",void 0);r([G("#date-dropdown")],Q.prototype,"dateDropdown",void 0);r([G("#mobile-dropdown")],Q.prototype,"mobileDropdown",void 0);Q=r([L("sort-filter-bar")],Q);/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */function qo(a,e,t){return a?e():t==null?void 0:t()}class Lt{constructor(e){var t,i,o,s,n,l,d;this.title=e==null?void 0:e.title,this.subtitle=e==null?void 0:e.subtitle,this.headline=e==null?void 0:e.headline,this.message=e==null?void 0:e.message,this.headerColor=(t=e==null?void 0:e.headerColor)!==null&&t!==void 0?t:"#55A183",this.bodyColor=(i=e==null?void 0:e.bodyColor)!==null&&i!==void 0?i:"#f5f5f7",this.showProcessingIndicator=(o=e==null?void 0:e.showProcessingIndicator)!==null&&o!==void 0?o:!1,this.processingImageMode=(s=e==null?void 0:e.processingImageMode)!==null&&s!==void 0?s:"complete",this.showCloseButton=(n=e==null?void 0:e.showCloseButton)!==null&&n!==void 0?n:!0,this.showHeaderLogo=(l=e==null?void 0:e.showHeaderLogo)!==null&&l!==void 0?l:!0,this.closeOnBackdropClick=(d=e==null?void 0:e.closeOnBackdropClick)!==null&&d!==void 0?d:!0}}const Yd=Object.freeze({processing:"processing",complete:"complete"});class Xd extends D{static get properties(){return{mode:{type:String}}}constructor(){super(),this.mode=Yd.processing}render(){return c` +
    + + Activity Indicator + + A rotating activity indicator with three dots in the middle. + + + + + + + + + + + + +
    + `}static get styles(){const e=v`var(--activityIndicatorCheckmarkColor, #31A481)`,t=v`var(--activityIndicatorCompletedRingColor, #31A481)`,i=v`var(--activityIndicatorLoadingRingColor, #333333)`,o=v`var(--activityIndicatorLoadingDotColor, #333333)`;return v` + #completed-ring { + fill: ${t}; + } + + #check { + fill: ${e}; + } + + #activity-ring { + fill: ${i}; + } + + #activity-dots { + fill: ${o}; + } + + .activity-indicator { + opacity: 0; + transition: opacity 0.25s ease-out; + } + + .processing .activity-indicator { + opacity: 1; + } + + .loaded-indicator { + opacity: 1; + transition: opacity 0.25s ease-out; + } + + .processing .loaded-indicator { + opacity: 0; + } + + .image { + border: 1px solid red; + display: inline-block; + } + + .processing #activity-ring { + animation: rotate 1.3s infinite linear; + transform-origin: 50px 50px; + transform-box: fill-box; + } + + .processing #left-dot { + opacity: 0; + animation: dot 1.3s infinite; + animation-delay: 0.2s; + } + + .processing #middle-dot { + opacity: 0; + animation: dot 1.3s infinite; + animation-delay: 0.4s; + } + + .processing #right-dot { + opacity: 0; + animation: dot 1.3s infinite; + animation-delay: 0.6s; + } + + @keyframes rotate { + 0% { + transform: rotate(-360deg); + } + 100% { + /* This frame is supposed to be inferred, but Safari doesn't rotate it unless we're explicit */ + transform: rotate(0deg); + } + } + + @keyframes dot { + 0% { + opacity: 0; + } + 25% { + opacity: 1; + } + 100% { + opacity: 0; + } + } + `}}window.customElements.define("ia-activity-indicator",Xd);var Zd=c` + + Close icon + A line drawing of an X + + +`,Jd=c` + +`;let Ta=class extends D{constructor(){super(...arguments),this.config=new Lt}render(){return c` + + `}handleCloseButton(){const e=new Event("closeButtonPressed");this.dispatchEvent(e)}get closeButtonTemplate(){return c` + + `}static get styles(){const e=v`var(--modalLogoSize, 6.5rem)`,t=v`var(--processingImageSize, 7.5rem)`,i=v`var(--modalCornerRadius, 1rem)`,o=v`var(--modalBorder, 2px solid black)`,s=v`var(--modalBottomMargin, 2.5rem)`,n=v`var(--modalTopMargin, 5rem)`,l=v`var(--modalHeaderBottomPadding, 0.5em)`,d=v`var(--modalBottomPadding, 2rem)`,p=v`var(--modalScrollOffset, 5px)`,f=v`var(--modalTitleFontSize, 1.8rem)`,m=v`var(--modalSubtitleFontSize, 1.4rem)`,y=v`var(--modalHeadlineFontSize, 1.6rem)`,w=v`var(--modalMessageFontSize, 1.4rem)`,x=v`var(--modalTitleLineHeight, normal)`,C=v`var(--modalSubtitleLineHeight, normal)`,A=v`var(--modalHeadlineLineHeight, normal)`,F=v`var(--modalMessageLineHeight, normal)`;return v` + .processing-logo { + margin: auto; + width: ${t}; + height: ${t}; + } + + .processing-logo.hidden { + height: 1rem; + } + + .processing-logo.hidden ia-activity-indicator { + display: none; + } + + .modal-wrapper { + outline: none; + } + + .modal-container { + border-radius: ${i}; + width: 100%; + margin-top: ${n}; + } + + header { + position: relative; + background-color: #36a483; + color: white; + border-radius: calc(${i}) calc(${i}) 0 0; + border: ${o}; + border-bottom: 0; + text-align: center; + padding-bottom: ${l}; + } + + .title { + margin: 0; + padding: 0; + font-size: ${f}; + font-weight: bold; + line-height: ${x}; + } + + .subtitle { + margin: 0; + padding: 0; + font-weight: normal; + padding-top: 0; + font-size: ${m}; + line-height: ${C}; + } + + .modal-body { + background-color: #f5f5f7; + border-radius: 0 0 calc(${i}) calc(${i}); + border: ${o}; + border-top: 0; + padding: 0 1rem calc(${d} - ${p}) 1rem; + color: #333; + margin-bottom: 2.5rem; + min-height: 5rem; + } + + .content { + overflow-y: auto; + max-height: calc(100vh - (16.5rem + ${s})); + min-height: 5rem; + padding: 0 0 calc(${p}) 0; + } + + .headline { + font-size: ${y}; + font-weight: bold; + text-align: center; + line-height: ${A}; + margin: 0; + padding: 0; + } + + .message { + margin: 1rem 0 0 0; + text-align: center; + font-size: ${w}; + line-height: ${F}; + } + + .logo-icon { + border-radius: 100%; + border: 3px solid #fff; + box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18), + 0 2px 2px 0 rgba(0, 0, 0, 0.08); + width: ${e}; + height: ${e}; + margin: -2.9rem auto 0.5rem auto; + background-color: black; + display: flex; + justify-content: center; + align-items: center; + } + + .logo-icon svg { + width: calc(${e} * 0.65); + height: calc(${e} * 0.65); + } + + .logo-icon svg .fill-color { + fill: white; + } + + .logo-icon svg .stroke-color { + stroke: red; + } + + .close-button { + position: absolute; + right: 1.2rem; + top: 1.2rem; + width: 2rem; + height: 2rem; + border-radius: 100%; + border: 0; + padding: 0; + cursor: pointer; + background-color: white; + box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18), + 0 4px 4px 0 rgba(0, 0, 0, 0.08); + } + + .sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + border: 0; + } + + slot::slotted(.sr-only) { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + border: 0; + } + `}};r([h({type:Object})],Ta.prototype,"config",void 0);Ta=r([L("modal-template")],Ta);function ec(a,e,t){var i=t||{},o=i.noTrailing,s=o===void 0?!1:o,n=i.noLeading,l=n===void 0?!1:n,d=i.debounceMode,p=d===void 0?void 0:d,f,m=!1,y=0;function w(){f&&clearTimeout(f)}function x(A){var F=A||{},R=F.upcomingOnly,W=R===void 0?!1:R;w(),m=!W}function C(){for(var A=arguments.length,F=new Array(A),R=0;Ra?l?(y=Date.now(),s||(f=setTimeout(p?he:Z,a))):Z():s!==!0&&(f=setTimeout(p?he:Z,p===void 0?a-B:a))}return C.cancel=x,C}var bt;(function(a){a.Open="open",a.Closed="closed"})(bt||(bt={}));class tc{constructor(e){this.windowResizeThrottler=ec(100,this.updateModalContainerHeight,{noLeading:!1,noTrailing:!1}).bind(this),this.modalManager=e}handleModeChange(e){switch(e){case bt.Open:this.startResizeListener(),this.stopDocumentScroll();break;case bt.Closed:this.stopResizeListener(),this.resumeDocumentScroll();break}}updateModalContainerHeight(){this.modalManager.style.setProperty("--containerHeight",`${window.innerHeight}px`)}stopDocumentScroll(){document.body.classList.add("modal-manager-open")}resumeDocumentScroll(){document.body.classList.remove("modal-manager-open")}startResizeListener(){window.addEventListener("resize",this.windowResizeThrottler)}stopResizeListener(){window.removeEventListener("resize",this.windowResizeThrottler)}}let Nt=class extends D{constructor(){super(...arguments),this.mode=bt.Closed,this.hostBridge=new tc(this),this.closeOnBackdropClick=!0}render(){return c` +
    +
    + + ${this.customModalContent} + +
    + `}getMode(){return this.mode}closeModal(){this.mode=bt.Closed}callUserClosedModalCallback(){const e=this.userClosedModalCallback;this.userClosedModalCallback=void 0,e&&e()}showModal(e){return An(this,void 0,void 0,function*(){this.closeOnBackdropClick=e.config.closeOnBackdropClick,this.userClosedModalCallback=e.userClosedModalCallback,this.modalTemplate.config=e.config,this.customModalContent=e.customModalContent,this.mode=bt.Open,yield this.modalTemplate.updateComplete,this.modalTemplate.focus()})}updated(e){e.has("mode")&&this.handleModeChange()}backdropClicked(){this.closeOnBackdropClick&&(this.closeModal(),this.callUserClosedModalCallback())}handleModeChange(){this.hostBridge.handleModeChange(this.mode),this.emitModeChangeEvent()}emitModeChangeEvent(){const e=new CustomEvent("modeChanged",{detail:{mode:this.mode}});this.dispatchEvent(e)}closeButtonPressed(){this.closeModal(),this.callUserClosedModalCallback()}static get styles(){const e=v`var(--modalBackdropColor, rgba(10, 10, 10, 0.9))`,t=v`var(--modalBackdropZindex, 1000)`,i=v`var(--modalWidth, 32rem)`,o=v`var(--modalMaxWidth, 95%)`,s=v`var(--modalZindex, 2000)`;return v` + .container { + width: 100%; + height: 100%; + } + + .backdrop { + position: fixed; + top: 0; + left: 0; + background-color: ${e}; + width: 100%; + height: 100%; + z-index: ${t}; + } + + modal-template { + outline: 0; + position: fixed; + top: 0; + left: 50%; + transform: translate(-50%, 0); + z-index: ${s}; + width: ${i}; + max-width: ${o}; + } + `}};r([h({type:String,reflect:!0})],Nt.prototype,"mode",void 0);r([h({type:Object})],Nt.prototype,"customModalContent",void 0);r([h({type:Object})],Nt.prototype,"hostBridge",void 0);r([G("modal-template")],Nt.prototype,"modalTemplate",void 0);Nt=r([L("modal-manager")],Nt);const ur=v`var(--white, #fff)`,ic=v`var(--primaryDisableCTAFill, #767676)`,oc=v`var(--secondaryCTABorder, #999)`,ac=v`var(--primaryCTAFill, #194880)`,Qo=v`var(--primaryCTAFillRGB, 25, 72, 128)`,sc=v`var(--primaryCTABorder, #c5d1df)`,rc=v`var(--primaryErrorCTAFill, #d9534f)`,Go=v`var(--primaryErrorCTAFillRGB, 229, 28, 38)`,nc=v`var(--primaryErrorCTABorder, #d43f3a)`,lc=v`var(--secondaryCTAFill, #333)`,Ko=v`var(--secondaryCTAFillRGB, 51, 51, 51)`,dc=v`var(--primaryCTABorder, #979797)`,cc=v`var(---primaryWarningFill, #ee8950)`,Yo=v`var(--primaryWarningFillRGB, 238, 137, 80)`,hc=v`var(--primaryWarningBorder, #ec7939)`;var pc=v` + .ia-button { + min-height: 3rem; + cursor: pointer; + color: ${ur}; + line-height: normal; + border-radius: 0.4rem; + font-size: 1.4rem; + font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; + border: 1px solid transparent; + white-space: nowrap; + appearance: auto; + box-sizing: border-box; + display: flex; + align-items: center; + transition: all 0.1s ease 0s; + vertical-align: middle; + padding: 0 3rem; + outline-color: ${ur}; + outline-offset: -4px; + user-select: none; + text-decoration: none; + width: fit-content; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + -o-user-select: none; + } + .ia-button:focus-visible { + outline-style: double; + } + .ia-button:disabled { + cursor: not-allowed; + background-color: ${ic}; + border: 1px solid ${oc}; + } + .ia-button.transparent { + background-color: transparent; + } + + .ia-button.primary:disabled, + .ia-button.danger:disabled, + .ia-button.warning:disabled, + .ia-button.dark:disabled { + opacity: 0.5; + } + + .ia-button.primary { + background-color: ${ac}; + border-color: ${sc}; + } + .ia-button.primary:hover { + background-color: rgba(${Qo}, 0.9); + } + .ia-button.primary:focus-visible { + background-color: rgba(${Qo}, 0.8); + } + .ia-button.primary:active { + background-color: rgba(${Qo}, 0.7); + } + + .ia-button.danger { + background-color: ${rc}; + border-color: ${nc}; + } + .ia-button.danger:hover { + background-color: rgba(${Go}, 0.9); + } + .ia-button.danger:focus-visible { + background-color: rgba(${Go}, 0.8); + } + .ia-button.danger:active { + background-color: rgba(${Go}, 0.7); + } + + .ia-button.warning { + background-color: ${cc}; + border-color: ${hc}; + } + .ia-button.warning:hover { + background-color: rgba(${Yo}, 0.9); + } + .ia-button.warning:focus-visible { + background-color: rgba(${Yo}, 0.8); + } + .ia-button.warning:active { + background-color: rgba(${Yo}, 0.7); + } + + .ia-button.dark { + background-color: ${lc}; + border-color: ${dc}; + } + .ia-button.dark:hover { + background-color: rgba(${Ko}, 0.9); + } + .ia-button.dark:focus-visible { + background-color: rgba(${Ko}, 0.8); + } + .ia-button.dark:active { + background-color: rgba(${Ko}, 0.7); + } + + .ia-button.link { + margin: 0; + padding: 6px; + border: 0; + appearance: none; + background: none; + color: var(--ia-theme-link-color, #4b64ff); + text-decoration: none; + cursor: pointer; + } + .ia-button.link:hover { + text-decoration: underline; + } +`;let Ji=class extends D{constructor(){super(...arguments),this.items=[]}render(){return c` +
      + ${gt(this.items,({title:e,date:t})=>c` +
    • + ${e!=null?e:"[untitled]"} + ${t!=null?t:""} +
    • + `)} +
    + ${this.message?c`

    ${this.message}

    `:b} +
    + +
    + `}removeItemsBtnClicked(){this.dispatchEvent(new CustomEvent("confirm",{detail:{items:this.items}}))}static get styles(){return v` + ul { + margin: 0; + padding: 0 10px; + font-size: 1.4rem; + list-style-type: none; + max-height: min(400px, 40vh); + overflow-y: auto; + } + + li { + display: flex; + justify-content: space-between; + padding: 2px 0; + } + li:not(:last-of-type) { + border-bottom: 1px solid rgb(232, 232, 232); + } + + .item-title { + word-break: break-word; + } + + .item-date { + white-space: nowrap; + } + + .message { + font-size: 1.4rem; + padding: 5px 10px; + } + + .button-bar { + display: flex; + justify-content: center; + margin: 10px 5px; + } + + .remove-items-btn { + margin-bottom: 10px; + padding: 10px; + border: 1px solid var(--primaryErrorCTABorder, #d43f3a); + border-radius: 4px; + color: white; + background: var(--primaryErrorCTAFill, #d9534f); + appearance: none; + cursor: pointer; + } + .remove-items-btn:hover { + background: rgba(var(--primaryErrorCTAFillRGB, 229, 28, 38), 0.9); + } + .remove-items-btn:active { + background: rgba(var(--primaryErrorCTAFillRGB, 229, 28, 38), 0.7); + } + `}};r([h({type:Object})],Ji.prototype,"items",void 0);r([h({type:String})],Ji.prototype,"message",void 0);Ji=r([L("remove-items-modal-content")],Ji);let We=class extends D{constructor(){super(...arguments),this.label=k("Select items to remove"),this.selectedItems=[],this.showSelectAll=!1,this.showUnselectAll=!1,this.showItemManageButton=!1,this.removeAllowed=!1}render(){return c` +
    + ${this.label} +
    + + + ${qo(this.showItemManageButton,()=>c` `)} +
    + ${qo(this.showSelectAll,()=>c` `)} + ${qo(this.showUnselectAll,()=>c` `)} +
    +
    +
    + `}cancelClicked(){this.dispatchEvent(new CustomEvent("cancel"))}removeItemsClicked(){this.dispatchEvent(new CustomEvent("removeItems"))}manageItemsClicked(){this.dispatchEvent(new CustomEvent("manageItems"))}selectAllClicked(){this.dispatchEvent(new CustomEvent("selectAll"))}unselectAllClicked(){this.dispatchEvent(new CustomEvent("unselectAll"))}showRemoveItemsModal(){var e,t;const i=c` + this.removeItemsClicked()} + > + `,o=new Lt({showProcessingIndicator:!1,processingImageMode:"processing",bodyColor:"#fff",headerColor:"#194880",showHeaderLogo:!1,closeOnBackdropClick:!0,title:c`${k("Are you sure you want to remove these items?")}`});(e=this.modalManager)===null||e===void 0||e.classList.add("remove-items"),(t=this.modalManager)===null||t===void 0||t.showModal({config:o,customModalContent:i,userClosedModalCallback:()=>{var s;(s=this.modalManager)===null||s===void 0||s.classList.remove("remove-items")}})}showRemoveItemsProcessingModal(){var e,t;const i=new Lt({showProcessingIndicator:!0,processingImageMode:"processing",bodyColor:"#fff",headerColor:"#194880",showHeaderLogo:!1,closeOnBackdropClick:!0,title:c`${k("Removing selected items...")}`});(e=this.modalManager)===null||e===void 0||e.classList.add("remove-items"),(t=this.modalManager)===null||t===void 0||t.showModal({config:i,userClosedModalCallback:()=>{var o;(o=this.modalManager)===null||o===void 0||o.classList.remove("remove-items")}})}showRemoveItemsErrorModal(){var e,t;const i=new Lt({showProcessingIndicator:!1,processingImageMode:"processing",bodyColor:"#fff",headerColor:"#691916",showHeaderLogo:!1,closeOnBackdropClick:!0,title:c`${k("Error: unable to remove items")}`,message:c`${k("An error occurred while removing items. Please try again in a few minutes.")}`});(e=this.modalManager)===null||e===void 0||e.classList.add("remove-items"),(t=this.modalManager)===null||t===void 0||t.showModal({config:i,userClosedModalCallback:()=>{var o;(o=this.modalManager)===null||o===void 0||o.classList.remove("remove-items")}})}static get styles(){return v` + ${pc} + .manage-container { + display: flex; + align-items: center; + column-gap: 5px; + padding: 20px 0 20px; + flex-wrap: wrap; + } + + .manage-label { + display: inline-block; + font-weight: bold; + font-size: 1.8rem; + padding-right: 10px; + } + + .manage-buttons { + display: flex; + flex-wrap: wrap; + align-items: center; + column-gap: 5px; + } + + .selection-buttons { + display: inherit; + } + + .ia-button, + button { + padding: 6px 12px; + font-size: 1.4rem; + margin: 3px 0; + } + `}};r([h({type:String})],We.prototype,"label",void 0);r([h({type:Object})],We.prototype,"modalManager",void 0);r([h({type:Object})],We.prototype,"selectedItems",void 0);r([h({type:String})],We.prototype,"manageViewModalMsg",void 0);r([h({type:Boolean})],We.prototype,"showSelectAll",void 0);r([h({type:Boolean})],We.prototype,"showUnselectAll",void 0);r([h({type:Boolean})],We.prototype,"showItemManageButton",void 0);r([h({type:Boolean})],We.prototype,"removeAllowed",void 0);We=r([L("manage-bar")],We);/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const hi=(a,e)=>{var t,i;const o=a._$AN;if(o===void 0)return!1;for(const s of o)(i=(t=s)._$AO)===null||i===void 0||i.call(t,e,!1),hi(s,e);return!0},eo=a=>{let e,t;do{if((e=a._$AM)===void 0)break;t=e._$AN,t.delete(a),a=e}while((t==null?void 0:t.size)===0)},fn=a=>{for(let e;e=a._$AM;a=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(a))break;t.add(a),vc(e)}};function uc(a){this._$AN!==void 0?(eo(this),this._$AM=a,fn(this)):this._$AM=a}function fc(a,e=!1,t=0){const i=this._$AH,o=this._$AN;if(o!==void 0&&o.size!==0)if(e)if(Array.isArray(i))for(let s=t;s{var e,t,i,o;a.type==Ie.CHILD&&((e=(i=a)._$AP)!==null&&e!==void 0||(i._$AP=fc),(t=(o=a)._$AQ)!==null&&t!==void 0||(o._$AQ=uc))};class mc extends ki{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,i){super._$AT(e,t,i),fn(this),this.isConnected=e._$AU}_$AO(e,t=!0){var i,o;e!==this.isConnected&&(this.isConnected=e,e?(i=this.reconnected)===null||i===void 0||i.call(this):(o=this.disconnected)===null||o===void 0||o.call(this)),t&&(hi(this,e),eo(this))}setValue(e){if(Ir(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}}const Xo=new WeakMap,gc=Ci(class extends mc{render(a){return b}update(a,[e]){var t;const i=e!==this.U;return i&&this.U!==void 0&&this.ot(void 0),(i||this.rt!==this.lt)&&(this.U=e,this.ht=(t=a.options)===null||t===void 0?void 0:t.host,this.ot(this.lt=a.element)),b}ot(a){var e;if(typeof this.U=="function"){const t=(e=this.ht)!==null&&e!==void 0?e:globalThis;let i=Xo.get(t);i===void 0&&(i=new WeakMap,Xo.set(t,i)),i.get(this.U)!==void 0&&this.U.call(this.ht,void 0),i.set(this.U,a),a!==void 0&&this.U.call(this.ht,a)}else this.U.value=a}get rt(){var a,e,t;return typeof this.U=="function"?(e=Xo.get((a=this.ht)!==null&&a!==void 0?a:globalThis))===null||e===void 0?void 0:e.get(this.U):(t=this.U)===null||t===void 0?void 0:t.value}disconnected(){this.rt===this.lt&&this.ot(void 0)}reconnected(){this.ot(this.lt)}});/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const fr=Ci(class extends ki{constructor(a){if(super(a),a.type!==Ie.PROPERTY&&a.type!==Ie.ATTRIBUTE&&a.type!==Ie.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Ir(a))throw Error("`live` bindings can only contain a single expression")}render(a){return a}update(a,[e]){if(e===Ce||e===b)return e;const t=a.element,i=a.name;if(a.type===Ie.PROPERTY){if(e===t[i])return Ce}else if(a.type===Ie.BOOLEAN_ATTRIBUTE){if(!!e===t.hasAttribute(i))return Ce}else if(a.type===Ie.ATTRIBUTE&&t.getAttribute(i)===e+"")return Ce;return Ur(a),e}});Zo.extend(zn);const bc=180,yc=40,wc=10,_c=125,xc=30,vr="YYYY",Sc="no data",$c=0,mr=4,Cc=v`var(--histogramDateRangeSliderColor, #4B65FE)`,kc=v`var(--histogramDateRangeSelectedRangeColor, #DBE0FF)`,Tc=v`var(--histogramDateRangeBarIncludedFill, #2C2C2C)`,Ec=v`var(--histogramDateRangeActivityIndicator, #2C2C2C)`,Mc=v`var(--histogramDateRangeBarExcludedFill, #CCCCCC)`,zc=v`var(--histogramDateRangeInputRowMargin, 0)`,Pc=v`var(--histogramDateRangeInputBorder, 0.5px solid #2C2C2C)`,Ac=v`var(--histogramDateRangeInputWidth, 35px)`,Lc=v`var(--histogramDateRangeInputFontSize, 1.2rem)`,Dc=v`var(--histogramDateRangeInputFontFamily, sans-serif)`,gr=v`var(--histogramDateRangeTooltipBackgroundColor, #2C2C2C)`,br=v`var(--histogramDateRangeTooltipTextColor, #FFFFFF)`,Rc=v`var(--histogramDateRangeTooltipFontSize, 1.1rem)`,Fc=v`var(--histogramDateRangeTooltipFontFamily, sans-serif)`;let J=class extends D{constructor(){super(...arguments),this.width=bc,this.height=yc,this.sliderWidth=wc,this.tooltipWidth=_c,this.tooltipHeight=xc,this.updateDelay=$c,this.dateFormat=vr,this.missingDataMessage=Sc,this.minDate="",this.maxDate="",this.disabled=!1,this.bins=[],this.updateWhileFocused=!1,this._tooltipOffset=0,this._tooltipVisible=!1,this._isDragging=!1,this._isLoading=!1,this._minSelectedDate="",this._maxSelectedDate="",this._minDateMS=0,this._maxDateMS=0,this._dragOffset=0,this._histWidth=0,this._binWidth=0,this._histData=[],this._previousDateRange="",this.drag=e=>{e.preventDefault(),!this.disabled&&(this.setDragOffset(e),this._isDragging=!0,this.addListeners(),this.cancelPendingUpdateEvent())},this.drop=()=>{this._isDragging&&(this.removeListeners(),this.beginEmitUpdateProcess()),this._isDragging=!1},this.move=e=>{const t=this.getBoundingClientRect().x,i=e.clientX-t-this._dragOffset;this._currentSlider.id==="slider-min"?this.minSelectedDate=this.translatePositionToDate(this.validMinSliderX(i)):this.maxSelectedDate=this.translatePositionToDate(this.validMaxSliderX(i))}}disconnectedCallback(){this.removeListeners(),super.disconnectedCallback()}updated(e){(e.has("bins")||e.has("minDate")||e.has("maxDate")||e.has("minSelectedDate")||e.has("maxSelectedDate")||e.has("width")||e.has("height"))&&this.handleDataUpdate()}handleDataUpdate(){!this.hasBinData||(this._histWidth=this.width-this.sliderWidth*2,this._minDateMS=this.getMSFromString(this.minDate),this._maxDateMS=this.getMSFromString(this.maxDate),this._binWidth=this._histWidth/this._numBins,this._previousDateRange=this.currentDateRangeString,this._histData=this.calculateHistData(),this.minSelectedDate=this.minSelectedDate?this.minSelectedDate:this.minDate,this.maxSelectedDate=this.maxSelectedDate?this.maxSelectedDate:this.maxDate,this.requestUpdate())}calculateHistData(){const e=Math.min(...this.bins),t=Math.max(...this.bins),i=e===t?1:Math.log1p(t),o=this.height/i,s=this.dateRangeMS/this._numBins;return this.bins.map((n,l)=>({value:n,height:Math.floor(Math.log1p(n)*o),binStart:`${this.formatDate(l*s+this._minDateMS)}`,binEnd:`${this.formatDate((l+1)*s+this._minDateMS)}`}))}get hasBinData(){return this._numBins>0}get _numBins(){return!this.bins||!this.bins.length?0:this.bins.length}get histogramLeftEdgeX(){return this.sliderWidth}get histogramRightEdgeX(){return this.width-this.sliderWidth}get loading(){return this._isLoading}set loading(e){this.disabled=e,this._isLoading=e}get minSelectedDate(){return this.formatDate(this.getMSFromString(this._minSelectedDate))}set minSelectedDate(e){if(!this._minSelectedDate){this._minSelectedDate=e;return}const t=this.getMSFromString(e),i=!Number.isNaN(t),o=t<=this.getMSFromString(this.maxSelectedDate);i&&o&&(this._minSelectedDate=this.formatDate(t)),this.requestUpdate()}get maxSelectedDate(){return this.formatDate(this.getMSFromString(this._maxSelectedDate))}set maxSelectedDate(e){if(!this._maxSelectedDate){this._maxSelectedDate=e;return}const t=this.getMSFromString(e),i=!Number.isNaN(t),o=t>=this.getMSFromString(this.minSelectedDate);i&&o&&(this._maxSelectedDate=this.formatDate(t)),this.requestUpdate()}get minSliderX(){const e=this.translateDateToPosition(this.minSelectedDate);return this.validMinSliderX(e)}get maxSliderX(){const e=this.translateDateToPosition(this.maxSelectedDate);return this.validMaxSliderX(e)}get dateRangeMS(){return this._maxDateMS-this._minDateMS}showTooltip(e){if(this._isDragging||this.disabled)return;const t=e.currentTarget,i=t.x.baseVal.value+this.sliderWidth/2,o=t.dataset,s=`item${o.numItems!=="1"?"s":""}`,n=Number(o.numItems).toLocaleString();this._tooltipOffset=i+(this._binWidth-this.sliderWidth-this.tooltipWidth)/2,this._tooltipContent=c` + ${n} ${s}
    + ${o.binStart} - ${o.binEnd} + `,this._tooltipVisible=!0}hideTooltip(){this._tooltipContent=void 0,this._tooltipVisible=!1}validMinSliderX(e){const t=Math.min(this.translateDateToPosition(this.maxSelectedDate),this.histogramRightEdgeX);return e=this.clamp(e,this.histogramLeftEdgeX,t),Number.isNaN(e)||tthis.histogramRightEdgeX?this.histogramRightEdgeX:e}addListeners(){window.addEventListener("pointermove",this.move),window.addEventListener("pointerup",this.drop),window.addEventListener("pointercancel",this.drop)}removeListeners(){window.removeEventListener("pointermove",this.move),window.removeEventListener("pointerup",this.drop),window.removeEventListener("pointercancel",this.drop)}beginEmitUpdateProcess(){this.cancelPendingUpdateEvent(),this._emitUpdatedEventTimer=setTimeout(()=>{if(this.currentDateRangeString===this._previousDateRange)return;this._previousDateRange=this.currentDateRangeString;const e={detail:{minDate:this.minSelectedDate,maxDate:this.maxSelectedDate},bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("histogramDateRangeUpdated",e))},this.updateDelay)}cancelPendingUpdateEvent(){this._emitUpdatedEventTimer!==void 0&&(clearTimeout(this._emitUpdatedEventTimer),this._emitUpdatedEventTimer=void 0)}setDragOffset(e){this._currentSlider=e.currentTarget;const t=this._currentSlider.id==="slider-min"?this.minSliderX:this.maxSliderX,i=this.getBoundingClientRect().x;this._dragOffset=e.clientX-i-t}translatePositionToDate(e){const t=Math.ceil((e-this.sliderWidth)*this.dateRangeMS/this._histWidth);return this.formatDate(this._minDateMS+t)}translateDateToPosition(e){const t=this.getMSFromString(e);return this.sliderWidth+(t-this._minDateMS)*this._histWidth/this.dateRangeMS}clamp(e,t,i){return Math.min(Math.max(e,t),i)}handleInputFocus(){this.updateWhileFocused||this.cancelPendingUpdateEvent()}handleMinDateInput(e){const t=e.currentTarget;t.value!==this.minSelectedDate&&(this.minSelectedDate=t.value,this.beginEmitUpdateProcess())}handleMaxDateInput(e){const t=e.currentTarget;t.value!==this.maxSelectedDate&&(this.maxSelectedDate=t.value,this.beginEmitUpdateProcess())}handleKeyUp(e){if(e.key==="Enter"){const t=e.currentTarget;t.blur(),t.id==="date-min"?this.handleMinDateInput(e):t.id==="date-max"&&this.handleMaxDateInput(e)}}get currentDateRangeString(){return`${this.minSelectedDate}:${this.maxSelectedDate}`}getMSFromString(e){const t=typeof e=="string"?e:String(e);if((t.split(/(\d+)/).length-1)/2===1){const o=new Date(0,0);return o.setFullYear(Number(t)),o.getTime()}return Zo(t,[this.dateFormat,vr]).valueOf()}handleBarClick(e){const t=e.currentTarget.dataset,i=(this.getMSFromString(t.binStart)+this.getMSFromString(t.binEnd))/2,o=Math.abs(i-this.getMSFromString(this.minSelectedDate)),s=Math.abs(i-this.getMSFromString(this.maxSelectedDate));o + + + + + `}get selectedRangeTemplate(){return U` + `}get histogramTemplate(){const e=this._histWidth/this._numBins,t=e-1;let i=this.sliderWidth;return this._histData.map(o=>{const s=U` + `;return i+=e,s})}formatDate(e){if(Number.isNaN(e))return"";const t=Zo(e);return t.year()<1e3?String(t.year()):t.format(this.dateFormat)}get minInputTemplate(){return c` + + `}get maxInputTemplate(){return c` + + `}get minLabelTemplate(){return c``}get maxLabelTemplate(){return c``}get tooltipTemplate(){return c` + +
    ${this._tooltipContent}
    + `}get noDataTemplate(){return c` +
    ${this.missingDataMessage}
    + `}get activityIndicatorTemplate(){return this.loading?c` + + `:b}render(){return this.hasBinData?c` +
    + ${this.activityIndicatorTemplate} ${this.tooltipTemplate} +
    + + ${this.selectedRangeTemplate} + ${this.histogramTemplate} + ${this.minSliderTemplate} ${this.maxSliderTemplate} + +
    + ${this.minLabelTemplate} ${this.minInputTemplate} +
    -
    + ${this.maxLabelTemplate} ${this.maxInputTemplate} + +
    +
    +
    + `:this.noDataTemplate}};J.styles=v` + .missing-data-message { + text-align: center; + } + #container { + margin: 0; + touch-action: none; + position: relative; + } + .disabled { + opacity: 0.3; + } + ia-activity-indicator { + position: absolute; + left: calc(50% - 10px); + top: 10px; + width: 20px; + height: 20px; + --activityIndicatorLoadingDotColor: rgba(0, 0, 0, 0); + --activityIndicatorLoadingRingColor: ${Ec}; + } + + /* prevent selection from interfering with tooltip, especially on mobile */ + /* https://stackoverflow.com/a/4407335/1163042 */ + .noselect { + -webkit-touch-callout: none; /* iOS Safari */ + -webkit-user-select: none; /* Safari */ + -moz-user-select: none; /* Old versions of Firefox */ + -ms-user-select: none; /* Internet Explorer/Edge */ + user-select: none; /* current Chrome, Edge, Opera and Firefox */ + } + .bar { + /* create a transparent border around the hist bars to prevent "gaps" and + flickering when moving around between bars. this also helps with handling + clicks on the bars, preventing users from being able to click in between + bars */ + stroke: rgba(0, 0, 0, 0); + /* ensure transparent stroke wide enough to cover gap between bars */ + stroke-width: 2px; + } + .bar:hover { + /* highlight currently hovered bar */ + fill-opacity: 0.7; + } + .disabled .bar:hover { + /* ensure no visual hover interaction when disabled */ + fill-opacity: 1; + } + /****** histogram ********/ + #tooltip { + position: absolute; + background: ${gr}; + color: ${br}; + text-align: center; + border-radius: 3px; + padding: 2px; + font-size: ${Rc}; + font-family: ${Fc}; + touch-action: none; + pointer-events: none; + } + #tooltip:after { + content: ''; + position: absolute; + margin-left: -5px; + top: 100%; + /* arrow */ + border: 5px solid ${br}; + border-color: ${gr} transparent transparent + transparent; + } + /****** slider ********/ + .draggable:hover { + cursor: grab; + } + .dragging { + cursor: grabbing !important; + } + /****** inputs ********/ + #inputs { + display: flex; + justify-content: center; + margin: ${zc}; + } + #inputs .dash { + position: relative; + bottom: -1px; + align-self: center; /* Otherwise the dash sticks to the top while the inputs grow */ + } + input { + width: ${Ac}; + margin: 0 3px; + border: ${Pc}; + border-radius: 2px !important; + text-align: center; + font-size: ${Lc}; + font-family: ${Dc}; + } + .sr-only { + position: absolute !important; + width: 1px !important; + height: 1px !important; + margin: 0 !important; + padding: 0 !important; + border: 0 !important; + overflow: hidden !important; + white-space: nowrap !important; + clip: rect(1px, 1px, 1px, 1px) !important; + -webkit-clip-path: inset(50%) !important; + clip-path: inset(50%) !important; + } + `;r([h({type:Number})],J.prototype,"width",void 0);r([h({type:Number})],J.prototype,"height",void 0);r([h({type:Number})],J.prototype,"sliderWidth",void 0);r([h({type:Number})],J.prototype,"tooltipWidth",void 0);r([h({type:Number})],J.prototype,"tooltipHeight",void 0);r([h({type:Number})],J.prototype,"updateDelay",void 0);r([h({type:String})],J.prototype,"dateFormat",void 0);r([h({type:String})],J.prototype,"missingDataMessage",void 0);r([h({type:String})],J.prototype,"minDate",void 0);r([h({type:String})],J.prototype,"maxDate",void 0);r([h({type:Boolean})],J.prototype,"disabled",void 0);r([h({type:Object})],J.prototype,"bins",void 0);r([h({type:Boolean})],J.prototype,"updateWhileFocused",void 0);r([P()],J.prototype,"_tooltipOffset",void 0);r([P()],J.prototype,"_tooltipContent",void 0);r([P()],J.prototype,"_tooltipVisible",void 0);r([P()],J.prototype,"_isDragging",void 0);r([P()],J.prototype,"_isLoading",void 0);r([h({type:Boolean})],J.prototype,"loading",null);r([h()],J.prototype,"minSelectedDate",null);r([h()],J.prototype,"maxSelectedDate",null);J=r([L("histogram-date-range")],J);const yr=U` +`,wr=U` + + + +`;let se=class extends D{constructor(){super(...arguments),this.prompt="Do you find this feature useful?",this.buttonText="Beta",this.isOpen=!1,this.processing=!1,this.popupTopX=0,this.popupTopY=0,this.voteSubmitted=!1,this.voteNeedsChoosing=!1,this.resizingElement=document.body}render(){return c` + + ${this.popupTemplate} + `}firstUpdated(){this.boundEscapeListener=this.handleEscape.bind(this),this.boundScrollListener=this.handleScroll.bind(this)}updated(e){if(e.has("vote")&&this.vote&&(this.error=void 0,this.voteNeedsChoosing=!1),e.has("resizeObserver")){const t=e.get("resizeObserver");this.disconnectResizeObserver(t)}}handleResize(){!this.isOpen||this.positionPopup()}handleScroll(){!this.isOpen||this.positionPopup()}disconnectedCallback(){this.removeEscapeListener(),this.disconnectResizeObserver(this.resizeObserver)}disconnectResizeObserver(e){const t=e!=null?e:this.resizeObserver;t==null||t.removeObserver({handler:this,target:this.resizingElement})}setupResizeObserver(){!this.resizeObserver||this.resizeObserver.addObserver({handler:this,target:this.resizingElement})}async setupRecaptcha(){!this.recaptchaManager||(this.recaptchaWidget=await this.recaptchaManager.getRecaptchaWidget())}resetState(){this.vote=void 0,this.voteSubmitted=!1,this.error=void 0,this.voteNeedsChoosing=!1,this.comments.value=""}async showPopup(){this.voteSubmitted||(this.resetState(),this.setupResizeObserver(),this.setupScrollObserver(),this.setupEscapeListener(),this.positionPopup(),this.isOpen=!0,await this.setupRecaptcha())}closePopup(){this.disconnectResizeObserver(),this.stopScrollObserver(),this.removeEscapeListener(),this.isOpen=!1}positionPopup(){const e=this.betaButton.getBoundingClientRect(),t=this.popup.getBoundingClientRect(),i=window.innerWidth,o=window.innerHeight,s=i/2,n=o/2;e.lefti&&(this.popupTopX=i-t.width),e.top + + + `}get upvoteSelected(){return this.vote==="up"}get downvoteSelected(){return this.vote==="down"}upvoteKeypressed(e){(e.key==="Enter"||e.key===" ")&&this.upvoteButtonSelected()}downvoteKeypressed(e){(e.key==="Enter"||e.key===" ")&&this.downvoteButtonSelected()}upvoteButtonSelected(){this.vote=this.vote==="up"?void 0:"up"}downvoteButtonSelected(){this.vote=this.vote==="down"?void 0:"down"}get chooseVoteErrorClass(){return this.voteNeedsChoosing?"error":""}get upvoteButtonClass(){switch(this.vote){case"up":return"selected";case"down":return"unselected";default:return"noselection"}}get downvoteButtonClass(){switch(this.vote){case"up":return"unselected";case"down":return"selected";default:return"noselection"}}backgroundClicked(e){var t;e.target instanceof Node&&(!((t=this.popup)===null||t===void 0)&&t.contains(e.target)||this.closePopup())}cancel(e){e.preventDefault(),this.vote=void 0,this.closePopup()}async submit(e){if(e.preventDefault(),!this.vote){this.voteNeedsChoosing=!0,this.error=c`Please select a vote.`;return}if(!this.featureIdentifier)throw new Error("featureIdentifier is required");if(!this.featureFeedbackService)throw new Error("featureFeedbackService is required");if(!this.recaptchaWidget)throw new Error("recaptchaWidget is required");this.processing=!0;try{const t=await this.recaptchaWidget.execute();(await this.featureFeedbackService.submitFeedback({featureIdentifier:this.featureIdentifier,vote:this.vote,comments:this.comments.value,recaptchaToken:t})).success?(this.voteSubmitted=!0,this.closePopup()):this.error=c`There was an error submitting your feedback.`}catch(t){this.error=c`There was an error submitting your feedback.
    Error: + ${t instanceof Error?t.message:t}`}this.processing=!1}static get styles(){const e=v`var(--featureFeedbackBlueColor, #194880)`,t=v`var(--featureFeedbackDarkGrayColor, #767676)`,i=v`var(--defaultColorSvgFilter, invert(52%) sepia(0%) saturate(1%) hue-rotate(331deg) brightness(87%) contrast(89%))`,o=v`var(--featureFeedbackBackdropZindex, 5)`,s=v`var(--featureFeedbackModalZindex, 6)`,n=v`var(--featureFeedbackPopupBorderColor, ${e})`,l=v`var(--featureFeedbackSubmitButtonColor, ${e})`,d=v`var(--featureFeedbackBetaButtonBorderColor, ${e})`,p=v`var(--featureFeedbackBetaButtonTextColor, ${e})`,f=v`var(--featureFeedbackBetaButtonSvgFilter, ${i})`,m=v`var(--featureFeedbackCancelButtonColor, #515151)`,y=v`var(--featureFeedbackPopupBlockerColor, rgba(255, 255, 255, 0.3))`,w=v`var(--featureFeedbackPopupBackgroundColor, #F5F5F7)`,x=v`var(--featureFeedbackPromptFontWeight, bold)`,C=v`var(--featureFeedbackPromptFontSize, 14px)`,A=v`var(--defaultColor, ${t});`,F=v`var(--defaultColorSvgFilter, ${i});`,R=v`var(--upvoteColor, #23765D);`,W=v`var(--upvoteColorSvgFilter, invert(34%) sepia(72%) saturate(357%) hue-rotate(111deg) brightness(97%) contrast(95%));`,B=v`var(--downvoteColor, #720D11);`,Z=v`var(--downvoteColorSvgFilter, invert(5%) sepia(81%) saturate(5874%) hue-rotate(352deg) brightness(105%) contrast(95%));`,he=v`var(--unselectedColor, #CCCCCC);`,ze=v`var(--unselectedColorSvgFilter, invert(100%) sepia(0%) saturate(107%) hue-rotate(138deg) brightness(89%) contrast(77%));`;return v` + #beta-button { + font-size: 12px; + font-weight: bold; + font-style: italic; + color: ${p}; + border: 1px solid ${d}; + border-radius: 4px; + padding: 1px 5px; + } + + .beta-button-thumb svg { + height: 10px; + width: 10px; + filter: ${f}; + } + + .beta-button-thumb.unselected svg { + filter: ${ze}; + } + + #error { + color: red; + font-size: 14px; + text-align: center; + font-weight: bold; + } + + #popup-background { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: ${o}; + background-color: ${y}; + overflow: hidden; + } + + #popup-background.closed { + visibility: hidden; + top: -100%; + left: -100%; + } + + #popup { + position: absolute; + padding: 10px; + background-color: ${w}; + border: 1px ${n} solid; + border-radius: 5px; + box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8); + z-index: ${s}; + max-width: 300px; + margin-left: 10px; + margin-right: 10px; + } + + button, + input, + a, + textarea { + font-family: inherit; + } + + button, + input[type='submit'] { + background: none; + cursor: pointer; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + border: none; + } + + button:disabled, + input[type='submit']:disabled { + cursor: default; + opacity: 0.5; + } + + #form > div { + margin-bottom: 10px; + } + + #form > div:last-child { + margin-bottom: 0; + } + + #prompt { + display: flex; + align-items: center; + font-size: ${C}; + font-weight: ${x}; + } + + #prompt > label { + flex: none; + cursor: pointer; + } + + #prompt-text { + text-align: left; + } + + #comments { + width: 100%; + height: 50px; + background-color: #ffffff; + border: 1px #2c2c2c solid; + border-radius: 4px; + padding: 7px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + resize: none; + } + + #comments::placeholder { + color: #767676; + } + + #actions { + display: flex; + justify-content: center; + } + + .cta-button { + color: white; + font-size: 14px; + border-radius: 4px; + height: 30px; + margin: 0; + } + + #cancel-button { + background-color: ${m}; + } + + #submit-button { + background-color: ${l}; + margin-left: 10px; + } + + .vote-button { + background-color: #ffffff; + border: 1px solid #767676; + border-radius: 2px; + padding: 0; + width: 25px; + height: 25px; + box-sizing: border-box; + display: flex; + justify-content: center; + align-items: center; + margin-left: 10px; + } + + .vote-button svg { + width: 15px; + height: 15px; + } + + .vote-button input { + margin: 0; + padding: 0; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + } + + .vote-button.noselection { + border-color: ${A}; + } + + .vote-button.noselection svg { + filter: ${F}; + } + + .vote-button.unselected { + border-color: ${he}; + } + + .vote-button.unselected svg { + filter: ${ze}; + } + + .upvote-button.selected { + border-color: ${R}; + } + + .upvote-button.selected svg { + filter: ${W}; + } + + .downvote-button.selected { + border-color: ${B}; + } + + .downvote-button.selected svg { + filter: ${Z}; + } + + .vote-button.error { + box-shadow: 0 0 4px red; + } + `}};r([h({type:String})],se.prototype,"featureIdentifier",void 0);r([h({type:String})],se.prototype,"prompt",void 0);r([h({type:String})],se.prototype,"buttonText",void 0);r([h({type:Object})],se.prototype,"recaptchaManager",void 0);r([h({type:Object})],se.prototype,"resizeObserver",void 0);r([h({type:Boolean})],se.prototype,"disabled",void 0);r([h({type:Object})],se.prototype,"featureFeedbackService",void 0);r([G("#beta-button")],se.prototype,"betaButton",void 0);r([G("#popup")],se.prototype,"popup",void 0);r([P()],se.prototype,"isOpen",void 0);r([P()],se.prototype,"processing",void 0);r([P()],se.prototype,"popupTopX",void 0);r([P()],se.prototype,"popupTopY",void 0);r([P()],se.prototype,"vote",void 0);r([P()],se.prototype,"voteSubmitted",void 0);r([P()],se.prototype,"error",void 0);r([P()],se.prototype,"voteNeedsChoosing",void 0);r([P()],se.prototype,"recaptchaWidget",void 0);r([G("#comments")],se.prototype,"comments",void 0);se=r([L("feature-feedback")],se);var Bc=c` + + + +`,Oc=U` + + + Go left icon + +`,Ic=U` + + + Go right icon + +`;let Ht=class extends D{constructor(){super(...arguments),this.step=2,this.currentPage=1,this.pages=[]}firstUpdated(){this.observePageCount()}updated(e){e.has("size")&&this.observePageCount(),e.has("currentPage")&&(this.observePageCount(),this.emitPageClick())}observePageCount(){this.pages=[];const e=7,t=this.size<=e;if(this.size<=5){this.pages=[...Array(this.size).keys()].map(s=>s+1);return}if(this.size===e){if(this.currentPage===2){this.pages=[1,2,3,4,0,this.size];return}if(this.currentPage===this.size-1){this.pages=[1,0,4,5,this.size-1,this.size];return}}if(this.currentPage===1){this.pages=[1,2,3,0,this.size];return}if(this.currentPage===this.size){this.pages=[1,0,this.size-2,this.size-1,this.size];return}if(this.currentPage===this.size-1){this.pages=[1,0,this.size-3,this.size-2,this.size-1,this.size];return}if(t&&this.currentPage>1&&this.currentPages+1);return}let i=this.currentPage-this.step,o=this.currentPage+this.step;i<=0&&(o+=-i+1,i=1),o>=this.size&&(i=Math.max(i-(o-this.size),1),o=this.size),i===2&&(o-=1),o===this.size-1&&(i+=1),this.createFirstNode(i),this.createMiddelNode(i,o),this.createLastNode(o)}createFirstNode(e){var t,i;e>1&&((t=this.pages)===null||t===void 0||t.push(1)),e>2&&((i=this.pages)===null||i===void 0||i.push(0))}createMiddelNode(e,t){var i;for(let o=e;o<=t;o+=1)(i=this.pages)===null||i===void 0||i.push(o)}createLastNode(e){var t,i;e...`}emitPageClick(){this.dispatchEvent(new CustomEvent("pageNumberClicked",{detail:{page:this.currentPage},bubbles:!0,composed:!0}))}onRewind(){this.currentPage-=1,this.currentPage<1&&(this.currentPage=1)}onForward(){this.currentPage+=1,this.currentPage>this.size&&(this.currentPage=this.size)}onChange(e){this.currentPage=e}getPageTemplate(e){return c` + + `}get getPagesTemplate(){var e;return!this.pages||!this.pages.length?b:c` + ${(e=this.pages)===null||e===void 0?void 0:e.map(t=>c`${t!==0?this.getPageTemplate(t):this.getEllipsisTemplate}`)} + `}render(){return c` +
    + +
    ${this.getPagesTemplate}
    + +
    + `}static get styles(){return[et,v` + .facets-pagination { + user-select: none; + margin-top: 10px; + background-color: #eee; + text-align: center; + } + .facets-pagination button { + border: none; + background: none; + } + .facets-pagination .arrow-icon { + width: 2.5rem; + vertical-align: middle; + } + .facets-pagination .arrow-icon svg { + height: 14px; + fill: #2c2c2c; + } + .facets-pagination button, + .facets-pagination i { + background: none; + border: 0; + cursor: pointer; + border-radius: 4px; + margin: 10px 5px; + padding: 5px; + font-size: 1.4rem; + color: inherit; + vertical-align: baseline; + display: inline-block; + min-width: 2.5rem; + } + .facets-pagination i { + cursor: auto; + display: inline; + } + .facets-pagination button.current { + background: #2c2c2c; + color: white; + } + .page-numbers { + display: inline-block; + } + `]}};r([h({type:Number})],Ht.prototype,"size",void 0);r([h({type:Number})],Ht.prototype,"step",void 0);r([h({type:Number})],Ht.prototype,"currentPage",void 0);r([P()],Ht.prototype,"pages",void 0);Ht=r([L("more-facets-pagination")],Ht);var Uc=U` + +`,Nc=U` + +`,Ea;let wi=Ea=class extends D{render(){return c`${this.facetRowTemplate}`}get facetRowTemplate(){var e,t,i,o;const{bucket:s,facetType:n}=this;if(!s||!n)return b;const l=`${n}:${s.key}-show-only`,d=`${n}:${s.key}-negative`,p=n!=="collection"?c`${(e=s.displayText)!==null&&e!==void 0?e:s.key}`:c` + ${(i=(t=this.collectionTitles)===null||t===void 0?void 0:t.get(s.key))!==null&&i!==void 0?i:s.key} + `,f=s.state==="hidden",m=s.state==="selected",y=`${n}: ${(o=s.displayText)!==null&&o!==void 0?o:s.key}`,w=m?`Show all ${n}s`:`Only show ${y}`,x=`Hide ${y}`,C=`Unhide ${y}`,A=f?C:x,F=`${y}, ${s.count} results`;return c` +
    +
    + {this.facetClicked(R,!1)}} + .checked=${m} + class="select-facet-checkbox" + title=${w} + id=${l} + data-testid=${l} + /> + {this.facetClicked(R,!0)}} + .checked=${f} + class="hide-facet-checkbox" + /> + +
    + +
    + `}facetClicked(e,t){const{bucket:i,facetType:o}=this;if(!i||!o)return;const s=e.target,{checked:n}=s;this.bucket=ne(q({},i),{state:Ea.getFacetState(n,t)}),this.dispatchFacetClickEvent({facetType:o,bucket:this.bucket,negative:t})}dispatchFacetClickEvent(e){const t=new CustomEvent("facetClick",{detail:e});this.dispatchEvent(t)}static getFacetState(e,t){let i;return e?i=t?"hidden":"selected":i="none",i}static get styles(){const e=v`var(--facet-row-border-top, 1px solid transparent)`,t=v`var(--facet-row-border-bottom, 1px solid transparent)`;return v` + async-collection-name { + display: contents; + } + .facet-checkboxes { + margin: 0 5px 0 0; + display: flex; + height: 15px; + } + .facet-checkboxes input:first-child { + margin-right: 5px; + } + .facet-checkboxes input { + height: 15px; + width: 15px; + margin: 0; + } + .facet-row-container { + display: flex; + font-weight: 500; + font-size: 1.2rem; + margin: 2.5px auto; + height: auto; + border-top: ${e}; + border-bottom: ${t}; + overflow: hidden; + } + .facet-info-display { + display: flex; + flex: 1 1 0%; + cursor: pointer; + flex-wrap: wrap; + } + .facet-title { + word-break: break-word; + display: inline-block; + flex: 1 1 0%; + } + .facet-count { + text-align: right; + } + .select-facet-checkbox { + cursor: pointer; + display: inline-block; + } + .hide-facet-checkbox { + display: none; + } + .hide-facet-icon { + width: 15px; + height: 15px; + cursor: pointer; + opacity: 0.3; + display: inline-block; + } + .hide-facet-icon:hover, + .active { + opacity: 1; + } + .hide-facet-icon:hover .eye, + .hide-facet-icon .eye-closed { + display: none; + } + .hide-facet-icon:hover .eye-closed, + .hide-facet-icon.active .eye-closed { + display: inline; + } + .hide-facet-icon.active .eye { + display: none; + } + .sorting-icon { + cursor: pointer; + } + + a:link, + a:visited { + text-decoration: none; + color: var(--ia-theme-link-color, #4b64ff); + } + a:hover { + text-decoration: underline; + } + `}};r([h({type:String})],wi.prototype,"facetType",void 0);r([h({type:Object})],wi.prototype,"bucket",void 0);r([h({type:Object})],wi.prototype,"collectionTitles",void 0);wi=Ea=r([L("facet-row")],wi);let to=class extends D{facetClicked(e){this.dispatchFacetClickEvent(e.detail)}dispatchFacetClickEvent(e){const t=new CustomEvent("facetClick",{detail:e,composed:!0});this.dispatchEvent(t)}get facetsTemplate(){const{facetGroup:e}=this;if(!e)return b;const t=e.buckets;return c` +
    + ${Ra(t,i=>`${e.key}:${i.key}`,i=>c``)} +
    + `}render(){return c`${this.facetsTemplate}`}static get styles(){const e=v`var(--facetsColumnCount, 1)`,t=v`var(--facetsColumnGap, 15px)`;return v` + .facet-rows { + column-count: ${e}; + column-gap: ${t}; + } + + a:link, + a:visited { + text-decoration: none; + color: var(--ia-theme-link-color, #4b64ff); + } + a:hover { + text-decoration: underline; + } + `}};r([h({type:Object})],to.prototype,"facetGroup",void 0);r([h({type:Object})],to.prototype,"collectionTitles",void 0);to=r([L("facets-template")],to);let st=class extends D{constructor(){super(...arguments),this.leftValue="",this.rightValue="",this.side="left"}render(){var e,t;return c` +
    + + + + + +
    + `}get value(){return this.side==="left"?this.leftValue:this.rightValue}get selectedLabel(){var e,t;return this.side==="left"?(e=this.leftLabel)!==null&&e!==void 0?e:this.leftValue:(t=this.rightLabel)!==null&&t!==void 0?t:this.rightValue}handleClick(){this.side=this.side==="left"?"right":"left",this.emitChangeEvent()}handleRadioChange(){this.side=this.leftRadio.checked?"left":"right",this.emitChangeEvent()}emitChangeEvent(){const e=new CustomEvent("change",{detail:this.value});this.dispatchEvent(e)}static get styles(){const e=v`var(--switchWidth, 30px)`,t=v`var(--switchHeight, 14px)`,i=v`var(--switchMarginLeft, 5px)`,o=v`var(--switchMarginRight, 5px)`,s=v`var(--switchBorderWidth, 3px)`,n=v`var(--switchBgColor, #194880)`,l=v`var(--switchBorderColor, #194880)`,d=v`var(--labelFontSize, 1.3rem)`,p=v`var(--knobColor, white)`,f=v`var(--knobTransitionDuration, 0.25s)`,m=v`var(--knobTransitionFn, ease)`;return[et,v` + #container { + display: inline-flex; + align-items: center; + flex-wrap: nowrap; + font-size: ${d}; + } + + #switch-button { + width: ${e}; + height: ${t}; + margin: 0 ${o} 0 ${i}; + padding: 0; + border: ${s} solid ${l}; + border-radius: ${t}; + box-sizing: content-box; + background: ${n}; + appearance: none; + cursor: pointer; + } + + #switch-button.left #knob { + transform: translateX(0); + } + + #switch-button.right #knob { + transform: translateX(calc(${e} - ${t})); + } + + #switch-button:focus-visible { + outline: 2px solid black; + outline-offset: 2px; + } + + #knob { + display: block; + width: ${t}; + height: ${t}; + border-radius: 50%; + background: ${p}; + transition: transform ${f} ${m}; + } + + @media (prefers-reduced-motion: reduce) { + #knob { + transition-duration: 0.001s !important; /* Imperceptibly fast */ + } + } + `]}};r([h({type:String,attribute:!0})],st.prototype,"leftValue",void 0);r([h({type:String,attribute:!0})],st.prototype,"leftLabel",void 0);r([h({type:String,attribute:!0})],st.prototype,"rightValue",void 0);r([h({type:String,attribute:!0})],st.prototype,"rightLabel",void 0);r([h({type:String,attribute:!0})],st.prototype,"side",void 0);r([G("#switch-left")],st.prototype,"leftRadio",void 0);st=r([L("toggle-switch")],st);function Ma(a,e){if(!!a)for(const[t,i]of Object.entries(a))for(const[o,s]of Object.entries(i))e(t,o,s,a)}function io(a,e,t,i=!1){const o=a!=null?a:Xe(),s=ne(q({},o),{[e]:ne(q({},o[e]),{[t.key]:t})});return i&&t.state==="none"&&delete s[e][t.key],s}function Hc(a){const e=Xe();return Ma(a,(t,i,o)=>{e[t][i]=o}),e}function Vc(a,e){const t=Hc(a);return Ma(e,(i,o,s)=>{t[i][o]=s}),Ma(t,(i,o,s)=>{s.state==="none"&&delete t[i][o]}),t}const _r=["selected","hidden","none"];function vn(a,e=K.COUNT){return a.sort((t,i)=>{const o=_r.indexOf(t.state),s=_r.indexOf(i.state),n=o-s;let l;return e===K.ALPHABETICAL?l=t.key.localeCompare(i.key):e===K.NUMERIC?l=Number(i.key)-Number(t.key):l=i.count-t.count,n||l})}let de=class extends D{constructor(){super(...arguments),this.facetsPerPage=35,this.facetsLoading=!0,this.sortedBy=K.COUNT,this.unappliedFacetChanges=Xe(),this.pageNumber=1}willUpdate(e){(e.has("aggregations")||e.has("facetsPerPage")||e.has("sortedBy")||e.has("selectedFacets")||e.has("unappliedFacetChanges"))&&(this.facetGroup=this.mergedFacets)}updated(e){(e.has("facetKey")||e.has("query")||e.has("searchType")||e.has("filterMap"))&&(this.facetsLoading=!0,this.pageNumber=1,this.sortedBy=Qi[this.facetKey],this.updateSpecificFacets())}firstUpdated(){this.setupEscapeListeners()}setupEscapeListeners(){this.modalManager?document.addEventListener("keydown",e=>{var t;e.key==="Escape"&&((t=this.modalManager)===null||t===void 0||t.closeModal())}):document.removeEventListener("keydown",()=>{})}get isSearchResultsPage(){var e;const t=(e=this.pageSpecifierParams)===null||e===void 0?void 0:e.pageType;return t===void 0||t==="search_results"}async updateSpecificFacets(){var e,t,i,o,s,n;if(!this.facetKey)return;const l=(e=this.query)===null||e===void 0?void 0:e.trim();if(!l&&this.isSearchResultsPage)return;const d={simpleParams:[this.facetKey]},p=65535,f=ne(q({},this.pageSpecifierParams),{query:l||"",filters:this.filterMap,aggregations:d,aggregationsSize:p,rows:0}),m=await((t=this.searchService)===null||t===void 0?void 0:t.search(f,this.searchType));this.aggregations=(i=m==null?void 0:m.success)===null||i===void 0?void 0:i.response.aggregations,this.facetsLoading=!1;const y=(s=(o=m==null?void 0:m.success)===null||o===void 0?void 0:o.response)===null||s===void 0?void 0:s.collectionTitles;if(y)for(const[w,x]of Object.entries(y))(n=this.collectionTitles)===null||n===void 0||n.set(w,x)}pageNumberClicked(e){var t,i;const o=(t=e==null?void 0:e.detail)===null||t===void 0?void 0:t.page;o&&(this.pageNumber=Number(o)),(i=this.analyticsHandler)===null||i===void 0||i.sendEvent({category:Ne.default,action:te.moreFacetsPageChange,label:`${this.pageNumber}`})}get mergedFacets(){var e;if(!this.facetKey||!this.selectedFacets)return;const{selectedFacetGroup:t,aggregationFacetGroup:i}=this;if(!i)return;const o=q({},t!=null?t:i),s=(e=t==null?void 0:t.buckets.map(l=>{const d=i.buckets.find(p=>p.key===l.key);return d?ne(q({},l),{count:d.count}):l}))!==null&&e!==void 0?e:[];vn(s,this.sortedBy),i.buckets.forEach(l=>{t!=null&&t.buckets.find(p=>p.key===l.key)||s.push(l)});const n=this.unappliedFacetChanges[this.facetKey];for(const[l,d]of s.entries()){const p=n[d.key];p&&(s[l]=q({},p))}return o.buckets=s,o}get selectedFacetGroup(){if(!this.selectedFacets||!this.facetKey)return;const e=this.selectedFacets[this.facetKey];if(!e)return;const t=qi[this.facetKey],i=Object.entries(e).map(([o,s])=>({displayText:o,key:o,count:s==null?void 0:s.count,state:s==null?void 0:s.state}));return{title:t,key:this.facetKey,buckets:i}}get aggregationFacetGroup(){if(!this.aggregations||!this.facetKey)return;const e=this.aggregations[this.facetKey];if(!e)return;const t=qi[this.facetKey];let i=e.getSortedBuckets(this.sortedBy);this.facetKey==="collection"&&(i=i==null?void 0:i.filter(s=>{var n;const l=(n=s==null?void 0:s.key)===null||n===void 0?void 0:n.toString();return!ro[l]&&!(l!=null&&l.startsWith("fav-"))}));const o=i.map(s=>{const n=`${s.key}`;return{displayText:`${n}`,key:`${n}`,count:s.doc_count,state:"none"}});return{title:t,key:this.facetKey,buckets:o}}get facetGroupForCurrentPage(){const{facetGroup:e}=this;if(!e)return;const t=(this.pageNumber-1)*this.facetsPerPage,i=e.buckets.slice(t,t+this.facetsPerPage);return ne(q({},e),{buckets:i})}get moreFacetsTemplate(){return c` + {this.facetKey&&(this.unappliedFacetChanges=io(this.unappliedFacetChanges,this.facetKey,e.detail.bucket))}} + > + `}get loaderTemplate(){return c`
    + +
    `}get paginationSize(){var e;if(!this.aggregations||!this.facetKey)return 0;const t=(e=this.aggregations[this.facetKey])===null||e===void 0?void 0:e.buckets.length;return Math.ceil(t/this.facetsPerPage)}get facetsPaginationTemplate(){return this.paginationSize>1?c``:b}get footerTemplate(){return this.paginationSize>0?c`${this.facetsPaginationTemplate} + `:b}sortFacetAggregation(e){this.sortedBy=e,this.dispatchEvent(new CustomEvent("sortedFacets",{detail:this.sortedBy}))}get modalHeaderTemplate(){var e,t,i;const s=((e=this.sortedBy)!==null&&e!==void 0?e:Qi[this.facetKey])===K.COUNT?"left":"right";return c`${k("More facets for:")} + + ${(t=this.facetGroup)===null||t===void 0?void 0:t.title} + + + ${this.facetKey?c`{this.sortFacetAggregation(Number(n.detail))}} + >`:b} + `}render(){return c` + ${this.facetsLoading?this.loaderTemplate:c` +
    +
    ${this.modalHeaderTemplate}
    +
    ${this.moreFacetsTemplate}
    + ${this.footerTemplate} +
    + `} + `}applySearchFacetsClicked(){var e,t;const i=Vc(this.selectedFacets,this.unappliedFacetChanges),o=new CustomEvent("facetsChanged",{detail:i,bubbles:!0,composed:!0});this.dispatchEvent(o),this.unappliedFacetChanges=Xe(),(e=this.modalManager)===null||e===void 0||e.closeModal(),(t=this.analyticsHandler)===null||t===void 0||t.sendEvent({category:Ne.default,action:`${te.applyMoreFacetsModal}`,label:`${this.facetKey}`})}cancelClick(){var e,t;this.unappliedFacetChanges=Xe(),(e=this.modalManager)===null||e===void 0||e.closeModal(),(t=this.analyticsHandler)===null||t===void 0||t.sendEvent({category:Ne.default,action:te.closeMoreFacetsModal,label:`${this.facetKey}`})}static get styles(){const e=v`var(--primaryButtonBGColor, #194880)`;return[et,v` + section#more-facets { + overflow: auto; + padding: 10px; /* leaves room for scroll bar to appear without overlaying on content */ + --facetsColumnCount: 3; + } + .header-content .title { + display: block; + text-align: left; + font-size: 1.8rem; + padding: 0 10px; + font-weight: bold; + } + + .sort-label { + margin-left: 20px; + font-size: 1.3rem; + } + + .sort-toggle { + font-weight: normal; + } + + .facets-content { + font-size: 1.2rem; + max-height: 300px; + overflow: auto; + padding: 10px; + } + .facets-loader { + margin-bottom: 20px; + width: 70px; + display: block; + margin-left: auto; + margin-right: auto; + } + .btn { + border: none; + padding: 10px; + margin-bottom: 10px; + width: auto; + border-radius: 4px; + cursor: pointer; + } + .btn-cancel { + background-color: #2c2c2c; + color: white; + } + .btn-submit { + background-color: ${e}; + color: white; + } + .footer { + text-align: center; + margin-top: 10px; + } + + @media (max-width: 560px) { + section#more-facets { + max-height: 450px; + --facetsColumnCount: 1; + } + .facets-content { + overflow-y: auto; + height: 300px; + } + } + `]}};r([h({type:String})],de.prototype,"facetKey",void 0);r([h({type:String})],de.prototype,"query",void 0);r([h({type:Object})],de.prototype,"filterMap",void 0);r([h({type:String})],de.prototype,"searchType",void 0);r([h({type:Object})],de.prototype,"pageSpecifierParams",void 0);r([h({type:Object})],de.prototype,"collectionTitles",void 0);r([h({type:Number})],de.prototype,"facetsPerPage",void 0);r([h({type:Boolean})],de.prototype,"facetsLoading",void 0);r([h({type:Object})],de.prototype,"selectedFacets",void 0);r([h({type:String})],de.prototype,"sortedBy",void 0);r([h({type:Object})],de.prototype,"modalManager",void 0);r([h({type:Object})],de.prototype,"searchService",void 0);r([h({type:Object,attribute:!1})],de.prototype,"analyticsHandler",void 0);r([P()],de.prototype,"aggregations",void 0);r([P()],de.prototype,"facetGroup",void 0);r([P()],de.prototype,"unappliedFacetChanges",void 0);r([P()],de.prototype,"pageNumber",void 0);de=r([L("more-facets-content")],de);let xr=class extends D{render(){return c` +
    + +
    +
    +
    + `}static get styles(){return v` + #row { + display: grid; + grid-template-columns: 15px 1fr 36px; + grid-gap: 9px 6px; + align-items: center; + margin: 2.5px auto; + border: 1px solid transparent; + } + + .tombstone-line { + background: #ddd; + height: 6px; + border-radius: 50px; + } + + input[type='checkbox'] { + width: 15px; + height: 15px; + margin: 0; + } + `}};xr=r([L("facet-tombstone-row")],xr);let je=class extends D{constructor(){super(...arguments),this.boundEscapeListener=e=>{e.key==="Escape"&&this.closeModal()}}render(){var e,t;return c` +
    + + + +
    + `}connectedCallback(){var e;(e=super.connectedCallback)===null||e===void 0||e.call(this),this.setupEscapeListener()}disconnectedCallback(){var e;(e=super.disconnectedCallback)===null||e===void 0||e.call(this),this.removeEscapeListener()}setupEscapeListener(){document.addEventListener("keydown",this.boundEscapeListener)}removeEscapeListener(){document.removeEventListener("keydown",this.boundEscapeListener)}histogramDateRangeUpdated(e){this.minSelectedDate=e.detail.minDate,this.maxSelectedDate=e.detail.maxDate}applyBtnClicked(){var e;const t=new CustomEvent("histogramDateRangeApplied",{detail:{minDate:this.minSelectedDate,maxDate:this.maxSelectedDate}});this.dispatchEvent(t),this.closeModal(),(e=this.analyticsHandler)===null||e===void 0||e.sendEvent({category:Ne.default,action:te.histogramChangedFromModal,label:window.location.href})}closeModal(){this.modalManager&&(this.modalManager.closeModal(),this.dispatchEvent(new CustomEvent("modalClosed")))}static get styles(){return v` + #container { + display: flex; + justify-content: center; + padding: 40px 10px 10px; + overflow: hidden; + } + + #date-picker { + --histogramDateRangeInputWidth: 50px; + --histogramDateRangeInputRowMargin: 5px 0 0 0; + } + + #apply-btn { + margin: 0 0 0 5px; + padding: 8px 10px; + border: 0; + border-radius: 4px; + background: var(--primaryButtonBGColor, #194880); + color: white; + cursor: pointer; + } + `}};r([h({type:String})],je.prototype,"minDate",void 0);r([h({type:String})],je.prototype,"maxDate",void 0);r([h({type:String})],je.prototype,"minSelectedDate",void 0);r([h({type:String})],je.prototype,"maxSelectedDate",void 0);r([h({type:Array})],je.prototype,"buckets",void 0);r([h({type:Object,attribute:!1})],je.prototype,"modalManager",void 0);r([h({type:Object,attribute:!1})],je.prototype,"analyticsHandler",void 0);je=r([L("expanded-date-picker")],je);let H=class extends D{constructor(){super(...arguments),this.moreLinksVisible=!0,this.facetsLoading=!1,this.fullYearAggregationLoading=!1,this.collapsableFacets=!1,this.showHistogramDatePicker=!1,this.allowExpandingDatePicker=!1,this.parentCollections=[],this.collectionPagePath="/details/",this.isManageView=!1,this.openFacets={subject:!1,lending:!1,mediatype:!1,language:!1,creator:!1,collection:!1,year:!1},this.allowedFacetCount=6,this.handleExpandedDatePickerClosed=()=>{var e;(e=this.modalManager)===null||e===void 0||e.classList.remove("expanded-date-picker")},this.histogramDateRangeUpdated=e=>{const{minDate:t,maxDate:i}=e.detail,o=new CustomEvent("histogramDateRangeUpdated",{detail:{minDate:t,maxDate:i}});this.dispatchEvent(o)}}render(){const e=Ft({loading:this.facetsLoading,managing:this.isManageView}),t="date-picker-label";return c` +
    + ${this.showHistogramDatePicker&&(this.fullYearsHistogramAggregation||this.fullYearAggregationLoading)?c` +
    +

    + Year Published range filter + ${this.expandDatePickerBtnTemplate} +

    + ${this.histogramTemplate} +
    + `:b} + ${this.collectionPartOfTemplate} + ${this.mergedFacets.map(i=>this.getFacetGroupTemplate(i))} +
    + `}get collectionPartOfTemplate(){var e;if(!(!((e=this.parentCollections)===null||e===void 0)&&e.length))return b;const t="partof-heading";return c` +
    +
    +

    ${k("Part Of")}

    +
    + +
    + `}partOfCollectionClicked(e){var t;(t=this.analyticsHandler)===null||t===void 0||t.sendEvent({category:Ne.default,action:te.partOfCollectionClicked,label:e.target.dataset.id})}showDatePickerModal(){var e,t,i;const{fullYearsHistogramAggregation:o}=this,s=o==null?void 0:o.first_bucket_key,n=o==null?void 0:o.last_bucket_key,l=o==null?void 0:o.buckets,p=c` + {if(m&&m instanceof je){const y=m;y.minSelectedDate=this.minSelectedDate,y.maxSelectedDate=this.maxSelectedDate}})} + .minDate=${s} + .maxDate=${n} + .minSelectedDate=${this.minSelectedDate} + .maxSelectedDate=${this.maxSelectedDate} + .buckets=${l} + .modalManager=${this.modalManager} + .analyticsHandler=${this.analyticsHandler} + @histogramDateRangeApplied=${this.histogramDateRangeUpdated} + @modalClosed=${this.handleExpandedDatePickerClosed} + > + `,f=new Lt({bodyColor:"#fff",headerColor:"#194880",showHeaderLogo:!1,closeOnBackdropClick:!0,title:c`Select a date range`});(e=this.modalManager)===null||e===void 0||e.classList.add("expanded-date-picker"),(t=this.modalManager)===null||t===void 0||t.showModal({config:f,customModalContent:p,userClosedModalCallback:this.handleExpandedDatePickerClosed}),(i=this.analyticsHandler)===null||i===void 0||i.sendEvent({category:Ne.default,action:te.histogramExpanded,label:window.location.href})}updated(e){e.has("selectedFacets")&&this.dispatchFacetsChangedEvent()}dispatchFacetsChangedEvent(){const e=new CustomEvent("facetsChanged",{detail:this.selectedFacets});this.dispatchEvent(e)}get expandDatePickerBtnTemplate(){return this.allowExpandingDatePicker&&!this.facetsLoading?c``:b}get histogramTemplate(){var e,t;const{fullYearsHistogramAggregation:i}=this,o=i==null?void 0:i.first_bucket_key,s=i==null?void 0:i.last_bucket_key;return this.fullYearAggregationLoading?c`
    `:c` + + `}get mergedFacets(){const e=[];return wl.forEach(t=>{var i,o;const s=this.selectedFacetGroups.find(f=>f.key===t),n=this.aggregationFacetGroups.find(f=>f.key===t);if(s&&!n){e.push(s);return}if(!n)return;const l=s!=null?s:n;let d=(i=s==null?void 0:s.buckets.map(f=>{const m=n.buckets.find(y=>y.key===f.key);return m?ne(q({},f),{count:m.count}):f}))!==null&&i!==void 0?i:[];n.buckets.forEach(f=>{d.find(y=>y.key===f.key)||d.push(f)});let p=(o=Object.keys((s==null?void 0:s.buckets)||[]))===null||o===void 0?void 0:o.length;if(pxl[f.key])),vn(d),t==="mediatype"){const f=d.findIndex(m=>m.key==="collection");if(f>=p){const[m]=d.splice(f,1);p>this.allowedFacetCount&&(p+=1),d.splice(p-1,0,m)}}l.buckets=d.slice(0,p),e.push(l)}),e}get selectedFacetGroups(){return this.selectedFacets?Object.entries(this.selectedFacets).map(([t,i])=>{const o=t,s=qi[o],n=Object.entries(i).map(([l,d])=>{var p;let f=l;return o==="lending"&&(f=(p=Ds[l])!==null&&p!==void 0?p:l),{displayText:f,key:l,count:d.count,state:d.state}});return{title:s,key:o,buckets:n}}):[]}get aggregationFacetGroups(){var e;const t=[];return Object.entries((e=this.aggregations)!==null&&e!==void 0?e:[]).forEach(([i,o])=>{if(i==="year_histogram")return;const s=i,n=qi[s];if(!n)return;let l=o.getSortedBuckets(Qi[s]);s==="collection"&&(l=l==null?void 0:l.filter(f=>{var m;const y=(m=f==null?void 0:f.key)===null||m===void 0?void 0:m.toString();return!ro[y]&&!(y!=null&&y.startsWith("fav-"))}));const d=l.map(f=>{var m;const y=f.key;let w=`${f.key}`;return s==="lending"&&(w=(m=Ds[f.key])!==null&&m!==void 0?m:`${f.key}`),{displayText:w,key:`${y}`,count:f.doc_count,state:"none"}}),p={title:n,key:s,buckets:d};t.push(p)}),t}getFacetGroupTemplate(e){if(!this.facetsLoading&&e.buckets.length===0)return b;const{key:t}=e,i=this.openFacets[t],o=c` + ${da} + `,s=()=>{const l=q({},this.openFacets);l[t]=!i,this.openFacets=l},n=`facet-group-header-label-${e.key}`;return c` +
    +
    +

    + ${this.collapsableFacets?o:b} ${e.title} + filters +

    +
    +
    + ${this.facetsLoading?this.getTombstoneFacetGroupTemplate():c` + ${this.getFacetTemplate(e)} + ${this.searchMoreFacetsLink(e)} + `} +
    +
    + `}getTombstoneFacetGroupTemplate(){return c` + ${gt(Array(5).fill(null),()=>c``)} + `}searchMoreFacetsLink(e){if(!this.moreLinksVisible||e.key==="lending"||Object.keys(e.buckets).length{var i;this.showMoreFacetsModal(e,t),(i=this.analyticsHandler)===null||i===void 0||i.sendEvent({category:Ne.default,action:te.showMoreFacetsModal,label:e.key}),this.dispatchEvent(new CustomEvent("showMoreFacets",{detail:e.key}))}} + data-testid="more-link-btn" + > + More... + `}async showMoreFacetsModal(e,t){var i,o;const s=c` + {const d=new CustomEvent("facetsChanged",{detail:l.detail,bubbles:!0,composed:!0});this.dispatchEvent(d)}} + > + + `,n=new Lt({bodyColor:"#fff",headerColor:"#194880",showHeaderLogo:!1,closeOnBackdropClick:!0,title:c`Select filters`});(i=this.modalManager)===null||i===void 0||i.classList.add("more-search-facets"),(o=this.modalManager)===null||o===void 0||o.showModal({config:n,customModalContent:s,userClosedModalCallback:()=>{var l;(l=this.modalManager)===null||l===void 0||l.classList.remove("more-search-facets")}})}getFacetTemplate(e){return c` + {this.selectedFacets=io(this.selectedFacets,e.key,t.detail.bucket,!0);const i=new CustomEvent("facetsChanged",{detail:this.selectedFacets,bubbles:!0,composed:!0});this.dispatchEvent(i)}} + > + `}static get styles(){return[et,v` + a:link { + text-decoration: none; + color: var(--ia-theme-link-color, #4b64ff); + } + a:link:hover { + text-decoration: underline; + } + + #container.loading { + opacity: 0.5; + } + + #container.managing { + opacity: 0.3; + } + + .histogram-loading-indicator { + width: 100%; + height: 2.25rem; + margin-top: 1.75rem; + font-size: 1.4rem; + text-align: center; + } + + .collapser { + display: inline-block; + cursor: pointer; + width: 10px; + height: 10px; + } + + .collapser svg { + transition: transform 0.2s ease-in-out; + } + + .collapser.open svg { + transform: rotate(90deg); + } + + .facet-group:not(:last-child) { + margin-bottom: 2rem; + } + + .facet-group h3 { + margin-bottom: 0.7rem; + } + + .facet-group.mobile h3 { + cursor: pointer; + } + + .facet-group-header { + display: flex; + margin-bottom: 0.7rem; + justify-content: space-between; + border-bottom: 1px solid rgb(232, 232, 232); + } + + .facet-group-content { + transition: max-height 0.2s ease-in-out; + } + + .facet-group.mobile .facet-group-content { + max-height: 0; + overflow: hidden; + } + + .facet-group.mobile .facet-group-content.open { + max-height: 2000px; + } + + .partof-collections ul { + list-style-type: none; + padding: 0; + font-size: 1.2rem; + } + + h3 { + font-size: 1.4rem; + font-weight: 200 + padding-bottom: 3px; + margin: 0; + } + + .more-link { + font-size: 1.2rem; + text-decoration: none; + padding: 0; + background: inherit; + border: 0; + color: var(--ia-theme-link-color, #4b64ff); + cursor: pointer; + } + + #date-picker-label { + display: flex; + justify-content: space-between; + } + + .expand-date-picker-btn { + margin: 0; + padding: 0; + border: 0; + appearance: none; + background: none; + cursor: pointer; + } + + .expand-date-picker-btn > svg { + width: 14px; + height: 14px; + } + + .sorting-icon { + height: 15px; + cursor: pointer; + } + `]}};r([h({type:Object})],H.prototype,"searchService",void 0);r([h({type:String})],H.prototype,"searchType",void 0);r([h({type:Object})],H.prototype,"aggregations",void 0);r([h({type:Object})],H.prototype,"fullYearsHistogramAggregation",void 0);r([h({type:String})],H.prototype,"minSelectedDate",void 0);r([h({type:String})],H.prototype,"maxSelectedDate",void 0);r([h({type:Boolean})],H.prototype,"moreLinksVisible",void 0);r([h({type:Boolean})],H.prototype,"facetsLoading",void 0);r([h({type:Boolean})],H.prototype,"fullYearAggregationLoading",void 0);r([h({type:Object})],H.prototype,"selectedFacets",void 0);r([h({type:Boolean})],H.prototype,"collapsableFacets",void 0);r([h({type:Number})],H.prototype,"contentWidth",void 0);r([h({type:Boolean})],H.prototype,"showHistogramDatePicker",void 0);r([h({type:Boolean})],H.prototype,"allowExpandingDatePicker",void 0);r([h({type:String})],H.prototype,"query",void 0);r([h({type:Object})],H.prototype,"pageSpecifierParams",void 0);r([h({type:Array})],H.prototype,"parentCollections",void 0);r([h({type:Object})],H.prototype,"filterMap",void 0);r([h({type:String})],H.prototype,"baseNavigationUrl",void 0);r([h({type:String})],H.prototype,"collectionPagePath",void 0);r([h({type:Boolean})],H.prototype,"isManageView",void 0);r([h({type:Object,attribute:!1})],H.prototype,"modalManager",void 0);r([h({type:Object,attribute:!1})],H.prototype,"resizeObserver",void 0);r([h({type:Object,attribute:!1})],H.prototype,"featureFeedbackService",void 0);r([h({type:Object,attribute:!1})],H.prototype,"recaptchaManager",void 0);r([h({type:Object,attribute:!1})],H.prototype,"analyticsHandler",void 0);r([h({type:Object,attribute:!1})],H.prototype,"collectionTitles",void 0);r([P()],H.prototype,"openFacets",void 0);H=r([L("collection-facets")],H);let Sr=class extends D{render(){return c` +
    +
    +
    +
    +
    +
    + `}static get styles(){const e=v`var(--circularActivityIndicatorColor, dodgerblue)`,t=v`var(--circularActivityIndicatorThickness, 4px)`;return v` + :host { + display: block; + } + + .lds-ring { + display: inline-block; + position: relative; + width: 100%; + height: 100%; + } + .lds-ring div { + box-sizing: border-box; + display: block; + position: absolute; + width: 80%; + height: 80%; + margin: ${t}; + border-width: ${t}; + border-style: solid; + border-radius: 50%; + animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite; + border-color: ${e} transparent transparent transparent; + } + .lds-ring div:nth-child(1) { + animation-delay: -0.45s; + } + .lds-ring div:nth-child(2) { + animation-delay: -0.3s; + } + .lds-ring div:nth-child(3) { + animation-delay: -0.15s; + } + @keyframes lds-ring { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } + } + `}};Sr=r([L("circular-activity-indicator")],Sr);function Wc(a,e){return a===void 0?e!==void 0:e===void 0?a!==void 0:a.facetType===e.facetType&&a.bucketKey===e.bucketKey}function za(a,e){return a.label===e.label&&a.facets.length===e.facets.length&&a.facets.every((t,i)=>Wc(t,e.facets[i]))}function mn(a){if(!Array.isArray(a[0])){const i=a;let o=[...i];for(const s of i)o=o.filter(n=>s===n||!za(s,n));return o}const e=a,t=[];for(const i of e){const o=[];for(const s of i)t.find(l=>l.find(d=>za(s,d)))||o.push(s);o.length>0&&t.push(o)}return t}class Wa{async getRecommendedFacets(){const e=navigator.language,t=Wa.getLanguageDisplayName(e);return t?[{facets:[{facetType:"language",bucketKey:t}]}]:[]}static getLanguageDisplayName(e){const t=e.split("-")[0];return new Intl.DisplayNames(["en"],{type:"language"}).of(t)}}class co{async getRecommendedFacets(e){const t=[];for(const[i,o]of Object.entries(co.KEYWORDS))e.includes(i)&&t.push(...o);return t}}co.KEYWORDS={text:[{facets:[{facetType:"mediatype",bucketKey:"texts"}]}],book:[{facets:[{facetType:"mediatype",bucketKey:"texts"}]}],pdf:[{facets:[{facetType:"mediatype",bucketKey:"texts"}]}],epub:[{facets:[{facetType:"mediatype",bucketKey:"texts"}]}],audio:[{facets:[{facetType:"mediatype",bucketKey:"audio"}]}],song:[{facets:[{facetType:"mediatype",bucketKey:"audio"}]}],music:[{facets:[{facetType:"mediatype",bucketKey:"audio"}]}],listen:[{facets:[{facetType:"mediatype",bucketKey:"audio"}]}],podcast:[{facets:[{facetType:"mediatype",bucketKey:"audio"}]}],radio:[{facets:[{facetType:"mediatype",bucketKey:"audio"}]}],stream:[{facets:[{facetType:"mediatype",bucketKey:"audio"}]},{facets:[{facetType:"mediatype",bucketKey:"movies"}]}],video:[{facets:[{facetType:"mediatype",bucketKey:"movies"}]}],movie:[{facets:[{facetType:"mediatype",bucketKey:"movies"}]}],film:[{facets:[{facetType:"mediatype",bucketKey:"movies"}]}],image:[{facets:[{facetType:"mediatype",bucketKey:"image"}]}],photo:[{facets:[{facetType:"mediatype",bucketKey:"image"}]}],picture:[{facets:[{facetType:"mediatype",bucketKey:"image"}]}],software:[{facets:[{facetType:"mediatype",bucketKey:"software"}]}],app:[{facets:[{facetType:"mediatype",bucketKey:"software"}]}],program:[{facets:[{facetType:"mediatype",bucketKey:"software"}]}],game:[{facets:[{facetType:"mediatype",bucketKey:"software"}]}],etree:[{facets:[{facetType:"mediatype",bucketKey:"etree"}]}],concert:[{facets:[{facetType:"mediatype",bucketKey:"etree"}]}],"live music":[{facets:[{facetType:"mediatype",bucketKey:"etree"}]}],dataset:[{facets:[{facetType:"mediatype",bucketKey:"data"}]}]};class ho{async getRecommendedFacets(e){var t;const i=[];try{const o=encodeURIComponent(e),n=await(await fetch(`https://www.wikidata.org/w/api.php?action=wbsearchentities&search=${o}&format=json&language=en&uselang=en&origin=*&type=item&limit=5`)).json();for(const[l,d]of Object.entries(ho.ENTITIES))if(new RegExp(`\\b${l}\\b`).test((t=n.search[0])===null||t===void 0?void 0:t.description)){const f=n.search[0].label;i.push(...d.map(m=>{var y;return{label:(y=m.label)===null||y===void 0?void 0:y.replace("__QUERY",f),facets:m.facets.map(w=>{var x;const C=ne(q({},w),{bucketKey:w.bucketKey.replace("__QUERY",e)});return w.displayText&&(C.displayText=(x=C.displayText)===null||x===void 0?void 0:x.replace("__QUERY",f)),C})}}))}return i}catch{return[]}}}ho.ENTITIES={"written work":[{facets:[{facetType:"mediatype",bucketKey:"texts"}]}],literature:[{facets:[{facetType:"mediatype",bucketKey:"texts"}]}],book:[{facets:[{facetType:"mediatype",bucketKey:"texts"}]}],novel:[{facets:[{facetType:"mediatype",bucketKey:"texts"}]}],filmmaker:[{label:"Films by __QUERY",facets:[{facetType:"mediatype",bucketKey:"movies"},{facetType:"creator",bucketKey:"__QUERY"}]}],author:[{label:"Writing by __QUERY",facets:[{facetType:"mediatype",bucketKey:"texts"},{facetType:"creator",bucketKey:"__QUERY"}]}],writer:[{label:"Writing by __QUERY",facets:[{facetType:"mediatype",bucketKey:"texts"},{facetType:"creator",bucketKey:"__QUERY"}]}],poet:[{label:"Writing by __QUERY",facets:[{facetType:"mediatype",bucketKey:"texts"},{facetType:"creator",bucketKey:"__QUERY"}]}],photographer:[{label:"Images by __QUERY",facets:[{facetType:"mediatype",bucketKey:"image"},{facetType:"creator",bucketKey:"__QUERY"}]}],painter:[{label:"Images by __QUERY",facets:[{facetType:"mediatype",bucketKey:"image"},{facetType:"creator",bucketKey:"__QUERY"}]}],"visual artist":[{label:"Images by __QUERY",facets:[{facetType:"mediatype",bucketKey:"image"},{facetType:"creator",bucketKey:"__QUERY"}]}],"graphic artist":[{label:"Images by __QUERY",facets:[{facetType:"mediatype",bucketKey:"image"},{facetType:"creator",bucketKey:"__QUERY"}]}],singer:[{label:"Music by __QUERY",facets:[{facetType:"mediatype",bucketKey:"audio"},{facetType:"creator",bucketKey:"__QUERY"}]}],songwriter:[{label:"Music by __QUERY",facets:[{facetType:"mediatype",bucketKey:"audio"},{facetType:"creator",bucketKey:"__QUERY"}]}],musician:[{label:"Music by __QUERY",facets:[{facetType:"mediatype",bucketKey:"audio"},{facetType:"creator",bucketKey:"__QUERY"}]}],composer:[{label:"Music by __QUERY",facets:[{facetType:"mediatype",bucketKey:"audio"},{facetType:"creator",bucketKey:"__QUERY"}]}],pianist:[{label:"Music by __QUERY",facets:[{facetType:"mediatype",bucketKey:"audio"},{facetType:"creator",bucketKey:"__QUERY"}]}]};class po{async getRecommendedFacets(e){const t=po.HEURISTICS.map(i=>new i().getRecommendedFacets(e));return mn((await Promise.all(t)).flat())}}po.HEURISTICS=[co,ho,Wa];var jc=c` + + + +`;function qc(a){return a&&a.charAt(0).toLocaleUpperCase()+a.slice(1)}let _i=class extends D{constructor(){super(...arguments),this.selected=!1}render(){var e,t;if(!this.facetInfo)return b;const i=this.facetInfo.facets.length===1,o=this.facetInfo.facets[0],s=qc((this.labelPrefix?`${this.labelPrefix} `:"")+((t=(e=this.facetInfo.label)!==null&&e!==void 0?e:o.displayText)!==null&&t!==void 0?t:o.bucketKey));if(!s)return b;const n=i&&o.facetType==="mediatype"?Yr[o.bucketKey].icon:b;return c` + + ${n} ${s} + ${this.selected?c`×`:b} + + `}get href(){const e=new URL(window.location.href);if(this.facetInfo)for(const t of this.facetInfo.facets)e.searchParams.append("and[]",encodeURIComponent(`${t.facetType}:"${t.bucketKey}"`));return e.toString()}facetClicked(e){e.preventDefault(),this.facetInfo&&(this.selected=!this.selected,this.dispatchEvent(new CustomEvent("facetClick",{detail:{smartFacet:this.facetInfo,details:this.facetInfo.facets.map(t=>({facetType:t.facetType,bucket:{key:t.bucketKey,count:0,state:this.selected?"selected":"none"},negative:!1}))}})))}static get styles(){return v` + .smart-facet-button { + padding: 5px 10px; + border-radius: 15px; + background: #194880; + color: white; + font-size: 1.6rem; + font-family: inherit; + text-decoration: none; + box-shadow: 1px 1px rgba(0, 0, 0, 0.4); + } + + .smart-facet-button.selected { + background: #4c76aa; + } + + .smart-facet-button > svg { + width: 15px; + filter: invert(1); + vertical-align: text-top; + } + `}};r([h({type:Object})],_i.prototype,"facetInfo",void 0);r([h({type:String})],_i.prototype,"labelPrefix",void 0);r([h({type:Boolean})],_i.prototype,"selected",void 0);_i=r([L("smart-facet-button")],_i);let Vt=class extends D{render(){var e,t;if(!this.facetInfo||!this.activeFacetRef||this.facetInfo.length===0)return b;const i=(e=this.activeFacetRef.displayText)!==null&&e!==void 0?e:this.activeFacetRef.bucketKey;return i?c` + + `:b}get dropdownOptions(){var e,t;return(t=(e=this.facetInfo)===null||e===void 0?void 0:e.map(i=>{var o,s;const n=i.facets[0];return{id:n.bucketKey,label:(s=(o=i.label)!==null&&o!==void 0?o:n.displayText)!==null&&s!==void 0?s:n.bucketKey}}))!==null&&t!==void 0?t:[]}get activeDropdownOption(){if(!!this.activeFacetRef)return this.dropdownOptions.find(e=>{var t;return e.id===((t=this.activeFacetRef)===null||t===void 0?void 0:t.bucketKey)})}optionSelected(e){if(!this.facetInfo||!this.activeFacetRef)return;let t;for(const i of this.facetInfo){const o=i.facets.find(s=>s.bucketKey===e.detail.option.id);o&&(this.activeFacetRef=o,t=i)}!t||this.dispatchEvent(new CustomEvent("facetClick",{detail:{smartFacet:t,details:[{facetType:this.activeFacetRef.facetType,bucket:{key:this.activeFacetRef.bucketKey,count:0,state:"selected"},negative:!1}]}}))}onDropdownClick(){Ae("smart dropdown: onDropdownClick",this),this.dispatchEvent(new CustomEvent("dropdownClick",{detail:this}))}close(){this.dropdown&&(this.dropdown.open=!1)}static get styles(){return v` + .dropdown-container { + padding: 5px 8px; + border-radius: 5px; + background: #194880; + color: white; + font-size: 1.6rem; + font-family: inherit; + box-shadow: 1px 1px rgba(0, 0, 0, 0.4); + } + + .dropdown-label { + font-size: 1.6rem; + font-family: inherit; + } + + .dropdown { + --dropdownBorderWidth: 5px; + --dropdownBorderColor: transparent; + --caretWidth: 14px; + --caretHeight: 14px; + } + `}};r([h({type:Array})],Vt.prototype,"facetInfo",void 0);r([h({type:String})],Vt.prototype,"labelPrefix",void 0);r([h({type:Object})],Vt.prototype,"activeFacetRef",void 0);r([G("ia-dropdown")],Vt.prototype,"dropdown",void 0);Vt=r([L("smart-facet-dropdown")],Vt);const $r={collection:"Collection: ",creator:"By: ",subject:"About: "};function Qc(a){return a.charAt(0).toUpperCase()+a.slice(1)}let qe=class extends D{constructor(){super(...arguments),this.filterToggleActive=!1,this.heuristicRecs=[],this.smartFacets=[]}render(){return c` +
    + ${this.filtersToggleTemplate} + ${Ra(this.smartFacets,e=>`${e[0].label}|${e[0].facets[0].facetType}|${e[0].facets[0].bucketKey}`,e=>this.makeSmartFacet(e))} +
    + `}willUpdate(e){let t=!1;e.has("query")&&(Ae("query change",e.get("query"),this.query),this.lastAggregations=void 0,t=!0),e.has("aggregations")&&!this.lastAggregations&&this.aggregations&&Object.keys(this.aggregations).length>0&&(Ae("aggs change",e.get("aggregations"),this.aggregations),this.lastAggregations=this.aggregations,t=!0),t&&(Ae("should update smart facets, doing so..."),this.updateSmartFacets())}async updateSmartFacets(){Ae("updating smart facets"),this.query&&(this.heuristicRecs=await new po().getRecommendedFacets(this.query),Ae("heuristic recs are",this.heuristicRecs),this.smartFacets=mn(this.facetsToDisplay),Ae("smart facets are",this.smartFacets))}makeSmartFacet(e){return e.length===0?b:e.length===1?this.smartFacetButton(e[0]):this.smartFacetDropdown(e)}smartFacetButton(e){var t;return c` + + `}smartFacetDropdown(e){return c` + + `}get filtersToggleTemplate(){return c` + + `}get facetsToDisplay(){const e=[];if(this.heuristicRecs.length>0)for(const t of this.heuristicRecs)e.push([t]);if(this.lastAggregations){const t=["mediatype","year","language","creator","subject","collection"];for(const i of t){const o=this.lastAggregations[i];if(!o||o.buckets.length===0||["lending","year_histogram"].includes(i)||typeof o.buckets[0]=="number"||i==="mediatype"&&this.selectedFacets&&Object.values(this.selectedFacets.mediatype).some(d=>d.state!=="none"))continue;const s=i,l=o.buckets.filter(d=>{var p;const f=(p=this.selectedFacets)===null||p===void 0?void 0:p[s][d.key];return!(f&&f.state!=="none")});if(s==="mediatype")e.push([this.toSmartFacet(s,[l[0]])],[this.toSmartFacet(s,[l[1]])]);else if(s==="collection"||s==="subject"){const d=l.slice(0,5);e.push(d.map(p=>this.toSmartFacet(s,[p])))}else e.push([this.toSmartFacet(s,[l[0]])])}}return e}toSmartFacet(e,t){return{facets:t.map(i=>{var o;let s=Qc(i.key.toString());if(e==="collection"){const n=(o=this.collectionTitles)===null||o===void 0?void 0:o.get(i.key.toString());n&&(s=n)}return{facetType:e,bucketKey:i.key.toString(),displayText:s}})}}facetClicked(e){e.detail.smartFacet.selected||(this.smartFacets=[[ne(q({},e.detail.smartFacet),{selected:!0})],...this.smartFacets.filter(i=>i[0]!==e.detail.smartFacet)]);for(const i of e.detail.details)this.selectedFacets=io(this.selectedFacets,i.facetType,i.bucket,!0);const t=new CustomEvent("facetsChanged",{detail:this.selectedFacets});this.dispatchEvent(t)}facetDropdownClicked(e){if(this.smartFacets.find(i=>za(i[0],e.detail.smartFacet)))return;this.smartFacets=[[ne(q({},e.detail.smartFacet),{selected:!0})],...this.smartFacets];for(const i of e.detail.details)this.selectedFacets=io(this.selectedFacets,i.facetType,i.bucket,!0);const t=new CustomEvent("facetsChanged",{detail:this.selectedFacets});this.dispatchEvent(t)}onDropdownClick(e){var t;Ae("smart bar: onDropdownClick",e.detail),(t=this.shadowRoot)===null||t===void 0||t.querySelectorAll("smart-facet-dropdown").forEach(i=>{i!==e.detail&&(Ae("closing",i),i.close())})}filterToggleClicked(){this.dispatchEvent(new CustomEvent("filtersToggled"))}static get styles(){return v` + #smart-facets-container { + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 5px; + padding: 10px 0; + } + + #filters-toggle { + margin: 0; + border: 0; + padding: 5px 10px; + border-radius: 15px; + background: #194880; + color: white; + font-size: 1.6rem; + font-family: inherit; + text-decoration: none; + box-shadow: 1px 1px rgba(0, 0, 0, 0.4); + cursor: pointer; + } + + #filters-toggle.active { + background: #09294d; + box-shadow: -1px -1px rgba(0, 0, 0, 0.1); + } + + #filters-toggle > svg { + width: 15px; + filter: invert(1); + vertical-align: text-bottom; + } + `}};r([h({type:String})],qe.prototype,"query",void 0);r([h({type:Object})],qe.prototype,"aggregations",void 0);r([h({type:Object})],qe.prototype,"selectedFacets",void 0);r([h({type:Object})],qe.prototype,"collectionTitles",void 0);r([h({type:Boolean})],qe.prototype,"filterToggleActive",void 0);r([P()],qe.prototype,"heuristicRecs",void 0);r([P()],qe.prototype,"smartFacets",void 0);r([P()],qe.prototype,"lastAggregations",void 0);qe=r([L("smart-facet-bar")],qe);let T=class extends D{constructor(){super(),this.baseImageUrl="https://archive.org",this.searchType=le.METADATA,this.selectedSort=S.default,this.selectedTitleFilter=null,this.selectedCreatorFilter=null,this.sortDirection=null,this.defaultSortField=S.relevance,this.defaultSortDirection=null,this.pageSize=50,this.showSmartFacetBar=!1,this.showHistogramDatePicker=!1,this.suppressPlaceholders=!1,this.suppressResultCount=!1,this.suppressResultTiles=!1,this.suppressURLQuery=!1,this.suppressSortBar=!1,this.suppressDisplayModes=!1,this.facetLoadStrategy="eager",this.facetPaneVisible=!1,this.clearResultsOnEmptyQuery=!1,this.collectionPagePath="/details/",this.searchContext=Ne.default,this.pageContext="search",this.restorationStateHandler=new Tl({context:this.pageContext}),this.mobileBreakpoint=600,this.loggedIn=!1,this.modalManager=void 0,this.isManageView=!1,this.manageViewLabel="Select items to remove",this.enableSortOptionsSlot=!1,this.showSmartResults=!1,this.maxPagesToManage=15,this.dataSource=new Ml(this,this.pageSize),this.initialPageNumber=1,this.pagesToRender=this.initialPageNumber,this.searchResultsLoading=!1,this.facetsLoading=!1,this.mobileView=!1,this.collapsibleFacetsVisible=!1,this.placeholderType=null,this.layoutSizeAnalyticsSent=!1,this.isScrollingToCell=!1,this.isResizeToMobile=!1,this.dataSourceInstallInProgress=!1,this.placeholderCellTemplate=c``,this.updateLeftColumnHeight=()=>{var e,t,i,o,s;if(this.mobileView)(t=(e=this.leftColumn)===null||e===void 0?void 0:e.style)===null||t===void 0||t.removeProperty("height");else{const n=(i=this.leftColumn)===null||i===void 0?void 0:i.getBoundingClientRect().top;(s=(o=this.leftColumn)===null||o===void 0?void 0:o.style)===null||s===void 0||s.setProperty("height",`${window.innerHeight-(n!=null?n:0)-3}px`)}},this.updateFacetFadeOut=e=>{var t,i;const o=(t=this.shadowRoot)===null||t===void 0?void 0:t.getElementById("facets-bottom-fade");o==null||o.classList.toggle("hidden",(i=e==null?void 0:e[0])===null||i===void 0?void 0:i.isIntersecting)},this.initialQueryChangeHappened=!1,this.historyPopOccurred=!1,this.addController(this.dataSource)}tileModelAtCellIndex(e){const t=this.dataSource.getTileModelAt(e);if(!t&&!this.isScrollingToCell&&this.dataSource.queryInitialized){const i=Math.floor(e/this.pageSize)+1;this.dataSource.fetchPage(i)}return t}get estimatedTileCount(){return this.pagesToRender*this.pageSize}async getSessionId(){try{const e=sessionStorage==null?void 0:sessionStorage.getItem("cb-session");if(e)return e;if(this.sessionIdGenPromise)return this.sessionIdGenPromise;this.sessionIdGenPromise=qr(Math.random().toString());const t=await this.sessionIdGenPromise;return sessionStorage==null||sessionStorage.setItem("cb-session",t),t}catch{return""}}goToPage(e){return this.initialPageNumber=e,this.pagesToRender=e,this.scrollToPage(e)}setSearchResultsLoading(e){this.searchResultsLoading=e}setFacetsLoading(e){this.facetsLoading=e}setTotalResultCount(e){this.totalResults=e}clearFilters({facets:e=!0,dateRange:t=!0,letterFilters:i=!0,sort:o=!1}={}){e&&this.hasCheckedFacets&&(this.selectedFacets=Xe()),t&&(this.minSelectedDate=void 0,this.maxSelectedDate=void 0),i&&(this.selectedTitleFilter=null,this.selectedCreatorFilter=null),o&&(this.sortDirection=null,this.selectedSort=S.default)}get hasCheckedFacets(){if(!this.selectedFacets)return!1;for(const e of Object.values(this.selectedFacets))for(const t of Object.values(e))if(t.state!=="none")return!0;return!1}get hasActiveFilters(){return!!(this.hasCheckedFacets||this.minSelectedDate||this.maxSelectedDate||this.selectedTitleFilter||this.selectedCreatorFilter)}willUpdate(){this.setPlaceholderType()}render(){return c` + ${this.showSmartFacetBar?c` {this.facetPaneVisible=!this.facetPaneVisible}} + >`:b} + +
    + ${this.placeholderType?this.emptyPlaceholderTemplate:this.collectionBrowserTemplate} +
    + `}setPlaceholderType(){var e;const t=!!(!((e=this.baseQuery)===null||e===void 0)&&e.trim()),i=!!this.withinCollection,o=!!this.withinProfile,s=!this.searchResultsLoading&&(this.dataSource.size===0||!this.searchService);this.placeholderType=null,!this.suppressPlaceholders&&(!t&&!i&&!o?this.placeholderType="empty-query":s&&(this.placeholderType=!t&&i?"empty-collection":"no-results"),this.dataSource.queryErrorMessage&&(this.placeholderType=!t&&i?"collection-error":"query-error"))}get emptyPlaceholderTemplate(){var e;return c` + + `}get collectionBrowserTemplate(){return c` +
    + ${this.leftColumnTemplate} ${this.rightColumnTemplate} + `}get leftColumnTemplate(){return this.mobileView?this.mobileLeftColumnTemplate:this.desktopLeftColumnTemplate}get mobileLeftColumnTemplate(){return c` +
    + ${this.facetTopViewSlot} ${this.resultsCountTemplate} +
    ${this.mobileFacetsTemplate}
    +
    + `}get desktopLeftColumnTemplate(){return c` +
    + ${this.facetTopViewSlot} +
    +

    Filters

    + ${this.resultsCountTemplate} ${this.clearFiltersBtnTemplate(!1)} +
    +
    + ${this.facetsTemplate} +
    +
    +
    +
    + `}get facetTopViewSlot(){return c`
    + +
    `}get resultsCountTemplate(){var e;if(this.suppressResultCount)return b;const t=this.searchResultsLoading||this.totalResults===void 0,i=(e=this.totalResults)===null||e===void 0?void 0:e.toLocaleString(),o=this.totalResults===1?"Result":"Results";return c` +
    + + ${t?c`Searching…`:i} + + + ${t?b:o} + +
    + `}get rightColumnTemplate(){return c` +
    + ${this.showSmartResults?c``:b} +
    + ${this.showSmartResults?c`

    + ${k("All results")} +

    `:b} +
    + +
    + ${this.isManageView?this.manageBarTemplate:this.sortFilterBarTemplate} + + ${this.displayMode==="list-compact"&&this.totalResults?this.listHeaderTemplate:b} + ${this.suppressResultTiles?b:this.infiniteScrollerTemplate} +
    +
    + `}get infiniteScrollerTemplate(){return c`${this.displayMode==="grid"?c``:b} + `}get infiniteScrollerClasses(){var e;return Ft({[(e=this.displayMode)!==null&&e!==void 0?e:""]:!!this.displayMode,hidden:!!this.placeholderType})}get sortFilterBarTemplate(){var e;return this.suppressSortBar?b:c` + + + + + + `}get manageBarTemplate(){const e=this.profileElement==="uploads"?"Note: it may take a few minutes for these items to stop appearing in your uploads list.":b;return c` + this.dataSource.checkAllTiles()} + @unselectAll=${()=>this.dataSource.uncheckAllTiles()} + @cancel=${()=>{this.isManageView=!1,this.dataSource.uncheckAllTiles(),this.searchResultsLoading&&this.dataSource.resetPages()}} + > + `}handleRemoveItems(){this.dispatchEvent(new CustomEvent("itemRemovalRequested",{detail:{items:this.dataSource.checkedTileModels.map(e=>e!=null&&e.identifier?e.identifier:"")}}))}handleManageItems(){this.dispatchEvent(new CustomEvent("itemManagerRequested",{detail:{items:this.dataSource.checkedTileModels.map(e=>e!=null&&e.identifier?e.identifier:"")}}))}showRemoveItemsProcessingModal(){var e;(e=this.manageBar)===null||e===void 0||e.showRemoveItemsProcessingModal()}showRemoveItemsErrorModal(){var e;(e=this.manageBar)===null||e===void 0||e.showRemoveItemsErrorModal()}removeCheckedTiles(){this.dataSource.removeCheckedTiles()}userChangedSort(e){var t;const{selectedSort:i,sortDirection:o}=e.detail;this.selectedSort=i,this.sortDirection=o,((t=this.currentPage)!==null&&t!==void 0?t:1)>1&&this.goToPage(1),this.currentPage=1}sendSortByAnalytics(e){var t;const i=e&&!this.sortDirection;(t=this.analyticsHandler)===null||t===void 0||t.sendEvent({category:this.searchContext,action:te.sortBy,label:`${this.selectedSort}${this.sortDirection||i?`-${this.sortDirection}`:""}`})}selectedSortChanged(){this.dataSource.updatePrefixFiltersForCurrentSort()}get sortParam(){var e;const t=we[this.selectedSort];if(!(t!=null&&t.handledBySearchService))return null;const i=new URL(window.location.href).searchParams.get("sort"),o=(e=t.searchServiceKey)!==null&&e!==void 0?e:i==null?void 0:i.replace(/^-/,"");return this.sortDirection||(this.sortDirection="asc"),o?{field:o,direction:this.sortDirection}:null}get defaultSortParam(){var e;const t=(e=this.defaultSortDirection)!==null&&e!==void 0?e:"asc",i=we[this.defaultSortField].searchServiceKey;return i?{field:i,direction:t}:null}displayModeChanged(e){var t;this.displayMode=e.detail.displayMode,this.displayMode&&((t=this.analyticsHandler)===null||t===void 0||t.sendEvent({category:this.searchContext,action:te.displayMode,label:this.displayMode}))}get titleQuery(){return this.selectedTitleFilter?`firstTitle:${this.selectedTitleFilter}`:void 0}get creatorQuery(){return this.selectedCreatorFilter?`firstCreator:${this.selectedCreatorFilter}`:void 0}sendFilterByTitleAnalytics(e){var t;if(!e&&!this.selectedTitleFilter)return;const i=e&&!this.selectedTitleFilter;(t=this.analyticsHandler)===null||t===void 0||t.sendEvent({category:this.searchContext,action:te.filterByTitle,label:i?`clear-${e}`:`${e||"start"}-${this.selectedTitleFilter}`})}sendFilterByCreatorAnalytics(e){var t;if(!e&&!this.selectedCreatorFilter)return;const i=e&&!this.selectedCreatorFilter;(t=this.analyticsHandler)===null||t===void 0||t.sendEvent({category:this.searchContext,action:te.filterByCreator,label:i?`clear-${e}`:`${e||"start"}-${this.selectedCreatorFilter}`})}titleLetterSelected(e){this.selectedCreatorFilter=null,this.selectedTitleFilter=e.detail.selectedLetter}creatorLetterSelected(e){this.selectedTitleFilter=null,this.selectedCreatorFilter=e.detail.selectedLetter}get mobileFacetsTemplate(){return la.includes(this.profileElement)?b:c` +
    {var i;const o=t.target;this.isResizeToMobile=!1,this.collapsibleFacetsVisible=o.open,(i=this.analyticsHandler)===null||i===void 0||i.sendEvent({category:this.searchContext,action:te.mobileFacetsToggled,label:o.open?"open":"closed"})}}> + + ${da} +

    ${k("Filters")}

    + ${this.clearFiltersBtnTemplate(!0)} +
    + ${this.facetsTemplate} +
    + `}get facetsTemplate(){if(la.includes(this.profileElement))return b;if(this.facetLoadStrategy==="off")return c` +

    + ${k("Facets are temporarily unavailable.")} +

    + `;const e=c` + + + `;return(this.facetLoadStrategy==="opt-in"||this.facetLoadStrategy==="opt-in-or-login"&&!this.loggedIn)&&!this.mobileView?c` +
    {const o=i.target;this.collapsibleFacetsVisible=o.open}} + > + + ${da} +

    ${k("Filters")}

    +
    + ${e} + + `:e}clearFiltersBtnTemplate(e){if(!this.hasActiveFilters)return b;const t=Ft({"clear-filters-btn":!0,mobile:e}),i=e?"Clear all":"Clear all filters";return c` +
    + ${e?c` `:b} + +
    + `}get listHeaderTemplate(){return c` +
    + + +
    + `}histogramDateRangeUpdated(e){var t;const{minDate:i,maxDate:o}=e.detail;[this.minSelectedDate,this.maxSelectedDate]=[i,o],(t=this.analyticsHandler)===null||t===void 0||t.sendEvent({category:this.searchContext,action:te.histogramChanged,label:this.dateRangeQueryClause})}get dateRangeQueryClause(){if(!(!this.minSelectedDate||!this.maxSelectedDate))return`year:[${this.minSelectedDate} TO ${this.maxSelectedDate}]`}emitManageModeChangedEvent(){this.dispatchEvent(new CustomEvent("manageModeChanged",{detail:this.isManageView}))}async installDataSourceAndQueryState(e,t){var i,o;Ae("Installing data source & query state in CB:",e,t),this.dataSource&&this.removeController(this.dataSource),this.dataSource=e,this.addController(this.dataSource),this.baseQuery=t.baseQuery,this.profileElement=t.profileElement,this.searchType=t.searchType,this.selectedFacets=(i=t.selectedFacets)!==null&&i!==void 0?i:Xe(),this.minSelectedDate=t.minSelectedDate,this.maxSelectedDate=t.maxSelectedDate,this.selectedSort=(o=t.selectedSort)!==null&&o!==void 0?o:S.default,this.sortDirection=t.sortDirection,this.selectedTitleFilter=t.selectedTitleFilter,this.selectedCreatorFilter=t.selectedCreatorFilter,this.dataSourceInstallInProgress=!0,this.requestUpdate(),await this.updateComplete,this.dataSourceInstallInProgress=!1,this.searchResultsLoading||(this.setTotalResultCount(this.dataSource.totalResults),this.setTileCount(this.dataSource.size)),this.refreshVisibleResults()}firstUpdated(){this.restoreState(),this.setInitialSize()}setInitialSize(){this.contentWidth=this.contentContainer.getBoundingClientRect().width,this.mobileView=this.contentWidth>0&&this.contentWidth0&&this.contentWidthi/100)}),this.leftColIntersectionObserver.observe(t)),window.addEventListener("resize",this.updateLeftColumnHeight)}setupFacetsScrollListeners(){var e;const t=(e=this.shadowRoot)===null||e===void 0?void 0:e.querySelector("#facets-scroll-sentinel");t&&(this.facetsIntersectionObserver=new IntersectionObserver(this.updateFacetFadeOut),this.facetsIntersectionObserver.observe(t))}emitBaseQueryChanged(){this.dispatchEvent(new CustomEvent("baseQueryChanged",{detail:{baseQuery:this.baseQuery}}))}emitSearchTypeChanged(){this.dispatchEvent(new CustomEvent("searchTypeChanged",{detail:this.searchType}))}emitQueryStateChanged(){this.dispatchEvent(new CustomEvent("queryStateChanged",{detail:{baseQuery:this.baseQuery,withinCollection:this.withinCollection,withinProfile:this.withinProfile,profileElement:this.profileElement,searchType:this.searchType,selectedFacets:this.selectedFacets,minSelectedDate:this.minSelectedDate,maxSelectedDate:this.maxSelectedDate,selectedSort:this.selectedSort,sortDirection:this.sortDirection,selectedTitleFilter:this.selectedTitleFilter,selectedCreatorFilter:this.selectedCreatorFilter}}))}emitEmptyResults(){this.dispatchEvent(new Event("emptyResults"))}disconnectResizeObserver(e){e.removeObserver({target:this.contentContainer,handler:this})}setupResizeObserver(){!this.resizeObserver||!this.contentContainer||this.resizeObserver.addObserver({target:this.contentContainer,handler:this})}visibleCellsChanged(e){if(this.isScrollingToCell)return;const{visibleCellIndices:t}=e.detail;if(t.length===0)return;const i=Math.min(this.pageSize,t.length)-1,o=t[i],s=Math.floor(o/this.pageSize)+1;this.currentPage!==s&&(this.currentPage=s);const n=new CustomEvent("visiblePageChanged",{detail:{pageNumber:s}});this.dispatchEvent(n)}get initialSearchComplete(){return this.dataSource.initialSearchComplete}async handleQueryChange(){var e;!this.searchService||this.dataSource.pageFetchQueryKey===this.previousQueryKey||this.baseQuery&&!this.dataSource.canPerformSearch||(this.previousQueryKey=this.dataSource.pageFetchQueryKey,this.totalResults=void 0,this.pagesToRender=this.initialPageNumber===1?2:this.initialPageNumber,this.infiniteScroller&&(this.infiniteScroller.itemCount=this.estimatedTileCount,this.infiniteScroller.reload()),this.withinCollection&&((e=this.baseQuery)===null||e===void 0?void 0:e.trim())&&(this.defaultSortField=S.relevance,this.defaultSortDirection=null),!this.initialQueryChangeHappened&&this.initialPageNumber>1&&this.scrollToPage(this.initialPageNumber),this.initialQueryChangeHappened=!0,this.historyPopOccurred||this.persistState(),this.historyPopOccurred=!1)}setupStateRestorationObserver(){this.boundNavigationHandler||(this.boundNavigationHandler=this.historyNavigationHandler.bind(this)),window.addEventListener("popstate",this.boundNavigationHandler)}historyNavigationHandler(){this.historyPopOccurred=!0,this.restoreState()}restoreState(){var e,t,i,o,s;const n=this.restorationStateHandler.getRestorationState();this.displayMode=n.displayMode,n.searchType!=null&&(this.searchType=n.searchType),this.selectedSort=(e=n.selectedSort)!==null&&e!==void 0?e:S.default,this.sortDirection=(t=n.sortDirection)!==null&&t!==void 0?t:null,this.selectedTitleFilter=(i=n.selectedTitleFilter)!==null&&i!==void 0?i:null,this.selectedCreatorFilter=(o=n.selectedCreatorFilter)!==null&&o!==void 0?o:null,this.selectedFacets=n.selectedFacets,this.suppressURLQuery||(this.baseQuery=n.baseQuery),this.currentPage=(s=n.currentPage)!==null&&s!==void 0?s:1,this.minSelectedDate=n.minSelectedDate,this.maxSelectedDate=n.maxSelectedDate,this.currentPage>1&&this.goToPage(this.currentPage)}persistState(){var e,t,i,o;const s={displayMode:this.displayMode,searchType:this.searchType,selectedSort:this.selectedSort,sortDirection:(e=this.sortDirection)!==null&&e!==void 0?e:void 0,selectedFacets:(t=this.selectedFacets)!==null&&t!==void 0?t:Xe(),baseQuery:this.suppressURLQuery?void 0:this.baseQuery,currentPage:this.currentPage,titleQuery:this.titleQuery,creatorQuery:this.creatorQuery,minSelectedDate:this.minSelectedDate,maxSelectedDate:this.maxSelectedDate,selectedTitleFilter:(i=this.selectedTitleFilter)!==null&&i!==void 0?i:void 0,selectedCreatorFilter:(o=this.selectedCreatorFilter)!==null&&o!==void 0?o:void 0};this.restorationStateHandler.persistState(s,this.dataSourceInstallInProgress)}emitSearchResultsLoadingChanged(){this.dispatchEvent(new CustomEvent("searchResultsLoadingChanged",{detail:{loading:this.searchResultsLoading}}))}facetsChanged(e){this.selectedFacets=e.detail}facetClickHandler({detail:{facetType:e,bucket:t,negative:i}}){var o;let s;i?s=t.state!=="none"?te.facetNegativeSelected:te.facetNegativeDeselected:s=t.state!=="none"?te.facetSelected:te.facetDeselected,(o=this.analyticsHandler)===null||o===void 0||o.sendEvent({category:this.searchContext,action:s,label:e})}scrollToPage(e){return new Promise(t=>{const i=this.pageSize*(e-1);setTimeout(()=>{var o;this.isScrollingToCell=!0,(o=this.infiniteScroller)===null||o===void 0||o.scrollToCell(i,!0),setTimeout(()=>{var s;this.isScrollingToCell=!1,(s=this.infiniteScroller)===null||s===void 0||s.refreshAllVisibleCells(),t()},500)},0)})}get isRelevanceSortAvailable(){var e;return!!(!((e=this.baseQuery)===null||e===void 0)&&e.trim())}setTileCount(e){this.infiniteScroller&&(this.infiniteScroller.itemCount=e)}applyDefaultCollectionSort(e){var t,i,o;if(this.baseQuery){this.defaultSortField=S.relevance,this.defaultSortDirection=null;return}const s=!((i=(t=e==null?void 0:e.public_metadata)===null||t===void 0?void 0:t.identifier)===null||i===void 0)&&i.startsWith("fav-")?"-favoritedate":"-week",n=(o=e==null?void 0:e.public_metadata)===null||o===void 0?void 0:o["sort-by"],l=n!=null?n:s;let[d,p]=l.split(":");d.startsWith("-")?(d=d.slice(1),p="desc"):["asc","desc"].includes(p)||(p="asc");const m=Hr(d).field;m&&m!==S.default&&(this.defaultSortField=m,this.defaultSortDirection=p)}applyDefaultProfileSort(){if(this.profileElement){const e=bl[this.profileElement];this.defaultSortField=e!=null?e:S.weeklyview}else this.defaultSortField=S.weeklyview;this.defaultSortDirection="desc"}get currentVisiblePageNumbers(){var e,t;const i=(t=(e=this.infiniteScroller)===null||e===void 0?void 0:e.getVisibleCellIndices())!==null&&t!==void 0?t:[],o=new Set;return i.forEach(s=>{const n=Math.floor(s/this.pageSize)+1;o.add(n)}),Array.from(o)}refreshVisibleResults(){var e;(e=this.infiniteScroller)===null||e===void 0||e.refreshAllVisibleCells()}resultSelected(e){var t,i,o;if(this.isManageView){const s=this.dataSource.indexOf(e.detail);s>=0&&((t=this.infiniteScroller)===null||t===void 0||t.refreshCell(s)),this.requestUpdate()}(i=this.analyticsHandler)===null||i===void 0||i.sendEvent({category:this.searchContext,action:te.resultSelected,label:e.detail.mediatype}),(o=this.analyticsHandler)===null||o===void 0||o.sendEvent({category:this.searchContext,action:te.resultSelected,label:`page-${this.currentPage}`})}cellForIndex(e){const t=this.tileModelAtCellIndex(e);if(!!t)return c` + this.resultSelected(i)} + > + + `}scrollThresholdReached(){!this.dataSource.endOfDataReached&&this.dataSource.queryInitialized&&(this.pagesToRender+=1,this.dataSource.fetchPage(this.pagesToRender))}fetchManagableSearchResults(){var e;this.pageContext==="search"&&this.dataSource.totalResults>100&&!this.searchResultsLoading&&(this.dataSource.resetPages(),this.dataSource.fetchPage(1,this.maxPagesToManage),(e=this.infiniteScroller)===null||e===void 0||e.reload())}static get styles(){return[et,v` + :host { + display: block; + --leftColumnWidth: 18rem; + --leftColumnPaddingRight: 2.5rem; + } + + #facet-top-view { + display: flex; + } + + /** + * When page width resizes from desktop to mobile, use this class to + * disable expand/collapse transition when loading. + */ + .preload * { + transition: none !important; + -webkit-transition: none !important; + -moz-transition: none !important; + -ms-transition: none !important; + -o-transition: none !important; + } + + #content-container { + display: flex; + } + + empty-placeholder { + margin-top: var(--placeholderMarginTop, 0); + } + + .collapser-icon { + display: inline-block; + } + + .collapser-icon svg { + display: inline-block; + width: 12px; + height: 12px; + transition: transform 0.2s ease-out; + } + + #mobile-filter-collapse { + width: 100%; + } + + #mobile-filter-collapse > summary { + cursor: pointer; + list-style: none; + } + + #mobile-filter-collapse[open] > summary { + margin-bottom: 10px; + } + + #mobile-filter-collapse h2 { + display: inline-block; + margin: 0; + font-size: 2rem; + } + + #mobile-filter-collapse[open] svg { + transform: rotate(90deg); + } + + #content-container.mobile { + display: block; + } + + .column { + padding-top: 2rem; + } + + #right-column { + flex: 1; + position: relative; + min-height: 90vh; + border-left: 1px solid rgb(232, 232, 232); + border-right: 1px solid rgb(232, 232, 232); + margin-top: var(--rightColumnMarginTop, 0); + background: #fff; + } + + #right-column.smart-results-spacing { + padding-top: 0.5rem; + border-right: none; + background: transparent; + min-width: 0; + } + + #results { + background: #fff; + padding-left: 1rem; + padding-right: 1rem; + } + + #right-column.smart-results-spacing #results { + border-radius: 10px 10px 0px 0px; + padding-top: 0.5rem; + margin-top: 1rem; + } + + .mobile #right-column { + border-left: none; + } + + .mobile #results { + padding: 5px 5px 0; + } + + #left-column { + width: var(--leftColumnWidth, 18rem); + /* Prevents Safari from shrinking col at first draw */ + min-width: var(--leftColumnWidth, 18rem); + /* Reduced padding by 0.2rem to add the invisible border in the rule below */ + padding-right: calc(var(--leftColumnPaddingRight, 2.5rem) - 0.2rem); + border-right: 0.2rem solid transparent; /* Pads to the right of the scrollbar a bit */ + z-index: 1; + } + + .desktop #left-column { + top: 0; + position: sticky; + height: calc(100vh - 2rem); + max-height: calc(100vh - 2rem); + overflow-x: hidden; + overflow-y: scroll; + + /* + * Firefox doesn't support any of the -webkit-scrollbar stuff below, but + * does at least give us a tiny bit of control over width & color. + */ + scrollbar-width: thin; + scrollbar-color: transparent transparent; + } + .desktop #left-column:hover { + scrollbar-color: auto; + } + .desktop #left-column::-webkit-scrollbar { + appearance: none; + width: 6px; + } + .desktop #left-column::-webkit-scrollbar-button { + height: 3px; + background: transparent; + } + .desktop #left-column::-webkit-scrollbar-corner { + background: transparent; + } + .desktop #left-column::-webkit-scrollbar-thumb { + border-radius: 4px; + } + .desktop #left-column:hover::-webkit-scrollbar-thumb { + background: rgba(0, 0, 0, 0.15); + } + .desktop #left-column:hover::-webkit-scrollbar-thumb:hover { + background: rgba(0, 0, 0, 0.2); + } + .desktop #left-column:hover::-webkit-scrollbar-thumb:active { + background: rgba(0, 0, 0, 0.3); + } + + #facets-bottom-fade { + background: linear-gradient( + to bottom, + #f5f5f700 0%, + #f5f5f7c0 50%, + #f5f5f7 80%, + #f5f5f7 100% + ); + position: fixed; + bottom: 0; + height: 50px; + /* Wide enough to cover the content, but leave the scrollbar uncovered */ + width: calc( + var(--leftColumnWidth) + var(--leftColumnPaddingRight) - 10px + ); + z-index: 2; + pointer-events: none; + transition: height 0.1s ease; + } + #facets-bottom-fade.hidden { + height: 0; + } + + .facets-message { + font-size: 1.4rem; + } + + .desktop-facets-dropdown > summary { + cursor: pointer; + list-style: none; + } + + .desktop-facets-dropdown h2 { + display: inline-block; + margin: 0; + font-size: 1.6rem; + } + + .desktop-facets-dropdown[open] > summary { + margin-bottom: 10px; + } + + .desktop-facets-dropdown[open] svg { + transform: rotate(90deg); + } + + .desktop #left-column-scroll-sentinel { + width: 1px; + height: 100vh; + background: transparent; + } + + .desktop #facets-scroll-sentinel { + width: 1px; + height: 1px; + background: transparent; + } + + #facets-header-container { + display: flex; + justify-content: space-between; + align-items: flex-start; + clear: both; + } + + .desktop #facets-header-container { + flex-wrap: wrap; + } + + .mobile #left-column { + width: 100%; + min-width: 0; + padding: 0; + border: 0; + } + + .clear-filters-btn-row { + display: inline-block; + } + + .desktop .clear-filters-btn-row { + width: 100%; + } + + .clear-filters-btn { + display: inline-block; + appearance: none; + margin: 0; + padding: 0; + border: 0; + background: none; + color: var(--ia-theme-link-color); + font-size: 1.4rem; + font-family: inherit; + cursor: pointer; + } + + .clear-filters-btn:hover { + text-decoration: underline; + } + + .clear-filters-btn-separator { + display: inline-block; + margin-left: 5px; + border-left: 1px solid #2c2c2c; + font-size: 1.4rem; + line-height: 1.3rem; + } + + #facets-container { + position: relative; + max-height: 0; + transition: max-height 0.2s ease-in-out; + z-index: 1; + margin-top: 5rem; + padding-bottom: 2rem; + } + + .desktop #facets-container { + width: 18rem; + } + + .mobile #facets-container { + overflow: hidden; + padding-bottom: 0; + padding-left: 10px; + padding-right: 10px; + } + + #facets-container.expanded { + max-height: 2000px; + } + + .results-section-heading { + margin: 0.5rem 0.3rem; + font-size: 2rem; + line-height: 25px; + } + + #results-total { + display: flex; + align-items: baseline; + } + + .mobile #results-total { + float: right; + margin-bottom: 0; + margin-right: 5px; + } + + #big-results-count { + font-size: 2.4rem; + font-weight: 500; + margin-right: 5px; + } + + .mobile #big-results-count { + font-size: 2rem; + } + + #big-results-label { + font-size: 1.4rem; + font-weight: 200; + } + + #list-header { + max-height: 4.2rem; + } + + .loading-cover { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + display: flex; + justify-content: center; + z-index: 1; + padding-top: 50px; + } + + circular-activity-indicator { + width: 30px; + height: 30px; + } + + sort-filter-bar { + display: block; + margin-bottom: 4rem; + } + + infinite-scroller { + display: block; + --infiniteScrollerRowGap: var(--collectionBrowserRowGap, 1.7rem); + --infiniteScrollerColGap: var(--collectionBrowserColGap, 1.7rem); + } + + infinite-scroller.list-compact { + --infiniteScrollerCellMinWidth: var( + --collectionBrowserCellMinWidth, + 100% + ); + --infiniteScrollerCellMinHeight: 45px; /* override infinite scroller component */ + --infiniteScrollerCellMaxHeight: 56px; + --infiniteScrollerRowGap: 10px; + } + + infinite-scroller.list-detail { + --infiniteScrollerCellMinWidth: var( + --collectionBrowserCellMinWidth, + 100% + ); + --infiniteScrollerCellMinHeight: var( + --collectionBrowserCellMinHeight, + 5rem + ); + /* + 30px in spec, compensating for a -4px margin + to align title with top of item image + src/tiles/list/tile-list.ts + */ + --infiniteScrollerRowGap: 34px; + } + + .mobile infinite-scroller.list-detail { + --infiniteScrollerRowGap: 24px; + } + + infinite-scroller.grid { + --infiniteScrollerCellMinWidth: var( + --collectionBrowserCellMinWidth, + 17rem + ); + --infiniteScrollerCellMaxWidth: var( + --collectionBrowserCellMaxWidth, + 1fr + ); + } + + /* Allow tiles to shrink a bit further at smaller viewport widths */ + @media screen and (max-width: 880px) { + infinite-scroller.grid { + --infiniteScrollerCellMinWidth: var( + --collectionBrowserCellMinWidth, + 15rem + ); + } + } + /* At very small widths, maintain a 2-tile layout as far as it can reasonably go */ + @media screen and (max-width: 360px) { + infinite-scroller.grid { + --infiniteScrollerCellMinWidth: var( + --collectionBrowserCellMinWidth, + 12rem + ); + } + } + + infinite-scroller.hidden { + display: none; + } + `]}};r([h({type:String})],T.prototype,"baseNavigationUrl",void 0);r([h({type:String})],T.prototype,"baseImageUrl",void 0);r([h({type:Object})],T.prototype,"searchService",void 0);r([h({type:Number})],T.prototype,"searchType",void 0);r([h({type:String})],T.prototype,"withinCollection",void 0);r([h({type:String})],T.prototype,"withinProfile",void 0);r([h({type:String})],T.prototype,"profileElement",void 0);r([h({type:String})],T.prototype,"baseQuery",void 0);r([h({type:String})],T.prototype,"displayMode",void 0);r([h({type:String})],T.prototype,"selectedSort",void 0);r([h({type:String})],T.prototype,"selectedTitleFilter",void 0);r([h({type:String})],T.prototype,"selectedCreatorFilter",void 0);r([h({type:String})],T.prototype,"sortDirection",void 0);r([h({type:String})],T.prototype,"defaultSortField",void 0);r([h({type:String})],T.prototype,"defaultSortDirection",void 0);r([h({type:Number})],T.prototype,"pageSize",void 0);r([h({type:Number})],T.prototype,"currentPage",void 0);r([h({type:String})],T.prototype,"minSelectedDate",void 0);r([h({type:String})],T.prototype,"maxSelectedDate",void 0);r([h({type:Object})],T.prototype,"selectedFacets",void 0);r([h({type:Boolean})],T.prototype,"showSmartFacetBar",void 0);r([h({type:Boolean})],T.prototype,"showHistogramDatePicker",void 0);r([h({type:Boolean})],T.prototype,"suppressPlaceholders",void 0);r([h({type:Boolean})],T.prototype,"suppressResultCount",void 0);r([h({type:Boolean})],T.prototype,"suppressResultTiles",void 0);r([h({type:Boolean})],T.prototype,"suppressURLQuery",void 0);r([h({type:Boolean})],T.prototype,"suppressSortBar",void 0);r([h({type:Boolean})],T.prototype,"suppressDisplayModes",void 0);r([h({type:String})],T.prototype,"facetLoadStrategy",void 0);r([h({type:Boolean})],T.prototype,"facetPaneVisible",void 0);r([h({type:Boolean})],T.prototype,"clearResultsOnEmptyQuery",void 0);r([h({type:String})],T.prototype,"collectionPagePath",void 0);r([h({type:String,reflect:!0})],T.prototype,"searchContext",void 0);r([h({type:String})],T.prototype,"pageContext",void 0);r([h({type:Object})],T.prototype,"restorationStateHandler",void 0);r([h({type:Number})],T.prototype,"mobileBreakpoint",void 0);r([h({type:Boolean})],T.prototype,"loggedIn",void 0);r([h({type:Object})],T.prototype,"resizeObserver",void 0);r([h({type:Object})],T.prototype,"modalManager",void 0);r([h({type:Object})],T.prototype,"featureFeedbackService",void 0);r([h({type:Object})],T.prototype,"recaptchaManager",void 0);r([h({type:Boolean})],T.prototype,"isManageView",void 0);r([h({type:String})],T.prototype,"manageViewLabel",void 0);r([h({type:Boolean})],T.prototype,"enableSortOptionsSlot",void 0);r([h({type:Boolean,reflect:!0})],T.prototype,"showSmartResults",void 0);r([h({type:Number})],T.prototype,"maxPagesToManage",void 0);r([h({type:Object})],T.prototype,"dataSource",void 0);r([P()],T.prototype,"pagesToRender",void 0);r([P()],T.prototype,"searchResultsLoading",void 0);r([P()],T.prototype,"facetsLoading",void 0);r([P()],T.prototype,"totalResults",void 0);r([P()],T.prototype,"mobileView",void 0);r([P()],T.prototype,"collapsibleFacetsVisible",void 0);r([P()],T.prototype,"contentWidth",void 0);r([P()],T.prototype,"placeholderType",void 0);r([G("#content-container")],T.prototype,"contentContainer",void 0);r([G("#left-column")],T.prototype,"leftColumn",void 0);r([G("collection-facets")],T.prototype,"collectionFacets",void 0);r([G("manage-bar")],T.prototype,"manageBar",void 0);r([h({type:Object,attribute:!1})],T.prototype,"analyticsHandler",void 0);r([G("infinite-scroller")],T.prototype,"infiniteScroller",void 0);T=r([L("collection-browser")],T);let re=class extends D{constructor(){super(...arguments),this.searchService=this.initSearchServiceFromUrlParams(),this.resizeObserver=new ol,this.toggleSlots=!1,this.cellWidth=18,this.cellHeight=29,this.rowGap=1.7,this.colGap=1.7,this.suppressFacets=!1,this.lazyLoadFacets=!1,this.loggedIn=!1,this.searchType=le.METADATA,this.analyticsManager=new Ln,this.analyticsHandler={sendPing:this.sendAnalytics.bind(this),sendEvent:this.sendAnalytics.bind(this),sendEventNoSampling:this.sendAnalytics.bind(this)}}sendAnalytics(e){var t;console.log("Analytics Received ----",e),this.latestAction=e,(t=this.analyticsManager)===null||t===void 0||t.sendEvent(e)}initSearchServiceFromUrlParams(){var e,t,i;const o=new URL(window.location.href).searchParams;return new Ue({includeCredentials:!1,baseUrl:(e=o.get("search_base_url"))!==null&&e!==void 0?e:void 0,servicePath:(t=o.get("search_service_path"))!==null&&t!==void 0?t:void 0,debuggingEnabled:(i=!!o.get("debugging"))!==null&&i!==void 0?i:void 0})}searchPressed(e){e.preventDefault(),this.searchQuery=this.baseQueryField.value,this.collectionBrowser.searchType=this.searchType,this.goToCurrentPage()}collectionChanged(e){e.preventDefault(),this.withinCollection=this.baseCollectionField.value,this.collectionBrowser.withinCollection=this.withinCollection,this.goToCurrentPage()}goToCurrentPage(){var e;const t=(e=this.currentPage)!==null&&e!==void 0?e:1;t>1&&this.collectionBrowser.goToPage(t)}changePagePressed(e){e.preventDefault(),this.currentPage=this.pageNumberInput.valueAsNumber,this.collectionBrowser.goToPage(this.currentPage)}updated(e){e.has("currentPage")&&this.currentPage&&(this.pageNumberInput.value=this.currentPage.toString()),e.has("searchQuery")&&this.queryUpdated()}queryUpdated(){this.collectionBrowser.baseQuery=this.searchQuery}get getClass(){return new URLSearchParams(window.location.search).get("hide-dev-tools")?"hidden":""}render(){var e,t;return c` +
    +
    +
    +
    + + + +
    +
    + + + +
    +
    +
    +
    + + + +
    +
    + +
    + Search type: + + + + + + + + +
    + +
    + + +
    + +
    + +
    + +
    + Cell Controls +
    + + + ${this.cellWidth}rem +
    +
    + + + ${this.cellHeight}rem +
    +
    + + + ${this.rowGap}rem +
    +
    + + + ${this.colGap}rem +
    +
    + +
    + Other Controls +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + +
    + CB Visual Appearance +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + + + +
    + +
    +
    + + ${this.toggleSlots?c`
    Sort Slot
    `:b} + ${this.toggleSlots?c`
    Facet Slot
    `:b} +
    +
    + + `}async setPlaceholderType(e){switch(e){case"loading-placeholder":this.collectionBrowser.baseQuery="",this.collectionBrowser.suppressPlaceholders=!0,this.collectionBrowser.clearResultsOnEmptyQuery=!0,this.requestUpdate(),await this.collectionBrowser.updateComplete;break}}baseQueryChanged(e){this.searchQuery=e.detail.baseQuery}searchTypeChanged(e){this.searchType=e.detail}searchTypeSelected(e){const t=e.target;this.searchType=t.value==="fulltext"?le.FULLTEXT:le.METADATA}loginChanged(e){e.target.checked?this.loggedIn=!0:this.loggedIn=!1}outlineChanged(e){e.target.checked?this.collectionBrowser.style.setProperty("--infiniteScrollerCellOutline","1px solid #33D1FF"):this.collectionBrowser.style.removeProperty("--infiniteScrollerCellOutline")}toggleDevTools(){var e,t;const i=new URL(window.location.href),{searchParams:o}=i;o.get("hide-dev-tools")?o.delete("hide-dev-tools"):o.set("hide-dev-tools","true"),(t=(e=this.shadowRoot)===null||e===void 0?void 0:e.getElementById("dev-tools"))===null||t===void 0||t.classList.toggle("hidden"),window.history.replaceState&&window.history.replaceState({path:i.toString()},"",i.toString())}toggleFacetGroupOutline(e){e.target.checked?(this.collectionBrowser.classList.add("showFacetGroupOutlines"),this.modalManager.classList.add("showFacetGroupOutlines")):(this.collectionBrowser.classList.remove("showFacetGroupOutlines"),this.modalManager.classList.remove("showFacetGroupOutlines"))}async snippetsChanged(e){e.target.checked?this.searchService={async search(i,o){var s;const n=await Ue.default.search(i,o);return(s=n.success)===null||s===void 0||s.response.results.forEach(l=>{Object.defineProperty(l,"highlight",{value:new $(["this is a text {{{snippet}}} block with potentially","multiple {{{snippets}}} and such","but the {{{snippet}}} block may be quite long perhaps","depending on how many {{{snippet}}} matches there are","there may be multiple lines of {{{snippets}}} to show","but each {{{snippet}}} should be relatively short","and {{{snippets}}} are each a {{{snippet}}} of text","but every {{{snippet}}} might have multiple matches","the {{{snippets}}} should be separated and surrounded by ellipses"])})}),n}}:this.searchService=Ue.default,this.reperformCurrentSearch()}async reviewsChanged(e){e.target.checked?this.searchService={async search(i,o){var s;const n=await Ue.default.search(i,o);return(s=n.success)===null||s===void 0||s.response.results.forEach((l,d)=>{Object.defineProperty(l,"review",{value:{title:"My Great Review",body:"This item is really great and that's why I'm leaving this review on it and giving it so many star...",stars:(d+3)%6}})}),n}}:this.searchService=Ue.default,this.reperformCurrentSearch()}async reperformCurrentSearch(){const e=this.searchQuery;this.searchQuery="-",await this.updateComplete,await new Promise(t=>{setTimeout(t,0)}),this.searchQuery=e}datePickerChanged(e){const t=e.target;this.collectionBrowser.showHistogramDatePicker=t.checked,this.collectionBrowser.showHistogramDatePicker||(this.collectionBrowser.minSelectedDate=void 0,this.collectionBrowser.maxSelectedDate=void 0)}facetsChanged(e){const t=e.target;this.suppressFacets=!t.checked}lazyLoadFacetsChanged(e){const t=e.target;this.lazyLoadFacets=t.checked}manageModeChanged(e){var t;const i=(t=this.shadowRoot)===null||t===void 0?void 0:t.querySelector("#enable-management");i&&(i.checked=e.detail)}handleItemRemovalRequest(e){this.collectionBrowser.showRemoveItemsProcessingModal(),console.log("itemRemovalRequested: ",e.detail.items),setTimeout(()=>{this.collectionBrowser.showRemoveItemsErrorModal()},2e3)}handleItemManagerRequest(e){console.log("itemManagerRequested: ",e.detail.items)}manageModeCheckboxChanged(e){const t=e.target;this.collectionBrowser.isManageView=t.checked,this.collectionBrowser.manageViewLabel="Select items to remove (customizable texts)"}SearchManageModeCheckboxChanged(e){const t=e.target;this.collectionBrowser.pageContext=t.checked?"search":"collection"}smartFacetBarCheckboxChanged(e){const t=e.target;this.collectionBrowser.showSmartFacetBar=t.checked}facetTopSlotCheckboxChanged(e){const t=e.target,i=document.createElement("p");i.style.setProperty("border","1px solid #000"),i.textContent="New stuff as a child.",i.style.setProperty("height","20rem"),i.style.backgroundColor="#00000",i.setAttribute("slot","facet-top-slot"),t.checked?this.collectionBrowser.appendChild(i):this.collectionBrowser.removeChild(this.collectionBrowser.lastElementChild)}toggleSlotOptions(){this.toggleSlots=!this.toggleSlots}resultLastTileSlotCheckboxChanged(e){const t=e.target,i=document.createElement("div"),o=document.createElement("h3");o.textContent="Upload",i.setAttribute("slot","result-last-tile"),i.setAttribute("class","result-last-tile"),i.appendChild(o),t.checked?this.collectionBrowser.appendChild(i):this.collectionBrowser.removeChild(this.collectionBrowser.lastElementChild)}cbTopSlotCheckboxChanged(e){const t=e.target,i=document.createElement("p");i.style.setProperty("border","1px solid #000"),i.textContent="My Favorite list header.",i.style.setProperty("height","10rem"),i.style.backgroundColor="#00000",i.setAttribute("slot","cb-top-slot"),t.checked?this.collectionBrowser.appendChild(i):this.collectionBrowser.removeChild(this.collectionBrowser.lastElementChild)}sortBarLeftSlotCheckboxChanged(e){if(e.target.checked){const i=document.createElement("div");i.style.setProperty("border","1px solid #000"),i.textContent="Btn",i.style.setProperty("height","3rem"),i.style.setProperty("width","3rem"),i.setAttribute("slot","sort-options-left"),this.collectionBrowser.appendChild(i)}else{const i=this.collectionBrowser.querySelector('[slot="sort-options-left"]');i&&this.collectionBrowser.removeChild(i)}}sortBarRightSlotCheckboxChanged(e){if(e.target.checked){const i=document.createElement("div");i.style.setProperty("border","1px solid #000"),i.textContent="Search bar",i.style.setProperty("height","3rem"),i.style.setProperty("width","15rem"),i.setAttribute("slot","sort-options-right"),this.collectionBrowser.appendChild(i)}else{const i=this.collectionBrowser.querySelector('[slot="sort-options-right"]');i&&this.collectionBrowser.removeChild(i)}}rowGapChanged(e){const t=e.target;this.rowGap=parseFloat(t.value),this.collectionBrowser.style.setProperty("--collectionBrowserRowGap",`${t.value}rem`)}colGapChanged(e){const t=e.target;this.colGap=parseFloat(t.value),this.collectionBrowser.style.setProperty("--collectionBrowserColGap",`${t.value}rem`)}widthChanged(e){const t=e.target;this.cellWidth=parseFloat(t.value),this.collectionBrowser.style.setProperty("--collectionBrowserCellMinWidth",`${t.value}rem`)}heightChanged(e){const t=e.target;this.cellHeight=parseFloat(t.value),this.collectionBrowser.style.setProperty("--collectionBrowserCellMinHeight",`${t.value}rem`),this.collectionBrowser.style.setProperty("--collectionBrowserCellMaxHeight",`${t.value}rem`)}visiblePageChanged(e){const{pageNumber:t}=e.detail;t!==this.currentPage&&(this.currentPage=t)}replaceSortOptionsChanged(e){if(e.target.checked){const i=document.createElement("p");i.style.setProperty("border","1px solid #000"),i.textContent="New stuff as a child.",i.style.setProperty("height","20px"),i.setAttribute("slot","sort-options"),this.collectionBrowser.appendChild(i),this.collectionBrowser.enableSortOptionsSlot=!0}else{const i=this.collectionBrowser.querySelector('[slot="sort-options"]');i&&this.collectionBrowser.removeChild(i),this.collectionBrowser.enableSortOptionsSlot=!1}}};re.styles=v` + :host { + display: block; + --primaryButtonBGColor: #194880; + --ia-theme-link-color: #4b64ff; + } + + /* add the following styles to ensure proper modal visibility */ + body.modal-manager-open { + overflow: hidden; + } + modal-manager { + display: none; + } + modal-manager[mode='open'] { + display: block; + } + modal-manager.remove-items { + --modalWidth: 58rem; + --modalBorder: 2px solid var(--primaryButtonBGColor, #194880); + --modalTitleLineHeight: 4rem; + --modalTitleFontSize: 1.8rem; + } + modal-manager.more-search-facets { + --modalWidth: 85rem; + --modalBorder: 2px solid var(--primaryButtonBGColor, #194880); + --modalTitleLineHeight: 4rem; + --modalTitleFontSize: 1.8rem; + --modalCornerRadius: 0; + --modalBottomPadding: 0; + --modalBottomMargin: 0; + --modalScrollOffset: 0; + --modalCornerRadius: 0.5rem; + } + modal-manager.expanded-date-picker { + --modalWidth: 58rem; + --modalBorder: 2px solid var(--primaryButtonBGColor, #194880); + --modalTitleLineHeight: 4rem; + --modalTitleFontSize: 1.8rem; + --modalCornerRadius: 0; + --modalBottomPadding: 0; + --modalBottomMargin: 0; + --modalScrollOffset: 0; + --modalCornerRadius: 0.5rem; + } + + input, + button { + font-size: 1.6rem; + } + + modal-manager.showFacetGroupOutlines, + collection-browser.showFacetGroupOutlines { + --facet-row-border-top: 1px solid red; + --facet-row-border-bottom: 1px solid blue; + } + + collection-browser { + /* Same as production */ + max-width: 135rem; + margin: auto; + } + + #collection-browser-container { + /* Same as production */ + padding-left: 0.5rem; + margin-bottom: 2rem; + } + + #base-query-field { + width: 300px; + } + + .dev-tool-container { + position: relative; + } + #dev-tools { + position: relative; + top: 0; + left: 0; + z-index: 1; + -webkit-backdrop-filter: blur(10px); + backdrop-filter: blur(10px); + padding: 0.5rem 1rem; + border: 1px solid black; + font-size: 1.4rem; + background: #ffffffb3; + } + + #dev-tools > * { + display: flex; + } + + #toggle-dev-tools-btn { + position: fixed; + left: 77.4%; + top: 0; + background: red; + padding: 5px; + color: white; + font-size: 1.4rem; + margin: 0; + z-index: 1; + cursor: pointer; + } + + #search-and-page-inputs { + flex-wrap: wrap; + row-gap: 2px; + } + + #search-and-page-inputs > form { + margin-right: 1rem; + } + + #search-and-page-inputs label { + display: inline-block; + min-width: 50px; + } + + #page-number-input { + width: 75px; + } + + .search-type { + margin-right: 1rem; + } + + .cell-controls { + display: flex; + flex-wrap: wrap; + } + .cell-controls div { + display: flex; + align-items: center; + } + .cell-controls input[type='range'] { + width: 120px; + } + #cell-controls label { + display: inline-block; + width: 10rem; + } + + #cell-size-control, + #cell-gap-control { + flex-basis: calc(50% - 1rem); + flex-grow: 1; + } + + #cell-gap-control { + margin-left: 1rem; + } + + #checkbox-controls { + padding-top: 0.5rem; + flex-wrap: wrap; + } + + .checkbox-control { + flex-basis: 50%; + } + .checkbox-control.indent { + margin-left: 10px; + } + .checkbox-control label { + user-select: none; + } + + #last-event { + background-color: aliceblue; + padding: 5px; + margin: 5px auto; + } + + .hidden { + display: none; + } + + #toggle-controls { + background-color: lightskyblue; + padding: 5px; + margin: 5px auto; + } + + #search-types { + margin: 5px auto; + background-color: aliceblue; + font-size: 1.6rem; + } + + // slots + div[slot='cb-top-slot'] { + height: 50px; + border: 1px solid red; + background: bisque; + } + div[slot='facet-top-slot'] { + border: 1px solid red; + width: 100%; + height: 150px; + background-color: darkseagreen; + } + div[slot='sort-slot-left'] { + height: 50px; + border: 1px solid red; + background: bisque; + } + + /* user profile controls */ + .user-profile-controls { + width: fit-content; + } + + fieldset { + display: inline-block !important; + } + + .result-last-tile { + border-radius: 4px; + background-color: white; + border: 3px dashed #555; + box-shadow: none; + display: grid; + align-content: center; + } + .result-last-tile:hover { + box-shadow: rgba(8, 8, 32, 0.8) 0 0 6px 2px; + transition: box-shadow 0.1s ease 0s; + cursor: pointer; + border: 3px dashed #4b64ff; + } + .result-last-tile h3 { + margin-bottom: 4rem; + margin: 0px auto; + font-size: 2.8rem; + color: rgb(44, 44, 44); + font-weight: 200; + text-align: center; + } + `;r([P()],re.prototype,"toggleSlots",void 0);r([P()],re.prototype,"currentPage",void 0);r([P()],re.prototype,"searchQuery",void 0);r([P()],re.prototype,"withinCollection",void 0);r([P()],re.prototype,"cellWidth",void 0);r([P()],re.prototype,"cellHeight",void 0);r([P()],re.prototype,"rowGap",void 0);r([P()],re.prototype,"colGap",void 0);r([P()],re.prototype,"suppressFacets",void 0);r([P()],re.prototype,"lazyLoadFacets",void 0);r([P()],re.prototype,"loggedIn",void 0);r([P()],re.prototype,"searchType",void 0);r([h({type:Object,reflect:!1})],re.prototype,"latestAction",void 0);r([G("#base-query-field")],re.prototype,"baseQueryField",void 0);r([G("#base-collection-field")],re.prototype,"baseCollectionField",void 0);r([G("#page-number-input")],re.prototype,"pageNumberInput",void 0);r([G("collection-browser")],re.prototype,"collectionBrowser",void 0);r([G("modal-manager")],re.prototype,"modalManager",void 0);re=r([L("app-root")],re); diff --git a/pr/pr-426/index.html b/pr/pr-426/index.html new file mode 100644 index 000000000..c31e8ca46 --- /dev/null +++ b/pr/pr-426/index.html @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + diff --git a/pr/pr-426/manifest.json b/pr/pr-426/manifest.json new file mode 100644 index 000000000..93654e1cb --- /dev/null +++ b/pr/pr-426/manifest.json @@ -0,0 +1,7 @@ +{ + "index.html": { + "file": "assets/main.5f904dad.js", + "src": "index.html", + "isEntry": true + } +} \ No newline at end of file