@searchcraft/javascript-sdk 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/defineCustomElements.js +25 -23
- package/dist/components/html.js +1 -1
- package/dist/components/index.d.ts +131 -5
- package/dist/components/index.js +245 -62
- package/dist/components/index.js.map +1 -1
- package/dist/components/{searchcraft-summary-box2.js → marked.esm.js} +3 -101
- package/dist/components/marked.esm.js.map +1 -0
- package/dist/components/searchcraft-ad.js +1 -1
- package/dist/components/searchcraft-ad2.js +4 -4
- package/dist/components/searchcraft-button.js +1 -1
- package/dist/components/searchcraft-button2.js +2 -2
- package/dist/components/searchcraft-error-message.js +1 -1
- package/dist/components/searchcraft-error-message2.js +1 -1
- package/dist/components/searchcraft-facet-list.js +1 -1
- package/dist/components/searchcraft-facet-list2.js +2 -2
- package/dist/components/searchcraft-filter-panel.js +5 -5
- package/dist/components/searchcraft-input-form.js +1 -1
- package/dist/components/searchcraft-input-form2.js +6 -6
- package/dist/components/searchcraft-input-label.js +1 -1
- package/dist/components/searchcraft-input-label2.js +2 -2
- package/dist/components/searchcraft-loading.js +1 -1
- package/dist/components/searchcraft-loading2.js +1 -1
- package/dist/components/searchcraft-pagination.js +4 -4
- package/dist/components/searchcraft-popover-button.js +6 -4
- package/dist/components/searchcraft-popover-button.js.map +1 -1
- package/dist/components/searchcraft-popover-footer.js +1 -1
- package/dist/components/searchcraft-popover-footer2.js +5 -7
- package/dist/components/searchcraft-popover-footer2.js.map +1 -1
- package/dist/components/searchcraft-popover-form.js +18 -18
- package/dist/components/searchcraft-popover-form.js.map +1 -1
- package/dist/components/searchcraft-popover-list-item.js +1 -1
- package/dist/components/searchcraft-popover-list-item2.js +4 -4
- package/dist/components/searchcraft-popover-list-view.js +1 -1
- package/dist/components/searchcraft-popover-list-view2.js +4 -4
- package/dist/components/searchcraft-results-info.js +4 -4
- package/dist/components/searchcraft-results-summary.d.ts +11 -0
- package/dist/components/searchcraft-results-summary.js +9 -0
- package/dist/components/searchcraft-results-summary.js.map +1 -0
- package/dist/components/searchcraft-results-summary2.js +97 -0
- package/dist/components/searchcraft-results-summary2.js.map +1 -0
- package/dist/components/searchcraft-search-result.js +1 -1
- package/dist/components/searchcraft-search-result2.js +3 -3
- package/dist/components/searchcraft-search-results-per-page.js +3 -3
- package/dist/components/searchcraft-search-results.js +5 -5
- package/dist/components/searchcraft-select.js +1 -1
- package/dist/components/searchcraft-select2.js +1 -1
- package/dist/components/searchcraft-slider.js +1 -1
- package/dist/components/searchcraft-slider2.js +5 -5
- package/dist/components/searchcraft-summary-box.js +89 -1
- package/dist/components/searchcraft-summary-box.js.map +1 -1
- package/dist/components/searchcraft-theme.js +3 -3
- package/dist/components/searchcraft-theme.js.map +1 -1
- package/dist/components/searchcraft-toggle-button.js +1 -1
- package/dist/components/searchcraft-toggle-button2.js +5 -5
- package/dist/hydrate/index.js +2075 -1973
- package/dist/hydrate/index.mjs +2075 -1973
- package/dist/themes/hologram.css +1 -1
- package/dist/themes/hologram.css.map +1 -1
- package/dist/types/clients/SummaryClient.d.ts +10 -1
- package/dist/types/components/searchcraft-popover-button/searchcraft-popover-button.d.ts +1 -1
- package/dist/types/components/searchcraft-results-summary/searchcraft-results-summary.d.ts +65 -0
- package/dist/types/components/searchcraft-summary-box/searchcraft-summary-box.d.ts +5 -5
- package/dist/types/components.d.ts +119 -2
- package/dist/types/store/SearchcraftStore.types.d.ts +1 -0
- package/dist/types/types/core-types/SearchcraftConfig.types.d.ts +2 -2
- package/package.json +2 -2
- package/dist/components/searchcraft-summary-box2.js.map +0 -1
package/dist/hydrate/index.mjs
CHANGED
|
@@ -6307,12 +6307,14 @@ class SearchcraftPopoverButton {
|
|
|
6307
6307
|
switch (this.type) {
|
|
6308
6308
|
case 'skeuomorphic':
|
|
6309
6309
|
return this.renderSkeuomorphicSlot();
|
|
6310
|
+
case 'magnifying-glass':
|
|
6311
|
+
return (hAsync("div", { class: 'searchcraft-popover-button-input' }, hAsync("svg", { class: 'searchcraft-popover-button-input-search-icon', viewBox: '0 0 20 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', version: '1.1', "aria-hidden": 'true' }, hAsync("path", { d: 'M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z', stroke: 'currentColor', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' }))));
|
|
6310
6312
|
default:
|
|
6311
6313
|
return (hAsync("div", null, hAsync("slot", null)));
|
|
6312
6314
|
}
|
|
6313
6315
|
}
|
|
6314
6316
|
render() {
|
|
6315
|
-
return (hAsync("button", { key: '
|
|
6317
|
+
return (hAsync("button", { key: '760f4f8d8daddaaadc0367e21b9efe23c4ef7c7d', "aria-label": this.type === 'magnifying-glass' ? 'Search' : undefined, class: `searchcraft-popover-button ${this.type ? ` searchcraft-popover-button-${this.type}` : ''}`, innerHTML: typeof this.template !== 'undefined'
|
|
6316
6318
|
? this.template({ isPopoverVisible: this.isPopoverVisible }, { html: html$1 })
|
|
6317
6319
|
: undefined, onClick: this.handleOnClick.bind(this), type: 'button' }, typeof this.template !== 'undefined'
|
|
6318
6320
|
? undefined
|
|
@@ -6339,7 +6341,7 @@ class SearchcraftPopoverButton {
|
|
|
6339
6341
|
}; }
|
|
6340
6342
|
}
|
|
6341
6343
|
|
|
6342
|
-
const version = "0.
|
|
6344
|
+
const version = "0.15.0";
|
|
6343
6345
|
|
|
6344
6346
|
/**
|
|
6345
6347
|
* Renders the footer for the searchcraft-popover-form.
|
|
@@ -6411,9 +6413,7 @@ class SearchcraftPopoverFooter {
|
|
|
6411
6413
|
const hasResults = typeof this.searchResultsCount === 'number' &&
|
|
6412
6414
|
this.searchResultsCount > 0;
|
|
6413
6415
|
const showViewAll = !!this.safeViewAllHref && hasResults;
|
|
6414
|
-
return (hAsync("footer", { key: '548704335f80a2b4bc7ebd4ea2d0a2eb73376fde', class: 'searchcraft-popover-footer' }, hAsync("a", { key: 'a10cbfd833ef0c6016932fede6ca3195eecdfaea', class: 'searchcraft-popover-footer-link', href: href, target: '_blank', rel: 'noreferrer' }, hAsync("
|
|
6415
|
-
? `${formatNumberWithCommas(this.searchResultsCount)} Results Found`
|
|
6416
|
-
: ' '), showViewAll && (hAsync("a", { key: 'f6b5d3d55a90ac722ad561a9dc1fe9435607a15f', class: 'searchcraft-popover-footer-view-all', href: this.safeViewAllHref }, hAsync("span", { key: '50bc54b0a295738323790ff8d95f83c4771ad1c6', class: 'searchcraft-popover-footer-view-all-label' }, this.viewAllResultsLabel), hAsync("span", { key: '5da21f2ae33b48f548ba3a3174798ae833fa622f', class: 'searchcraft-popover-footer-view-all-shortcut', "aria-hidden": 'true' }, hAsync("kbd", { key: 'be6a5e1b8fdc3fd01412735180ff94fecf69247e' }, "\u2318"), hAsync("kbd", { key: 'e98f65b70e75f3be6623cd768afade9bf19301d5' }, "\u21B5")))))));
|
|
6416
|
+
return (hAsync("footer", { key: '548704335f80a2b4bc7ebd4ea2d0a2eb73376fde', class: 'searchcraft-popover-footer' }, hAsync("a", { key: 'a10cbfd833ef0c6016932fede6ca3195eecdfaea', class: 'searchcraft-popover-footer-link', href: href, target: '_blank', rel: 'noreferrer' }, hAsync("span", { key: '6c6333a61ae282419e32721fc9760d3d237870df', class: 'searchcraft-popover-footer-link-prefix' }, "Powered by\u00A0"), " Searchcraft"), hAsync("div", { key: 'c35f7d6c5b16510fa58301b8fad070e6cd14d72f', class: 'searchcraft-popover-footer-results' }, hAsync("p", { key: 'e1576404d2d23a7b53e761e617720cc4fb45ea8d', class: 'searchcraft-popover-footer-results-info' }, hasResults ? (hAsync("span", null, formatNumberWithCommas(this.searchResultsCount), " Results", hAsync("span", { class: 'searchcraft-popover-footer-results-found' }, ' Found'))) : (' ')), showViewAll && (hAsync("a", { key: '6f5585d1a75ccc44174a22603d13f3604078ca63', class: 'searchcraft-popover-footer-view-all', href: this.safeViewAllHref }, hAsync("span", { key: '12d8202b01d4493700fafd61f81989458d7620c4', class: 'searchcraft-popover-footer-view-all-label' }, this.viewAllResultsLabel), hAsync("span", { key: '3b26ffdc731827612e789fdb38c751062c1077ff', class: 'searchcraft-popover-footer-view-all-shortcut', "aria-hidden": 'true' }, hAsync("kbd", { key: '6999416b99a6b4b5b24702597736846b9168b12d' }, "\u2318"), hAsync("kbd", { key: '8a7f8ee088d037e96102dab463eb93a9d27d85ea' }, "\u21B5")))))));
|
|
6417
6417
|
}
|
|
6418
6418
|
static get cmpMeta() { return {
|
|
6419
6419
|
"$flags$": 768,
|
|
@@ -6746,20 +6746,20 @@ class SearchcraftPopoverForm {
|
|
|
6746
6746
|
const isListViewVisible = this.hasResultsToShow && this.isFocused;
|
|
6747
6747
|
return (hAsync("div", { class: classNames('searchcraft-popover-form searchcraft-popover-form-inline', {
|
|
6748
6748
|
'searchcraft-popover-form-active': isListViewVisible,
|
|
6749
|
-
}) }, hAsync("div", { class: 'searchcraft-popover-form-input searchcraft-popover-form-inline-input' }, hAsync("searchcraft-input-form", { onInputFocus: this.handleInputFocus.bind(this), searchcraftId: this.searchcraftId, placeholderValue: this.placeholderValue, placeholderBehavior: this.placeholderBehavior })), isListViewVisible && (hAsync("div", { class: 'searchcraft-popover-form-inline-wrapper' }, this.showSummaryBox && (hAsync("searchcraft-summary
|
|
6749
|
+
}) }, hAsync("div", { class: 'searchcraft-popover-form-input searchcraft-popover-form-inline-input' }, hAsync("searchcraft-input-form", { onInputFocus: this.handleInputFocus.bind(this), searchcraftId: this.searchcraftId, placeholderValue: this.placeholderValue, placeholderBehavior: this.placeholderBehavior })), isListViewVisible && (hAsync("div", { class: 'searchcraft-popover-form-inline-wrapper' }, this.showSummaryBox && (hAsync("searchcraft-results-summary", { searchcraftId: this.searchcraftId })), hAsync("searchcraft-popover-list-view", { popoverResultMappings: this.popoverResultMappings, searchClientResponseItems: this.searchClientResponseItems, adClientResponseItems: this.adClientResponseItems, searchResultsPage: this.searchResultsPage, searchResultsPerPage: this.searchResultsPerPage, searchcraftId: this.searchcraftId }), hAsync("searchcraft-popover-footer", { searchcraftId: this.searchcraftId, sdkVariant: this.sdkVariant, viewAllResultsHref: this.viewAllResultsHref, viewAllResultsLabel: this.resolvedViewAllResultsLabel })))));
|
|
6750
6750
|
}
|
|
6751
6751
|
renderModalPopover() {
|
|
6752
6752
|
if (this.isPopoverVisibleInState) {
|
|
6753
6753
|
return (hAsync("div", { class: classNames('searchcraft-popover-form searchcraft-popover-form-modal', {
|
|
6754
6754
|
'searchcraft-popover-form-active': this.hasResultsToShow,
|
|
6755
|
-
}) }, hAsync("div", { class: 'searchcraft-popover-form-modal-backdrop', onClick: this.handleModalBackdropClick }), hAsync("div", { class: 'searchcraft-popover-form-modal-wrapper' }, hAsync("div", { class: 'searchcraft-popover-form-input searchcraft-popover-form-modal-input' }, hAsync("searchcraft-input-form", { onInputFocus: this.handleInputFocus.bind(this), onInputInit: this.handleInputInit.bind(this), searchcraftId: this.searchcraftId, placeholderValue: this.placeholderValue, placeholderBehavior: this.placeholderBehavior }), hAsync("button", { type: 'button', class: 'searchcraft-popover-form-cancel-button searchcraft-popover-form-modal-cancel-button', onClick: this.handleCancelButtonClick.bind(this) }, "Cancel")), hAsync("div", { class: 'searchcraft-popover-form-modal-popover-list-view' }, this.showSummaryBox && this.hasResultsToShow && (hAsync("searchcraft-summary
|
|
6755
|
+
}) }, hAsync("div", { class: 'searchcraft-popover-form-modal-backdrop', onClick: this.handleModalBackdropClick }), hAsync("div", { class: 'searchcraft-popover-form-modal-wrapper' }, hAsync("div", { class: 'searchcraft-popover-form-input searchcraft-popover-form-modal-input' }, hAsync("searchcraft-input-form", { onInputFocus: this.handleInputFocus.bind(this), onInputInit: this.handleInputInit.bind(this), searchcraftId: this.searchcraftId, placeholderValue: this.placeholderValue, placeholderBehavior: this.placeholderBehavior }), hAsync("button", { type: 'button', class: 'searchcraft-popover-form-cancel-button searchcraft-popover-form-modal-cancel-button', onClick: this.handleCancelButtonClick.bind(this) }, "Cancel")), hAsync("div", { class: 'searchcraft-popover-form-modal-popover-list-view' }, this.showSummaryBox && this.hasResultsToShow && (hAsync("searchcraft-results-summary", { searchcraftId: this.searchcraftId })), this.hasResultsToShow && (hAsync("searchcraft-popover-list-view", { popoverResultMappings: this.popoverResultMappings, searchClientResponseItems: this.searchClientResponseItems, adClientResponseItems: this.adClientResponseItems, searchResultsPage: this.searchResultsPage, searchResultsPerPage: this.searchResultsPerPage, searchcraftId: this.searchcraftId }))), hAsync("searchcraft-popover-footer", { searchcraftId: this.searchcraftId, sdkVariant: this.sdkVariant, viewAllResultsHref: this.viewAllResultsHref, viewAllResultsLabel: this.resolvedViewAllResultsLabel }))));
|
|
6756
6756
|
}
|
|
6757
6757
|
}
|
|
6758
6758
|
renderFullscreenPopover() {
|
|
6759
6759
|
if (this.isPopoverVisibleInState) {
|
|
6760
6760
|
return (hAsync("div", { class: classNames('searchcraft-popover-form searchcraft-popover-form-fullscreen', {
|
|
6761
6761
|
'searchcraft-popover-form-active': this.hasResultsToShow,
|
|
6762
|
-
}) }, hAsync("div", { class: 'searchcraft-popover-form-input searchcraft-popover-form-fullscreen-input' }, hAsync("searchcraft-input-form", { onInputFocus: this.handleInputFocus.bind(this), onInputInit: this.handleInputInit.bind(this), searchcraftId: this.searchcraftId, placeholderValue: this.placeholderValue, placeholderBehavior: this.placeholderBehavior }), hAsync("button", { type: 'button', class: 'searchcraft-popover-form-cancel-button searchcraft-popover-form-fullscreen-cancel-button', onClick: this.handleCancelButtonClick.bind(this) }, "Cancel")), hAsync("div", { class: 'searchcraft-popover-form-fullscreen-popover-list-view' }, this.showSummaryBox && this.hasResultsToShow && (hAsync("searchcraft-summary
|
|
6762
|
+
}) }, hAsync("div", { class: 'searchcraft-popover-form-input searchcraft-popover-form-fullscreen-input' }, hAsync("searchcraft-input-form", { onInputFocus: this.handleInputFocus.bind(this), onInputInit: this.handleInputInit.bind(this), searchcraftId: this.searchcraftId, placeholderValue: this.placeholderValue, placeholderBehavior: this.placeholderBehavior }), hAsync("button", { type: 'button', class: 'searchcraft-popover-form-cancel-button searchcraft-popover-form-fullscreen-cancel-button', onClick: this.handleCancelButtonClick.bind(this) }, "Cancel")), hAsync("div", { class: 'searchcraft-popover-form-fullscreen-popover-list-view' }, this.showSummaryBox && this.hasResultsToShow && (hAsync("searchcraft-results-summary", { searchcraftId: this.searchcraftId })), this.hasResultsToShow && (hAsync("searchcraft-popover-list-view", { popoverResultMappings: this.popoverResultMappings, searchClientResponseItems: this.searchClientResponseItems, adClientResponseItems: this.adClientResponseItems, searchResultsPage: this.searchResultsPage, searchResultsPerPage: this.searchResultsPerPage, searchcraftId: this.searchcraftId }))), hAsync("searchcraft-popover-footer", { searchcraftId: this.searchcraftId, sdkVariant: this.sdkVariant, viewAllResultsHref: this.viewAllResultsHref, viewAllResultsLabel: this.resolvedViewAllResultsLabel })));
|
|
6763
6763
|
}
|
|
6764
6764
|
}
|
|
6765
6765
|
render() {
|
|
@@ -6861,7 +6861,7 @@ class SearchcraftPopoverListItem {
|
|
|
6861
6861
|
}
|
|
6862
6862
|
};
|
|
6863
6863
|
render() {
|
|
6864
|
-
return (hAsync("div", { key: '
|
|
6864
|
+
return (hAsync("div", { key: 'd1c9c310b8abc9d2370efb802eac1edf4189519d', class: 'searchcraft-popover-list-item' }, hAsync("a", { key: '30eb1a5076c5b4b95ae43147eaee0bb72ce46179', class: 'searchcraft-popover-list-item-link', href: this.href, onClick: this.handleLinkClick.bind(this) }, this.imageSource && (hAsync("div", { key: 'd18ff55823dc2c61f3786f423936af8b009aeeda', class: 'searchcraft-popover-list-item-image-wrapper' }, hAsync("img", { key: '56f4cc1d472f7da05e64fcf52c560a7ad0cdf7a6', alt: this.imageAlt, src: this.imageSource, class: 'searchcraft-popover-list-item-image' }))), hAsync("div", { key: '78a0f0235d5e71d10076b70ccbaf4b58e0d6fea0', class: 'searchcraft-popover-list-item-content' }, this.title && (hAsync("p", { key: '4489047af56e5aa295cb5f036e970dcad053d3b7', class: 'searchcraft-popover-list-item-content-title' }, this.title)), this.subtitle && (hAsync("p", { key: '4d177c227a1dbf1233022d738403c8eb93ba328d', class: 'searchcraft-popover-list-item-content-subtitle' }, this.subtitle))))));
|
|
6865
6865
|
}
|
|
6866
6866
|
static get cmpMeta() { return {
|
|
6867
6867
|
"$flags$": 768,
|
|
@@ -7368,718 +7368,6 @@ class SearchcraftResultsInfo {
|
|
|
7368
7368
|
}; }
|
|
7369
7369
|
}
|
|
7370
7370
|
|
|
7371
|
-
/**
|
|
7372
|
-
* This web component is designed to display detailed information for a single search result. Once a query is submitted, the component formats and presents the result.
|
|
7373
|
-
*
|
|
7374
|
-
* @internal
|
|
7375
|
-
*/
|
|
7376
|
-
class SearchcraftSearchResult {
|
|
7377
|
-
constructor(hostRef) {
|
|
7378
|
-
registerInstance(this, hostRef);
|
|
7379
|
-
}
|
|
7380
|
-
item;
|
|
7381
|
-
/**
|
|
7382
|
-
* The index.
|
|
7383
|
-
*/
|
|
7384
|
-
index;
|
|
7385
|
-
/**
|
|
7386
|
-
* The position in the document. Used with the "document_clicked" measure event.
|
|
7387
|
-
*/
|
|
7388
|
-
documentPosition = 0;
|
|
7389
|
-
/**
|
|
7390
|
-
* A callback function responsible for rendering a result.
|
|
7391
|
-
*/
|
|
7392
|
-
template;
|
|
7393
|
-
/**
|
|
7394
|
-
* The id of the Searchcraft instance that this component should use.
|
|
7395
|
-
*/
|
|
7396
|
-
searchcraftId;
|
|
7397
|
-
templateHtml;
|
|
7398
|
-
get hostElement() { return getElement(this); }
|
|
7399
|
-
core;
|
|
7400
|
-
cleanupCore;
|
|
7401
|
-
onCoreAvailable(core) {
|
|
7402
|
-
this.core = core;
|
|
7403
|
-
}
|
|
7404
|
-
connectedCallback() {
|
|
7405
|
-
this.cleanupCore = registry.useCoreInstance(this.searchcraftId, this.onCoreAvailable.bind(this));
|
|
7406
|
-
if (this.item) {
|
|
7407
|
-
try {
|
|
7408
|
-
this.templateHtml = this.template?.(this.item.document, this.index, {
|
|
7409
|
-
html: html$1,
|
|
7410
|
-
source_index: this.item.source_index,
|
|
7411
|
-
});
|
|
7412
|
-
}
|
|
7413
|
-
catch (error) {
|
|
7414
|
-
console.error('Invalid search result template:', error);
|
|
7415
|
-
}
|
|
7416
|
-
}
|
|
7417
|
-
}
|
|
7418
|
-
disconnectedCallback() {
|
|
7419
|
-
this.cleanupCore?.();
|
|
7420
|
-
}
|
|
7421
|
-
handleResultContainerClick = (event) => {
|
|
7422
|
-
if (!event.target) {
|
|
7423
|
-
return;
|
|
7424
|
-
}
|
|
7425
|
-
const target = event.target;
|
|
7426
|
-
const link = target.closest('a');
|
|
7427
|
-
if (!link ||
|
|
7428
|
-
!this.hostElement?.contains(link) ||
|
|
7429
|
-
!this.core ||
|
|
7430
|
-
!this.core.measureClient) {
|
|
7431
|
-
return;
|
|
7432
|
-
}
|
|
7433
|
-
const document_position = this.documentPosition;
|
|
7434
|
-
const search_term = this.core.store.getState().searchTerm;
|
|
7435
|
-
const number_of_documents = this.core.store.getState().searchClientResponseItems.length || 0;
|
|
7436
|
-
this.core.measureClient.sendMeasureEvent('document_clicked', {
|
|
7437
|
-
document_position,
|
|
7438
|
-
number_of_documents,
|
|
7439
|
-
search_term,
|
|
7440
|
-
});
|
|
7441
|
-
};
|
|
7442
|
-
handleKeyDown = () => { };
|
|
7443
|
-
render() {
|
|
7444
|
-
if (!this.item) {
|
|
7445
|
-
return;
|
|
7446
|
-
}
|
|
7447
|
-
if (typeof this.template === 'undefined') {
|
|
7448
|
-
return (hAsync("div", { class: 'searchcraft-search-result searchcraft-search-result-no-template', onClick: this.handleResultContainerClick, onKeyDown: this.handleKeyDown }, Object.entries(this.item.document).map(([key, value]) => (hAsync("p", { key: key }, hAsync("strong", null, key), ": ", value)))));
|
|
7449
|
-
}
|
|
7450
|
-
return (hAsync("div", { class: 'searchcraft-search-result', innerHTML: this.templateHtml, onClick: this.handleResultContainerClick, onKeyDown: this.handleKeyDown }));
|
|
7451
|
-
}
|
|
7452
|
-
static get cmpMeta() { return {
|
|
7453
|
-
"$flags$": 768,
|
|
7454
|
-
"$tagName$": "searchcraft-search-result",
|
|
7455
|
-
"$members$": {
|
|
7456
|
-
"item": [16],
|
|
7457
|
-
"index": [2],
|
|
7458
|
-
"documentPosition": [2, "document-position"],
|
|
7459
|
-
"template": [16],
|
|
7460
|
-
"searchcraftId": [1, "searchcraft-id"],
|
|
7461
|
-
"templateHtml": [32]
|
|
7462
|
-
},
|
|
7463
|
-
"$listeners$": undefined,
|
|
7464
|
-
"$lazyBundleId$": "-",
|
|
7465
|
-
"$attrsToReflect$": []
|
|
7466
|
-
}; }
|
|
7467
|
-
}
|
|
7468
|
-
|
|
7469
|
-
/**
|
|
7470
|
-
* This web component is responsible for displaying the results of a search query. Once a query is submitted, the component formats and presents an ordered list of the results.
|
|
7471
|
-
*
|
|
7472
|
-
*
|
|
7473
|
-
* @react-import
|
|
7474
|
-
* ```jsx
|
|
7475
|
-
* import { SearchcraftSearchResults } from "@searchcraft/react-sdk";
|
|
7476
|
-
* ```
|
|
7477
|
-
*
|
|
7478
|
-
* @vue-import
|
|
7479
|
-
* ```jsx
|
|
7480
|
-
* import { SearchcraftSearchResults } from "@searchcraft/vue-sdk";
|
|
7481
|
-
* ```
|
|
7482
|
-
*
|
|
7483
|
-
* @js-example
|
|
7484
|
-
* ```html
|
|
7485
|
-
* <!-- index.html -->
|
|
7486
|
-
* <searchcraft-search-results
|
|
7487
|
-
* ad-interval="4"
|
|
7488
|
-
* place-ad-at-start="true"
|
|
7489
|
-
* />
|
|
7490
|
-
* ```
|
|
7491
|
-
*
|
|
7492
|
-
* ```js
|
|
7493
|
-
* // index.js
|
|
7494
|
-
* const searchResults = document.querySelector('searchcraft-search-results');
|
|
7495
|
-
*
|
|
7496
|
-
* searchResults.template = (item, index, { html }) => html`
|
|
7497
|
-
* <h2>${item.title}</h2>
|
|
7498
|
-
* `;
|
|
7499
|
-
* ```
|
|
7500
|
-
*
|
|
7501
|
-
* @react-example
|
|
7502
|
-
* ```jsx
|
|
7503
|
-
* <SearchcraftSearchResults
|
|
7504
|
-
* adInterval={4}
|
|
7505
|
-
* placeAdAtState={true}
|
|
7506
|
-
* template={(item, index, { html }) => html`
|
|
7507
|
-
* <h2>${item.title}</h2>
|
|
7508
|
-
* `}
|
|
7509
|
-
* />
|
|
7510
|
-
* ```
|
|
7511
|
-
*
|
|
7512
|
-
* @vue-example
|
|
7513
|
-
* ```jsx
|
|
7514
|
-
* <SearchcraftSearchResults
|
|
7515
|
-
* adInterval={4}
|
|
7516
|
-
* placeAdAtState={true}
|
|
7517
|
-
* :template={(item, index, { html }) => html`
|
|
7518
|
-
* <h2>${item.title}</h2>
|
|
7519
|
-
* `}
|
|
7520
|
-
* />
|
|
7521
|
-
* ```
|
|
7522
|
-
*/
|
|
7523
|
-
class SearchcraftSearchResults {
|
|
7524
|
-
constructor(hostRef) {
|
|
7525
|
-
registerInstance(this, hostRef);
|
|
7526
|
-
}
|
|
7527
|
-
/**
|
|
7528
|
-
* The id of the Searchcraft instance that this component should use.
|
|
7529
|
-
*/
|
|
7530
|
-
searchcraftId;
|
|
7531
|
-
/**
|
|
7532
|
-
* A query that will appears when the component initializes or the search term is ''..
|
|
7533
|
-
*/
|
|
7534
|
-
initialQuery;
|
|
7535
|
-
/**
|
|
7536
|
-
* A callback function responsible for rendering a result. Passed to `searchcraft-search-result`.
|
|
7537
|
-
*/
|
|
7538
|
-
template;
|
|
7539
|
-
adClientResponseItems = [];
|
|
7540
|
-
config;
|
|
7541
|
-
isSearchInProgress = true;
|
|
7542
|
-
searchClientResponseItems;
|
|
7543
|
-
searchResultsPage;
|
|
7544
|
-
searchResultsPerPage;
|
|
7545
|
-
searchTerm = '';
|
|
7546
|
-
unsubscribe;
|
|
7547
|
-
cleanupCore;
|
|
7548
|
-
onCoreAvailable(core) {
|
|
7549
|
-
const state = core.store.getState();
|
|
7550
|
-
this.handleStateChange(state);
|
|
7551
|
-
this.searchClientResponseItems = state.searchClientResponseItems;
|
|
7552
|
-
this.searchTerm = state.searchTerm;
|
|
7553
|
-
this.config = state.core?.config;
|
|
7554
|
-
this.unsubscribe = core.store.subscribe((state) => this.handleStateChange(state));
|
|
7555
|
-
}
|
|
7556
|
-
connectedCallback() {
|
|
7557
|
-
this.cleanupCore = registry.useCoreInstance(this.searchcraftId, this.onCoreAvailable.bind(this));
|
|
7558
|
-
}
|
|
7559
|
-
disconnectedCallback() {
|
|
7560
|
-
this.unsubscribe?.();
|
|
7561
|
-
this.cleanupCore?.();
|
|
7562
|
-
}
|
|
7563
|
-
handleStateChange(state) {
|
|
7564
|
-
this.adClientResponseItems = [...state.adClientResponseItems];
|
|
7565
|
-
this.config = state.core?.config;
|
|
7566
|
-
this.isSearchInProgress = state.isSearchInProgress;
|
|
7567
|
-
this.searchClientResponseItems = [...state.searchClientResponseItems];
|
|
7568
|
-
this.searchResultsPage = state.searchResultsPage;
|
|
7569
|
-
this.searchResultsPerPage = state.searchResultsPerPage;
|
|
7570
|
-
this.searchTerm = state.searchTerm;
|
|
7571
|
-
}
|
|
7572
|
-
renderEmptyState() {
|
|
7573
|
-
return (hAsync("div", { class: 'searchcraft-search-results-empty-state' }, hAsync("slot", { name: 'empty-search' })));
|
|
7574
|
-
}
|
|
7575
|
-
renderNoResultsFoundState() {
|
|
7576
|
-
return (hAsync("div", { class: 'searchcraft-search-results' }, hAsync("div", { class: 'searchcraft-search-results-error-message' }, hAsync("searchcraft-error-message", null, "No search results found for \"", this.searchTerm, "\" query."))));
|
|
7577
|
-
}
|
|
7578
|
-
renderWithADMAds() {
|
|
7579
|
-
const items = this.searchClientResponseItems || [];
|
|
7580
|
-
return (hAsync("div", { class: 'searchcraft-search-results' }, this.adClientResponseItems?.map((item) => (hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'adMarketplace', adClientResponseItem: item, key: item.id, renderPosition: 'top' }))), items.map((item, index) => (hAsync("searchcraft-search-result", { "searchcraft-id": this.searchcraftId, key: item.id, "document-position": this.searchResultsPerPage * (this.searchResultsPage - 1) + index, index: index, item: item, template: this.template })))));
|
|
7581
|
-
}
|
|
7582
|
-
renderWithCustomAds() {
|
|
7583
|
-
const itemsToRender = [];
|
|
7584
|
-
const interstitialInterval = this.config?.customAdConfig?.adInterstitialInterval || 0;
|
|
7585
|
-
const interstitialQuantity = this.config?.customAdConfig?.adInterstitialQuantity || 1;
|
|
7586
|
-
const adStartQuantity = this.config?.customAdConfig?.adStartQuantity || 0;
|
|
7587
|
-
const adEndQuantity = this.config?.customAdConfig?.adEndQuantity || 0;
|
|
7588
|
-
const items = this.searchClientResponseItems || [];
|
|
7589
|
-
// Renders ads at beginning
|
|
7590
|
-
for (let n = 0; n < adStartQuantity; n++) {
|
|
7591
|
-
itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Custom', key: `${n}-ad`, renderPosition: 'top' }));
|
|
7592
|
-
}
|
|
7593
|
-
// Renders search results + interstitial ads
|
|
7594
|
-
items.forEach((item, index) => {
|
|
7595
|
-
if (interstitialInterval &&
|
|
7596
|
-
index % interstitialInterval === 0 &&
|
|
7597
|
-
index + interstitialInterval < items.length &&
|
|
7598
|
-
index >= interstitialInterval) {
|
|
7599
|
-
for (let n = 0; n < interstitialQuantity; n++) {
|
|
7600
|
-
itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Custom', key: `${item.id}-ad-${n}`, renderPosition: 'interstitial' }));
|
|
7601
|
-
}
|
|
7602
|
-
}
|
|
7603
|
-
itemsToRender.push(hAsync("searchcraft-search-result", { "searchcraft-id": this.searchcraftId, key: item.id, "document-position": this.searchResultsPerPage * (this.searchResultsPage - 1) + index, index: index, item: item, template: this.template }));
|
|
7604
|
-
});
|
|
7605
|
-
// Renders ads at end
|
|
7606
|
-
for (let n = 0; n < adEndQuantity; n++) {
|
|
7607
|
-
itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Custom', key: `${n}-ad`, renderPosition: 'bottom' }));
|
|
7608
|
-
}
|
|
7609
|
-
return hAsync("div", { class: 'searchcraft-search-results' }, itemsToRender);
|
|
7610
|
-
}
|
|
7611
|
-
renderWithNativoAds() {
|
|
7612
|
-
const itemsToRender = [];
|
|
7613
|
-
const interstitialStartIndex = this.config?.nativoConfig?.adInterstialStartIndex || 0;
|
|
7614
|
-
const interstitialInterval = this.config?.nativoConfig?.adInterstitialInterval || 0;
|
|
7615
|
-
const interstitialQuantity = this.config?.nativoConfig?.adInterstitialQuantity || 1;
|
|
7616
|
-
const adStartQuantity = this.config?.nativoConfig?.adStartQuantity || 0;
|
|
7617
|
-
const adEndQuantity = this.config?.nativoConfig?.adEndQuantity || 0;
|
|
7618
|
-
const items = this.searchClientResponseItems || [];
|
|
7619
|
-
// Renders ads at beginning
|
|
7620
|
-
for (let n = 0; n < adStartQuantity; n++) {
|
|
7621
|
-
itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Nativo', key: `${n}-ad`, renderPosition: 'top' }));
|
|
7622
|
-
}
|
|
7623
|
-
// Renders search results + interstitial ads
|
|
7624
|
-
items.forEach((item, index) => {
|
|
7625
|
-
if (interstitialInterval &&
|
|
7626
|
-
(index + interstitialStartIndex) % interstitialInterval === 0 &&
|
|
7627
|
-
index + interstitialInterval < items.length &&
|
|
7628
|
-
index >= interstitialInterval) {
|
|
7629
|
-
for (let n = 0; n < interstitialQuantity; n++) {
|
|
7630
|
-
itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Nativo', key: `${item.id}-ad-${n}`, renderPosition: 'interstitial' }));
|
|
7631
|
-
}
|
|
7632
|
-
}
|
|
7633
|
-
itemsToRender.push(hAsync("searchcraft-search-result", { "searchcraft-id": this.searchcraftId, key: item.id, "document-position": this.searchResultsPerPage * (this.searchResultsPage - 1) + index, index: index, item: item, template: this.template }));
|
|
7634
|
-
});
|
|
7635
|
-
// Renders ads at end
|
|
7636
|
-
for (let n = 0; n < adEndQuantity; n++) {
|
|
7637
|
-
itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Nativo', key: `${n}-ad`, renderPosition: 'bottom' }));
|
|
7638
|
-
}
|
|
7639
|
-
return hAsync("div", { class: 'searchcraft-search-results' }, itemsToRender);
|
|
7640
|
-
}
|
|
7641
|
-
renderWithNoAds() {
|
|
7642
|
-
const items = this.searchClientResponseItems || [];
|
|
7643
|
-
return (hAsync("div", { class: 'searchcraft-search-results' }, items.map((item, index) => (hAsync("searchcraft-search-result", { "searchcraft-id": this.searchcraftId, key: item.id, "document-position": this.searchResultsPerPage * (this.searchResultsPage - 1) + index, index: index, item: item, template: this.template })))));
|
|
7644
|
-
}
|
|
7645
|
-
render() {
|
|
7646
|
-
const searchClientResponseItems = this.searchClientResponseItems || [];
|
|
7647
|
-
if (searchClientResponseItems.length === 0 && !this.isSearchInProgress) {
|
|
7648
|
-
return this.renderEmptyState();
|
|
7649
|
-
}
|
|
7650
|
-
if (this.searchTerm.length > 0 &&
|
|
7651
|
-
searchClientResponseItems.length === 0 &&
|
|
7652
|
-
!this.isSearchInProgress) {
|
|
7653
|
-
return this.renderNoResultsFoundState();
|
|
7654
|
-
}
|
|
7655
|
-
if (this.config?.customAdConfig) {
|
|
7656
|
-
return this.renderWithCustomAds();
|
|
7657
|
-
}
|
|
7658
|
-
if (this.config?.admAdConfig) {
|
|
7659
|
-
return this.renderWithNativoAds();
|
|
7660
|
-
}
|
|
7661
|
-
if (this.config?.nativoConfig) {
|
|
7662
|
-
return this.renderWithNativoAds();
|
|
7663
|
-
}
|
|
7664
|
-
return this.renderWithNoAds();
|
|
7665
|
-
}
|
|
7666
|
-
static get cmpMeta() { return {
|
|
7667
|
-
"$flags$": 772,
|
|
7668
|
-
"$tagName$": "searchcraft-search-results",
|
|
7669
|
-
"$members$": {
|
|
7670
|
-
"searchcraftId": [1, "searchcraft-id"],
|
|
7671
|
-
"initialQuery": [1, "initial-query"],
|
|
7672
|
-
"template": [16],
|
|
7673
|
-
"adClientResponseItems": [32],
|
|
7674
|
-
"config": [32],
|
|
7675
|
-
"isSearchInProgress": [32],
|
|
7676
|
-
"searchClientResponseItems": [32],
|
|
7677
|
-
"searchResultsPage": [32],
|
|
7678
|
-
"searchResultsPerPage": [32],
|
|
7679
|
-
"searchTerm": [32]
|
|
7680
|
-
},
|
|
7681
|
-
"$listeners$": undefined,
|
|
7682
|
-
"$lazyBundleId$": "-",
|
|
7683
|
-
"$attrsToReflect$": []
|
|
7684
|
-
}; }
|
|
7685
|
-
}
|
|
7686
|
-
|
|
7687
|
-
/**
|
|
7688
|
-
* This web component is designed to choose the number of search results displayed.
|
|
7689
|
-
*
|
|
7690
|
-
* @react-import
|
|
7691
|
-
* ```jsx
|
|
7692
|
-
* import { SearchcraftSearchResultsPerPage } from "@searchcraft/react-sdk";
|
|
7693
|
-
* ```
|
|
7694
|
-
*
|
|
7695
|
-
* @vue-import
|
|
7696
|
-
* ```jsx
|
|
7697
|
-
* import { SearchcraftSearchResultsPerPage } from "@searchcraft/vue-sdk";
|
|
7698
|
-
* ```
|
|
7699
|
-
*
|
|
7700
|
-
* @js-example
|
|
7701
|
-
* ```html
|
|
7702
|
-
* <!-- index.html -->
|
|
7703
|
-
* <searchcraft-search-results-per-page increment="20" />
|
|
7704
|
-
* ```
|
|
7705
|
-
*
|
|
7706
|
-
* @react-example
|
|
7707
|
-
* ```jsx
|
|
7708
|
-
* <SearchcraftSearchResultsPerPage increment={20} />
|
|
7709
|
-
* ```
|
|
7710
|
-
*
|
|
7711
|
-
* @vue-example
|
|
7712
|
-
* ```jsx
|
|
7713
|
-
* <SearchcraftSearchResultsPerPage increment="20" />
|
|
7714
|
-
* ```
|
|
7715
|
-
*/
|
|
7716
|
-
class SearchcraftSearchResultsPerPage {
|
|
7717
|
-
constructor(hostRef) {
|
|
7718
|
-
registerInstance(this, hostRef);
|
|
7719
|
-
}
|
|
7720
|
-
/**
|
|
7721
|
-
* The amount the options will increase (e.g. 20 = [20, 40, 60, 80, 100]).
|
|
7722
|
-
* The base value is defined by the `searchResultsPerPage` option in the configuration.
|
|
7723
|
-
*/
|
|
7724
|
-
increment = 20;
|
|
7725
|
-
/**
|
|
7726
|
-
* The id of the Searchcraft instance that this component should use.
|
|
7727
|
-
*/
|
|
7728
|
-
searchcraftId;
|
|
7729
|
-
// store vars
|
|
7730
|
-
searchTerm;
|
|
7731
|
-
searchResultsPage;
|
|
7732
|
-
searchResultsPerPage;
|
|
7733
|
-
searchResultsCount;
|
|
7734
|
-
searchResultsPagesCount;
|
|
7735
|
-
searchClientRequestProperties;
|
|
7736
|
-
// local vars
|
|
7737
|
-
initialSearchResultsPerPage;
|
|
7738
|
-
// store functions
|
|
7739
|
-
setSearchResultsPerPage = () => { };
|
|
7740
|
-
setSearchResultsPage = () => { };
|
|
7741
|
-
unsubscribe = () => { };
|
|
7742
|
-
cleanupCore;
|
|
7743
|
-
onCoreAvailable(core) {
|
|
7744
|
-
this.unsubscribe = core.store.subscribe((state) => {
|
|
7745
|
-
// store vars
|
|
7746
|
-
this.searchTerm = state.searchTerm;
|
|
7747
|
-
this.searchResultsPerPage = state.searchResultsPerPage;
|
|
7748
|
-
this.searchResultsPage = state.searchResultsPage;
|
|
7749
|
-
this.searchResultsCount = state.searchResultsCount;
|
|
7750
|
-
this.searchClientRequestProperties = state.searchClientRequestProperties;
|
|
7751
|
-
// local vars
|
|
7752
|
-
this.searchResultsPagesCount = Math.ceil(this.searchResultsCount / this.searchResultsPerPage);
|
|
7753
|
-
// store functions
|
|
7754
|
-
this.setSearchResultsPage = state.setSearchResultsPage;
|
|
7755
|
-
this.setSearchResultsPerPage = state.setSearchResultsPerPage;
|
|
7756
|
-
});
|
|
7757
|
-
this.initialSearchResultsPerPage =
|
|
7758
|
-
core.store.getState().searchResultsPerPage;
|
|
7759
|
-
}
|
|
7760
|
-
connectedCallback() {
|
|
7761
|
-
this.cleanupCore = registry.useCoreInstance(this.searchcraftId, this.onCoreAvailable.bind(this));
|
|
7762
|
-
}
|
|
7763
|
-
disconnectedCallback() {
|
|
7764
|
-
this.unsubscribe?.();
|
|
7765
|
-
this.cleanupCore?.();
|
|
7766
|
-
}
|
|
7767
|
-
render() {
|
|
7768
|
-
// Check if this is an initialQuery case (string requestProperties with empty searchTerm)
|
|
7769
|
-
const isInitialQuery = typeof this.searchClientRequestProperties === 'string' &&
|
|
7770
|
-
this.searchTerm.trim() === '';
|
|
7771
|
-
// early return if there isn't a searchTerm (unless it's initialQuery) or there is 1 or fewer pages of results
|
|
7772
|
-
if ((!this.searchTerm && !isInitialQuery) ||
|
|
7773
|
-
this.searchResultsPagesCount <= 1) {
|
|
7774
|
-
return;
|
|
7775
|
-
}
|
|
7776
|
-
return (hAsync("div", { class: 'searchcraft-search-results-per-page' }, hAsync("div", { class: 'searchcraft-search-results-per-page-select' }, hAsync("label", { class: 'searchcraft-search-results-per-page-select-label', htmlFor: 'searchcraft-search-results-per-page-select-input' }, "Results Per Page"), hAsync("div", { class: 'searchcraft-search-results-per-page-select-input' }, hAsync("searchcraft-select", { inputId: 'searchcraft-search-results-per-page-select-input', name: 'results-per-page', options: [...Array(5)].map((_, index) => {
|
|
7777
|
-
const value = this.initialSearchResultsPerPage +
|
|
7778
|
-
Number(this.increment) * index;
|
|
7779
|
-
return {
|
|
7780
|
-
label: `${value}`,
|
|
7781
|
-
value,
|
|
7782
|
-
};
|
|
7783
|
-
}), onSelectChange: (event) => {
|
|
7784
|
-
this.setSearchResultsPerPage(Number(event.detail));
|
|
7785
|
-
this.setSearchResultsPage(1);
|
|
7786
|
-
} })))));
|
|
7787
|
-
}
|
|
7788
|
-
static get cmpMeta() { return {
|
|
7789
|
-
"$flags$": 768,
|
|
7790
|
-
"$tagName$": "searchcraft-search-results-per-page",
|
|
7791
|
-
"$members$": {
|
|
7792
|
-
"increment": [8],
|
|
7793
|
-
"searchcraftId": [1, "searchcraft-id"],
|
|
7794
|
-
"searchTerm": [32],
|
|
7795
|
-
"searchResultsPage": [32],
|
|
7796
|
-
"searchResultsPerPage": [32],
|
|
7797
|
-
"searchResultsCount": [32],
|
|
7798
|
-
"searchResultsPagesCount": [32],
|
|
7799
|
-
"searchClientRequestProperties": [32],
|
|
7800
|
-
"initialSearchResultsPerPage": [32],
|
|
7801
|
-
"setSearchResultsPerPage": [32],
|
|
7802
|
-
"setSearchResultsPage": [32]
|
|
7803
|
-
},
|
|
7804
|
-
"$listeners$": undefined,
|
|
7805
|
-
"$lazyBundleId$": "-",
|
|
7806
|
-
"$attrsToReflect$": []
|
|
7807
|
-
}; }
|
|
7808
|
-
}
|
|
7809
|
-
|
|
7810
|
-
/**
|
|
7811
|
-
* This web component is designed to allow users to select between a group of options.
|
|
7812
|
-
*
|
|
7813
|
-
* @js-example
|
|
7814
|
-
* ```html
|
|
7815
|
-
* <!-- index.html -->
|
|
7816
|
-
* <searchcraft-select
|
|
7817
|
-
* inputId="searchcraft-select"
|
|
7818
|
-
* name="searchcraft-select"
|
|
7819
|
-
* options="[{ label: 'label', value: 'value' }]"
|
|
7820
|
-
* />
|
|
7821
|
-
* ```
|
|
7822
|
-
*
|
|
7823
|
-
* @internal
|
|
7824
|
-
*/
|
|
7825
|
-
class SearchcraftSelect {
|
|
7826
|
-
constructor(hostRef) {
|
|
7827
|
-
registerInstance(this, hostRef);
|
|
7828
|
-
this.selectChange = createEvent(this, "selectChange");
|
|
7829
|
-
}
|
|
7830
|
-
/**
|
|
7831
|
-
* The caption displayed below the select input.
|
|
7832
|
-
*/
|
|
7833
|
-
caption;
|
|
7834
|
-
/**
|
|
7835
|
-
* Whether the select input is disabled.
|
|
7836
|
-
*/
|
|
7837
|
-
disabled = false;
|
|
7838
|
-
/**
|
|
7839
|
-
* The ID for the select input.
|
|
7840
|
-
*/
|
|
7841
|
-
inputId;
|
|
7842
|
-
/**
|
|
7843
|
-
* The label of the select input.
|
|
7844
|
-
*/
|
|
7845
|
-
label;
|
|
7846
|
-
/**
|
|
7847
|
-
* The ID for the label of the select input.
|
|
7848
|
-
*/
|
|
7849
|
-
labelId;
|
|
7850
|
-
/**
|
|
7851
|
-
* The name of the select input.
|
|
7852
|
-
*/
|
|
7853
|
-
name;
|
|
7854
|
-
/**
|
|
7855
|
-
* The options for the select input.
|
|
7856
|
-
*/
|
|
7857
|
-
options = [];
|
|
7858
|
-
/**
|
|
7859
|
-
* The event fired when the select is changed.
|
|
7860
|
-
*/
|
|
7861
|
-
selectChange;
|
|
7862
|
-
searchResultsPerPage;
|
|
7863
|
-
setSearchResultsPage = () => { };
|
|
7864
|
-
setSearchResultsPerPage = () => { };
|
|
7865
|
-
handleSelectChange = (event) => {
|
|
7866
|
-
this.selectChange.emit(event.target.value);
|
|
7867
|
-
};
|
|
7868
|
-
handleGoToPage(page) {
|
|
7869
|
-
this.setSearchResultsPage(page);
|
|
7870
|
-
}
|
|
7871
|
-
render() {
|
|
7872
|
-
return (hAsync("div", { key: '15ecbf48c824a161cd83bdab99dace8e44f1ab39', class: 'searchcraft-select' }, this.label && (hAsync("label", { key: 'aba433ae9c27c9405099cffcef923c3ad22d7fda', class: 'searchcraft-select-label', id: this.labelId || `${this.inputId}-label`, htmlFor: this.inputId }, this.label)), hAsync("div", { key: '8df8a2ff05924c9c55cdd6e3827cd927cddab82a', class: 'searchcraft-select-input-wrapper' }, hAsync("select", { key: '1d5f492c2255f8ca1b6ea5e04a2726dda2f2c52f', "aria-labelledby": this.label ? this.labelId || `${this.inputId}-label` : undefined, class: 'searchcraft-select-input', disabled: this.disabled, id: this.inputId, name: this.name, onChange: this.handleSelectChange }, (typeof this.options === 'string'
|
|
7873
|
-
? JSON.parse(this.options)
|
|
7874
|
-
: this.options).map(({ label, value, selected }) => {
|
|
7875
|
-
return (hAsync("option", { key: value, value: value, selected: selected }, label));
|
|
7876
|
-
})), hAsync("svg", { key: '0ec6892b529f2e70027aadea47208582a65a97b7', class: 'searchcraft-select-input-icon', width: '20', height: '20', viewBox: '0 0 20 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg' }, hAsync("title", { key: 'bced6b62378491d1d1c629b602d7d033d912c761' }, "Select dropdown icon"), hAsync("path", { key: '659f8ebf9129e2e7941da949d29688c41c1472bb', d: 'M5 7.5L10 12.5L15 7.5', stroke: 'currentColor', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' }))), this.caption && (hAsync("p", { key: '51217d926f68f79b6c3514f5fd769b56549fdce9', class: 'searchcraft-select-caption' }, this.caption))));
|
|
7877
|
-
}
|
|
7878
|
-
static get cmpMeta() { return {
|
|
7879
|
-
"$flags$": 768,
|
|
7880
|
-
"$tagName$": "searchcraft-select",
|
|
7881
|
-
"$members$": {
|
|
7882
|
-
"caption": [1],
|
|
7883
|
-
"disabled": [4],
|
|
7884
|
-
"inputId": [1, "input-id"],
|
|
7885
|
-
"label": [1],
|
|
7886
|
-
"labelId": [1, "label-id"],
|
|
7887
|
-
"name": [1],
|
|
7888
|
-
"options": [1],
|
|
7889
|
-
"searchResultsPerPage": [32],
|
|
7890
|
-
"setSearchResultsPage": [32],
|
|
7891
|
-
"setSearchResultsPerPage": [32]
|
|
7892
|
-
},
|
|
7893
|
-
"$listeners$": undefined,
|
|
7894
|
-
"$lazyBundleId$": "-",
|
|
7895
|
-
"$attrsToReflect$": []
|
|
7896
|
-
}; }
|
|
7897
|
-
}
|
|
7898
|
-
|
|
7899
|
-
/**
|
|
7900
|
-
* Creates a throttled version of the given function that only invokes
|
|
7901
|
-
* the original function at most once every specified number of milliseconds.
|
|
7902
|
-
*
|
|
7903
|
-
* The logic is written in a way that the last invocation is always called, after the
|
|
7904
|
-
* throttle cooldown period has ended.
|
|
7905
|
-
*
|
|
7906
|
-
* @template Arguments - The argument types for the function to throttle
|
|
7907
|
-
* @param callback - The function to throttle
|
|
7908
|
-
* @param delayInMilliseconds - The number of milliseconds to wait before allowing the next invocation
|
|
7909
|
-
* @returns A throttled version of the original function
|
|
7910
|
-
*/
|
|
7911
|
-
function throttle(callback, delayInMilliseconds) {
|
|
7912
|
-
let isThrottleOnCooldown = false;
|
|
7913
|
-
let trailingCallArgs = null;
|
|
7914
|
-
const invokeAction = (args) => {
|
|
7915
|
-
callback(...args);
|
|
7916
|
-
isThrottleOnCooldown = true;
|
|
7917
|
-
setTimeout(() => {
|
|
7918
|
-
isThrottleOnCooldown = false;
|
|
7919
|
-
if (trailingCallArgs) {
|
|
7920
|
-
const nextArgs = trailingCallArgs;
|
|
7921
|
-
trailingCallArgs = null;
|
|
7922
|
-
invokeAction(nextArgs);
|
|
7923
|
-
}
|
|
7924
|
-
}, delayInMilliseconds);
|
|
7925
|
-
};
|
|
7926
|
-
return (...args) => {
|
|
7927
|
-
if (!isThrottleOnCooldown) {
|
|
7928
|
-
invokeAction(args);
|
|
7929
|
-
}
|
|
7930
|
-
else {
|
|
7931
|
-
trailingCallArgs = args;
|
|
7932
|
-
}
|
|
7933
|
-
};
|
|
7934
|
-
}
|
|
7935
|
-
|
|
7936
|
-
/**
|
|
7937
|
-
* This web component is designed to allow users to select a value from a range defined by a minimum and maximum value. The component renders a slider interface, which can be used to visually choose a value between two boundaries.
|
|
7938
|
-
*
|
|
7939
|
-
* @internal
|
|
7940
|
-
*/
|
|
7941
|
-
class SearchcraftSlider {
|
|
7942
|
-
constructor(hostRef) {
|
|
7943
|
-
registerInstance(this, hostRef);
|
|
7944
|
-
this.rangeChanged = createEvent(this, "rangeChanged");
|
|
7945
|
-
}
|
|
7946
|
-
/**
|
|
7947
|
-
* The maximum value allowed.
|
|
7948
|
-
*/
|
|
7949
|
-
max = 100;
|
|
7950
|
-
/**
|
|
7951
|
-
* The minimum value allowed.
|
|
7952
|
-
*/
|
|
7953
|
-
min = 0;
|
|
7954
|
-
/**
|
|
7955
|
-
* The step amount for the slider inputs.
|
|
7956
|
-
*/
|
|
7957
|
-
step = 1;
|
|
7958
|
-
/** The type of data the sliders are using. */
|
|
7959
|
-
dataType = 'number';
|
|
7960
|
-
/** The date granularity to use. Used to format date labels. */
|
|
7961
|
-
dateGranularity;
|
|
7962
|
-
lowerBound = 0;
|
|
7963
|
-
upperBound = 1;
|
|
7964
|
-
endValue = 0;
|
|
7965
|
-
startValue = 0;
|
|
7966
|
-
lastFocusedHandle = 'max';
|
|
7967
|
-
throttledEmitUpdate = () => { };
|
|
7968
|
-
/**
|
|
7969
|
-
* When the range has changed.
|
|
7970
|
-
* */
|
|
7971
|
-
rangeChanged;
|
|
7972
|
-
connectedCallback() {
|
|
7973
|
-
switch (this.dataType) {
|
|
7974
|
-
case 'number':
|
|
7975
|
-
this.startValue = this.min;
|
|
7976
|
-
this.endValue = this.max;
|
|
7977
|
-
this.lowerBound = this.min;
|
|
7978
|
-
this.upperBound = this.max;
|
|
7979
|
-
break;
|
|
7980
|
-
case 'date': {
|
|
7981
|
-
this.startValue = 0;
|
|
7982
|
-
this.endValue = getDifferenceInUnits(this.dateGranularity || 'year', this.min, this.max);
|
|
7983
|
-
this.lowerBound = 0;
|
|
7984
|
-
this.upperBound = this.endValue;
|
|
7985
|
-
break;
|
|
7986
|
-
}
|
|
7987
|
-
}
|
|
7988
|
-
this.throttledEmitUpdate = throttle(this.emitUpdate, 120);
|
|
7989
|
-
}
|
|
7990
|
-
emitUpdate = async () => {
|
|
7991
|
-
switch (this.dataType) {
|
|
7992
|
-
case 'number':
|
|
7993
|
-
this.rangeChanged?.emit({
|
|
7994
|
-
startValue: this.startValue,
|
|
7995
|
-
endValue: this.endValue,
|
|
7996
|
-
});
|
|
7997
|
-
break;
|
|
7998
|
-
case 'date': {
|
|
7999
|
-
const granularity = this.dateGranularity || 'year';
|
|
8000
|
-
const startTimestamp = getStartOf(this.min, granularity, this.lowerBound + this.startValue);
|
|
8001
|
-
const endTimestamp = getStartOf(this.min, granularity, this.lowerBound + this.endValue + 1);
|
|
8002
|
-
this.rangeChanged?.emit({
|
|
8003
|
-
startValue: startTimestamp,
|
|
8004
|
-
endValue: endTimestamp,
|
|
8005
|
-
});
|
|
8006
|
-
break;
|
|
8007
|
-
}
|
|
8008
|
-
}
|
|
8009
|
-
};
|
|
8010
|
-
handleStartValueChange = (event) => {
|
|
8011
|
-
const inputElement = event.target;
|
|
8012
|
-
const value = Number.parseInt(inputElement.value, 10);
|
|
8013
|
-
this.lastFocusedHandle = 'min';
|
|
8014
|
-
if (value <= this.endValue) {
|
|
8015
|
-
this.startValue = value;
|
|
8016
|
-
this.throttledEmitUpdate();
|
|
8017
|
-
}
|
|
8018
|
-
else {
|
|
8019
|
-
this.startValue = this.endValue;
|
|
8020
|
-
inputElement.value = `${this.endValue}`;
|
|
8021
|
-
}
|
|
8022
|
-
};
|
|
8023
|
-
handleEndValueChange = (event) => {
|
|
8024
|
-
const inputElement = event.target;
|
|
8025
|
-
const value = Number.parseInt(inputElement.value, 10);
|
|
8026
|
-
this.lastFocusedHandle = 'max';
|
|
8027
|
-
if (value >= this.startValue) {
|
|
8028
|
-
this.endValue = value;
|
|
8029
|
-
this.throttledEmitUpdate();
|
|
8030
|
-
}
|
|
8031
|
-
else {
|
|
8032
|
-
this.endValue = this.startValue;
|
|
8033
|
-
inputElement.value = `${this.startValue}`;
|
|
8034
|
-
}
|
|
8035
|
-
};
|
|
8036
|
-
getLabel = (value) => {
|
|
8037
|
-
switch (this.dataType) {
|
|
8038
|
-
case 'number':
|
|
8039
|
-
return `${this.startValue}`;
|
|
8040
|
-
case 'date': {
|
|
8041
|
-
const granularity = this.dateGranularity || 'year';
|
|
8042
|
-
const dateOffset = this.lowerBound + value;
|
|
8043
|
-
const timestamp = getStartOf(this.min, granularity, dateOffset);
|
|
8044
|
-
return getFormattedDateString(this.dateGranularity || 'year', new Date(timestamp));
|
|
8045
|
-
}
|
|
8046
|
-
}
|
|
8047
|
-
};
|
|
8048
|
-
render() {
|
|
8049
|
-
const startPercent = ((this.startValue - this.lowerBound) /
|
|
8050
|
-
(this.upperBound - this.lowerBound)) *
|
|
8051
|
-
100;
|
|
8052
|
-
const endPercent = ((this.endValue - this.lowerBound) /
|
|
8053
|
-
(this.upperBound - this.lowerBound)) *
|
|
8054
|
-
100;
|
|
8055
|
-
const startLabel = this.getLabel(this.startValue);
|
|
8056
|
-
const endLabel = this.getLabel(this.endValue);
|
|
8057
|
-
return (hAsync("div", { key: '59b07f5c8a14f6cbad8bae6faebf12e9a511bcbb', class: 'searchcraft-slider' }, hAsync("div", { key: '603c0bc39c6fe018016caf17b3b73f5b3c410fba', class: 'searchcraft-slider-range' }, hAsync("div", { key: '31d4097f29aa13d0ab14ec861ecea803e8190ed0', class: 'searchcraft-slider-active-range', style: {
|
|
8058
|
-
left: `${startPercent}%`,
|
|
8059
|
-
width: `${endPercent - startPercent}%`,
|
|
8060
|
-
} }), hAsync("input", { key: '40299fe0d7b973b448151a045b7a7f6c3b8846fd', class: classNames('searchcraft-slider-input', 'searchcraft-slider-input-min-handle'), max: this.upperBound, min: this.lowerBound, onInput: this.handleStartValueChange.bind(this), step: this.step, style: { zIndex: this.lastFocusedHandle === 'min' ? '2' : '1' }, type: 'range', value: this.startValue }), hAsync("input", { key: 'd46ad0cee946b168cd6004f8a2f819f6e46c50e4', class: classNames('searchcraft-slider-input', 'searchcraft-slider-input-max-handle'), max: this.upperBound, min: this.lowerBound, onInput: this.handleEndValueChange.bind(this), step: this.step, style: { zIndex: this.lastFocusedHandle === 'max' ? '2' : '1' }, type: 'range', value: this.endValue })), hAsync("div", { key: 'e65452bc456b0fa69d0dc0dd1276e19b9cf521e6', class: 'searchcraft-slider-label' }, hAsync("span", { key: '2b5aec3e96d9bc9420b047a1d00cce40f361c729', class: 'searchcraft-slider-start-label' }, startLabel), hAsync("span", { key: 'fce2109bd481b3df9ac4beee3731a24c012e4512', class: 'searchcraft-slider-end-label' }, endLabel))));
|
|
8061
|
-
}
|
|
8062
|
-
static get cmpMeta() { return {
|
|
8063
|
-
"$flags$": 768,
|
|
8064
|
-
"$tagName$": "searchcraft-slider",
|
|
8065
|
-
"$members$": {
|
|
8066
|
-
"max": [2],
|
|
8067
|
-
"min": [2],
|
|
8068
|
-
"step": [2],
|
|
8069
|
-
"dataType": [1, "data-type"],
|
|
8070
|
-
"dateGranularity": [1, "date-granularity"],
|
|
8071
|
-
"lowerBound": [32],
|
|
8072
|
-
"upperBound": [32],
|
|
8073
|
-
"endValue": [32],
|
|
8074
|
-
"startValue": [32],
|
|
8075
|
-
"lastFocusedHandle": [32]
|
|
8076
|
-
},
|
|
8077
|
-
"$listeners$": undefined,
|
|
8078
|
-
"$lazyBundleId$": "-",
|
|
8079
|
-
"$attrsToReflect$": []
|
|
8080
|
-
}; }
|
|
8081
|
-
}
|
|
8082
|
-
|
|
8083
7371
|
/**
|
|
8084
7372
|
* marked v15.0.12 - a markdown parser
|
|
8085
7373
|
* Copyright (c) 2011-2025, Christopher Jeffrey. (MIT Licensed)
|
|
@@ -8842,1404 +8130,2226 @@ ${currentText}` : currentText;
|
|
|
8842
8130
|
};
|
|
8843
8131
|
}));
|
|
8844
8132
|
}
|
|
8845
|
-
return item;
|
|
8133
|
+
return item;
|
|
8134
|
+
}
|
|
8135
|
+
lheading(src) {
|
|
8136
|
+
const cap = this.rules.block.lheading.exec(src);
|
|
8137
|
+
if (cap) {
|
|
8138
|
+
return {
|
|
8139
|
+
type: "heading",
|
|
8140
|
+
raw: cap[0],
|
|
8141
|
+
depth: cap[2].charAt(0) === "=" ? 1 : 2,
|
|
8142
|
+
text: cap[1],
|
|
8143
|
+
tokens: this.lexer.inline(cap[1])
|
|
8144
|
+
};
|
|
8145
|
+
}
|
|
8146
|
+
}
|
|
8147
|
+
paragraph(src) {
|
|
8148
|
+
const cap = this.rules.block.paragraph.exec(src);
|
|
8149
|
+
if (cap) {
|
|
8150
|
+
const text = cap[1].charAt(cap[1].length - 1) === "\n" ? cap[1].slice(0, -1) : cap[1];
|
|
8151
|
+
return {
|
|
8152
|
+
type: "paragraph",
|
|
8153
|
+
raw: cap[0],
|
|
8154
|
+
text,
|
|
8155
|
+
tokens: this.lexer.inline(text)
|
|
8156
|
+
};
|
|
8157
|
+
}
|
|
8158
|
+
}
|
|
8159
|
+
text(src) {
|
|
8160
|
+
const cap = this.rules.block.text.exec(src);
|
|
8161
|
+
if (cap) {
|
|
8162
|
+
return {
|
|
8163
|
+
type: "text",
|
|
8164
|
+
raw: cap[0],
|
|
8165
|
+
text: cap[0],
|
|
8166
|
+
tokens: this.lexer.inline(cap[0])
|
|
8167
|
+
};
|
|
8168
|
+
}
|
|
8169
|
+
}
|
|
8170
|
+
escape(src) {
|
|
8171
|
+
const cap = this.rules.inline.escape.exec(src);
|
|
8172
|
+
if (cap) {
|
|
8173
|
+
return {
|
|
8174
|
+
type: "escape",
|
|
8175
|
+
raw: cap[0],
|
|
8176
|
+
text: cap[1]
|
|
8177
|
+
};
|
|
8178
|
+
}
|
|
8179
|
+
}
|
|
8180
|
+
tag(src) {
|
|
8181
|
+
const cap = this.rules.inline.tag.exec(src);
|
|
8182
|
+
if (cap) {
|
|
8183
|
+
if (!this.lexer.state.inLink && this.rules.other.startATag.test(cap[0])) {
|
|
8184
|
+
this.lexer.state.inLink = true;
|
|
8185
|
+
} else if (this.lexer.state.inLink && this.rules.other.endATag.test(cap[0])) {
|
|
8186
|
+
this.lexer.state.inLink = false;
|
|
8187
|
+
}
|
|
8188
|
+
if (!this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(cap[0])) {
|
|
8189
|
+
this.lexer.state.inRawBlock = true;
|
|
8190
|
+
} else if (this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(cap[0])) {
|
|
8191
|
+
this.lexer.state.inRawBlock = false;
|
|
8192
|
+
}
|
|
8193
|
+
return {
|
|
8194
|
+
type: "html",
|
|
8195
|
+
raw: cap[0],
|
|
8196
|
+
inLink: this.lexer.state.inLink,
|
|
8197
|
+
inRawBlock: this.lexer.state.inRawBlock,
|
|
8198
|
+
block: false,
|
|
8199
|
+
text: cap[0]
|
|
8200
|
+
};
|
|
8201
|
+
}
|
|
8202
|
+
}
|
|
8203
|
+
link(src) {
|
|
8204
|
+
const cap = this.rules.inline.link.exec(src);
|
|
8205
|
+
if (cap) {
|
|
8206
|
+
const trimmedUrl = cap[2].trim();
|
|
8207
|
+
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(trimmedUrl)) {
|
|
8208
|
+
if (!this.rules.other.endAngleBracket.test(trimmedUrl)) {
|
|
8209
|
+
return;
|
|
8210
|
+
}
|
|
8211
|
+
const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), "\\");
|
|
8212
|
+
if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {
|
|
8213
|
+
return;
|
|
8214
|
+
}
|
|
8215
|
+
} else {
|
|
8216
|
+
const lastParenIndex = findClosingBracket(cap[2], "()");
|
|
8217
|
+
if (lastParenIndex === -2) {
|
|
8218
|
+
return;
|
|
8219
|
+
}
|
|
8220
|
+
if (lastParenIndex > -1) {
|
|
8221
|
+
const start = cap[0].indexOf("!") === 0 ? 5 : 4;
|
|
8222
|
+
const linkLen = start + cap[1].length + lastParenIndex;
|
|
8223
|
+
cap[2] = cap[2].substring(0, lastParenIndex);
|
|
8224
|
+
cap[0] = cap[0].substring(0, linkLen).trim();
|
|
8225
|
+
cap[3] = "";
|
|
8226
|
+
}
|
|
8227
|
+
}
|
|
8228
|
+
let href = cap[2];
|
|
8229
|
+
let title = "";
|
|
8230
|
+
if (this.options.pedantic) {
|
|
8231
|
+
const link2 = this.rules.other.pedanticHrefTitle.exec(href);
|
|
8232
|
+
if (link2) {
|
|
8233
|
+
href = link2[1];
|
|
8234
|
+
title = link2[3];
|
|
8235
|
+
}
|
|
8236
|
+
} else {
|
|
8237
|
+
title = cap[3] ? cap[3].slice(1, -1) : "";
|
|
8238
|
+
}
|
|
8239
|
+
href = href.trim();
|
|
8240
|
+
if (this.rules.other.startAngleBracket.test(href)) {
|
|
8241
|
+
if (this.options.pedantic && !this.rules.other.endAngleBracket.test(trimmedUrl)) {
|
|
8242
|
+
href = href.slice(1);
|
|
8243
|
+
} else {
|
|
8244
|
+
href = href.slice(1, -1);
|
|
8245
|
+
}
|
|
8246
|
+
}
|
|
8247
|
+
return outputLink(cap, {
|
|
8248
|
+
href: href ? href.replace(this.rules.inline.anyPunctuation, "$1") : href,
|
|
8249
|
+
title: title ? title.replace(this.rules.inline.anyPunctuation, "$1") : title
|
|
8250
|
+
}, cap[0], this.lexer, this.rules);
|
|
8251
|
+
}
|
|
8252
|
+
}
|
|
8253
|
+
reflink(src, links) {
|
|
8254
|
+
let cap;
|
|
8255
|
+
if ((cap = this.rules.inline.reflink.exec(src)) || (cap = this.rules.inline.nolink.exec(src))) {
|
|
8256
|
+
const linkString = (cap[2] || cap[1]).replace(this.rules.other.multipleSpaceGlobal, " ");
|
|
8257
|
+
const link2 = links[linkString.toLowerCase()];
|
|
8258
|
+
if (!link2) {
|
|
8259
|
+
const text = cap[0].charAt(0);
|
|
8260
|
+
return {
|
|
8261
|
+
type: "text",
|
|
8262
|
+
raw: text,
|
|
8263
|
+
text
|
|
8264
|
+
};
|
|
8265
|
+
}
|
|
8266
|
+
return outputLink(cap, link2, cap[0], this.lexer, this.rules);
|
|
8267
|
+
}
|
|
8268
|
+
}
|
|
8269
|
+
emStrong(src, maskedSrc, prevChar = "") {
|
|
8270
|
+
let match = this.rules.inline.emStrongLDelim.exec(src);
|
|
8271
|
+
if (!match) return;
|
|
8272
|
+
if (match[3] && prevChar.match(this.rules.other.unicodeAlphaNumeric)) return;
|
|
8273
|
+
const nextChar = match[1] || match[2] || "";
|
|
8274
|
+
if (!nextChar || !prevChar || this.rules.inline.punctuation.exec(prevChar)) {
|
|
8275
|
+
const lLength = [...match[0]].length - 1;
|
|
8276
|
+
let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;
|
|
8277
|
+
const endReg = match[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
|
|
8278
|
+
endReg.lastIndex = 0;
|
|
8279
|
+
maskedSrc = maskedSrc.slice(-1 * src.length + lLength);
|
|
8280
|
+
while ((match = endReg.exec(maskedSrc)) != null) {
|
|
8281
|
+
rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];
|
|
8282
|
+
if (!rDelim) continue;
|
|
8283
|
+
rLength = [...rDelim].length;
|
|
8284
|
+
if (match[3] || match[4]) {
|
|
8285
|
+
delimTotal += rLength;
|
|
8286
|
+
continue;
|
|
8287
|
+
} else if (match[5] || match[6]) {
|
|
8288
|
+
if (lLength % 3 && !((lLength + rLength) % 3)) {
|
|
8289
|
+
midDelimTotal += rLength;
|
|
8290
|
+
continue;
|
|
8291
|
+
}
|
|
8292
|
+
}
|
|
8293
|
+
delimTotal -= rLength;
|
|
8294
|
+
if (delimTotal > 0) continue;
|
|
8295
|
+
rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);
|
|
8296
|
+
const lastCharLength = [...match[0]][0].length;
|
|
8297
|
+
const raw = src.slice(0, lLength + match.index + lastCharLength + rLength);
|
|
8298
|
+
if (Math.min(lLength, rLength) % 2) {
|
|
8299
|
+
const text2 = raw.slice(1, -1);
|
|
8300
|
+
return {
|
|
8301
|
+
type: "em",
|
|
8302
|
+
raw,
|
|
8303
|
+
text: text2,
|
|
8304
|
+
tokens: this.lexer.inlineTokens(text2)
|
|
8305
|
+
};
|
|
8306
|
+
}
|
|
8307
|
+
const text = raw.slice(2, -2);
|
|
8308
|
+
return {
|
|
8309
|
+
type: "strong",
|
|
8310
|
+
raw,
|
|
8311
|
+
text,
|
|
8312
|
+
tokens: this.lexer.inlineTokens(text)
|
|
8313
|
+
};
|
|
8314
|
+
}
|
|
8315
|
+
}
|
|
8316
|
+
}
|
|
8317
|
+
codespan(src) {
|
|
8318
|
+
const cap = this.rules.inline.code.exec(src);
|
|
8319
|
+
if (cap) {
|
|
8320
|
+
let text = cap[2].replace(this.rules.other.newLineCharGlobal, " ");
|
|
8321
|
+
const hasNonSpaceChars = this.rules.other.nonSpaceChar.test(text);
|
|
8322
|
+
const hasSpaceCharsOnBothEnds = this.rules.other.startingSpaceChar.test(text) && this.rules.other.endingSpaceChar.test(text);
|
|
8323
|
+
if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {
|
|
8324
|
+
text = text.substring(1, text.length - 1);
|
|
8325
|
+
}
|
|
8326
|
+
return {
|
|
8327
|
+
type: "codespan",
|
|
8328
|
+
raw: cap[0],
|
|
8329
|
+
text
|
|
8330
|
+
};
|
|
8331
|
+
}
|
|
8846
8332
|
}
|
|
8847
|
-
|
|
8848
|
-
const cap = this.rules.
|
|
8333
|
+
br(src) {
|
|
8334
|
+
const cap = this.rules.inline.br.exec(src);
|
|
8849
8335
|
if (cap) {
|
|
8850
8336
|
return {
|
|
8851
|
-
type: "
|
|
8337
|
+
type: "br",
|
|
8338
|
+
raw: cap[0]
|
|
8339
|
+
};
|
|
8340
|
+
}
|
|
8341
|
+
}
|
|
8342
|
+
del(src) {
|
|
8343
|
+
const cap = this.rules.inline.del.exec(src);
|
|
8344
|
+
if (cap) {
|
|
8345
|
+
return {
|
|
8346
|
+
type: "del",
|
|
8852
8347
|
raw: cap[0],
|
|
8853
|
-
|
|
8854
|
-
|
|
8855
|
-
tokens: this.lexer.inline(cap[1])
|
|
8348
|
+
text: cap[2],
|
|
8349
|
+
tokens: this.lexer.inlineTokens(cap[2])
|
|
8856
8350
|
};
|
|
8857
8351
|
}
|
|
8858
8352
|
}
|
|
8859
|
-
|
|
8860
|
-
const cap = this.rules.
|
|
8353
|
+
autolink(src) {
|
|
8354
|
+
const cap = this.rules.inline.autolink.exec(src);
|
|
8861
8355
|
if (cap) {
|
|
8862
|
-
|
|
8356
|
+
let text, href;
|
|
8357
|
+
if (cap[2] === "@") {
|
|
8358
|
+
text = cap[1];
|
|
8359
|
+
href = "mailto:" + text;
|
|
8360
|
+
} else {
|
|
8361
|
+
text = cap[1];
|
|
8362
|
+
href = text;
|
|
8363
|
+
}
|
|
8863
8364
|
return {
|
|
8864
|
-
type: "
|
|
8365
|
+
type: "link",
|
|
8865
8366
|
raw: cap[0],
|
|
8866
8367
|
text,
|
|
8867
|
-
|
|
8368
|
+
href,
|
|
8369
|
+
tokens: [
|
|
8370
|
+
{
|
|
8371
|
+
type: "text",
|
|
8372
|
+
raw: text,
|
|
8373
|
+
text
|
|
8374
|
+
}
|
|
8375
|
+
]
|
|
8868
8376
|
};
|
|
8869
8377
|
}
|
|
8870
8378
|
}
|
|
8871
|
-
|
|
8872
|
-
|
|
8873
|
-
if (cap) {
|
|
8379
|
+
url(src) {
|
|
8380
|
+
let cap;
|
|
8381
|
+
if (cap = this.rules.inline.url.exec(src)) {
|
|
8382
|
+
let text, href;
|
|
8383
|
+
if (cap[2] === "@") {
|
|
8384
|
+
text = cap[0];
|
|
8385
|
+
href = "mailto:" + text;
|
|
8386
|
+
} else {
|
|
8387
|
+
let prevCapZero;
|
|
8388
|
+
do {
|
|
8389
|
+
prevCapZero = cap[0];
|
|
8390
|
+
cap[0] = this.rules.inline._backpedal.exec(cap[0])?.[0] ?? "";
|
|
8391
|
+
} while (prevCapZero !== cap[0]);
|
|
8392
|
+
text = cap[0];
|
|
8393
|
+
if (cap[1] === "www.") {
|
|
8394
|
+
href = "http://" + cap[0];
|
|
8395
|
+
} else {
|
|
8396
|
+
href = cap[0];
|
|
8397
|
+
}
|
|
8398
|
+
}
|
|
8874
8399
|
return {
|
|
8875
|
-
type: "
|
|
8400
|
+
type: "link",
|
|
8876
8401
|
raw: cap[0],
|
|
8877
|
-
text
|
|
8878
|
-
|
|
8402
|
+
text,
|
|
8403
|
+
href,
|
|
8404
|
+
tokens: [
|
|
8405
|
+
{
|
|
8406
|
+
type: "text",
|
|
8407
|
+
raw: text,
|
|
8408
|
+
text
|
|
8409
|
+
}
|
|
8410
|
+
]
|
|
8879
8411
|
};
|
|
8880
8412
|
}
|
|
8881
8413
|
}
|
|
8882
|
-
|
|
8883
|
-
const cap = this.rules.inline.
|
|
8414
|
+
inlineText(src) {
|
|
8415
|
+
const cap = this.rules.inline.text.exec(src);
|
|
8884
8416
|
if (cap) {
|
|
8417
|
+
const escaped = this.lexer.state.inRawBlock;
|
|
8885
8418
|
return {
|
|
8886
|
-
type: "
|
|
8419
|
+
type: "text",
|
|
8887
8420
|
raw: cap[0],
|
|
8888
|
-
text: cap[
|
|
8421
|
+
text: cap[0],
|
|
8422
|
+
escaped
|
|
8889
8423
|
};
|
|
8890
8424
|
}
|
|
8891
8425
|
}
|
|
8892
|
-
|
|
8893
|
-
|
|
8894
|
-
|
|
8895
|
-
|
|
8896
|
-
|
|
8897
|
-
|
|
8898
|
-
|
|
8426
|
+
};
|
|
8427
|
+
|
|
8428
|
+
// src/Lexer.ts
|
|
8429
|
+
var _Lexer = class __Lexer {
|
|
8430
|
+
tokens;
|
|
8431
|
+
options;
|
|
8432
|
+
state;
|
|
8433
|
+
tokenizer;
|
|
8434
|
+
inlineQueue;
|
|
8435
|
+
constructor(options2) {
|
|
8436
|
+
this.tokens = [];
|
|
8437
|
+
this.tokens.links = /* @__PURE__ */ Object.create(null);
|
|
8438
|
+
this.options = options2 || _defaults;
|
|
8439
|
+
this.options.tokenizer = this.options.tokenizer || new _Tokenizer();
|
|
8440
|
+
this.tokenizer = this.options.tokenizer;
|
|
8441
|
+
this.tokenizer.options = this.options;
|
|
8442
|
+
this.tokenizer.lexer = this;
|
|
8443
|
+
this.inlineQueue = [];
|
|
8444
|
+
this.state = {
|
|
8445
|
+
inLink: false,
|
|
8446
|
+
inRawBlock: false,
|
|
8447
|
+
top: true
|
|
8448
|
+
};
|
|
8449
|
+
const rules = {
|
|
8450
|
+
other,
|
|
8451
|
+
block: block.normal,
|
|
8452
|
+
inline: inline.normal
|
|
8453
|
+
};
|
|
8454
|
+
if (this.options.pedantic) {
|
|
8455
|
+
rules.block = block.pedantic;
|
|
8456
|
+
rules.inline = inline.pedantic;
|
|
8457
|
+
} else if (this.options.gfm) {
|
|
8458
|
+
rules.block = block.gfm;
|
|
8459
|
+
if (this.options.breaks) {
|
|
8460
|
+
rules.inline = inline.breaks;
|
|
8461
|
+
} else {
|
|
8462
|
+
rules.inline = inline.gfm;
|
|
8463
|
+
}
|
|
8464
|
+
}
|
|
8465
|
+
this.tokenizer.rules = rules;
|
|
8466
|
+
}
|
|
8467
|
+
/**
|
|
8468
|
+
* Expose Rules
|
|
8469
|
+
*/
|
|
8470
|
+
static get rules() {
|
|
8471
|
+
return {
|
|
8472
|
+
block,
|
|
8473
|
+
inline
|
|
8474
|
+
};
|
|
8475
|
+
}
|
|
8476
|
+
/**
|
|
8477
|
+
* Static Lex Method
|
|
8478
|
+
*/
|
|
8479
|
+
static lex(src, options2) {
|
|
8480
|
+
const lexer2 = new __Lexer(options2);
|
|
8481
|
+
return lexer2.lex(src);
|
|
8482
|
+
}
|
|
8483
|
+
/**
|
|
8484
|
+
* Static Lex Inline Method
|
|
8485
|
+
*/
|
|
8486
|
+
static lexInline(src, options2) {
|
|
8487
|
+
const lexer2 = new __Lexer(options2);
|
|
8488
|
+
return lexer2.inlineTokens(src);
|
|
8489
|
+
}
|
|
8490
|
+
/**
|
|
8491
|
+
* Preprocessing
|
|
8492
|
+
*/
|
|
8493
|
+
lex(src) {
|
|
8494
|
+
src = src.replace(other.carriageReturn, "\n");
|
|
8495
|
+
this.blockTokens(src, this.tokens);
|
|
8496
|
+
for (let i = 0; i < this.inlineQueue.length; i++) {
|
|
8497
|
+
const next = this.inlineQueue[i];
|
|
8498
|
+
this.inlineTokens(next.src, next.tokens);
|
|
8499
|
+
}
|
|
8500
|
+
this.inlineQueue = [];
|
|
8501
|
+
return this.tokens;
|
|
8502
|
+
}
|
|
8503
|
+
blockTokens(src, tokens = [], lastParagraphClipped = false) {
|
|
8504
|
+
if (this.options.pedantic) {
|
|
8505
|
+
src = src.replace(other.tabCharGlobal, " ").replace(other.spaceLine, "");
|
|
8506
|
+
}
|
|
8507
|
+
while (src) {
|
|
8508
|
+
let token;
|
|
8509
|
+
if (this.options.extensions?.block?.some((extTokenizer) => {
|
|
8510
|
+
if (token = extTokenizer.call({ lexer: this }, src, tokens)) {
|
|
8511
|
+
src = src.substring(token.raw.length);
|
|
8512
|
+
tokens.push(token);
|
|
8513
|
+
return true;
|
|
8514
|
+
}
|
|
8515
|
+
return false;
|
|
8516
|
+
})) {
|
|
8517
|
+
continue;
|
|
8518
|
+
}
|
|
8519
|
+
if (token = this.tokenizer.space(src)) {
|
|
8520
|
+
src = src.substring(token.raw.length);
|
|
8521
|
+
const lastToken = tokens.at(-1);
|
|
8522
|
+
if (token.raw.length === 1 && lastToken !== void 0) {
|
|
8523
|
+
lastToken.raw += "\n";
|
|
8524
|
+
} else {
|
|
8525
|
+
tokens.push(token);
|
|
8526
|
+
}
|
|
8527
|
+
continue;
|
|
8528
|
+
}
|
|
8529
|
+
if (token = this.tokenizer.code(src)) {
|
|
8530
|
+
src = src.substring(token.raw.length);
|
|
8531
|
+
const lastToken = tokens.at(-1);
|
|
8532
|
+
if (lastToken?.type === "paragraph" || lastToken?.type === "text") {
|
|
8533
|
+
lastToken.raw += "\n" + token.raw;
|
|
8534
|
+
lastToken.text += "\n" + token.text;
|
|
8535
|
+
this.inlineQueue.at(-1).src = lastToken.text;
|
|
8536
|
+
} else {
|
|
8537
|
+
tokens.push(token);
|
|
8538
|
+
}
|
|
8539
|
+
continue;
|
|
8540
|
+
}
|
|
8541
|
+
if (token = this.tokenizer.fences(src)) {
|
|
8542
|
+
src = src.substring(token.raw.length);
|
|
8543
|
+
tokens.push(token);
|
|
8544
|
+
continue;
|
|
8545
|
+
}
|
|
8546
|
+
if (token = this.tokenizer.heading(src)) {
|
|
8547
|
+
src = src.substring(token.raw.length);
|
|
8548
|
+
tokens.push(token);
|
|
8549
|
+
continue;
|
|
8550
|
+
}
|
|
8551
|
+
if (token = this.tokenizer.hr(src)) {
|
|
8552
|
+
src = src.substring(token.raw.length);
|
|
8553
|
+
tokens.push(token);
|
|
8554
|
+
continue;
|
|
8555
|
+
}
|
|
8556
|
+
if (token = this.tokenizer.blockquote(src)) {
|
|
8557
|
+
src = src.substring(token.raw.length);
|
|
8558
|
+
tokens.push(token);
|
|
8559
|
+
continue;
|
|
8560
|
+
}
|
|
8561
|
+
if (token = this.tokenizer.list(src)) {
|
|
8562
|
+
src = src.substring(token.raw.length);
|
|
8563
|
+
tokens.push(token);
|
|
8564
|
+
continue;
|
|
8565
|
+
}
|
|
8566
|
+
if (token = this.tokenizer.html(src)) {
|
|
8567
|
+
src = src.substring(token.raw.length);
|
|
8568
|
+
tokens.push(token);
|
|
8569
|
+
continue;
|
|
8570
|
+
}
|
|
8571
|
+
if (token = this.tokenizer.def(src)) {
|
|
8572
|
+
src = src.substring(token.raw.length);
|
|
8573
|
+
const lastToken = tokens.at(-1);
|
|
8574
|
+
if (lastToken?.type === "paragraph" || lastToken?.type === "text") {
|
|
8575
|
+
lastToken.raw += "\n" + token.raw;
|
|
8576
|
+
lastToken.text += "\n" + token.raw;
|
|
8577
|
+
this.inlineQueue.at(-1).src = lastToken.text;
|
|
8578
|
+
} else if (!this.tokens.links[token.tag]) {
|
|
8579
|
+
this.tokens.links[token.tag] = {
|
|
8580
|
+
href: token.href,
|
|
8581
|
+
title: token.title
|
|
8582
|
+
};
|
|
8583
|
+
}
|
|
8584
|
+
continue;
|
|
8899
8585
|
}
|
|
8900
|
-
if (
|
|
8901
|
-
|
|
8902
|
-
|
|
8903
|
-
|
|
8586
|
+
if (token = this.tokenizer.table(src)) {
|
|
8587
|
+
src = src.substring(token.raw.length);
|
|
8588
|
+
tokens.push(token);
|
|
8589
|
+
continue;
|
|
8904
8590
|
}
|
|
8905
|
-
|
|
8906
|
-
|
|
8907
|
-
|
|
8908
|
-
|
|
8909
|
-
|
|
8910
|
-
|
|
8911
|
-
|
|
8912
|
-
|
|
8913
|
-
|
|
8914
|
-
|
|
8915
|
-
|
|
8916
|
-
|
|
8917
|
-
|
|
8918
|
-
|
|
8919
|
-
|
|
8920
|
-
|
|
8921
|
-
|
|
8922
|
-
|
|
8923
|
-
const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), "\\");
|
|
8924
|
-
if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {
|
|
8925
|
-
return;
|
|
8926
|
-
}
|
|
8927
|
-
} else {
|
|
8928
|
-
const lastParenIndex = findClosingBracket(cap[2], "()");
|
|
8929
|
-
if (lastParenIndex === -2) {
|
|
8930
|
-
return;
|
|
8591
|
+
if (token = this.tokenizer.lheading(src)) {
|
|
8592
|
+
src = src.substring(token.raw.length);
|
|
8593
|
+
tokens.push(token);
|
|
8594
|
+
continue;
|
|
8595
|
+
}
|
|
8596
|
+
let cutSrc = src;
|
|
8597
|
+
if (this.options.extensions?.startBlock) {
|
|
8598
|
+
let startIndex = Infinity;
|
|
8599
|
+
const tempSrc = src.slice(1);
|
|
8600
|
+
let tempStart;
|
|
8601
|
+
this.options.extensions.startBlock.forEach((getStartIndex) => {
|
|
8602
|
+
tempStart = getStartIndex.call({ lexer: this }, tempSrc);
|
|
8603
|
+
if (typeof tempStart === "number" && tempStart >= 0) {
|
|
8604
|
+
startIndex = Math.min(startIndex, tempStart);
|
|
8605
|
+
}
|
|
8606
|
+
});
|
|
8607
|
+
if (startIndex < Infinity && startIndex >= 0) {
|
|
8608
|
+
cutSrc = src.substring(0, startIndex + 1);
|
|
8931
8609
|
}
|
|
8932
|
-
|
|
8933
|
-
|
|
8934
|
-
|
|
8935
|
-
|
|
8936
|
-
|
|
8937
|
-
|
|
8610
|
+
}
|
|
8611
|
+
if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {
|
|
8612
|
+
const lastToken = tokens.at(-1);
|
|
8613
|
+
if (lastParagraphClipped && lastToken?.type === "paragraph") {
|
|
8614
|
+
lastToken.raw += "\n" + token.raw;
|
|
8615
|
+
lastToken.text += "\n" + token.text;
|
|
8616
|
+
this.inlineQueue.pop();
|
|
8617
|
+
this.inlineQueue.at(-1).src = lastToken.text;
|
|
8618
|
+
} else {
|
|
8619
|
+
tokens.push(token);
|
|
8938
8620
|
}
|
|
8621
|
+
lastParagraphClipped = cutSrc.length !== src.length;
|
|
8622
|
+
src = src.substring(token.raw.length);
|
|
8623
|
+
continue;
|
|
8939
8624
|
}
|
|
8940
|
-
|
|
8941
|
-
|
|
8942
|
-
|
|
8943
|
-
|
|
8944
|
-
|
|
8945
|
-
|
|
8946
|
-
|
|
8625
|
+
if (token = this.tokenizer.text(src)) {
|
|
8626
|
+
src = src.substring(token.raw.length);
|
|
8627
|
+
const lastToken = tokens.at(-1);
|
|
8628
|
+
if (lastToken?.type === "text") {
|
|
8629
|
+
lastToken.raw += "\n" + token.raw;
|
|
8630
|
+
lastToken.text += "\n" + token.text;
|
|
8631
|
+
this.inlineQueue.pop();
|
|
8632
|
+
this.inlineQueue.at(-1).src = lastToken.text;
|
|
8633
|
+
} else {
|
|
8634
|
+
tokens.push(token);
|
|
8947
8635
|
}
|
|
8948
|
-
|
|
8949
|
-
title = cap[3] ? cap[3].slice(1, -1) : "";
|
|
8636
|
+
continue;
|
|
8950
8637
|
}
|
|
8951
|
-
|
|
8952
|
-
|
|
8953
|
-
if (this.options.
|
|
8954
|
-
|
|
8638
|
+
if (src) {
|
|
8639
|
+
const errMsg = "Infinite loop on byte: " + src.charCodeAt(0);
|
|
8640
|
+
if (this.options.silent) {
|
|
8641
|
+
console.error(errMsg);
|
|
8642
|
+
break;
|
|
8955
8643
|
} else {
|
|
8956
|
-
|
|
8644
|
+
throw new Error(errMsg);
|
|
8957
8645
|
}
|
|
8958
8646
|
}
|
|
8959
|
-
return outputLink(cap, {
|
|
8960
|
-
href: href ? href.replace(this.rules.inline.anyPunctuation, "$1") : href,
|
|
8961
|
-
title: title ? title.replace(this.rules.inline.anyPunctuation, "$1") : title
|
|
8962
|
-
}, cap[0], this.lexer, this.rules);
|
|
8963
8647
|
}
|
|
8648
|
+
this.state.top = true;
|
|
8649
|
+
return tokens;
|
|
8964
8650
|
}
|
|
8965
|
-
|
|
8966
|
-
|
|
8967
|
-
|
|
8968
|
-
|
|
8969
|
-
|
|
8970
|
-
|
|
8971
|
-
|
|
8972
|
-
|
|
8973
|
-
|
|
8974
|
-
|
|
8975
|
-
|
|
8976
|
-
|
|
8651
|
+
inline(src, tokens = []) {
|
|
8652
|
+
this.inlineQueue.push({ src, tokens });
|
|
8653
|
+
return tokens;
|
|
8654
|
+
}
|
|
8655
|
+
/**
|
|
8656
|
+
* Lexing/Compiling
|
|
8657
|
+
*/
|
|
8658
|
+
inlineTokens(src, tokens = []) {
|
|
8659
|
+
let maskedSrc = src;
|
|
8660
|
+
let match = null;
|
|
8661
|
+
if (this.tokens.links) {
|
|
8662
|
+
const links = Object.keys(this.tokens.links);
|
|
8663
|
+
if (links.length > 0) {
|
|
8664
|
+
while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {
|
|
8665
|
+
if (links.includes(match[0].slice(match[0].lastIndexOf("[") + 1, -1))) {
|
|
8666
|
+
maskedSrc = maskedSrc.slice(0, match.index) + "[" + "a".repeat(match[0].length - 2) + "]" + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);
|
|
8667
|
+
}
|
|
8668
|
+
}
|
|
8977
8669
|
}
|
|
8978
|
-
return outputLink(cap, link2, cap[0], this.lexer, this.rules);
|
|
8979
8670
|
}
|
|
8980
|
-
|
|
8981
|
-
|
|
8982
|
-
|
|
8983
|
-
|
|
8984
|
-
|
|
8985
|
-
|
|
8986
|
-
|
|
8987
|
-
|
|
8988
|
-
|
|
8989
|
-
|
|
8990
|
-
|
|
8991
|
-
|
|
8992
|
-
|
|
8993
|
-
|
|
8994
|
-
|
|
8995
|
-
|
|
8996
|
-
|
|
8997
|
-
|
|
8998
|
-
|
|
8999
|
-
}
|
|
9000
|
-
|
|
9001
|
-
|
|
9002
|
-
|
|
8671
|
+
while ((match = this.tokenizer.rules.inline.anyPunctuation.exec(maskedSrc)) != null) {
|
|
8672
|
+
maskedSrc = maskedSrc.slice(0, match.index) + "++" + maskedSrc.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
|
|
8673
|
+
}
|
|
8674
|
+
while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {
|
|
8675
|
+
maskedSrc = maskedSrc.slice(0, match.index) + "[" + "a".repeat(match[0].length - 2) + "]" + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
|
|
8676
|
+
}
|
|
8677
|
+
let keepPrevChar = false;
|
|
8678
|
+
let prevChar = "";
|
|
8679
|
+
while (src) {
|
|
8680
|
+
if (!keepPrevChar) {
|
|
8681
|
+
prevChar = "";
|
|
8682
|
+
}
|
|
8683
|
+
keepPrevChar = false;
|
|
8684
|
+
let token;
|
|
8685
|
+
if (this.options.extensions?.inline?.some((extTokenizer) => {
|
|
8686
|
+
if (token = extTokenizer.call({ lexer: this }, src, tokens)) {
|
|
8687
|
+
src = src.substring(token.raw.length);
|
|
8688
|
+
tokens.push(token);
|
|
8689
|
+
return true;
|
|
8690
|
+
}
|
|
8691
|
+
return false;
|
|
8692
|
+
})) {
|
|
8693
|
+
continue;
|
|
8694
|
+
}
|
|
8695
|
+
if (token = this.tokenizer.escape(src)) {
|
|
8696
|
+
src = src.substring(token.raw.length);
|
|
8697
|
+
tokens.push(token);
|
|
8698
|
+
continue;
|
|
8699
|
+
}
|
|
8700
|
+
if (token = this.tokenizer.tag(src)) {
|
|
8701
|
+
src = src.substring(token.raw.length);
|
|
8702
|
+
tokens.push(token);
|
|
8703
|
+
continue;
|
|
8704
|
+
}
|
|
8705
|
+
if (token = this.tokenizer.link(src)) {
|
|
8706
|
+
src = src.substring(token.raw.length);
|
|
8707
|
+
tokens.push(token);
|
|
8708
|
+
continue;
|
|
8709
|
+
}
|
|
8710
|
+
if (token = this.tokenizer.reflink(src, this.tokens.links)) {
|
|
8711
|
+
src = src.substring(token.raw.length);
|
|
8712
|
+
const lastToken = tokens.at(-1);
|
|
8713
|
+
if (token.type === "text" && lastToken?.type === "text") {
|
|
8714
|
+
lastToken.raw += token.raw;
|
|
8715
|
+
lastToken.text += token.text;
|
|
8716
|
+
} else {
|
|
8717
|
+
tokens.push(token);
|
|
8718
|
+
}
|
|
8719
|
+
continue;
|
|
8720
|
+
}
|
|
8721
|
+
if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {
|
|
8722
|
+
src = src.substring(token.raw.length);
|
|
8723
|
+
tokens.push(token);
|
|
8724
|
+
continue;
|
|
8725
|
+
}
|
|
8726
|
+
if (token = this.tokenizer.codespan(src)) {
|
|
8727
|
+
src = src.substring(token.raw.length);
|
|
8728
|
+
tokens.push(token);
|
|
8729
|
+
continue;
|
|
8730
|
+
}
|
|
8731
|
+
if (token = this.tokenizer.br(src)) {
|
|
8732
|
+
src = src.substring(token.raw.length);
|
|
8733
|
+
tokens.push(token);
|
|
8734
|
+
continue;
|
|
8735
|
+
}
|
|
8736
|
+
if (token = this.tokenizer.del(src)) {
|
|
8737
|
+
src = src.substring(token.raw.length);
|
|
8738
|
+
tokens.push(token);
|
|
8739
|
+
continue;
|
|
8740
|
+
}
|
|
8741
|
+
if (token = this.tokenizer.autolink(src)) {
|
|
8742
|
+
src = src.substring(token.raw.length);
|
|
8743
|
+
tokens.push(token);
|
|
8744
|
+
continue;
|
|
8745
|
+
}
|
|
8746
|
+
if (!this.state.inLink && (token = this.tokenizer.url(src))) {
|
|
8747
|
+
src = src.substring(token.raw.length);
|
|
8748
|
+
tokens.push(token);
|
|
8749
|
+
continue;
|
|
8750
|
+
}
|
|
8751
|
+
let cutSrc = src;
|
|
8752
|
+
if (this.options.extensions?.startInline) {
|
|
8753
|
+
let startIndex = Infinity;
|
|
8754
|
+
const tempSrc = src.slice(1);
|
|
8755
|
+
let tempStart;
|
|
8756
|
+
this.options.extensions.startInline.forEach((getStartIndex) => {
|
|
8757
|
+
tempStart = getStartIndex.call({ lexer: this }, tempSrc);
|
|
8758
|
+
if (typeof tempStart === "number" && tempStart >= 0) {
|
|
8759
|
+
startIndex = Math.min(startIndex, tempStart);
|
|
9003
8760
|
}
|
|
8761
|
+
});
|
|
8762
|
+
if (startIndex < Infinity && startIndex >= 0) {
|
|
8763
|
+
cutSrc = src.substring(0, startIndex + 1);
|
|
8764
|
+
}
|
|
8765
|
+
}
|
|
8766
|
+
if (token = this.tokenizer.inlineText(cutSrc)) {
|
|
8767
|
+
src = src.substring(token.raw.length);
|
|
8768
|
+
if (token.raw.slice(-1) !== "_") {
|
|
8769
|
+
prevChar = token.raw.slice(-1);
|
|
9004
8770
|
}
|
|
9005
|
-
|
|
9006
|
-
|
|
9007
|
-
|
|
9008
|
-
|
|
9009
|
-
|
|
9010
|
-
|
|
9011
|
-
|
|
9012
|
-
return {
|
|
9013
|
-
type: "em",
|
|
9014
|
-
raw,
|
|
9015
|
-
text: text2,
|
|
9016
|
-
tokens: this.lexer.inlineTokens(text2)
|
|
9017
|
-
};
|
|
8771
|
+
keepPrevChar = true;
|
|
8772
|
+
const lastToken = tokens.at(-1);
|
|
8773
|
+
if (lastToken?.type === "text") {
|
|
8774
|
+
lastToken.raw += token.raw;
|
|
8775
|
+
lastToken.text += token.text;
|
|
8776
|
+
} else {
|
|
8777
|
+
tokens.push(token);
|
|
9018
8778
|
}
|
|
9019
|
-
|
|
9020
|
-
return {
|
|
9021
|
-
type: "strong",
|
|
9022
|
-
raw,
|
|
9023
|
-
text,
|
|
9024
|
-
tokens: this.lexer.inlineTokens(text)
|
|
9025
|
-
};
|
|
8779
|
+
continue;
|
|
9026
8780
|
}
|
|
9027
|
-
|
|
9028
|
-
|
|
9029
|
-
|
|
9030
|
-
|
|
9031
|
-
|
|
9032
|
-
|
|
9033
|
-
|
|
9034
|
-
|
|
9035
|
-
if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {
|
|
9036
|
-
text = text.substring(1, text.length - 1);
|
|
8781
|
+
if (src) {
|
|
8782
|
+
const errMsg = "Infinite loop on byte: " + src.charCodeAt(0);
|
|
8783
|
+
if (this.options.silent) {
|
|
8784
|
+
console.error(errMsg);
|
|
8785
|
+
break;
|
|
8786
|
+
} else {
|
|
8787
|
+
throw new Error(errMsg);
|
|
8788
|
+
}
|
|
9037
8789
|
}
|
|
9038
|
-
return {
|
|
9039
|
-
type: "codespan",
|
|
9040
|
-
raw: cap[0],
|
|
9041
|
-
text
|
|
9042
|
-
};
|
|
9043
8790
|
}
|
|
8791
|
+
return tokens;
|
|
9044
8792
|
}
|
|
9045
|
-
|
|
9046
|
-
|
|
9047
|
-
|
|
9048
|
-
|
|
9049
|
-
|
|
9050
|
-
|
|
9051
|
-
|
|
8793
|
+
};
|
|
8794
|
+
|
|
8795
|
+
// src/Renderer.ts
|
|
8796
|
+
var _Renderer = class {
|
|
8797
|
+
options;
|
|
8798
|
+
parser;
|
|
8799
|
+
// set by the parser
|
|
8800
|
+
constructor(options2) {
|
|
8801
|
+
this.options = options2 || _defaults;
|
|
8802
|
+
}
|
|
8803
|
+
space(token) {
|
|
8804
|
+
return "";
|
|
8805
|
+
}
|
|
8806
|
+
code({ text, lang, escaped }) {
|
|
8807
|
+
const langString = (lang || "").match(other.notSpaceStart)?.[0];
|
|
8808
|
+
const code = text.replace(other.endingNewline, "") + "\n";
|
|
8809
|
+
if (!langString) {
|
|
8810
|
+
return "<pre><code>" + (escaped ? code : escape2(code, true)) + "</code></pre>\n";
|
|
9052
8811
|
}
|
|
8812
|
+
return '<pre><code class="language-' + escape2(langString) + '">' + (escaped ? code : escape2(code, true)) + "</code></pre>\n";
|
|
9053
8813
|
}
|
|
9054
|
-
|
|
9055
|
-
const
|
|
9056
|
-
|
|
9057
|
-
|
|
9058
|
-
|
|
9059
|
-
|
|
9060
|
-
|
|
9061
|
-
|
|
9062
|
-
|
|
8814
|
+
blockquote({ tokens }) {
|
|
8815
|
+
const body = this.parser.parse(tokens);
|
|
8816
|
+
return `<blockquote>
|
|
8817
|
+
${body}</blockquote>
|
|
8818
|
+
`;
|
|
8819
|
+
}
|
|
8820
|
+
html({ text }) {
|
|
8821
|
+
return text;
|
|
8822
|
+
}
|
|
8823
|
+
heading({ tokens, depth }) {
|
|
8824
|
+
return `<h${depth}>${this.parser.parseInline(tokens)}</h${depth}>
|
|
8825
|
+
`;
|
|
8826
|
+
}
|
|
8827
|
+
hr(token) {
|
|
8828
|
+
return "<hr>\n";
|
|
8829
|
+
}
|
|
8830
|
+
list(token) {
|
|
8831
|
+
const ordered = token.ordered;
|
|
8832
|
+
const start = token.start;
|
|
8833
|
+
let body = "";
|
|
8834
|
+
for (let j = 0; j < token.items.length; j++) {
|
|
8835
|
+
const item = token.items[j];
|
|
8836
|
+
body += this.listitem(item);
|
|
9063
8837
|
}
|
|
8838
|
+
const type = ordered ? "ol" : "ul";
|
|
8839
|
+
const startAttr = ordered && start !== 1 ? ' start="' + start + '"' : "";
|
|
8840
|
+
return "<" + type + startAttr + ">\n" + body + "</" + type + ">\n";
|
|
9064
8841
|
}
|
|
9065
|
-
|
|
9066
|
-
|
|
9067
|
-
if (
|
|
9068
|
-
|
|
9069
|
-
if (
|
|
9070
|
-
|
|
9071
|
-
|
|
8842
|
+
listitem(item) {
|
|
8843
|
+
let itemBody = "";
|
|
8844
|
+
if (item.task) {
|
|
8845
|
+
const checkbox = this.checkbox({ checked: !!item.checked });
|
|
8846
|
+
if (item.loose) {
|
|
8847
|
+
if (item.tokens[0]?.type === "paragraph") {
|
|
8848
|
+
item.tokens[0].text = checkbox + " " + item.tokens[0].text;
|
|
8849
|
+
if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === "text") {
|
|
8850
|
+
item.tokens[0].tokens[0].text = checkbox + " " + escape2(item.tokens[0].tokens[0].text);
|
|
8851
|
+
item.tokens[0].tokens[0].escaped = true;
|
|
8852
|
+
}
|
|
8853
|
+
} else {
|
|
8854
|
+
item.tokens.unshift({
|
|
8855
|
+
type: "text",
|
|
8856
|
+
raw: checkbox + " ",
|
|
8857
|
+
text: checkbox + " ",
|
|
8858
|
+
escaped: true
|
|
8859
|
+
});
|
|
8860
|
+
}
|
|
9072
8861
|
} else {
|
|
9073
|
-
|
|
9074
|
-
href = text;
|
|
8862
|
+
itemBody += checkbox + " ";
|
|
9075
8863
|
}
|
|
9076
|
-
return {
|
|
9077
|
-
type: "link",
|
|
9078
|
-
raw: cap[0],
|
|
9079
|
-
text,
|
|
9080
|
-
href,
|
|
9081
|
-
tokens: [
|
|
9082
|
-
{
|
|
9083
|
-
type: "text",
|
|
9084
|
-
raw: text,
|
|
9085
|
-
text
|
|
9086
|
-
}
|
|
9087
|
-
]
|
|
9088
|
-
};
|
|
9089
8864
|
}
|
|
8865
|
+
itemBody += this.parser.parse(item.tokens, !!item.loose);
|
|
8866
|
+
return `<li>${itemBody}</li>
|
|
8867
|
+
`;
|
|
9090
8868
|
}
|
|
9091
|
-
|
|
9092
|
-
|
|
9093
|
-
|
|
9094
|
-
|
|
9095
|
-
|
|
9096
|
-
|
|
9097
|
-
|
|
9098
|
-
|
|
9099
|
-
|
|
9100
|
-
|
|
9101
|
-
|
|
9102
|
-
|
|
9103
|
-
|
|
9104
|
-
|
|
9105
|
-
|
|
9106
|
-
|
|
9107
|
-
|
|
9108
|
-
|
|
9109
|
-
|
|
8869
|
+
checkbox({ checked }) {
|
|
8870
|
+
return "<input " + (checked ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
|
|
8871
|
+
}
|
|
8872
|
+
paragraph({ tokens }) {
|
|
8873
|
+
return `<p>${this.parser.parseInline(tokens)}</p>
|
|
8874
|
+
`;
|
|
8875
|
+
}
|
|
8876
|
+
table(token) {
|
|
8877
|
+
let header = "";
|
|
8878
|
+
let cell = "";
|
|
8879
|
+
for (let j = 0; j < token.header.length; j++) {
|
|
8880
|
+
cell += this.tablecell(token.header[j]);
|
|
8881
|
+
}
|
|
8882
|
+
header += this.tablerow({ text: cell });
|
|
8883
|
+
let body = "";
|
|
8884
|
+
for (let j = 0; j < token.rows.length; j++) {
|
|
8885
|
+
const row = token.rows[j];
|
|
8886
|
+
cell = "";
|
|
8887
|
+
for (let k = 0; k < row.length; k++) {
|
|
8888
|
+
cell += this.tablecell(row[k]);
|
|
9110
8889
|
}
|
|
9111
|
-
|
|
9112
|
-
|
|
9113
|
-
|
|
9114
|
-
|
|
9115
|
-
|
|
9116
|
-
|
|
9117
|
-
|
|
9118
|
-
|
|
9119
|
-
|
|
9120
|
-
|
|
9121
|
-
|
|
9122
|
-
|
|
9123
|
-
|
|
8890
|
+
body += this.tablerow({ text: cell });
|
|
8891
|
+
}
|
|
8892
|
+
if (body) body = `<tbody>${body}</tbody>`;
|
|
8893
|
+
return "<table>\n<thead>\n" + header + "</thead>\n" + body + "</table>\n";
|
|
8894
|
+
}
|
|
8895
|
+
tablerow({ text }) {
|
|
8896
|
+
return `<tr>
|
|
8897
|
+
${text}</tr>
|
|
8898
|
+
`;
|
|
8899
|
+
}
|
|
8900
|
+
tablecell(token) {
|
|
8901
|
+
const content = this.parser.parseInline(token.tokens);
|
|
8902
|
+
const type = token.header ? "th" : "td";
|
|
8903
|
+
const tag2 = token.align ? `<${type} align="${token.align}">` : `<${type}>`;
|
|
8904
|
+
return tag2 + content + `</${type}>
|
|
8905
|
+
`;
|
|
8906
|
+
}
|
|
8907
|
+
/**
|
|
8908
|
+
* span level renderer
|
|
8909
|
+
*/
|
|
8910
|
+
strong({ tokens }) {
|
|
8911
|
+
return `<strong>${this.parser.parseInline(tokens)}</strong>`;
|
|
8912
|
+
}
|
|
8913
|
+
em({ tokens }) {
|
|
8914
|
+
return `<em>${this.parser.parseInline(tokens)}</em>`;
|
|
8915
|
+
}
|
|
8916
|
+
codespan({ text }) {
|
|
8917
|
+
return `<code>${escape2(text, true)}</code>`;
|
|
8918
|
+
}
|
|
8919
|
+
br(token) {
|
|
8920
|
+
return "<br>";
|
|
8921
|
+
}
|
|
8922
|
+
del({ tokens }) {
|
|
8923
|
+
return `<del>${this.parser.parseInline(tokens)}</del>`;
|
|
8924
|
+
}
|
|
8925
|
+
link({ href, title, tokens }) {
|
|
8926
|
+
const text = this.parser.parseInline(tokens);
|
|
8927
|
+
const cleanHref = cleanUrl(href);
|
|
8928
|
+
if (cleanHref === null) {
|
|
8929
|
+
return text;
|
|
8930
|
+
}
|
|
8931
|
+
href = cleanHref;
|
|
8932
|
+
let out = '<a href="' + href + '"';
|
|
8933
|
+
if (title) {
|
|
8934
|
+
out += ' title="' + escape2(title) + '"';
|
|
9124
8935
|
}
|
|
8936
|
+
out += ">" + text + "</a>";
|
|
8937
|
+
return out;
|
|
9125
8938
|
}
|
|
9126
|
-
|
|
9127
|
-
|
|
9128
|
-
|
|
9129
|
-
|
|
9130
|
-
|
|
9131
|
-
|
|
9132
|
-
|
|
9133
|
-
|
|
9134
|
-
|
|
9135
|
-
|
|
8939
|
+
image({ href, title, text, tokens }) {
|
|
8940
|
+
if (tokens) {
|
|
8941
|
+
text = this.parser.parseInline(tokens, this.parser.textRenderer);
|
|
8942
|
+
}
|
|
8943
|
+
const cleanHref = cleanUrl(href);
|
|
8944
|
+
if (cleanHref === null) {
|
|
8945
|
+
return escape2(text);
|
|
8946
|
+
}
|
|
8947
|
+
href = cleanHref;
|
|
8948
|
+
let out = `<img src="${href}" alt="${text}"`;
|
|
8949
|
+
if (title) {
|
|
8950
|
+
out += ` title="${escape2(title)}"`;
|
|
9136
8951
|
}
|
|
8952
|
+
out += ">";
|
|
8953
|
+
return out;
|
|
8954
|
+
}
|
|
8955
|
+
text(token) {
|
|
8956
|
+
return "tokens" in token && token.tokens ? this.parser.parseInline(token.tokens) : "escaped" in token && token.escaped ? token.text : escape2(token.text);
|
|
9137
8957
|
}
|
|
9138
8958
|
};
|
|
9139
8959
|
|
|
9140
|
-
// src/
|
|
9141
|
-
var
|
|
9142
|
-
|
|
8960
|
+
// src/TextRenderer.ts
|
|
8961
|
+
var _TextRenderer = class {
|
|
8962
|
+
// no need for block level renderers
|
|
8963
|
+
strong({ text }) {
|
|
8964
|
+
return text;
|
|
8965
|
+
}
|
|
8966
|
+
em({ text }) {
|
|
8967
|
+
return text;
|
|
8968
|
+
}
|
|
8969
|
+
codespan({ text }) {
|
|
8970
|
+
return text;
|
|
8971
|
+
}
|
|
8972
|
+
del({ text }) {
|
|
8973
|
+
return text;
|
|
8974
|
+
}
|
|
8975
|
+
html({ text }) {
|
|
8976
|
+
return text;
|
|
8977
|
+
}
|
|
8978
|
+
text({ text }) {
|
|
8979
|
+
return text;
|
|
8980
|
+
}
|
|
8981
|
+
link({ text }) {
|
|
8982
|
+
return "" + text;
|
|
8983
|
+
}
|
|
8984
|
+
image({ text }) {
|
|
8985
|
+
return "" + text;
|
|
8986
|
+
}
|
|
8987
|
+
br() {
|
|
8988
|
+
return "";
|
|
8989
|
+
}
|
|
8990
|
+
};
|
|
8991
|
+
|
|
8992
|
+
// src/Parser.ts
|
|
8993
|
+
var _Parser = class __Parser {
|
|
9143
8994
|
options;
|
|
9144
|
-
|
|
9145
|
-
|
|
9146
|
-
inlineQueue;
|
|
8995
|
+
renderer;
|
|
8996
|
+
textRenderer;
|
|
9147
8997
|
constructor(options2) {
|
|
9148
|
-
this.tokens = [];
|
|
9149
|
-
this.tokens.links = /* @__PURE__ */ Object.create(null);
|
|
9150
8998
|
this.options = options2 || _defaults;
|
|
9151
|
-
this.options.
|
|
9152
|
-
this.
|
|
9153
|
-
this.
|
|
9154
|
-
this.
|
|
9155
|
-
this.
|
|
9156
|
-
this.state = {
|
|
9157
|
-
inLink: false,
|
|
9158
|
-
inRawBlock: false,
|
|
9159
|
-
top: true
|
|
9160
|
-
};
|
|
9161
|
-
const rules = {
|
|
9162
|
-
other,
|
|
9163
|
-
block: block.normal,
|
|
9164
|
-
inline: inline.normal
|
|
9165
|
-
};
|
|
9166
|
-
if (this.options.pedantic) {
|
|
9167
|
-
rules.block = block.pedantic;
|
|
9168
|
-
rules.inline = inline.pedantic;
|
|
9169
|
-
} else if (this.options.gfm) {
|
|
9170
|
-
rules.block = block.gfm;
|
|
9171
|
-
if (this.options.breaks) {
|
|
9172
|
-
rules.inline = inline.breaks;
|
|
9173
|
-
} else {
|
|
9174
|
-
rules.inline = inline.gfm;
|
|
9175
|
-
}
|
|
9176
|
-
}
|
|
9177
|
-
this.tokenizer.rules = rules;
|
|
9178
|
-
}
|
|
9179
|
-
/**
|
|
9180
|
-
* Expose Rules
|
|
9181
|
-
*/
|
|
9182
|
-
static get rules() {
|
|
9183
|
-
return {
|
|
9184
|
-
block,
|
|
9185
|
-
inline
|
|
9186
|
-
};
|
|
8999
|
+
this.options.renderer = this.options.renderer || new _Renderer();
|
|
9000
|
+
this.renderer = this.options.renderer;
|
|
9001
|
+
this.renderer.options = this.options;
|
|
9002
|
+
this.renderer.parser = this;
|
|
9003
|
+
this.textRenderer = new _TextRenderer();
|
|
9187
9004
|
}
|
|
9188
9005
|
/**
|
|
9189
|
-
* Static
|
|
9006
|
+
* Static Parse Method
|
|
9190
9007
|
*/
|
|
9191
|
-
static
|
|
9192
|
-
const
|
|
9193
|
-
return
|
|
9008
|
+
static parse(tokens, options2) {
|
|
9009
|
+
const parser2 = new __Parser(options2);
|
|
9010
|
+
return parser2.parse(tokens);
|
|
9194
9011
|
}
|
|
9195
9012
|
/**
|
|
9196
|
-
* Static
|
|
9013
|
+
* Static Parse Inline Method
|
|
9197
9014
|
*/
|
|
9198
|
-
static
|
|
9199
|
-
const
|
|
9200
|
-
return
|
|
9015
|
+
static parseInline(tokens, options2) {
|
|
9016
|
+
const parser2 = new __Parser(options2);
|
|
9017
|
+
return parser2.parseInline(tokens);
|
|
9201
9018
|
}
|
|
9202
9019
|
/**
|
|
9203
|
-
*
|
|
9020
|
+
* Parse Loop
|
|
9204
9021
|
*/
|
|
9205
|
-
|
|
9206
|
-
|
|
9207
|
-
|
|
9208
|
-
|
|
9209
|
-
|
|
9210
|
-
|
|
9211
|
-
|
|
9212
|
-
|
|
9213
|
-
|
|
9214
|
-
|
|
9215
|
-
blockTokens(src, tokens = [], lastParagraphClipped = false) {
|
|
9216
|
-
if (this.options.pedantic) {
|
|
9217
|
-
src = src.replace(other.tabCharGlobal, " ").replace(other.spaceLine, "");
|
|
9218
|
-
}
|
|
9219
|
-
while (src) {
|
|
9220
|
-
let token;
|
|
9221
|
-
if (this.options.extensions?.block?.some((extTokenizer) => {
|
|
9222
|
-
if (token = extTokenizer.call({ lexer: this }, src, tokens)) {
|
|
9223
|
-
src = src.substring(token.raw.length);
|
|
9224
|
-
tokens.push(token);
|
|
9225
|
-
return true;
|
|
9022
|
+
parse(tokens, top = true) {
|
|
9023
|
+
let out = "";
|
|
9024
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
9025
|
+
const anyToken = tokens[i];
|
|
9026
|
+
if (this.options.extensions?.renderers?.[anyToken.type]) {
|
|
9027
|
+
const genericToken = anyToken;
|
|
9028
|
+
const ret = this.options.extensions.renderers[genericToken.type].call({ parser: this }, genericToken);
|
|
9029
|
+
if (ret !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(genericToken.type)) {
|
|
9030
|
+
out += ret || "";
|
|
9031
|
+
continue;
|
|
9226
9032
|
}
|
|
9227
|
-
return false;
|
|
9228
|
-
})) {
|
|
9229
|
-
continue;
|
|
9230
9033
|
}
|
|
9231
|
-
|
|
9232
|
-
|
|
9233
|
-
|
|
9234
|
-
|
|
9235
|
-
|
|
9236
|
-
} else {
|
|
9237
|
-
tokens.push(token);
|
|
9034
|
+
const token = anyToken;
|
|
9035
|
+
switch (token.type) {
|
|
9036
|
+
case "space": {
|
|
9037
|
+
out += this.renderer.space(token);
|
|
9038
|
+
continue;
|
|
9238
9039
|
}
|
|
9239
|
-
|
|
9240
|
-
|
|
9241
|
-
|
|
9242
|
-
src = src.substring(token.raw.length);
|
|
9243
|
-
const lastToken = tokens.at(-1);
|
|
9244
|
-
if (lastToken?.type === "paragraph" || lastToken?.type === "text") {
|
|
9245
|
-
lastToken.raw += "\n" + token.raw;
|
|
9246
|
-
lastToken.text += "\n" + token.text;
|
|
9247
|
-
this.inlineQueue.at(-1).src = lastToken.text;
|
|
9248
|
-
} else {
|
|
9249
|
-
tokens.push(token);
|
|
9040
|
+
case "hr": {
|
|
9041
|
+
out += this.renderer.hr(token);
|
|
9042
|
+
continue;
|
|
9250
9043
|
}
|
|
9251
|
-
|
|
9252
|
-
|
|
9253
|
-
|
|
9254
|
-
|
|
9255
|
-
|
|
9256
|
-
|
|
9257
|
-
|
|
9258
|
-
|
|
9259
|
-
|
|
9260
|
-
|
|
9261
|
-
|
|
9262
|
-
|
|
9263
|
-
|
|
9264
|
-
|
|
9265
|
-
|
|
9266
|
-
|
|
9267
|
-
|
|
9268
|
-
|
|
9269
|
-
|
|
9270
|
-
tokens.push(token);
|
|
9271
|
-
continue;
|
|
9272
|
-
}
|
|
9273
|
-
if (token = this.tokenizer.list(src)) {
|
|
9274
|
-
src = src.substring(token.raw.length);
|
|
9275
|
-
tokens.push(token);
|
|
9276
|
-
continue;
|
|
9277
|
-
}
|
|
9278
|
-
if (token = this.tokenizer.html(src)) {
|
|
9279
|
-
src = src.substring(token.raw.length);
|
|
9280
|
-
tokens.push(token);
|
|
9281
|
-
continue;
|
|
9282
|
-
}
|
|
9283
|
-
if (token = this.tokenizer.def(src)) {
|
|
9284
|
-
src = src.substring(token.raw.length);
|
|
9285
|
-
const lastToken = tokens.at(-1);
|
|
9286
|
-
if (lastToken?.type === "paragraph" || lastToken?.type === "text") {
|
|
9287
|
-
lastToken.raw += "\n" + token.raw;
|
|
9288
|
-
lastToken.text += "\n" + token.raw;
|
|
9289
|
-
this.inlineQueue.at(-1).src = lastToken.text;
|
|
9290
|
-
} else if (!this.tokens.links[token.tag]) {
|
|
9291
|
-
this.tokens.links[token.tag] = {
|
|
9292
|
-
href: token.href,
|
|
9293
|
-
title: token.title
|
|
9294
|
-
};
|
|
9044
|
+
case "heading": {
|
|
9045
|
+
out += this.renderer.heading(token);
|
|
9046
|
+
continue;
|
|
9047
|
+
}
|
|
9048
|
+
case "code": {
|
|
9049
|
+
out += this.renderer.code(token);
|
|
9050
|
+
continue;
|
|
9051
|
+
}
|
|
9052
|
+
case "table": {
|
|
9053
|
+
out += this.renderer.table(token);
|
|
9054
|
+
continue;
|
|
9055
|
+
}
|
|
9056
|
+
case "blockquote": {
|
|
9057
|
+
out += this.renderer.blockquote(token);
|
|
9058
|
+
continue;
|
|
9059
|
+
}
|
|
9060
|
+
case "list": {
|
|
9061
|
+
out += this.renderer.list(token);
|
|
9062
|
+
continue;
|
|
9295
9063
|
}
|
|
9296
|
-
|
|
9297
|
-
|
|
9298
|
-
|
|
9299
|
-
src = src.substring(token.raw.length);
|
|
9300
|
-
tokens.push(token);
|
|
9301
|
-
continue;
|
|
9302
|
-
}
|
|
9303
|
-
if (token = this.tokenizer.lheading(src)) {
|
|
9304
|
-
src = src.substring(token.raw.length);
|
|
9305
|
-
tokens.push(token);
|
|
9306
|
-
continue;
|
|
9307
|
-
}
|
|
9308
|
-
let cutSrc = src;
|
|
9309
|
-
if (this.options.extensions?.startBlock) {
|
|
9310
|
-
let startIndex = Infinity;
|
|
9311
|
-
const tempSrc = src.slice(1);
|
|
9312
|
-
let tempStart;
|
|
9313
|
-
this.options.extensions.startBlock.forEach((getStartIndex) => {
|
|
9314
|
-
tempStart = getStartIndex.call({ lexer: this }, tempSrc);
|
|
9315
|
-
if (typeof tempStart === "number" && tempStart >= 0) {
|
|
9316
|
-
startIndex = Math.min(startIndex, tempStart);
|
|
9317
|
-
}
|
|
9318
|
-
});
|
|
9319
|
-
if (startIndex < Infinity && startIndex >= 0) {
|
|
9320
|
-
cutSrc = src.substring(0, startIndex + 1);
|
|
9064
|
+
case "html": {
|
|
9065
|
+
out += this.renderer.html(token);
|
|
9066
|
+
continue;
|
|
9321
9067
|
}
|
|
9322
|
-
|
|
9323
|
-
|
|
9324
|
-
|
|
9325
|
-
if (lastParagraphClipped && lastToken?.type === "paragraph") {
|
|
9326
|
-
lastToken.raw += "\n" + token.raw;
|
|
9327
|
-
lastToken.text += "\n" + token.text;
|
|
9328
|
-
this.inlineQueue.pop();
|
|
9329
|
-
this.inlineQueue.at(-1).src = lastToken.text;
|
|
9330
|
-
} else {
|
|
9331
|
-
tokens.push(token);
|
|
9068
|
+
case "paragraph": {
|
|
9069
|
+
out += this.renderer.paragraph(token);
|
|
9070
|
+
continue;
|
|
9332
9071
|
}
|
|
9333
|
-
|
|
9334
|
-
|
|
9335
|
-
|
|
9336
|
-
|
|
9337
|
-
|
|
9338
|
-
|
|
9339
|
-
|
|
9340
|
-
|
|
9341
|
-
|
|
9342
|
-
|
|
9343
|
-
|
|
9344
|
-
|
|
9345
|
-
|
|
9346
|
-
|
|
9072
|
+
case "text": {
|
|
9073
|
+
let textToken = token;
|
|
9074
|
+
let body = this.renderer.text(textToken);
|
|
9075
|
+
while (i + 1 < tokens.length && tokens[i + 1].type === "text") {
|
|
9076
|
+
textToken = tokens[++i];
|
|
9077
|
+
body += "\n" + this.renderer.text(textToken);
|
|
9078
|
+
}
|
|
9079
|
+
if (top) {
|
|
9080
|
+
out += this.renderer.paragraph({
|
|
9081
|
+
type: "paragraph",
|
|
9082
|
+
raw: body,
|
|
9083
|
+
text: body,
|
|
9084
|
+
tokens: [{ type: "text", raw: body, text: body, escaped: true }]
|
|
9085
|
+
});
|
|
9086
|
+
} else {
|
|
9087
|
+
out += body;
|
|
9088
|
+
}
|
|
9089
|
+
continue;
|
|
9347
9090
|
}
|
|
9348
|
-
|
|
9349
|
-
|
|
9350
|
-
|
|
9351
|
-
|
|
9352
|
-
|
|
9353
|
-
|
|
9354
|
-
|
|
9355
|
-
|
|
9356
|
-
throw new Error(errMsg);
|
|
9091
|
+
default: {
|
|
9092
|
+
const errMsg = 'Token with "' + token.type + '" type was not found.';
|
|
9093
|
+
if (this.options.silent) {
|
|
9094
|
+
console.error(errMsg);
|
|
9095
|
+
return "";
|
|
9096
|
+
} else {
|
|
9097
|
+
throw new Error(errMsg);
|
|
9098
|
+
}
|
|
9357
9099
|
}
|
|
9358
9100
|
}
|
|
9359
9101
|
}
|
|
9360
|
-
|
|
9361
|
-
return tokens;
|
|
9362
|
-
}
|
|
9363
|
-
inline(src, tokens = []) {
|
|
9364
|
-
this.inlineQueue.push({ src, tokens });
|
|
9365
|
-
return tokens;
|
|
9102
|
+
return out;
|
|
9366
9103
|
}
|
|
9367
9104
|
/**
|
|
9368
|
-
*
|
|
9105
|
+
* Parse Inline Tokens
|
|
9369
9106
|
*/
|
|
9370
|
-
|
|
9371
|
-
let
|
|
9372
|
-
let
|
|
9373
|
-
|
|
9374
|
-
|
|
9375
|
-
|
|
9376
|
-
|
|
9377
|
-
|
|
9378
|
-
|
|
9379
|
-
}
|
|
9107
|
+
parseInline(tokens, renderer = this.renderer) {
|
|
9108
|
+
let out = "";
|
|
9109
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
9110
|
+
const anyToken = tokens[i];
|
|
9111
|
+
if (this.options.extensions?.renderers?.[anyToken.type]) {
|
|
9112
|
+
const ret = this.options.extensions.renderers[anyToken.type].call({ parser: this }, anyToken);
|
|
9113
|
+
if (ret !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(anyToken.type)) {
|
|
9114
|
+
out += ret || "";
|
|
9115
|
+
continue;
|
|
9380
9116
|
}
|
|
9381
9117
|
}
|
|
9382
|
-
|
|
9383
|
-
|
|
9384
|
-
|
|
9385
|
-
|
|
9386
|
-
|
|
9387
|
-
maskedSrc = maskedSrc.slice(0, match.index) + "[" + "a".repeat(match[0].length - 2) + "]" + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
|
|
9388
|
-
}
|
|
9389
|
-
let keepPrevChar = false;
|
|
9390
|
-
let prevChar = "";
|
|
9391
|
-
while (src) {
|
|
9392
|
-
if (!keepPrevChar) {
|
|
9393
|
-
prevChar = "";
|
|
9394
|
-
}
|
|
9395
|
-
keepPrevChar = false;
|
|
9396
|
-
let token;
|
|
9397
|
-
if (this.options.extensions?.inline?.some((extTokenizer) => {
|
|
9398
|
-
if (token = extTokenizer.call({ lexer: this }, src, tokens)) {
|
|
9399
|
-
src = src.substring(token.raw.length);
|
|
9400
|
-
tokens.push(token);
|
|
9401
|
-
return true;
|
|
9118
|
+
const token = anyToken;
|
|
9119
|
+
switch (token.type) {
|
|
9120
|
+
case "escape": {
|
|
9121
|
+
out += renderer.text(token);
|
|
9122
|
+
break;
|
|
9402
9123
|
}
|
|
9403
|
-
|
|
9404
|
-
|
|
9405
|
-
|
|
9406
|
-
}
|
|
9407
|
-
if (token = this.tokenizer.escape(src)) {
|
|
9408
|
-
src = src.substring(token.raw.length);
|
|
9409
|
-
tokens.push(token);
|
|
9410
|
-
continue;
|
|
9411
|
-
}
|
|
9412
|
-
if (token = this.tokenizer.tag(src)) {
|
|
9413
|
-
src = src.substring(token.raw.length);
|
|
9414
|
-
tokens.push(token);
|
|
9415
|
-
continue;
|
|
9416
|
-
}
|
|
9417
|
-
if (token = this.tokenizer.link(src)) {
|
|
9418
|
-
src = src.substring(token.raw.length);
|
|
9419
|
-
tokens.push(token);
|
|
9420
|
-
continue;
|
|
9421
|
-
}
|
|
9422
|
-
if (token = this.tokenizer.reflink(src, this.tokens.links)) {
|
|
9423
|
-
src = src.substring(token.raw.length);
|
|
9424
|
-
const lastToken = tokens.at(-1);
|
|
9425
|
-
if (token.type === "text" && lastToken?.type === "text") {
|
|
9426
|
-
lastToken.raw += token.raw;
|
|
9427
|
-
lastToken.text += token.text;
|
|
9428
|
-
} else {
|
|
9429
|
-
tokens.push(token);
|
|
9124
|
+
case "html": {
|
|
9125
|
+
out += renderer.html(token);
|
|
9126
|
+
break;
|
|
9430
9127
|
}
|
|
9431
|
-
|
|
9432
|
-
|
|
9433
|
-
|
|
9434
|
-
src = src.substring(token.raw.length);
|
|
9435
|
-
tokens.push(token);
|
|
9436
|
-
continue;
|
|
9437
|
-
}
|
|
9438
|
-
if (token = this.tokenizer.codespan(src)) {
|
|
9439
|
-
src = src.substring(token.raw.length);
|
|
9440
|
-
tokens.push(token);
|
|
9441
|
-
continue;
|
|
9442
|
-
}
|
|
9443
|
-
if (token = this.tokenizer.br(src)) {
|
|
9444
|
-
src = src.substring(token.raw.length);
|
|
9445
|
-
tokens.push(token);
|
|
9446
|
-
continue;
|
|
9447
|
-
}
|
|
9448
|
-
if (token = this.tokenizer.del(src)) {
|
|
9449
|
-
src = src.substring(token.raw.length);
|
|
9450
|
-
tokens.push(token);
|
|
9451
|
-
continue;
|
|
9452
|
-
}
|
|
9453
|
-
if (token = this.tokenizer.autolink(src)) {
|
|
9454
|
-
src = src.substring(token.raw.length);
|
|
9455
|
-
tokens.push(token);
|
|
9456
|
-
continue;
|
|
9457
|
-
}
|
|
9458
|
-
if (!this.state.inLink && (token = this.tokenizer.url(src))) {
|
|
9459
|
-
src = src.substring(token.raw.length);
|
|
9460
|
-
tokens.push(token);
|
|
9461
|
-
continue;
|
|
9462
|
-
}
|
|
9463
|
-
let cutSrc = src;
|
|
9464
|
-
if (this.options.extensions?.startInline) {
|
|
9465
|
-
let startIndex = Infinity;
|
|
9466
|
-
const tempSrc = src.slice(1);
|
|
9467
|
-
let tempStart;
|
|
9468
|
-
this.options.extensions.startInline.forEach((getStartIndex) => {
|
|
9469
|
-
tempStart = getStartIndex.call({ lexer: this }, tempSrc);
|
|
9470
|
-
if (typeof tempStart === "number" && tempStart >= 0) {
|
|
9471
|
-
startIndex = Math.min(startIndex, tempStart);
|
|
9472
|
-
}
|
|
9473
|
-
});
|
|
9474
|
-
if (startIndex < Infinity && startIndex >= 0) {
|
|
9475
|
-
cutSrc = src.substring(0, startIndex + 1);
|
|
9128
|
+
case "link": {
|
|
9129
|
+
out += renderer.link(token);
|
|
9130
|
+
break;
|
|
9476
9131
|
}
|
|
9477
|
-
|
|
9478
|
-
|
|
9479
|
-
|
|
9480
|
-
if (token.raw.slice(-1) !== "_") {
|
|
9481
|
-
prevChar = token.raw.slice(-1);
|
|
9132
|
+
case "image": {
|
|
9133
|
+
out += renderer.image(token);
|
|
9134
|
+
break;
|
|
9482
9135
|
}
|
|
9483
|
-
|
|
9484
|
-
|
|
9485
|
-
|
|
9486
|
-
|
|
9487
|
-
|
|
9488
|
-
|
|
9489
|
-
|
|
9136
|
+
case "strong": {
|
|
9137
|
+
out += renderer.strong(token);
|
|
9138
|
+
break;
|
|
9139
|
+
}
|
|
9140
|
+
case "em": {
|
|
9141
|
+
out += renderer.em(token);
|
|
9142
|
+
break;
|
|
9143
|
+
}
|
|
9144
|
+
case "codespan": {
|
|
9145
|
+
out += renderer.codespan(token);
|
|
9146
|
+
break;
|
|
9147
|
+
}
|
|
9148
|
+
case "br": {
|
|
9149
|
+
out += renderer.br(token);
|
|
9150
|
+
break;
|
|
9151
|
+
}
|
|
9152
|
+
case "del": {
|
|
9153
|
+
out += renderer.del(token);
|
|
9154
|
+
break;
|
|
9490
9155
|
}
|
|
9491
|
-
|
|
9492
|
-
|
|
9493
|
-
if (src) {
|
|
9494
|
-
const errMsg = "Infinite loop on byte: " + src.charCodeAt(0);
|
|
9495
|
-
if (this.options.silent) {
|
|
9496
|
-
console.error(errMsg);
|
|
9156
|
+
case "text": {
|
|
9157
|
+
out += renderer.text(token);
|
|
9497
9158
|
break;
|
|
9498
|
-
}
|
|
9499
|
-
|
|
9159
|
+
}
|
|
9160
|
+
default: {
|
|
9161
|
+
const errMsg = 'Token with "' + token.type + '" type was not found.';
|
|
9162
|
+
if (this.options.silent) {
|
|
9163
|
+
console.error(errMsg);
|
|
9164
|
+
return "";
|
|
9165
|
+
} else {
|
|
9166
|
+
throw new Error(errMsg);
|
|
9167
|
+
}
|
|
9500
9168
|
}
|
|
9501
9169
|
}
|
|
9502
9170
|
}
|
|
9503
|
-
return
|
|
9171
|
+
return out;
|
|
9504
9172
|
}
|
|
9505
9173
|
};
|
|
9506
9174
|
|
|
9507
|
-
// src/
|
|
9508
|
-
var
|
|
9175
|
+
// src/Hooks.ts
|
|
9176
|
+
var _Hooks = class {
|
|
9509
9177
|
options;
|
|
9510
|
-
|
|
9511
|
-
// set by the parser
|
|
9178
|
+
block;
|
|
9512
9179
|
constructor(options2) {
|
|
9513
9180
|
this.options = options2 || _defaults;
|
|
9514
9181
|
}
|
|
9515
|
-
|
|
9516
|
-
|
|
9182
|
+
static passThroughHooks = /* @__PURE__ */ new Set([
|
|
9183
|
+
"preprocess",
|
|
9184
|
+
"postprocess",
|
|
9185
|
+
"processAllTokens"
|
|
9186
|
+
]);
|
|
9187
|
+
/**
|
|
9188
|
+
* Process markdown before marked
|
|
9189
|
+
*/
|
|
9190
|
+
preprocess(markdown) {
|
|
9191
|
+
return markdown;
|
|
9517
9192
|
}
|
|
9518
|
-
|
|
9519
|
-
|
|
9520
|
-
|
|
9521
|
-
|
|
9522
|
-
|
|
9523
|
-
}
|
|
9524
|
-
return '<pre><code class="language-' + escape2(langString) + '">' + (escaped ? code : escape2(code, true)) + "</code></pre>\n";
|
|
9193
|
+
/**
|
|
9194
|
+
* Process HTML after marked is finished
|
|
9195
|
+
*/
|
|
9196
|
+
postprocess(html2) {
|
|
9197
|
+
return html2;
|
|
9525
9198
|
}
|
|
9526
|
-
|
|
9527
|
-
|
|
9528
|
-
|
|
9529
|
-
|
|
9530
|
-
|
|
9199
|
+
/**
|
|
9200
|
+
* Process all tokens before walk tokens
|
|
9201
|
+
*/
|
|
9202
|
+
processAllTokens(tokens) {
|
|
9203
|
+
return tokens;
|
|
9531
9204
|
}
|
|
9532
|
-
|
|
9533
|
-
|
|
9205
|
+
/**
|
|
9206
|
+
* Provide function to tokenize markdown
|
|
9207
|
+
*/
|
|
9208
|
+
provideLexer() {
|
|
9209
|
+
return this.block ? _Lexer.lex : _Lexer.lexInline;
|
|
9534
9210
|
}
|
|
9535
|
-
|
|
9536
|
-
|
|
9537
|
-
|
|
9211
|
+
/**
|
|
9212
|
+
* Provide function to parse tokens
|
|
9213
|
+
*/
|
|
9214
|
+
provideParser() {
|
|
9215
|
+
return this.block ? _Parser.parse : _Parser.parseInline;
|
|
9538
9216
|
}
|
|
9539
|
-
|
|
9540
|
-
|
|
9217
|
+
};
|
|
9218
|
+
|
|
9219
|
+
// src/Instance.ts
|
|
9220
|
+
var Marked = class {
|
|
9221
|
+
defaults = _getDefaults();
|
|
9222
|
+
options = this.setOptions;
|
|
9223
|
+
parse = this.parseMarkdown(true);
|
|
9224
|
+
parseInline = this.parseMarkdown(false);
|
|
9225
|
+
Parser = _Parser;
|
|
9226
|
+
Renderer = _Renderer;
|
|
9227
|
+
TextRenderer = _TextRenderer;
|
|
9228
|
+
Lexer = _Lexer;
|
|
9229
|
+
Tokenizer = _Tokenizer;
|
|
9230
|
+
Hooks = _Hooks;
|
|
9231
|
+
constructor(...args) {
|
|
9232
|
+
this.use(...args);
|
|
9541
9233
|
}
|
|
9542
|
-
|
|
9543
|
-
|
|
9544
|
-
|
|
9545
|
-
|
|
9546
|
-
|
|
9547
|
-
|
|
9548
|
-
|
|
9234
|
+
/**
|
|
9235
|
+
* Run callback for every token
|
|
9236
|
+
*/
|
|
9237
|
+
walkTokens(tokens, callback) {
|
|
9238
|
+
let values = [];
|
|
9239
|
+
for (const token of tokens) {
|
|
9240
|
+
values = values.concat(callback.call(this, token));
|
|
9241
|
+
switch (token.type) {
|
|
9242
|
+
case "table": {
|
|
9243
|
+
const tableToken = token;
|
|
9244
|
+
for (const cell of tableToken.header) {
|
|
9245
|
+
values = values.concat(this.walkTokens(cell.tokens, callback));
|
|
9246
|
+
}
|
|
9247
|
+
for (const row of tableToken.rows) {
|
|
9248
|
+
for (const cell of row) {
|
|
9249
|
+
values = values.concat(this.walkTokens(cell.tokens, callback));
|
|
9250
|
+
}
|
|
9251
|
+
}
|
|
9252
|
+
break;
|
|
9253
|
+
}
|
|
9254
|
+
case "list": {
|
|
9255
|
+
const listToken = token;
|
|
9256
|
+
values = values.concat(this.walkTokens(listToken.items, callback));
|
|
9257
|
+
break;
|
|
9258
|
+
}
|
|
9259
|
+
default: {
|
|
9260
|
+
const genericToken = token;
|
|
9261
|
+
if (this.defaults.extensions?.childTokens?.[genericToken.type]) {
|
|
9262
|
+
this.defaults.extensions.childTokens[genericToken.type].forEach((childTokens) => {
|
|
9263
|
+
const tokens2 = genericToken[childTokens].flat(Infinity);
|
|
9264
|
+
values = values.concat(this.walkTokens(tokens2, callback));
|
|
9265
|
+
});
|
|
9266
|
+
} else if (genericToken.tokens) {
|
|
9267
|
+
values = values.concat(this.walkTokens(genericToken.tokens, callback));
|
|
9268
|
+
}
|
|
9269
|
+
}
|
|
9270
|
+
}
|
|
9549
9271
|
}
|
|
9550
|
-
|
|
9551
|
-
const startAttr = ordered && start !== 1 ? ' start="' + start + '"' : "";
|
|
9552
|
-
return "<" + type + startAttr + ">\n" + body + "</" + type + ">\n";
|
|
9272
|
+
return values;
|
|
9553
9273
|
}
|
|
9554
|
-
|
|
9555
|
-
|
|
9556
|
-
|
|
9557
|
-
const
|
|
9558
|
-
|
|
9559
|
-
|
|
9560
|
-
|
|
9561
|
-
if (
|
|
9562
|
-
|
|
9563
|
-
|
|
9274
|
+
use(...args) {
|
|
9275
|
+
const extensions = this.defaults.extensions || { renderers: {}, childTokens: {} };
|
|
9276
|
+
args.forEach((pack) => {
|
|
9277
|
+
const opts = { ...pack };
|
|
9278
|
+
opts.async = this.defaults.async || opts.async || false;
|
|
9279
|
+
if (pack.extensions) {
|
|
9280
|
+
pack.extensions.forEach((ext) => {
|
|
9281
|
+
if (!ext.name) {
|
|
9282
|
+
throw new Error("extension name required");
|
|
9283
|
+
}
|
|
9284
|
+
if ("renderer" in ext) {
|
|
9285
|
+
const prevRenderer = extensions.renderers[ext.name];
|
|
9286
|
+
if (prevRenderer) {
|
|
9287
|
+
extensions.renderers[ext.name] = function(...args2) {
|
|
9288
|
+
let ret = ext.renderer.apply(this, args2);
|
|
9289
|
+
if (ret === false) {
|
|
9290
|
+
ret = prevRenderer.apply(this, args2);
|
|
9291
|
+
}
|
|
9292
|
+
return ret;
|
|
9293
|
+
};
|
|
9294
|
+
} else {
|
|
9295
|
+
extensions.renderers[ext.name] = ext.renderer;
|
|
9296
|
+
}
|
|
9297
|
+
}
|
|
9298
|
+
if ("tokenizer" in ext) {
|
|
9299
|
+
if (!ext.level || ext.level !== "block" && ext.level !== "inline") {
|
|
9300
|
+
throw new Error("extension level must be 'block' or 'inline'");
|
|
9301
|
+
}
|
|
9302
|
+
const extLevel = extensions[ext.level];
|
|
9303
|
+
if (extLevel) {
|
|
9304
|
+
extLevel.unshift(ext.tokenizer);
|
|
9305
|
+
} else {
|
|
9306
|
+
extensions[ext.level] = [ext.tokenizer];
|
|
9307
|
+
}
|
|
9308
|
+
if (ext.start) {
|
|
9309
|
+
if (ext.level === "block") {
|
|
9310
|
+
if (extensions.startBlock) {
|
|
9311
|
+
extensions.startBlock.push(ext.start);
|
|
9312
|
+
} else {
|
|
9313
|
+
extensions.startBlock = [ext.start];
|
|
9314
|
+
}
|
|
9315
|
+
} else if (ext.level === "inline") {
|
|
9316
|
+
if (extensions.startInline) {
|
|
9317
|
+
extensions.startInline.push(ext.start);
|
|
9318
|
+
} else {
|
|
9319
|
+
extensions.startInline = [ext.start];
|
|
9320
|
+
}
|
|
9321
|
+
}
|
|
9322
|
+
}
|
|
9323
|
+
}
|
|
9324
|
+
if ("childTokens" in ext && ext.childTokens) {
|
|
9325
|
+
extensions.childTokens[ext.name] = ext.childTokens;
|
|
9326
|
+
}
|
|
9327
|
+
});
|
|
9328
|
+
opts.extensions = extensions;
|
|
9329
|
+
}
|
|
9330
|
+
if (pack.renderer) {
|
|
9331
|
+
const renderer = this.defaults.renderer || new _Renderer(this.defaults);
|
|
9332
|
+
for (const prop in pack.renderer) {
|
|
9333
|
+
if (!(prop in renderer)) {
|
|
9334
|
+
throw new Error(`renderer '${prop}' does not exist`);
|
|
9335
|
+
}
|
|
9336
|
+
if (["options", "parser"].includes(prop)) {
|
|
9337
|
+
continue;
|
|
9338
|
+
}
|
|
9339
|
+
const rendererProp = prop;
|
|
9340
|
+
const rendererFunc = pack.renderer[rendererProp];
|
|
9341
|
+
const prevRenderer = renderer[rendererProp];
|
|
9342
|
+
renderer[rendererProp] = (...args2) => {
|
|
9343
|
+
let ret = rendererFunc.apply(renderer, args2);
|
|
9344
|
+
if (ret === false) {
|
|
9345
|
+
ret = prevRenderer.apply(renderer, args2);
|
|
9346
|
+
}
|
|
9347
|
+
return ret || "";
|
|
9348
|
+
};
|
|
9349
|
+
}
|
|
9350
|
+
opts.renderer = renderer;
|
|
9351
|
+
}
|
|
9352
|
+
if (pack.tokenizer) {
|
|
9353
|
+
const tokenizer = this.defaults.tokenizer || new _Tokenizer(this.defaults);
|
|
9354
|
+
for (const prop in pack.tokenizer) {
|
|
9355
|
+
if (!(prop in tokenizer)) {
|
|
9356
|
+
throw new Error(`tokenizer '${prop}' does not exist`);
|
|
9357
|
+
}
|
|
9358
|
+
if (["options", "rules", "lexer"].includes(prop)) {
|
|
9359
|
+
continue;
|
|
9360
|
+
}
|
|
9361
|
+
const tokenizerProp = prop;
|
|
9362
|
+
const tokenizerFunc = pack.tokenizer[tokenizerProp];
|
|
9363
|
+
const prevTokenizer = tokenizer[tokenizerProp];
|
|
9364
|
+
tokenizer[tokenizerProp] = (...args2) => {
|
|
9365
|
+
let ret = tokenizerFunc.apply(tokenizer, args2);
|
|
9366
|
+
if (ret === false) {
|
|
9367
|
+
ret = prevTokenizer.apply(tokenizer, args2);
|
|
9368
|
+
}
|
|
9369
|
+
return ret;
|
|
9370
|
+
};
|
|
9371
|
+
}
|
|
9372
|
+
opts.tokenizer = tokenizer;
|
|
9373
|
+
}
|
|
9374
|
+
if (pack.hooks) {
|
|
9375
|
+
const hooks = this.defaults.hooks || new _Hooks();
|
|
9376
|
+
for (const prop in pack.hooks) {
|
|
9377
|
+
if (!(prop in hooks)) {
|
|
9378
|
+
throw new Error(`hook '${prop}' does not exist`);
|
|
9379
|
+
}
|
|
9380
|
+
if (["options", "block"].includes(prop)) {
|
|
9381
|
+
continue;
|
|
9382
|
+
}
|
|
9383
|
+
const hooksProp = prop;
|
|
9384
|
+
const hooksFunc = pack.hooks[hooksProp];
|
|
9385
|
+
const prevHook = hooks[hooksProp];
|
|
9386
|
+
if (_Hooks.passThroughHooks.has(prop)) {
|
|
9387
|
+
hooks[hooksProp] = (arg) => {
|
|
9388
|
+
if (this.defaults.async) {
|
|
9389
|
+
return Promise.resolve(hooksFunc.call(hooks, arg)).then((ret2) => {
|
|
9390
|
+
return prevHook.call(hooks, ret2);
|
|
9391
|
+
});
|
|
9392
|
+
}
|
|
9393
|
+
const ret = hooksFunc.call(hooks, arg);
|
|
9394
|
+
return prevHook.call(hooks, ret);
|
|
9395
|
+
};
|
|
9396
|
+
} else {
|
|
9397
|
+
hooks[hooksProp] = (...args2) => {
|
|
9398
|
+
let ret = hooksFunc.apply(hooks, args2);
|
|
9399
|
+
if (ret === false) {
|
|
9400
|
+
ret = prevHook.apply(hooks, args2);
|
|
9401
|
+
}
|
|
9402
|
+
return ret;
|
|
9403
|
+
};
|
|
9564
9404
|
}
|
|
9565
|
-
} else {
|
|
9566
|
-
item.tokens.unshift({
|
|
9567
|
-
type: "text",
|
|
9568
|
-
raw: checkbox + " ",
|
|
9569
|
-
text: checkbox + " ",
|
|
9570
|
-
escaped: true
|
|
9571
|
-
});
|
|
9572
9405
|
}
|
|
9573
|
-
|
|
9574
|
-
itemBody += checkbox + " ";
|
|
9406
|
+
opts.hooks = hooks;
|
|
9575
9407
|
}
|
|
9576
|
-
|
|
9577
|
-
|
|
9578
|
-
|
|
9579
|
-
|
|
9580
|
-
|
|
9581
|
-
|
|
9582
|
-
|
|
9583
|
-
|
|
9584
|
-
|
|
9585
|
-
|
|
9586
|
-
|
|
9587
|
-
}
|
|
9588
|
-
table(token) {
|
|
9589
|
-
let header = "";
|
|
9590
|
-
let cell = "";
|
|
9591
|
-
for (let j = 0; j < token.header.length; j++) {
|
|
9592
|
-
cell += this.tablecell(token.header[j]);
|
|
9593
|
-
}
|
|
9594
|
-
header += this.tablerow({ text: cell });
|
|
9595
|
-
let body = "";
|
|
9596
|
-
for (let j = 0; j < token.rows.length; j++) {
|
|
9597
|
-
const row = token.rows[j];
|
|
9598
|
-
cell = "";
|
|
9599
|
-
for (let k = 0; k < row.length; k++) {
|
|
9600
|
-
cell += this.tablecell(row[k]);
|
|
9408
|
+
if (pack.walkTokens) {
|
|
9409
|
+
const walkTokens2 = this.defaults.walkTokens;
|
|
9410
|
+
const packWalktokens = pack.walkTokens;
|
|
9411
|
+
opts.walkTokens = function(token) {
|
|
9412
|
+
let values = [];
|
|
9413
|
+
values.push(packWalktokens.call(this, token));
|
|
9414
|
+
if (walkTokens2) {
|
|
9415
|
+
values = values.concat(walkTokens2.call(this, token));
|
|
9416
|
+
}
|
|
9417
|
+
return values;
|
|
9418
|
+
};
|
|
9601
9419
|
}
|
|
9602
|
-
|
|
9603
|
-
}
|
|
9604
|
-
|
|
9605
|
-
return "<table>\n<thead>\n" + header + "</thead>\n" + body + "</table>\n";
|
|
9606
|
-
}
|
|
9607
|
-
tablerow({ text }) {
|
|
9608
|
-
return `<tr>
|
|
9609
|
-
${text}</tr>
|
|
9610
|
-
`;
|
|
9611
|
-
}
|
|
9612
|
-
tablecell(token) {
|
|
9613
|
-
const content = this.parser.parseInline(token.tokens);
|
|
9614
|
-
const type = token.header ? "th" : "td";
|
|
9615
|
-
const tag2 = token.align ? `<${type} align="${token.align}">` : `<${type}>`;
|
|
9616
|
-
return tag2 + content + `</${type}>
|
|
9617
|
-
`;
|
|
9618
|
-
}
|
|
9619
|
-
/**
|
|
9620
|
-
* span level renderer
|
|
9621
|
-
*/
|
|
9622
|
-
strong({ tokens }) {
|
|
9623
|
-
return `<strong>${this.parser.parseInline(tokens)}</strong>`;
|
|
9624
|
-
}
|
|
9625
|
-
em({ tokens }) {
|
|
9626
|
-
return `<em>${this.parser.parseInline(tokens)}</em>`;
|
|
9627
|
-
}
|
|
9628
|
-
codespan({ text }) {
|
|
9629
|
-
return `<code>${escape2(text, true)}</code>`;
|
|
9630
|
-
}
|
|
9631
|
-
br(token) {
|
|
9632
|
-
return "<br>";
|
|
9633
|
-
}
|
|
9634
|
-
del({ tokens }) {
|
|
9635
|
-
return `<del>${this.parser.parseInline(tokens)}</del>`;
|
|
9636
|
-
}
|
|
9637
|
-
link({ href, title, tokens }) {
|
|
9638
|
-
const text = this.parser.parseInline(tokens);
|
|
9639
|
-
const cleanHref = cleanUrl(href);
|
|
9640
|
-
if (cleanHref === null) {
|
|
9641
|
-
return text;
|
|
9642
|
-
}
|
|
9643
|
-
href = cleanHref;
|
|
9644
|
-
let out = '<a href="' + href + '"';
|
|
9645
|
-
if (title) {
|
|
9646
|
-
out += ' title="' + escape2(title) + '"';
|
|
9647
|
-
}
|
|
9648
|
-
out += ">" + text + "</a>";
|
|
9649
|
-
return out;
|
|
9650
|
-
}
|
|
9651
|
-
image({ href, title, text, tokens }) {
|
|
9652
|
-
if (tokens) {
|
|
9653
|
-
text = this.parser.parseInline(tokens, this.parser.textRenderer);
|
|
9654
|
-
}
|
|
9655
|
-
const cleanHref = cleanUrl(href);
|
|
9656
|
-
if (cleanHref === null) {
|
|
9657
|
-
return escape2(text);
|
|
9658
|
-
}
|
|
9659
|
-
href = cleanHref;
|
|
9660
|
-
let out = `<img src="${href}" alt="${text}"`;
|
|
9661
|
-
if (title) {
|
|
9662
|
-
out += ` title="${escape2(title)}"`;
|
|
9663
|
-
}
|
|
9664
|
-
out += ">";
|
|
9665
|
-
return out;
|
|
9666
|
-
}
|
|
9667
|
-
text(token) {
|
|
9668
|
-
return "tokens" in token && token.tokens ? this.parser.parseInline(token.tokens) : "escaped" in token && token.escaped ? token.text : escape2(token.text);
|
|
9669
|
-
}
|
|
9670
|
-
};
|
|
9671
|
-
|
|
9672
|
-
// src/TextRenderer.ts
|
|
9673
|
-
var _TextRenderer = class {
|
|
9674
|
-
// no need for block level renderers
|
|
9675
|
-
strong({ text }) {
|
|
9676
|
-
return text;
|
|
9677
|
-
}
|
|
9678
|
-
em({ text }) {
|
|
9679
|
-
return text;
|
|
9680
|
-
}
|
|
9681
|
-
codespan({ text }) {
|
|
9682
|
-
return text;
|
|
9683
|
-
}
|
|
9684
|
-
del({ text }) {
|
|
9685
|
-
return text;
|
|
9686
|
-
}
|
|
9687
|
-
html({ text }) {
|
|
9688
|
-
return text;
|
|
9689
|
-
}
|
|
9690
|
-
text({ text }) {
|
|
9691
|
-
return text;
|
|
9692
|
-
}
|
|
9693
|
-
link({ text }) {
|
|
9694
|
-
return "" + text;
|
|
9695
|
-
}
|
|
9696
|
-
image({ text }) {
|
|
9697
|
-
return "" + text;
|
|
9698
|
-
}
|
|
9699
|
-
br() {
|
|
9700
|
-
return "";
|
|
9420
|
+
this.defaults = { ...this.defaults, ...opts };
|
|
9421
|
+
});
|
|
9422
|
+
return this;
|
|
9701
9423
|
}
|
|
9702
|
-
|
|
9703
|
-
|
|
9704
|
-
|
|
9705
|
-
var _Parser = class __Parser {
|
|
9706
|
-
options;
|
|
9707
|
-
renderer;
|
|
9708
|
-
textRenderer;
|
|
9709
|
-
constructor(options2) {
|
|
9710
|
-
this.options = options2 || _defaults;
|
|
9711
|
-
this.options.renderer = this.options.renderer || new _Renderer();
|
|
9712
|
-
this.renderer = this.options.renderer;
|
|
9713
|
-
this.renderer.options = this.options;
|
|
9714
|
-
this.renderer.parser = this;
|
|
9715
|
-
this.textRenderer = new _TextRenderer();
|
|
9424
|
+
setOptions(opt) {
|
|
9425
|
+
this.defaults = { ...this.defaults, ...opt };
|
|
9426
|
+
return this;
|
|
9716
9427
|
}
|
|
9717
|
-
|
|
9718
|
-
|
|
9719
|
-
*/
|
|
9720
|
-
static parse(tokens, options2) {
|
|
9721
|
-
const parser2 = new __Parser(options2);
|
|
9722
|
-
return parser2.parse(tokens);
|
|
9428
|
+
lexer(src, options2) {
|
|
9429
|
+
return _Lexer.lex(src, options2 ?? this.defaults);
|
|
9723
9430
|
}
|
|
9724
|
-
|
|
9725
|
-
|
|
9726
|
-
*/
|
|
9727
|
-
static parseInline(tokens, options2) {
|
|
9728
|
-
const parser2 = new __Parser(options2);
|
|
9729
|
-
return parser2.parseInline(tokens);
|
|
9431
|
+
parser(tokens, options2) {
|
|
9432
|
+
return _Parser.parse(tokens, options2 ?? this.defaults);
|
|
9730
9433
|
}
|
|
9731
|
-
|
|
9732
|
-
|
|
9733
|
-
|
|
9734
|
-
|
|
9735
|
-
|
|
9736
|
-
|
|
9737
|
-
|
|
9738
|
-
if (this.options.extensions?.renderers?.[anyToken.type]) {
|
|
9739
|
-
const genericToken = anyToken;
|
|
9740
|
-
const ret = this.options.extensions.renderers[genericToken.type].call({ parser: this }, genericToken);
|
|
9741
|
-
if (ret !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(genericToken.type)) {
|
|
9742
|
-
out += ret || "";
|
|
9743
|
-
continue;
|
|
9744
|
-
}
|
|
9434
|
+
parseMarkdown(blockType) {
|
|
9435
|
+
const parse2 = (src, options2) => {
|
|
9436
|
+
const origOpt = { ...options2 };
|
|
9437
|
+
const opt = { ...this.defaults, ...origOpt };
|
|
9438
|
+
const throwError = this.onError(!!opt.silent, !!opt.async);
|
|
9439
|
+
if (this.defaults.async === true && origOpt.async === false) {
|
|
9440
|
+
return throwError(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
|
|
9745
9441
|
}
|
|
9746
|
-
|
|
9747
|
-
|
|
9748
|
-
|
|
9749
|
-
|
|
9750
|
-
|
|
9751
|
-
|
|
9752
|
-
|
|
9753
|
-
|
|
9754
|
-
|
|
9442
|
+
if (typeof src === "undefined" || src === null) {
|
|
9443
|
+
return throwError(new Error("marked(): input parameter is undefined or null"));
|
|
9444
|
+
}
|
|
9445
|
+
if (typeof src !== "string") {
|
|
9446
|
+
return throwError(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(src) + ", string expected"));
|
|
9447
|
+
}
|
|
9448
|
+
if (opt.hooks) {
|
|
9449
|
+
opt.hooks.options = opt;
|
|
9450
|
+
opt.hooks.block = blockType;
|
|
9451
|
+
}
|
|
9452
|
+
const lexer2 = opt.hooks ? opt.hooks.provideLexer() : blockType ? _Lexer.lex : _Lexer.lexInline;
|
|
9453
|
+
const parser2 = opt.hooks ? opt.hooks.provideParser() : blockType ? _Parser.parse : _Parser.parseInline;
|
|
9454
|
+
if (opt.async) {
|
|
9455
|
+
return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src).then((src2) => lexer2(src2, opt)).then((tokens) => opt.hooks ? opt.hooks.processAllTokens(tokens) : tokens).then((tokens) => opt.walkTokens ? Promise.all(this.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens).then((tokens) => parser2(tokens, opt)).then((html2) => opt.hooks ? opt.hooks.postprocess(html2) : html2).catch(throwError);
|
|
9456
|
+
}
|
|
9457
|
+
try {
|
|
9458
|
+
if (opt.hooks) {
|
|
9459
|
+
src = opt.hooks.preprocess(src);
|
|
9755
9460
|
}
|
|
9756
|
-
|
|
9757
|
-
|
|
9758
|
-
|
|
9461
|
+
let tokens = lexer2(src, opt);
|
|
9462
|
+
if (opt.hooks) {
|
|
9463
|
+
tokens = opt.hooks.processAllTokens(tokens);
|
|
9759
9464
|
}
|
|
9760
|
-
|
|
9761
|
-
|
|
9762
|
-
continue;
|
|
9465
|
+
if (opt.walkTokens) {
|
|
9466
|
+
this.walkTokens(tokens, opt.walkTokens);
|
|
9763
9467
|
}
|
|
9764
|
-
|
|
9765
|
-
|
|
9766
|
-
|
|
9468
|
+
let html2 = parser2(tokens, opt);
|
|
9469
|
+
if (opt.hooks) {
|
|
9470
|
+
html2 = opt.hooks.postprocess(html2);
|
|
9767
9471
|
}
|
|
9768
|
-
|
|
9769
|
-
|
|
9770
|
-
|
|
9472
|
+
return html2;
|
|
9473
|
+
} catch (e) {
|
|
9474
|
+
return throwError(e);
|
|
9475
|
+
}
|
|
9476
|
+
};
|
|
9477
|
+
return parse2;
|
|
9478
|
+
}
|
|
9479
|
+
onError(silent, async) {
|
|
9480
|
+
return (e) => {
|
|
9481
|
+
e.message += "\nPlease report this to https://github.com/markedjs/marked.";
|
|
9482
|
+
if (silent) {
|
|
9483
|
+
const msg = "<p>An error occurred:</p><pre>" + escape2(e.message + "", true) + "</pre>";
|
|
9484
|
+
if (async) {
|
|
9485
|
+
return Promise.resolve(msg);
|
|
9771
9486
|
}
|
|
9772
|
-
|
|
9773
|
-
|
|
9774
|
-
|
|
9487
|
+
return msg;
|
|
9488
|
+
}
|
|
9489
|
+
if (async) {
|
|
9490
|
+
return Promise.reject(e);
|
|
9491
|
+
}
|
|
9492
|
+
throw e;
|
|
9493
|
+
};
|
|
9494
|
+
}
|
|
9495
|
+
};
|
|
9496
|
+
|
|
9497
|
+
// src/marked.ts
|
|
9498
|
+
var markedInstance = new Marked();
|
|
9499
|
+
function marked(src, opt) {
|
|
9500
|
+
return markedInstance.parse(src, opt);
|
|
9501
|
+
}
|
|
9502
|
+
marked.options = marked.setOptions = function(options2) {
|
|
9503
|
+
markedInstance.setOptions(options2);
|
|
9504
|
+
marked.defaults = markedInstance.defaults;
|
|
9505
|
+
changeDefaults(marked.defaults);
|
|
9506
|
+
return marked;
|
|
9507
|
+
};
|
|
9508
|
+
marked.getDefaults = _getDefaults;
|
|
9509
|
+
marked.defaults = _defaults;
|
|
9510
|
+
marked.use = function(...args) {
|
|
9511
|
+
markedInstance.use(...args);
|
|
9512
|
+
marked.defaults = markedInstance.defaults;
|
|
9513
|
+
changeDefaults(marked.defaults);
|
|
9514
|
+
return marked;
|
|
9515
|
+
};
|
|
9516
|
+
marked.walkTokens = function(tokens, callback) {
|
|
9517
|
+
return markedInstance.walkTokens(tokens, callback);
|
|
9518
|
+
};
|
|
9519
|
+
marked.parseInline = markedInstance.parseInline;
|
|
9520
|
+
marked.Parser = _Parser;
|
|
9521
|
+
marked.parser = _Parser.parse;
|
|
9522
|
+
marked.Renderer = _Renderer;
|
|
9523
|
+
marked.TextRenderer = _TextRenderer;
|
|
9524
|
+
marked.Lexer = _Lexer;
|
|
9525
|
+
marked.lexer = _Lexer.lex;
|
|
9526
|
+
marked.Tokenizer = _Tokenizer;
|
|
9527
|
+
marked.Hooks = _Hooks;
|
|
9528
|
+
marked.parse = marked;
|
|
9529
|
+
|
|
9530
|
+
/**
|
|
9531
|
+
* This component renders a results summary for RAG search result summaries.
|
|
9532
|
+
* When the user makes a search, a network call is made to retrieve the summary content, which is then
|
|
9533
|
+
* rendered in this box.
|
|
9534
|
+
*
|
|
9535
|
+
* NOTE: This component requires the usage of a read key that has "SUMMARY" permissions.
|
|
9536
|
+
*
|
|
9537
|
+
* @react-import
|
|
9538
|
+
* ```jsx
|
|
9539
|
+
* import { SearchcraftResultsSummary } from "@searchcraft/react-sdk";
|
|
9540
|
+
* ```
|
|
9541
|
+
*
|
|
9542
|
+
* @vue-import
|
|
9543
|
+
* ```ts
|
|
9544
|
+
* import { SearchcraftResultsSummary } from "@searchcraft/vue-sdk";
|
|
9545
|
+
* ```
|
|
9546
|
+
*
|
|
9547
|
+
* @js-example
|
|
9548
|
+
* ```html
|
|
9549
|
+
* <searchcraft-results-summary />
|
|
9550
|
+
* ```
|
|
9551
|
+
*
|
|
9552
|
+
* @react-example
|
|
9553
|
+
* ```jsx
|
|
9554
|
+
* <SearchcraftResultsSummary />
|
|
9555
|
+
* ```
|
|
9556
|
+
*
|
|
9557
|
+
* @vue-example
|
|
9558
|
+
* ```jsx
|
|
9559
|
+
* <SearchcraftResultsSummary />
|
|
9560
|
+
* ```
|
|
9561
|
+
*/
|
|
9562
|
+
class SearchcraftResultsSummary {
|
|
9563
|
+
constructor(hostRef) {
|
|
9564
|
+
registerInstance(this, hostRef);
|
|
9565
|
+
}
|
|
9566
|
+
/**
|
|
9567
|
+
* The id of the Searchcraft instance that this component should use.
|
|
9568
|
+
*/
|
|
9569
|
+
searchcraftId;
|
|
9570
|
+
summary = '';
|
|
9571
|
+
summaryErrorMessage = '';
|
|
9572
|
+
isLoading = false;
|
|
9573
|
+
isSummaryNotEnabled = false;
|
|
9574
|
+
unsubscribe;
|
|
9575
|
+
cleanupCore;
|
|
9576
|
+
/**
|
|
9577
|
+
* Callback invoked when the Searchcraft core instance is available.
|
|
9578
|
+
*/
|
|
9579
|
+
onCoreAvailable(core) {
|
|
9580
|
+
core.store.setState({ hasSummaryBox: true });
|
|
9581
|
+
this.unsubscribe = core.store.subscribe(this.handleStateChange.bind(this));
|
|
9582
|
+
}
|
|
9583
|
+
connectedCallback() {
|
|
9584
|
+
this.cleanupCore = registry.useCoreInstance(this.searchcraftId, this.onCoreAvailable.bind(this));
|
|
9585
|
+
}
|
|
9586
|
+
disconnectedCallback() {
|
|
9587
|
+
this.unsubscribe?.();
|
|
9588
|
+
this.cleanupCore?.();
|
|
9589
|
+
}
|
|
9590
|
+
/**
|
|
9591
|
+
* Handles state changes from the store and updates component state.
|
|
9592
|
+
*/
|
|
9593
|
+
handleStateChange(state) {
|
|
9594
|
+
this.isLoading = state.isSummaryLoading;
|
|
9595
|
+
this.isSummaryNotEnabled = state.isSummaryNotEnabled;
|
|
9596
|
+
this.summaryErrorMessage = state.summaryErrorMessage;
|
|
9597
|
+
this.summary = this.sanitizeMarkdown(state.summary);
|
|
9598
|
+
}
|
|
9599
|
+
/**
|
|
9600
|
+
* Sanitizes and converts markdown to HTML.
|
|
9601
|
+
*/
|
|
9602
|
+
sanitizeMarkdown(markdown) {
|
|
9603
|
+
return purify.sanitize(marked.parse(markdown));
|
|
9604
|
+
}
|
|
9605
|
+
/**
|
|
9606
|
+
* Renders the appropriate content based on current state.
|
|
9607
|
+
*/
|
|
9608
|
+
renderContent() {
|
|
9609
|
+
if (this.isLoading) {
|
|
9610
|
+
return hAsync("searchcraft-loading", { label: 'LOADING' });
|
|
9775
9611
|
}
|
|
9776
|
-
|
|
9777
|
-
|
|
9778
|
-
continue;
|
|
9612
|
+
if (this.isSummaryNotEnabled) {
|
|
9613
|
+
return (hAsync("div", { class: 'searchcraft-results-summary-content' }, this.summaryErrorMessage || 'AI summaries are not enabled'));
|
|
9779
9614
|
}
|
|
9780
|
-
|
|
9781
|
-
|
|
9782
|
-
|
|
9615
|
+
return (hAsync("div", { class: 'searchcraft-results-summary-content', innerHTML: this.summary, "aria-live": "polite" }));
|
|
9616
|
+
}
|
|
9617
|
+
render() {
|
|
9618
|
+
return (hAsync("div", { key: '4fabef16a76b57d737aa47fcf106c7375d19a5bc', class: 'searchcraft-results-summary' }, this.renderContent()));
|
|
9619
|
+
}
|
|
9620
|
+
static get cmpMeta() { return {
|
|
9621
|
+
"$flags$": 768,
|
|
9622
|
+
"$tagName$": "searchcraft-results-summary",
|
|
9623
|
+
"$members$": {
|
|
9624
|
+
"searchcraftId": [1, "searchcraft-id"],
|
|
9625
|
+
"summary": [32],
|
|
9626
|
+
"summaryErrorMessage": [32],
|
|
9627
|
+
"isLoading": [32],
|
|
9628
|
+
"isSummaryNotEnabled": [32]
|
|
9629
|
+
},
|
|
9630
|
+
"$listeners$": undefined,
|
|
9631
|
+
"$lazyBundleId$": "-",
|
|
9632
|
+
"$attrsToReflect$": []
|
|
9633
|
+
}; }
|
|
9634
|
+
}
|
|
9635
|
+
|
|
9636
|
+
/**
|
|
9637
|
+
* This web component is designed to display detailed information for a single search result. Once a query is submitted, the component formats and presents the result.
|
|
9638
|
+
*
|
|
9639
|
+
* @internal
|
|
9640
|
+
*/
|
|
9641
|
+
class SearchcraftSearchResult {
|
|
9642
|
+
constructor(hostRef) {
|
|
9643
|
+
registerInstance(this, hostRef);
|
|
9644
|
+
}
|
|
9645
|
+
item;
|
|
9646
|
+
/**
|
|
9647
|
+
* The index.
|
|
9648
|
+
*/
|
|
9649
|
+
index;
|
|
9650
|
+
/**
|
|
9651
|
+
* The position in the document. Used with the "document_clicked" measure event.
|
|
9652
|
+
*/
|
|
9653
|
+
documentPosition = 0;
|
|
9654
|
+
/**
|
|
9655
|
+
* A callback function responsible for rendering a result.
|
|
9656
|
+
*/
|
|
9657
|
+
template;
|
|
9658
|
+
/**
|
|
9659
|
+
* The id of the Searchcraft instance that this component should use.
|
|
9660
|
+
*/
|
|
9661
|
+
searchcraftId;
|
|
9662
|
+
templateHtml;
|
|
9663
|
+
get hostElement() { return getElement(this); }
|
|
9664
|
+
core;
|
|
9665
|
+
cleanupCore;
|
|
9666
|
+
onCoreAvailable(core) {
|
|
9667
|
+
this.core = core;
|
|
9668
|
+
}
|
|
9669
|
+
connectedCallback() {
|
|
9670
|
+
this.cleanupCore = registry.useCoreInstance(this.searchcraftId, this.onCoreAvailable.bind(this));
|
|
9671
|
+
if (this.item) {
|
|
9672
|
+
try {
|
|
9673
|
+
this.templateHtml = this.template?.(this.item.document, this.index, {
|
|
9674
|
+
html: html$1,
|
|
9675
|
+
source_index: this.item.source_index,
|
|
9676
|
+
});
|
|
9677
|
+
}
|
|
9678
|
+
catch (error) {
|
|
9679
|
+
console.error('Invalid search result template:', error);
|
|
9680
|
+
}
|
|
9783
9681
|
}
|
|
9784
|
-
|
|
9785
|
-
|
|
9786
|
-
|
|
9787
|
-
|
|
9788
|
-
|
|
9789
|
-
|
|
9790
|
-
|
|
9791
|
-
if (top) {
|
|
9792
|
-
out += this.renderer.paragraph({
|
|
9793
|
-
type: "paragraph",
|
|
9794
|
-
raw: body,
|
|
9795
|
-
text: body,
|
|
9796
|
-
tokens: [{ type: "text", raw: body, text: body, escaped: true }]
|
|
9797
|
-
});
|
|
9798
|
-
} else {
|
|
9799
|
-
out += body;
|
|
9800
|
-
}
|
|
9801
|
-
continue;
|
|
9682
|
+
}
|
|
9683
|
+
disconnectedCallback() {
|
|
9684
|
+
this.cleanupCore?.();
|
|
9685
|
+
}
|
|
9686
|
+
handleResultContainerClick = (event) => {
|
|
9687
|
+
if (!event.target) {
|
|
9688
|
+
return;
|
|
9802
9689
|
}
|
|
9803
|
-
|
|
9804
|
-
|
|
9805
|
-
|
|
9806
|
-
|
|
9807
|
-
|
|
9808
|
-
|
|
9809
|
-
|
|
9810
|
-
}
|
|
9690
|
+
const target = event.target;
|
|
9691
|
+
const link = target.closest('a');
|
|
9692
|
+
if (!link ||
|
|
9693
|
+
!this.hostElement?.contains(link) ||
|
|
9694
|
+
!this.core ||
|
|
9695
|
+
!this.core.measureClient) {
|
|
9696
|
+
return;
|
|
9811
9697
|
}
|
|
9812
|
-
|
|
9813
|
-
|
|
9814
|
-
|
|
9815
|
-
|
|
9816
|
-
|
|
9817
|
-
|
|
9818
|
-
|
|
9819
|
-
|
|
9820
|
-
|
|
9821
|
-
|
|
9822
|
-
|
|
9823
|
-
|
|
9824
|
-
|
|
9825
|
-
if (ret !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(anyToken.type)) {
|
|
9826
|
-
out += ret || "";
|
|
9827
|
-
continue;
|
|
9698
|
+
const document_position = this.documentPosition;
|
|
9699
|
+
const search_term = this.core.store.getState().searchTerm;
|
|
9700
|
+
const number_of_documents = this.core.store.getState().searchClientResponseItems.length || 0;
|
|
9701
|
+
this.core.measureClient.sendMeasureEvent('document_clicked', {
|
|
9702
|
+
document_position,
|
|
9703
|
+
number_of_documents,
|
|
9704
|
+
search_term,
|
|
9705
|
+
});
|
|
9706
|
+
};
|
|
9707
|
+
handleKeyDown = () => { };
|
|
9708
|
+
render() {
|
|
9709
|
+
if (!this.item) {
|
|
9710
|
+
return;
|
|
9828
9711
|
}
|
|
9829
|
-
|
|
9830
|
-
|
|
9831
|
-
switch (token.type) {
|
|
9832
|
-
case "escape": {
|
|
9833
|
-
out += renderer.text(token);
|
|
9834
|
-
break;
|
|
9712
|
+
if (typeof this.template === 'undefined') {
|
|
9713
|
+
return (hAsync("div", { class: 'searchcraft-search-result searchcraft-search-result-no-template', onClick: this.handleResultContainerClick, onKeyDown: this.handleKeyDown }, Object.entries(this.item.document).map(([key, value]) => (hAsync("p", { key: key }, hAsync("strong", null, key), ": ", value)))));
|
|
9835
9714
|
}
|
|
9836
|
-
|
|
9837
|
-
|
|
9838
|
-
|
|
9715
|
+
return (hAsync("div", { class: 'searchcraft-search-result', innerHTML: this.templateHtml, onClick: this.handleResultContainerClick, onKeyDown: this.handleKeyDown }));
|
|
9716
|
+
}
|
|
9717
|
+
static get cmpMeta() { return {
|
|
9718
|
+
"$flags$": 768,
|
|
9719
|
+
"$tagName$": "searchcraft-search-result",
|
|
9720
|
+
"$members$": {
|
|
9721
|
+
"item": [16],
|
|
9722
|
+
"index": [2],
|
|
9723
|
+
"documentPosition": [2, "document-position"],
|
|
9724
|
+
"template": [16],
|
|
9725
|
+
"searchcraftId": [1, "searchcraft-id"],
|
|
9726
|
+
"templateHtml": [32]
|
|
9727
|
+
},
|
|
9728
|
+
"$listeners$": undefined,
|
|
9729
|
+
"$lazyBundleId$": "-",
|
|
9730
|
+
"$attrsToReflect$": []
|
|
9731
|
+
}; }
|
|
9732
|
+
}
|
|
9733
|
+
|
|
9734
|
+
/**
|
|
9735
|
+
* This web component is responsible for displaying the results of a search query. Once a query is submitted, the component formats and presents an ordered list of the results.
|
|
9736
|
+
*
|
|
9737
|
+
*
|
|
9738
|
+
* @react-import
|
|
9739
|
+
* ```jsx
|
|
9740
|
+
* import { SearchcraftSearchResults } from "@searchcraft/react-sdk";
|
|
9741
|
+
* ```
|
|
9742
|
+
*
|
|
9743
|
+
* @vue-import
|
|
9744
|
+
* ```jsx
|
|
9745
|
+
* import { SearchcraftSearchResults } from "@searchcraft/vue-sdk";
|
|
9746
|
+
* ```
|
|
9747
|
+
*
|
|
9748
|
+
* @js-example
|
|
9749
|
+
* ```html
|
|
9750
|
+
* <!-- index.html -->
|
|
9751
|
+
* <searchcraft-search-results
|
|
9752
|
+
* ad-interval="4"
|
|
9753
|
+
* place-ad-at-start="true"
|
|
9754
|
+
* />
|
|
9755
|
+
* ```
|
|
9756
|
+
*
|
|
9757
|
+
* ```js
|
|
9758
|
+
* // index.js
|
|
9759
|
+
* const searchResults = document.querySelector('searchcraft-search-results');
|
|
9760
|
+
*
|
|
9761
|
+
* searchResults.template = (item, index, { html }) => html`
|
|
9762
|
+
* <h2>${item.title}</h2>
|
|
9763
|
+
* `;
|
|
9764
|
+
* ```
|
|
9765
|
+
*
|
|
9766
|
+
* @react-example
|
|
9767
|
+
* ```jsx
|
|
9768
|
+
* <SearchcraftSearchResults
|
|
9769
|
+
* adInterval={4}
|
|
9770
|
+
* placeAdAtState={true}
|
|
9771
|
+
* template={(item, index, { html }) => html`
|
|
9772
|
+
* <h2>${item.title}</h2>
|
|
9773
|
+
* `}
|
|
9774
|
+
* />
|
|
9775
|
+
* ```
|
|
9776
|
+
*
|
|
9777
|
+
* @vue-example
|
|
9778
|
+
* ```jsx
|
|
9779
|
+
* <SearchcraftSearchResults
|
|
9780
|
+
* adInterval={4}
|
|
9781
|
+
* placeAdAtState={true}
|
|
9782
|
+
* :template={(item, index, { html }) => html`
|
|
9783
|
+
* <h2>${item.title}</h2>
|
|
9784
|
+
* `}
|
|
9785
|
+
* />
|
|
9786
|
+
* ```
|
|
9787
|
+
*/
|
|
9788
|
+
class SearchcraftSearchResults {
|
|
9789
|
+
constructor(hostRef) {
|
|
9790
|
+
registerInstance(this, hostRef);
|
|
9791
|
+
}
|
|
9792
|
+
/**
|
|
9793
|
+
* The id of the Searchcraft instance that this component should use.
|
|
9794
|
+
*/
|
|
9795
|
+
searchcraftId;
|
|
9796
|
+
/**
|
|
9797
|
+
* A query that will appears when the component initializes or the search term is ''..
|
|
9798
|
+
*/
|
|
9799
|
+
initialQuery;
|
|
9800
|
+
/**
|
|
9801
|
+
* A callback function responsible for rendering a result. Passed to `searchcraft-search-result`.
|
|
9802
|
+
*/
|
|
9803
|
+
template;
|
|
9804
|
+
adClientResponseItems = [];
|
|
9805
|
+
config;
|
|
9806
|
+
isSearchInProgress = true;
|
|
9807
|
+
searchClientResponseItems;
|
|
9808
|
+
searchResultsPage;
|
|
9809
|
+
searchResultsPerPage;
|
|
9810
|
+
searchTerm = '';
|
|
9811
|
+
unsubscribe;
|
|
9812
|
+
cleanupCore;
|
|
9813
|
+
onCoreAvailable(core) {
|
|
9814
|
+
const state = core.store.getState();
|
|
9815
|
+
this.handleStateChange(state);
|
|
9816
|
+
this.searchClientResponseItems = state.searchClientResponseItems;
|
|
9817
|
+
this.searchTerm = state.searchTerm;
|
|
9818
|
+
this.config = state.core?.config;
|
|
9819
|
+
this.unsubscribe = core.store.subscribe((state) => this.handleStateChange(state));
|
|
9820
|
+
}
|
|
9821
|
+
connectedCallback() {
|
|
9822
|
+
this.cleanupCore = registry.useCoreInstance(this.searchcraftId, this.onCoreAvailable.bind(this));
|
|
9823
|
+
}
|
|
9824
|
+
disconnectedCallback() {
|
|
9825
|
+
this.unsubscribe?.();
|
|
9826
|
+
this.cleanupCore?.();
|
|
9827
|
+
}
|
|
9828
|
+
handleStateChange(state) {
|
|
9829
|
+
this.adClientResponseItems = [...state.adClientResponseItems];
|
|
9830
|
+
this.config = state.core?.config;
|
|
9831
|
+
this.isSearchInProgress = state.isSearchInProgress;
|
|
9832
|
+
this.searchClientResponseItems = [...state.searchClientResponseItems];
|
|
9833
|
+
this.searchResultsPage = state.searchResultsPage;
|
|
9834
|
+
this.searchResultsPerPage = state.searchResultsPerPage;
|
|
9835
|
+
this.searchTerm = state.searchTerm;
|
|
9836
|
+
}
|
|
9837
|
+
renderEmptyState() {
|
|
9838
|
+
return (hAsync("div", { class: 'searchcraft-search-results-empty-state' }, hAsync("slot", { name: 'empty-search' })));
|
|
9839
|
+
}
|
|
9840
|
+
renderNoResultsFoundState() {
|
|
9841
|
+
return (hAsync("div", { class: 'searchcraft-search-results' }, hAsync("div", { class: 'searchcraft-search-results-error-message' }, hAsync("searchcraft-error-message", null, "No search results found for \"", this.searchTerm, "\" query."))));
|
|
9842
|
+
}
|
|
9843
|
+
renderWithADMAds() {
|
|
9844
|
+
const items = this.searchClientResponseItems || [];
|
|
9845
|
+
return (hAsync("div", { class: 'searchcraft-search-results' }, this.adClientResponseItems?.map((item) => (hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'adMarketplace', adClientResponseItem: item, key: item.id, renderPosition: 'top' }))), items.map((item, index) => (hAsync("searchcraft-search-result", { "searchcraft-id": this.searchcraftId, key: item.id, "document-position": this.searchResultsPerPage * (this.searchResultsPage - 1) + index, index: index, item: item, template: this.template })))));
|
|
9846
|
+
}
|
|
9847
|
+
renderWithCustomAds() {
|
|
9848
|
+
const itemsToRender = [];
|
|
9849
|
+
const interstitialInterval = this.config?.customAdConfig?.adInterstitialInterval || 0;
|
|
9850
|
+
const interstitialQuantity = this.config?.customAdConfig?.adInterstitialQuantity || 1;
|
|
9851
|
+
const adStartQuantity = this.config?.customAdConfig?.adStartQuantity || 0;
|
|
9852
|
+
const adEndQuantity = this.config?.customAdConfig?.adEndQuantity || 0;
|
|
9853
|
+
const items = this.searchClientResponseItems || [];
|
|
9854
|
+
// Renders ads at beginning
|
|
9855
|
+
for (let n = 0; n < adStartQuantity; n++) {
|
|
9856
|
+
itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Custom', key: `${n}-ad`, renderPosition: 'top' }));
|
|
9839
9857
|
}
|
|
9840
|
-
|
|
9841
|
-
|
|
9842
|
-
|
|
9858
|
+
// Renders search results + interstitial ads
|
|
9859
|
+
items.forEach((item, index) => {
|
|
9860
|
+
if (interstitialInterval &&
|
|
9861
|
+
index % interstitialInterval === 0 &&
|
|
9862
|
+
index + interstitialInterval < items.length &&
|
|
9863
|
+
index >= interstitialInterval) {
|
|
9864
|
+
for (let n = 0; n < interstitialQuantity; n++) {
|
|
9865
|
+
itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Custom', key: `${item.id}-ad-${n}`, renderPosition: 'interstitial' }));
|
|
9866
|
+
}
|
|
9867
|
+
}
|
|
9868
|
+
itemsToRender.push(hAsync("searchcraft-search-result", { "searchcraft-id": this.searchcraftId, key: item.id, "document-position": this.searchResultsPerPage * (this.searchResultsPage - 1) + index, index: index, item: item, template: this.template }));
|
|
9869
|
+
});
|
|
9870
|
+
// Renders ads at end
|
|
9871
|
+
for (let n = 0; n < adEndQuantity; n++) {
|
|
9872
|
+
itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Custom', key: `${n}-ad`, renderPosition: 'bottom' }));
|
|
9843
9873
|
}
|
|
9844
|
-
|
|
9845
|
-
|
|
9846
|
-
|
|
9874
|
+
return hAsync("div", { class: 'searchcraft-search-results' }, itemsToRender);
|
|
9875
|
+
}
|
|
9876
|
+
renderWithNativoAds() {
|
|
9877
|
+
const itemsToRender = [];
|
|
9878
|
+
const interstitialStartIndex = this.config?.nativoConfig?.adInterstialStartIndex || 0;
|
|
9879
|
+
const interstitialInterval = this.config?.nativoConfig?.adInterstitialInterval || 0;
|
|
9880
|
+
const interstitialQuantity = this.config?.nativoConfig?.adInterstitialQuantity || 1;
|
|
9881
|
+
const adStartQuantity = this.config?.nativoConfig?.adStartQuantity || 0;
|
|
9882
|
+
const adEndQuantity = this.config?.nativoConfig?.adEndQuantity || 0;
|
|
9883
|
+
const items = this.searchClientResponseItems || [];
|
|
9884
|
+
// Renders ads at beginning
|
|
9885
|
+
for (let n = 0; n < adStartQuantity; n++) {
|
|
9886
|
+
itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Nativo', key: `${n}-ad`, renderPosition: 'top' }));
|
|
9847
9887
|
}
|
|
9848
|
-
|
|
9849
|
-
|
|
9850
|
-
|
|
9888
|
+
// Renders search results + interstitial ads
|
|
9889
|
+
items.forEach((item, index) => {
|
|
9890
|
+
if (interstitialInterval &&
|
|
9891
|
+
(index + interstitialStartIndex) % interstitialInterval === 0 &&
|
|
9892
|
+
index + interstitialInterval < items.length &&
|
|
9893
|
+
index >= interstitialInterval) {
|
|
9894
|
+
for (let n = 0; n < interstitialQuantity; n++) {
|
|
9895
|
+
itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Nativo', key: `${item.id}-ad-${n}`, renderPosition: 'interstitial' }));
|
|
9896
|
+
}
|
|
9897
|
+
}
|
|
9898
|
+
itemsToRender.push(hAsync("searchcraft-search-result", { "searchcraft-id": this.searchcraftId, key: item.id, "document-position": this.searchResultsPerPage * (this.searchResultsPage - 1) + index, index: index, item: item, template: this.template }));
|
|
9899
|
+
});
|
|
9900
|
+
// Renders ads at end
|
|
9901
|
+
for (let n = 0; n < adEndQuantity; n++) {
|
|
9902
|
+
itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Nativo', key: `${n}-ad`, renderPosition: 'bottom' }));
|
|
9851
9903
|
}
|
|
9852
|
-
|
|
9853
|
-
|
|
9854
|
-
|
|
9904
|
+
return hAsync("div", { class: 'searchcraft-search-results' }, itemsToRender);
|
|
9905
|
+
}
|
|
9906
|
+
renderWithNoAds() {
|
|
9907
|
+
const items = this.searchClientResponseItems || [];
|
|
9908
|
+
return (hAsync("div", { class: 'searchcraft-search-results' }, items.map((item, index) => (hAsync("searchcraft-search-result", { "searchcraft-id": this.searchcraftId, key: item.id, "document-position": this.searchResultsPerPage * (this.searchResultsPage - 1) + index, index: index, item: item, template: this.template })))));
|
|
9909
|
+
}
|
|
9910
|
+
render() {
|
|
9911
|
+
const searchClientResponseItems = this.searchClientResponseItems || [];
|
|
9912
|
+
if (searchClientResponseItems.length === 0 && !this.isSearchInProgress) {
|
|
9913
|
+
return this.renderEmptyState();
|
|
9855
9914
|
}
|
|
9856
|
-
|
|
9857
|
-
|
|
9858
|
-
|
|
9915
|
+
if (this.searchTerm.length > 0 &&
|
|
9916
|
+
searchClientResponseItems.length === 0 &&
|
|
9917
|
+
!this.isSearchInProgress) {
|
|
9918
|
+
return this.renderNoResultsFoundState();
|
|
9859
9919
|
}
|
|
9860
|
-
|
|
9861
|
-
|
|
9862
|
-
break;
|
|
9920
|
+
if (this.config?.customAdConfig) {
|
|
9921
|
+
return this.renderWithCustomAds();
|
|
9863
9922
|
}
|
|
9864
|
-
|
|
9865
|
-
|
|
9866
|
-
break;
|
|
9923
|
+
if (this.config?.admAdConfig) {
|
|
9924
|
+
return this.renderWithNativoAds();
|
|
9867
9925
|
}
|
|
9868
|
-
|
|
9869
|
-
|
|
9870
|
-
break;
|
|
9926
|
+
if (this.config?.nativoConfig) {
|
|
9927
|
+
return this.renderWithNativoAds();
|
|
9871
9928
|
}
|
|
9872
|
-
|
|
9873
|
-
|
|
9874
|
-
|
|
9875
|
-
|
|
9876
|
-
|
|
9877
|
-
|
|
9878
|
-
|
|
9879
|
-
|
|
9929
|
+
return this.renderWithNoAds();
|
|
9930
|
+
}
|
|
9931
|
+
static get cmpMeta() { return {
|
|
9932
|
+
"$flags$": 772,
|
|
9933
|
+
"$tagName$": "searchcraft-search-results",
|
|
9934
|
+
"$members$": {
|
|
9935
|
+
"searchcraftId": [1, "searchcraft-id"],
|
|
9936
|
+
"initialQuery": [1, "initial-query"],
|
|
9937
|
+
"template": [16],
|
|
9938
|
+
"adClientResponseItems": [32],
|
|
9939
|
+
"config": [32],
|
|
9940
|
+
"isSearchInProgress": [32],
|
|
9941
|
+
"searchClientResponseItems": [32],
|
|
9942
|
+
"searchResultsPage": [32],
|
|
9943
|
+
"searchResultsPerPage": [32],
|
|
9944
|
+
"searchTerm": [32]
|
|
9945
|
+
},
|
|
9946
|
+
"$listeners$": undefined,
|
|
9947
|
+
"$lazyBundleId$": "-",
|
|
9948
|
+
"$attrsToReflect$": []
|
|
9949
|
+
}; }
|
|
9950
|
+
}
|
|
9951
|
+
|
|
9952
|
+
/**
|
|
9953
|
+
* This web component is designed to choose the number of search results displayed.
|
|
9954
|
+
*
|
|
9955
|
+
* @react-import
|
|
9956
|
+
* ```jsx
|
|
9957
|
+
* import { SearchcraftSearchResultsPerPage } from "@searchcraft/react-sdk";
|
|
9958
|
+
* ```
|
|
9959
|
+
*
|
|
9960
|
+
* @vue-import
|
|
9961
|
+
* ```jsx
|
|
9962
|
+
* import { SearchcraftSearchResultsPerPage } from "@searchcraft/vue-sdk";
|
|
9963
|
+
* ```
|
|
9964
|
+
*
|
|
9965
|
+
* @js-example
|
|
9966
|
+
* ```html
|
|
9967
|
+
* <!-- index.html -->
|
|
9968
|
+
* <searchcraft-search-results-per-page increment="20" />
|
|
9969
|
+
* ```
|
|
9970
|
+
*
|
|
9971
|
+
* @react-example
|
|
9972
|
+
* ```jsx
|
|
9973
|
+
* <SearchcraftSearchResultsPerPage increment={20} />
|
|
9974
|
+
* ```
|
|
9975
|
+
*
|
|
9976
|
+
* @vue-example
|
|
9977
|
+
* ```jsx
|
|
9978
|
+
* <SearchcraftSearchResultsPerPage increment="20" />
|
|
9979
|
+
* ```
|
|
9980
|
+
*/
|
|
9981
|
+
class SearchcraftSearchResultsPerPage {
|
|
9982
|
+
constructor(hostRef) {
|
|
9983
|
+
registerInstance(this, hostRef);
|
|
9984
|
+
}
|
|
9985
|
+
/**
|
|
9986
|
+
* The amount the options will increase (e.g. 20 = [20, 40, 60, 80, 100]).
|
|
9987
|
+
* The base value is defined by the `searchResultsPerPage` option in the configuration.
|
|
9988
|
+
*/
|
|
9989
|
+
increment = 20;
|
|
9990
|
+
/**
|
|
9991
|
+
* The id of the Searchcraft instance that this component should use.
|
|
9992
|
+
*/
|
|
9993
|
+
searchcraftId;
|
|
9994
|
+
// store vars
|
|
9995
|
+
searchTerm;
|
|
9996
|
+
searchResultsPage;
|
|
9997
|
+
searchResultsPerPage;
|
|
9998
|
+
searchResultsCount;
|
|
9999
|
+
searchResultsPagesCount;
|
|
10000
|
+
searchClientRequestProperties;
|
|
10001
|
+
// local vars
|
|
10002
|
+
initialSearchResultsPerPage;
|
|
10003
|
+
// store functions
|
|
10004
|
+
setSearchResultsPerPage = () => { };
|
|
10005
|
+
setSearchResultsPage = () => { };
|
|
10006
|
+
unsubscribe = () => { };
|
|
10007
|
+
cleanupCore;
|
|
10008
|
+
onCoreAvailable(core) {
|
|
10009
|
+
this.unsubscribe = core.store.subscribe((state) => {
|
|
10010
|
+
// store vars
|
|
10011
|
+
this.searchTerm = state.searchTerm;
|
|
10012
|
+
this.searchResultsPerPage = state.searchResultsPerPage;
|
|
10013
|
+
this.searchResultsPage = state.searchResultsPage;
|
|
10014
|
+
this.searchResultsCount = state.searchResultsCount;
|
|
10015
|
+
this.searchClientRequestProperties = state.searchClientRequestProperties;
|
|
10016
|
+
// local vars
|
|
10017
|
+
this.searchResultsPagesCount = Math.ceil(this.searchResultsCount / this.searchResultsPerPage);
|
|
10018
|
+
// store functions
|
|
10019
|
+
this.setSearchResultsPage = state.setSearchResultsPage;
|
|
10020
|
+
this.setSearchResultsPerPage = state.setSearchResultsPerPage;
|
|
10021
|
+
});
|
|
10022
|
+
this.initialSearchResultsPerPage =
|
|
10023
|
+
core.store.getState().searchResultsPerPage;
|
|
10024
|
+
}
|
|
10025
|
+
connectedCallback() {
|
|
10026
|
+
this.cleanupCore = registry.useCoreInstance(this.searchcraftId, this.onCoreAvailable.bind(this));
|
|
10027
|
+
}
|
|
10028
|
+
disconnectedCallback() {
|
|
10029
|
+
this.unsubscribe?.();
|
|
10030
|
+
this.cleanupCore?.();
|
|
10031
|
+
}
|
|
10032
|
+
render() {
|
|
10033
|
+
// Check if this is an initialQuery case (string requestProperties with empty searchTerm)
|
|
10034
|
+
const isInitialQuery = typeof this.searchClientRequestProperties === 'string' &&
|
|
10035
|
+
this.searchTerm.trim() === '';
|
|
10036
|
+
// early return if there isn't a searchTerm (unless it's initialQuery) or there is 1 or fewer pages of results
|
|
10037
|
+
if ((!this.searchTerm && !isInitialQuery) ||
|
|
10038
|
+
this.searchResultsPagesCount <= 1) {
|
|
10039
|
+
return;
|
|
9880
10040
|
}
|
|
9881
|
-
|
|
10041
|
+
return (hAsync("div", { class: 'searchcraft-search-results-per-page' }, hAsync("div", { class: 'searchcraft-search-results-per-page-select' }, hAsync("label", { class: 'searchcraft-search-results-per-page-select-label', htmlFor: 'searchcraft-search-results-per-page-select-input' }, "Results Per Page"), hAsync("div", { class: 'searchcraft-search-results-per-page-select-input' }, hAsync("searchcraft-select", { inputId: 'searchcraft-search-results-per-page-select-input', name: 'results-per-page', options: [...Array(5)].map((_, index) => {
|
|
10042
|
+
const value = this.initialSearchResultsPerPage +
|
|
10043
|
+
Number(this.increment) * index;
|
|
10044
|
+
return {
|
|
10045
|
+
label: `${value}`,
|
|
10046
|
+
value,
|
|
10047
|
+
};
|
|
10048
|
+
}), onSelectChange: (event) => {
|
|
10049
|
+
this.setSearchResultsPerPage(Number(event.detail));
|
|
10050
|
+
this.setSearchResultsPage(1);
|
|
10051
|
+
} })))));
|
|
9882
10052
|
}
|
|
9883
|
-
return
|
|
9884
|
-
|
|
9885
|
-
|
|
10053
|
+
static get cmpMeta() { return {
|
|
10054
|
+
"$flags$": 768,
|
|
10055
|
+
"$tagName$": "searchcraft-search-results-per-page",
|
|
10056
|
+
"$members$": {
|
|
10057
|
+
"increment": [8],
|
|
10058
|
+
"searchcraftId": [1, "searchcraft-id"],
|
|
10059
|
+
"searchTerm": [32],
|
|
10060
|
+
"searchResultsPage": [32],
|
|
10061
|
+
"searchResultsPerPage": [32],
|
|
10062
|
+
"searchResultsCount": [32],
|
|
10063
|
+
"searchResultsPagesCount": [32],
|
|
10064
|
+
"searchClientRequestProperties": [32],
|
|
10065
|
+
"initialSearchResultsPerPage": [32],
|
|
10066
|
+
"setSearchResultsPerPage": [32],
|
|
10067
|
+
"setSearchResultsPage": [32]
|
|
10068
|
+
},
|
|
10069
|
+
"$listeners$": undefined,
|
|
10070
|
+
"$lazyBundleId$": "-",
|
|
10071
|
+
"$attrsToReflect$": []
|
|
10072
|
+
}; }
|
|
10073
|
+
}
|
|
9886
10074
|
|
|
9887
|
-
|
|
9888
|
-
|
|
9889
|
-
|
|
9890
|
-
|
|
9891
|
-
|
|
9892
|
-
|
|
9893
|
-
|
|
9894
|
-
|
|
9895
|
-
|
|
9896
|
-
|
|
9897
|
-
|
|
9898
|
-
|
|
9899
|
-
|
|
9900
|
-
|
|
9901
|
-
|
|
9902
|
-
|
|
9903
|
-
|
|
9904
|
-
|
|
9905
|
-
|
|
9906
|
-
|
|
9907
|
-
|
|
9908
|
-
|
|
9909
|
-
|
|
9910
|
-
|
|
9911
|
-
|
|
9912
|
-
|
|
9913
|
-
|
|
9914
|
-
|
|
9915
|
-
|
|
9916
|
-
|
|
9917
|
-
|
|
9918
|
-
|
|
9919
|
-
|
|
9920
|
-
|
|
9921
|
-
|
|
9922
|
-
|
|
9923
|
-
|
|
9924
|
-
|
|
9925
|
-
|
|
9926
|
-
|
|
9927
|
-
|
|
9928
|
-
|
|
9929
|
-
|
|
10075
|
+
/**
|
|
10076
|
+
* This web component is designed to allow users to select between a group of options.
|
|
10077
|
+
*
|
|
10078
|
+
* @js-example
|
|
10079
|
+
* ```html
|
|
10080
|
+
* <!-- index.html -->
|
|
10081
|
+
* <searchcraft-select
|
|
10082
|
+
* inputId="searchcraft-select"
|
|
10083
|
+
* name="searchcraft-select"
|
|
10084
|
+
* options="[{ label: 'label', value: 'value' }]"
|
|
10085
|
+
* />
|
|
10086
|
+
* ```
|
|
10087
|
+
*
|
|
10088
|
+
* @internal
|
|
10089
|
+
*/
|
|
10090
|
+
class SearchcraftSelect {
|
|
10091
|
+
constructor(hostRef) {
|
|
10092
|
+
registerInstance(this, hostRef);
|
|
10093
|
+
this.selectChange = createEvent(this, "selectChange");
|
|
10094
|
+
}
|
|
10095
|
+
/**
|
|
10096
|
+
* The caption displayed below the select input.
|
|
10097
|
+
*/
|
|
10098
|
+
caption;
|
|
10099
|
+
/**
|
|
10100
|
+
* Whether the select input is disabled.
|
|
10101
|
+
*/
|
|
10102
|
+
disabled = false;
|
|
10103
|
+
/**
|
|
10104
|
+
* The ID for the select input.
|
|
10105
|
+
*/
|
|
10106
|
+
inputId;
|
|
10107
|
+
/**
|
|
10108
|
+
* The label of the select input.
|
|
10109
|
+
*/
|
|
10110
|
+
label;
|
|
10111
|
+
/**
|
|
10112
|
+
* The ID for the label of the select input.
|
|
10113
|
+
*/
|
|
10114
|
+
labelId;
|
|
10115
|
+
/**
|
|
10116
|
+
* The name of the select input.
|
|
10117
|
+
*/
|
|
10118
|
+
name;
|
|
10119
|
+
/**
|
|
10120
|
+
* The options for the select input.
|
|
10121
|
+
*/
|
|
10122
|
+
options = [];
|
|
10123
|
+
/**
|
|
10124
|
+
* The event fired when the select is changed.
|
|
10125
|
+
*/
|
|
10126
|
+
selectChange;
|
|
10127
|
+
searchResultsPerPage;
|
|
10128
|
+
setSearchResultsPage = () => { };
|
|
10129
|
+
setSearchResultsPerPage = () => { };
|
|
10130
|
+
handleSelectChange = (event) => {
|
|
10131
|
+
this.selectChange.emit(event.target.value);
|
|
10132
|
+
};
|
|
10133
|
+
handleGoToPage(page) {
|
|
10134
|
+
this.setSearchResultsPage(page);
|
|
10135
|
+
}
|
|
10136
|
+
render() {
|
|
10137
|
+
return (hAsync("div", { key: '15ecbf48c824a161cd83bdab99dace8e44f1ab39', class: 'searchcraft-select' }, this.label && (hAsync("label", { key: 'aba433ae9c27c9405099cffcef923c3ad22d7fda', class: 'searchcraft-select-label', id: this.labelId || `${this.inputId}-label`, htmlFor: this.inputId }, this.label)), hAsync("div", { key: '8df8a2ff05924c9c55cdd6e3827cd927cddab82a', class: 'searchcraft-select-input-wrapper' }, hAsync("select", { key: '1d5f492c2255f8ca1b6ea5e04a2726dda2f2c52f', "aria-labelledby": this.label ? this.labelId || `${this.inputId}-label` : undefined, class: 'searchcraft-select-input', disabled: this.disabled, id: this.inputId, name: this.name, onChange: this.handleSelectChange }, (typeof this.options === 'string'
|
|
10138
|
+
? JSON.parse(this.options)
|
|
10139
|
+
: this.options).map(({ label, value, selected }) => {
|
|
10140
|
+
return (hAsync("option", { key: value, value: value, selected: selected }, label));
|
|
10141
|
+
})), hAsync("svg", { key: '0ec6892b529f2e70027aadea47208582a65a97b7', class: 'searchcraft-select-input-icon', width: '20', height: '20', viewBox: '0 0 20 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg' }, hAsync("title", { key: 'bced6b62378491d1d1c629b602d7d033d912c761' }, "Select dropdown icon"), hAsync("path", { key: '659f8ebf9129e2e7941da949d29688c41c1472bb', d: 'M5 7.5L10 12.5L15 7.5', stroke: 'currentColor', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' }))), this.caption && (hAsync("p", { key: '51217d926f68f79b6c3514f5fd769b56549fdce9', class: 'searchcraft-select-caption' }, this.caption))));
|
|
10142
|
+
}
|
|
10143
|
+
static get cmpMeta() { return {
|
|
10144
|
+
"$flags$": 768,
|
|
10145
|
+
"$tagName$": "searchcraft-select",
|
|
10146
|
+
"$members$": {
|
|
10147
|
+
"caption": [1],
|
|
10148
|
+
"disabled": [4],
|
|
10149
|
+
"inputId": [1, "input-id"],
|
|
10150
|
+
"label": [1],
|
|
10151
|
+
"labelId": [1, "label-id"],
|
|
10152
|
+
"name": [1],
|
|
10153
|
+
"options": [1],
|
|
10154
|
+
"searchResultsPerPage": [32],
|
|
10155
|
+
"setSearchResultsPage": [32],
|
|
10156
|
+
"setSearchResultsPerPage": [32]
|
|
10157
|
+
},
|
|
10158
|
+
"$listeners$": undefined,
|
|
10159
|
+
"$lazyBundleId$": "-",
|
|
10160
|
+
"$attrsToReflect$": []
|
|
10161
|
+
}; }
|
|
10162
|
+
}
|
|
9930
10163
|
|
|
9931
|
-
|
|
9932
|
-
|
|
9933
|
-
|
|
9934
|
-
|
|
9935
|
-
|
|
9936
|
-
|
|
9937
|
-
|
|
9938
|
-
|
|
9939
|
-
|
|
9940
|
-
|
|
9941
|
-
|
|
9942
|
-
|
|
9943
|
-
|
|
9944
|
-
|
|
9945
|
-
|
|
9946
|
-
|
|
9947
|
-
|
|
9948
|
-
|
|
9949
|
-
|
|
9950
|
-
|
|
9951
|
-
|
|
9952
|
-
|
|
9953
|
-
|
|
9954
|
-
|
|
9955
|
-
const tableToken = token;
|
|
9956
|
-
for (const cell of tableToken.header) {
|
|
9957
|
-
values = values.concat(this.walkTokens(cell.tokens, callback));
|
|
9958
|
-
}
|
|
9959
|
-
for (const row of tableToken.rows) {
|
|
9960
|
-
for (const cell of row) {
|
|
9961
|
-
values = values.concat(this.walkTokens(cell.tokens, callback));
|
|
10164
|
+
/**
|
|
10165
|
+
* Creates a throttled version of the given function that only invokes
|
|
10166
|
+
* the original function at most once every specified number of milliseconds.
|
|
10167
|
+
*
|
|
10168
|
+
* The logic is written in a way that the last invocation is always called, after the
|
|
10169
|
+
* throttle cooldown period has ended.
|
|
10170
|
+
*
|
|
10171
|
+
* @template Arguments - The argument types for the function to throttle
|
|
10172
|
+
* @param callback - The function to throttle
|
|
10173
|
+
* @param delayInMilliseconds - The number of milliseconds to wait before allowing the next invocation
|
|
10174
|
+
* @returns A throttled version of the original function
|
|
10175
|
+
*/
|
|
10176
|
+
function throttle(callback, delayInMilliseconds) {
|
|
10177
|
+
let isThrottleOnCooldown = false;
|
|
10178
|
+
let trailingCallArgs = null;
|
|
10179
|
+
const invokeAction = (args) => {
|
|
10180
|
+
callback(...args);
|
|
10181
|
+
isThrottleOnCooldown = true;
|
|
10182
|
+
setTimeout(() => {
|
|
10183
|
+
isThrottleOnCooldown = false;
|
|
10184
|
+
if (trailingCallArgs) {
|
|
10185
|
+
const nextArgs = trailingCallArgs;
|
|
10186
|
+
trailingCallArgs = null;
|
|
10187
|
+
invokeAction(nextArgs);
|
|
9962
10188
|
}
|
|
9963
|
-
|
|
9964
|
-
|
|
9965
|
-
|
|
9966
|
-
|
|
9967
|
-
|
|
9968
|
-
values = values.concat(this.walkTokens(listToken.items, callback));
|
|
9969
|
-
break;
|
|
10189
|
+
}, delayInMilliseconds);
|
|
10190
|
+
};
|
|
10191
|
+
return (...args) => {
|
|
10192
|
+
if (!isThrottleOnCooldown) {
|
|
10193
|
+
invokeAction(args);
|
|
9970
10194
|
}
|
|
9971
|
-
|
|
9972
|
-
|
|
9973
|
-
if (this.defaults.extensions?.childTokens?.[genericToken.type]) {
|
|
9974
|
-
this.defaults.extensions.childTokens[genericToken.type].forEach((childTokens) => {
|
|
9975
|
-
const tokens2 = genericToken[childTokens].flat(Infinity);
|
|
9976
|
-
values = values.concat(this.walkTokens(tokens2, callback));
|
|
9977
|
-
});
|
|
9978
|
-
} else if (genericToken.tokens) {
|
|
9979
|
-
values = values.concat(this.walkTokens(genericToken.tokens, callback));
|
|
9980
|
-
}
|
|
10195
|
+
else {
|
|
10196
|
+
trailingCallArgs = args;
|
|
9981
10197
|
}
|
|
9982
|
-
|
|
10198
|
+
};
|
|
10199
|
+
}
|
|
10200
|
+
|
|
10201
|
+
/**
|
|
10202
|
+
* This web component is designed to allow users to select a value from a range defined by a minimum and maximum value. The component renders a slider interface, which can be used to visually choose a value between two boundaries.
|
|
10203
|
+
*
|
|
10204
|
+
* @internal
|
|
10205
|
+
*/
|
|
10206
|
+
class SearchcraftSlider {
|
|
10207
|
+
constructor(hostRef) {
|
|
10208
|
+
registerInstance(this, hostRef);
|
|
10209
|
+
this.rangeChanged = createEvent(this, "rangeChanged");
|
|
9983
10210
|
}
|
|
9984
|
-
|
|
9985
|
-
|
|
9986
|
-
|
|
9987
|
-
|
|
9988
|
-
|
|
9989
|
-
|
|
9990
|
-
|
|
9991
|
-
|
|
9992
|
-
|
|
9993
|
-
|
|
9994
|
-
|
|
9995
|
-
|
|
9996
|
-
|
|
9997
|
-
|
|
9998
|
-
|
|
9999
|
-
|
|
10000
|
-
|
|
10001
|
-
|
|
10002
|
-
|
|
10003
|
-
|
|
10004
|
-
|
|
10005
|
-
|
|
10006
|
-
|
|
10007
|
-
|
|
10008
|
-
|
|
10009
|
-
|
|
10010
|
-
|
|
10011
|
-
|
|
10012
|
-
|
|
10013
|
-
|
|
10014
|
-
|
|
10015
|
-
|
|
10016
|
-
|
|
10017
|
-
|
|
10018
|
-
|
|
10019
|
-
|
|
10020
|
-
|
|
10021
|
-
|
|
10022
|
-
|
|
10023
|
-
|
|
10024
|
-
} else {
|
|
10025
|
-
extensions.startBlock = [ext.start];
|
|
10026
|
-
}
|
|
10027
|
-
} else if (ext.level === "inline") {
|
|
10028
|
-
if (extensions.startInline) {
|
|
10029
|
-
extensions.startInline.push(ext.start);
|
|
10030
|
-
} else {
|
|
10031
|
-
extensions.startInline = [ext.start];
|
|
10032
|
-
}
|
|
10033
|
-
}
|
|
10034
|
-
}
|
|
10035
|
-
}
|
|
10036
|
-
if ("childTokens" in ext && ext.childTokens) {
|
|
10037
|
-
extensions.childTokens[ext.name] = ext.childTokens;
|
|
10038
|
-
}
|
|
10039
|
-
});
|
|
10040
|
-
opts.extensions = extensions;
|
|
10041
|
-
}
|
|
10042
|
-
if (pack.renderer) {
|
|
10043
|
-
const renderer = this.defaults.renderer || new _Renderer(this.defaults);
|
|
10044
|
-
for (const prop in pack.renderer) {
|
|
10045
|
-
if (!(prop in renderer)) {
|
|
10046
|
-
throw new Error(`renderer '${prop}' does not exist`);
|
|
10047
|
-
}
|
|
10048
|
-
if (["options", "parser"].includes(prop)) {
|
|
10049
|
-
continue;
|
|
10050
|
-
}
|
|
10051
|
-
const rendererProp = prop;
|
|
10052
|
-
const rendererFunc = pack.renderer[rendererProp];
|
|
10053
|
-
const prevRenderer = renderer[rendererProp];
|
|
10054
|
-
renderer[rendererProp] = (...args2) => {
|
|
10055
|
-
let ret = rendererFunc.apply(renderer, args2);
|
|
10056
|
-
if (ret === false) {
|
|
10057
|
-
ret = prevRenderer.apply(renderer, args2);
|
|
10058
|
-
}
|
|
10059
|
-
return ret || "";
|
|
10060
|
-
};
|
|
10061
|
-
}
|
|
10062
|
-
opts.renderer = renderer;
|
|
10063
|
-
}
|
|
10064
|
-
if (pack.tokenizer) {
|
|
10065
|
-
const tokenizer = this.defaults.tokenizer || new _Tokenizer(this.defaults);
|
|
10066
|
-
for (const prop in pack.tokenizer) {
|
|
10067
|
-
if (!(prop in tokenizer)) {
|
|
10068
|
-
throw new Error(`tokenizer '${prop}' does not exist`);
|
|
10069
|
-
}
|
|
10070
|
-
if (["options", "rules", "lexer"].includes(prop)) {
|
|
10071
|
-
continue;
|
|
10072
|
-
}
|
|
10073
|
-
const tokenizerProp = prop;
|
|
10074
|
-
const tokenizerFunc = pack.tokenizer[tokenizerProp];
|
|
10075
|
-
const prevTokenizer = tokenizer[tokenizerProp];
|
|
10076
|
-
tokenizer[tokenizerProp] = (...args2) => {
|
|
10077
|
-
let ret = tokenizerFunc.apply(tokenizer, args2);
|
|
10078
|
-
if (ret === false) {
|
|
10079
|
-
ret = prevTokenizer.apply(tokenizer, args2);
|
|
10211
|
+
/**
|
|
10212
|
+
* The maximum value allowed.
|
|
10213
|
+
*/
|
|
10214
|
+
max = 100;
|
|
10215
|
+
/**
|
|
10216
|
+
* The minimum value allowed.
|
|
10217
|
+
*/
|
|
10218
|
+
min = 0;
|
|
10219
|
+
/**
|
|
10220
|
+
* The step amount for the slider inputs.
|
|
10221
|
+
*/
|
|
10222
|
+
step = 1;
|
|
10223
|
+
/** The type of data the sliders are using. */
|
|
10224
|
+
dataType = 'number';
|
|
10225
|
+
/** The date granularity to use. Used to format date labels. */
|
|
10226
|
+
dateGranularity;
|
|
10227
|
+
lowerBound = 0;
|
|
10228
|
+
upperBound = 1;
|
|
10229
|
+
endValue = 0;
|
|
10230
|
+
startValue = 0;
|
|
10231
|
+
lastFocusedHandle = 'max';
|
|
10232
|
+
throttledEmitUpdate = () => { };
|
|
10233
|
+
/**
|
|
10234
|
+
* When the range has changed.
|
|
10235
|
+
* */
|
|
10236
|
+
rangeChanged;
|
|
10237
|
+
connectedCallback() {
|
|
10238
|
+
switch (this.dataType) {
|
|
10239
|
+
case 'number':
|
|
10240
|
+
this.startValue = this.min;
|
|
10241
|
+
this.endValue = this.max;
|
|
10242
|
+
this.lowerBound = this.min;
|
|
10243
|
+
this.upperBound = this.max;
|
|
10244
|
+
break;
|
|
10245
|
+
case 'date': {
|
|
10246
|
+
this.startValue = 0;
|
|
10247
|
+
this.endValue = getDifferenceInUnits(this.dateGranularity || 'year', this.min, this.max);
|
|
10248
|
+
this.lowerBound = 0;
|
|
10249
|
+
this.upperBound = this.endValue;
|
|
10250
|
+
break;
|
|
10080
10251
|
}
|
|
10081
|
-
return ret;
|
|
10082
|
-
};
|
|
10083
10252
|
}
|
|
10084
|
-
|
|
10085
|
-
|
|
10086
|
-
|
|
10087
|
-
|
|
10088
|
-
|
|
10089
|
-
|
|
10090
|
-
|
|
10091
|
-
|
|
10092
|
-
if (["options", "block"].includes(prop)) {
|
|
10093
|
-
continue;
|
|
10094
|
-
}
|
|
10095
|
-
const hooksProp = prop;
|
|
10096
|
-
const hooksFunc = pack.hooks[hooksProp];
|
|
10097
|
-
const prevHook = hooks[hooksProp];
|
|
10098
|
-
if (_Hooks.passThroughHooks.has(prop)) {
|
|
10099
|
-
hooks[hooksProp] = (arg) => {
|
|
10100
|
-
if (this.defaults.async) {
|
|
10101
|
-
return Promise.resolve(hooksFunc.call(hooks, arg)).then((ret2) => {
|
|
10102
|
-
return prevHook.call(hooks, ret2);
|
|
10253
|
+
this.throttledEmitUpdate = throttle(this.emitUpdate, 120);
|
|
10254
|
+
}
|
|
10255
|
+
emitUpdate = async () => {
|
|
10256
|
+
switch (this.dataType) {
|
|
10257
|
+
case 'number':
|
|
10258
|
+
this.rangeChanged?.emit({
|
|
10259
|
+
startValue: this.startValue,
|
|
10260
|
+
endValue: this.endValue,
|
|
10103
10261
|
});
|
|
10104
|
-
|
|
10105
|
-
|
|
10106
|
-
|
|
10107
|
-
|
|
10108
|
-
|
|
10109
|
-
|
|
10110
|
-
|
|
10111
|
-
|
|
10112
|
-
|
|
10113
|
-
|
|
10114
|
-
|
|
10115
|
-
};
|
|
10116
|
-
}
|
|
10262
|
+
break;
|
|
10263
|
+
case 'date': {
|
|
10264
|
+
const granularity = this.dateGranularity || 'year';
|
|
10265
|
+
const startTimestamp = getStartOf(this.min, granularity, this.lowerBound + this.startValue);
|
|
10266
|
+
const endTimestamp = getStartOf(this.min, granularity, this.lowerBound + this.endValue + 1);
|
|
10267
|
+
this.rangeChanged?.emit({
|
|
10268
|
+
startValue: startTimestamp,
|
|
10269
|
+
endValue: endTimestamp,
|
|
10270
|
+
});
|
|
10271
|
+
break;
|
|
10272
|
+
}
|
|
10117
10273
|
}
|
|
10118
|
-
|
|
10119
|
-
|
|
10120
|
-
|
|
10121
|
-
const
|
|
10122
|
-
|
|
10123
|
-
|
|
10124
|
-
|
|
10125
|
-
|
|
10126
|
-
if (walkTokens2) {
|
|
10127
|
-
values = values.concat(walkTokens2.call(this, token));
|
|
10128
|
-
}
|
|
10129
|
-
return values;
|
|
10130
|
-
};
|
|
10131
|
-
}
|
|
10132
|
-
this.defaults = { ...this.defaults, ...opts };
|
|
10133
|
-
});
|
|
10134
|
-
return this;
|
|
10135
|
-
}
|
|
10136
|
-
setOptions(opt) {
|
|
10137
|
-
this.defaults = { ...this.defaults, ...opt };
|
|
10138
|
-
return this;
|
|
10139
|
-
}
|
|
10140
|
-
lexer(src, options2) {
|
|
10141
|
-
return _Lexer.lex(src, options2 ?? this.defaults);
|
|
10142
|
-
}
|
|
10143
|
-
parser(tokens, options2) {
|
|
10144
|
-
return _Parser.parse(tokens, options2 ?? this.defaults);
|
|
10145
|
-
}
|
|
10146
|
-
parseMarkdown(blockType) {
|
|
10147
|
-
const parse2 = (src, options2) => {
|
|
10148
|
-
const origOpt = { ...options2 };
|
|
10149
|
-
const opt = { ...this.defaults, ...origOpt };
|
|
10150
|
-
const throwError = this.onError(!!opt.silent, !!opt.async);
|
|
10151
|
-
if (this.defaults.async === true && origOpt.async === false) {
|
|
10152
|
-
return throwError(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
|
|
10153
|
-
}
|
|
10154
|
-
if (typeof src === "undefined" || src === null) {
|
|
10155
|
-
return throwError(new Error("marked(): input parameter is undefined or null"));
|
|
10156
|
-
}
|
|
10157
|
-
if (typeof src !== "string") {
|
|
10158
|
-
return throwError(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(src) + ", string expected"));
|
|
10159
|
-
}
|
|
10160
|
-
if (opt.hooks) {
|
|
10161
|
-
opt.hooks.options = opt;
|
|
10162
|
-
opt.hooks.block = blockType;
|
|
10163
|
-
}
|
|
10164
|
-
const lexer2 = opt.hooks ? opt.hooks.provideLexer() : blockType ? _Lexer.lex : _Lexer.lexInline;
|
|
10165
|
-
const parser2 = opt.hooks ? opt.hooks.provideParser() : blockType ? _Parser.parse : _Parser.parseInline;
|
|
10166
|
-
if (opt.async) {
|
|
10167
|
-
return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src).then((src2) => lexer2(src2, opt)).then((tokens) => opt.hooks ? opt.hooks.processAllTokens(tokens) : tokens).then((tokens) => opt.walkTokens ? Promise.all(this.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens).then((tokens) => parser2(tokens, opt)).then((html2) => opt.hooks ? opt.hooks.postprocess(html2) : html2).catch(throwError);
|
|
10168
|
-
}
|
|
10169
|
-
try {
|
|
10170
|
-
if (opt.hooks) {
|
|
10171
|
-
src = opt.hooks.preprocess(src);
|
|
10274
|
+
};
|
|
10275
|
+
handleStartValueChange = (event) => {
|
|
10276
|
+
const inputElement = event.target;
|
|
10277
|
+
const value = Number.parseInt(inputElement.value, 10);
|
|
10278
|
+
this.lastFocusedHandle = 'min';
|
|
10279
|
+
if (value <= this.endValue) {
|
|
10280
|
+
this.startValue = value;
|
|
10281
|
+
this.throttledEmitUpdate();
|
|
10172
10282
|
}
|
|
10173
|
-
|
|
10174
|
-
|
|
10175
|
-
|
|
10283
|
+
else {
|
|
10284
|
+
this.startValue = this.endValue;
|
|
10285
|
+
inputElement.value = `${this.endValue}`;
|
|
10176
10286
|
}
|
|
10177
|
-
|
|
10178
|
-
|
|
10287
|
+
};
|
|
10288
|
+
handleEndValueChange = (event) => {
|
|
10289
|
+
const inputElement = event.target;
|
|
10290
|
+
const value = Number.parseInt(inputElement.value, 10);
|
|
10291
|
+
this.lastFocusedHandle = 'max';
|
|
10292
|
+
if (value >= this.startValue) {
|
|
10293
|
+
this.endValue = value;
|
|
10294
|
+
this.throttledEmitUpdate();
|
|
10179
10295
|
}
|
|
10180
|
-
|
|
10181
|
-
|
|
10182
|
-
|
|
10296
|
+
else {
|
|
10297
|
+
this.endValue = this.startValue;
|
|
10298
|
+
inputElement.value = `${this.startValue}`;
|
|
10183
10299
|
}
|
|
10184
|
-
return html2;
|
|
10185
|
-
} catch (e) {
|
|
10186
|
-
return throwError(e);
|
|
10187
|
-
}
|
|
10188
10300
|
};
|
|
10189
|
-
|
|
10190
|
-
|
|
10191
|
-
|
|
10192
|
-
|
|
10193
|
-
|
|
10194
|
-
|
|
10195
|
-
|
|
10196
|
-
|
|
10197
|
-
|
|
10301
|
+
getLabel = (value) => {
|
|
10302
|
+
switch (this.dataType) {
|
|
10303
|
+
case 'number':
|
|
10304
|
+
return `${this.startValue}`;
|
|
10305
|
+
case 'date': {
|
|
10306
|
+
const granularity = this.dateGranularity || 'year';
|
|
10307
|
+
const dateOffset = this.lowerBound + value;
|
|
10308
|
+
const timestamp = getStartOf(this.min, granularity, dateOffset);
|
|
10309
|
+
return getFormattedDateString(this.dateGranularity || 'year', new Date(timestamp));
|
|
10310
|
+
}
|
|
10198
10311
|
}
|
|
10199
|
-
return msg;
|
|
10200
|
-
}
|
|
10201
|
-
if (async) {
|
|
10202
|
-
return Promise.reject(e);
|
|
10203
|
-
}
|
|
10204
|
-
throw e;
|
|
10205
10312
|
};
|
|
10206
|
-
|
|
10207
|
-
|
|
10208
|
-
|
|
10209
|
-
|
|
10210
|
-
|
|
10211
|
-
|
|
10212
|
-
|
|
10313
|
+
render() {
|
|
10314
|
+
const startPercent = ((this.startValue - this.lowerBound) /
|
|
10315
|
+
(this.upperBound - this.lowerBound)) *
|
|
10316
|
+
100;
|
|
10317
|
+
const endPercent = ((this.endValue - this.lowerBound) /
|
|
10318
|
+
(this.upperBound - this.lowerBound)) *
|
|
10319
|
+
100;
|
|
10320
|
+
const startLabel = this.getLabel(this.startValue);
|
|
10321
|
+
const endLabel = this.getLabel(this.endValue);
|
|
10322
|
+
return (hAsync("div", { key: '2c72254f52151edd2e2fa89c092fc788db0b5562', class: 'searchcraft-slider' }, hAsync("div", { key: '98c25badf2c9386d7173ea552e510dcc168e7fc7', class: 'searchcraft-slider-range' }, hAsync("div", { key: '50774db2253e34b1bce68acc0a40b2706cab542d', class: 'searchcraft-slider-active-range', style: {
|
|
10323
|
+
left: `${startPercent}%`,
|
|
10324
|
+
width: `${endPercent - startPercent}%`,
|
|
10325
|
+
} }), hAsync("input", { key: '229afedc1318a63cbd75806805210cf4f5695e6e', class: classNames('searchcraft-slider-input', 'searchcraft-slider-input-min-handle'), max: this.upperBound, min: this.lowerBound, onInput: this.handleStartValueChange.bind(this), step: this.step, style: { zIndex: this.lastFocusedHandle === 'min' ? '2' : '1' }, type: 'range', value: this.startValue }), hAsync("input", { key: '6aa038b01daaba86f501ebbbec30fc6720b549b3', class: classNames('searchcraft-slider-input', 'searchcraft-slider-input-max-handle'), max: this.upperBound, min: this.lowerBound, onInput: this.handleEndValueChange.bind(this), step: this.step, style: { zIndex: this.lastFocusedHandle === 'max' ? '2' : '1' }, type: 'range', value: this.endValue })), hAsync("div", { key: 'f70501538635c3b08ad1e6ac101d0b3192ef8e04', class: 'searchcraft-slider-label' }, hAsync("span", { key: 'ddd539b86774f8900771d77d5ef7eb3a67c98d59', class: 'searchcraft-slider-start-label' }, startLabel), hAsync("span", { key: 'b754a9c8d284e0623032cee6b92f9df88873ec04', class: 'searchcraft-slider-end-label' }, endLabel))));
|
|
10326
|
+
}
|
|
10327
|
+
static get cmpMeta() { return {
|
|
10328
|
+
"$flags$": 768,
|
|
10329
|
+
"$tagName$": "searchcraft-slider",
|
|
10330
|
+
"$members$": {
|
|
10331
|
+
"max": [2],
|
|
10332
|
+
"min": [2],
|
|
10333
|
+
"step": [2],
|
|
10334
|
+
"dataType": [1, "data-type"],
|
|
10335
|
+
"dateGranularity": [1, "date-granularity"],
|
|
10336
|
+
"lowerBound": [32],
|
|
10337
|
+
"upperBound": [32],
|
|
10338
|
+
"endValue": [32],
|
|
10339
|
+
"startValue": [32],
|
|
10340
|
+
"lastFocusedHandle": [32]
|
|
10341
|
+
},
|
|
10342
|
+
"$listeners$": undefined,
|
|
10343
|
+
"$lazyBundleId$": "-",
|
|
10344
|
+
"$attrsToReflect$": []
|
|
10345
|
+
}; }
|
|
10213
10346
|
}
|
|
10214
|
-
marked.options = marked.setOptions = function(options2) {
|
|
10215
|
-
markedInstance.setOptions(options2);
|
|
10216
|
-
marked.defaults = markedInstance.defaults;
|
|
10217
|
-
changeDefaults(marked.defaults);
|
|
10218
|
-
return marked;
|
|
10219
|
-
};
|
|
10220
|
-
marked.getDefaults = _getDefaults;
|
|
10221
|
-
marked.defaults = _defaults;
|
|
10222
|
-
marked.use = function(...args) {
|
|
10223
|
-
markedInstance.use(...args);
|
|
10224
|
-
marked.defaults = markedInstance.defaults;
|
|
10225
|
-
changeDefaults(marked.defaults);
|
|
10226
|
-
return marked;
|
|
10227
|
-
};
|
|
10228
|
-
marked.walkTokens = function(tokens, callback) {
|
|
10229
|
-
return markedInstance.walkTokens(tokens, callback);
|
|
10230
|
-
};
|
|
10231
|
-
marked.parseInline = markedInstance.parseInline;
|
|
10232
|
-
marked.Parser = _Parser;
|
|
10233
|
-
marked.parser = _Parser.parse;
|
|
10234
|
-
marked.Renderer = _Renderer;
|
|
10235
|
-
marked.TextRenderer = _TextRenderer;
|
|
10236
|
-
marked.Lexer = _Lexer;
|
|
10237
|
-
marked.lexer = _Lexer.lex;
|
|
10238
|
-
marked.Tokenizer = _Tokenizer;
|
|
10239
|
-
marked.Hooks = _Hooks;
|
|
10240
|
-
marked.parse = marked;
|
|
10241
10347
|
|
|
10242
10348
|
/**
|
|
10349
|
+
* @deprecated Use `searchcraft-results-summary` instead.
|
|
10350
|
+
* This component is deprecated and will be removed in a future version.
|
|
10351
|
+
* Please update to use `searchcraft-results-summary` which has the same functionality.
|
|
10352
|
+
*
|
|
10243
10353
|
* This component renders a summary box for RAG search result summaries.
|
|
10244
10354
|
* When the user makes a search, a network call is made to retrieve the summary content, which is then
|
|
10245
10355
|
* rendered in this box.
|
|
@@ -10280,9 +10390,9 @@ class SearchcraftSummaryBox {
|
|
|
10280
10390
|
*/
|
|
10281
10391
|
searchcraftId;
|
|
10282
10392
|
summary = '';
|
|
10393
|
+
summaryErrorMessage = '';
|
|
10283
10394
|
isLoading = false;
|
|
10284
10395
|
isSummaryNotEnabled = false;
|
|
10285
|
-
get hostElement() { return getElement(this); }
|
|
10286
10396
|
unsubscribe;
|
|
10287
10397
|
cleanupCore;
|
|
10288
10398
|
onCoreAvailable(core) {
|
|
@@ -10302,9 +10412,8 @@ class SearchcraftSummaryBox {
|
|
|
10302
10412
|
handleStateChange(state) {
|
|
10303
10413
|
this.isLoading = state.isSummaryLoading;
|
|
10304
10414
|
this.isSummaryNotEnabled = state.isSummaryNotEnabled;
|
|
10415
|
+
this.summaryErrorMessage = state.summaryErrorMessage;
|
|
10305
10416
|
this.summary = this.sanitizeMarkdown(state.summary);
|
|
10306
|
-
// Update DOM directly for performance (avoids re-render)
|
|
10307
|
-
this.updateContentElement(state.summary);
|
|
10308
10417
|
}
|
|
10309
10418
|
/**
|
|
10310
10419
|
* Sanitizes and converts markdown to HTML.
|
|
@@ -10312,15 +10421,6 @@ class SearchcraftSummaryBox {
|
|
|
10312
10421
|
sanitizeMarkdown(markdown) {
|
|
10313
10422
|
return purify.sanitize(marked.parse(markdown));
|
|
10314
10423
|
}
|
|
10315
|
-
/**
|
|
10316
|
-
* Updates the content element directly without triggering a re-render.
|
|
10317
|
-
*/
|
|
10318
|
-
updateContentElement(markdown) {
|
|
10319
|
-
const contentElement = this.hostElement?.querySelector('.searchcraft-summary-box-content');
|
|
10320
|
-
if (contentElement) {
|
|
10321
|
-
contentElement.innerHTML = this.sanitizeMarkdown(markdown);
|
|
10322
|
-
}
|
|
10323
|
-
}
|
|
10324
10424
|
/**
|
|
10325
10425
|
* Renders the appropriate content based on current state.
|
|
10326
10426
|
*/
|
|
@@ -10329,12 +10429,12 @@ class SearchcraftSummaryBox {
|
|
|
10329
10429
|
return hAsync("searchcraft-loading", { label: 'LOADING' });
|
|
10330
10430
|
}
|
|
10331
10431
|
if (this.isSummaryNotEnabled) {
|
|
10332
|
-
return (hAsync("div", { class: 'searchcraft-summary-box-content' },
|
|
10432
|
+
return (hAsync("div", { class: 'searchcraft-summary-box-content' }, this.summaryErrorMessage || 'AI summaries are not enabled'));
|
|
10333
10433
|
}
|
|
10334
|
-
return hAsync("div", { class: 'searchcraft-summary-box-content'
|
|
10434
|
+
return (hAsync("div", { class: 'searchcraft-summary-box-content', innerHTML: this.summary }));
|
|
10335
10435
|
}
|
|
10336
10436
|
render() {
|
|
10337
|
-
return hAsync("div", { key: '
|
|
10437
|
+
return hAsync("div", { key: 'a33091962cfbbcf0399e9e15e8346590511090e1', class: 'searchcraft-summary-box' }, this.renderContent());
|
|
10338
10438
|
}
|
|
10339
10439
|
static get cmpMeta() { return {
|
|
10340
10440
|
"$flags$": 768,
|
|
@@ -10342,6 +10442,7 @@ class SearchcraftSummaryBox {
|
|
|
10342
10442
|
"$members$": {
|
|
10343
10443
|
"searchcraftId": [1, "searchcraft-id"],
|
|
10344
10444
|
"summary": [32],
|
|
10445
|
+
"summaryErrorMessage": [32],
|
|
10345
10446
|
"isLoading": [32],
|
|
10346
10447
|
"isSummaryNotEnabled": [32]
|
|
10347
10448
|
},
|
|
@@ -10351,7 +10452,7 @@ class SearchcraftSummaryBox {
|
|
|
10351
10452
|
}; }
|
|
10352
10453
|
}
|
|
10353
10454
|
|
|
10354
|
-
var styles = `[class*=searchcraft-],[class*=searchcraft-] *,[class*=searchcraft-]::before,[class*=searchcraft-]::after,[class*=searchcraft-] *,::before,[class*=searchcraft-] *,::after{box-sizing:border-box;padding:0;margin:0}:root{--sc-text-base-size: 1em;--sc-text-scale-ratio: 1.1;--sc-font-family: sans-serif;--sc-font-bold: 700;--sc-font-normal: 400;--sc-heading-1-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-2-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-3-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-4-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-5-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-6-font-size: calc( var(--sc-text-base-size) / ( var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) ) );--sc-body-font-size: calc(var(--sc-text-base-size));--sc-body-small-font-size: calc( var(--sc-text-base-size) / ( var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) ) )}:root{--sc-border-radius: 8px;--sc-border-radius-sm: calc(var(--sc-border-radius) / 2);--sc-border-radius-lg: calc(var(--sc-border-radius) * 2);--sc-border-radius-xl: calc(var(--sc-border-radius) * 3);--sc-border-radius-2xl: calc(var(--sc-border-radius) * 4);--sc-border-radius-full: 9999px}:root{--sc-breakpoint-sm: 576px;--sc-breakpoint-md: 768px;--sc-breakpoint-lg: 992px}:root{--sc-surface-neutral-primary: var(--sc-color-background, #ffffff);--sc-color-background-hover-computed: hsl( from var(--sc-color-background) h s clamp(10, calc(l + 5), 95) );--sc-surface-neutral-primary-hover: var( --sc-color-background-hover, var(--sc-color-background-hover-computed, #fafafa) );--sc-color-background-active-computed: hsl( from var(--sc-color-background) h s clamp(5, calc(l - 5), 90) );--sc-surface-neutral-primary-active: var( --sc-color-background-active, var(--sc-color-background-active-computed, #f7f7f7) );--sc-surface-neutral-secondary: var( --sc-color-background-secondary, var(--sc-color-background, #f3f3f3) );--sc-color-background-secondary-hover-computed: hsl( from var(--sc-color-background-secondary) h s clamp(10, calc(l + 5), 95) );--sc-surface-neutral-secondary-hover: var( --sc-color-background-hover, var(--sc-color-background-hover-computed, #e6e6e6) );--sc-color-background-secondary-active-computed: hsl( from var(--sc-color-background-secondary) h s clamp(5, calc(l - 5), 90) );--sc-surface-neutral-secondary-active: var( --sc-color-background-secondary-active, var(--sc-color-background-active-computed, #e0e0e0) );--sc-surface-neutral-light: #ffffff;--sc-content-neutral-primary: var(--sc-color-foreground, #292929);--sc-color-foreground-secondary-computed: hsl( from var(--sc-color-foreground) h s clamp(10, calc(l + 5), 90) );--sc-content-neutral-secondary: var( --sc-color-foreground-secondary, var(--sc-color-foreground-secondary-computed, #404040) );--sc-border-neutral: var(--sc-color-border, rgba(0, 0, 0, 0.1));--sc-surface-brand-primary: var(--sc-color-brand, #000000);--sc-color-brand-hover-computed: hsl( from var(--sc-color-brand) h s clamp(20, calc(l + 5), 95) );--sc-surface-brand-primary-hover: var( --sc-color-brand-hover, var(--sc-color-brand-hover-computed, #2e2e2e) );--sc-color-brand-active-computed: hsl( from var(--sc-color-brand) h s clamp(10, calc(l - 5), 85) );--sc-surface-brand-primary-active: var( --sc-color-brand-active, var(--sc-color-brand-active-computed, #292929) );--sc-surface-brand-secondary: var( --sc-color-brand-secondary, var(--sc-color-brand, #e6e6e6) );--sc-color-brand-secondary-hover-computed: hsl( from var(--sc-color-brand-secondary) h s clamp(10, calc(l + 5), 95) );--sc-surface-brand-secondary-hover: var( --sc-color-background-hover, var(--sc-color-background-hover-computed, #ebebeb) );--sc-color-brand-secondary-active-computed: hsl( from var(--sc-color-brand-secondary) h s clamp(5, calc(l - 5), 90) );--sc-surface-brand-secondary-active: var( --sc-color-brand-secondary-active, var(--sc-color-brand-active-computed, #e0e0e0) );--sc-content-brand: var( --sc-color-brand-text, var(--sc-surface-brand-primary) );--sc-content-brand-on-primary: #ffffff;--sc-border-brand: var(--sc-surface-brand-primary);--sc-surface-success-primary: var(--sc-color-success, #008000);--sc-color-success-primary-hover-computed: hsl( from var(--sc-color-success) h s 30 );--sc-surface-success-primary-hover: var( --sc-color-success-primary-hover, var(--sc-color-success-primary-hover-computed, #009900) );--sc-color-success-primary-active-computed: hsl( from var(--sc-color-success) h s 20 );--sc-surface-success-primary-active: var( --sc-color-success-primary-active, var(--sc-color-success-primary-active-computed, #006600) );--sc-color-success-secondary-computed: hsl( from var(--sc-color-success) h s 90 );--sc-surface-success-secondary: var( --sc-color-success-secondary, var(--sc-color-success-secondary-computed, #ccffcc) );--sc-color-success-secondary-hover-computed: hsl( from var(--sc-color-success-secondary) h s 95 );--sc-surface-success-secondary-hover: var( --sc-color-success-secondary-hover, var(--sc-color-success-secondary-hover-computed, #e6ffe6) );--sc-color-success-secondary-active-computed: hsl( from var(--sc-color-success-secondary) h s 85 );--sc-surface-success-secondary-active: var( --sc-color-success-secondary-active, var(--sc-color-success-secondary-active-computed, #b2ffb2) );--sc-content-success: var( --sc-color-brand-text, hsl(from var(--sc-surface-success-primary) h s 30) );--sc-content-success-on-primary: #ffffff;--sc-border-success: var(--sc-surface-success-primary);--sc-surface-caution-primary: var(--sc-color-caution, #cc6600);--sc-color-caution-primary-hover-computed: hsl( from var(--sc-color-caution) h s 30 );--sc-surface-caution-primary-hover: var( --sc-color-caution-primary-hover, var(--sc-color-caution-primary-hover-computed, #e57300) );--sc-color-caution-primary-active-computed: hsl( from var(--sc-color-caution) h s 20 );--sc-surface-caution-primary-active: var( --sc-color-caution-primary-active, var(--sc-color-caution-primary-active-computed, #b25a00) );--sc-color-caution-secondary-computed: hsl( from var(--sc-color-caution) h s 90 );--sc-surface-caution-secondary: var( --sc-color-caution-secondary, var(--sc-color-caution-secondary-computed, #ffd9b3) );--sc-color-caution-secondary-hover-computed: hsl( from var(--sc-color-caution-secondary) h s 95 );--sc-surface-caution-secondary-hover: var( --sc-color-caution-secondary-hover, var(--sc-color-caution-secondary-hover-computed, #ffe5cc) );--sc-color-caution-secondary-active-computed: hsl( from var(--sc-color-caution-secondary) h s 85 );--sc-surface-caution-secondary-active: var( --sc-color-caution-secondary-active, var(--sc-color-caution-secondary-active-computed, #ffcc99) );--sc-content-caution: var( --sc-color-caution-text, hsl(from var(--sc-surface-caution-primary) h s 30) );--sc-content-caution-on-primary: #ffffff;--sc-border-caution: var(--sc-surface-caution-primary);--sc-surface-danger-primary: var(--sc-color-danger, #cc0000);--sc-color-danger-primary-hover-computed: hsl( from var(--sc-color-danger) h s 30 );--sc-surface-danger-primary-hover: var( --sc-color-danger-primary-hover, var(--sc-color-danger-primary-hover-computed, #e50000) );--sc-color-danger-primary-active-computed: hsl( from var(--sc-color-danger) h s 20 );--sc-surface-danger-primary-active: var( --sc-color-danger-primary-active, var(--sc-color-danger-primary-active-computed, #b30000) );--sc-color-danger-secondary-computed: hsl(from var(--sc-color-danger) h s 90);--sc-surface-danger-secondary: var( --sc-color-danger-secondary, var(--sc-color-danger-secondary-computed, #ffcccc) );--sc-color-danger-secondary-hover-computed: hsl( from var(--sc-color-danger-secondary) h s 95 );--sc-surface-danger-secondary-hover: var( --sc-color-danger-secondary-hover, var(--sc-color-danger-secondary-hover-computed, #ffe7e7) );--sc-color-danger-secondary-active-computed: hsl( from var(--sc-color-danger-secondary) h s 85 );--sc-surface-danger-secondary-active: var( --sc-color-danger-secondary-active, var(--sc-color-danger-secondary-active-computed, #ffb3b3) );--sc-content-danger: var( --sc-color-caution-text, hsl(from var(--sc-surface-danger-primary) h s 30) );--sc-content-danger-on-primary: #ffffff;--sc-border-danger: var(--sc-surface-danger-primary);--sc-color-disabled: hsl(from var(--sc-color-page-primary) h s calc(l * 0.5));--sc-surface-disabled: var(--sc-color-disabled, #d9d9d9);--sc-color-disabled-text: hsl( from var(--sc-color-text-primary) h s calc(l * 0.5) );--sc-content-disabled: var(--sc-color-disabled-text, #737373);--sc-content-disabled-on-disabled: var(--sc-color-disabled-text, #737373)}@supports(hanging-punctuation: first) and (font: -apple-system-body) and (-webkit-appearance: none){:root{--sc-color-background-hover-computed: hsl( from var(--sc-color-background) h s clamp(10%, calc(l + 5%), 95%) );--sc-color-background-active-computed: hsl( from var(--sc-color-background) h s clamp(5%, calc(l - 5%), 90%) );--sc-color-foreground-secondary-computed: hsl( from var(--sc-color-foreground) h s clamp(10%, calc(l + 5%), 90%) );--sc-color-brand-hover-computed: hsl( from var(--sc-color-brand) h s clamp(20%, calc(l + 5%), 95%) );--sc-color-brand-active-computed: hsl( from var(--sc-color-brand) h s clamp(10%, calc(l - 5%), 85%) );--sc-color-success-primary-hover-computed: hsl( from var(--sc-color-success) h s 30% );--sc-color-success-primary-active-computed: hsl( from var(--sc-color-success) h s 20% );--sc-color-success-secondary-computed: hsl( from var(--sc-color-success) h s 90% );--sc-color-success-secondary-hover-computed: hsl( from var(--sc-color-success-secondary) h s 95% );--sc-color-success-secondary-active-computed: hsl( from var(--sc-color-success-secondary) h s 85% );--sc-content-success: var( --sc-color-brand-text, hsl(from var(--sc-surface-success-primary) h s 30%) );--sc-color-caution-primary-hover-computed: hsl( from var(--sc-color-caution) h s 30% );--sc-color-caution-primary-active-computed: hsl( from var(--sc-color-caution) h s 20% );--sc-color-caution-secondary-computed: hsl( from var(--sc-color-caution) h s 90% );--sc-color-caution-secondary-hover-computed: hsl( from var(--sc-color-caution-secondary) h s 95% );--sc-color-caution-secondary-active-computed: hsl( from var(--sc-color-caution-secondary) h s 85% );--sc-content-caution: var( --sc-color-caution-text, hsl(from var(--sc-surface-caution-primary) h s 30%) );--sc-color-danger-primary-hover-computed: hsl( from var(--sc-color-danger) h s 30% );--sc-color-danger-primary-active-computed: hsl( from var(--sc-color-danger) h s 20% );--sc-color-danger-secondary-computed: hsl( from var(--sc-color-danger) h s 90% );--sc-color-danger-secondary-hover-computed: hsl( from var(--sc-color-danger-secondary) h s 95% );--sc-color-danger-secondary-active-computed: hsl( from var(--sc-color-danger-secondary) h s 85% );--sc-content-danger: var( --sc-color-caution-text, hsl(from var(--sc-surface-danger-primary) h s 30%) )}}.searchcraft-ad{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased}.searchcraft-ad-no-template{display:flex;flex-direction:column;font-size:.875rem}.searchcraft-ad-no-template>p{margin:0}.searchcraft-adm-ad{display:flex;flex-direction:column;justify-content:center;gap:16px}.searchcraft-search-result{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased}.searchcraft-search-result-no-template{display:flex;flex-direction:column;font-size:.875rem}.searchcraft-search-result-no-template>p{margin:0}.searchcraft-search-results{display:flex;flex-direction:column;justify-content:center;gap:16px}.searchcraft-search-results-empty-state{text-align:center}.searchcraft-search-results-error-message{text-align:center}.searchcraft-button{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);background:none;border:2px solid rgba(0,0,0,0);border-radius:var(--sc-border-radius);cursor:pointer;display:flex;gap:4px;padding:12px;position:relative}.searchcraft-button.searchcraft-button-disabled{cursor:not-allowed}.searchcraft-button-primary{background-color:var(--sc-surface-brand-primary);color:var(--sc-content-brand-on-primary);font-weight:var(--sc-font-bold)}.searchcraft-button-primary:hover{background-color:var(--sc-surface-brand-primary-hover)}.searchcraft-button-primary:focus{border-color:var(--sc-border-primary)}.searchcraft-button-primary:active{background-color:var(--sc-surface-brand-primary-active)}.searchcraft-button-primary.searchcraft-button-disabled,.searchcraft-button-primary.searchcraft-button-disabled:hover,.searchcraft-button-primary.searchcraft-button-disabled:focus,.searchcraft-button-primary.searchcraft-button-disabled:active{background-color:var(--sc-surface-disabled);border-color:rgba(0,0,0,0);color:var(--sc-content-disabled)}.searchcraft-button-tertiary{background-color:var(--sc-surface-neutral-primary);color:var(--sc-content-brand);font-weight:var(--sc-font-normal)}.searchcraft-button-tertiary:hover{background-color:var(--sc-surface-brand-secondary-hover)}.searchcraft-button-tertiary:focus{background-color:var(--sc-surface-neutral-light);border-color:var(--sc-border-primary)}.searchcraft-button-tertiary:active{background-color:var(--sc-surface-brand-secondary-active)}.searchcraft-button-tertiary.searchcraft-button-disabled,.searchcraft-button-tertiary.searchcraft-button-disabled:hover,.searchcraft-button-tertiary.searchcraft-button-disabled:focus,.searchcraft-button-tertiary.searchcraft-button-disabled:active{background-color:var(--sc-surface-neutral-light);border-color:rgba(0,0,0,0);color:var(--sc-content-disabled)}.searchcraft-button-icon{fill:none}.searchcraft-error-message{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-danger);margin:0}.searchcraft-facet-list{display:flex;flex-direction:column;gap:8px;width:100%}.searchcraft-facet-list-checkbox-label{align-items:center;color:var(--sc-content-neutral-primary);display:flex;font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);gap:8px;position:relative;-webkit-font-smoothing:antialiased}.searchcraft-facet-list-checkbox-input-wrapper{position:relative}.searchcraft-facet-list-checkbox-input{align-items:center;appearance:none;background-color:var(--sc-surface-neutral-secondary);border:1px solid var(--sc-surface-disabled);border-radius:var(--sc-border-radius);cursor:pointer;display:flex;height:24px;justify-content:center;width:24px;margin:0}.searchcraft-facet-list-checkbox-input:focus{outline:2px solid var(--sc-surface-brand-primary);outline-offset:2px}.searchcraft-facet-list-checkbox-input:checked{background-color:var(--sc-surface-brand-primary);position:relative}.searchcraft-facet-list-checkbox-input:checked+.searchcraft-facet-list-checkbox-input-check-icon{display:flex}.searchcraft-facet-list-checkbox-input:checked+.searchcraft-facet-list-checkbox-input-dash-icon{display:flex}.searchcraft-facet-child-list{display:flex;flex-direction:column;gap:6px}.searchcraft-facet-child-list-checkbox-label{margin-left:24px}.searchcraft-facet-child-list-checkbox-label:first-child{margin-top:6px}.searchcraft-facet-list-checkbox-input-check-icon{display:none;height:16px;left:50%;position:absolute;margin-top:2px;top:50%;transform:translate(-50%, -50%);width:16px}.searchcraft-facet-list-checkbox-input-dash-icon{display:none;height:3px;left:50%;position:absolute;top:50%;transform:translate(-50%, -50%);width:14px}.searchcraft-facet-list-message{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-disabled);text-align:center}.searchcraft-facet-list-wrapper{display:flex;flex-direction:column;width:100%;min-height:0}.searchcraft-facet-list-content{display:flex;flex-direction:column;gap:8px;min-height:0;flex-shrink:0}.searchcraft-facet-list-view-more{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);background:none;border:none;color:var(--sc-content-brand);cursor:pointer;padding:8px 0;text-align:left;text-decoration:underline}.searchcraft-facet-list-view-more:hover{color:var(--sc-surface-brand-primary-hover)}.searchcraft-facet-list-view-more:focus{outline:2px solid var(--sc-surface-brand-primary);outline-offset:2px}.searchcraft-filter-panel{display:flex;flex-direction:column;gap:16px}.searchcraft-filter-panel-section{display:flex;flex-direction:column;gap:8px}.searchcraft-filter-panel-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);font-weight:var(--sc-font-bold)}[data-toggle-facet-section]{cursor:pointer;display:flex;align-items:center;justify-content:space-between;width:100%;position:relative}[data-toggle-facet-section]::after{content:"›";display:inline-block;font-size:1.5em;line-height:1;margin-left:auto;flex-shrink:0;transition:transform .2s ease;transform-origin:center}[data-toggle-facet-section][data-facet-section-collapsed]::after{transform:rotate(90deg)}[data-toggle-facet-section][data-facet-section-expanded]::after{transform:rotate(-90deg)}@media(max-width: 767px){[data-toggle-filter-panel]{cursor:pointer;display:flex !important;align-items:center;justify-content:space-between;width:100%}[data-toggle-filter-panel]::after{content:"›";display:inline-block;font-size:1.5em;line-height:1;margin-left:auto;flex-shrink:0;transition:transform .2s ease;transform-origin:center}[data-toggle-filter-panel][data-filter-panel-collapsed]::after{transform:rotate(90deg)}[data-toggle-filter-panel][data-filter-panel-expanded]::after{transform:rotate(-90deg)}}@media(min-width: 768px){[data-toggle-filter-panel]{cursor:default}[data-toggle-filter-panel]::after{display:none}}:root{--sc-input-form-border-radius: var(--sc-border-radius);--sc-input-form-search-icon-size: 20px;--sc-input-form-clear-icon-size: 20px}.searchcraft-input-form-grid{display:grid;gap:4px 8px}.searchcraft-input-form-grid-button-left{grid-template-rows:repeat(3, auto);grid-template-columns:auto 1fr}.searchcraft-input-form-grid-button-left .searchcraft-input-form-button{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-form-grid-button-left .searchcraft-input-form-label{grid-column:2/span 1;grid-row:1/span 1}.searchcraft-input-form-grid-button-left .searchcraft-input-form-error-message{grid-column:2/span 1;grid-row:3/span 1}.searchcraft-input-form-grid-button-left .searchcraft-input-form-input-wrapper{grid-column:2/span 1;grid-row:2/span 1}.searchcraft-input-form-grid-button-right{grid-template-rows:repeat(3, auto);grid-template-columns:1fr auto}.searchcraft-input-form-grid-button-right .searchcraft-input-form-button{grid-column:2/span 1;grid-row:2/span 1}.searchcraft-input-form-grid-button-right .searchcraft-input-form-label{grid-column:1/span 1;grid-row:1/span 1}.searchcraft-input-form-grid-button-right .searchcraft-input-form-error-message{grid-column:1/span 1;grid-row:3/span 1}.searchcraft-input-form-grid-button-right .searchcraft-input-form-input-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-form-grid-button-none{grid-template-rows:repeat(3, auto);grid-template-columns:auto}.searchcraft-input-form-grid-button-none .searchcraft-input-form-button{display:none}.searchcraft-input-form-grid-button-none .searchcraft-input-form-label{grid-column:1/span 1;grid-row:1/span 1}.searchcraft-input-form-grid-button-none .searchcraft-input-form-error-message{grid-column:1/span 1;grid-row:3/span 1}.searchcraft-input-form-grid-button-none .searchcraft-input-form-input-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-form-input-wrapper{display:flex;position:relative}.searchcraft-input-form-input{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);background-color:var(--sc-surface-neutral-secondary);border-radius:var(--sc-input-form-border-radius);border:none;color:var(--sc-content-neutral-primary);flex:1;outline:none;padding:12px 44px}.searchcraft-input-form-input::placeholder{color:var(--sc-content-disabled)}.searchcraft-input-form-input:focus{outline:var(--sc-border-brand) solid 2px;outline-offset:-1px}.searchcraft-input-form-input.searchcraft-placeholder-hide-on-focus:focus::placeholder{opacity:0}.searchcraft-input-form-error{color:var(--sc-content-danger);outline:var(--sc-border-danger) solid 2px}.searchcraft-input-form-error:focus{outline:var(--sc-border-danger) solid 2px}.searchcraft-input-form-input-icon{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:absolute;pointer-events:none;top:0;width:44px}.searchcraft-input-form-input-search-icon{color:var(--sc-content-neutral-secondary);fill:none;height:var(--sc-input-form-search-icon-size);pointer-events:none;width:var(--sc-input-form-search-icon-size)}.searchcraft-input-form-clear-button{all:unset;align-items:center;bottom:0;border:none;cursor:pointer;display:flex;justify-content:center;outline:none;position:absolute;right:0;top:0;width:44px}.searchcraft-input-form-clear-icon{color:var(--sc-content-brand);fill:none;height:var(--sc-input-form-clear-icon-size);width:var(--sc-input-form-clear-icon-size)}.searchcraft-input-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-neutral-primary);font-weight:var(--sc-font-bold);margin-top:4px;margin-bottom:4px}:root{--sc-popover-button-border-radius: var(--sc-border-radius)}@media(min-width: 576px){:root{--sc-popover-button-border-radius: var(--sc-border-radius-lg)}}.searchcraft-popover-button{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);cursor:pointer}.searchcraft-popover-button-skeuomorphic{appearance:none;background:none;border:none;color:var(--sc-content-neutral-primary);display:block;width:100%}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-wrapper{border:1px solid var(--sc-border-neutral);border-radius:var(--sc-popover-button-border-radius);box-shadow:0 1px 1px rgb(from var(--sc-content-neutral-secondary) r g b/10%) inset,0 2px 4px rgb(from var(--sc-content-neutral-secondary) r g b/5%) inset;display:flex;gap:24px;height:40px;justify-content:space-between;line-height:1;padding:4px 5px 4px 10px;background:var(--sc-surface-neutral-primary)}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-wrapper{box-shadow:0 1px 1px rgb(from var(--sc-content-neutral-secondary) r g b/10%) inset,0 2px 2px rgb(from var(--sc-content-neutral-secondary) r g b/5%) inset,0 4px 4px rgb(from var(--sc-content-neutral-secondary) r g b/5%) inset;height:63px;padding:8px 10px 8px 16px}}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-input{align-items:center;display:flex;gap:4px}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-input{gap:8px}}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps{color:var(--sc-content-neutral-secondary);display:flex;gap:4px;font-size:20px;font-weight:500}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps{gap:8px}}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap{border-radius:calc(var(--sc-popover-button-border-radius) - 3px);border-radius:calc(var(var(--sc-popover-button-border-radius)) - 3px);background-color:var(--sc-surface-neutral-primary);box-shadow:0 3px hsl(from var(--sc-surface-neutral-secondary) h s calc(l - 5)),0 1px 2px rgb(from var(--sc-content-neutral-secondary) r g b/10%),0 6px 4px rgb(from var(--sc-content-neutral-secondary) r g b/5%);height:calc(100% - 2px);position:relative}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap{border-radius:calc(var(--sc-popover-button-border-radius) - 8px);border-radius:calc(var(var(--sc-popover-button-border-radius)) - 8px);box-shadow:0 4px hsl(from var(--sc-surface-neutral-secondary) h s calc(l - 5)),0 1px 2px rgb(from var(--sc-content-neutral-secondary) r g b/15%),0 6px 1px rgb(from var(--sc-content-neutral-secondary) r g b/20%),0 7px 2px rgb(from var(--sc-content-neutral-secondary) r g b/15%),0 9px 4px rgb(from var(--sc-content-neutral-secondary) r g b/10%),0 13px 8px rgb(from var(--sc-content-neutral-secondary) r g b/5%);height:calc(100% - 5px)}}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap::before,.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap::after{content:"";display:block}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap::before{border-radius:calc(var(--sc-popover-button-border-radius) - 4px);border-radius:calc(var(var(--sc-popover-button-border-radius)) - 4px);background:linear-gradient(340deg, rgb(from var(--sc-surface-neutral-secondary) r g b/2%) 0%, var(--sc-surface-neutral-secondary) 100%);inset:2px;position:absolute}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap::before{border-radius:calc(var(--sc-popover-button-border-radius) - 12px);border-radius:calc(var(var(--sc-popover-button-border-radius)) - 12px);inset:4px}}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap::after{aspect-ratio:1/1;height:100%}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap>span{display:flex;line-height:1;left:50%;margin-top:2%;position:absolute;top:50%;transform:translate(-50%, -50%)}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-input-search-icon{height:60%;width:auto}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-input-search-icon{height:50%}}:root{--sc-popover-list-view-height: 600px;--sc-popover-modal-max-width: 800px}.searchcraft-popover-form{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);display:flex;flex:1;flex-direction:column}.searchcraft-popover-form searchcraft-input-form,.searchcraft-popover-form searchcraft-popover-footer{width:100%}.searchcraft-popover-form.searchcraft-popover-form-active .searchcraft-popover-form-input{padding-bottom:1px}.searchcraft-popover-form searchcraft-popover-list-view{flex-shrink:1;height:100%;min-height:0;overflow:auto;padding:0 24px}.searchcraft-popover-form searchcraft-summary-box{margin-bottom:16px}.searchcraft-popover-form-input{display:flex;flex-direction:row;gap:12px}.searchcraft-popover-form-input .searchcraft-input-form-input{background-color:var(--sc-surface-neutral-primary);border:1px solid var(--sc-border-neutral);border-radius:var(--sc-border-radius-lg);box-shadow:0 1px 1px rgb(from var(--sc-content-neutral-primary) r g b/10%) inset,0 2px 2px rgb(from var(--sc-content-neutral-primary) r g b/5%) inset,0 4px 4px rgb(from var(--sc-content-neutral-primary) r g b/5%) inset;width:0}.searchcraft-popover-form-cancel-button{background:none;border:none;cursor:pointer;font-size:14px}.searchcraft-popover-form-modal-input,.searchcraft-popover-form-fullscreen-input{padding:24px}.searchcraft-popover-form-modal-popover-list-view,.searchcraft-popover-form-fullscreen-popover-list-view{flex-grow:1;flex-shrink:1;min-height:0;overflow:auto;padding:0 24px}.searchcraft-popover-form-modal-popover-list-view searchcraft-summary-box,.searchcraft-popover-form-fullscreen-popover-list-view searchcraft-summary-box{padding:20px 0;margin-bottom:0;border-bottom:1px solid var(--sc-border-neutral-subtle)}.searchcraft-popover-form-inline{background-color:var(--sc-surface-neutral-primary);border:1px solid rgba(0,0,0,0);border-radius:var(--sc-border-radius-xl);padding:12px;position:relative}.searchcraft-popover-form-inline.searchcraft-popover-form-active{border:1px solid var(--sc-border-neutral);border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;padding-bottom:1px}.searchcraft-popover-form-inline searchcraft-popover-list-view{padding:0 12px}.searchcraft-popover-form-inline .searchcraft-input-form-input,.searchcraft-popover-form-inline .searchcraft-popover-list-item-link,.searchcraft-popover-form-inline .searchcraft-adm-ad-link{border-radius:calc(--sc-border-radius-xl - 12px);border-radius:calc(var(--sc-border-radius-xl) - 12px)}.searchcraft-popover-form-inline-wrapper{background-color:var(--sc-surface-neutral-primary);border:1px solid var(--sc-border-neutral);border-top:none;border-bottom-left-radius:var(--sc-border-radius-xl);border-bottom-right-radius:var(--sc-border-radius-xl);display:flex;flex-direction:column;left:-1px;max-height:var(--sc-popover-list-view-height);overflow:hidden;position:absolute;right:-1px;top:100%}.searchcraft-popover-form-inline-wrapper searchcraft-summary-box{padding:16px 12px;margin-bottom:0;border-bottom:1px solid var(--sc-border-neutral-subtle)}.searchcraft-popover-form-modal{align-items:center;display:flex;inset:0;position:fixed;z-index:1000}.searchcraft-popover-form-modal .searchcraft-input-form-input,.searchcraft-popover-form-modal .searchcraft-popover-list-item-link,.searchcraft-popover-form-modal .searchcraft-adm-ad-link{border-radius:calc(--sc-border-radius-2xl - 20px);border-radius:calc(var(--sc-border-radius-2xl) - 20px)}.searchcraft-popover-form-modal-backdrop{background-color:rgb(from var(--sc-content-neutral-primary) r g b/50%);display:none;inset:0;position:fixed}@media(min-width: 576px){.searchcraft-popover-form-modal-backdrop{display:block}}.searchcraft-popover-form-modal-wrapper{background-color:var(--sc-surface-neutral-primary);box-shadow:1px 2px rgb(from var(--sc-content-neutral-primary) r g b/7%),0 2px 4px rgb(from var(--sc-content-neutral-primary) r g b/7%),0 4px 8px rgb(from var(--sc-content-neutral-primary) r g b/7%),0 8px 16px rgb(from var(--sc-content-neutral-primary) r g b/7%),0 16px 32px rgb(from var(--sc-content-neutral-primary) r g b/7%),0 32px 64px rgb(from var(--sc-content-neutral-primary) r g b/7%);display:flex;flex-direction:column;inset:0;max-width:var(--sc-popover-modal-max-width);overflow:hidden;position:absolute;width:100%;z-index:1001}@media(min-width: 576px){.searchcraft-popover-form-modal-wrapper{border-radius:var(--sc-border-radius-2xl);inset:0;margin-top:100px;max-height:var(--sc-popover-list-view-height);max-width:var(--sc-popover-modal-max-width);position:relative}}.searchcraft-popover-form-modal-cancel-button{border-radius:calc(--sc-border-radius-2xl - 20px);border-radius:calc(var(--sc-border-radius-2xl) - 20px);padding:8px}@media(min-width: 576px){.searchcraft-popover-form-modal-cancel-button{padding:8px 12px}}.searchcraft-popover-form-fullscreen{background-color:var(--sc-surface-neutral-primary);display:flex;flex-direction:column;justify-content:space-between;inset:0;position:fixed;z-index:1000}.searchcraft-popover-form-fullscreen .searchcraft-popover-list-item-link,.searchcraft-popover-form-fullscreen .searchcraft-adm-ad-link{border-radius:var(--sc-border-radius-lg)}.searchcraft-popover-form-fullscreen-cancel-button{border-radius:var(--sc-border-radius-lg);padding:8px}@media(min-width: 576px){.searchcraft-popover-form-fullscreen-cancel-button{padding:8px 12px}}.searchcraft-popover-footer{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;background-color:var(--sc-surface-neutral-secondary);box-shadow:0 1px 1px rgb(from var(--sc-content-neutral-primary) r g b/10%) inset,0 2px 2px rgb(from var(--sc-content-neutral-primary) r g b/5%) inset,0 4px 4px rgb(from var(--sc-content-neutral-primary) r g b/5%) inset;display:flex;gap:8px;justify-content:space-between;line-height:1;padding:20px 24px}@media(min-width: 576px){.searchcraft-popover-footer{padding:20px 32px}}.searchcraft-popover-footer-results-info{margin:0}.searchcraft-popover-footer-link{align-items:center;color:var(--sc-content-neutral-primary);display:flex;max-width:160px;padding-top:6px;width:100%}.searchcraft-popover-footer-results{align-items:center;display:flex;gap:8px}.searchcraft-popover-footer-view-all{align-items:center;border-radius:999px;border:1px solid var(--sc-border-neutral-strong);color:var(--sc-content-neutral-primary);display:inline-flex;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-bold);gap:6px;line-height:1;padding:6px 10px;text-decoration:none}.searchcraft-popover-footer-view-all-shortcut{display:inline-flex;gap:2px}.searchcraft-popover-footer-view-all-shortcut kbd{background-color:var(--sc-surface-neutral-primary);border-radius:4px;border:1px solid var(--sc-border-neutral-subtle);line-height:1;padding:1px 4px}:root{--sc-popover-list-item-image-fit: contain}.searchcraft-popover-list-item{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;border-bottom:1px solid var(--sc-border-neutral);padding:12px 0}searchcraft-popover-list-item:last-child .searchcraft-popover-list-item{border-bottom:none}.searchcraft-popover-list-item-link{align-items:flex-start;color:var(--sc-content-neutral-primary);display:flex;gap:24px;padding:12px;text-decoration:none}.searchcraft-popover-list-item-link:focus,.searchcraft-popover-list-item-link:active{background-color:var(--sc-surface-neutral-primary-active)}.searchcraft-popover-list-item-link:hover{background-color:var(--sc-surface-neutral-primary-hover)}.searchcraft-popover-list-item-image-wrapper{align-items:center;aspect-ratio:16/9;display:flex;flex-shrink:0;justify-content:center;width:160px}.searchcraft-popover-list-item-image{height:100%;object-fit:var(--sc-popover-list-item-image-fit);width:100%}.searchcraft-popover-list-item-content{display:flex;flex-direction:column;flex-grow:1;gap:4px;justify-content:center}.searchcraft-popover-list-item-content-title,.searchcraft-popover-list-item-content-subtitle{display:-webkit-box;line-clamp:2;margin:0;overflow:hidden;-webkit-line-clamp:2;-webkit-box-orient:vertical}.searchcraft-popover-list-item-content-title{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-heading-5-font-size);font-weight:var(--sc-font-bold)}.searchcraft-popover-list-item-content-subtitle{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal)}.searchcraft-popover-list-view{display:flex;flex-direction:column}.searchcraft-results-info{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-primary);margin:0}.searchcraft-slider{align-items:center;display:flex;flex-direction:column;gap:10px;width:100%;margin-top:4px}.searchcraft-slider-range{align-items:center;background-color:var(--sc-surface-disabled);border-radius:999px;display:flex;position:relative;height:4px;width:100%}.searchcraft-slider-range::-webkit-slider-runnable-track{pointer-events:none}.searchcraft-slider-range .searchcraft-slider-active-range{background-color:var(--sc-surface-brand-primary);border-radius:2px;height:4px;position:absolute;top:50%;transform:translateY(-50%);z-index:0}.searchcraft-slider-range .searchcraft-slider-active-range::-webkit-slider-runnable-track{pointer-events:none}.searchcraft-slider-range .searchcraft-slider-active-range::-moz-range-track{pointer-events:none}.searchcraft-slider-range .searchcraft-slider-input{appearance:none;background:rgba(0,0,0,0);border-radius:2px;height:4px;margin:0;outline:none;pointer-events:none;position:absolute;width:100%;-webkit-appearance:none}.searchcraft-slider-range .searchcraft-slider-input::-webkit-slider-thumb{background-color:var(--sc-surface-neutral-light);border-radius:50%;border:1px solid var(--sc-border-neutral);cursor:pointer;height:18px;pointer-events:all;width:18px;-webkit-appearance:none}.searchcraft-slider-range .searchcraft-slider-input::-moz-range-thumb{background-color:var(--sc-surface-neutral-light);border-radius:50%;border:1px solid var(--sc-border-neutral);cursor:pointer;height:18px;pointer-events:all;width:18px}.searchcraft-slider-range .searchcraft-slider-input:focus::-webkit-slider-thumb{outline:2px solid var(--sc-surface-brand-primary)}.searchcraft-slider-range .searchcraft-slider-input:focus::-moz-range-thumb{outline:2px solid var(--sc-surface-brand-primary)}.searchcraft-slider-label{color:var(--sc-content-primary);display:flex;font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);justify-content:space-between;margin-top:4px;width:100%}.searchcraft-slider-start-label,.searchcraft-slider-end-label{min-width:30px;text-align:center}.searchcraft-toggle-button{align-items:flex-start;display:flex;gap:10px;justify-content:space-between}.searchcraft-toggle-button-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-neutral-primary);margin:0}.searchcraft-toggle-button-sub-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-neutral-secondary);margin:0}.searchcraft-toggle-button-background{background:var(--sc-surface-disabled);border-radius:var(--sc-border-radius-full);border:none;cursor:pointer;flex-shrink:0;height:26px;position:relative;transition:background-color .2s;width:44px}.searchcraft-toggle-button-handle{background:var(--sc-surface-neutral-light);border-radius:50%;height:18px;left:4px;position:absolute;top:calc(50% - 9px);transition:transform .3s ease;width:18px}.searchcraft-toggle-button-active .searchcraft-toggle-button-background{background:var(--sc-surface-brand-primary);box-shadow:0px 0px 0px 1px rgba(0,0,0,.05)}.searchcraft-toggle-button-active .searchcraft-toggle-button-handle{transform:translateX(16px)}.searchcraft-pagination{display:inline-grid;gap:16px;grid-template-columns:repeat(3, auto);grid-template-rows:1fr}.searchcraft-pagination-list{border:1px solid var(--sc-border-neutral);border-radius:var(--sc-border-radius);display:flex;list-style-type:none;margin:0;overflow:hidden;padding:0;width:auto}.searchcraft-pagination-list li{border-right:1px solid var(--sc-border-neutral);height:100%;min-height:44px;width:44px}.searchcraft-pagination-list li:last-child{border-right:none}.searchcraft-pagination-item{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);align-items:center;background-color:var(--sc-surface-neutral-primary);border:none;display:flex;height:100%;justify-content:center;width:100%}.searchcraft-pagination-item-active{background-color:var(--sc-surface-brand-secondary);font-weight:var(--sc-font-bold)}.searchcraft-pagination-control{border:1px solid var(--sc-border-neutral);border-radius:var(--sc-border-radius)}.searchcraft-pagination-range{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);align-items:center;display:flex}.searchcraft-select{display:flex;flex-direction:column;gap:4px}.searchcraft-select-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);font-weight:var(--sc-font-bold)}.searchcraft-select-input-wrapper{position:relative}.searchcraft-select-input{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);appearance:none;background-color:var(--sc-surface-neutral-secondary);border:2px solid rgba(0,0,0,0);border-radius:var(--sc-border-radius);cursor:pointer;height:44px;padding:0 44px 0 16px;width:100%}.searchcraft-select-input:hover{background-color:var(--sc-surface-neutral-secondary-hover)}.searchcraft-select-input:active{background-color:var(--sc-surface-neutral-secondary-active)}.searchcraft-select-input:focus{border-color:var(--sc-border-brand);outline:none}.searchcraft-select-input-icon{fill:none;pointer-events:none;position:absolute;right:12px;top:50%;transform:translateY(-50%)}.searchcraft-select-caption{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal)}.searchcraft-search-results-per-page{display:flex}.searchcraft-search-results-per-page-select{align-items:center;display:flex;gap:12px}.searchcraft-search-results-per-page-select-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal)}.searchcraft-search-results-per-page-select-input{min-width:120px}.searchcraft-summary-box{padding:20px;border-radius:var(--sc-border-radius);background-color:var(--sc-surface-neutral-secondary);position:relative;min-height:200px;color:var(--sc-content-neutral-primary);font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal)}.searchcraft-summary-box h1,.searchcraft-summary-box h2,.searchcraft-summary-box h3,.searchcraft-summary-box h4,.searchcraft-summary-box h5{padding-top:10px;padding-bottom:10px}.searchcraft-summary-box p{padding-bottom:10px}.searchcraft-summary-box img{max-width:200px}.searchcraft-summary-box ol,.searchcraft-summary-box ul{padding-left:1em;padding-bottom:10px}.searchcraft-summary-box a{color:var(--sc-content-brand)}.searchcraft-loading{display:flex;flex-direction:column;align-items:center;gap:12px;position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}.searchcraft-loading-dots{display:flex;gap:8px;align-items:center;height:40px}.searchcraft-loading-dots>div{width:10px;height:10px;border-radius:50%;background-color:var(--sc-surface-brand-primary);animation:searchcraft-jump .6s ease-in-out infinite}.searchcraft-loading-dots .searchcraft-loading-dot-2{animation-delay:.15s}.searchcraft-loading-dots .searchcraft-loading-dot-3{animation-delay:.3s}.searchcraft-loading-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);letter-spacing:2px;color:#828282;margin:0}@keyframes searchcraft-jump{0%{transform:translateY(0);animation-timing-function:cubic-bezier(0.33, 1, 0.68, 1)}50%{transform:translateY(-20px);animation-timing-function:cubic-bezier(0.32, 0, 0.67, 0)}100%{transform:translateY(0)}}/*# sourceMappingURL=hologram.css.map */
|
|
10455
|
+
var styles = `[class*=searchcraft-],[class*=searchcraft-] *,[class*=searchcraft-]::before,[class*=searchcraft-]::after,[class*=searchcraft-] *,::before,[class*=searchcraft-] *,::after{box-sizing:border-box;padding:0;margin:0}:root{--sc-text-base-size: 1em;--sc-text-scale-ratio: 1.1;--sc-font-family: sans-serif;--sc-font-bold: 700;--sc-font-normal: 400;--sc-heading-1-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-2-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-3-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-4-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-5-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-6-font-size: calc( var(--sc-text-base-size) / ( var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) ) );--sc-body-font-size: calc(var(--sc-text-base-size));--sc-body-small-font-size: calc( var(--sc-text-base-size) / ( var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) ) )}:root{--sc-border-radius: 8px;--sc-border-radius-sm: calc(var(--sc-border-radius) / 2);--sc-border-radius-lg: calc(var(--sc-border-radius) * 2);--sc-border-radius-xl: calc(var(--sc-border-radius) * 3);--sc-border-radius-2xl: calc(var(--sc-border-radius) * 4);--sc-border-radius-full: 9999px}:root{--sc-breakpoint-sm: 576px;--sc-breakpoint-md: 768px;--sc-breakpoint-lg: 992px}:root{--sc-surface-neutral-primary: var(--sc-color-background, #ffffff);--sc-color-background-hover-computed: hsl( from var(--sc-color-background) h s clamp(10, calc(l + 5), 95) );--sc-surface-neutral-primary-hover: var( --sc-color-background-hover, var(--sc-color-background-hover-computed, #fafafa) );--sc-color-background-active-computed: hsl( from var(--sc-color-background) h s clamp(5, calc(l - 5), 90) );--sc-surface-neutral-primary-active: var( --sc-color-background-active, var(--sc-color-background-active-computed, #f7f7f7) );--sc-surface-neutral-secondary: var( --sc-color-background-secondary, var(--sc-color-background, #f3f3f3) );--sc-color-background-secondary-hover-computed: hsl( from var(--sc-color-background-secondary) h s clamp(10, calc(l + 5), 95) );--sc-surface-neutral-secondary-hover: var( --sc-color-background-hover, var(--sc-color-background-hover-computed, #e6e6e6) );--sc-color-background-secondary-active-computed: hsl( from var(--sc-color-background-secondary) h s clamp(5, calc(l - 5), 90) );--sc-surface-neutral-secondary-active: var( --sc-color-background-secondary-active, var(--sc-color-background-active-computed, #e0e0e0) );--sc-surface-neutral-light: #ffffff;--sc-content-neutral-primary: var(--sc-color-foreground, #292929);--sc-color-foreground-secondary-computed: hsl( from var(--sc-color-foreground) h s clamp(10, calc(l + 5), 90) );--sc-content-neutral-secondary: var( --sc-color-foreground-secondary, var(--sc-color-foreground-secondary-computed, #404040) );--sc-border-neutral: var(--sc-color-border, rgba(0, 0, 0, 0.1));--sc-surface-brand-primary: var(--sc-color-brand, #000000);--sc-color-brand-hover-computed: hsl( from var(--sc-color-brand) h s clamp(20, calc(l + 5), 95) );--sc-surface-brand-primary-hover: var( --sc-color-brand-hover, var(--sc-color-brand-hover-computed, #2e2e2e) );--sc-color-brand-active-computed: hsl( from var(--sc-color-brand) h s clamp(10, calc(l - 5), 85) );--sc-surface-brand-primary-active: var( --sc-color-brand-active, var(--sc-color-brand-active-computed, #292929) );--sc-surface-brand-secondary: var( --sc-color-brand-secondary, var(--sc-color-brand, #e6e6e6) );--sc-color-brand-secondary-hover-computed: hsl( from var(--sc-color-brand-secondary) h s clamp(10, calc(l + 5), 95) );--sc-surface-brand-secondary-hover: var( --sc-color-background-hover, var(--sc-color-background-hover-computed, #ebebeb) );--sc-color-brand-secondary-active-computed: hsl( from var(--sc-color-brand-secondary) h s clamp(5, calc(l - 5), 90) );--sc-surface-brand-secondary-active: var( --sc-color-brand-secondary-active, var(--sc-color-brand-active-computed, #e0e0e0) );--sc-content-brand: var( --sc-color-brand-text, var(--sc-surface-brand-primary) );--sc-content-brand-on-primary: #ffffff;--sc-border-brand: var(--sc-surface-brand-primary);--sc-surface-success-primary: var(--sc-color-success, #008000);--sc-color-success-primary-hover-computed: hsl( from var(--sc-color-success) h s 30 );--sc-surface-success-primary-hover: var( --sc-color-success-primary-hover, var(--sc-color-success-primary-hover-computed, #009900) );--sc-color-success-primary-active-computed: hsl( from var(--sc-color-success) h s 20 );--sc-surface-success-primary-active: var( --sc-color-success-primary-active, var(--sc-color-success-primary-active-computed, #006600) );--sc-color-success-secondary-computed: hsl( from var(--sc-color-success) h s 90 );--sc-surface-success-secondary: var( --sc-color-success-secondary, var(--sc-color-success-secondary-computed, #ccffcc) );--sc-color-success-secondary-hover-computed: hsl( from var(--sc-color-success-secondary) h s 95 );--sc-surface-success-secondary-hover: var( --sc-color-success-secondary-hover, var(--sc-color-success-secondary-hover-computed, #e6ffe6) );--sc-color-success-secondary-active-computed: hsl( from var(--sc-color-success-secondary) h s 85 );--sc-surface-success-secondary-active: var( --sc-color-success-secondary-active, var(--sc-color-success-secondary-active-computed, #b2ffb2) );--sc-content-success: var( --sc-color-brand-text, hsl(from var(--sc-surface-success-primary) h s 30) );--sc-content-success-on-primary: #ffffff;--sc-border-success: var(--sc-surface-success-primary);--sc-surface-caution-primary: var(--sc-color-caution, #cc6600);--sc-color-caution-primary-hover-computed: hsl( from var(--sc-color-caution) h s 30 );--sc-surface-caution-primary-hover: var( --sc-color-caution-primary-hover, var(--sc-color-caution-primary-hover-computed, #e57300) );--sc-color-caution-primary-active-computed: hsl( from var(--sc-color-caution) h s 20 );--sc-surface-caution-primary-active: var( --sc-color-caution-primary-active, var(--sc-color-caution-primary-active-computed, #b25a00) );--sc-color-caution-secondary-computed: hsl( from var(--sc-color-caution) h s 90 );--sc-surface-caution-secondary: var( --sc-color-caution-secondary, var(--sc-color-caution-secondary-computed, #ffd9b3) );--sc-color-caution-secondary-hover-computed: hsl( from var(--sc-color-caution-secondary) h s 95 );--sc-surface-caution-secondary-hover: var( --sc-color-caution-secondary-hover, var(--sc-color-caution-secondary-hover-computed, #ffe5cc) );--sc-color-caution-secondary-active-computed: hsl( from var(--sc-color-caution-secondary) h s 85 );--sc-surface-caution-secondary-active: var( --sc-color-caution-secondary-active, var(--sc-color-caution-secondary-active-computed, #ffcc99) );--sc-content-caution: var( --sc-color-caution-text, hsl(from var(--sc-surface-caution-primary) h s 30) );--sc-content-caution-on-primary: #ffffff;--sc-border-caution: var(--sc-surface-caution-primary);--sc-surface-danger-primary: var(--sc-color-danger, #cc0000);--sc-color-danger-primary-hover-computed: hsl( from var(--sc-color-danger) h s 30 );--sc-surface-danger-primary-hover: var( --sc-color-danger-primary-hover, var(--sc-color-danger-primary-hover-computed, #e50000) );--sc-color-danger-primary-active-computed: hsl( from var(--sc-color-danger) h s 20 );--sc-surface-danger-primary-active: var( --sc-color-danger-primary-active, var(--sc-color-danger-primary-active-computed, #b30000) );--sc-color-danger-secondary-computed: hsl(from var(--sc-color-danger) h s 90);--sc-surface-danger-secondary: var( --sc-color-danger-secondary, var(--sc-color-danger-secondary-computed, #ffcccc) );--sc-color-danger-secondary-hover-computed: hsl( from var(--sc-color-danger-secondary) h s 95 );--sc-surface-danger-secondary-hover: var( --sc-color-danger-secondary-hover, var(--sc-color-danger-secondary-hover-computed, #ffe7e7) );--sc-color-danger-secondary-active-computed: hsl( from var(--sc-color-danger-secondary) h s 85 );--sc-surface-danger-secondary-active: var( --sc-color-danger-secondary-active, var(--sc-color-danger-secondary-active-computed, #ffb3b3) );--sc-content-danger: var( --sc-color-caution-text, hsl(from var(--sc-surface-danger-primary) h s 30) );--sc-content-danger-on-primary: #ffffff;--sc-border-danger: var(--sc-surface-danger-primary);--sc-color-disabled: hsl(from var(--sc-color-page-primary) h s calc(l * 0.5));--sc-surface-disabled: var(--sc-color-disabled, #d9d9d9);--sc-color-disabled-text: hsl( from var(--sc-color-text-primary) h s calc(l * 0.5) );--sc-content-disabled: var(--sc-color-disabled-text, #737373);--sc-content-disabled-on-disabled: var(--sc-color-disabled-text, #737373)}@supports(hanging-punctuation: first) and (font: -apple-system-body) and (-webkit-appearance: none){:root{--sc-color-background-hover-computed: hsl( from var(--sc-color-background) h s clamp(10%, calc(l + 5%), 95%) );--sc-color-background-active-computed: hsl( from var(--sc-color-background) h s clamp(5%, calc(l - 5%), 90%) );--sc-color-foreground-secondary-computed: hsl( from var(--sc-color-foreground) h s clamp(10%, calc(l + 5%), 90%) );--sc-color-brand-hover-computed: hsl( from var(--sc-color-brand) h s clamp(20%, calc(l + 5%), 95%) );--sc-color-brand-active-computed: hsl( from var(--sc-color-brand) h s clamp(10%, calc(l - 5%), 85%) );--sc-color-success-primary-hover-computed: hsl( from var(--sc-color-success) h s 30% );--sc-color-success-primary-active-computed: hsl( from var(--sc-color-success) h s 20% );--sc-color-success-secondary-computed: hsl( from var(--sc-color-success) h s 90% );--sc-color-success-secondary-hover-computed: hsl( from var(--sc-color-success-secondary) h s 95% );--sc-color-success-secondary-active-computed: hsl( from var(--sc-color-success-secondary) h s 85% );--sc-content-success: var( --sc-color-brand-text, hsl(from var(--sc-surface-success-primary) h s 30%) );--sc-color-caution-primary-hover-computed: hsl( from var(--sc-color-caution) h s 30% );--sc-color-caution-primary-active-computed: hsl( from var(--sc-color-caution) h s 20% );--sc-color-caution-secondary-computed: hsl( from var(--sc-color-caution) h s 90% );--sc-color-caution-secondary-hover-computed: hsl( from var(--sc-color-caution-secondary) h s 95% );--sc-color-caution-secondary-active-computed: hsl( from var(--sc-color-caution-secondary) h s 85% );--sc-content-caution: var( --sc-color-caution-text, hsl(from var(--sc-surface-caution-primary) h s 30%) );--sc-color-danger-primary-hover-computed: hsl( from var(--sc-color-danger) h s 30% );--sc-color-danger-primary-active-computed: hsl( from var(--sc-color-danger) h s 20% );--sc-color-danger-secondary-computed: hsl( from var(--sc-color-danger) h s 90% );--sc-color-danger-secondary-hover-computed: hsl( from var(--sc-color-danger-secondary) h s 95% );--sc-color-danger-secondary-active-computed: hsl( from var(--sc-color-danger-secondary) h s 85% );--sc-content-danger: var( --sc-color-caution-text, hsl(from var(--sc-surface-danger-primary) h s 30%) )}}.searchcraft-ad{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased}.searchcraft-ad-no-template{display:flex;flex-direction:column;font-size:.875rem}.searchcraft-ad-no-template>p{margin:0}.searchcraft-adm-ad{display:flex;flex-direction:column;justify-content:center;gap:16px}.searchcraft-search-result{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased}.searchcraft-search-result-no-template{display:flex;flex-direction:column;font-size:.875rem}.searchcraft-search-result-no-template>p{margin:0}.searchcraft-search-results{display:flex;flex-direction:column;justify-content:center;gap:16px}.searchcraft-search-results-empty-state{text-align:center}.searchcraft-search-results-error-message{text-align:center}.searchcraft-button{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);background:none;border:2px solid rgba(0,0,0,0);border-radius:var(--sc-border-radius);cursor:pointer;display:flex;gap:4px;padding:12px;position:relative}.searchcraft-button.searchcraft-button-disabled{cursor:not-allowed}.searchcraft-button-primary{background-color:var(--sc-surface-brand-primary);color:var(--sc-content-brand-on-primary);font-weight:var(--sc-font-bold)}.searchcraft-button-primary:hover{background-color:var(--sc-surface-brand-primary-hover)}.searchcraft-button-primary:focus{border-color:var(--sc-border-primary)}.searchcraft-button-primary:active{background-color:var(--sc-surface-brand-primary-active)}.searchcraft-button-primary.searchcraft-button-disabled,.searchcraft-button-primary.searchcraft-button-disabled:hover,.searchcraft-button-primary.searchcraft-button-disabled:focus,.searchcraft-button-primary.searchcraft-button-disabled:active{background-color:var(--sc-surface-disabled);border-color:rgba(0,0,0,0);color:var(--sc-content-disabled)}.searchcraft-button-tertiary{background-color:var(--sc-surface-neutral-primary);color:var(--sc-content-brand);font-weight:var(--sc-font-normal)}.searchcraft-button-tertiary:hover{background-color:var(--sc-surface-brand-secondary-hover)}.searchcraft-button-tertiary:focus{background-color:var(--sc-surface-neutral-light);border-color:var(--sc-border-primary)}.searchcraft-button-tertiary:active{background-color:var(--sc-surface-brand-secondary-active)}.searchcraft-button-tertiary.searchcraft-button-disabled,.searchcraft-button-tertiary.searchcraft-button-disabled:hover,.searchcraft-button-tertiary.searchcraft-button-disabled:focus,.searchcraft-button-tertiary.searchcraft-button-disabled:active{background-color:var(--sc-surface-neutral-light);border-color:rgba(0,0,0,0);color:var(--sc-content-disabled)}.searchcraft-button-icon{fill:none}.searchcraft-error-message{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-danger);margin:0}.searchcraft-facet-list{display:flex;flex-direction:column;gap:8px;width:100%}.searchcraft-facet-list-checkbox-label{align-items:center;color:var(--sc-content-neutral-primary);display:flex;font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);gap:8px;position:relative;-webkit-font-smoothing:antialiased}.searchcraft-facet-list-checkbox-input-wrapper{position:relative}.searchcraft-facet-list-checkbox-input{align-items:center;appearance:none;background-color:var(--sc-surface-neutral-secondary);border:1px solid var(--sc-surface-disabled);border-radius:var(--sc-border-radius);cursor:pointer;display:flex;height:24px;justify-content:center;width:24px;margin:0}.searchcraft-facet-list-checkbox-input:focus{outline:2px solid var(--sc-surface-brand-primary);outline-offset:2px}.searchcraft-facet-list-checkbox-input:checked{background-color:var(--sc-surface-brand-primary);position:relative}.searchcraft-facet-list-checkbox-input:checked+.searchcraft-facet-list-checkbox-input-check-icon{display:flex}.searchcraft-facet-list-checkbox-input:checked+.searchcraft-facet-list-checkbox-input-dash-icon{display:flex}.searchcraft-facet-child-list{display:flex;flex-direction:column;gap:6px}.searchcraft-facet-child-list-checkbox-label{margin-left:24px}.searchcraft-facet-child-list-checkbox-label:first-child{margin-top:6px}.searchcraft-facet-list-checkbox-input-check-icon{display:none;height:16px;left:50%;position:absolute;margin-top:2px;top:50%;transform:translate(-50%, -50%);width:16px}.searchcraft-facet-list-checkbox-input-dash-icon{display:none;height:3px;left:50%;position:absolute;top:50%;transform:translate(-50%, -50%);width:14px}.searchcraft-facet-list-message{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-disabled);text-align:center}.searchcraft-facet-list-wrapper{display:flex;flex-direction:column;width:100%;min-height:0}.searchcraft-facet-list-content{display:flex;flex-direction:column;gap:8px;min-height:0;flex-shrink:0}.searchcraft-facet-list-view-more{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);background:none;border:none;color:var(--sc-content-brand);cursor:pointer;padding:8px 0;text-align:left;text-decoration:underline}.searchcraft-facet-list-view-more:hover{color:var(--sc-surface-brand-primary-hover)}.searchcraft-facet-list-view-more:focus{outline:2px solid var(--sc-surface-brand-primary);outline-offset:2px}.searchcraft-filter-panel{display:flex;flex-direction:column;gap:16px}.searchcraft-filter-panel-section{display:flex;flex-direction:column;gap:8px}.searchcraft-filter-panel-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);font-weight:var(--sc-font-bold)}[data-toggle-facet-section]{cursor:pointer;display:flex;align-items:center;justify-content:space-between;width:100%;position:relative}[data-toggle-facet-section]::after{content:"›";display:inline-block;font-size:1.5em;line-height:1;margin-left:auto;flex-shrink:0;transition:transform .2s ease;transform-origin:center}[data-toggle-facet-section][data-facet-section-collapsed]::after{transform:rotate(90deg)}[data-toggle-facet-section][data-facet-section-expanded]::after{transform:rotate(-90deg)}@media(max-width: 767px){[data-toggle-filter-panel]{cursor:pointer;display:flex !important;align-items:center;justify-content:space-between;width:100%}[data-toggle-filter-panel]::after{content:"›";display:inline-block;font-size:1.5em;line-height:1;margin-left:auto;flex-shrink:0;transition:transform .2s ease;transform-origin:center}[data-toggle-filter-panel][data-filter-panel-collapsed]::after{transform:rotate(90deg)}[data-toggle-filter-panel][data-filter-panel-expanded]::after{transform:rotate(-90deg)}}@media(min-width: 768px){[data-toggle-filter-panel]{cursor:default}[data-toggle-filter-panel]::after{display:none}}:root{--sc-input-form-border-radius: var(--sc-border-radius);--sc-input-form-search-icon-size: 20px;--sc-input-form-clear-icon-size: 20px}.searchcraft-input-form-grid{display:grid;gap:4px 8px}.searchcraft-input-form-grid-button-left{grid-template-rows:repeat(3, auto);grid-template-columns:auto 1fr}.searchcraft-input-form-grid-button-left .searchcraft-input-form-button{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-form-grid-button-left .searchcraft-input-form-label{grid-column:2/span 1;grid-row:1/span 1}.searchcraft-input-form-grid-button-left .searchcraft-input-form-error-message{grid-column:2/span 1;grid-row:3/span 1}.searchcraft-input-form-grid-button-left .searchcraft-input-form-input-wrapper{grid-column:2/span 1;grid-row:2/span 1}.searchcraft-input-form-grid-button-right{grid-template-rows:repeat(3, auto);grid-template-columns:1fr auto}.searchcraft-input-form-grid-button-right .searchcraft-input-form-button{grid-column:2/span 1;grid-row:2/span 1}.searchcraft-input-form-grid-button-right .searchcraft-input-form-label{grid-column:1/span 1;grid-row:1/span 1}.searchcraft-input-form-grid-button-right .searchcraft-input-form-error-message{grid-column:1/span 1;grid-row:3/span 1}.searchcraft-input-form-grid-button-right .searchcraft-input-form-input-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-form-grid-button-none{grid-template-rows:repeat(3, auto);grid-template-columns:auto}.searchcraft-input-form-grid-button-none .searchcraft-input-form-button{display:none}.searchcraft-input-form-grid-button-none .searchcraft-input-form-label{grid-column:1/span 1;grid-row:1/span 1}.searchcraft-input-form-grid-button-none .searchcraft-input-form-error-message{grid-column:1/span 1;grid-row:3/span 1}.searchcraft-input-form-grid-button-none .searchcraft-input-form-input-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-form-input-wrapper{display:flex;position:relative}.searchcraft-input-form-input{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);background-color:var(--sc-surface-neutral-secondary);border-radius:var(--sc-input-form-border-radius);border:none;color:var(--sc-content-neutral-primary);flex:1;outline:none;padding:12px 44px}.searchcraft-input-form-input::placeholder{color:var(--sc-content-disabled)}.searchcraft-input-form-input:focus{outline:var(--sc-border-brand) solid 2px;outline-offset:-1px}.searchcraft-input-form-input.searchcraft-placeholder-hide-on-focus:focus::placeholder{opacity:0}.searchcraft-input-form-error{color:var(--sc-content-danger);outline:var(--sc-border-danger) solid 2px}.searchcraft-input-form-error:focus{outline:var(--sc-border-danger) solid 2px}.searchcraft-input-form-input-icon{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:absolute;pointer-events:none;top:0;width:44px}.searchcraft-input-form-input-search-icon{color:var(--sc-content-neutral-secondary);fill:none;height:var(--sc-input-form-search-icon-size);pointer-events:none;width:var(--sc-input-form-search-icon-size)}.searchcraft-input-form-clear-button{all:unset;align-items:center;bottom:0;border:none;cursor:pointer;display:flex;justify-content:center;outline:none;position:absolute;right:0;top:0;width:44px}.searchcraft-input-form-clear-icon{color:var(--sc-content-brand);fill:none;height:var(--sc-input-form-clear-icon-size);width:var(--sc-input-form-clear-icon-size)}.searchcraft-input-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-neutral-primary);font-weight:var(--sc-font-bold);margin-top:4px;margin-bottom:4px}:root{--sc-popover-button-border-radius: var(--sc-border-radius)}@media(min-width: 576px){:root{--sc-popover-button-border-radius: var(--sc-border-radius-lg)}}.searchcraft-popover-button{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);cursor:pointer}.searchcraft-popover-button-skeuomorphic{appearance:none;background:none;border:none;color:var(--sc-content-neutral-primary);display:block;width:100%}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-wrapper{border:1px solid var(--sc-border-neutral);border-radius:var(--sc-popover-button-border-radius);box-shadow:0 1px 1px rgb(from var(--sc-content-neutral-secondary) r g b/10%) inset,0 2px 4px rgb(from var(--sc-content-neutral-secondary) r g b/5%) inset;display:flex;gap:24px;height:40px;justify-content:space-between;line-height:1;padding:4px 5px 4px 10px;background:var(--sc-surface-neutral-primary)}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-wrapper{box-shadow:0 1px 1px rgb(from var(--sc-content-neutral-secondary) r g b/10%) inset,0 2px 2px rgb(from var(--sc-content-neutral-secondary) r g b/5%) inset,0 4px 4px rgb(from var(--sc-content-neutral-secondary) r g b/5%) inset;height:63px;padding:8px 10px 8px 16px}}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-input{align-items:center;display:flex;gap:4px}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-input{gap:8px}}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps{color:var(--sc-content-neutral-secondary);display:flex;gap:4px;font-size:20px;font-weight:500}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps{gap:8px}}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap{border-radius:calc(var(--sc-popover-button-border-radius) - 3px);border-radius:calc(var(var(--sc-popover-button-border-radius)) - 3px);background-color:var(--sc-surface-neutral-primary);box-shadow:0 3px hsl(from var(--sc-surface-neutral-secondary) h s calc(l - 5)),0 1px 2px rgb(from var(--sc-content-neutral-secondary) r g b/10%),0 6px 4px rgb(from var(--sc-content-neutral-secondary) r g b/5%);height:calc(100% - 2px);position:relative}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap{border-radius:calc(var(--sc-popover-button-border-radius) - 8px);border-radius:calc(var(var(--sc-popover-button-border-radius)) - 8px);box-shadow:0 4px hsl(from var(--sc-surface-neutral-secondary) h s calc(l - 5)),0 1px 2px rgb(from var(--sc-content-neutral-secondary) r g b/15%),0 6px 1px rgb(from var(--sc-content-neutral-secondary) r g b/20%),0 7px 2px rgb(from var(--sc-content-neutral-secondary) r g b/15%),0 9px 4px rgb(from var(--sc-content-neutral-secondary) r g b/10%),0 13px 8px rgb(from var(--sc-content-neutral-secondary) r g b/5%);height:calc(100% - 5px)}}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap::before,.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap::after{content:"";display:block}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap::before{border-radius:calc(var(--sc-popover-button-border-radius) - 4px);border-radius:calc(var(var(--sc-popover-button-border-radius)) - 4px);background:linear-gradient(340deg, rgb(from var(--sc-surface-neutral-secondary) r g b/2%) 0%, var(--sc-surface-neutral-secondary) 100%);inset:2px;position:absolute}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap::before{border-radius:calc(var(--sc-popover-button-border-radius) - 12px);border-radius:calc(var(var(--sc-popover-button-border-radius)) - 12px);inset:4px}}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap::after{aspect-ratio:1/1;height:100%}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap>span{display:flex;line-height:1;left:50%;margin-top:2%;position:absolute;top:50%;transform:translate(-50%, -50%)}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-input-search-icon{height:60%;width:auto}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-input-search-icon{height:50%}}:root{--sc-popover-button-magnifying-glass-icon-size: 20px;--sc-popover-button-magnifying-glass-icon-color: var(--sc-content-neutral-secondary);--sc-popover-button-magnifying-glass-icon-color-hover: var(--sc-content-brand);--sc-popover-button-magnifying-glass-padding: 12px}@media(min-width: 576px){:root{--sc-popover-button-magnifying-glass-padding: 16px}}.searchcraft-popover-button-magnifying-glass{appearance:none;background:none;border:none;color:var(--sc-content-neutral-primary);cursor:pointer;display:flex;align-items:center;justify-content:center}.searchcraft-popover-button-magnifying-glass .searchcraft-popover-button-input{display:flex;align-items:center;justify-content:center;padding:var(--sc-popover-button-magnifying-glass-padding)}.searchcraft-popover-button-magnifying-glass .searchcraft-popover-button-input-search-icon{color:var(--sc-popover-button-magnifying-glass-icon-color);display:block;fill:none;stroke:currentcolor;stroke-width:1.5;width:var(--sc-popover-button-magnifying-glass-icon-size);height:var(--sc-popover-button-magnifying-glass-icon-size);transition:color .2s ease}.searchcraft-popover-button-magnifying-glass:hover .searchcraft-popover-button-input-search-icon{color:var(--sc-popover-button-magnifying-glass-icon-color-hover)}:root{--sc-popover-list-view-height: 600px;--sc-popover-modal-max-width: 800px}.searchcraft-popover-form{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);display:flex;flex:1;flex-direction:column}.searchcraft-popover-form searchcraft-input-form,.searchcraft-popover-form searchcraft-popover-footer{width:100%}.searchcraft-popover-form.searchcraft-popover-form-active .searchcraft-popover-form-input{padding-bottom:1px}.searchcraft-popover-form searchcraft-popover-list-view{flex-shrink:1;height:100%;min-height:0;overflow:auto;padding:0 24px}.searchcraft-popover-form searchcraft-results-summary,.searchcraft-popover-form searchcraft-summary-box{margin-bottom:16px}.searchcraft-popover-form-input{display:flex;flex-direction:row;gap:12px}.searchcraft-popover-form-input .searchcraft-input-form-input{background-color:var(--sc-surface-neutral-primary);border:1px solid var(--sc-border-neutral);border-radius:var(--sc-border-radius-lg);width:0}.searchcraft-popover-form-cancel-button{background:none;border:none;cursor:pointer;font-size:14px}.searchcraft-popover-form-modal-input,.searchcraft-popover-form-fullscreen-input{padding:24px}.searchcraft-popover-form-modal-popover-list-view,.searchcraft-popover-form-fullscreen-popover-list-view{flex-grow:1;flex-shrink:1;min-height:0;overflow:auto;padding:0 24px}.searchcraft-popover-form-modal-popover-list-view searchcraft-results-summary,.searchcraft-popover-form-modal-popover-list-view searchcraft-summary-box,.searchcraft-popover-form-fullscreen-popover-list-view searchcraft-results-summary,.searchcraft-popover-form-fullscreen-popover-list-view searchcraft-summary-box{padding:20px 0;margin-bottom:0;border-bottom:1px solid var(--sc-border-neutral-subtle)}.searchcraft-popover-form-inline{background-color:var(--sc-surface-neutral-primary);border:1px solid rgba(0,0,0,0);border-radius:var(--sc-border-radius-xl);padding:12px;position:relative}.searchcraft-popover-form-inline.searchcraft-popover-form-active{border:1px solid var(--sc-border-neutral);border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;padding-bottom:1px}.searchcraft-popover-form-inline searchcraft-popover-list-view{padding:0 12px}.searchcraft-popover-form-inline .searchcraft-input-form-input,.searchcraft-popover-form-inline .searchcraft-popover-list-item-link,.searchcraft-popover-form-inline .searchcraft-adm-ad-link{border-radius:calc(--sc-border-radius-xl - 12px);border-radius:calc(var(--sc-border-radius-xl) - 12px)}.searchcraft-popover-form-inline-wrapper{background-color:var(--sc-surface-neutral-primary);border:1px solid var(--sc-border-neutral);border-top:none;border-bottom-left-radius:var(--sc-border-radius-xl);border-bottom-right-radius:var(--sc-border-radius-xl);display:flex;flex-direction:column;left:-1px;max-height:var(--sc-popover-list-view-height);overflow:hidden;position:absolute;right:-1px;top:100%}.searchcraft-popover-form-inline-wrapper searchcraft-results-summary,.searchcraft-popover-form-inline-wrapper searchcraft-summary-box{padding:16px 12px;margin-bottom:0;border-bottom:1px solid var(--sc-border-neutral-subtle)}.searchcraft-popover-form-modal{align-items:center;display:flex;inset:0;position:fixed;z-index:1000}.searchcraft-popover-form-modal .searchcraft-input-form-input,.searchcraft-popover-form-modal .searchcraft-popover-list-item-link,.searchcraft-popover-form-modal .searchcraft-adm-ad-link{border-radius:calc(--sc-border-radius-2xl - 20px);border-radius:calc(var(--sc-border-radius-2xl) - 20px)}.searchcraft-popover-form-modal-backdrop{background-color:rgb(from var(--sc-content-neutral-primary) r g b/50%);display:none;inset:0;position:fixed}@media(min-width: 576px){.searchcraft-popover-form-modal-backdrop{display:block}}.searchcraft-popover-form-modal-wrapper{background-color:var(--sc-surface-neutral-primary);box-shadow:1px 2px rgb(from var(--sc-content-neutral-primary) r g b/7%),0 2px 4px rgb(from var(--sc-content-neutral-primary) r g b/7%),0 4px 8px rgb(from var(--sc-content-neutral-primary) r g b/7%),0 8px 16px rgb(from var(--sc-content-neutral-primary) r g b/7%),0 16px 32px rgb(from var(--sc-content-neutral-primary) r g b/7%),0 32px 64px rgb(from var(--sc-content-neutral-primary) r g b/7%);display:flex;flex-direction:column;inset:0;max-width:var(--sc-popover-modal-max-width);overflow:hidden;position:absolute;width:100%;z-index:1001}@media(min-width: 576px){.searchcraft-popover-form-modal-wrapper{border-radius:var(--sc-border-radius-2xl);inset:0;margin-top:100px;max-height:var(--sc-popover-list-view-height);max-width:var(--sc-popover-modal-max-width);position:relative}}.searchcraft-popover-form-modal-cancel-button{border-radius:calc(--sc-border-radius-2xl - 20px);border-radius:calc(var(--sc-border-radius-2xl) - 20px);padding:8px}@media(min-width: 576px){.searchcraft-popover-form-modal-cancel-button{padding:8px 12px}}.searchcraft-popover-form-fullscreen{background-color:var(--sc-surface-neutral-primary);display:flex;flex-direction:column;justify-content:space-between;inset:0;position:fixed;z-index:1000}.searchcraft-popover-form-fullscreen .searchcraft-popover-list-item-link,.searchcraft-popover-form-fullscreen .searchcraft-adm-ad-link{border-radius:var(--sc-border-radius-lg)}.searchcraft-popover-form-fullscreen-cancel-button{border-radius:var(--sc-border-radius-lg);padding:8px}@media(min-width: 576px){.searchcraft-popover-form-fullscreen-cancel-button{padding:8px 12px}}.searchcraft-popover-footer{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;align-items:center;background-color:var(--sc-surface-neutral-secondary);display:flex;gap:.5rem;justify-content:space-between;line-height:1;padding:1.25rem 1.5rem}@media(min-width: 576px){.searchcraft-popover-footer{padding:1.25rem 2rem}}.searchcraft-popover-footer-results-info{margin:0}.searchcraft-popover-footer-results-found{display:none}@media(min-width: 576px){.searchcraft-popover-footer-results-found{display:inline}}.searchcraft-popover-footer-link{align-items:center;color:var(--sc-content-neutral-primary);display:flex;font-weight:var(--sc-font-bold);text-decoration:none;white-space:nowrap}.searchcraft-popover-footer-link-prefix{display:none;font-weight:var(--sc-font-normal)}@media(min-width: 576px){.searchcraft-popover-footer-link-prefix{display:inline}}.searchcraft-popover-footer-results{align-items:center;display:flex;gap:.5rem}.searchcraft-popover-footer-view-all{align-items:center;border-radius:999px;border:.0625rem solid var(--sc-border-neutral-strong);color:var(--sc-content-neutral-primary);display:inline-flex;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-bold);gap:.375rem;line-height:1;padding:.375rem .625rem;text-decoration:none}.searchcraft-popover-footer-view-all-shortcut{display:none}@media(min-width: 576px){.searchcraft-popover-footer-view-all-shortcut{display:inline-flex;gap:.125rem}.searchcraft-popover-footer-view-all-shortcut kbd{align-items:center;border-radius:.25rem;border:1px solid var(--sc-content-neutral-primary);display:flex;font-family:Helvetica,Arial,sans-serif;font-size:.75rem;font-style:normal;font-weight:400;height:1.5rem;justify-content:center;line-height:1rem;width:1.5rem}}:root{--sc-popover-list-item-image-fit: contain}.searchcraft-popover-list-item{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;border-bottom:1px solid var(--sc-border-neutral);padding:12px 0}searchcraft-popover-list-item:last-child .searchcraft-popover-list-item{border-bottom:none}.searchcraft-popover-list-item-link{align-items:flex-start;color:var(--sc-content-neutral-primary);display:flex;gap:24px;padding:12px;text-decoration:none}.searchcraft-popover-list-item-link:focus,.searchcraft-popover-list-item-link:active{background-color:var(--sc-surface-neutral-primary-active)}.searchcraft-popover-list-item-link:hover{background-color:var(--sc-surface-neutral-primary-hover)}.searchcraft-popover-list-item-image-wrapper{align-items:center;aspect-ratio:16/9;display:flex;flex-shrink:0;justify-content:center;width:160px}.searchcraft-popover-list-item-image{height:100%;object-fit:var(--sc-popover-list-item-image-fit);width:100%}.searchcraft-popover-list-item-content{display:flex;flex-direction:column;flex-grow:1;gap:4px;justify-content:center}.searchcraft-popover-list-item-content-title,.searchcraft-popover-list-item-content-subtitle{display:-webkit-box;line-clamp:2;margin:0;overflow:hidden;-webkit-line-clamp:2;-webkit-box-orient:vertical}.searchcraft-popover-list-item-content-title{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-heading-5-font-size);font-weight:var(--sc-font-bold)}.searchcraft-popover-list-item-content-subtitle{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal)}.searchcraft-popover-list-view{display:flex;flex-direction:column}.searchcraft-results-info{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-primary);margin:0}.searchcraft-slider{align-items:center;display:flex;flex-direction:column;gap:10px;width:100%;margin-top:4px}.searchcraft-slider-range{align-items:center;background-color:var(--sc-surface-disabled);border-radius:999px;display:flex;position:relative;height:4px;width:100%}.searchcraft-slider-range::-webkit-slider-runnable-track{pointer-events:none}.searchcraft-slider-range .searchcraft-slider-active-range{background-color:var(--sc-surface-brand-primary);border-radius:2px;height:4px;position:absolute;top:50%;transform:translateY(-50%);z-index:0}.searchcraft-slider-range .searchcraft-slider-active-range::-webkit-slider-runnable-track{pointer-events:none}.searchcraft-slider-range .searchcraft-slider-active-range::-moz-range-track{pointer-events:none}.searchcraft-slider-range .searchcraft-slider-input{appearance:none;background:rgba(0,0,0,0);border-radius:2px;height:4px;margin:0;outline:none;pointer-events:none;position:absolute;width:100%;-webkit-appearance:none}.searchcraft-slider-range .searchcraft-slider-input::-webkit-slider-thumb{background-color:var(--sc-surface-neutral-light);border-radius:50%;border:1px solid var(--sc-border-neutral);cursor:pointer;height:18px;pointer-events:all;width:18px;-webkit-appearance:none}.searchcraft-slider-range .searchcraft-slider-input::-moz-range-thumb{background-color:var(--sc-surface-neutral-light);border-radius:50%;border:1px solid var(--sc-border-neutral);cursor:pointer;height:18px;pointer-events:all;width:18px}.searchcraft-slider-range .searchcraft-slider-input:focus::-webkit-slider-thumb{outline:2px solid var(--sc-surface-brand-primary)}.searchcraft-slider-range .searchcraft-slider-input:focus::-moz-range-thumb{outline:2px solid var(--sc-surface-brand-primary)}.searchcraft-slider-label{color:var(--sc-content-primary);display:flex;font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);justify-content:space-between;margin-top:4px;width:100%}.searchcraft-slider-start-label,.searchcraft-slider-end-label{min-width:30px;text-align:center}.searchcraft-toggle-button{align-items:flex-start;display:flex;gap:10px;justify-content:space-between}.searchcraft-toggle-button-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-neutral-primary);margin:0}.searchcraft-toggle-button-sub-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-neutral-secondary);margin:0}.searchcraft-toggle-button-background{background:var(--sc-surface-disabled);border-radius:var(--sc-border-radius-full);border:none;cursor:pointer;flex-shrink:0;height:26px;position:relative;transition:background-color .2s;width:44px}.searchcraft-toggle-button-handle{background:var(--sc-surface-neutral-light);border-radius:50%;height:18px;left:4px;position:absolute;top:calc(50% - 9px);transition:transform .3s ease;width:18px}.searchcraft-toggle-button-active .searchcraft-toggle-button-background{background:var(--sc-surface-brand-primary);box-shadow:0px 0px 0px 1px rgba(0,0,0,.05)}.searchcraft-toggle-button-active .searchcraft-toggle-button-handle{transform:translateX(16px)}.searchcraft-pagination{display:inline-grid;gap:16px;grid-template-columns:repeat(3, auto);grid-template-rows:1fr}.searchcraft-pagination-list{border:1px solid var(--sc-border-neutral);border-radius:var(--sc-border-radius);display:flex;list-style-type:none;margin:0;overflow:hidden;padding:0;width:auto}.searchcraft-pagination-list li{border-right:1px solid var(--sc-border-neutral);height:100%;min-height:44px;width:44px}.searchcraft-pagination-list li:last-child{border-right:none}.searchcraft-pagination-item{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);align-items:center;background-color:var(--sc-surface-neutral-primary);border:none;display:flex;height:100%;justify-content:center;width:100%}.searchcraft-pagination-item-active{background-color:var(--sc-surface-brand-secondary);font-weight:var(--sc-font-bold)}.searchcraft-pagination-control{border:1px solid var(--sc-border-neutral);border-radius:var(--sc-border-radius)}.searchcraft-pagination-range{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);align-items:center;display:flex}.searchcraft-select{display:flex;flex-direction:column;gap:4px}.searchcraft-select-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);font-weight:var(--sc-font-bold)}.searchcraft-select-input-wrapper{position:relative}.searchcraft-select-input{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);appearance:none;background-color:var(--sc-surface-neutral-secondary);border:2px solid rgba(0,0,0,0);border-radius:var(--sc-border-radius);cursor:pointer;height:44px;padding:0 44px 0 16px;width:100%}.searchcraft-select-input:hover{background-color:var(--sc-surface-neutral-secondary-hover)}.searchcraft-select-input:active{background-color:var(--sc-surface-neutral-secondary-active)}.searchcraft-select-input:focus{border-color:var(--sc-border-brand);outline:none}.searchcraft-select-input-icon{fill:none;pointer-events:none;position:absolute;right:12px;top:50%;transform:translateY(-50%)}.searchcraft-select-caption{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal)}.searchcraft-search-results-per-page{display:flex}.searchcraft-search-results-per-page-select{align-items:center;display:flex;gap:12px}.searchcraft-search-results-per-page-select-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal)}.searchcraft-search-results-per-page-select-input{min-width:120px}.searchcraft-results-summary{padding:20px;border-radius:var(--sc-border-radius);background-color:var(--sc-surface-neutral-secondary);position:relative;min-height:200px;color:var(--sc-content-neutral-primary);font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal)}.searchcraft-results-summary h1,.searchcraft-results-summary h2,.searchcraft-results-summary h3,.searchcraft-results-summary h4,.searchcraft-results-summary h5{padding-top:10px;padding-bottom:10px}.searchcraft-results-summary p{padding-bottom:10px}.searchcraft-results-summary img{max-width:200px}.searchcraft-results-summary ol,.searchcraft-results-summary ul{padding-left:1em;padding-bottom:10px}.searchcraft-results-summary a{color:var(--sc-content-brand)}.searchcraft-summary-box{padding:20px;border-radius:var(--sc-border-radius);background-color:var(--sc-surface-neutral-secondary);position:relative;min-height:200px;color:var(--sc-content-neutral-primary);font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal)}.searchcraft-summary-box h1,.searchcraft-summary-box h2,.searchcraft-summary-box h3,.searchcraft-summary-box h4,.searchcraft-summary-box h5{padding-top:10px;padding-bottom:10px}.searchcraft-summary-box p{padding-bottom:10px}.searchcraft-summary-box img{max-width:200px}.searchcraft-summary-box ol,.searchcraft-summary-box ul{padding-left:1em;padding-bottom:10px}.searchcraft-summary-box a{color:var(--sc-content-brand)}.searchcraft-loading{display:flex;flex-direction:column;align-items:center;gap:12px;position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}.searchcraft-loading-dots{display:flex;gap:8px;align-items:center;height:40px}.searchcraft-loading-dots>div{width:10px;height:10px;border-radius:50%;background-color:var(--sc-surface-brand-primary);animation:searchcraft-jump .6s ease-in-out infinite}.searchcraft-loading-dots .searchcraft-loading-dot-2{animation-delay:.15s}.searchcraft-loading-dots .searchcraft-loading-dot-3{animation-delay:.3s}.searchcraft-loading-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);letter-spacing:2px;color:#828282;margin:0}@keyframes searchcraft-jump{0%{transform:translateY(0);animation-timing-function:cubic-bezier(0.33, 1, 0.68, 1)}50%{transform:translateY(-20px);animation-timing-function:cubic-bezier(0.32, 0, 0.67, 0)}100%{transform:translateY(0)}}/*# sourceMappingURL=hologram.css.map */
|
|
10355
10456
|
`;
|
|
10356
10457
|
|
|
10357
10458
|
/**
|
|
@@ -10387,7 +10488,7 @@ class SearchcraftTheme {
|
|
|
10387
10488
|
registerInstance(this, hostRef);
|
|
10388
10489
|
}
|
|
10389
10490
|
render() {
|
|
10390
|
-
return hAsync("style", { key: '
|
|
10491
|
+
return hAsync("style", { key: 'ef26626cdfa4fa98d516802d71443c49a9c6ecf9' }, styles);
|
|
10391
10492
|
}
|
|
10392
10493
|
static get cmpMeta() { return {
|
|
10393
10494
|
"$flags$": 256,
|
|
@@ -10451,9 +10552,9 @@ class SearchcraftToggleButton {
|
|
|
10451
10552
|
this.cleanupCore?.();
|
|
10452
10553
|
}
|
|
10453
10554
|
render() {
|
|
10454
|
-
return (hAsync("div", { key: '
|
|
10555
|
+
return (hAsync("div", { key: 'ab1d5ee21c7aaa28af1c405edc986556858366e8', class: classNames('searchcraft-toggle-button', {
|
|
10455
10556
|
'searchcraft-toggle-button-active': this.isActive,
|
|
10456
|
-
}) }, hAsync("div", { key: '
|
|
10557
|
+
}) }, hAsync("div", { key: '44f86a16d796d448bdb2fb3af72d4d8e1484364b' }, hAsync("p", { key: '9fedb38795d6379cae56dc005ab8e4a944b4261b', class: 'searchcraft-toggle-button-label' }, this.label), this.subLabel && (hAsync("p", { key: '44f3d17175184032275fec89a4cfe7f8266b7014', class: 'searchcraft-toggle-button-sub-label' }, this.subLabel))), hAsync("button", { key: '15fc18906ff2fb21fe646a4e3a8a2ace4a37cae2', class: 'searchcraft-toggle-button-background', onClick: this.handleToggle, type: 'button' }, hAsync("div", { key: '716d29c65a199f63f5fd294dc3e3ad2ea4d53aa3', class: 'searchcraft-toggle-button-handle' }))));
|
|
10457
10558
|
}
|
|
10458
10559
|
static get cmpMeta() { return {
|
|
10459
10560
|
"$flags$": 768,
|
|
@@ -10487,6 +10588,7 @@ registerComponents([
|
|
|
10487
10588
|
SearchcraftPopoverListItemAd,
|
|
10488
10589
|
SearchcraftPopoverListView,
|
|
10489
10590
|
SearchcraftResultsInfo,
|
|
10591
|
+
SearchcraftResultsSummary,
|
|
10490
10592
|
SearchcraftSearchResult,
|
|
10491
10593
|
SearchcraftSearchResults,
|
|
10492
10594
|
SearchcraftSearchResultsPerPage,
|