@searchcraft/javascript-sdk 0.7.2 → 0.8.1
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/cjs/{store-f6ba3dfb.js → SearchcraftStore-75fac5e0.js} +576 -443
- package/dist/cjs/SearchcraftStore-75fac5e0.js.map +1 -0
- package/dist/cjs/index.cjs.js +2 -3
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/searchcraft-base-search-result_2.cjs.entry.js +152 -0
- package/dist/cjs/searchcraft-base-search-result_2.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-base-search-results.cjs.entry.js +30 -80
- package/dist/cjs/searchcraft-base-search-results.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-button_3.cjs.entry.js +22 -7
- package/dist/cjs/searchcraft-button_3.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-facet-list_3.cjs.entry.js +19 -18
- package/dist/cjs/searchcraft-facet-list_3.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-filter-panel.cjs.entry.js +6 -6
- package/dist/cjs/searchcraft-filter-panel.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-input-form_2.cjs.entry.js +20 -33
- package/dist/cjs/searchcraft-input-form_2.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-javascript-sdk.cjs.js +1 -1
- package/dist/cjs/searchcraft-pagination.cjs.entry.js +106 -0
- package/dist/cjs/searchcraft-pagination.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-popover-button.cjs.entry.js +3 -3
- package/dist/cjs/searchcraft-popover-button.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-popover-form.cjs.entry.js +27 -25
- package/dist/cjs/searchcraft-popover-form.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-popover-list-item_2.cjs.entry.js +101 -0
- package/dist/cjs/searchcraft-popover-list-item_2.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-results-info.cjs.entry.js +51 -13
- package/dist/cjs/searchcraft-results-info.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-search-results-per-page.cjs.entry.js +75 -0
- package/dist/cjs/searchcraft-search-results-per-page.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-select.cjs.entry.js +70 -0
- package/dist/cjs/searchcraft-select.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-theme.cjs.entry.js +29 -11
- package/dist/cjs/searchcraft-theme.cjs.entry.js.map +1 -1
- package/dist/cjs/units-fe4d8083.js.map +1 -1
- package/dist/collection/collection-manifest.json +5 -0
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js +86 -208
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js.map +1 -1
- package/dist/collection/components/searchcraft-base-search-result-ad/searchcraft-base-search-result-ad.js +73 -0
- package/dist/collection/components/searchcraft-base-search-result-ad/searchcraft-base-search-result-ad.js.map +1 -0
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js +37 -144
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js.map +1 -1
- package/dist/collection/components/searchcraft-button/searchcraft-button.js +87 -17
- package/dist/collection/components/searchcraft-button/searchcraft-button.js.map +1 -1
- package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js +1 -1
- package/dist/collection/components/searchcraft-facet-list/searchcraft-facet-list.js +8 -8
- package/dist/collection/components/searchcraft-facet-list/searchcraft-facet-list.js.map +1 -1
- package/dist/collection/components/searchcraft-filter-panel/searchcraft-filter-panel.js +7 -7
- package/dist/collection/components/searchcraft-filter-panel/searchcraft-filter-panel.js.map +1 -1
- package/dist/collection/components/searchcraft-input-form/searchcraft-input-form.js +10 -14
- package/dist/collection/components/searchcraft-input-form/searchcraft-input-form.js.map +1 -1
- package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js +1 -1
- package/dist/collection/components/searchcraft-pagination/searchcraft-pagination.js +141 -0
- package/dist/collection/components/searchcraft-pagination/searchcraft-pagination.js.map +1 -0
- package/dist/collection/components/searchcraft-popover-button/searchcraft-popover-button.js +1 -1
- package/dist/collection/components/searchcraft-popover-form/searchcraft-popover-form.js +26 -21
- package/dist/collection/components/searchcraft-popover-form/searchcraft-popover-form.js.map +1 -1
- package/dist/collection/components/searchcraft-popover-list-item/searchcraft-popover-list-item.js +59 -92
- package/dist/collection/components/searchcraft-popover-list-item/searchcraft-popover-list-item.js.map +1 -1
- package/dist/collection/components/searchcraft-popover-list-item-ad/searchcraft-popover-list-item-ad.js +73 -0
- package/dist/collection/components/searchcraft-popover-list-item-ad/searchcraft-popover-list-item-ad.js.map +1 -0
- package/dist/collection/components/searchcraft-popover-list-view/searchcraft-popover-list-view.js +77 -24
- package/dist/collection/components/searchcraft-popover-list-view/searchcraft-popover-list-view.js.map +1 -1
- package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.js +105 -17
- package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.js.map +1 -1
- package/dist/collection/components/searchcraft-search-results-per-page/searchcraft-search-results-per-page.js +129 -0
- package/dist/collection/components/searchcraft-search-results-per-page/searchcraft-search-results-per-page.js.map +1 -0
- package/dist/collection/components/searchcraft-select/searchcraft-select.js +261 -0
- package/dist/collection/components/searchcraft-select/searchcraft-select.js.map +1 -0
- package/dist/collection/components/searchcraft-slider/searchcraft-slider.js +2 -2
- package/dist/collection/components/searchcraft-theme/searchcraft-theme.js +72 -12
- package/dist/collection/components/searchcraft-theme/searchcraft-theme.js.map +1 -1
- package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.js +7 -6
- package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.js.map +1 -1
- package/dist/collection/index.js +1 -2
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/provider/SearchcraftStore.js +160 -0
- package/dist/collection/provider/SearchcraftStore.js.map +1 -0
- package/dist/collection/provider/SearchcraftStore.types.js +2 -0
- package/dist/collection/provider/SearchcraftStore.types.js.map +1 -0
- package/dist/collection/provider/store.js +2 -136
- package/dist/collection/provider/store.js.map +1 -1
- package/dist/collection/utils/units.js.map +1 -1
- package/dist/components/index.js +11 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/{p-a75ef832.js → p-0e393fe1.js} +2 -2
- package/dist/components/{p-a75ef832.js.map → p-0e393fe1.js.map} +1 -1
- package/dist/components/p-25ee7496.js +58 -0
- package/dist/components/p-25ee7496.js.map +1 -0
- package/dist/components/{p-936e2ed4.js → p-38419178.js} +576 -442
- package/dist/components/p-38419178.js.map +1 -0
- package/dist/components/{p-1234974c.js → p-433f974c.js} +9 -8
- package/dist/components/p-433f974c.js.map +1 -0
- package/dist/components/{p-4b92ae26.js → p-4e9cd62e.js} +4 -4
- package/dist/components/{p-4b92ae26.js.map → p-4e9cd62e.js.map} +1 -1
- package/dist/components/{p-755f491b.js → p-6104fe5d.js} +2 -2
- package/dist/components/p-6104fe5d.js.map +1 -0
- package/dist/components/{p-b4a8fcbe.js → p-97332d3e.js} +51 -59
- package/dist/components/p-97332d3e.js.map +1 -0
- package/dist/components/{p-960ddc89.js → p-ae78be68.js} +17 -21
- package/dist/components/p-ae78be68.js.map +1 -0
- package/dist/components/p-bf6a086a.js +92 -0
- package/dist/components/p-bf6a086a.js.map +1 -0
- package/dist/components/p-bff4d3fc.js +65 -0
- package/dist/components/p-bff4d3fc.js.map +1 -0
- package/dist/components/{p-521fe971.js → p-d19bf6ff.js} +25 -8
- package/dist/components/p-d19bf6ff.js.map +1 -0
- package/dist/components/p-de4a48b1.js +65 -0
- package/dist/components/p-de4a48b1.js.map +1 -0
- package/dist/components/{p-ca881e5c.js → p-e55a7970.js} +2 -2
- package/dist/components/{p-ca881e5c.js.map → p-e55a7970.js.map} +1 -1
- package/dist/components/p-ec0d230e.js +75 -0
- package/dist/components/p-ec0d230e.js.map +1 -0
- package/dist/components/{p-54998882.js → p-fc7cda96.js} +10 -10
- package/dist/components/p-fc7cda96.js.map +1 -0
- package/dist/components/searchcraft-base-search-result-ad.d.ts +11 -0
- package/dist/components/searchcraft-base-search-result-ad.js +8 -0
- package/dist/components/searchcraft-base-search-result-ad.js.map +1 -0
- package/dist/components/searchcraft-base-search-result.js +1 -1
- package/dist/components/searchcraft-base-search-results.js +44 -89
- package/dist/components/searchcraft-base-search-results.js.map +1 -1
- package/dist/components/searchcraft-button.js +1 -1
- package/dist/components/searchcraft-error-message.js +1 -1
- package/dist/components/searchcraft-facet-list.js +1 -1
- package/dist/components/searchcraft-filter-panel.js +9 -9
- package/dist/components/searchcraft-filter-panel.js.map +1 -1
- package/dist/components/searchcraft-input-form.js +1 -1
- package/dist/components/searchcraft-input-label.js +1 -1
- package/dist/components/searchcraft-pagination.d.ts +11 -0
- package/dist/components/searchcraft-pagination.js +135 -0
- package/dist/components/searchcraft-pagination.js.map +1 -0
- package/dist/components/searchcraft-popover-button.js +2 -2
- package/dist/components/searchcraft-popover-form.js +41 -30
- package/dist/components/searchcraft-popover-form.js.map +1 -1
- package/dist/components/searchcraft-popover-list-item-ad.d.ts +11 -0
- package/dist/components/searchcraft-popover-list-item-ad.js +8 -0
- package/dist/components/searchcraft-popover-list-item-ad.js.map +1 -0
- package/dist/components/searchcraft-popover-list-item.js +1 -1
- package/dist/components/searchcraft-popover-list-view.js +1 -1
- package/dist/components/searchcraft-results-info.js +60 -17
- package/dist/components/searchcraft-results-info.js.map +1 -1
- package/dist/components/searchcraft-search-results-per-page.d.ts +11 -0
- package/dist/components/searchcraft-search-results-per-page.js +105 -0
- package/dist/components/searchcraft-search-results-per-page.js.map +1 -0
- package/dist/components/searchcraft-select.d.ts +11 -0
- package/dist/components/searchcraft-select.js +8 -0
- package/dist/components/searchcraft-select.js.map +1 -0
- package/dist/components/searchcraft-slider.js +1 -1
- package/dist/components/searchcraft-theme.js +34 -13
- package/dist/components/searchcraft-theme.js.map +1 -1
- package/dist/components/searchcraft-toggle-button.js +1 -1
- package/dist/esm/{store-aa071d9c.js → SearchcraftStore-3cfd565a.js} +576 -442
- package/dist/esm/SearchcraftStore-3cfd565a.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/searchcraft-base-search-result_2.entry.js +147 -0
- package/dist/esm/searchcraft-base-search-result_2.entry.js.map +1 -0
- package/dist/esm/searchcraft-base-search-results.entry.js +30 -80
- package/dist/esm/searchcraft-base-search-results.entry.js.map +1 -1
- package/dist/esm/searchcraft-button_3.entry.js +22 -7
- package/dist/esm/searchcraft-button_3.entry.js.map +1 -1
- package/dist/esm/searchcraft-facet-list_3.entry.js +17 -16
- package/dist/esm/searchcraft-facet-list_3.entry.js.map +1 -1
- package/dist/esm/searchcraft-filter-panel.entry.js +5 -5
- package/dist/esm/searchcraft-filter-panel.entry.js.map +1 -1
- package/dist/esm/searchcraft-input-form_2.entry.js +19 -32
- package/dist/esm/searchcraft-input-form_2.entry.js.map +1 -1
- package/dist/esm/searchcraft-javascript-sdk.js +1 -1
- package/dist/esm/searchcraft-pagination.entry.js +102 -0
- package/dist/esm/searchcraft-pagination.entry.js.map +1 -0
- package/dist/esm/searchcraft-popover-button.entry.js +2 -2
- package/dist/esm/searchcraft-popover-form.entry.js +20 -18
- package/dist/esm/searchcraft-popover-form.entry.js.map +1 -1
- package/dist/esm/searchcraft-popover-list-item_2.entry.js +96 -0
- package/dist/esm/searchcraft-popover-list-item_2.entry.js.map +1 -0
- package/dist/esm/searchcraft-results-info.entry.js +51 -13
- package/dist/esm/searchcraft-results-info.entry.js.map +1 -1
- package/dist/esm/searchcraft-search-results-per-page.entry.js +71 -0
- package/dist/esm/searchcraft-search-results-per-page.entry.js.map +1 -0
- package/dist/esm/searchcraft-select.entry.js +66 -0
- package/dist/esm/searchcraft-select.entry.js.map +1 -0
- package/dist/esm/searchcraft-theme.entry.js +29 -11
- package/dist/esm/searchcraft-theme.entry.js.map +1 -1
- package/dist/esm/{units-b6eba560.js → units-daaf96f5.js} +2 -2
- package/dist/esm/units-daaf96f5.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/index.esm.js +1 -1
- package/dist/searchcraft-javascript-sdk/p-279f3e15.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-279f3e15.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-2bc82b48.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-2bc82b48.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-2dc07b47.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-2dc07b47.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-38419178.js +11 -0
- package/dist/searchcraft-javascript-sdk/p-38419178.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-5e064c07.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-5e064c07.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/{p-755f491b.js → p-6104fe5d.js} +2 -2
- package/dist/searchcraft-javascript-sdk/p-6104fe5d.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-69da4e58.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-69da4e58.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-6bffd3f5.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-6bffd3f5.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-75779e4b.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-75779e4b.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-7f4dd50c.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-9340f4e4.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-9340f4e4.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-a84b1548.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-a84b1548.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-b8ea0454.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-b8ea0454.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-c4a9d8ab.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-c4a9d8ab.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-d2fffca9.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-d2fffca9.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-e11de2d6.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-e11de2d6.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js +1 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js.map +1 -1
- package/dist/types/components/searchcraft-base-search-result/searchcraft-base-search-result.d.ts +20 -41
- package/dist/types/components/searchcraft-base-search-result-ad/searchcraft-base-search-result-ad.d.ts +14 -0
- package/dist/types/components/searchcraft-base-search-results/searchcraft-base-search-results.d.ts +9 -18
- package/dist/types/components/searchcraft-button/searchcraft-button.d.ts +17 -6
- package/dist/types/components/searchcraft-facet-list/searchcraft-facet-list.d.ts +1 -1
- package/dist/types/components/searchcraft-filter-panel/searchcraft-filter-panel.d.ts +2 -2
- package/dist/types/components/searchcraft-input-form/searchcraft-input-form.d.ts +1 -1
- package/dist/types/components/searchcraft-pagination/searchcraft-pagination.d.ts +33 -0
- package/dist/types/components/searchcraft-popover-form/searchcraft-popover-form.d.ts +9 -7
- package/dist/types/components/searchcraft-popover-list-item/searchcraft-popover-list-item.d.ts +9 -12
- package/dist/types/components/searchcraft-popover-list-item-ad/searchcraft-popover-list-item-ad.d.ts +14 -0
- package/dist/types/components/searchcraft-popover-list-view/searchcraft-popover-list-view.d.ts +7 -4
- package/dist/types/components/searchcraft-results-info/searchcraft-results-info.d.ts +26 -4
- package/dist/types/components/searchcraft-search-results-per-page/searchcraft-search-results-per-page.d.ts +33 -0
- package/dist/types/components/searchcraft-select/searchcraft-select.d.ts +64 -0
- package/dist/types/components/searchcraft-theme/searchcraft-theme.d.ts +11 -2
- package/dist/types/components/searchcraft-toggle-button/searchcraft-toggle-button.d.ts +1 -1
- package/dist/types/components.d.ts +444 -170
- package/dist/types/index.d.ts +1 -2
- package/dist/types/provider/SearchcraftStore.d.ts +4 -0
- package/dist/types/provider/SearchcraftStore.types.d.ts +44 -0
- package/dist/types/provider/store.d.ts +2 -34
- package/dist/types/utils/units.d.ts +1 -1
- package/package.json +3 -3
- package/dist/cjs/searchcraft-base-search-result.cjs.entry.js +0 -117
- package/dist/cjs/searchcraft-base-search-result.cjs.entry.js.map +0 -1
- package/dist/cjs/searchcraft-popover-list-item.cjs.entry.js +0 -49
- package/dist/cjs/searchcraft-popover-list-item.cjs.entry.js.map +0 -1
- package/dist/cjs/store-f6ba3dfb.js.map +0 -1
- package/dist/collection/types/_shared.types.js +0 -2
- package/dist/collection/types/_shared.types.js.map +0 -1
- package/dist/collection/types/index.js +0 -5
- package/dist/collection/types/index.js.map +0 -1
- package/dist/collection/types/searchcraft-base-search-results.types.js +0 -2
- package/dist/collection/types/searchcraft-base-search-results.types.js.map +0 -1
- package/dist/collection/types/searchcraft-filter-panel.types.js +0 -2
- package/dist/collection/types/searchcraft-filter-panel.types.js.map +0 -1
- package/dist/collection/types/searchcraft-popover-form.types.js +0 -2
- package/dist/collection/types/searchcraft-popover-form.types.js.map +0 -1
- package/dist/components/p-0ef4ab33.js +0 -66
- package/dist/components/p-0ef4ab33.js.map +0 -1
- package/dist/components/p-1234974c.js.map +0 -1
- package/dist/components/p-506cdac1.js +0 -58
- package/dist/components/p-506cdac1.js.map +0 -1
- package/dist/components/p-521fe971.js.map +0 -1
- package/dist/components/p-54998882.js.map +0 -1
- package/dist/components/p-755f491b.js.map +0 -1
- package/dist/components/p-936e2ed4.js.map +0 -1
- package/dist/components/p-960ddc89.js.map +0 -1
- package/dist/components/p-b4a8fcbe.js.map +0 -1
- package/dist/esm/searchcraft-base-search-result.entry.js +0 -113
- package/dist/esm/searchcraft-base-search-result.entry.js.map +0 -1
- package/dist/esm/searchcraft-popover-list-item.entry.js +0 -45
- package/dist/esm/searchcraft-popover-list-item.entry.js.map +0 -1
- package/dist/esm/store-aa071d9c.js.map +0 -1
- package/dist/esm/units-b6eba560.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-109ab0e0.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-109ab0e0.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-26f5263d.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-26f5263d.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-2ff7eb35.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-2ff7eb35.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-36f0532e.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-36f0532e.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-41b6bc5d.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-41b6bc5d.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-57eddb07.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-57eddb07.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-5d6fbee0.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-5d6fbee0.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-64c5a1d2.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-64c5a1d2.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-755f491b.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-936e2ed4.js +0 -11
- package/dist/searchcraft-javascript-sdk/p-936e2ed4.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-c7df8be6.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-c7df8be6.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-eb6058e8.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-eb6058e8.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-faaa4394.entry.js +0 -2
- package/dist/types/types/_shared.types.d.ts +0 -46
- package/dist/types/types/index.d.ts +0 -5
- package/dist/types/types/searchcraft-base-search-results.types.d.ts +0 -11
- package/dist/types/types/searchcraft-filter-panel.types.d.ts +0 -43
- package/dist/types/types/searchcraft-popover-form.types.d.ts +0 -9
- /package/dist/searchcraft-javascript-sdk/{p-faaa4394.entry.js.map → p-7f4dd50c.entry.js.map} +0 -0
- /package/dist/types/{types → themes}/raw.d.ts +0 -0
|
@@ -1,34 +1,52 @@
|
|
|
1
1
|
import { r as registerInstance } from './index-3608c57d.js';
|
|
2
2
|
|
|
3
|
-
const styles = `:root{--sc-font-family: sans-serif;--sc-heading-1-font-size: 32px;--sc-heading-1-line-height: 36px;--sc-heading-1-font-weight: 700;--sc-heading-2-font-size: 29px;--sc-heading-2-line-height: 32px;--sc-heading-2-font-weight: 700;--sc-heading-3-font-size: 26px;--sc-heading-3-line-height: 28px;--sc-heading-3-font-weight: 700;--sc-heading-4-font-size: 23px;--sc-heading-4-line-height: 24px;--sc-heading-4-font-weight: 700;--sc-heading-5-font-size: 20px;--sc-heading-5-line-height: 24px;--sc-heading-5-font-weight: 700;--sc-heading-6-font-size: 10px;--sc-heading-6-line-height: 12px;--sc-heading-6-font-weight: 700;--sc-body-bold-font-size: 16px;--sc-body-bold-line-height: 20px;--sc-body-bold-font-weight: 700;--sc-body-font-size: 16px;--sc-body-line-height: 20px;--sc-body-font-weight:400;--sc-body-small-bold-font-size: 12px;--sc-body-small-bold-line-height: 16px;--sc-body-small-bold-font-weight: 700;--sc-body-small-font-size: 12px;--sc-body-small-line-height: 16px;--sc-body-small-font-weight: 400}:root{--sc-input-border-radius: 8px;--sc-input-search-icon-size: 20px;--sc-input-clear-icon-size: 20px;--sc-input-padding-left: 44px;--sc-input-padding-right: 44px;--sc-image-border-radius: 8px;--sc-popover-form-border-radius: 8px;--sc-popover-list-view-height: 400px;--sc-popover-list-item-image-size: 60px;--sc-popover-list-item-padding-horizontal: 8px;--sc-popover-list-item-padding-vertical: 8px;--sc-popover-modal-max-width: 570px}:root{--sc-breakpoint-sm: 576px;--sc-breakpoint-md: 768px;--sc-breakpoint-lg: 992px}:root{--sc-surface-disabled: #D9D9D9;--sc-surface-neutral-primary: #FFFFFF;--sc-surface-neutral-secondary: #F3F3F3;--sc-surface-neutral-light: #FFFFFF;--sc-surface-neutral-primary-hover: #FAFAFA;--sc-surface-neutral-primary-active: #F7F7F7;--sc-surface-neutral-secondary-hover: #EDEDED;--sc-surface-neutral-secondary-active: #E6E6E6;--sc-surface-brand-primary: #000000;--sc-surface-brand-secondary: #E6E6E6;--sc-surface-brand-primary-hover: #2E2E2E;--sc-surface-brand-primary-active: #292929;--sc-surface-brand-secondary-hover: #EBEBEB;--sc-surface-brand-secondary-active: #E0E0E0;--sc-surface-success-primary: #008000;--sc-surface-success-secondary: #CCFFCC;--sc-surface-success-primary-hover: #009900;--sc-surface-success-primary-active: #006600;--sc-surface-success-secondary-hover: #E6FFE6;--sc-surface-success-secondary-active: #E6FFE6;--sc-surface-caution-primary: #CC6600;--sc-surface-caution-secondary: #FFD9B3;--sc-surface-caution-primary-hover: #E57300;--sc-surface-caution-primary-active: #B25A00;--sc-surface-caution-secondary-hover: #FFE5CC;--sc-surface-caution-secondary-active: #FFCC99;--sc-surface-danger-primary: #CC0000;--sc-surface-danger-secondary: #FFCCCC;--sc-surface-danger-primary-hover: #E50000;--sc-surface-danger-primary-active: #B30000;--sc-surface-danger-secondary-hover: #FFE7E7;--sc-surface-danger-secondary-active: #FFB3B3;--sc-content-brand: #000000;--sc-content-success: #008000;--sc-content-caution: #994D00;--sc-content-danger: #990000;--sc-content-disabled: #737373;--sc-content-neutral-primary: #292929;--sc-content-neutral-secondary: #404040;--sc-content-brand-on-primary: #FFFFFF;--sc-content-success-on-primary: #FFFFFF;--sc-content-caution-on-primary: #FFFFFF;--sc-content-danger-on-primary: #FFFFFF;--sc-content-disabled-on-disabled: #737373;--sc-border-neutral: rgba(0,0,0, 0.1);--sc-border-brand: #000000;--sc-border-success: #008000;--sc-border-caution: #CC6600;--sc-border-danger: #CC0000;--sc-border-disabled: #737373}.searchcraft-search-result-container{all:unset;align-items:flex-start;border-radius:16px;display:flex;flex-direction:column;gap:16px;padding:8px;color:inherit;background-color:var(--sc-surface-neutral-primary)}@media(min-width: 768px){.searchcraft-search-result-container{flex-direction:row}}a.searchcraft-search-result-container{cursor:pointer;transition:background-color 100ms}.searchcraft-base-search-result-content-container{flex:1;display:flex;flex-direction:column;gap:8px}.searchcraft-search-result-image{border-radius:var(--sc-image-border-radius);width:100%}@media(min-width: 768px){.searchcraft-search-result-image{width:200px}}.searchcraft-base-search-result-title{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-bold-font-size);font-weight:var(--sc-body-bold-font-weight);line-height:var(--sc-body-bold-line-height);margin:0;color:var(--sc-content-neutral-primary)}.searchcraft-base-search-result-subtitle{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-body-small-font-weight);line-height:var(--sc-body-small-line-height);margin:0;color:var(--sc-content-disabled)}.searchcraft-base-search-result-body-content{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-body-font-weight);line-height:var(--sc-body-line-height);margin:0;color:var(--sc-content-neutral-secondary)}.searchcraft-base-search-result-footer-content{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-body-font-weight);line-height:var(--sc-body-line-height);margin:0;color:var(--sc-content-disabled)}.searchcraft-search-results-container{display:flex;flex-direction:column;justify-content:center;gap:16px}.searchcraft-ad-section{align-items:center;background-color:#f1f1f1;border-radius:16px;display:flex;flex-direction:column;font-size:16px;justify-content:center;min-height:176px;text-align:center}.searchcraft-ad-section p{margin:0;color:var(--sc-content-disabled)}.searchcraft-search-results-empty-state-container{text-align:center}.searchcraft-search-results-error-message-container{text-align:center}.searchcraft-button{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-bold-font-size);font-weight:var(--sc-body-bold-font-weight);line-height:var(--sc-body-bold-line-height);border-radius:8px;display:flex;padding:12px 20px;position:relative;background-color:var(--sc-surface-brand-primary);border:1px solid var(--sc-border-primary);color:var(--sc-content-brand-on-primary)}.searchcraft-button:hover{cursor:pointer;background-color:var(--sc-surface-brand-primary-hover)}.searchcraft-button:focus{outline:2px solid var(--sc-surface-brand-primary)}.buttonLabel{position:relative}.searchcraft-error-message{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-body-small-font-weight);line-height:var(--sc-body-small-line-height);color:var(--sc-content-danger);margin:0}.filtersListContainer{width:100%}.filterCheckboxLabel{align-items:center;color:var(--sc-content-primary);display:flex;font-family:var(--sc-font-family);font-size:14px;font-weight:600;gap:14px;position:relative;-webkit-font-smoothing:antialiased}.filterCheckboxLabel input[type=checkbox]{align-items:center;appearance:none;background-color:var(--sc-surface-brand-secondary-hover);border:1px solid var(--sc-surface-disabled);border-radius:8px;cursor:pointer;display:flex;height:24px;justify-content:center;width:24px}.filterCheckboxLabel input[type=checkbox]:focus{outline:2px solid var(--sc-surface-brand-primary)}.filterCheckboxLabel input[type=checkbox]:checked{background-color:var(--sc-surface-brand-primary);position:relative}.filterCheckboxLabel input[type=checkbox]:checked+.checkContainer{display:block}.filterCheckboxLabel input[type=checkbox]:checked+.dashContainer{display:block}.childFilterCheckboxLabel{align-items:center;color:var(--sc-content-primary);display:flex;font-family:var(--sc-font-family);font-size:14px;font-weight:600;gap:12px;margin-left:24px;position:relative}.childFilterCheckboxLabel input[type=checkbox]{align-items:center;appearance:none;background-color:var(--sc-surface-brand-secondary-hover);border:1px solid var(--sc-surface-disabled);border-radius:8px;cursor:pointer;display:flex;height:24px;justify-content:center;position:relative;width:24px;-webkit-font-smoothing:antialiased}.childFilterCheckboxLabel input[type=checkbox]:focus{outline:2px solid var(--sc-surface-brand-primary)}.childFilterCheckboxLabel input[type=checkbox]:checked{background-color:var(--sc-surface-brand-primary);position:relative}.childFilterCheckboxLabel input[type=checkbox]:checked+.checkContainer{display:block}.childFilterCheckboxLabel input[type=checkbox]:checked+.dashContainer{display:block}.checkContainer{display:none;height:16px;width:16px;position:absolute;top:9px;left:8px}.dashContainer{display:none;height:3px;width:14px;position:absolute;top:3px;left:9px}.searchcraft-facet-message{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-body-small-font-weight);line-height:var(--sc-body-small-line-height);color:var(--sc-content-disabled);text-align:center}.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);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-bold-font-size);font-weight:var(--sc-body-small-bold-font-weight);line-height:var(--sc-body-small-bold-line-height)}.searchcraft-input-grid{display:grid;gap:4px 8px}.searchcraft-input-grid-buttonLeft{grid-template-rows:repeat(3, auto);grid-template-columns:auto 1fr}.searchcraft-input-grid-buttonLeft .searchcraft-input-button-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-grid-buttonLeft .searchcraft-input-label-wrapper{grid-column:2/span 1;grid-row:1/span 1}.searchcraft-input-grid-buttonLeft .searchcraft-input-error-wrapper{grid-column:2/span 1;grid-row:3/span 1}.searchcraft-input-grid-buttonLeft .searchcraft-input-wrapper{grid-column:2/span 1;grid-row:2/span 1}.searchcraft-input-grid-buttonRight{grid-template-rows:repeat(3, auto);grid-template-columns:1fr auto}.searchcraft-input-grid-buttonRight .searchcraft-input-button-wrapper{grid-column:2/span 1;grid-row:2/span 1}.searchcraft-input-grid-buttonRight .searchcraft-input-label-wrapper{grid-column:1/span 1;grid-row:1/span 1}.searchcraft-input-grid-buttonRight .searchcraft-input-error-wrapper{grid-column:1/span 1;grid-row:3/span 1}.searchcraft-input-grid-buttonRight .searchcraft-input-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-grid-buttonNone{grid-template-rows:repeat(3, auto);grid-template-columns:auto}.searchcraft-input-grid-buttonNone .searchcraft-input-button-wrapper{display:none}.searchcraft-input-grid-buttonNone .searchcraft-input-label-wrapper{grid-column:1/span 1;grid-row:1/span 1}.searchcraft-input-grid-buttonNone .searchcraft-input-error-wrapper{grid-column:1/span 1;grid-row:3/span 1}.searchcraft-input-grid-buttonNone .searchcraft-input-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-wrapper{position:relative;display:flex}.searchcraft-input{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-body-font-weight);line-height:var(--sc-body-line-height);background-color:var(--sc-surface-neutral-secondary);border-radius:var(--sc-input-border-radius);border:none;color:var(--sc-content-neutral-primary);outline:none;padding-left:var(--sc-input-padding-left);padding-right:var(--sc-input-padding-right);padding-top:12px;padding-bottom:12px;flex:1}.searchcraft-input::placeholder{color:var(--sc-content-disabled)}.searchcraft-input:focus{outline:var(--sc-border-brand) solid 2px}.searchcraft-input:focus::placeholder{opacity:0}.searchcraft-input.error{color:var(--sc-content-danger);outline:var(--sc-border-danger) solid 2px}.searchcraft-input.error:focus{outline:var(--sc-border-danger) solid 2px}.searchcraft-input-search-icon-wrapper{align-items:center;justify-content:center;display:flex;position:absolute;pointer-events:none;bottom:0;left:0;top:0;width:var(--sc-input-padding-left)}.searchcraft-input-search-icon{pointer-events:none;width:var(--sc-input-search-icon-size);height:var(--sc-input-search-icon-size)}.searchcraft-input-clear-button{all:unset;align-items:center;justify-content:center;cursor:pointer;display:flex;position:absolute;border:none;outline:none;bottom:0;right:0;top:0;width:var(--sc-input-padding-right)}.searchcraft-input-clear-icon{width:var(--sc-input-clear-icon-size);height:var(--sc-input-clear-icon-size)}.searchcraft-input-label{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-bold-font-size);font-weight:var(--sc-body-small-bold-font-weight);line-height:var(--sc-body-small-bold-line-height);color:var(--sc-content-neutral-primary);margin-top:4px;margin-bottom:4px}.searchcraft-popover-form{display:flex;flex-direction:column;flex:1}.searchcraft-popover-form .searchcraft-popover-form-input-wrapper{padding:12px;background-color:var(--sc-surface-neutral-secondary);display:flex;flex-direction:row;gap:4px}.searchcraft-popover-form .searchcraft-popover-form-input-wrapper>searchcraft-input-form{flex:1}.searchcraft-popover-form .searchcraft-popover-form-cancel-button{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-body-font-weight);line-height:var(--sc-body-line-height);border:0;outline:0;padding:0;flex-shrink:0;background:none;cursor:pointer;padding-left:12px;padding-right:12px;border-radius:calc(var(--sc-popover-form-border-radius)*.8)}.searchcraft-popover-form .searchcraft-popover-form-cancel-button:hover{background-color:var(--sc-surface-brand-secondary-hover)}.searchcraft-popover-form .searchcraft-popover-form-cancel-button:focus{background-color:var(--sc-surface-brand-secondary-active)}.searchcraft-popover-form-inline .searchcraft-input{border-top-left-radius:var(--sc-popover-form-border-radius);border-top-right-radius:var(--sc-popover-form-border-radius);border-bottom-left-radius:var(--sc-popover-form-border-radius);border-bottom-right-radius:var(--sc-popover-form-border-radius);border:none;outline:none}.searchcraft-popover-form-inline.searchcraft-popover-form-active .searchcraft-input{border-top-left-radius:var(--sc-popover-form-border-radius);border-top-right-radius:var(--sc-popover-form-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.searchcraft-popover-form-inline .searchcraft-popover-inline-wrapper-outer{position:relative}.searchcraft-popover-form-inline .searchcraft-popover-inline-wrapper-inner{position:absolute;height:var(--sc-popover-list-view-height);z-index:1000;width:100%}.searchcraft-popover-form-inline .searchcraft-popover-list-view{display:flex;flex-direction:column;overflow:auto;background-color:var(--sc-surface-neutral-secondary);border-bottom-left-radius:var(--sc-popover-form-border-radius);border-bottom-right-radius:var(--sc-popover-form-border-radius);max-height:var(--sc-popover-list-view-height)}.searchcraft-popover-form-modal{position:fixed;inset:0;z-index:1000;display:flex;align-items:flex-start;justify-content:center;padding:0;background-color:var(--sc-surface-neutral-secondary)}@media(min-width: 576px){.searchcraft-popover-form-modal{padding:16px;background-color:rgba(0,0,0,0)}}.searchcraft-popover-form-modal .searchcraft-input{border-radius:calc(var(--sc-popover-form-border-radius)*.8);outline-width:1px;outline-color:var(--sc-border-neutral)}.searchcraft-popover-form-modal .searchcraft-popover-form-modal-backdrop{position:absolute;inset:0;background-color:rgba(0,0,0,.5);display:none}@media(min-width: 576px){.searchcraft-popover-form-modal .searchcraft-popover-form-modal-backdrop{display:block}}.searchcraft-popover-form-modal .searchcraft-popover-form-modal-inner{position:absolute;inset:0;z-index:1002;margin-top:0px;display:flex;border-radius:var(--sc-popover-form-border-radius);overflow:hidden}@media(min-width: 576px){.searchcraft-popover-form-modal .searchcraft-popover-form-modal-inner{inset:auto;position:relative;width:100%;margin-top:100px;max-width:var(--sc-popover-modal-max-width)}}.searchcraft-popover-form-modal .searchcraft-popover-list-view{display:flex;flex-direction:column;overflow:auto;background-color:var(--sc-surface-neutral-secondary);border-bottom-left-radius:0;border-bottom-right-radius:0}@media(min-width: 576px){.searchcraft-popover-form-modal .searchcraft-popover-list-view{max-height:var(--sc-popover-list-view-height)}}.searchcraft-popover-form-modal searchcraft-popover-list-view{overflow:scroll}@media(min-width: 576px){.searchcraft-popover-form-modal searchcraft-popover-list-view{overflow:auto}}.searchcraft-popover-form-fullscreen{position:fixed;inset:0;z-index:1000;background-color:var(--sc-surface-neutral-secondary)}.searchcraft-popover-form-fullscreen .searchcraft-popover-form{position:absolute;inset:0}.searchcraft-popover-form-fullscreen .searchcraft-input{border-radius:calc(var(--sc-popover-form-border-radius)*.8);outline-width:1px;outline-color:var(--sc-border-neutral)}.searchcraft-popover-form-fullscreen searchcraft-popover-list-view{overflow:scroll}.searchcraft-popover-list-item{all:unset;display:flex;flex-direction:row;cursor:pointer;gap:8px;padding-right:var(--sc-popover-list-item-padding-horizontal);padding-left:var(--sc-popover-list-item-padding-horizontal);padding-top:var(--sc-popover-list-item-padding-vertical);padding-bottom:var(--sc-popover-list-item-padding-vertical)}.searchcraft-popover-list-item:focus{background-color:var(--sc-surface-neutral-secondary-active);color:var(--sc-content-neutral-secondary)}.searchcraft-popover-list-item:hover{background-color:var(--sc-surface-neutral-secondary-hover);color:var(--sc-content-neutral-secondary)}.searchcraft-popover-list-item-title{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-body-font-weight);line-height:var(--sc-body-line-height);margin:0;color:inherit}.searchcraft-popover-list-item-subtitle{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-body-small-font-weight);line-height:var(--sc-body-small-line-height);margin:0;color:inherit}.searchcraft-popover-list-item-image-wrapper{width:var(--sc-popover-list-item-image-size);height:var(--sc-popover-list-item-image-size);display:flex;align-items:center;justify-content:center;flex-shrink:0}.searchcraft-popover-list-item-image{max-width:var(--sc-popover-list-item-image-size);max-height:var(--sc-popover-list-item-image-size)}.searchcraft-popover-list-item-info-wrapper{display:flex;flex-direction:column;gap:8px;justify-content:center}.searchcraft-results-info-container{border-bottom:1px solid var(--sc-surface-disabled);display:flex;justify-content:flex-start}.searchcraft-results-info-content{color:var(--sc-content-primary);font-family:var(--sc-font-family);font-size:18px;font-weight:600;line-height:20px;margin:0px 0 8px}@media(max-width: 768px){.searchcraft-results-info-content{margin:0;margin-bottom:8px}}.searchcraft-slider-container{align-items:center;display:flex;flex-direction:column;gap:10px;width:100%}.searchcraft-slider-range-container{align-items:center;background-color:var(--sc-surface-disabled);border-radius:999px;display:flex;position:relative;height:4px;width:100%}.searchcraft-slider-range-container::-webkit-slider-runnable-track{pointer-events:none}.searchcraft-slider-range-container .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-container .searchcraft-slider-active-range::-webkit-slider-runnable-track{pointer-events:none}.searchcraft-slider-range-container .searchcraft-slider-active-range::-moz-range-track{pointer-events:none}.searchcraft-slider-range-container .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-container .searchcraft-slider-input::-webkit-slider-thumb{background-color:var(--sc-surface-neutral-light);border-radius:50%;border:2px solid var(--sc-border-neutral);cursor:pointer;height:20px;pointer-events:all;width:20px;-webkit-appearance:none}.searchcraft-slider-range-container .searchcraft-slider-input::-moz-range-thumb{background-color:var(--sc-surface-neutral-light);border-radius:50%;border:2px solid var(--sc-border-neutral);cursor:pointer;height:20px;pointer-events:all;width:20px}.searchcraft-slider-label-container{color:var(--sc-content-primary);display:flex;font-family:"Source Sans Pro",sans-serif;font-size:15px;font-weight:600;justify-content:space-between;margin-top:10px;width:100%}.searchcraft-slider-label{min-width:30px;text-align:center}.searchcraft-toggle-button-container{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}.searchcraft-toggle-button-label{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-body-font-weight);line-height:var(--sc-body-line-height);margin:0;color:var(--sc-content-neutral-primary)}.searchcraft-toggle-button-sub-label{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-body-small-font-weight);line-height:var(--sc-body-small-line-height);margin:0;color:var(--sc-content-neutral-secondary)}.searchcraft-toggle-button-background{transition:background-color .2s;background:var(--sc-surface-disabled);border:none;border-radius:16px;cursor:pointer;height:26px;position:relative;width:44px;flex-shrink:0}.searchcraft-toggle-button-background.active{background:var(--sc-surface-brand-primary);box-shadow:0px 0px 0px 1px rgba(0,0,0,.05)}.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-handle.active{transform:translateX(16px)}/*# sourceMappingURL=hologram.css.map */
|
|
3
|
+
const styles = `: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)}: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: hsl( from var(--sc-color-background) h s clamp(10, calc(l + 5), 95) );--sc-surface-neutral-primary-hover: var(--sc-color-background-hover, #fafafa);--sc-color-background-active: hsl( from var(--sc-color-background) h s clamp(5, calc(l - 5), 90) );--sc-surface-neutral-primary-active: var( --sc-color-background-active, #f7f7f7 );--sc-surface-neutral-secondary: var( --sc-color-background-secondary, var(--sc-color-background, #f3f3f3) );--sc-surface-neutral-secondary-hover: var( --sc-color-background-secondary-hover, var(--sc-color-background-hover, #e6e6e6) );--sc-surface-neutral-secondary-active: var( --sc-color-background-secondary-active, var(--sc-color-background-active, #e0e0e0) );--sc-surface-neutral-light: #ffffff;--sc-content-neutral-primary: var(--sc-color-foreground, #292929);--sc-color-foreground-secondary: hsl( from var(--sc-color-foreground) h s clamp(10, calc(l + 5), 90) );--sc-content-neutral-secondary: var(--sc-color-foreground-secondary, #404040);--sc-border-neutral: rgba(0, 0, 0, 0.1);--sc-surface-brand-primary: var(--sc-color-brand, #000000);--sc-color-brand-hover: hsl( from var(--sc-color-brand) h s clamp(20, calc(l + 5), 95) );--sc-surface-brand-primary-hover: var(--sc-color-brand-hover, #2e2e2e);--sc-color-brand-active: hsl( from var(--sc-color-brand) h s clamp(10, calc(l - 5), 85) );--sc-surface-brand-primary-active: var(--sc-color-brand-active, #292929);--sc-surface-brand-secondary: var( --sc-color-brand-secondary, var(--sc-color-brand, #e6e6e6) );--sc-surface-brand-secondary-hover: var( --sc-color-brand-secondary-hover, var(--sc-color-brand-hover, #ebebeb) );--sc-surface-brand-secondary-active: var( --sc-color-brand-secondary-active, var(--sc-color-brand-active, #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: hsl(from var(--sc-color-success) h s 30);--sc-surface-success-primary-hover: var( --sc-color-success-primary-hover, #009900 );--sc-color-success-primary-active: hsl(from var(--sc-color-success) h s 20);--sc-surface-success-primary-active: var( --sc-color-success-primary-active, #006600 );--sc-color-success-secondary: hsl(from var(--sc-color-success) h s 90);--sc-surface-success-secondary: var(--sc-color-success-secondary, #ccffcc);--sc-color-success-secondary-hover: hsl( from var(--sc-color-success-secondary) h s 95 );--sc-surface-success-secondary-hover: var( --sc-color-success-secondary-hover, #e6ffe6 );--sc-color-success-secondary-active: hsl( from var(--sc-color-success-secondary) h s 85 );--sc-surface-success-secondary-active: var( --sc-color-success-secondary-active, #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: hsl(from var(--sc-color-caution) h s 30);--sc-surface-caution-primary-hover: var( --sc-color-caution-primary-hover, #e57300 );--sc-color-caution-primary-active: hsl(from var(--sc-color-caution) h s 20);--sc-surface-caution-primary-active: var( --sc-color-caution-primary-active, #b25a00 );--sc-color-caution-secondary: hsl(from var(--sc-color-caution) h s 90);--sc-surface-caution-secondary: var(--sc-color-caution-secondary, #ffd9b3);--sc-color-caution-secondary-hover: hsl( from var(--sc-color-caution-secondary) h s 95 );--sc-surface-caution-secondary-hover: var( --sc-color-caution-secondary-hover, #ffe5cc );--sc-color-caution-secondary-active: hsl( from var(--sc-color-caution-secondary) h s 85 );--sc-surface-caution-secondary-active: var( --sc-color-caution-secondary-active, #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: hsl(from var(--sc-color-danger) h s 30);--sc-surface-danger-primary-hover: var( --sc-color-danger-primary-hover, #e50000 );--sc-color-danger-primary-active: hsl(from var(--sc-color-danger) h s 20);--sc-surface-danger-primary-active: var( --sc-color-danger-primary-active, #b30000 );--sc-color-danger-secondary: hsl(from var(--sc-color-danger) h s 90);--sc-surface-danger-secondary: var(--sc-color-danger-secondary, #ffcccc);--sc-color-danger-secondary-hover: hsl( from var(--sc-color-danger-secondary) h s 95 );--sc-surface-danger-secondary-hover: var( --sc-color-danger-secondary-hover, #ffe7e7 );--sc-color-danger-secondary-active: hsl( from var(--sc-color-danger-secondary) h s 85 );--sc-surface-danger-secondary-active: var( --sc-color-danger-secondary-active, #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: hsl( from var(--sc-color-background) h s clamp(10%, calc(l + 5%), 95%) );--sc-color-background-active: hsl( from var(--sc-color-background) h s clamp(5%, calc(l - 5%), 90%) );--sc-color-foreground-secondary: hsl( from var(--sc-color-foreground) h s clamp(10%, calc(l + 5%), 90%) );--sc-color-brand-hover: hsl( from var(--sc-color-brand) h s clamp(20%, calc(l + 5%), 95%) );--sc-color-brand-active: hsl( from var(--sc-color-brand) h s clamp(10%, calc(l - 5%), 85%) );--sc-color-success-primary-hover: hsl(from var(--sc-color-success) h s 30%);--sc-color-success-primary-active: hsl( from var(--sc-color-success) h s 20% );--sc-color-success-secondary: hsl(from var(--sc-color-success) h s 90%);--sc-color-success-secondary-hover: hsl( from var(--sc-color-success-secondary) h s 95% );--sc-color-success-secondary-active: 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: hsl(from var(--sc-color-caution) h s 30%);--sc-color-caution-primary-active: hsl( from var(--sc-color-caution) h s 20% );--sc-color-caution-secondary: hsl(from var(--sc-color-caution) h s 90%);--sc-color-caution-secondary-hover: hsl( from var(--sc-color-caution-secondary) h s 95% );--sc-color-caution-secondary-active: 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: hsl(from var(--sc-color-danger) h s 30%);--sc-color-danger-primary-active: hsl(from var(--sc-color-danger) h s 20%);--sc-color-danger-secondary: hsl(from var(--sc-color-danger) h s 90%);--sc-color-danger-secondary-hover: hsl( from var(--sc-color-danger-secondary) h s 95% );--sc-color-danger-secondary-active: 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-search-result-container{all:unset;align-items:flex-start;border-radius:var(--sc-border-radius-lg);display:flex;flex-direction:column;gap:16px;padding:8px;color:inherit;background-color:var(--sc-surface-neutral-primary)}@media(min-width: 768px){.searchcraft-search-result-container{flex-direction:row}}a.searchcraft-search-result-container{cursor:pointer;transition:background-color 100ms}.searchcraft-base-search-result-content-container{flex:1;display:flex;flex-direction:column;gap:8px}.searchcraft-search-result-image{border-radius:calc(--sc-border-radius-lg - 8px);border-radius:calc(var(--sc-border-radius-lg) - 8px);width:100%}@media(min-width: 768px){.searchcraft-search-result-image{width:200px}}.searchcraft-base-search-result-title{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);color:var(--sc-content-neutral-primary);font-weight:var(--sc-font-bold);margin:0}.searchcraft-base-search-result-subtitle{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);color:var(--sc-content-disabled);margin:0}.searchcraft-base-search-result-body-content{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);color:var(--sc-content-neutral-secondary);margin:0}.searchcraft-base-search-result-footer-content{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);color:var(--sc-content-disabled);margin:0}.searchcraft-base-ad{all:unset;display:flex;flex-direction:row;cursor:pointer;gap:8px;padding-right:var(--sc-popover-list-item-padding-horizontal);padding-left:var(--sc-popover-list-item-padding-horizontal);padding-top:var(--sc-popover-list-item-padding-vertical);padding-bottom:var(--sc-popover-list-item-padding-vertical);background-color:var(--sc-surface-neutral-primary);border-radius:16px;border:1px solid blue}.searchcraft-base-ad-title{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);margin:0;color:inherit}.searchcraft-base-ad-subtitle{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);margin:0;color:inherit}.searchcraft-base-ad-image-wrapper{width:var(--sc-popover-list-item-image-size);height:var(--sc-popover-list-item-image-size);display:flex;align-items:center;justify-content:center;flex-shrink:0}.searchcraft-base-ad-image{max-width:var(--sc-popover-list-item-image-size);max-height:var(--sc-popover-list-item-image-size)}.searchcraft-base-ad-info-wrapper{display:flex;flex-direction:column;gap:8px;justify-content:center}.searchcraft-search-results-container{display:flex;flex-direction:column;justify-content:center;gap:16px}.searchcraft-search-results-empty-state-container{text-align:center}.searchcraft-search-results-error-message-container{text-align:center}.searchcraft-button{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);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-error-message{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);color:var(--sc-content-danger);margin:0}.filtersListContainer{width:100%}.filterCheckboxLabel{align-items:center;color:var(--sc-content-brand);display:flex;font-family:var(--sc-font-family);font-size:14px;font-weight:600;gap:14px;position:relative;-webkit-font-smoothing:antialiased}.filterCheckboxLabel input[type=checkbox]{align-items:center;appearance:none;background-color:var(--sc-surface-neutral-secondary);border:1px solid var(--sc-surface-disabled);border-radius:8px;cursor:pointer;display:flex;height:24px;justify-content:center;width:24px}.filterCheckboxLabel input[type=checkbox]:focus{outline:2px solid var(--sc-surface-brand-primary)}.filterCheckboxLabel input[type=checkbox]:checked{background-color:var(--sc-surface-brand-primary);position:relative}.filterCheckboxLabel input[type=checkbox]:checked+.checkContainer{display:block}.filterCheckboxLabel input[type=checkbox]:checked+.dashContainer{display:block}.childFilterCheckboxLabel{align-items:center;color:var(--sc-content-primary);display:flex;font-family:var(--sc-font-family);font-size:14px;font-weight:600;gap:12px;margin-left:24px;position:relative}.childFilterCheckboxLabel input[type=checkbox]{align-items:center;appearance:none;background-color:var(--sc-surface-neutral-secondary-hover);border:1px solid var(--sc-surface-disabled);border-radius:8px;cursor:pointer;display:flex;height:24px;justify-content:center;position:relative;width:24px;-webkit-font-smoothing:antialiased}.childFilterCheckboxLabel input[type=checkbox]:focus{outline:2px solid var(--sc-surface-brand-primary)}.childFilterCheckboxLabel input[type=checkbox]:checked{background-color:var(--sc-surface-brand-primary);position:relative}.childFilterCheckboxLabel input[type=checkbox]:checked+.checkContainer{display:block}.childFilterCheckboxLabel input[type=checkbox]:checked+.dashContainer{display:block}.checkContainer{display:none;height:16px;width:16px;position:absolute;top:9px;left:8px}.dashContainer{display:none;height:3px;width:14px;position:absolute;top:3px;left:9px}.searchcraft-facet-message{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);color:var(--sc-content-disabled);text-align:center}.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);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-bold)}:root{--sc-input-border-radius: var(--sc-border-radius);--sc-input-search-icon-size: 20px;--sc-input-clear-icon-size: 20px;--sc-input-padding-left: 44px;--sc-input-padding-right: 44px}.searchcraft-input-grid{display:grid;gap:4px 8px}.searchcraft-input-grid-buttonLeft{grid-template-rows:repeat(3, auto);grid-template-columns:auto 1fr}.searchcraft-input-grid-buttonLeft .searchcraft-input-button-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-grid-buttonLeft .searchcraft-input-label-wrapper{grid-column:2/span 1;grid-row:1/span 1}.searchcraft-input-grid-buttonLeft .searchcraft-input-error-wrapper{grid-column:2/span 1;grid-row:3/span 1}.searchcraft-input-grid-buttonLeft .searchcraft-input-wrapper{grid-column:2/span 1;grid-row:2/span 1}.searchcraft-input-grid-buttonRight{grid-template-rows:repeat(3, auto);grid-template-columns:1fr auto}.searchcraft-input-grid-buttonRight .searchcraft-input-button-wrapper{grid-column:2/span 1;grid-row:2/span 1}.searchcraft-input-grid-buttonRight .searchcraft-input-label-wrapper{grid-column:1/span 1;grid-row:1/span 1}.searchcraft-input-grid-buttonRight .searchcraft-input-error-wrapper{grid-column:1/span 1;grid-row:3/span 1}.searchcraft-input-grid-buttonRight .searchcraft-input-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-grid-buttonNone{grid-template-rows:repeat(3, auto);grid-template-columns:auto}.searchcraft-input-grid-buttonNone .searchcraft-input-button-wrapper{display:none}.searchcraft-input-grid-buttonNone .searchcraft-input-label-wrapper{grid-column:1/span 1;grid-row:1/span 1}.searchcraft-input-grid-buttonNone .searchcraft-input-error-wrapper{grid-column:1/span 1;grid-row:3/span 1}.searchcraft-input-grid-buttonNone .searchcraft-input-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-wrapper{position:relative;display:flex}.searchcraft-input{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);background-color:var(--sc-surface-neutral-secondary);border-radius:var(--sc-input-border-radius);border:none;color:var(--sc-content-neutral-primary);outline:none;padding-left:var(--sc-input-padding-left);padding-right:var(--sc-input-padding-right);padding-top:12px;padding-bottom:12px;flex:1}.searchcraft-input::placeholder{color:var(--sc-content-disabled)}.searchcraft-input:focus{outline:var(--sc-border-brand) solid 2px}.searchcraft-input:focus::placeholder{opacity:0}.searchcraft-input.error{color:var(--sc-content-danger);outline:var(--sc-border-danger) solid 2px}.searchcraft-input.error:focus{outline:var(--sc-border-danger) solid 2px}.searchcraft-input-search-icon-wrapper{align-items:center;justify-content:center;display:flex;position:absolute;pointer-events:none;bottom:0;left:0;top:0;width:var(--sc-input-padding-left)}.searchcraft-input-search-icon{pointer-events:none;width:var(--sc-input-search-icon-size);height:var(--sc-input-search-icon-size);color:var(--sc-content-neutral-secondary)}.searchcraft-input-clear-button{all:unset;align-items:center;justify-content:center;cursor:pointer;display:flex;position:absolute;border:none;outline:none;bottom:0;right:0;top:0;width:var(--sc-input-padding-right)}.searchcraft-input-clear-icon{width:var(--sc-input-clear-icon-size);height:var(--sc-input-clear-icon-size);color:var(--sc-content-brand)}.searchcraft-input-label{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);color:var(--sc-content-neutral-primary);font-weight:var(--sc-font-bold);margin-top:4px;margin-bottom:4px}:root{--sc-popover-form-border-radius: var(--sc-border-radius);--sc-popover-list-view-height: 400px;--sc-popover-list-item-image-size: 60px;--sc-popover-list-item-padding-horizontal: 8px;--sc-popover-list-item-padding-vertical: 8px;--sc-popover-modal-max-width: 570px}.searchcraft-popover-form{display:flex;flex-direction:column;flex:1}.searchcraft-popover-form .searchcraft-popover-form-input-wrapper{padding:12px;background-color:var(--sc-surface-neutral-secondary);display:flex;flex-direction:row;gap:4px}.searchcraft-popover-form .searchcraft-popover-form-input-wrapper>searchcraft-input-form{flex:1}.searchcraft-popover-form .searchcraft-popover-form-cancel-button{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);border-radius:calc(--sc-popover-form-border-radius - 12px);border-radius:calc(var(--sc-popover-form-border-radius) - 12px);border:0;outline:0;padding:0;flex-shrink:0;background:none;cursor:pointer;padding-left:12px;padding-right:12px}.searchcraft-popover-form .searchcraft-popover-form-cancel-button:hover{background-color:var(--sc-surface-brand-secondary-hover)}.searchcraft-popover-form .searchcraft-popover-form-cancel-button:focus{background-color:var(--sc-surface-brand-secondary-active)}.searchcraft-popover-form-inline .searchcraft-input{border-top-left-radius:var(--sc-popover-form-border-radius);border-top-right-radius:var(--sc-popover-form-border-radius);border-bottom-left-radius:var(--sc-popover-form-border-radius);border-bottom-right-radius:var(--sc-popover-form-border-radius);border:none;outline:none}.searchcraft-popover-form-inline.searchcraft-popover-form-active .searchcraft-input{border-top-left-radius:var(--sc-popover-form-border-radius);border-top-right-radius:var(--sc-popover-form-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.searchcraft-popover-form-inline .searchcraft-popover-inline-wrapper-outer{position:relative}.searchcraft-popover-form-inline .searchcraft-popover-inline-wrapper-inner{position:absolute;height:var(--sc-popover-list-view-height);z-index:1000;width:100%}.searchcraft-popover-form-inline .searchcraft-popover-list-view{display:flex;flex-direction:column;overflow:auto;background-color:var(--sc-surface-neutral-secondary);border-bottom-left-radius:var(--sc-popover-form-border-radius);border-bottom-right-radius:var(--sc-popover-form-border-radius);max-height:var(--sc-popover-list-view-height)}.searchcraft-popover-form-modal{position:fixed;inset:0;z-index:1000;display:flex;align-items:flex-start;justify-content:center;padding:0;background-color:var(--sc-surface-neutral-secondary)}@media(min-width: 576px){.searchcraft-popover-form-modal{padding:16px;background-color:rgba(0,0,0,0)}}.searchcraft-popover-form-modal .searchcraft-input{border-radius:calc(--sc-popover-form-border-radius - 12px);border-radius:calc(var(--sc-popover-form-border-radius) - 12px);outline-width:1px;outline-color:var(--sc-border-neutral)}.searchcraft-popover-form-modal .searchcraft-popover-form-modal-backdrop{position:absolute;inset:0;background-color:rgba(0,0,0,.5);display:none}@media(min-width: 576px){.searchcraft-popover-form-modal .searchcraft-popover-form-modal-backdrop{display:block}}.searchcraft-popover-form-modal .searchcraft-popover-form-modal-inner{position:absolute;inset:0;z-index:1002;margin-top:0px;display:flex;border-radius:var(--sc-popover-form-border-radius);overflow:hidden}@media(min-width: 576px){.searchcraft-popover-form-modal .searchcraft-popover-form-modal-inner{inset:auto;position:relative;width:100%;margin-top:100px;max-width:var(--sc-popover-modal-max-width)}}.searchcraft-popover-form-modal .searchcraft-popover-list-view{display:flex;flex-direction:column;overflow:auto;background-color:var(--sc-surface-neutral-secondary);border-bottom-left-radius:0;border-bottom-right-radius:0}@media(min-width: 576px){.searchcraft-popover-form-modal .searchcraft-popover-list-view{max-height:var(--sc-popover-list-view-height)}}.searchcraft-popover-form-modal searchcraft-popover-list-view{overflow:scroll}@media(min-width: 576px){.searchcraft-popover-form-modal searchcraft-popover-list-view{overflow:auto}}.searchcraft-popover-form-fullscreen{position:fixed;inset:0;z-index:1000;background-color:var(--sc-surface-neutral-secondary)}.searchcraft-popover-form-fullscreen .searchcraft-popover-form{position:absolute;inset:0}.searchcraft-popover-form-fullscreen .searchcraft-input{border-radius:calc(--sc-popover-form-border-radius - 12px);border-radius:calc(var(--sc-popover-form-border-radius) - 12px);outline-width:1px;outline-color:var(--sc-border-neutral)}.searchcraft-popover-form-fullscreen searchcraft-popover-list-view{overflow:scroll}.searchcraft-popover-list-item-ad{all:unset;display:flex;flex-direction:row;cursor:pointer;gap:8px;padding-right:var(--sc-popover-list-item-padding-horizontal);padding-left:var(--sc-popover-list-item-padding-horizontal);padding-top:var(--sc-popover-list-item-padding-vertical);padding-bottom:var(--sc-popover-list-item-padding-vertical);border:1px solid blue}.searchcraft-popover-list-item-ad:focus{background-color:var(--sc-surface-neutral-secondary-active);color:var(--sc-content-neutral-secondary)}.searchcraft-popover-list-item-ad:hover{background-color:var(--sc-surface-neutral-secondary-hover);color:var(--sc-content-neutral-secondary)}.searchcraft-popover-list-item-ad-title{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);margin:0;color:inherit}.searchcraft-popover-list-item-ad-subtitle{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);margin:0;color:inherit}.searchcraft-popover-list-item-ad-image-wrapper{width:var(--sc-popover-list-item-image-size);height:var(--sc-popover-list-item-image-size);display:flex;align-items:center;justify-content:center;flex-shrink:0}.searchcraft-popover-list-item-ad-image{max-width:var(--sc-popover-list-item-image-size);max-height:var(--sc-popover-list-item-image-size)}.searchcraft-popover-list-item-ad-info-wrapper{display:flex;flex-direction:column;gap:8px;justify-content:center}.searchcraft-popover-list-item{all:unset;color:var(--sc-content-neutral-secondary);display:flex;flex-direction:row;cursor:pointer;gap:8px;padding-right:var(--sc-popover-list-item-padding-horizontal);padding-left:var(--sc-popover-list-item-padding-horizontal);padding-top:var(--sc-popover-list-item-padding-vertical);padding-bottom:var(--sc-popover-list-item-padding-vertical)}.searchcraft-popover-list-item:focus{background-color:var(--sc-surface-neutral-secondary-active);color:var(--sc-content-neutral-secondary)}.searchcraft-popover-list-item:hover{background-color:var(--sc-surface-neutral-secondary-hover);color:var(--sc-content-neutral-secondary)}.searchcraft-popover-list-item-title{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);margin:0;color:inherit}.searchcraft-popover-list-item-subtitle{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);margin:0;color:inherit}.searchcraft-popover-list-item-image-wrapper{width:var(--sc-popover-list-item-image-size);height:var(--sc-popover-list-item-image-size);display:flex;align-items:center;justify-content:center;flex-shrink:0}.searchcraft-popover-list-item-image{max-width:var(--sc-popover-list-item-image-size);max-height:var(--sc-popover-list-item-image-size)}.searchcraft-popover-list-item-info-wrapper{display:flex;flex-direction:column;gap:8px;justify-content:center}.searchcraft-results-info{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);color:var(--sc-content-primary);margin:0}.searchcraft-slider-container{align-items:center;display:flex;flex-direction:column;gap:10px;width:100%}.searchcraft-slider-range-container{align-items:center;background-color:var(--sc-surface-disabled);border-radius:999px;display:flex;position:relative;height:4px;width:100%}.searchcraft-slider-range-container::-webkit-slider-runnable-track{pointer-events:none}.searchcraft-slider-range-container .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-container .searchcraft-slider-active-range::-webkit-slider-runnable-track{pointer-events:none}.searchcraft-slider-range-container .searchcraft-slider-active-range::-moz-range-track{pointer-events:none}.searchcraft-slider-range-container .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-container .searchcraft-slider-input::-webkit-slider-thumb{background-color:var(--sc-surface-neutral-light);border-radius:50%;border:2px solid var(--sc-border-neutral);cursor:pointer;height:20px;pointer-events:all;width:20px;-webkit-appearance:none}.searchcraft-slider-range-container .searchcraft-slider-input::-moz-range-thumb{background-color:var(--sc-surface-neutral-light);border-radius:50%;border:2px solid var(--sc-border-neutral);cursor:pointer;height:20px;pointer-events:all;width:20px}.searchcraft-slider-label-container{color:var(--sc-content-primary);display:flex;font-family:"Source Sans Pro",sans-serif;font-size:15px;font-weight:600;justify-content:space-between;margin-top:10px;width:100%}.searchcraft-slider-label{min-width:30px;text-align:center}.searchcraft-toggle-button-container{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}.searchcraft-toggle-button-label{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);margin:0;color:var(--sc-content-neutral-primary)}.searchcraft-toggle-button-sub-label{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);margin:0;color:var(--sc-content-neutral-secondary)}.searchcraft-toggle-button-background{transition:background-color .2s;background:var(--sc-surface-disabled);border:none;border-radius:16px;cursor:pointer;height:26px;position:relative;width:44px;flex-shrink:0}.searchcraft-toggle-button-background.active{background:var(--sc-surface-brand-primary);box-shadow:0px 0px 0px 1px rgba(0,0,0,.05)}.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-handle.active{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);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);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);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);align-items:center;display:flex}.searchcraft-select{display:flex;flex-direction:column;gap:4px}.searchcraft-select-label{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-bold)}.searchcraft-select-input-wrapper{position:relative}.searchcraft-select-input{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);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{pointer-events:none;position:absolute;right:12px;top:50%;transform:translateY(-50%)}.searchcraft-select-caption{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size)}.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);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size)}.searchcraft-search-results-per-page-select-input{min-width:120px}/*# sourceMappingURL=hologram.css.map */
|
|
4
4
|
`;
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const SearchcraftTheme = class {
|
|
7
7
|
constructor(hostRef) {
|
|
8
8
|
registerInstance(this, hostRef);
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* The name of the theme.
|
|
12
|
+
*/
|
|
13
|
+
theme = 'light';
|
|
14
|
+
/**
|
|
15
|
+
* The custom theme configuration object.
|
|
16
|
+
*/
|
|
17
|
+
customTheme = '[]';
|
|
18
|
+
camelToKebab = (string) => {
|
|
19
|
+
return string
|
|
20
|
+
.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`) // Convert uppercase letters to `-lowercase`
|
|
21
|
+
.toLowerCase(); // Ensure the whole string is in lowercase
|
|
22
|
+
};
|
|
10
23
|
componentDidLoad() {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const styleTag = document.querySelector('#searchcraft-theme') ||
|
|
24
|
+
// Inject style element
|
|
25
|
+
const styleElement = document.querySelector('#searchcraft-theme') ||
|
|
14
26
|
document.createElement('style');
|
|
15
|
-
|
|
16
|
-
|
|
27
|
+
styleElement.innerHTML = styles;
|
|
28
|
+
styleElement.id = 'searchcraft-theme';
|
|
17
29
|
const head = document.head || document.getElementsByTagName('head')[0];
|
|
18
|
-
if (!head.contains(
|
|
30
|
+
if (!head.contains(styleElement)) {
|
|
19
31
|
if (head.firstChild) {
|
|
20
|
-
head.insertBefore(
|
|
32
|
+
head.insertBefore(styleElement, head.firstChild);
|
|
21
33
|
}
|
|
22
34
|
else {
|
|
23
|
-
head.appendChild(
|
|
35
|
+
head.appendChild(styleElement);
|
|
24
36
|
}
|
|
25
37
|
}
|
|
38
|
+
// Add theme name to body
|
|
39
|
+
document.body.dataset.theme = this.theme;
|
|
40
|
+
// Add CSS variables from customTheme configuration to document
|
|
41
|
+
Object.entries(JSON.parse(this.customTheme)).map(([key, value]) => {
|
|
42
|
+
document.documentElement.style.setProperty(`--${this.camelToKebab(key)}`, `${value}`);
|
|
43
|
+
});
|
|
26
44
|
}
|
|
27
45
|
render() {
|
|
28
46
|
return;
|
|
29
47
|
}
|
|
30
48
|
};
|
|
31
49
|
|
|
32
|
-
export {
|
|
50
|
+
export { SearchcraftTheme as searchcraft_theme };
|
|
33
51
|
|
|
34
52
|
//# sourceMappingURL=searchcraft-theme.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"searchcraft-theme.entry.js","mappings":";;AAAA,eAAe,CAAC;AAChB;;MCgBa,uBAAuB;;;;IAClC,gBAAgB;QACd,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QAChC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACpB,MAAM,QAAQ,GACZ,QAAQ,CAAC,aAAa,CAAC,oBAAoB,CAAC;YAC5C,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAClC,QAAQ,CAAC,SAAS,GAAG,MAAM,CAAC;QAC5B,QAAQ,CAAC,EAAE,GAAG,mBAAmB,CAAC;QAElC,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QACvE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;YAC5B,IAAI,IAAI,CAAC,UAAU,EAAE;gBACnB,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;aAC9C;iBAAM;gBACL,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;aAC5B;SAEF;KACF;IAED,MAAM;QACJ,OAAO;KACR;;;;;","names":[],"sources":["src/themes/hologram.css?raw","src/components/searchcraft-theme/searchcraft-theme.tsx"],"sourcesContent":["export default `:root{--sc-font-family: sans-serif;--sc-heading-1-font-size: 32px;--sc-heading-1-line-height: 36px;--sc-heading-1-font-weight: 700;--sc-heading-2-font-size: 29px;--sc-heading-2-line-height: 32px;--sc-heading-2-font-weight: 700;--sc-heading-3-font-size: 26px;--sc-heading-3-line-height: 28px;--sc-heading-3-font-weight: 700;--sc-heading-4-font-size: 23px;--sc-heading-4-line-height: 24px;--sc-heading-4-font-weight: 700;--sc-heading-5-font-size: 20px;--sc-heading-5-line-height: 24px;--sc-heading-5-font-weight: 700;--sc-heading-6-font-size: 10px;--sc-heading-6-line-height: 12px;--sc-heading-6-font-weight: 700;--sc-body-bold-font-size: 16px;--sc-body-bold-line-height: 20px;--sc-body-bold-font-weight: 700;--sc-body-font-size: 16px;--sc-body-line-height: 20px;--sc-body-font-weight:400;--sc-body-small-bold-font-size: 12px;--sc-body-small-bold-line-height: 16px;--sc-body-small-bold-font-weight: 700;--sc-body-small-font-size: 12px;--sc-body-small-line-height: 16px;--sc-body-small-font-weight: 400}:root{--sc-input-border-radius: 8px;--sc-input-search-icon-size: 20px;--sc-input-clear-icon-size: 20px;--sc-input-padding-left: 44px;--sc-input-padding-right: 44px;--sc-image-border-radius: 8px;--sc-popover-form-border-radius: 8px;--sc-popover-list-view-height: 400px;--sc-popover-list-item-image-size: 60px;--sc-popover-list-item-padding-horizontal: 8px;--sc-popover-list-item-padding-vertical: 8px;--sc-popover-modal-max-width: 570px}:root{--sc-breakpoint-sm: 576px;--sc-breakpoint-md: 768px;--sc-breakpoint-lg: 992px}:root{--sc-surface-disabled: #D9D9D9;--sc-surface-neutral-primary: #FFFFFF;--sc-surface-neutral-secondary: #F3F3F3;--sc-surface-neutral-light: #FFFFFF;--sc-surface-neutral-primary-hover: #FAFAFA;--sc-surface-neutral-primary-active: #F7F7F7;--sc-surface-neutral-secondary-hover: #EDEDED;--sc-surface-neutral-secondary-active: #E6E6E6;--sc-surface-brand-primary: #000000;--sc-surface-brand-secondary: #E6E6E6;--sc-surface-brand-primary-hover: #2E2E2E;--sc-surface-brand-primary-active: #292929;--sc-surface-brand-secondary-hover: #EBEBEB;--sc-surface-brand-secondary-active: #E0E0E0;--sc-surface-success-primary: #008000;--sc-surface-success-secondary: #CCFFCC;--sc-surface-success-primary-hover: #009900;--sc-surface-success-primary-active: #006600;--sc-surface-success-secondary-hover: #E6FFE6;--sc-surface-success-secondary-active: #E6FFE6;--sc-surface-caution-primary: #CC6600;--sc-surface-caution-secondary: #FFD9B3;--sc-surface-caution-primary-hover: #E57300;--sc-surface-caution-primary-active: #B25A00;--sc-surface-caution-secondary-hover: #FFE5CC;--sc-surface-caution-secondary-active: #FFCC99;--sc-surface-danger-primary: #CC0000;--sc-surface-danger-secondary: #FFCCCC;--sc-surface-danger-primary-hover: #E50000;--sc-surface-danger-primary-active: #B30000;--sc-surface-danger-secondary-hover: #FFE7E7;--sc-surface-danger-secondary-active: #FFB3B3;--sc-content-brand: #000000;--sc-content-success: #008000;--sc-content-caution: #994D00;--sc-content-danger: #990000;--sc-content-disabled: #737373;--sc-content-neutral-primary: #292929;--sc-content-neutral-secondary: #404040;--sc-content-brand-on-primary: #FFFFFF;--sc-content-success-on-primary: #FFFFFF;--sc-content-caution-on-primary: #FFFFFF;--sc-content-danger-on-primary: #FFFFFF;--sc-content-disabled-on-disabled: #737373;--sc-border-neutral: rgba(0,0,0, 0.1);--sc-border-brand: #000000;--sc-border-success: #008000;--sc-border-caution: #CC6600;--sc-border-danger: #CC0000;--sc-border-disabled: #737373}.searchcraft-search-result-container{all:unset;align-items:flex-start;border-radius:16px;display:flex;flex-direction:column;gap:16px;padding:8px;color:inherit;background-color:var(--sc-surface-neutral-primary)}@media(min-width: 768px){.searchcraft-search-result-container{flex-direction:row}}a.searchcraft-search-result-container{cursor:pointer;transition:background-color 100ms}.searchcraft-base-search-result-content-container{flex:1;display:flex;flex-direction:column;gap:8px}.searchcraft-search-result-image{border-radius:var(--sc-image-border-radius);width:100%}@media(min-width: 768px){.searchcraft-search-result-image{width:200px}}.searchcraft-base-search-result-title{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-bold-font-size);font-weight:var(--sc-body-bold-font-weight);line-height:var(--sc-body-bold-line-height);margin:0;color:var(--sc-content-neutral-primary)}.searchcraft-base-search-result-subtitle{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-body-small-font-weight);line-height:var(--sc-body-small-line-height);margin:0;color:var(--sc-content-disabled)}.searchcraft-base-search-result-body-content{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-body-font-weight);line-height:var(--sc-body-line-height);margin:0;color:var(--sc-content-neutral-secondary)}.searchcraft-base-search-result-footer-content{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-body-font-weight);line-height:var(--sc-body-line-height);margin:0;color:var(--sc-content-disabled)}.searchcraft-search-results-container{display:flex;flex-direction:column;justify-content:center;gap:16px}.searchcraft-ad-section{align-items:center;background-color:#f1f1f1;border-radius:16px;display:flex;flex-direction:column;font-size:16px;justify-content:center;min-height:176px;text-align:center}.searchcraft-ad-section p{margin:0;color:var(--sc-content-disabled)}.searchcraft-search-results-empty-state-container{text-align:center}.searchcraft-search-results-error-message-container{text-align:center}.searchcraft-button{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-bold-font-size);font-weight:var(--sc-body-bold-font-weight);line-height:var(--sc-body-bold-line-height);border-radius:8px;display:flex;padding:12px 20px;position:relative;background-color:var(--sc-surface-brand-primary);border:1px solid var(--sc-border-primary);color:var(--sc-content-brand-on-primary)}.searchcraft-button:hover{cursor:pointer;background-color:var(--sc-surface-brand-primary-hover)}.searchcraft-button:focus{outline:2px solid var(--sc-surface-brand-primary)}.buttonLabel{position:relative}.searchcraft-error-message{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-body-small-font-weight);line-height:var(--sc-body-small-line-height);color:var(--sc-content-danger);margin:0}.filtersListContainer{width:100%}.filterCheckboxLabel{align-items:center;color:var(--sc-content-primary);display:flex;font-family:var(--sc-font-family);font-size:14px;font-weight:600;gap:14px;position:relative;-webkit-font-smoothing:antialiased}.filterCheckboxLabel input[type=checkbox]{align-items:center;appearance:none;background-color:var(--sc-surface-brand-secondary-hover);border:1px solid var(--sc-surface-disabled);border-radius:8px;cursor:pointer;display:flex;height:24px;justify-content:center;width:24px}.filterCheckboxLabel input[type=checkbox]:focus{outline:2px solid var(--sc-surface-brand-primary)}.filterCheckboxLabel input[type=checkbox]:checked{background-color:var(--sc-surface-brand-primary);position:relative}.filterCheckboxLabel input[type=checkbox]:checked+.checkContainer{display:block}.filterCheckboxLabel input[type=checkbox]:checked+.dashContainer{display:block}.childFilterCheckboxLabel{align-items:center;color:var(--sc-content-primary);display:flex;font-family:var(--sc-font-family);font-size:14px;font-weight:600;gap:12px;margin-left:24px;position:relative}.childFilterCheckboxLabel input[type=checkbox]{align-items:center;appearance:none;background-color:var(--sc-surface-brand-secondary-hover);border:1px solid var(--sc-surface-disabled);border-radius:8px;cursor:pointer;display:flex;height:24px;justify-content:center;position:relative;width:24px;-webkit-font-smoothing:antialiased}.childFilterCheckboxLabel input[type=checkbox]:focus{outline:2px solid var(--sc-surface-brand-primary)}.childFilterCheckboxLabel input[type=checkbox]:checked{background-color:var(--sc-surface-brand-primary);position:relative}.childFilterCheckboxLabel input[type=checkbox]:checked+.checkContainer{display:block}.childFilterCheckboxLabel input[type=checkbox]:checked+.dashContainer{display:block}.checkContainer{display:none;height:16px;width:16px;position:absolute;top:9px;left:8px}.dashContainer{display:none;height:3px;width:14px;position:absolute;top:3px;left:9px}.searchcraft-facet-message{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-body-small-font-weight);line-height:var(--sc-body-small-line-height);color:var(--sc-content-disabled);text-align:center}.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);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-bold-font-size);font-weight:var(--sc-body-small-bold-font-weight);line-height:var(--sc-body-small-bold-line-height)}.searchcraft-input-grid{display:grid;gap:4px 8px}.searchcraft-input-grid-buttonLeft{grid-template-rows:repeat(3, auto);grid-template-columns:auto 1fr}.searchcraft-input-grid-buttonLeft .searchcraft-input-button-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-grid-buttonLeft .searchcraft-input-label-wrapper{grid-column:2/span 1;grid-row:1/span 1}.searchcraft-input-grid-buttonLeft .searchcraft-input-error-wrapper{grid-column:2/span 1;grid-row:3/span 1}.searchcraft-input-grid-buttonLeft .searchcraft-input-wrapper{grid-column:2/span 1;grid-row:2/span 1}.searchcraft-input-grid-buttonRight{grid-template-rows:repeat(3, auto);grid-template-columns:1fr auto}.searchcraft-input-grid-buttonRight .searchcraft-input-button-wrapper{grid-column:2/span 1;grid-row:2/span 1}.searchcraft-input-grid-buttonRight .searchcraft-input-label-wrapper{grid-column:1/span 1;grid-row:1/span 1}.searchcraft-input-grid-buttonRight .searchcraft-input-error-wrapper{grid-column:1/span 1;grid-row:3/span 1}.searchcraft-input-grid-buttonRight .searchcraft-input-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-grid-buttonNone{grid-template-rows:repeat(3, auto);grid-template-columns:auto}.searchcraft-input-grid-buttonNone .searchcraft-input-button-wrapper{display:none}.searchcraft-input-grid-buttonNone .searchcraft-input-label-wrapper{grid-column:1/span 1;grid-row:1/span 1}.searchcraft-input-grid-buttonNone .searchcraft-input-error-wrapper{grid-column:1/span 1;grid-row:3/span 1}.searchcraft-input-grid-buttonNone .searchcraft-input-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-wrapper{position:relative;display:flex}.searchcraft-input{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-body-font-weight);line-height:var(--sc-body-line-height);background-color:var(--sc-surface-neutral-secondary);border-radius:var(--sc-input-border-radius);border:none;color:var(--sc-content-neutral-primary);outline:none;padding-left:var(--sc-input-padding-left);padding-right:var(--sc-input-padding-right);padding-top:12px;padding-bottom:12px;flex:1}.searchcraft-input::placeholder{color:var(--sc-content-disabled)}.searchcraft-input:focus{outline:var(--sc-border-brand) solid 2px}.searchcraft-input:focus::placeholder{opacity:0}.searchcraft-input.error{color:var(--sc-content-danger);outline:var(--sc-border-danger) solid 2px}.searchcraft-input.error:focus{outline:var(--sc-border-danger) solid 2px}.searchcraft-input-search-icon-wrapper{align-items:center;justify-content:center;display:flex;position:absolute;pointer-events:none;bottom:0;left:0;top:0;width:var(--sc-input-padding-left)}.searchcraft-input-search-icon{pointer-events:none;width:var(--sc-input-search-icon-size);height:var(--sc-input-search-icon-size)}.searchcraft-input-clear-button{all:unset;align-items:center;justify-content:center;cursor:pointer;display:flex;position:absolute;border:none;outline:none;bottom:0;right:0;top:0;width:var(--sc-input-padding-right)}.searchcraft-input-clear-icon{width:var(--sc-input-clear-icon-size);height:var(--sc-input-clear-icon-size)}.searchcraft-input-label{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-bold-font-size);font-weight:var(--sc-body-small-bold-font-weight);line-height:var(--sc-body-small-bold-line-height);color:var(--sc-content-neutral-primary);margin-top:4px;margin-bottom:4px}.searchcraft-popover-form{display:flex;flex-direction:column;flex:1}.searchcraft-popover-form .searchcraft-popover-form-input-wrapper{padding:12px;background-color:var(--sc-surface-neutral-secondary);display:flex;flex-direction:row;gap:4px}.searchcraft-popover-form .searchcraft-popover-form-input-wrapper>searchcraft-input-form{flex:1}.searchcraft-popover-form .searchcraft-popover-form-cancel-button{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-body-font-weight);line-height:var(--sc-body-line-height);border:0;outline:0;padding:0;flex-shrink:0;background:none;cursor:pointer;padding-left:12px;padding-right:12px;border-radius:calc(var(--sc-popover-form-border-radius)*.8)}.searchcraft-popover-form .searchcraft-popover-form-cancel-button:hover{background-color:var(--sc-surface-brand-secondary-hover)}.searchcraft-popover-form .searchcraft-popover-form-cancel-button:focus{background-color:var(--sc-surface-brand-secondary-active)}.searchcraft-popover-form-inline .searchcraft-input{border-top-left-radius:var(--sc-popover-form-border-radius);border-top-right-radius:var(--sc-popover-form-border-radius);border-bottom-left-radius:var(--sc-popover-form-border-radius);border-bottom-right-radius:var(--sc-popover-form-border-radius);border:none;outline:none}.searchcraft-popover-form-inline.searchcraft-popover-form-active .searchcraft-input{border-top-left-radius:var(--sc-popover-form-border-radius);border-top-right-radius:var(--sc-popover-form-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.searchcraft-popover-form-inline .searchcraft-popover-inline-wrapper-outer{position:relative}.searchcraft-popover-form-inline .searchcraft-popover-inline-wrapper-inner{position:absolute;height:var(--sc-popover-list-view-height);z-index:1000;width:100%}.searchcraft-popover-form-inline .searchcraft-popover-list-view{display:flex;flex-direction:column;overflow:auto;background-color:var(--sc-surface-neutral-secondary);border-bottom-left-radius:var(--sc-popover-form-border-radius);border-bottom-right-radius:var(--sc-popover-form-border-radius);max-height:var(--sc-popover-list-view-height)}.searchcraft-popover-form-modal{position:fixed;inset:0;z-index:1000;display:flex;align-items:flex-start;justify-content:center;padding:0;background-color:var(--sc-surface-neutral-secondary)}@media(min-width: 576px){.searchcraft-popover-form-modal{padding:16px;background-color:rgba(0,0,0,0)}}.searchcraft-popover-form-modal .searchcraft-input{border-radius:calc(var(--sc-popover-form-border-radius)*.8);outline-width:1px;outline-color:var(--sc-border-neutral)}.searchcraft-popover-form-modal .searchcraft-popover-form-modal-backdrop{position:absolute;inset:0;background-color:rgba(0,0,0,.5);display:none}@media(min-width: 576px){.searchcraft-popover-form-modal .searchcraft-popover-form-modal-backdrop{display:block}}.searchcraft-popover-form-modal .searchcraft-popover-form-modal-inner{position:absolute;inset:0;z-index:1002;margin-top:0px;display:flex;border-radius:var(--sc-popover-form-border-radius);overflow:hidden}@media(min-width: 576px){.searchcraft-popover-form-modal .searchcraft-popover-form-modal-inner{inset:auto;position:relative;width:100%;margin-top:100px;max-width:var(--sc-popover-modal-max-width)}}.searchcraft-popover-form-modal .searchcraft-popover-list-view{display:flex;flex-direction:column;overflow:auto;background-color:var(--sc-surface-neutral-secondary);border-bottom-left-radius:0;border-bottom-right-radius:0}@media(min-width: 576px){.searchcraft-popover-form-modal .searchcraft-popover-list-view{max-height:var(--sc-popover-list-view-height)}}.searchcraft-popover-form-modal searchcraft-popover-list-view{overflow:scroll}@media(min-width: 576px){.searchcraft-popover-form-modal searchcraft-popover-list-view{overflow:auto}}.searchcraft-popover-form-fullscreen{position:fixed;inset:0;z-index:1000;background-color:var(--sc-surface-neutral-secondary)}.searchcraft-popover-form-fullscreen .searchcraft-popover-form{position:absolute;inset:0}.searchcraft-popover-form-fullscreen .searchcraft-input{border-radius:calc(var(--sc-popover-form-border-radius)*.8);outline-width:1px;outline-color:var(--sc-border-neutral)}.searchcraft-popover-form-fullscreen searchcraft-popover-list-view{overflow:scroll}.searchcraft-popover-list-item{all:unset;display:flex;flex-direction:row;cursor:pointer;gap:8px;padding-right:var(--sc-popover-list-item-padding-horizontal);padding-left:var(--sc-popover-list-item-padding-horizontal);padding-top:var(--sc-popover-list-item-padding-vertical);padding-bottom:var(--sc-popover-list-item-padding-vertical)}.searchcraft-popover-list-item:focus{background-color:var(--sc-surface-neutral-secondary-active);color:var(--sc-content-neutral-secondary)}.searchcraft-popover-list-item:hover{background-color:var(--sc-surface-neutral-secondary-hover);color:var(--sc-content-neutral-secondary)}.searchcraft-popover-list-item-title{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-body-font-weight);line-height:var(--sc-body-line-height);margin:0;color:inherit}.searchcraft-popover-list-item-subtitle{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-body-small-font-weight);line-height:var(--sc-body-small-line-height);margin:0;color:inherit}.searchcraft-popover-list-item-image-wrapper{width:var(--sc-popover-list-item-image-size);height:var(--sc-popover-list-item-image-size);display:flex;align-items:center;justify-content:center;flex-shrink:0}.searchcraft-popover-list-item-image{max-width:var(--sc-popover-list-item-image-size);max-height:var(--sc-popover-list-item-image-size)}.searchcraft-popover-list-item-info-wrapper{display:flex;flex-direction:column;gap:8px;justify-content:center}.searchcraft-results-info-container{border-bottom:1px solid var(--sc-surface-disabled);display:flex;justify-content:flex-start}.searchcraft-results-info-content{color:var(--sc-content-primary);font-family:var(--sc-font-family);font-size:18px;font-weight:600;line-height:20px;margin:0px 0 8px}@media(max-width: 768px){.searchcraft-results-info-content{margin:0;margin-bottom:8px}}.searchcraft-slider-container{align-items:center;display:flex;flex-direction:column;gap:10px;width:100%}.searchcraft-slider-range-container{align-items:center;background-color:var(--sc-surface-disabled);border-radius:999px;display:flex;position:relative;height:4px;width:100%}.searchcraft-slider-range-container::-webkit-slider-runnable-track{pointer-events:none}.searchcraft-slider-range-container .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-container .searchcraft-slider-active-range::-webkit-slider-runnable-track{pointer-events:none}.searchcraft-slider-range-container .searchcraft-slider-active-range::-moz-range-track{pointer-events:none}.searchcraft-slider-range-container .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-container .searchcraft-slider-input::-webkit-slider-thumb{background-color:var(--sc-surface-neutral-light);border-radius:50%;border:2px solid var(--sc-border-neutral);cursor:pointer;height:20px;pointer-events:all;width:20px;-webkit-appearance:none}.searchcraft-slider-range-container .searchcraft-slider-input::-moz-range-thumb{background-color:var(--sc-surface-neutral-light);border-radius:50%;border:2px solid var(--sc-border-neutral);cursor:pointer;height:20px;pointer-events:all;width:20px}.searchcraft-slider-label-container{color:var(--sc-content-primary);display:flex;font-family:\"Source Sans Pro\",sans-serif;font-size:15px;font-weight:600;justify-content:space-between;margin-top:10px;width:100%}.searchcraft-slider-label{min-width:30px;text-align:center}.searchcraft-toggle-button-container{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}.searchcraft-toggle-button-label{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-body-font-weight);line-height:var(--sc-body-line-height);margin:0;color:var(--sc-content-neutral-primary)}.searchcraft-toggle-button-sub-label{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-body-small-font-weight);line-height:var(--sc-body-small-line-height);margin:0;color:var(--sc-content-neutral-secondary)}.searchcraft-toggle-button-background{transition:background-color .2s;background:var(--sc-surface-disabled);border:none;border-radius:16px;cursor:pointer;height:26px;position:relative;width:44px;flex-shrink:0}.searchcraft-toggle-button-background.active{background:var(--sc-surface-brand-primary);box-shadow:0px 0px 0px 1px rgba(0,0,0,.05)}.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-handle.active{transform:translateX(16px)}/*# sourceMappingURL=hologram.css.map */\n`","import { Component } from '@stencil/core';\nimport styles from '../../themes/hologram.css?raw';\n\n/**\n * This web component adds Searchcraft's built-in css theme to your page's <head> tag.\n * It does not render anything visible, its only function is to manage the css styles on the page.\n *\n * ## Usage\n * ```html\n * <!-- index.html -->\n * <searchcraft-theme />\n * ```\n */\n@Component({\n tag: 'searchcraft-theme',\n shadow: false,\n})\nexport class SearchcraftErrorMessage {\n componentDidLoad() {\n console.log('Loading theme...');\n console.log(styles);\n const styleTag =\n document.querySelector('#searchcraft-theme') ||\n document.createElement('style');\n styleTag.innerHTML = styles;\n styleTag.id = 'searchcraft-theme';\n\n const head = document.head || document.getElementsByTagName('head')[0];\n if (!head.contains(styleTag)) {\n if (head.firstChild) {\n head.insertBefore(styleTag, head.firstChild);\n } else {\n head.appendChild(styleTag);\n }\n } else {\n }\n }\n\n render() {\n return;\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"searchcraft-theme.entry.js","mappings":";;AAAA,eAAe,CAAC;AAChB;;MCgBa,gBAAgB;;;;;;;IAInB,KAAK,GAAG,OAAO,CAAC;;;;IAIhB,WAAW,GAAG,IAAI,CAAC;IAEnB,YAAY,GAAG,CAAC,MAAM;QAC5B,OAAO,MAAM;aACV,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,KAAK,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;aACvD,WAAW,EAAE,CAAC;KAClB,CAAC;IAEF,gBAAgB;;QAEd,MAAM,YAAY,GAChB,QAAQ,CAAC,aAAa,CAAC,oBAAoB,CAAC;YAC5C,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAClC,YAAY,CAAC,SAAS,GAAG,MAAM,CAAC;QAChC,YAAY,CAAC,EAAE,GAAG,mBAAmB,CAAC;QAEtC,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAEvE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE;YAChC,IAAI,IAAI,CAAC,UAAU,EAAE;gBACnB,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;aAClD;iBAAM;gBACL,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;aAChC;SACF;;QAGD,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;;QAGzC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC;YAC5D,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,WAAW,CACxC,KAAK,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,EAC7B,GAAG,KAAK,EAAE,CACX,CAAC;SACH,CAAC,CAAC;KACJ;IAED,MAAM;QACJ,OAAO;KACR;;;;;","names":[],"sources":["src/themes/hologram.css?raw","src/components/searchcraft-theme/searchcraft-theme.tsx"],"sourcesContent":["export default `: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)}: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: hsl( from var(--sc-color-background) h s clamp(10, calc(l + 5), 95) );--sc-surface-neutral-primary-hover: var(--sc-color-background-hover, #fafafa);--sc-color-background-active: hsl( from var(--sc-color-background) h s clamp(5, calc(l - 5), 90) );--sc-surface-neutral-primary-active: var( --sc-color-background-active, #f7f7f7 );--sc-surface-neutral-secondary: var( --sc-color-background-secondary, var(--sc-color-background, #f3f3f3) );--sc-surface-neutral-secondary-hover: var( --sc-color-background-secondary-hover, var(--sc-color-background-hover, #e6e6e6) );--sc-surface-neutral-secondary-active: var( --sc-color-background-secondary-active, var(--sc-color-background-active, #e0e0e0) );--sc-surface-neutral-light: #ffffff;--sc-content-neutral-primary: var(--sc-color-foreground, #292929);--sc-color-foreground-secondary: hsl( from var(--sc-color-foreground) h s clamp(10, calc(l + 5), 90) );--sc-content-neutral-secondary: var(--sc-color-foreground-secondary, #404040);--sc-border-neutral: rgba(0, 0, 0, 0.1);--sc-surface-brand-primary: var(--sc-color-brand, #000000);--sc-color-brand-hover: hsl( from var(--sc-color-brand) h s clamp(20, calc(l + 5), 95) );--sc-surface-brand-primary-hover: var(--sc-color-brand-hover, #2e2e2e);--sc-color-brand-active: hsl( from var(--sc-color-brand) h s clamp(10, calc(l - 5), 85) );--sc-surface-brand-primary-active: var(--sc-color-brand-active, #292929);--sc-surface-brand-secondary: var( --sc-color-brand-secondary, var(--sc-color-brand, #e6e6e6) );--sc-surface-brand-secondary-hover: var( --sc-color-brand-secondary-hover, var(--sc-color-brand-hover, #ebebeb) );--sc-surface-brand-secondary-active: var( --sc-color-brand-secondary-active, var(--sc-color-brand-active, #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: hsl(from var(--sc-color-success) h s 30);--sc-surface-success-primary-hover: var( --sc-color-success-primary-hover, #009900 );--sc-color-success-primary-active: hsl(from var(--sc-color-success) h s 20);--sc-surface-success-primary-active: var( --sc-color-success-primary-active, #006600 );--sc-color-success-secondary: hsl(from var(--sc-color-success) h s 90);--sc-surface-success-secondary: var(--sc-color-success-secondary, #ccffcc);--sc-color-success-secondary-hover: hsl( from var(--sc-color-success-secondary) h s 95 );--sc-surface-success-secondary-hover: var( --sc-color-success-secondary-hover, #e6ffe6 );--sc-color-success-secondary-active: hsl( from var(--sc-color-success-secondary) h s 85 );--sc-surface-success-secondary-active: var( --sc-color-success-secondary-active, #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: hsl(from var(--sc-color-caution) h s 30);--sc-surface-caution-primary-hover: var( --sc-color-caution-primary-hover, #e57300 );--sc-color-caution-primary-active: hsl(from var(--sc-color-caution) h s 20);--sc-surface-caution-primary-active: var( --sc-color-caution-primary-active, #b25a00 );--sc-color-caution-secondary: hsl(from var(--sc-color-caution) h s 90);--sc-surface-caution-secondary: var(--sc-color-caution-secondary, #ffd9b3);--sc-color-caution-secondary-hover: hsl( from var(--sc-color-caution-secondary) h s 95 );--sc-surface-caution-secondary-hover: var( --sc-color-caution-secondary-hover, #ffe5cc );--sc-color-caution-secondary-active: hsl( from var(--sc-color-caution-secondary) h s 85 );--sc-surface-caution-secondary-active: var( --sc-color-caution-secondary-active, #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: hsl(from var(--sc-color-danger) h s 30);--sc-surface-danger-primary-hover: var( --sc-color-danger-primary-hover, #e50000 );--sc-color-danger-primary-active: hsl(from var(--sc-color-danger) h s 20);--sc-surface-danger-primary-active: var( --sc-color-danger-primary-active, #b30000 );--sc-color-danger-secondary: hsl(from var(--sc-color-danger) h s 90);--sc-surface-danger-secondary: var(--sc-color-danger-secondary, #ffcccc);--sc-color-danger-secondary-hover: hsl( from var(--sc-color-danger-secondary) h s 95 );--sc-surface-danger-secondary-hover: var( --sc-color-danger-secondary-hover, #ffe7e7 );--sc-color-danger-secondary-active: hsl( from var(--sc-color-danger-secondary) h s 85 );--sc-surface-danger-secondary-active: var( --sc-color-danger-secondary-active, #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: hsl( from var(--sc-color-background) h s clamp(10%, calc(l + 5%), 95%) );--sc-color-background-active: hsl( from var(--sc-color-background) h s clamp(5%, calc(l - 5%), 90%) );--sc-color-foreground-secondary: hsl( from var(--sc-color-foreground) h s clamp(10%, calc(l + 5%), 90%) );--sc-color-brand-hover: hsl( from var(--sc-color-brand) h s clamp(20%, calc(l + 5%), 95%) );--sc-color-brand-active: hsl( from var(--sc-color-brand) h s clamp(10%, calc(l - 5%), 85%) );--sc-color-success-primary-hover: hsl(from var(--sc-color-success) h s 30%);--sc-color-success-primary-active: hsl( from var(--sc-color-success) h s 20% );--sc-color-success-secondary: hsl(from var(--sc-color-success) h s 90%);--sc-color-success-secondary-hover: hsl( from var(--sc-color-success-secondary) h s 95% );--sc-color-success-secondary-active: 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: hsl(from var(--sc-color-caution) h s 30%);--sc-color-caution-primary-active: hsl( from var(--sc-color-caution) h s 20% );--sc-color-caution-secondary: hsl(from var(--sc-color-caution) h s 90%);--sc-color-caution-secondary-hover: hsl( from var(--sc-color-caution-secondary) h s 95% );--sc-color-caution-secondary-active: 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: hsl(from var(--sc-color-danger) h s 30%);--sc-color-danger-primary-active: hsl(from var(--sc-color-danger) h s 20%);--sc-color-danger-secondary: hsl(from var(--sc-color-danger) h s 90%);--sc-color-danger-secondary-hover: hsl( from var(--sc-color-danger-secondary) h s 95% );--sc-color-danger-secondary-active: 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-search-result-container{all:unset;align-items:flex-start;border-radius:var(--sc-border-radius-lg);display:flex;flex-direction:column;gap:16px;padding:8px;color:inherit;background-color:var(--sc-surface-neutral-primary)}@media(min-width: 768px){.searchcraft-search-result-container{flex-direction:row}}a.searchcraft-search-result-container{cursor:pointer;transition:background-color 100ms}.searchcraft-base-search-result-content-container{flex:1;display:flex;flex-direction:column;gap:8px}.searchcraft-search-result-image{border-radius:calc(--sc-border-radius-lg - 8px);border-radius:calc(var(--sc-border-radius-lg) - 8px);width:100%}@media(min-width: 768px){.searchcraft-search-result-image{width:200px}}.searchcraft-base-search-result-title{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);color:var(--sc-content-neutral-primary);font-weight:var(--sc-font-bold);margin:0}.searchcraft-base-search-result-subtitle{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);color:var(--sc-content-disabled);margin:0}.searchcraft-base-search-result-body-content{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);color:var(--sc-content-neutral-secondary);margin:0}.searchcraft-base-search-result-footer-content{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);color:var(--sc-content-disabled);margin:0}.searchcraft-base-ad{all:unset;display:flex;flex-direction:row;cursor:pointer;gap:8px;padding-right:var(--sc-popover-list-item-padding-horizontal);padding-left:var(--sc-popover-list-item-padding-horizontal);padding-top:var(--sc-popover-list-item-padding-vertical);padding-bottom:var(--sc-popover-list-item-padding-vertical);background-color:var(--sc-surface-neutral-primary);border-radius:16px;border:1px solid blue}.searchcraft-base-ad-title{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);margin:0;color:inherit}.searchcraft-base-ad-subtitle{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);margin:0;color:inherit}.searchcraft-base-ad-image-wrapper{width:var(--sc-popover-list-item-image-size);height:var(--sc-popover-list-item-image-size);display:flex;align-items:center;justify-content:center;flex-shrink:0}.searchcraft-base-ad-image{max-width:var(--sc-popover-list-item-image-size);max-height:var(--sc-popover-list-item-image-size)}.searchcraft-base-ad-info-wrapper{display:flex;flex-direction:column;gap:8px;justify-content:center}.searchcraft-search-results-container{display:flex;flex-direction:column;justify-content:center;gap:16px}.searchcraft-search-results-empty-state-container{text-align:center}.searchcraft-search-results-error-message-container{text-align:center}.searchcraft-button{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);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-error-message{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);color:var(--sc-content-danger);margin:0}.filtersListContainer{width:100%}.filterCheckboxLabel{align-items:center;color:var(--sc-content-brand);display:flex;font-family:var(--sc-font-family);font-size:14px;font-weight:600;gap:14px;position:relative;-webkit-font-smoothing:antialiased}.filterCheckboxLabel input[type=checkbox]{align-items:center;appearance:none;background-color:var(--sc-surface-neutral-secondary);border:1px solid var(--sc-surface-disabled);border-radius:8px;cursor:pointer;display:flex;height:24px;justify-content:center;width:24px}.filterCheckboxLabel input[type=checkbox]:focus{outline:2px solid var(--sc-surface-brand-primary)}.filterCheckboxLabel input[type=checkbox]:checked{background-color:var(--sc-surface-brand-primary);position:relative}.filterCheckboxLabel input[type=checkbox]:checked+.checkContainer{display:block}.filterCheckboxLabel input[type=checkbox]:checked+.dashContainer{display:block}.childFilterCheckboxLabel{align-items:center;color:var(--sc-content-primary);display:flex;font-family:var(--sc-font-family);font-size:14px;font-weight:600;gap:12px;margin-left:24px;position:relative}.childFilterCheckboxLabel input[type=checkbox]{align-items:center;appearance:none;background-color:var(--sc-surface-neutral-secondary-hover);border:1px solid var(--sc-surface-disabled);border-radius:8px;cursor:pointer;display:flex;height:24px;justify-content:center;position:relative;width:24px;-webkit-font-smoothing:antialiased}.childFilterCheckboxLabel input[type=checkbox]:focus{outline:2px solid var(--sc-surface-brand-primary)}.childFilterCheckboxLabel input[type=checkbox]:checked{background-color:var(--sc-surface-brand-primary);position:relative}.childFilterCheckboxLabel input[type=checkbox]:checked+.checkContainer{display:block}.childFilterCheckboxLabel input[type=checkbox]:checked+.dashContainer{display:block}.checkContainer{display:none;height:16px;width:16px;position:absolute;top:9px;left:8px}.dashContainer{display:none;height:3px;width:14px;position:absolute;top:3px;left:9px}.searchcraft-facet-message{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);color:var(--sc-content-disabled);text-align:center}.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);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-bold)}:root{--sc-input-border-radius: var(--sc-border-radius);--sc-input-search-icon-size: 20px;--sc-input-clear-icon-size: 20px;--sc-input-padding-left: 44px;--sc-input-padding-right: 44px}.searchcraft-input-grid{display:grid;gap:4px 8px}.searchcraft-input-grid-buttonLeft{grid-template-rows:repeat(3, auto);grid-template-columns:auto 1fr}.searchcraft-input-grid-buttonLeft .searchcraft-input-button-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-grid-buttonLeft .searchcraft-input-label-wrapper{grid-column:2/span 1;grid-row:1/span 1}.searchcraft-input-grid-buttonLeft .searchcraft-input-error-wrapper{grid-column:2/span 1;grid-row:3/span 1}.searchcraft-input-grid-buttonLeft .searchcraft-input-wrapper{grid-column:2/span 1;grid-row:2/span 1}.searchcraft-input-grid-buttonRight{grid-template-rows:repeat(3, auto);grid-template-columns:1fr auto}.searchcraft-input-grid-buttonRight .searchcraft-input-button-wrapper{grid-column:2/span 1;grid-row:2/span 1}.searchcraft-input-grid-buttonRight .searchcraft-input-label-wrapper{grid-column:1/span 1;grid-row:1/span 1}.searchcraft-input-grid-buttonRight .searchcraft-input-error-wrapper{grid-column:1/span 1;grid-row:3/span 1}.searchcraft-input-grid-buttonRight .searchcraft-input-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-grid-buttonNone{grid-template-rows:repeat(3, auto);grid-template-columns:auto}.searchcraft-input-grid-buttonNone .searchcraft-input-button-wrapper{display:none}.searchcraft-input-grid-buttonNone .searchcraft-input-label-wrapper{grid-column:1/span 1;grid-row:1/span 1}.searchcraft-input-grid-buttonNone .searchcraft-input-error-wrapper{grid-column:1/span 1;grid-row:3/span 1}.searchcraft-input-grid-buttonNone .searchcraft-input-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-wrapper{position:relative;display:flex}.searchcraft-input{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);background-color:var(--sc-surface-neutral-secondary);border-radius:var(--sc-input-border-radius);border:none;color:var(--sc-content-neutral-primary);outline:none;padding-left:var(--sc-input-padding-left);padding-right:var(--sc-input-padding-right);padding-top:12px;padding-bottom:12px;flex:1}.searchcraft-input::placeholder{color:var(--sc-content-disabled)}.searchcraft-input:focus{outline:var(--sc-border-brand) solid 2px}.searchcraft-input:focus::placeholder{opacity:0}.searchcraft-input.error{color:var(--sc-content-danger);outline:var(--sc-border-danger) solid 2px}.searchcraft-input.error:focus{outline:var(--sc-border-danger) solid 2px}.searchcraft-input-search-icon-wrapper{align-items:center;justify-content:center;display:flex;position:absolute;pointer-events:none;bottom:0;left:0;top:0;width:var(--sc-input-padding-left)}.searchcraft-input-search-icon{pointer-events:none;width:var(--sc-input-search-icon-size);height:var(--sc-input-search-icon-size);color:var(--sc-content-neutral-secondary)}.searchcraft-input-clear-button{all:unset;align-items:center;justify-content:center;cursor:pointer;display:flex;position:absolute;border:none;outline:none;bottom:0;right:0;top:0;width:var(--sc-input-padding-right)}.searchcraft-input-clear-icon{width:var(--sc-input-clear-icon-size);height:var(--sc-input-clear-icon-size);color:var(--sc-content-brand)}.searchcraft-input-label{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);color:var(--sc-content-neutral-primary);font-weight:var(--sc-font-bold);margin-top:4px;margin-bottom:4px}:root{--sc-popover-form-border-radius: var(--sc-border-radius);--sc-popover-list-view-height: 400px;--sc-popover-list-item-image-size: 60px;--sc-popover-list-item-padding-horizontal: 8px;--sc-popover-list-item-padding-vertical: 8px;--sc-popover-modal-max-width: 570px}.searchcraft-popover-form{display:flex;flex-direction:column;flex:1}.searchcraft-popover-form .searchcraft-popover-form-input-wrapper{padding:12px;background-color:var(--sc-surface-neutral-secondary);display:flex;flex-direction:row;gap:4px}.searchcraft-popover-form .searchcraft-popover-form-input-wrapper>searchcraft-input-form{flex:1}.searchcraft-popover-form .searchcraft-popover-form-cancel-button{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);border-radius:calc(--sc-popover-form-border-radius - 12px);border-radius:calc(var(--sc-popover-form-border-radius) - 12px);border:0;outline:0;padding:0;flex-shrink:0;background:none;cursor:pointer;padding-left:12px;padding-right:12px}.searchcraft-popover-form .searchcraft-popover-form-cancel-button:hover{background-color:var(--sc-surface-brand-secondary-hover)}.searchcraft-popover-form .searchcraft-popover-form-cancel-button:focus{background-color:var(--sc-surface-brand-secondary-active)}.searchcraft-popover-form-inline .searchcraft-input{border-top-left-radius:var(--sc-popover-form-border-radius);border-top-right-radius:var(--sc-popover-form-border-radius);border-bottom-left-radius:var(--sc-popover-form-border-radius);border-bottom-right-radius:var(--sc-popover-form-border-radius);border:none;outline:none}.searchcraft-popover-form-inline.searchcraft-popover-form-active .searchcraft-input{border-top-left-radius:var(--sc-popover-form-border-radius);border-top-right-radius:var(--sc-popover-form-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.searchcraft-popover-form-inline .searchcraft-popover-inline-wrapper-outer{position:relative}.searchcraft-popover-form-inline .searchcraft-popover-inline-wrapper-inner{position:absolute;height:var(--sc-popover-list-view-height);z-index:1000;width:100%}.searchcraft-popover-form-inline .searchcraft-popover-list-view{display:flex;flex-direction:column;overflow:auto;background-color:var(--sc-surface-neutral-secondary);border-bottom-left-radius:var(--sc-popover-form-border-radius);border-bottom-right-radius:var(--sc-popover-form-border-radius);max-height:var(--sc-popover-list-view-height)}.searchcraft-popover-form-modal{position:fixed;inset:0;z-index:1000;display:flex;align-items:flex-start;justify-content:center;padding:0;background-color:var(--sc-surface-neutral-secondary)}@media(min-width: 576px){.searchcraft-popover-form-modal{padding:16px;background-color:rgba(0,0,0,0)}}.searchcraft-popover-form-modal .searchcraft-input{border-radius:calc(--sc-popover-form-border-radius - 12px);border-radius:calc(var(--sc-popover-form-border-radius) - 12px);outline-width:1px;outline-color:var(--sc-border-neutral)}.searchcraft-popover-form-modal .searchcraft-popover-form-modal-backdrop{position:absolute;inset:0;background-color:rgba(0,0,0,.5);display:none}@media(min-width: 576px){.searchcraft-popover-form-modal .searchcraft-popover-form-modal-backdrop{display:block}}.searchcraft-popover-form-modal .searchcraft-popover-form-modal-inner{position:absolute;inset:0;z-index:1002;margin-top:0px;display:flex;border-radius:var(--sc-popover-form-border-radius);overflow:hidden}@media(min-width: 576px){.searchcraft-popover-form-modal .searchcraft-popover-form-modal-inner{inset:auto;position:relative;width:100%;margin-top:100px;max-width:var(--sc-popover-modal-max-width)}}.searchcraft-popover-form-modal .searchcraft-popover-list-view{display:flex;flex-direction:column;overflow:auto;background-color:var(--sc-surface-neutral-secondary);border-bottom-left-radius:0;border-bottom-right-radius:0}@media(min-width: 576px){.searchcraft-popover-form-modal .searchcraft-popover-list-view{max-height:var(--sc-popover-list-view-height)}}.searchcraft-popover-form-modal searchcraft-popover-list-view{overflow:scroll}@media(min-width: 576px){.searchcraft-popover-form-modal searchcraft-popover-list-view{overflow:auto}}.searchcraft-popover-form-fullscreen{position:fixed;inset:0;z-index:1000;background-color:var(--sc-surface-neutral-secondary)}.searchcraft-popover-form-fullscreen .searchcraft-popover-form{position:absolute;inset:0}.searchcraft-popover-form-fullscreen .searchcraft-input{border-radius:calc(--sc-popover-form-border-radius - 12px);border-radius:calc(var(--sc-popover-form-border-radius) - 12px);outline-width:1px;outline-color:var(--sc-border-neutral)}.searchcraft-popover-form-fullscreen searchcraft-popover-list-view{overflow:scroll}.searchcraft-popover-list-item-ad{all:unset;display:flex;flex-direction:row;cursor:pointer;gap:8px;padding-right:var(--sc-popover-list-item-padding-horizontal);padding-left:var(--sc-popover-list-item-padding-horizontal);padding-top:var(--sc-popover-list-item-padding-vertical);padding-bottom:var(--sc-popover-list-item-padding-vertical);border:1px solid blue}.searchcraft-popover-list-item-ad:focus{background-color:var(--sc-surface-neutral-secondary-active);color:var(--sc-content-neutral-secondary)}.searchcraft-popover-list-item-ad:hover{background-color:var(--sc-surface-neutral-secondary-hover);color:var(--sc-content-neutral-secondary)}.searchcraft-popover-list-item-ad-title{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);margin:0;color:inherit}.searchcraft-popover-list-item-ad-subtitle{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);margin:0;color:inherit}.searchcraft-popover-list-item-ad-image-wrapper{width:var(--sc-popover-list-item-image-size);height:var(--sc-popover-list-item-image-size);display:flex;align-items:center;justify-content:center;flex-shrink:0}.searchcraft-popover-list-item-ad-image{max-width:var(--sc-popover-list-item-image-size);max-height:var(--sc-popover-list-item-image-size)}.searchcraft-popover-list-item-ad-info-wrapper{display:flex;flex-direction:column;gap:8px;justify-content:center}.searchcraft-popover-list-item{all:unset;color:var(--sc-content-neutral-secondary);display:flex;flex-direction:row;cursor:pointer;gap:8px;padding-right:var(--sc-popover-list-item-padding-horizontal);padding-left:var(--sc-popover-list-item-padding-horizontal);padding-top:var(--sc-popover-list-item-padding-vertical);padding-bottom:var(--sc-popover-list-item-padding-vertical)}.searchcraft-popover-list-item:focus{background-color:var(--sc-surface-neutral-secondary-active);color:var(--sc-content-neutral-secondary)}.searchcraft-popover-list-item:hover{background-color:var(--sc-surface-neutral-secondary-hover);color:var(--sc-content-neutral-secondary)}.searchcraft-popover-list-item-title{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);margin:0;color:inherit}.searchcraft-popover-list-item-subtitle{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);margin:0;color:inherit}.searchcraft-popover-list-item-image-wrapper{width:var(--sc-popover-list-item-image-size);height:var(--sc-popover-list-item-image-size);display:flex;align-items:center;justify-content:center;flex-shrink:0}.searchcraft-popover-list-item-image{max-width:var(--sc-popover-list-item-image-size);max-height:var(--sc-popover-list-item-image-size)}.searchcraft-popover-list-item-info-wrapper{display:flex;flex-direction:column;gap:8px;justify-content:center}.searchcraft-results-info{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);color:var(--sc-content-primary);margin:0}.searchcraft-slider-container{align-items:center;display:flex;flex-direction:column;gap:10px;width:100%}.searchcraft-slider-range-container{align-items:center;background-color:var(--sc-surface-disabled);border-radius:999px;display:flex;position:relative;height:4px;width:100%}.searchcraft-slider-range-container::-webkit-slider-runnable-track{pointer-events:none}.searchcraft-slider-range-container .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-container .searchcraft-slider-active-range::-webkit-slider-runnable-track{pointer-events:none}.searchcraft-slider-range-container .searchcraft-slider-active-range::-moz-range-track{pointer-events:none}.searchcraft-slider-range-container .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-container .searchcraft-slider-input::-webkit-slider-thumb{background-color:var(--sc-surface-neutral-light);border-radius:50%;border:2px solid var(--sc-border-neutral);cursor:pointer;height:20px;pointer-events:all;width:20px;-webkit-appearance:none}.searchcraft-slider-range-container .searchcraft-slider-input::-moz-range-thumb{background-color:var(--sc-surface-neutral-light);border-radius:50%;border:2px solid var(--sc-border-neutral);cursor:pointer;height:20px;pointer-events:all;width:20px}.searchcraft-slider-label-container{color:var(--sc-content-primary);display:flex;font-family:\"Source Sans Pro\",sans-serif;font-size:15px;font-weight:600;justify-content:space-between;margin-top:10px;width:100%}.searchcraft-slider-label{min-width:30px;text-align:center}.searchcraft-toggle-button-container{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}.searchcraft-toggle-button-label{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);margin:0;color:var(--sc-content-neutral-primary)}.searchcraft-toggle-button-sub-label{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);margin:0;color:var(--sc-content-neutral-secondary)}.searchcraft-toggle-button-background{transition:background-color .2s;background:var(--sc-surface-disabled);border:none;border-radius:16px;cursor:pointer;height:26px;position:relative;width:44px;flex-shrink:0}.searchcraft-toggle-button-background.active{background:var(--sc-surface-brand-primary);box-shadow:0px 0px 0px 1px rgba(0,0,0,.05)}.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-handle.active{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);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);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);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);align-items:center;display:flex}.searchcraft-select{display:flex;flex-direction:column;gap:4px}.searchcraft-select-label{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-bold)}.searchcraft-select-input-wrapper{position:relative}.searchcraft-select-input{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);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{pointer-events:none;position:absolute;right:12px;top:50%;transform:translateY(-50%)}.searchcraft-select-caption{font-family:var(--sc-font-family);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size)}.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);font-weight:var(--sc-font-normal);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size)}.searchcraft-search-results-per-page-select-input{min-width:120px}/*# sourceMappingURL=hologram.css.map */\n`","import { Component, Prop } from '@stencil/core';\nimport styles from '../../themes/hologram.css?raw';\n\n/**\n * This web component adds Searchcraft's built-in css theme to your page's <head> tag.\n * It does not render anything visible, its only function is to manage the css styles on the page.\n *\n * ## Usage\n * ```html\n * <!-- index.html -->\n * <searchcraft-theme theme=\"light\" custom-theme=\"{}\" />\n * ```\n */\n@Component({\n tag: 'searchcraft-theme',\n shadow: false,\n})\nexport class SearchcraftTheme {\n /**\n * The name of the theme.\n */\n @Prop() theme = 'light';\n /**\n * The custom theme configuration object.\n */\n @Prop() customTheme = '[]';\n\n private camelToKebab = (string) => {\n return string\n .replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`) // Convert uppercase letters to `-lowercase`\n .toLowerCase(); // Ensure the whole string is in lowercase\n };\n\n componentDidLoad() {\n // Inject style element\n const styleElement =\n document.querySelector('#searchcraft-theme') ||\n document.createElement('style');\n styleElement.innerHTML = styles;\n styleElement.id = 'searchcraft-theme';\n\n const head = document.head || document.getElementsByTagName('head')[0];\n\n if (!head.contains(styleElement)) {\n if (head.firstChild) {\n head.insertBefore(styleElement, head.firstChild);\n } else {\n head.appendChild(styleElement);\n }\n }\n\n // Add theme name to body\n document.body.dataset.theme = this.theme;\n\n // Add CSS variables from customTheme configuration to document\n Object.entries(JSON.parse(this.customTheme)).map(([key, value]) => {\n document.documentElement.style.setProperty(\n `--${this.camelToKebab(key)}`,\n `${value}`,\n );\n });\n }\n\n render() {\n return;\n }\n}\n"],"version":3}
|
|
@@ -79,6 +79,6 @@ function getFormattedTimeFromNow(timestamp) {
|
|
|
79
79
|
return `${years}y ago`;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
export {
|
|
82
|
+
export { getDocumentValueFromSearchResultMapping as a, formatNumberWithCommas as f, getMillis as g };
|
|
83
83
|
|
|
84
|
-
//# sourceMappingURL=units-
|
|
84
|
+
//# sourceMappingURL=units-daaf96f5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"units-daaf96f5.js","mappings":"AAEA;;;;;;;;;SASgB,uCAAuC,CACrD,QAA6C,EAC7C,OAAwC;IAExC,IAAI,QAAQ,IAAI,OAAO,EAAE;QACvB,OAAO,OAAO,CAAC,UAAU;aACtB,GAAG,CAAC,CAAC,gBAAgB;YACpB,IAAI,UAAU,GAAG,QAAQ,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;YAEtD,IAAI,UAAU,EAAE;gBACd,QAAQ,gBAAgB,CAAC,QAAQ;oBAC/B,KAAK,MAAM,EAAE;;wBAEX,UAAU,GAAG,uBAAuB,CAAC,UAAoB,CAAC,CAAC;wBAC3D,MAAM;qBACP;oBACD,KAAK,QAAQ,EAAE;wBACb,UAAU,GAAG,IAAI,CAAC,YAAY,CAC5B,gBAAgB,CAAC,kBAAkB,EACnC,gBAAgB,CAAC,mBAAmB,CACrC,CAAC,MAAM,CACL,UAAqB,IAAI,gBAAgB,CAAC,WAAW,IAAI,CAAC,CAAC,CAC7D,CAAC;wBACF,MAAM;qBACP;iBAGF;aACF;YAED,OAAO,UAAU,CAAC;SACnB,CAAC;aACD,MAAM,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,CAAC;aAC1B,IAAI,CAAC,OAAO,CAAC,SAAS,IAAI,GAAG,CAAC,CAAC;KACnC;AACH,CAAC;SAEe,SAAS,CAAC,IAAuC;IAC/D,MAAM,YAAY,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IACpC,MAAM,WAAW,GAAG,EAAE,GAAG,YAAY,CAAC;IACtC,MAAM,aAAa,GAAG,EAAE,GAAG,WAAW,CAAC;IACvC,MAAM,YAAY,GAAG,GAAG,GAAG,WAAW,CAAC;IAEvC,QAAQ,IAAI;QACV,KAAK,MAAM;YACT,OAAO,YAAY,CAAC;QACtB,KAAK,KAAK;YACR,OAAO,WAAW,CAAC;QACrB,KAAK,OAAO;YACV,OAAO,aAAa,CAAC;QACvB,KAAK,MAAM;YACT,OAAO,YAAY,CAAC;QACtB;YACE,OAAO,OAAO,CAAC;KAClB;AACH,CAAC;SAEe,sBAAsB,CAAC,MAAM;IAC3C,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,uBAAuB,EAAE,GAAG,CAAC,CAAC;AACjE,CAAC;AAED;;;;;;;SAOgB,uBAAuB,CAAC,SAAiB;IACvD,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;IACvB,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC;IACtC,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAC9B,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC,OAAO,EAAE,IAAI,IAAI,CAC7C,CAAC;IAEF,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,GAAG,EAAE,CAAC,CAAC;IAC/C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;IACvC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC;IACpC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC;IAErC,IAAI,OAAO,GAAG,EAAE,EAAE;QAChB,OAAO,GAAG,OAAO,OAAO,CAAC;KAC1B;IACD,IAAI,KAAK,GAAG,EAAE,EAAE;QACd,OAAO,GAAG,KAAK,OAAO,CAAC;KACxB;IACD,IAAI,IAAI,GAAG,GAAG,EAAE;QACd,OAAO,GAAG,IAAI,OAAO,CAAC;KACvB;IACD,OAAO,GAAG,KAAK,OAAO,CAAC;AACzB;;;;","names":[],"sources":["src/utils/units.ts"],"sourcesContent":["import type { SearchResultMapping } from '@searchcraft/core';\n\n/**\n * Given a document and a SearchResultMapping, return a mapped value from the document.\n *\n * Applies formatting based on the values specified in the `SearchResultFieldName` values.\n *\n * @param document\n * @param {SearchResultMapping} mapping\n * @returns {string | undefined}\n */\nexport function getDocumentValueFromSearchResultMapping(\n document: Record<string, unknown> | undefined,\n mapping: SearchResultMapping | undefined,\n): string | undefined {\n if (document && mapping) {\n return mapping.fieldNames\n .map((fieldNameDetails) => {\n let valueFound = document[fieldNameDetails.fieldName];\n\n if (valueFound) {\n switch (fieldNameDetails.dataType) {\n case 'date': {\n // TODO: Use fieldNameDetails.DateFormatOptions to format the date\n valueFound = getFormattedTimeFromNow(valueFound as string);\n break;\n }\n case 'number': {\n valueFound = Intl.NumberFormat(\n fieldNameDetails.numberFormatLocale,\n fieldNameDetails.numberFormatOptions,\n ).format(\n (valueFound as number) * (fieldNameDetails.numberScale || 1),\n );\n break;\n }\n default:\n break;\n }\n }\n\n return valueFound;\n })\n .filter((value) => !!value)\n .join(mapping.delimiter || ' ');\n }\n}\n\nexport function getMillis(unit: 'year' | 'month' | 'day' | 'hour'): number {\n const millisInHour = 60 * 60 * 1000;\n const millisInDay = 24 * millisInHour;\n const millisInMonth = 30 * millisInDay;\n const millisInYear = 365 * millisInDay;\n\n switch (unit) {\n case 'hour':\n return millisInHour;\n case 'day':\n return millisInDay;\n case 'month':\n return millisInMonth;\n case 'year':\n return millisInYear;\n default:\n return 3600000;\n }\n}\n\nexport function formatNumberWithCommas(number) {\n return number.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',');\n}\n\n/**\n * Given a timestamp value, returns a formatted time string for the time\n * since now.\n *\n * @param timestamp\n * @returns {string} Formatted string value\n */\nexport function getFormattedTimeFromNow(timestamp: string): string {\n const now = new Date();\n const inputTime = new Date(timestamp);\n const diffInSeconds = Math.floor(\n (now.getTime() - inputTime.getTime()) / 1000,\n );\n\n const minutes = Math.floor(diffInSeconds / 60);\n const hours = Math.floor(minutes / 60);\n const days = Math.floor(hours / 24);\n const years = Math.floor(days / 365);\n\n if (minutes < 60) {\n return `${minutes}m ago`;\n }\n if (hours < 24) {\n return `${hours}h ago`;\n }\n if (days < 365) {\n return `${days}d ago`;\n }\n return `${years}y ago`;\n}\n"],"version":3}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{p as parseCustomStyles,s as serializeStyles}from"./p-d9551738.js";export{u as useSearchcraftStore
|
|
1
|
+
export{p as parseCustomStyles,s as serializeStyles}from"./p-d9551738.js";export{u as useSearchcraftStore}from"./p-38419178.js";
|
|
2
2
|
//# sourceMappingURL=index.esm.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as t,h as s,F as e}from"./p-7e13c128.js";import{u as a}from"./p-38419178.js";import{a as r}from"./p-6104fe5d.js";const c=class{constructor(s){t(this,s)}item;searchResultMappings;containerTarget="_blank";containerRel;buttonTarget="_blank";buttonRel;imagePlacement="right";customStyles;documentPosition=0;titleContent;subtitleContent;bodyContent;footerContent;buttonLabel;buttonHref;containerHref;imageSrc;imageAlt;searchcraftStore=a.getState();connectedCallback(){if(this.item){this.mapValuesFromDocument(this.item.document)}}mapValuesFromDocument(t){this.titleContent=r(t,this.searchResultMappings?.title);this.subtitleContent=r(t,this.searchResultMappings?.subtitle);this.bodyContent=r(t,this.searchResultMappings?.body);this.containerHref=r(t,this.searchResultMappings?.containerHref);this.buttonHref=r(t,this.searchResultMappings?.buttonHref);this.imageSrc=r(t,this.searchResultMappings?.imageSource);this.footerContent=r(t,this.searchResultMappings?.footer)}handleLinkClick=()=>{const t=this.searchcraftStore.getSearchcraftInstance();if(t){const s=this.documentPosition;const e=this.searchcraftStore.searchTerm;const a=this.searchcraftStore.searchClientResponseItems.length;t.measureClient?.sendMeasureEvent("document_clicked",{document_position:s,number_of_documents:a,search_term:e})}};parseStyles=()=>{if(this.customStyles){try{return JSON.parse(this.customStyles)}catch(t){console.error("Error parsing custom styles:",t);return{}}}return{}};render(){const t=this.parseStyles();const a=this.imageSrc&&s("img",{alt:this.imageAlt,class:"searchcraft-search-result-image",src:this.imageSrc,style:t.image||{}});const r=s(e,null,this.imageSrc&&this.imagePlacement==="left"&&a,s("div",{class:"searchcraft-base-search-result-content-container"},this.titleContent&&s("h2",{class:"searchcraft-base-search-result-title",style:t.title||{}},this.titleContent),this.subtitleContent&&s("h3",{class:"searchcraft-base-search-result-subtitle",style:t.subtitle||{}},this.subtitleContent),this.bodyContent&&s("p",{class:"searchcraft-base-search-result-body-content",style:t.primaryContent||{}},this.bodyContent),this.footerContent&&s("p",{class:"searchcraft-base-search-result-footer-content",style:t.secondaryContent||{}},this.footerContent),this.buttonHref&&!this.containerHref&&this.buttonLabel&&s("a",{class:"searchcraft-search-result-button",href:this.buttonHref,style:t.button||{},target:this.buttonTarget,rel:this.buttonRel},this.buttonLabel)),this.imageSrc&&this.imagePlacement==="right"&&a);if(this.containerHref){return s("a",{class:"searchcraft-search-result-container",onClick:this.handleLinkClick,href:this.containerHref,rel:this.containerRel,style:t.container||{},tabindex:"0",target:this.containerTarget},r)}return s("div",{class:"searchcraft-search-result-container",style:t.container||{}},r)}};const i=class{constructor(s){t(this,s)}adClientResponseItem;connectedCallback(){if(this.adClientResponseItem?.admAd?.impression_url){fetch(this.adClientResponseItem?.admAd?.impression_url)}}renderADMProductAd(){const t=this.adClientResponseItem?.admAd;if(!t){return}return s("a",{class:"searchcraft-base-ad",href:t.click_url},t.image_url&&s("div",{class:"searchcraft-base-ad-image-wrapper"},s("img",{alt:t.term,src:t.image_url,class:"searchcraft-base-ad-image"})),s("div",{class:"searchcraft-base-ad-info-wrapper"},s("p",{class:"searchcraft-base-ad-title"},t.term),s("p",{class:"searchcraft-base-ad-subtitle"},t.price)))}renderADMTextAd(){const t=this.adClientResponseItem?.admAd;if(!t){return}return s("a",{class:"searchcraft-base-ad",href:t.click_url},t.image_url&&s("div",{class:"searchcraft-base-ad-image-wrapper"},s("img",{alt:t.term,src:t.image_url,class:"searchcraft-base-ad-image"})),s("div",{class:"searchcraft-base-ad-info-wrapper"},s("p",{class:"searchcraft-base-ad-title"},t.term)))}renderNativoAd(){}renderAdPlaceholder(){return s("p",null,"Ad placeholder")}render(){if(!this.adClientResponseItem){return this.renderAdPlaceholder()}switch(this.adClientResponseItem.type){case"adm-product-ad":return this.renderADMProductAd();case"adm-text-ad":return this.renderADMTextAd();case"nativo-ad":return this.renderNativoAd()}}};export{c as searchcraft_base_search_result,i as searchcraft_base_search_result_ad};
|
|
2
|
+
//# sourceMappingURL=p-279f3e15.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SearchcraftBaseSearchResult","item","searchResultMappings","containerTarget","containerRel","buttonTarget","buttonRel","imagePlacement","customStyles","documentPosition","titleContent","subtitleContent","bodyContent","footerContent","buttonLabel","buttonHref","containerHref","imageSrc","imageAlt","searchcraftStore","useSearchcraftStore","getState","connectedCallback","this","mapValuesFromDocument","document","getDocumentValueFromSearchResultMapping","title","subtitle","body","imageSource","footer","handleLinkClick","searchcraft","getSearchcraftInstance","document_position","search_term","searchTerm","number_of_documents","searchClientResponseItems","length","measureClient","sendMeasureEvent","parseStyles","JSON","parse","error","console","render","styles","imageContainer","h","alt","class","src","style","image","contentContainer","Fragment","primaryContent","secondaryContent","href","button","target","rel","onClick","container","tabindex","SearchcraftBaseSearchResultAd","adClientResponseItem","admAd","impression_url","fetch","renderADMProductAd","ad","click_url","image_url","term","price","renderADMTextAd","renderNativoAd","renderAdPlaceholder","type"],"sources":["src/components/searchcraft-base-search-result/searchcraft-base-search-result.tsx","src/components/searchcraft-base-search-result-ad/searchcraft-base-search-result-ad.tsx"],"sourcesContent":["import { useSearchcraftStore } from '@provider/store';\nimport type {\n SearchClientResponseItem,\n SearchDocument,\n} from '@searchcraft/core';\nimport { Component, Fragment, h, Prop, State } from '@stencil/core';\nimport { getDocumentValueFromSearchResultMapping } from '@utils';\nimport type { SearchResultMappings } from '@searchcraft/core';\n\n/**\n * This web component is designed to display detailed information for a single search result.\n * Once a query is submitted, the component formats and presents the result.\n * It is consumed within the `searchcraft-base-search-results` component.\n */\n@Component({\n tag: 'searchcraft-base-search-result',\n shadow: false,\n})\nexport class SearchcraftBaseSearchResult {\n @Prop() item: SearchClientResponseItem | undefined;\n @Prop() searchResultMappings: SearchResultMappings | undefined;\n /**\n * Where to open the link for the containing element.\n */\n @Prop() containerTarget: '_blank' | '_self' | '_top' | '_parent' = '_blank';\n /**\n * The relationship between the current document and the link for the containing element.\n */\n @Prop() containerRel: 'noreferrer' | 'noopener' | 'nofollow' | undefined;\n /**\n * Where to open the link for the button rendered when containerHref is not present.\n */\n @Prop() buttonTarget: '_blank' | '_self' | '_top' | '_parent' = '_blank';\n /**\n * The relationship between the current document and the link for the button rendered when containerHref is not present.\n */\n @Prop() buttonRel: 'noreferrer' | 'noopener' | 'nofollow' | undefined;\n /**\n * The placement of the image.\n */\n @Prop() imagePlacement: 'left' | 'right' = 'right';\n /**\n * A custom styles object.\n */\n @Prop() customStyles: string | undefined;\n /**\n * The position in the document. Used with the \"document_clicked\" measure event.\n */\n @Prop() documentPosition = 0;\n\n @State() titleContent: string | undefined;\n @State() subtitleContent: string | undefined;\n @State() bodyContent: string | undefined;\n @State() footerContent: string | undefined;\n @State() buttonLabel: string | undefined;\n @State() buttonHref: string | undefined;\n @State() containerHref: string | undefined;\n @State() imageSrc: string | undefined;\n @State() imageAlt: string | undefined;\n\n private searchcraftStore = useSearchcraftStore.getState();\n\n connectedCallback() {\n if (this.item) {\n this.mapValuesFromDocument(this.item.document);\n }\n }\n\n mapValuesFromDocument(document: SearchDocument) {\n this.titleContent = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings?.title,\n );\n this.subtitleContent = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings?.subtitle,\n );\n this.bodyContent = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings?.body,\n );\n this.containerHref = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings?.containerHref,\n );\n this.buttonHref = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings?.buttonHref,\n );\n this.imageSrc = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings?.imageSource,\n );\n this.footerContent = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings?.footer,\n );\n }\n\n private handleLinkClick = () => {\n const searchcraft = this.searchcraftStore.getSearchcraftInstance();\n\n if (searchcraft) {\n const document_position = this.documentPosition;\n const search_term = this.searchcraftStore.searchTerm;\n const number_of_documents =\n this.searchcraftStore.searchClientResponseItems.length;\n\n searchcraft.measureClient?.sendMeasureEvent('document_clicked', {\n document_position,\n number_of_documents,\n search_term,\n });\n }\n };\n\n private parseStyles = (): Record<string, { [key: string]: string }> => {\n if (this.customStyles) {\n try {\n return JSON.parse(this.customStyles);\n } catch (error) {\n console.error('Error parsing custom styles:', error);\n return {};\n }\n }\n return {};\n };\n\n render() {\n const styles = this.parseStyles();\n const imageContainer = this.imageSrc && (\n <img\n alt={this.imageAlt}\n class='searchcraft-search-result-image'\n src={this.imageSrc}\n style={styles.image || {}}\n />\n );\n\n const contentContainer = (\n <Fragment>\n {this.imageSrc && this.imagePlacement === 'left' && imageContainer}\n <div class='searchcraft-base-search-result-content-container'>\n {this.titleContent && (\n <h2\n class='searchcraft-base-search-result-title'\n style={styles.title || {}}\n >\n {this.titleContent}\n </h2>\n )}\n {this.subtitleContent && (\n <h3\n class='searchcraft-base-search-result-subtitle'\n style={styles.subtitle || {}}\n >\n {this.subtitleContent}\n </h3>\n )}\n {this.bodyContent && (\n <p\n class='searchcraft-base-search-result-body-content'\n style={styles.primaryContent || {}}\n >\n {this.bodyContent}\n </p>\n )}\n\n {this.footerContent && (\n <p\n class='searchcraft-base-search-result-footer-content'\n style={styles.secondaryContent || {}}\n >\n {this.footerContent}\n </p>\n )}\n {this.buttonHref && !this.containerHref && this.buttonLabel && (\n <a\n class='searchcraft-search-result-button'\n href={this.buttonHref}\n style={styles.button || {}}\n target={this.buttonTarget}\n rel={this.buttonRel}\n >\n {this.buttonLabel}\n </a>\n )}\n </div>\n {this.imageSrc && this.imagePlacement === 'right' && imageContainer}\n </Fragment>\n );\n\n /** Render as an anchor tag if the containerHref prop is present. */\n if (this.containerHref) {\n return (\n <a\n class='searchcraft-search-result-container'\n onClick={this.handleLinkClick}\n href={this.containerHref}\n rel={this.containerRel}\n style={styles.container || {}}\n tabindex='0'\n target={this.containerTarget}\n >\n {contentContainer}\n </a>\n );\n }\n\n /** Render as a div if no href prop. */\n return (\n <div\n class='searchcraft-search-result-container'\n style={styles.container || {}}\n >\n {contentContainer}\n </div>\n );\n }\n}\n","import type {\n AdClientResponseItem,\n ADMProductAd,\n ADMTextAd,\n} from '@searchcraft/core';\nimport { Component, h, Prop } from '@stencil/core';\n\n/**\n * A single list item rendered in a searchcraft-popover-list-view.\n */\n@Component({\n tag: 'searchcraft-base-search-result-ad',\n shadow: false,\n})\nexport class SearchcraftBaseSearchResultAd {\n @Prop() adClientResponseItem?: AdClientResponseItem;\n\n connectedCallback() {\n if (this.adClientResponseItem?.admAd?.impression_url) {\n fetch(this.adClientResponseItem?.admAd?.impression_url);\n }\n }\n\n renderADMProductAd() {\n const ad = this.adClientResponseItem?.admAd as ADMProductAd;\n if (!ad) {\n return;\n }\n\n return (\n <a class='searchcraft-base-ad' href={ad.click_url}>\n {ad.image_url && (\n <div class='searchcraft-base-ad-image-wrapper'>\n <img\n alt={ad.term}\n src={ad.image_url}\n class='searchcraft-base-ad-image'\n />\n </div>\n )}\n <div class='searchcraft-base-ad-info-wrapper'>\n <p class='searchcraft-base-ad-title'>{ad.term}</p>\n <p class='searchcraft-base-ad-subtitle'>{ad.price}</p>\n </div>\n </a>\n );\n }\n\n renderADMTextAd() {\n const ad = this.adClientResponseItem?.admAd as ADMTextAd;\n if (!ad) {\n return;\n }\n\n return (\n <a class='searchcraft-base-ad' href={ad.click_url}>\n {ad.image_url && (\n <div class='searchcraft-base-ad-image-wrapper'>\n <img\n alt={ad.term}\n src={ad.image_url}\n class='searchcraft-base-ad-image'\n />\n </div>\n )}\n <div class='searchcraft-base-ad-info-wrapper'>\n <p class='searchcraft-base-ad-title'>{ad.term}</p>\n </div>\n </a>\n );\n }\n\n renderNativoAd() {}\n\n renderAdPlaceholder() {\n return <p>Ad placeholder</p>;\n // return;\n }\n\n render() {\n if (!this.adClientResponseItem) {\n return this.renderAdPlaceholder();\n }\n\n switch (this.adClientResponseItem.type) {\n case 'adm-product-ad':\n return this.renderADMProductAd();\n case 'adm-text-ad':\n return this.renderADMTextAd();\n case 'nativo-ad':\n return this.renderNativoAd();\n }\n }\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as t,c as e,h as s,F as c}from"./p-7e13c128.js";import{c as a}from"./p-5cdc6210.js";import{u as i}from"./p-38419178.js";import{g as n}from"./p-6104fe5d.js";function h(t,e){const s={...t};for(const c in e){if(e.hasOwnProperty(c)){if(e[c]instanceof Object&&t[c]instanceof Object){s[c]=h(t[c],e[c])}else{s[c]=e[c]}}}return s}function r(t){return t.filter(((t,e,s)=>!s.some(((s,c)=>c!==e&&s.includes(t)))))}function l(t){const e={};const s=t=>{e[t.path]={count:t.count,path:t.path};t.children?.forEach((t=>{s(t)}))};s(t);return e}function o(t){const e={count:0,path:"/",children:{}};Object.keys(t).forEach((s=>{const c=t[s];if(!c){return}if(c.path==="/"){return}const a=c.path.substring(1).split("/");let i=e;let n="";a.forEach(((t,e)=>{const s=`${n}/${t}`;if(!i.children[s]){i.children[s]={count:0,path:s,children:{}}}if(e===a.length-1){i.children[s].count=c.count}n=s;i=i.children[s]}))}));return e}function d(t){const e={count:t.count,path:t.path,children:[]};if(Object.keys(t.children).length>0){e.children=Object.values(t.children).map((t=>d(t)))}return e}function f(t,e){const s=Object.keys(t);const c=Object.keys(e);const a=new Set(c.filter((t=>t.split("/").length>2)).map((t=>t.substring(0,t.lastIndexOf("/")))));const i=Object.fromEntries(s.filter((t=>!a.has(t.substring(0,t.lastIndexOf("/"))))).map((e=>[e,t[e]])));return i}function b(t,e,s){const c=e[t];const a=s[t];const i={count:0,path:"/",children:c};const n={count:0,path:"/",children:a};const r=l(i);const b=l(n);const u=f(r,b);const p=h(u,b);const k=o(p);const g=d(k);return{[t]:g.children}}const u=class{constructor(s){t(this,s);this.facetSelectionUpdated=e(this,"facetSelectionUpdated",7)}fieldName="";facetSelectionUpdated;baseFacetRoot;facetRoot;selectedPaths={};lastTimeTaken;hasNewSearchTerm=false;lastSearchTerm;lastSearchMode;lastSortType;unsubscribe;searchStore=i.getState();handleStateUpdate(t){const e=t.searchResponseFacetPrime;const s=t.searchResponseTimeTaken;if(!this.fieldName){return}if(t.searchTerm!==this.lastSearchTerm||t.searchMode!==this.lastSearchMode||t.sortType!==this.lastSortType){this.selectedPaths={};this.hasNewSearchTerm=true}if(s!==this.lastTimeTaken&&e){this.facetRoot=undefined;const t=e.find((t=>this.fieldName===Object.keys(t)[0]));if(this.hasNewSearchTerm){this.baseFacetRoot=t;this.facetRoot=t;this.hasNewSearchTerm=false}else if(this.baseFacetRoot&&t){this.facetRoot=b(this.fieldName,this.baseFacetRoot,t)}}this.lastSearchTerm=t.searchTerm;this.lastSearchMode=t.searchMode;this.lastSortType=t.sortType;this.lastTimeTaken=s}connectedCallback(){this.handleStateUpdate(this.searchStore);this.unsubscribe=i.subscribe((t=>{this.handleStateUpdate(t)}))}disconnectedCallback(){this.unsubscribe?.()}handleCheckboxChange(t){const e=!this.selectedPaths[t];if(e){this.selectedPaths={...this.selectedPaths,[t]:true}}else{const e=Object.keys(this.selectedPaths).filter((e=>!e.includes(t)));this.selectedPaths=e.reduce(((t,e)=>{t[e]=true;return t}),{})}const s=Object.keys(this.selectedPaths).filter((t=>this.selectedPaths[t]));const c=r(s);this.facetSelectionUpdated?.emit({paths:c})}formatLabel=t=>{const e=t.path.replace(/^\//,"");const s=t.count;return`${e.replace(/-/g," ").replace(/\b\w/g,(t=>t.toUpperCase()))} (${s})`};formatSubLabel=(t,e)=>{const s=t.path.substring(e.path.length);const c=s.replace(/^\//,"");const a=t.count;return`${c.replace(/-/g," ").replace(/\b\w/g,(t=>t.toUpperCase()))} (${a})`};render(){if(!this.fieldName){return}const t=this.facetRoot?.[this.fieldName];return s("div",{class:a("filtersListContainer","searchcraft-filters-list-container")},!t&&s("p",{class:"searchcraft-facet-message"},"Enter a search to view facets."),t?.map((t=>{const e=t.children?t.children?.some((t=>this.selectedPaths[t.path])):false;return s("div",{key:t.path,class:a("searchcraft-filters-list-item")},s("label",{class:a("filterCheckboxLabel","searchcraft-filters-list-checkbox-label")},s("input",{checked:this.selectedPaths[t.path],onChange:e=>this.handleCheckboxChange(t.path),type:"checkbox"}),e?s("div",{class:a("dashContainer","searchcraft-filter-list-dash-container")},s("svg",{width:"14",height:"3",viewBox:"0 0 14 3",fill:"none"},s("title",null,"Checkbox Dash"),s("line",{x1:"1.5",y1:"1.5",x2:"12.5",y2:"1.5",stroke:"white","stroke-width":"3","stroke-linecap":"round"}))):s("div",{class:a("checkContainer","searchcraft-filter-list-check-container")},s("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},s("title",null,"Checkbox Check"),s("path",{d:"M13.9999 2L5.74988 10L1.99988 6.36364",stroke:"white","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"}))),this.formatLabel(t)),t.children&&t.children.length>0&&s(c,null,t.children.map((e=>s("label",{key:e.path,class:a("childFilterCheckboxLabel","searchcraft-child-filter-checkbox-label"),style:{display:this.selectedPaths[t.path]?"flex":"none"}},s("input",{checked:this.selectedPaths[e.path],onChange:t=>{this.handleCheckboxChange(e.path)},type:"checkbox"}),s("div",{class:a("checkContainer","searchcraft-filter-list-check-container")},s("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},s("title",null,"Checkbox Check"),s("path",{d:"M13.9999 2L5.74988 10L1.99988 6.36364",stroke:"white","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"}))),this.formatSubLabel(e,t))))))})))}};const p=class{constructor(s){t(this,s);this.rangeChanged=e(this,"rangeChanged",7)}max=100;min=0;granularity=n("month");dataType="number";endValue=this.max;startValue=this.min;lastFocusedHandle="max";rangeChanged;componentDidLoad(){this.startValue=this.min;this.endValue=this.max}emitUpdate=async()=>{this.rangeChanged?.emit({startValue:this.startValue,endValue:this.endValue})};handleStartValueChange=t=>{const e=t.target;const s=Number.parseInt(e.value,10);this.lastFocusedHandle="min";if(s<=this.endValue){this.startValue=s;this.emitUpdate()}else{this.startValue=this.endValue;e.value=`${this.endValue}`}};handleEndValueChange=t=>{const e=t.target;const s=Number.parseInt(e.value,10);this.lastFocusedHandle="max";if(s>=this.startValue){this.endValue=s;this.emitUpdate()}else{this.endValue=this.startValue;e.value=`${this.startValue}`}};render(){const t=this.min;const e=this.max;const c=(this.startValue-t)/(e-t)*100;const i=(this.endValue-t)/(e-t)*100;const n=this.dataType==="number"?this.startValue:new Date(this.startValue).getFullYear();const h=this.dataType==="number"?this.endValue:new Date(this.endValue).getFullYear();return s("div",{key:"c5dd33e5dbeb14c6acf1a3caa2101c8aff186abf",class:"searchcraft-slider-container"},s("div",{key:"208354ad0176cfaa498ac4bb58cc584dd1976026",class:"searchcraft-slider-range-container"},s("div",{key:"9ad0890810211c2d5b9e4588d67d43a85f76f0bb",class:"searchcraft-slider-active-range",style:{left:`${c}%`,width:`${i-c}%`}}),s("input",{key:"80d5d3847424991564fff0b6d16a0659b35fdcc2",class:a("searchcraft-slider-input","searchcraft-slider-input-min-handle"),max:this.max,min:this.min,onInput:this.handleStartValueChange.bind(this),step:this.granularity,style:{zIndex:this.lastFocusedHandle==="min"?"2":"1"},type:"range",value:this.startValue}),s("input",{key:"063f4fc243a64dc3743d6cd8fbe6776e65f0d79e",class:a("searchcraft-slider-input","searchcraft-slider-input-max-handle"),max:this.max,min:this.min,onInput:this.handleEndValueChange.bind(this),step:this.granularity,style:{zIndex:this.lastFocusedHandle==="max"?"2":"1"},type:"range",value:this.endValue})),s("div",{key:"148f3b70984ae66b0fe765d0351df380719fb5d8",class:"searchcraft-slider-label-container"},s("span",{key:"e5f1ad86454262abcb5261eba7b3555e59822b49",class:"searchcraft-slider-label"},n),s("span",{key:"beac7a99a5a8fc1416712e4877eaf65574d8a42e",class:"searchcraft-slider-label"},h)))}};const k=class{constructor(s){t(this,s);this.toggleUpdated=e(this,"toggleUpdated",7)}label="Toggle";subLabel;toggleUpdated;isActive=false;unsubscribe;lastSearchTerm;handleToggle=async()=>{this.isActive=!this.isActive;this.toggleUpdated?.emit(this.isActive)};connectedCallback(){this.unsubscribe=i.subscribe((t=>{if(t.searchTerm!==this.lastSearchTerm&&t.searchTerm.trim().length===0){this.isActive=false}this.lastSearchTerm=t.searchTerm}))}disconnectedCallback(){this.unsubscribe?.()}render(){return s("div",{key:"ff105efef07b5f57127ff83ddb105658398b205d",class:"searchcraft-toggle-button-container"},s("div",{key:"696046a2cb1f1bd0273bb77fda7c16ed5795422a"},s("p",{key:"93690038f12e2c7cff406a8f8ceeedaa5b871b70",class:"searchcraft-toggle-button-label"},this.label),this.subLabel&&s("p",{key:"1eaa110307794a4c15812e252d8a6ac7e81e7408",class:"searchcraft-toggle-button-sub-label"},this.subLabel)),s("button",{key:"a2671d9696db713763d44d0a84e08aff19bc8aa0",class:a("searchcraft-toggle-button-background",{active:this.isActive}),onClick:this.handleToggle,type:"button"},s("div",{key:"12874ac4782f756c6568952764777b758452406f",class:a("searchcraft-toggle-button-handle",{active:this.isActive})})))}};export{u as searchcraft_facet_list,p as searchcraft_slider,k as searchcraft_toggle_button};
|
|
2
|
+
//# sourceMappingURL=p-2bc82b48.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["deepMergeWithSpread","obj1","obj2","result","key","hasOwnProperty","Object","removeSubstringMatches","arr","filter","entry","index","array","some","otherEntry","otherIndex","includes","facetToRecord","facet","records","traverseAndAddToFragments","facetChild","path","count","children","forEach","child","recordToObject","record","root","keys","fragment","pathParts","substring","split","currentRoot","currentPath","part","nextPath","length","objectToFacet","childObject","transformed","values","map","subChildObject","filterRecordByParentPaths","record1","record2","paths1","paths2","parentPaths","Set","lastIndexOf","filteredRecord","fromEntries","has","mergeFacetRoots","fieldName","incomingRoot","currentArray","incomingArray","currentRootFacetChild","incomingRootFacetChild","currentRecord","incomingRecord","filteredCurrentRecord","mergedRecord","mergedObject","mergedFacetChild","SearchcraftFacetList","facetSelectionUpdated","baseFacetRoot","facetRoot","selectedPaths","lastTimeTaken","hasNewSearchTerm","lastSearchTerm","lastSearchMode","lastSortType","unsubscribe","searchStore","useSearchcraftStore","getState","handleStateUpdate","state","facetPrime","searchResponseFacetPrime","timeTaken","searchResponseTimeTaken","this","searchTerm","searchMode","sortType","undefined","incomingFacetRoot","find","connectedCallback","subscribe","disconnectedCallback","handleCheckboxChange","isCheckboxChecked","updatedPaths","testPath","reduce","acc","str","paths","pathsWithParentPathsRemoved","emit","formatLabel","label","replace","char","toUpperCase","formatSubLabel","facetChildAncestor","facetChildPath","render","firstFacet","h","class","classNames","isChildSelected","checked","onChange","_event","type","width","height","viewBox","fill","x1","y1","x2","y2","stroke","d","Fragment","grandchild","style","display","SearchcraftSlider","max","min","granularity","getMillis","dataType","endValue","startValue","lastFocusedHandle","rangeChanged","componentDidLoad","emitUpdate","async","handleStartValueChange","event","inputElement","target","value","Number","parseInt","handleEndValueChange","rangeMin","rangeMax","startPercent","endPercent","startLabel","Date","getFullYear","endLabel","left","onInput","bind","step","zIndex","SearchcraftToggleButton","subLabel","toggleUpdated","isActive","handleToggle","trim","active","onClick"],"sources":["src/utils/facets.ts","src/components/searchcraft-facet-list/searchcraft-facet-list.tsx","src/components/searchcraft-slider/searchcraft-slider.tsx","src/components/searchcraft-toggle-button/searchcraft-toggle-button.tsx"],"sourcesContent":["import type {\n FacetChild,\n FacetChildObject,\n FacetRoot,\n} from '@searchcraft/core';\n\nfunction deepMergeWithSpread(obj1, obj2) {\n const result = { ...obj1 };\n\n for (const key in obj2) {\n // biome-ignore lint/suspicious/noPrototypeBuiltins: <explanation>\n if (obj2.hasOwnProperty(key)) {\n if (obj2[key] instanceof Object && obj1[key] instanceof Object) {\n result[key] = deepMergeWithSpread(obj1[key], obj2[key]);\n } else {\n result[key] = obj2[key];\n }\n }\n }\n\n return result;\n}\n\n/**\n * Given an array of facet paths, removes parent facet paths.\n */\nexport function removeSubstringMatches(arr: string[]): string[] {\n return arr.filter(\n (entry, index, array) =>\n !array.some(\n (otherEntry, otherIndex) =>\n otherIndex !== index && otherEntry.includes(entry),\n ),\n );\n}\n\ntype FacetChildFragment = {\n count: number;\n path: string;\n};\n\nfunction facetToRecord(facet: FacetChild): Record<string, FacetChildFragment> {\n const records: Record<string, FacetChildFragment> = {};\n\n const traverseAndAddToFragments = (facetChild: FacetChild) => {\n records[facetChild.path] = {\n count: facetChild.count,\n path: facetChild.path,\n };\n\n facetChild.children?.forEach((child) => {\n traverseAndAddToFragments(child);\n });\n };\n\n traverseAndAddToFragments(facet);\n\n return records;\n}\n\nfunction recordToObject(\n record: Record<string, FacetChildFragment>,\n): FacetChildObject {\n const root: FacetChildObject = {\n count: 0,\n path: '/',\n children: {},\n };\n\n Object.keys(record).forEach((key) => {\n const fragment = record[key];\n if (!fragment) {\n return;\n }\n\n if (fragment.path === '/') {\n return;\n }\n const pathParts = fragment.path.substring(1).split('/');\n let currentRoot = root;\n let currentPath = '';\n\n pathParts.forEach((part, index) => {\n const nextPath = `${currentPath}/${part}`;\n if (!currentRoot.children[nextPath]) {\n currentRoot.children[nextPath] = {\n count: 0,\n path: nextPath,\n children: {},\n };\n }\n\n if (index === pathParts.length - 1) {\n currentRoot.children[nextPath].count = fragment.count;\n }\n\n currentPath = nextPath;\n currentRoot = currentRoot.children[nextPath];\n });\n });\n\n return root;\n}\n\nfunction objectToFacet(childObject: FacetChildObject): FacetChild {\n const transformed: FacetChild = {\n count: childObject.count,\n path: childObject.path,\n children: [],\n };\n\n if (Object.keys(childObject.children).length > 0) {\n transformed.children = Object.values(childObject.children).map(\n (subChildObject) => objectToFacet(subChildObject),\n );\n }\n\n return transformed;\n}\n\n/**\n * Filters records with the parent paths from record2 OUT of record1\n */\nfunction filterRecordByParentPaths(\n record1: Record<string, FacetChild>,\n record2: Record<string, FacetChild>,\n): Record<string, FacetChild> {\n // Extract all paths (keys) both records\n const paths1 = Object.keys(record1);\n const paths2 = Object.keys(record2);\n\n // Find all parent paths in record2\n const parentPaths = new Set(\n paths2\n .filter((path) => path.split('/').length > 2) // Only consider paths with more than one level\n .map((path) => path.substring(0, path.lastIndexOf('/'))),\n );\n\n // Filter out keys in record1 that share a parent path with any of the identified parent paths\n const filteredRecord = Object.fromEntries(\n paths1\n .filter(\n (path) => !parentPaths.has(path.substring(0, path.lastIndexOf('/'))),\n )\n .map((path) => [path, record1[path]]), // Reconstruct the key-value pairs\n );\n\n return filteredRecord as Record<string, FacetChild>;\n}\n\nexport function mergeFacetRoots(\n fieldName: string,\n currentRoot: FacetRoot,\n incomingRoot: FacetRoot,\n): FacetRoot {\n const currentArray = currentRoot[fieldName];\n const incomingArray = incomingRoot[fieldName];\n\n const currentRootFacetChild: FacetChild = {\n count: 0,\n path: '/',\n children: currentArray,\n };\n\n const incomingRootFacetChild: FacetChild = {\n count: 0,\n path: '/',\n children: incomingArray,\n };\n\n // Flatten them into records\n const currentRecord: Record<string, FacetChildFragment> = facetToRecord(\n currentRootFacetChild,\n );\n\n const incomingRecord: Record<string, FacetChildFragment> = facetToRecord(\n incomingRootFacetChild,\n );\n\n // Filter out the records from record1 (the current set of records)\n // that share a parent path with record2 (the incoming records)\n const filteredCurrentRecord = filterRecordByParentPaths(\n currentRecord,\n incomingRecord,\n );\n\n // Deep merge the records together\n const mergedRecord: Record<string, FacetChildFragment> = deepMergeWithSpread(\n filteredCurrentRecord,\n incomingRecord,\n );\n\n // Convert into a heirarchical object\n const mergedObject: FacetChildObject = recordToObject(mergedRecord);\n\n // Convert the heirarchical object back to the Facet child structure\n const mergedFacetChild = objectToFacet(mergedObject);\n\n return {\n [fieldName]: mergedFacetChild.children,\n } as FacetRoot;\n}\n","import {\n Component,\n h,\n State,\n Prop,\n Event,\n type EventEmitter,\n Fragment,\n} from '@stencil/core';\nimport classNames from 'classnames';\n\nimport type { FacetChild, FacetRoot } from '@searchcraft/core';\n\nimport { useSearchcraftStore, type SearchcraftState } from '@provider/store';\nimport { mergeFacetRoots, removeSubstringMatches } from '@utils';\n\n/**\n * This web component is designed to display facets in a search interface, allowing users to refine their search results by applying filters based on various attributes.\n * It is consumed within the `searchcraft-filter-panel`.\n *\n * ## Usage\n * ```html\n * <!-- index.html -->\n * <searchcraft-facet-list field-name=\"title\" />\n * ```\n *\n * ```js\n * // index.js\n * const facetList = document.querySelector('searchcraft-facet-list');\n *\n * facetList.addEventListener('facetSelectionUpdated', () => {\n * console.log('Facet selection updated');\n * });\n * ```\n */\n@Component({\n tag: 'searchcraft-facet-list',\n shadow: false,\n})\nexport class SearchcraftFacetList {\n /**\n * The name of the field where facets are applied.\n */\n @Prop() fieldName = '';\n\n /**\n * When the facets are updated.\n */\n @Event() facetSelectionUpdated?: EventEmitter<{ paths: string[] }>;\n\n @State() baseFacetRoot: FacetRoot | undefined;\n @State() facetRoot: FacetRoot | undefined;\n @State() selectedPaths: Record<string, boolean> = {};\n @State() lastTimeTaken: number | undefined;\n @State() hasNewSearchTerm = false;\n\n @State() lastSearchTerm: string | undefined;\n @State() lastSearchMode: string | undefined;\n @State() lastSortType: string | undefined;\n\n @State() unsubscribe: (() => void) | undefined;\n\n private searchStore = useSearchcraftStore.getState();\n\n handleStateUpdate(state: SearchcraftState) {\n const facetPrime = state.searchResponseFacetPrime;\n const timeTaken = state.searchResponseTimeTaken;\n\n if (!this.fieldName) {\n return;\n }\n\n /** Things to do when the state's search term has changed, but before the response received */\n if (\n state.searchTerm !== this.lastSearchTerm ||\n state.searchMode !== this.lastSearchMode ||\n state.sortType !== this.lastSortType\n ) {\n this.selectedPaths = {};\n this.hasNewSearchTerm = true;\n }\n\n /** Things to do when a new response with a new facet prime has been received */\n if (timeTaken !== this.lastTimeTaken && facetPrime) {\n this.facetRoot = undefined;\n const incomingFacetRoot: FacetRoot | undefined = facetPrime.find(\n (facet) => this.fieldName === Object.keys(facet)[0],\n );\n\n /** Data is from a new search term: completely override our facets */\n if (this.hasNewSearchTerm) {\n this.baseFacetRoot = incomingFacetRoot;\n this.facetRoot = incomingFacetRoot;\n this.hasNewSearchTerm = false;\n } else if (this.baseFacetRoot && incomingFacetRoot) {\n /** Data is from an existing search term, merge the facets together */\n this.facetRoot = mergeFacetRoots(\n this.fieldName,\n this.baseFacetRoot,\n incomingFacetRoot,\n );\n }\n }\n\n this.lastSearchTerm = state.searchTerm;\n this.lastSearchMode = state.searchMode;\n this.lastSortType = state.sortType;\n this.lastTimeTaken = timeTaken;\n }\n\n connectedCallback() {\n this.handleStateUpdate(this.searchStore);\n\n this.unsubscribe = useSearchcraftStore.subscribe((state) => {\n this.handleStateUpdate(state);\n });\n }\n\n disconnectedCallback() {\n this.unsubscribe?.();\n }\n\n handleCheckboxChange(path: string) {\n const isCheckboxChecked = !this.selectedPaths[path];\n\n if (isCheckboxChecked) {\n /**\n * Checkbox Checked: Add to the selectedPaths record\n * Uses spread operator here so UI updates.\n */\n this.selectedPaths = {\n ...this.selectedPaths,\n [path]: true,\n };\n } else {\n /**\n * Checkbox Uncheck: Remove any paths and sub-paths\n */\n const updatedPaths = Object.keys(this.selectedPaths).filter(\n (testPath) => !testPath.includes(path),\n );\n\n this.selectedPaths = updatedPaths.reduce(\n (acc, str) => {\n acc[str] = true;\n return acc;\n },\n {} as Record<string, boolean>,\n );\n }\n\n /**\n * Emit the paths array, with parent paths removed.\n */\n const paths = Object.keys(this.selectedPaths).filter(\n (path) => this.selectedPaths[path],\n );\n const pathsWithParentPathsRemoved = removeSubstringMatches(paths);\n\n this.facetSelectionUpdated?.emit({ paths: pathsWithParentPathsRemoved });\n }\n\n formatLabel = (facetChild: FacetChild): string => {\n const label = facetChild.path.replace(/^\\//, '');\n const count = facetChild.count;\n return `${label.replace(/-/g, ' ').replace(/\\b\\w/g, (char) => char.toUpperCase())} (${count})`;\n };\n\n formatSubLabel = (\n facetChild: FacetChild,\n facetChildAncestor: FacetChild,\n ): string => {\n const facetChildPath = facetChild.path.substring(\n facetChildAncestor.path.length,\n );\n const label = facetChildPath.replace(/^\\//, '');\n const count = facetChild.count;\n return `${label.replace(/-/g, ' ').replace(/\\b\\w/g, (char) => char.toUpperCase())} (${count})`;\n };\n\n render() {\n if (!this.fieldName) {\n return;\n }\n\n const firstFacet = this.facetRoot?.[this.fieldName];\n\n return (\n <div\n class={classNames(\n 'filtersListContainer',\n 'searchcraft-filters-list-container',\n )}\n >\n {!firstFacet && (\n <p class='searchcraft-facet-message'>\n Enter a search to view facets.\n </p>\n )}\n {firstFacet?.map((facetChild: FacetChild) => {\n const isChildSelected = facetChild.children\n ? facetChild.children?.some(\n (child) => this.selectedPaths[child.path],\n )\n : false;\n\n return (\n <div\n key={facetChild.path}\n class={classNames('searchcraft-filters-list-item')}\n >\n <label\n class={classNames(\n 'filterCheckboxLabel',\n 'searchcraft-filters-list-checkbox-label',\n )}\n >\n <input\n checked={this.selectedPaths[facetChild.path]}\n onChange={(_event: Event) =>\n this.handleCheckboxChange(facetChild.path)\n }\n type='checkbox'\n />\n {isChildSelected ? (\n <div\n class={classNames(\n 'dashContainer',\n 'searchcraft-filter-list-dash-container',\n )}\n >\n <svg width='14' height='3' viewBox='0 0 14 3' fill='none'>\n <title>Checkbox Dash</title>\n <line\n x1='1.5'\n y1='1.5'\n x2='12.5'\n y2='1.5'\n stroke='white'\n stroke-width='3'\n stroke-linecap='round'\n />\n </svg>\n </div>\n ) : (\n <div\n class={classNames(\n 'checkContainer',\n 'searchcraft-filter-list-check-container',\n )}\n >\n <svg width='16' height='16' viewBox='0 0 16 16' fill='none'>\n <title>Checkbox Check</title>\n <path\n d='M13.9999 2L5.74988 10L1.99988 6.36364'\n stroke='white'\n stroke-width='3'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n </svg>\n </div>\n )}\n {this.formatLabel(facetChild)}\n </label>\n {facetChild.children && facetChild.children.length > 0 && (\n <Fragment>\n {facetChild.children.map((grandchild) => (\n <label\n key={grandchild.path}\n class={classNames(\n 'childFilterCheckboxLabel',\n 'searchcraft-child-filter-checkbox-label',\n )}\n style={{\n display: this.selectedPaths[facetChild.path]\n ? 'flex'\n : 'none',\n }}\n >\n <input\n checked={this.selectedPaths[grandchild.path]}\n onChange={(_event: Event) => {\n this.handleCheckboxChange(grandchild.path);\n }}\n type='checkbox'\n />\n <div\n class={classNames(\n 'checkContainer',\n 'searchcraft-filter-list-check-container',\n )}\n >\n <svg\n width='16'\n height='16'\n viewBox='0 0 16 16'\n fill='none'\n >\n <title>Checkbox Check</title>\n <path\n d='M13.9999 2L5.74988 10L1.99988 6.36364'\n stroke='white'\n stroke-width='3'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n </svg>\n </div>\n {this.formatSubLabel(grandchild, facetChild)}\n </label>\n ))}\n </Fragment>\n )}\n </div>\n );\n })}\n </div>\n );\n }\n}\n","import {\n Component,\n Event,\n type EventEmitter,\n h,\n State,\n Prop,\n} from '@stencil/core';\nimport { getMillis } from '@utils';\nimport classNames from 'classnames';\n\n/**\n * This web component is designed to allow users to select a value from a range defined by a minimum and maximum value.\n * The component renders a slider interface, which can be used to visually choose a value between two boundaries.\n * It is consumed by the `searchcraft-filter-panel` component.\n */\n@Component({\n tag: 'searchcraft-slider',\n shadow: false,\n})\nexport class SearchcraftSlider {\n /**\n * The maximum value allowed.\n */\n @Prop() max = 100;\n /**\n * The minimum value allowed.\n */\n @Prop() min = 0;\n /**\n * The granularity that the value must adhere to.\n */\n @Prop() granularity: number = getMillis('month');\n /** The type of data allowed. */\n @Prop() dataType: 'number' | 'date' = 'number';\n\n @State() endValue = this.max;\n @State() startValue = this.min;\n @State() lastFocusedHandle: 'min' | 'max' = 'max';\n\n /**\n * When the range has changed.\n * */\n @Event() rangeChanged:\n | EventEmitter<{ startValue: number; endValue: number }>\n | undefined;\n\n componentDidLoad() {\n this.startValue = this.min;\n this.endValue = this.max;\n }\n\n private emitUpdate = async () => {\n this.rangeChanged?.emit({\n startValue: this.startValue,\n endValue: this.endValue,\n });\n };\n\n private handleStartValueChange = (event: InputEvent) => {\n const inputElement = event.target as HTMLInputElement;\n const value = Number.parseInt(inputElement.value, 10);\n this.lastFocusedHandle = 'min';\n if (value <= this.endValue) {\n this.startValue = value;\n this.emitUpdate();\n } else {\n this.startValue = this.endValue;\n inputElement.value = `${this.endValue}`;\n }\n };\n\n private handleEndValueChange = (event: InputEvent) => {\n const inputElement = event.target as HTMLInputElement;\n const value = Number.parseInt(inputElement.value, 10);\n this.lastFocusedHandle = 'max';\n if (value >= this.startValue) {\n this.endValue = value;\n this.emitUpdate();\n } else {\n this.endValue = this.startValue;\n inputElement.value = `${this.startValue}`;\n }\n };\n\n render() {\n const rangeMin = this.min;\n const rangeMax = this.max;\n const startPercent =\n ((this.startValue - rangeMin) / (rangeMax - rangeMin)) * 100;\n const endPercent =\n ((this.endValue - rangeMin) / (rangeMax - rangeMin)) * 100;\n\n const startLabel =\n this.dataType === 'number'\n ? this.startValue\n : new Date(this.startValue).getFullYear();\n\n const endLabel =\n this.dataType === 'number'\n ? this.endValue\n : new Date(this.endValue).getFullYear();\n\n return (\n <div class='searchcraft-slider-container'>\n <div class='searchcraft-slider-range-container'>\n <div\n class='searchcraft-slider-active-range'\n style={{\n left: `${startPercent}%`,\n width: `${endPercent - startPercent}%`,\n }}\n />\n <input\n class={classNames(\n 'searchcraft-slider-input',\n 'searchcraft-slider-input-min-handle',\n )}\n max={this.max}\n min={this.min}\n onInput={this.handleStartValueChange.bind(this)}\n step={this.granularity}\n style={{ zIndex: this.lastFocusedHandle === 'min' ? '2' : '1' }}\n type='range'\n value={this.startValue}\n />\n <input\n class={classNames(\n 'searchcraft-slider-input',\n 'searchcraft-slider-input-max-handle',\n )}\n max={this.max}\n min={this.min}\n onInput={this.handleEndValueChange.bind(this)}\n step={this.granularity}\n style={{ zIndex: this.lastFocusedHandle === 'max' ? '2' : '1' }}\n type='range'\n value={this.endValue}\n />\n </div>\n <div class='searchcraft-slider-label-container'>\n <span class='searchcraft-slider-label'>{startLabel}</span>\n <span class='searchcraft-slider-label'>{endLabel}</span>\n </div>\n </div>\n );\n }\n}\n","import { useSearchcraftStore } from '@provider/store';\nimport {\n Component,\n Event,\n h,\n Prop,\n State,\n type EventEmitter,\n} from '@stencil/core';\nimport classNames from 'classnames';\n\n/**\n * This web component simulates a light switch functionality, providing a simple and intuitive toggle between two states—on and off.\n * It is consumed within the `searchcraft-filter-panel` component.\n */\n@Component({\n tag: 'searchcraft-toggle-button',\n shadow: false,\n})\nexport class SearchcraftToggleButton {\n /**\n * The label.\n */\n @Prop() label = 'Toggle';\n /**\n * The secondary label displayed below the main label.\n */\n @Prop() subLabel: string | undefined;\n\n /**\n * When the toggle element is changed.\n */\n @Event() toggleUpdated?: EventEmitter<boolean>;\n\n @State() isActive = false;\n @State() unsubscribe: (() => void) | undefined;\n @State() lastSearchTerm: string | undefined;\n\n private handleToggle = async () => {\n this.isActive = !this.isActive;\n this.toggleUpdated?.emit(this.isActive);\n };\n\n connectedCallback() {\n /** When the query changes, sets toggle button state back to inactive. */\n this.unsubscribe = useSearchcraftStore.subscribe((state) => {\n if (\n state.searchTerm !== this.lastSearchTerm &&\n state.searchTerm.trim().length === 0\n ) {\n this.isActive = false;\n }\n this.lastSearchTerm = state.searchTerm;\n });\n }\n\n disconnectedCallback() {\n this.unsubscribe?.();\n }\n\n render() {\n return (\n <div class='searchcraft-toggle-button-container'>\n <div>\n <p class='searchcraft-toggle-button-label'>{this.label}</p>\n {this.subLabel && (\n <p class='searchcraft-toggle-button-sub-label'>{this.subLabel}</p>\n )}\n </div>\n <button\n class={classNames('searchcraft-toggle-button-background', {\n active: this.isActive,\n })}\n onClick={this.handleToggle}\n type='button'\n >\n <div\n class={classNames('searchcraft-toggle-button-handle', {\n active: this.isActive,\n })}\n />\n </button>\n </div>\n );\n }\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as s,g as e,h as t}from"./p-7e13c128.js";import{c as i}from"./p-5cdc6210.js";import{u as r}from"./p-38419178.js";const o=class{constructor(e){s(this,e)}config;type="inline";popoverResultMappings;hotkey="k";hotkeyModifier="meta";isPopoverVisibleInState=false;unsubscribe;searchClientResponseItems=[];adClientResponseItems=[];searchTerm;isFocused=false;breakpointSm=576;breakpointMd=768;breakpointLg=992;searchResultsPage;searchResultsPerPage;modalElement;get hostElement(){return e(this)}componentDidLoad(){const s=getComputedStyle(document.documentElement);this.breakpointSm=Number.parseFloat(s.getPropertyValue("--sc-breakpoint-sm").trim());this.breakpointMd=Number.parseFloat(s.getPropertyValue("--sc-breakpoint-md").trim());this.breakpointLg=Number.parseFloat(s.getPropertyValue("--sc-breakpoint-lg").trim());this.isPopoverVisibleInState=r.getState().isPopoverVisible;document.addEventListener("click",this.handleDocumentClick);document.addEventListener("keydown",this.handleDocumentKeyDown);this.unsubscribe=r.subscribe((s=>{if(this.isPopoverVisibleInState!==s.isPopoverVisible){this.handlePopoverVisibilityChange(s.isPopoverVisible)}this.searchClientResponseItems=[...s.searchClientResponseItems];this.adClientResponseItems=[...s.adClientResponseItems];this.searchTerm=s.searchTerm;this.searchResultsPage=s.searchResultsPage;this.searchResultsPerPage=s.searchResultsPerPage}))}disconnectedCallback(){this.unsubscribe?.();document.removeEventListener("click",this.handleDocumentClick);document.removeEventListener("keydown",this.handleDocumentKeyDown)}handleDocumentClick=s=>{if(!this.hostElement.contains(s.target)){this.isFocused=false}};handlePopoverVisibilityChange(s){this.isPopoverVisibleInState=s;document.body.style.overflow=s?"hidden":"auto"}handleDocumentKeyDown=s=>{if(s.key===this.hotkey){this.handleHotkeyPressed(s)}if(!this.hostElement.contains(document.activeElement)){return}switch(s.key){case"ArrowDown":case"ArrowUp":s.preventDefault();this.focusOnNextListItem(s.key);break;case"Escape":r.getState().setPopoverVisibility(false);break;default:return}};handleInputInit=()=>{const s=this.hostElement.querySelector(".searchcraft-input");s?.focus()};handleInputFocus(){this.isFocused=true;if(this.type==="inline"&&window.visualViewport&&window.visualViewport.width<this.breakpointSm){r.getState().setPopoverVisibility(true);if(!this.modalElement){this.modalElement=document.createElement("searchcraft-popover-form");this.modalElement.config=this.config;this.modalElement.popoverResultMappings=this.popoverResultMappings;this.modalElement.setAttribute("type","fullscreen");document.body.appendChild(this.modalElement)}}}handleModalBackdropClick(s){r.getState().setPopoverVisibility(false)}handleHotkeyPressed(s){if(s.ctrlKey&&this.hotkeyModifier==="ctrl"||s.altKey&&this.hotkeyModifier==="alt"||s.metaKey&&this.hotkeyModifier==="meta"){s.preventDefault();if(this.type==="inline"&&!this.isPopoverVisibleInState){const s=this.hostElement.querySelector(".searchcraft-input");s?.focus()}else{r.getState().setPopoverVisibility(!this.isPopoverVisibleInState)}}}handleCancelButtonClick(){r.getState().setPopoverVisibility(false)}focusOnNextListItem(s){const e=Array.from(document.querySelectorAll("a.searchcraft-popover-list-item")).filter((s=>!s.hasAttribute("disabled")&&s.offsetParent!==null));const t=e.indexOf(document.activeElement);if(s==="ArrowDown"){e[(t+1)%e.length]?.focus()}else if(s==="ArrowUp"){if(t>=1){e[t-1]?.focus()}else{const s=document.querySelector(".searchcraft-input");if(s){s.focus();requestAnimationFrame((()=>{s.selectionEnd=s.value.length;s.selectionStart=s.value.length}))}}}}get hasResultsToShow(){return this.searchTerm&&this.searchTerm?.trim()?.length>0&&this.searchClientResponseItems.length>0}renderInlinePopover(){const s=this.hasResultsToShow&&this.isFocused;const e=i("searchcraft-popover-form searchcraft-popover-form-inline",{"searchcraft-popover-form-active":s});return t("div",{class:e},t("searchcraft-input-form",{config:this.config,onInputFocus:this.handleInputFocus.bind(this)}),s&&t("div",{class:"searchcraft-popover-inline-wrapper-outer"},t("div",{class:"searchcraft-popover-inline-wrapper-inner"},t("searchcraft-popover-list-view",{popoverResultMappings:this.popoverResultMappings,searchClientResponseItems:this.searchClientResponseItems,adClientResponseItems:this.adClientResponseItems,searchResultsPage:this.searchResultsPage,searchResultsPerPage:this.searchResultsPerPage}))))}renderModalPopover(){if(this.isPopoverVisibleInState){const s=i("searchcraft-popover-form",{"searchcraft-popover-form-active":this.hasResultsToShow});return t("div",{class:"searchcraft-popover-form-modal"},t("div",{class:"searchcraft-popover-form-modal-backdrop",onClick:this.handleModalBackdropClick}),t("div",{class:"searchcraft-popover-form-modal-inner"},t("div",{class:s},t("div",{class:"searchcraft-popover-form-input-wrapper"},t("searchcraft-input-form",{config:this.config,onInputFocus:this.handleInputFocus.bind(this),onInputInit:this.handleInputInit.bind(this)}),t("button",{type:"button",class:"searchcraft-popover-form-cancel-button",onClick:this.handleCancelButtonClick.bind(this)},"Cancel")),this.hasResultsToShow&&t("searchcraft-popover-list-view",{popoverResultMappings:this.popoverResultMappings,searchClientResponseItems:this.searchClientResponseItems,adClientResponseItems:this.adClientResponseItems,searchResultsPage:this.searchResultsPage,searchResultsPerPage:this.searchResultsPerPage}))))}}renderFullscreenPopover(){if(this.isPopoverVisibleInState){return t("div",{class:"searchcraft-popover-form-fullscreen"},t("div",{class:"searchcraft-popover-form"},t("div",{class:"searchcraft-popover-form-input-wrapper"},t("searchcraft-input-form",{config:this.config,onInputFocus:this.handleInputFocus.bind(this),onInputInit:this.handleInputInit.bind(this)}),t("button",{type:"button",class:"searchcraft-popover-form-cancel-button",onClick:this.handleCancelButtonClick.bind(this)},"Cancel")),this.hasResultsToShow&&t("searchcraft-popover-list-view",{popoverResultMappings:this.popoverResultMappings,searchClientResponseItems:this.searchClientResponseItems,adClientResponseItems:this.adClientResponseItems,searchResultsPage:this.searchResultsPage,searchResultsPerPage:this.searchResultsPerPage})))}}render(){switch(this.type){case"inline":return this.renderInlinePopover();case"modal":return this.renderModalPopover();case"fullscreen":return this.renderFullscreenPopover()}}};export{o as searchcraft_popover_form};
|
|
2
|
+
//# sourceMappingURL=p-2dc07b47.entry.js.map
|