@searchcraft/javascript-sdk 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +198 -0
- package/dist/cjs/{index-264ebadc.js → index-c8a8e492.js} +29 -3
- package/dist/cjs/index-c8a8e492.js.map +1 -0
- package/dist/cjs/index.cjs.js +4 -5
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{package-35d3b670.js → package-ccc7e307.js} +3 -3
- package/dist/cjs/package-ccc7e307.js.map +1 -0
- package/dist/cjs/searchcraft-auto-search-form.cjs.entry.js +160 -0
- package/dist/cjs/searchcraft-auto-search-form.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-base-search-form.cjs.entry.js +8 -11
- package/dist/cjs/searchcraft-base-search-form.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-base-search-result.cjs.entry.js +74 -0
- package/dist/cjs/searchcraft-base-search-result.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-base-search-results.cjs.entry.js +129 -0
- package/dist/cjs/searchcraft-base-search-results.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-button-icon.cjs.entry.js +1 -1
- package/dist/cjs/searchcraft-button.cjs.entry.js +3 -8
- package/dist/cjs/searchcraft-button.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-check-icon_2.cjs.entry.js +28 -0
- package/dist/cjs/searchcraft-check-icon_2.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-clear-icon-set.cjs.entry.js +30 -0
- package/dist/cjs/searchcraft-clear-icon-set.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-error-message_3.cjs.entry.js +95 -0
- package/dist/cjs/searchcraft-error-message_3.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-facet-list_3.cjs.entry.js +183 -0
- package/dist/cjs/searchcraft-facet-list_3.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-filter-panel.cjs.entry.js +134 -0
- package/dist/cjs/searchcraft-filter-panel.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-javascript-sdk.cjs.js +2 -2
- package/dist/cjs/searchcraft-results-info.cjs.entry.js +46 -0
- package/dist/cjs/searchcraft-results-info.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-search-icon-set.cjs.entry.js +33 -0
- package/dist/cjs/searchcraft-search-icon-set.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-spinner-dark.cjs.entry.js +3 -3
- package/dist/cjs/searchcraft-spinner-dark.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-spinner-light.cjs.entry.js +3 -3
- package/dist/cjs/searchcraft-spinner-light.cjs.entry.js.map +1 -1
- package/dist/{esm/store-b519dd0b.js → cjs/store-72205332.js} +139 -205
- package/dist/cjs/store-72205332.js.map +1 -0
- package/dist/cjs/utils-4ee2b88d.js +169 -0
- package/dist/cjs/utils-4ee2b88d.js.map +1 -0
- package/dist/collection/collection-manifest.json +2 -4
- package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.js +61 -95
- package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.js.map +1 -1
- package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.module.css +98 -9
- package/dist/collection/components/searchcraft-base-search-form/searchcraft-base-search-form.js +31 -16
- package/dist/collection/components/searchcraft-base-search-form/searchcraft-base-search-form.js.map +1 -1
- package/dist/collection/components/searchcraft-base-search-form/searchcraft-base-search-form.module.css +94 -8
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js +125 -153
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js.map +1 -1
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.module.css +139 -206
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js +138 -89
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js.map +1 -1
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.module.css +105 -23
- package/dist/collection/components/searchcraft-button/searchcraft-button.js +2 -8
- package/dist/collection/components/searchcraft-button/searchcraft-button.js.map +1 -1
- package/dist/collection/components/searchcraft-button/searchcraft-button.module.css +107 -36
- package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js +1 -22
- package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js.map +1 -1
- package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.module.css +101 -15
- package/dist/collection/components/searchcraft-facet-list/searchcraft-facet-list.js +140 -0
- package/dist/collection/components/searchcraft-facet-list/searchcraft-facet-list.js.map +1 -0
- package/dist/collection/components/searchcraft-facet-list/searchcraft-facet-list.module.css +216 -0
- package/dist/collection/components/searchcraft-filter-panel/searchcraft-filter-panel.js +166 -0
- package/dist/collection/components/searchcraft-filter-panel/searchcraft-filter-panel.js.map +1 -0
- package/dist/collection/components/searchcraft-filter-panel/searchcraft-filter-panel.module.css +118 -0
- package/dist/collection/components/searchcraft-input/searchcraft-input.js +36 -125
- package/dist/collection/components/searchcraft-input/searchcraft-input.js.map +1 -1
- package/dist/collection/components/searchcraft-input/searchcraft-input.module.css +158 -209
- package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js +1 -12
- package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js.map +1 -1
- package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.module.css +102 -14
- package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.js +1 -2
- package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.js.map +1 -1
- package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.module.css +103 -9
- package/dist/collection/components/searchcraft-slider/searchcraft-slider.js +79 -62
- package/dist/collection/components/searchcraft-slider/searchcraft-slider.js.map +1 -1
- package/dist/collection/components/searchcraft-slider/searchcraft-slider.module.css +106 -7
- package/dist/collection/components/searchcraft-spinner-dark/searchcraft-spinner-dark.js +1 -1
- package/dist/collection/components/searchcraft-spinner-dark/searchcraft-spinner-dark.module.css +103 -4
- package/dist/collection/components/searchcraft-spinner-light/searchcraft-spinner-light.js +1 -1
- package/dist/collection/components/searchcraft-spinner-light/searchcraft-spinner-light.module.css +102 -3
- package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.js +50 -65
- package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.js.map +1 -1
- package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.module.css +135 -9
- package/dist/collection/index.js +2 -1
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/provider/store.js +45 -31
- package/dist/collection/provider/store.js.map +1 -1
- package/dist/collection/types/index.js +3 -0
- package/dist/collection/types/index.js.map +1 -0
- package/dist/collection/types/searchcraft-base-search-results.types.js +2 -0
- package/dist/collection/types/searchcraft-base-search-results.types.js.map +1 -0
- package/dist/collection/types/searchcraft-filter-panel.types.js +2 -0
- package/dist/collection/types/searchcraft-filter-panel.types.js.map +1 -0
- package/dist/collection/utils/utils.js +114 -35
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/index.js +7 -11
- package/dist/components/index.js.map +1 -1
- package/dist/components/{p-bbf9973a.js → p-04d13314.js} +2 -2
- package/dist/components/{p-bbf9973a.js.map → p-04d13314.js.map} +1 -1
- package/dist/components/p-0deddac7.js +161 -0
- package/dist/components/p-0deddac7.js.map +1 -0
- package/dist/components/p-37f54c0b.js +54 -0
- package/dist/components/p-37f54c0b.js.map +1 -0
- package/dist/components/{p-6b353c3e.js → p-5639be85.js} +23 -3
- package/dist/components/p-5639be85.js.map +1 -0
- package/dist/components/p-68897c11.js +124 -0
- package/dist/components/p-68897c11.js.map +1 -0
- package/dist/components/{p-b0c1fd63.js → p-69eed21e.js} +3 -3
- package/dist/components/p-69eed21e.js.map +1 -0
- package/dist/components/p-8062f0ea.js +82 -0
- package/dist/components/p-8062f0ea.js.map +1 -0
- package/dist/components/p-9f2b8375.js +33 -0
- package/dist/components/p-9f2b8375.js.map +1 -0
- package/dist/components/p-ace4e6a0.js +35 -0
- package/dist/components/p-ace4e6a0.js.map +1 -0
- package/dist/components/p-b1a59f07.js +101 -0
- package/dist/components/p-b1a59f07.js.map +1 -0
- package/dist/components/{p-727bfc38.js → p-be63dcac.js} +126 -110
- package/dist/components/p-be63dcac.js.map +1 -0
- package/dist/components/p-c8bc1e4f.js +40 -0
- package/dist/components/p-c8bc1e4f.js.map +1 -0
- package/dist/components/{p-aad03c2a.js → p-de50441f.js} +2 -2
- package/dist/components/{p-aad03c2a.js.map → p-de50441f.js.map} +1 -1
- package/dist/components/p-e3c8b1ef.js +91 -0
- package/dist/components/p-e3c8b1ef.js.map +1 -0
- package/dist/components/p-ebf021b5.js +49 -0
- package/dist/components/p-ebf021b5.js.map +1 -0
- package/dist/components/searchcraft-auto-search-form.js +64 -74
- package/dist/components/searchcraft-auto-search-form.js.map +1 -1
- package/dist/components/searchcraft-base-search-form.js +20 -52
- package/dist/components/searchcraft-base-search-form.js.map +1 -1
- package/dist/components/searchcraft-base-search-result.js +1 -1
- package/dist/components/searchcraft-base-search-results.js +75 -53
- package/dist/components/searchcraft-base-search-results.js.map +1 -1
- package/dist/components/searchcraft-button-icon.js +1 -1
- package/dist/components/searchcraft-button.js +1 -1
- package/dist/components/searchcraft-check-icon.js +1 -1
- package/dist/components/searchcraft-clear-icon-set.js +39 -1
- package/dist/components/searchcraft-clear-icon-set.js.map +1 -1
- package/dist/components/searchcraft-dash-icon.js +1 -1
- package/dist/components/searchcraft-error-message.js +1 -1
- package/dist/components/searchcraft-facet-list.d.ts +11 -0
- package/dist/components/searchcraft-facet-list.js +8 -0
- package/dist/components/searchcraft-facet-list.js.map +1 -0
- package/dist/components/searchcraft-filter-panel.d.ts +11 -0
- package/dist/components/searchcraft-filter-panel.js +184 -0
- package/dist/components/searchcraft-filter-panel.js.map +1 -0
- package/dist/components/searchcraft-input-label.js +1 -1
- package/dist/components/searchcraft-input.js +1 -1
- package/dist/components/searchcraft-results-info.js +5 -6
- package/dist/components/searchcraft-results-info.js.map +1 -1
- package/dist/components/searchcraft-search-icon-set.js +44 -1
- package/dist/components/searchcraft-search-icon-set.js.map +1 -1
- package/dist/components/searchcraft-slider.js +1 -104
- package/dist/components/searchcraft-slider.js.map +1 -1
- package/dist/components/searchcraft-spinner-dark.js +1 -1
- package/dist/components/searchcraft-spinner-light.js +3 -3
- package/dist/components/searchcraft-spinner-light.js.map +1 -1
- package/dist/components/searchcraft-toggle-button.js +1 -93
- package/dist/components/searchcraft-toggle-button.js.map +1 -1
- package/dist/esm/{index-d851fb46.js → index-88dc5f88.js} +29 -3
- package/dist/esm/index-88dc5f88.js.map +1 -0
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{package-82baadd7.js → package-ee16f835.js} +3 -3
- package/dist/esm/package-ee16f835.js.map +1 -0
- package/dist/esm/searchcraft-auto-search-form.entry.js +156 -0
- package/dist/esm/searchcraft-auto-search-form.entry.js.map +1 -0
- package/dist/esm/searchcraft-base-search-form.entry.js +8 -11
- package/dist/esm/searchcraft-base-search-form.entry.js.map +1 -1
- package/dist/esm/searchcraft-base-search-result.entry.js +70 -0
- package/dist/esm/searchcraft-base-search-result.entry.js.map +1 -0
- package/dist/esm/searchcraft-base-search-results.entry.js +125 -0
- package/dist/esm/searchcraft-base-search-results.entry.js.map +1 -0
- package/dist/esm/searchcraft-button-icon.entry.js +1 -1
- package/dist/esm/searchcraft-button.entry.js +3 -8
- package/dist/esm/searchcraft-button.entry.js.map +1 -1
- package/dist/esm/searchcraft-check-icon_2.entry.js +23 -0
- package/dist/esm/searchcraft-check-icon_2.entry.js.map +1 -0
- package/dist/{components/p-62e6b69c.js → esm/searchcraft-clear-icon-set.entry.js} +7 -24
- package/dist/esm/searchcraft-clear-icon-set.entry.js.map +1 -0
- package/dist/esm/searchcraft-error-message_3.entry.js +89 -0
- package/dist/esm/searchcraft-error-message_3.entry.js.map +1 -0
- package/dist/esm/searchcraft-facet-list_3.entry.js +177 -0
- package/dist/esm/searchcraft-facet-list_3.entry.js.map +1 -0
- package/dist/esm/searchcraft-filter-panel.entry.js +130 -0
- package/dist/esm/searchcraft-filter-panel.entry.js.map +1 -0
- package/dist/esm/searchcraft-javascript-sdk.js +3 -3
- package/dist/esm/searchcraft-results-info.entry.js +42 -0
- package/dist/esm/searchcraft-results-info.entry.js.map +1 -0
- package/dist/{components/p-5a872bdf.js → esm/searchcraft-search-icon-set.entry.js} +7 -26
- package/dist/esm/searchcraft-search-icon-set.entry.js.map +1 -0
- package/dist/esm/searchcraft-spinner-dark.entry.js +3 -3
- package/dist/esm/searchcraft-spinner-dark.entry.js.map +1 -1
- package/dist/esm/searchcraft-spinner-light.entry.js +3 -3
- package/dist/esm/searchcraft-spinner-light.entry.js.map +1 -1
- package/dist/{cjs/store-e3bbdd49.js → esm/store-52436995.js} +136 -217
- package/dist/esm/store-52436995.js.map +1 -0
- package/dist/esm/utils-89a02921.js +161 -0
- package/dist/esm/utils-89a02921.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/index.esm.js +1 -1
- package/dist/searchcraft-javascript-sdk/p-08bd95f1.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-08bd95f1.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-0deddac7.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-0deddac7.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-15f9891d.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-15f9891d.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-2419a8c5.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-2419a8c5.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-343adbe3.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-343adbe3.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-3a2d9be9.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-3a2d9be9.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-4278ff89.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-4278ff89.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-4c32c87d.js +3 -0
- package/dist/searchcraft-javascript-sdk/p-4c32c87d.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-56413bef.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-56413bef.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-69eed21e.js +2 -0
- package/dist/searchcraft-javascript-sdk/{p-99356c9a.entry.js → p-69f64bdd.entry.js} +2 -2
- package/dist/searchcraft-javascript-sdk/p-7c59b3cd.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-7c59b3cd.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-93e9de71.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-93e9de71.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-9647ae41.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-9647ae41.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-a613a6ba.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-a613a6ba.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-acc645c7.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-acc645c7.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-bb03e946.js +11 -0
- package/dist/searchcraft-javascript-sdk/p-bb03e946.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-bf80bbee.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-bf80bbee.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-f4612b94.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-f4612b94.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-auto-search-form/searchcraft-auto-search-form.d.ts +6 -6
- package/dist/types/components/searchcraft-base-search-form/searchcraft-base-search-form.d.ts +3 -2
- package/dist/types/components/searchcraft-base-search-result/searchcraft-base-search-result.d.ts +16 -18
- package/dist/types/components/searchcraft-base-search-results/searchcraft-base-search-results.d.ts +15 -6
- package/dist/types/components/searchcraft-button/searchcraft-button.d.ts +0 -2
- package/dist/types/components/searchcraft-error-message/searchcraft-error-message.d.ts +0 -1
- package/dist/types/components/searchcraft-facet-list/searchcraft-facet-list.d.ts +21 -0
- package/dist/types/components/searchcraft-filter-panel/searchcraft-filter-panel.d.ts +25 -0
- package/dist/types/components/searchcraft-input/searchcraft-input.d.ts +4 -10
- package/dist/types/components/searchcraft-input-label/searchcraft-input-label.d.ts +0 -2
- package/dist/types/components/searchcraft-slider/searchcraft-slider.d.ts +11 -12
- package/dist/types/components/searchcraft-toggle-button/searchcraft-toggle-button.d.ts +4 -9
- package/dist/types/components.d.ts +123 -185
- package/dist/types/index.d.ts +2 -1
- package/dist/types/provider/store.d.ts +15 -9
- package/dist/types/types/index.d.ts +2 -0
- package/dist/types/types/searchcraft-base-search-results.types.d.ts +17 -0
- package/dist/types/types/searchcraft-filter-panel.types.d.ts +42 -0
- package/dist/types/utils/utils.d.ts +23 -15
- package/package.json +2 -2
- package/dist/cjs/index-264ebadc.js.map +0 -1
- package/dist/cjs/package-35d3b670.js.map +0 -1
- package/dist/cjs/searchcraft-auto-search-form_17.cjs.entry.js +0 -867
- package/dist/cjs/searchcraft-auto-search-form_17.cjs.entry.js.map +0 -1
- package/dist/cjs/store-e3bbdd49.js.map +0 -1
- package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.js +0 -94
- package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.js.map +0 -1
- package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.module.css +0 -33
- package/dist/collection/components/searchcraft-filters-list/searchcraft-filters-list.js +0 -168
- package/dist/collection/components/searchcraft-filters-list/searchcraft-filters-list.js.map +0 -1
- package/dist/collection/components/searchcraft-filters-list/searchcraft-filters-list.module.css +0 -111
- package/dist/collection/components/searchcraft-input-caption/searchcraft-input-caption.js +0 -121
- package/dist/collection/components/searchcraft-input-caption/searchcraft-input-caption.js.map +0 -1
- package/dist/collection/components/searchcraft-input-caption/searchcraft-input-caption.module.css +0 -79
- package/dist/collection/components/searchcraft-input-icon/searchcraft-input-icon.js +0 -109
- package/dist/collection/components/searchcraft-input-icon/searchcraft-input-icon.js.map +0 -1
- package/dist/collection/components/searchcraft-input-icon/searchcraft-input-icon.module.css +0 -17
- package/dist/components/p-4f939ba2.js +0 -53
- package/dist/components/p-4f939ba2.js.map +0 -1
- package/dist/components/p-5015a359.js +0 -39
- package/dist/components/p-5015a359.js.map +0 -1
- package/dist/components/p-54848b4d.js +0 -136
- package/dist/components/p-54848b4d.js.map +0 -1
- package/dist/components/p-5a872bdf.js.map +0 -1
- package/dist/components/p-62c40862.js +0 -91
- package/dist/components/p-62c40862.js.map +0 -1
- package/dist/components/p-62e6b69c.js.map +0 -1
- package/dist/components/p-69ee3b9a.js +0 -59
- package/dist/components/p-69ee3b9a.js.map +0 -1
- package/dist/components/p-6b353c3e.js.map +0 -1
- package/dist/components/p-727bfc38.js.map +0 -1
- package/dist/components/p-7c280820.js +0 -33
- package/dist/components/p-7c280820.js.map +0 -1
- package/dist/components/p-7d385ffb.js +0 -60
- package/dist/components/p-7d385ffb.js.map +0 -1
- package/dist/components/p-8524c749.js +0 -54
- package/dist/components/p-8524c749.js.map +0 -1
- package/dist/components/p-b0c1fd63.js.map +0 -1
- package/dist/components/p-b38d171d.js +0 -47
- package/dist/components/p-b38d171d.js.map +0 -1
- package/dist/components/p-cd9a038a.js +0 -105
- package/dist/components/p-cd9a038a.js.map +0 -1
- package/dist/components/searchcraft-clear-input-button.d.ts +0 -11
- package/dist/components/searchcraft-clear-input-button.js +0 -8
- package/dist/components/searchcraft-clear-input-button.js.map +0 -1
- package/dist/components/searchcraft-filters-list.d.ts +0 -11
- package/dist/components/searchcraft-filters-list.js +0 -151
- package/dist/components/searchcraft-filters-list.js.map +0 -1
- package/dist/components/searchcraft-input-caption.d.ts +0 -11
- package/dist/components/searchcraft-input-caption.js +0 -8
- package/dist/components/searchcraft-input-caption.js.map +0 -1
- package/dist/components/searchcraft-input-icon.d.ts +0 -11
- package/dist/components/searchcraft-input-icon.js +0 -8
- package/dist/components/searchcraft-input-icon.js.map +0 -1
- package/dist/esm/index-d851fb46.js.map +0 -1
- package/dist/esm/package-82baadd7.js.map +0 -1
- package/dist/esm/searchcraft-auto-search-form_17.entry.js +0 -847
- package/dist/esm/searchcraft-auto-search-form_17.entry.js.map +0 -1
- package/dist/esm/store-b519dd0b.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-1f3ae7f3.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-1f3ae7f3.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-201cb2dc.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-201cb2dc.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-2c220368.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-2c220368.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-39c0ca33.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-39c0ca33.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-476829a4.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-476829a4.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-b0c1fd63.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-b42eaa55.js +0 -3
- package/dist/searchcraft-javascript-sdk/p-b42eaa55.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-d5f8dda2.js +0 -11
- package/dist/searchcraft-javascript-sdk/p-d5f8dda2.js.map +0 -1
- package/dist/types/components/searchcraft-clear-input-button/searchcraft-clear-input-button.d.ts +0 -10
- package/dist/types/components/searchcraft-filters-list/searchcraft-filters-list.d.ts +0 -34
- package/dist/types/components/searchcraft-input-caption/searchcraft-input-caption.d.ts +0 -9
- package/dist/types/components/searchcraft-input-icon/searchcraft-input-icon.d.ts +0 -9
- package/readme.md +0 -11
- /package/dist/searchcraft-javascript-sdk/{p-b0c1fd63.js.map → p-69eed21e.js.map} +0 -0
- /package/dist/searchcraft-javascript-sdk/{p-99356c9a.entry.js.map → p-69f64bdd.entry.js.map} +0 -0
|
@@ -1,93 +1,3 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
function parseCustomStyles(styles) {
|
|
4
|
-
if (typeof styles === 'string') {
|
|
5
|
-
try {
|
|
6
|
-
return JSON.parse(styles);
|
|
7
|
-
}
|
|
8
|
-
catch (error) {
|
|
9
|
-
console.error('Invalid customStyles format:', styles);
|
|
10
|
-
return {};
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
return styles || {};
|
|
14
|
-
}
|
|
15
|
-
function parseSearchKeys(documentAttributesForDisplay) {
|
|
16
|
-
try {
|
|
17
|
-
const parsedKeys = JSON.parse(documentAttributesForDisplay);
|
|
18
|
-
if (Array.isArray(parsedKeys) &&
|
|
19
|
-
parsedKeys.every((key) => typeof key === 'string')) {
|
|
20
|
-
return parsedKeys;
|
|
21
|
-
}
|
|
22
|
-
console.warn('searchKeys must be a JSON array of strings. Defaulting to an empty array.');
|
|
23
|
-
return [];
|
|
24
|
-
}
|
|
25
|
-
catch (error) {
|
|
26
|
-
console.error('Failed to parse searchKeys:', error);
|
|
27
|
-
return [];
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
function extractDynamicProperties(document, keys) {
|
|
31
|
-
const extractedProperties = {};
|
|
32
|
-
keys.forEach((key) => {
|
|
33
|
-
extractedProperties[key] = document[key] || '';
|
|
34
|
-
});
|
|
35
|
-
return extractedProperties;
|
|
36
|
-
}
|
|
37
|
-
function serializeStyles(styles) {
|
|
38
|
-
try {
|
|
39
|
-
return JSON.stringify(styles);
|
|
40
|
-
}
|
|
41
|
-
catch (error) {
|
|
42
|
-
console.error('Error serializing styles:', error);
|
|
43
|
-
return '{}';
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
function getFormattedTimeFromNow(timestamp) {
|
|
47
|
-
const now = new Date();
|
|
48
|
-
const inputTime = new Date(timestamp);
|
|
49
|
-
const diffInSeconds = Math.floor((now.getTime() - inputTime.getTime()) / 1000);
|
|
50
|
-
const minutes = Math.floor(diffInSeconds / 60);
|
|
51
|
-
const hours = Math.floor(minutes / 60);
|
|
52
|
-
const days = Math.floor(hours / 24);
|
|
53
|
-
const years = Math.floor(days / 365);
|
|
54
|
-
if (minutes < 60) {
|
|
55
|
-
return `${minutes}m ago`;
|
|
56
|
-
}
|
|
57
|
-
if (hours < 24) {
|
|
58
|
-
return `${hours}h ago`;
|
|
59
|
-
}
|
|
60
|
-
if (days < 365) {
|
|
61
|
-
return `${days}d ago`;
|
|
62
|
-
}
|
|
63
|
-
return `${years}y ago`;
|
|
64
|
-
}
|
|
65
|
-
function flattenFacets(sections) {
|
|
66
|
-
return sections.map((section) => {
|
|
67
|
-
const fullPath = section.path;
|
|
68
|
-
// Create the FacetCheckbox object
|
|
69
|
-
const facetCheckbox = {
|
|
70
|
-
label: fullPath.replace(/^\//, ''), // Format the label without leading slash
|
|
71
|
-
value: fullPath, // The full path as the value
|
|
72
|
-
count: section.count, // Count from the Section
|
|
73
|
-
children: flattenFacets(section.children || []), // Recursively flatten children
|
|
74
|
-
};
|
|
75
|
-
return facetCheckbox;
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
function filterPaths(paths) {
|
|
79
|
-
return paths.filter((path) => {
|
|
80
|
-
const parts = path.split('/').filter(Boolean);
|
|
81
|
-
if (parts.length > 1) {
|
|
82
|
-
return true;
|
|
83
|
-
}
|
|
84
|
-
return !paths.some((otherPath) => otherPath.startsWith(`${path}/`) && otherPath !== path);
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
function formatNumberWithCommas(number) {
|
|
88
|
-
return number.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
89
|
-
}
|
|
90
|
-
|
|
91
1
|
var zustand = {};
|
|
92
2
|
|
|
93
3
|
var vanilla$1 = {};
|
|
@@ -132,23 +42,23 @@ var react_production_min = {};
|
|
|
132
42
|
* This source code is licensed under the MIT license found in the
|
|
133
43
|
* LICENSE file in the root directory of this source tree.
|
|
134
44
|
*/
|
|
135
|
-
var l$1=Symbol.for("react.element"),n=Symbol.for("react.portal"),p$1=Symbol.for("react.fragment"),q$1=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),t=Symbol.for("react.provider"),u=Symbol.for("react.context"),v$1=Symbol.for("react.forward_ref"),w$1=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),y$1=Symbol.for("react.lazy"),z$1=Symbol.iterator;function A$1(a){if(null===a||"object"!==typeof a)return null;a=z$1&&a[z$1]||a["@@iterator"];return "function"===typeof a?a:null}
|
|
136
|
-
var B$1={isMounted:function(){return !1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C$1=Object.assign,D={};function E$1(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B$1;}E$1.prototype.isReactComponent={};
|
|
137
|
-
E$1.prototype.setState=function(a,b){if("object"!==typeof a&&"function"!==typeof a&&null!=a)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,a,b,"setState");};E$1.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate");};function F$1(){}F$1.prototype=E$1.prototype;function G$1(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B$1;}var H$1=G$1.prototype=new F$1;
|
|
138
|
-
H$1.constructor=G$1;C$1(H$1,E$1.prototype);H$1.isPureReactComponent=!0;var I
|
|
45
|
+
var l$1=Symbol.for("react.element"),n=Symbol.for("react.portal"),p$1=Symbol.for("react.fragment"),q$1=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),t=Symbol.for("react.provider"),u=Symbol.for("react.context"),v$1=Symbol.for("react.forward_ref"),w$1=Symbol.for("react.suspense"),x$1=Symbol.for("react.memo"),y$1=Symbol.for("react.lazy"),z$1=Symbol.iterator;function A$1(a){if(null===a||"object"!==typeof a)return null;a=z$1&&a[z$1]||a["@@iterator"];return "function"===typeof a?a:null}
|
|
46
|
+
var B$1={isMounted:function(){return !1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C$1=Object.assign,D$1={};function E$1(a,b,e){this.props=a;this.context=b;this.refs=D$1;this.updater=e||B$1;}E$1.prototype.isReactComponent={};
|
|
47
|
+
E$1.prototype.setState=function(a,b){if("object"!==typeof a&&"function"!==typeof a&&null!=a)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,a,b,"setState");};E$1.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate");};function F$1(){}F$1.prototype=E$1.prototype;function G$1(a,b,e){this.props=a;this.context=b;this.refs=D$1;this.updater=e||B$1;}var H$1=G$1.prototype=new F$1;
|
|
48
|
+
H$1.constructor=G$1;C$1(H$1,E$1.prototype);H$1.isPureReactComponent=!0;var I=Array.isArray,J$1=Object.prototype.hasOwnProperty,K$1={current:null},L$1={key:!0,ref:!0,__self:!0,__source:!0};
|
|
139
49
|
function M$1(a,b,e){var d,c={},k=null,h=null;if(null!=b)for(d in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=""+b.key),b)J$1.call(b,d)&&!L$1.hasOwnProperty(d)&&(c[d]=b[d]);var g=arguments.length-2;if(1===g)c.children=e;else if(1<g){for(var f=Array(g),m=0;m<g;m++)f[m]=arguments[m+2];c.children=f;}if(a&&a.defaultProps)for(d in g=a.defaultProps,g)void 0===c[d]&&(c[d]=g[d]);return {$$typeof:l$1,type:a,key:k,ref:h,props:c,_owner:K$1.current}}
|
|
140
50
|
function N$1(a,b){return {$$typeof:l$1,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function O$1(a){return "object"===typeof a&&null!==a&&a.$$typeof===l$1}function escape(a){var b={"=":"=0",":":"=2"};return "$"+a.replace(/[=:]/g,function(a){return b[a]})}var P$1=/\/+/g;function Q$1(a,b){return "object"===typeof a&&null!==a&&null!=a.key?escape(""+a.key):b.toString(36)}
|
|
141
|
-
function R(a,b,e,d,c){var k=typeof a;if("undefined"===k||"boolean"===k)a=null;var h=!1;if(null===a)h=!0;else switch(k){case "string":case "number":h=!0;break;case "object":switch(a.$$typeof){case l$1:case n:h=!0;}}if(h)return h=a,c=c(h),a=""===d?"."+Q$1(h,0):d,I
|
|
51
|
+
function R(a,b,e,d,c){var k=typeof a;if("undefined"===k||"boolean"===k)a=null;var h=!1;if(null===a)h=!0;else switch(k){case "string":case "number":h=!0;break;case "object":switch(a.$$typeof){case l$1:case n:h=!0;}}if(h)return h=a,c=c(h),a=""===d?"."+Q$1(h,0):d,I(c)?(e="",null!=a&&(e=a.replace(P$1,"$&/")+"/"),R(c,b,e,"",function(a){return a})):null!=c&&(O$1(c)&&(c=N$1(c,e+(!c.key||h&&h.key===c.key?"":(""+c.key).replace(P$1,"$&/")+"/")+a)),b.push(c)),1;h=0;d=""===d?".":d+":";if(I(a))for(var g=0;g<a.length;g++){k=
|
|
142
52
|
a[g];var f=d+Q$1(k,g);h+=R(k,b,e,f,c);}else if(f=A$1(a),"function"===typeof f)for(a=f.call(a),g=0;!(k=a.next()).done;)k=k.value,f=d+Q$1(k,g++),h+=R(k,b,e,f,c);else if("object"===k)throw b=String(a),Error("Objects are not valid as a React child (found: "+("[object Object]"===b?"object with keys {"+Object.keys(a).join(", ")+"}":b)+"). If you meant to render a collection of children, use an array instead.");return h}
|
|
143
53
|
function S$1(a,b,e){if(null==a)return a;var d=[],c=0;R(a,d,"","",function(a){return b.call(e,a,c++)});return d}function T$1(a){if(-1===a._status){var b=a._result;b=b();b.then(function(b){if(0===a._status||-1===a._status)a._status=1,a._result=b;},function(b){if(0===a._status||-1===a._status)a._status=2,a._result=b;});-1===a._status&&(a._status=0,a._result=b);}if(1===a._status)return a._result.default;throw a._result;}
|
|
144
|
-
var U
|
|
54
|
+
var U={current:null},V$1={transition:null},W$1={ReactCurrentDispatcher:U,ReactCurrentBatchConfig:V$1,ReactCurrentOwner:K$1};function X$1(){throw Error("act(...) is not supported in production builds of React.");}
|
|
145
55
|
react_production_min.Children={map:S$1,forEach:function(a,b,e){S$1(a,function(){b.apply(this,arguments);},e);},count:function(a){var b=0;S$1(a,function(){b++;});return b},toArray:function(a){return S$1(a,function(a){return a})||[]},only:function(a){if(!O$1(a))throw Error("React.Children.only expected to receive a single React element child.");return a}};react_production_min.Component=E$1;react_production_min.Fragment=p$1;react_production_min.Profiler=r;react_production_min.PureComponent=G$1;react_production_min.StrictMode=q$1;react_production_min.Suspense=w$1;
|
|
146
56
|
react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W$1;react_production_min.act=X$1;
|
|
147
57
|
react_production_min.cloneElement=function(a,b,e){if(null===a||void 0===a)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+a+".");var d=C$1({},a.props),c=a.key,k=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,h=K$1.current);void 0!==b.key&&(c=""+b.key);if(a.type&&a.type.defaultProps)var g=a.type.defaultProps;for(f in b)J$1.call(b,f)&&!L$1.hasOwnProperty(f)&&(d[f]=void 0===b[f]&&void 0!==g?g[f]:b[f]);}var f=arguments.length-2;if(1===f)d.children=e;else if(1<f){g=Array(f);
|
|
148
58
|
for(var m=0;m<f;m++)g[m]=arguments[m+2];d.children=g;}return {$$typeof:l$1,type:a.type,key:c,ref:k,props:d,_owner:h}};react_production_min.createContext=function(a){a={$$typeof:u,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};a.Provider={$$typeof:t,_context:a};return a.Consumer=a};react_production_min.createElement=M$1;react_production_min.createFactory=function(a){var b=M$1.bind(null,a);b.type=a;return b};react_production_min.createRef=function(){return {current:null}};
|
|
149
|
-
react_production_min.forwardRef=function(a){return {$$typeof:v$1,render:a}};react_production_min.isValidElement=O$1;react_production_min.lazy=function(a){return {$$typeof:y$1,_payload:{_status:-1,_result:a},_init:T$1}};react_production_min.memo=function(a,b){return {$$typeof:x,type:a,compare:void 0===b?null:b}};react_production_min.startTransition=function(a){var b=V$1.transition;V$1.transition={};try{a();}finally{V$1.transition=b;}};react_production_min.unstable_act=X$1;react_production_min.useCallback=function(a,b){return U
|
|
150
|
-
react_production_min.useDebugValue=function(){};react_production_min.useDeferredValue=function(a){return U
|
|
151
|
-
react_production_min.useMemo=function(a,b){return U
|
|
59
|
+
react_production_min.forwardRef=function(a){return {$$typeof:v$1,render:a}};react_production_min.isValidElement=O$1;react_production_min.lazy=function(a){return {$$typeof:y$1,_payload:{_status:-1,_result:a},_init:T$1}};react_production_min.memo=function(a,b){return {$$typeof:x$1,type:a,compare:void 0===b?null:b}};react_production_min.startTransition=function(a){var b=V$1.transition;V$1.transition={};try{a();}finally{V$1.transition=b;}};react_production_min.unstable_act=X$1;react_production_min.useCallback=function(a,b){return U.current.useCallback(a,b)};react_production_min.useContext=function(a){return U.current.useContext(a)};
|
|
60
|
+
react_production_min.useDebugValue=function(){};react_production_min.useDeferredValue=function(a){return U.current.useDeferredValue(a)};react_production_min.useEffect=function(a,b){return U.current.useEffect(a,b)};react_production_min.useId=function(){return U.current.useId()};react_production_min.useImperativeHandle=function(a,b,e){return U.current.useImperativeHandle(a,b,e)};react_production_min.useInsertionEffect=function(a,b){return U.current.useInsertionEffect(a,b)};react_production_min.useLayoutEffect=function(a,b){return U.current.useLayoutEffect(a,b)};
|
|
61
|
+
react_production_min.useMemo=function(a,b){return U.current.useMemo(a,b)};react_production_min.useReducer=function(a,b,e){return U.current.useReducer(a,b,e)};react_production_min.useRef=function(a){return U.current.useRef(a)};react_production_min.useState=function(a){return U.current.useState(a)};react_production_min.useSyncExternalStore=function(a,b,e){return U.current.useSyncExternalStore(a,b,e)};react_production_min.useTransition=function(){return U.current.useTransition()};react_production_min.version="18.3.1";
|
|
152
62
|
|
|
153
63
|
{
|
|
154
64
|
react.exports = react_production_min;
|
|
@@ -199,8 +109,8 @@ Object.keys(react).forEach(function (k) {
|
|
|
199
109
|
});
|
|
200
110
|
}(zustand));
|
|
201
111
|
|
|
202
|
-
var
|
|
203
|
-
var B = (n, t, r) => t in n ?
|
|
112
|
+
var D = Object.defineProperty;
|
|
113
|
+
var B = (n, t, r) => t in n ? D(n, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : n[t] = r;
|
|
204
114
|
var p = (n, t, r) => B(n, typeof t != "symbol" ? t + "" : t, r);
|
|
205
115
|
const L = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
206
116
|
let N = (n = 21) => {
|
|
@@ -227,8 +137,8 @@ function w(n, t, r, o) {
|
|
|
227
137
|
}
|
|
228
138
|
function d(u) {
|
|
229
139
|
var a;
|
|
230
|
-
u.done ? s(u.value) : (a = u.value, a instanceof r ? a : new r(function(
|
|
231
|
-
|
|
140
|
+
u.done ? s(u.value) : (a = u.value, a instanceof r ? a : new r(function(g) {
|
|
141
|
+
g(a);
|
|
232
142
|
})).then(e, c);
|
|
233
143
|
}
|
|
234
144
|
d((o = o.apply(n, [])).next());
|
|
@@ -282,8 +192,8 @@ function y(n, t) {
|
|
|
282
192
|
continue;
|
|
283
193
|
}
|
|
284
194
|
a = t.call(n, e);
|
|
285
|
-
} catch (
|
|
286
|
-
a = [6,
|
|
195
|
+
} catch (g) {
|
|
196
|
+
a = [6, g], o = 0;
|
|
287
197
|
} finally {
|
|
288
198
|
r = s = 0;
|
|
289
199
|
}
|
|
@@ -303,21 +213,21 @@ var b = { exclude: [] }, T = {}, j = { timeout: "true" }, v = function(n, t) {
|
|
|
303
213
|
return [n[0], (0, n[1])()];
|
|
304
214
|
}));
|
|
305
215
|
};
|
|
306
|
-
function
|
|
216
|
+
function M(n) {
|
|
307
217
|
return n ^= n >>> 16, n = Math.imul(n, 2246822507), n ^= n >>> 13, n = Math.imul(n, 3266489909), (n ^= n >>> 16) >>> 0;
|
|
308
218
|
}
|
|
309
219
|
var f = new Uint32Array([597399067, 2869860233, 951274213, 2716044179]);
|
|
310
|
-
function
|
|
220
|
+
function m(n, t) {
|
|
311
221
|
return n << t | n >>> 32 - t;
|
|
312
222
|
}
|
|
313
|
-
function
|
|
223
|
+
function x(n, t) {
|
|
314
224
|
var r;
|
|
315
225
|
if (t === void 0 && (t = 0), t = t ? 0 | t : 0, typeof n == "string" && (r = n, n = new TextEncoder().encode(r).buffer), !(n instanceof ArrayBuffer)) throw new TypeError("Expected key to be ArrayBuffer or string");
|
|
316
226
|
var o = new Uint32Array([t, t, t, t]);
|
|
317
227
|
((function(i, e) {
|
|
318
228
|
for (var c = i.byteLength / 16 | 0, d = new Uint32Array(i, 0, 4 * c), u = 0; u < c; u++) {
|
|
319
229
|
var a = d.subarray(4 * u, 4 * (u + 1));
|
|
320
|
-
a[0] = Math.imul(a[0], f[0]), a[0] =
|
|
230
|
+
a[0] = Math.imul(a[0], f[0]), a[0] = m(a[0], 15), a[0] = Math.imul(a[0], f[1]), e[0] = e[0] ^ a[0], e[0] = m(e[0], 19), e[0] = e[0] + e[1], e[0] = Math.imul(e[0], 5) + 1444728091, a[1] = Math.imul(a[1], f[1]), a[1] = m(a[1], 16), a[1] = Math.imul(a[1], f[2]), e[1] = e[1] ^ a[1], e[1] = m(e[1], 17), e[1] = e[1] + e[2], e[1] = Math.imul(e[1], 5) + 197830471, a[2] = Math.imul(a[2], f[2]), a[2] = m(a[2], 17), a[2] = Math.imul(a[2], f[3]), e[2] = e[2] ^ a[2], e[2] = m(e[2], 15), e[2] = e[2] + e[3], e[2] = Math.imul(e[2], 5) + 2530024501, a[3] = Math.imul(a[3], f[3]), a[3] = m(a[3], 18), a[3] = Math.imul(a[3], f[0]), e[3] = e[3] ^ a[3], e[3] = m(e[3], 13), e[3] = e[3] + e[0], e[3] = Math.imul(e[3], 5) + 850148119;
|
|
321
231
|
}
|
|
322
232
|
}))(n, o), function(i, e) {
|
|
323
233
|
var c = i.byteLength / 16 | 0, d = i.byteLength % 16, u = new Uint32Array(4), a = new Uint8Array(i, 16 * c, d);
|
|
@@ -327,7 +237,7 @@ function I(n, t) {
|
|
|
327
237
|
case 14:
|
|
328
238
|
u[3] = u[3] ^ a[13] << 8;
|
|
329
239
|
case 13:
|
|
330
|
-
u[3] = u[3] ^ a[12] << 0, u[3] = Math.imul(u[3], f[3]), u[3] =
|
|
240
|
+
u[3] = u[3] ^ a[12] << 0, u[3] = Math.imul(u[3], f[3]), u[3] = m(u[3], 18), u[3] = Math.imul(u[3], f[0]), e[3] = e[3] ^ u[3];
|
|
331
241
|
case 12:
|
|
332
242
|
u[2] = u[2] ^ a[11] << 24;
|
|
333
243
|
case 11:
|
|
@@ -335,7 +245,7 @@ function I(n, t) {
|
|
|
335
245
|
case 10:
|
|
336
246
|
u[2] = u[2] ^ a[9] << 8;
|
|
337
247
|
case 9:
|
|
338
|
-
u[2] = u[2] ^ a[8] << 0, u[2] = Math.imul(u[2], f[2]), u[2] =
|
|
248
|
+
u[2] = u[2] ^ a[8] << 0, u[2] = Math.imul(u[2], f[2]), u[2] = m(u[2], 17), u[2] = Math.imul(u[2], f[3]), e[2] = e[2] ^ u[2];
|
|
339
249
|
case 8:
|
|
340
250
|
u[1] = u[1] ^ a[7] << 24;
|
|
341
251
|
case 7:
|
|
@@ -343,7 +253,7 @@ function I(n, t) {
|
|
|
343
253
|
case 6:
|
|
344
254
|
u[1] = u[1] ^ a[5] << 8;
|
|
345
255
|
case 5:
|
|
346
|
-
u[1] = u[1] ^ a[4] << 0, u[1] = Math.imul(u[1], f[1]), u[1] =
|
|
256
|
+
u[1] = u[1] ^ a[4] << 0, u[1] = Math.imul(u[1], f[1]), u[1] = m(u[1], 16), u[1] = Math.imul(u[1], f[2]), e[1] = e[1] ^ u[1];
|
|
347
257
|
case 4:
|
|
348
258
|
u[0] = u[0] ^ a[3] << 24;
|
|
349
259
|
case 3:
|
|
@@ -351,10 +261,10 @@ function I(n, t) {
|
|
|
351
261
|
case 2:
|
|
352
262
|
u[0] = u[0] ^ a[1] << 8;
|
|
353
263
|
case 1:
|
|
354
|
-
u[0] = u[0] ^ a[0] << 0, u[0] = Math.imul(u[0], f[0]), u[0] =
|
|
264
|
+
u[0] = u[0] ^ a[0] << 0, u[0] = Math.imul(u[0], f[0]), u[0] = m(u[0], 15), u[0] = Math.imul(u[0], f[1]), e[0] = e[0] ^ u[0];
|
|
355
265
|
}
|
|
356
266
|
}(n, o), function(i, e) {
|
|
357
|
-
e[0] = e[0] ^ i.byteLength, e[1] = e[1] ^ i.byteLength, e[2] = e[2] ^ i.byteLength, e[3] = e[3] ^ i.byteLength, e[0] = e[0] + e[1] | 0, e[0] = e[0] + e[2] | 0, e[0] = e[0] + e[3] | 0, e[1] = e[1] + e[0] | 0, e[2] = e[2] + e[0] | 0, e[3] = e[3] + e[0] | 0, e[0] =
|
|
267
|
+
e[0] = e[0] ^ i.byteLength, e[1] = e[1] ^ i.byteLength, e[2] = e[2] ^ i.byteLength, e[3] = e[3] ^ i.byteLength, e[0] = e[0] + e[1] | 0, e[0] = e[0] + e[2] | 0, e[0] = e[0] + e[3] | 0, e[1] = e[1] + e[0] | 0, e[2] = e[2] + e[0] | 0, e[3] = e[3] + e[0] | 0, e[0] = M(e[0]), e[1] = M(e[1]), e[2] = M(e[2]), e[3] = M(e[3]), e[0] = e[0] + e[1] | 0, e[0] = e[0] + e[2] | 0, e[0] = e[0] + e[3] | 0, e[1] = e[1] + e[0] | 0, e[2] = e[2] + e[0] | 0, e[3] = e[3] + e[0] | 0;
|
|
358
268
|
}(n, o);
|
|
359
269
|
var s = new Uint8Array(o.buffer);
|
|
360
270
|
return Array.from(s).map(function(i) {
|
|
@@ -385,7 +295,7 @@ function V() {
|
|
|
385
295
|
return e !== void 0;
|
|
386
296
|
}), s = {}, o.forEach(function(e, c) {
|
|
387
297
|
s[t[c]] = e;
|
|
388
|
-
}), [2,
|
|
298
|
+
}), [2, F(s, b.exclude || [])];
|
|
389
299
|
case 2:
|
|
390
300
|
throw i.sent();
|
|
391
301
|
case 3:
|
|
@@ -394,13 +304,13 @@ function V() {
|
|
|
394
304
|
});
|
|
395
305
|
});
|
|
396
306
|
}
|
|
397
|
-
function
|
|
307
|
+
function F(n, t) {
|
|
398
308
|
var r = {}, o = function(i) {
|
|
399
309
|
if (n.hasOwnProperty(i)) {
|
|
400
310
|
var e = n[i];
|
|
401
311
|
if (typeof e != "object" || Array.isArray(e)) t.includes(i) || (r[i] = e);
|
|
402
312
|
else {
|
|
403
|
-
var c =
|
|
313
|
+
var c = F(e, t.map(function(d) {
|
|
404
314
|
return d.startsWith(i + ".") ? d.slice(i.length + 1) : d;
|
|
405
315
|
}));
|
|
406
316
|
Object.keys(c).length > 0 && (r[i] = c);
|
|
@@ -410,7 +320,7 @@ function O(n, t) {
|
|
|
410
320
|
for (var s in n) o(s);
|
|
411
321
|
return r;
|
|
412
322
|
}
|
|
413
|
-
function
|
|
323
|
+
function H(n) {
|
|
414
324
|
return w(this, void 0, void 0, function() {
|
|
415
325
|
var t, r;
|
|
416
326
|
return y(this, function(o) {
|
|
@@ -418,7 +328,7 @@ function $(n) {
|
|
|
418
328
|
case 0:
|
|
419
329
|
return o.trys.push([0, 2, , 3]), [4, V()];
|
|
420
330
|
case 1:
|
|
421
|
-
return t = o.sent(), r =
|
|
331
|
+
return t = o.sent(), r = x(JSON.stringify(t)), [2, r.toString()];
|
|
422
332
|
case 2:
|
|
423
333
|
throw o.sent();
|
|
424
334
|
case 3:
|
|
@@ -427,11 +337,11 @@ function $(n) {
|
|
|
427
337
|
});
|
|
428
338
|
});
|
|
429
339
|
}
|
|
430
|
-
function
|
|
340
|
+
function $(n) {
|
|
431
341
|
for (var t = 0, r = 0; r < n.length; ++r) t += Math.abs(n[r]);
|
|
432
342
|
return t;
|
|
433
343
|
}
|
|
434
|
-
function
|
|
344
|
+
function _(n, t, r) {
|
|
435
345
|
for (var o = [], s = 0; s < n[0].data.length; s++) {
|
|
436
346
|
for (var i = [], e = 0; e < n.length; e++) i.push(n[e].data[s]);
|
|
437
347
|
o.push(K(i));
|
|
@@ -447,7 +357,7 @@ function K(n) {
|
|
|
447
357
|
for (var i in t) t[i] > t[s] && (s = parseInt(i, 10));
|
|
448
358
|
return s;
|
|
449
359
|
}
|
|
450
|
-
function
|
|
360
|
+
function E() {
|
|
451
361
|
if (typeof navigator > "u") return { name: "unknown", version: "unknown" };
|
|
452
362
|
for (var n = navigator.userAgent, t = { Edg: "Edge", OPR: "Opera" }, r = 0, o = [/(?<name>Edge|Edg)\/(?<version>\d+(?:\.\d+)?)/, /(?<name>(?:Chrome|Chromium|OPR|Opera|Vivaldi|Brave))\/(?<version>\d+(?:\.\d+)?)/, /(?<name>(?:Firefox|Waterfox|Iceweasel|IceCat))\/(?<version>\d+(?:\.\d+)?)/, /(?<name>Safari)\/(?<version>\d+(?:\.\d+)?)/, /(?<name>MSIE|Trident|IEMobile).+?(?<version>\d+(?:\.\d+)?)/, /(?<name>[A-Za-z]+)\/(?<version>\d+(?:\.\d+)?)/, /(?<name>SamsungBrowser)\/(?<version>\d+(?:\.\d+)?)/]; r < o.length; r++) {
|
|
453
363
|
var s = o[r], i = n.match(s);
|
|
@@ -464,7 +374,7 @@ v("audio", function() {
|
|
|
464
374
|
i.frequency.value = 1e3;
|
|
465
375
|
var e, c = o.createDynamicsCompressor();
|
|
466
376
|
c.threshold.value = -50, c.knee.value = 40, c.ratio.value = 12, c.attack.value = 0, c.release.value = 0.2, i.connect(c), c.connect(o.destination), i.start(), o.oncomplete = function(d) {
|
|
467
|
-
e = d.renderedBuffer.getChannelData(0), t({ sampleHash:
|
|
377
|
+
e = d.renderedBuffer.getChannelData(0), t({ sampleHash: $(e), oscillator: i.type, maxChannels: o.destination.maxChannelCount, channelCountMode: s.channelCountMode });
|
|
468
378
|
}, o.startRendering();
|
|
469
379
|
} catch (d) {
|
|
470
380
|
console.error("Error creating audio fingerprint:", d), r(d);
|
|
@@ -473,8 +383,8 @@ v("audio", function() {
|
|
|
473
383
|
});
|
|
474
384
|
});
|
|
475
385
|
});
|
|
476
|
-
var z =
|
|
477
|
-
|
|
386
|
+
var z = E().name !== "SamsungBrowser" ? 1 : 3, C = 280, k = 20;
|
|
387
|
+
E().name != "Firefox" && v("canvas", function() {
|
|
478
388
|
return document.createElement("canvas").getContext("2d"), new Promise(function(n) {
|
|
479
389
|
var t = Array.from({ length: z }, function() {
|
|
480
390
|
return function() {
|
|
@@ -489,11 +399,11 @@ M().name != "Firefox" && v("canvas", function() {
|
|
|
489
399
|
return e;
|
|
490
400
|
}();
|
|
491
401
|
});
|
|
492
|
-
n({ commonImageDataHash:
|
|
402
|
+
n({ commonImageDataHash: x(_(t, C, k).data.toString()).toString() });
|
|
493
403
|
});
|
|
494
404
|
});
|
|
495
405
|
var A, J = ["Arial", "Arial Black", "Arial Narrow", "Arial Rounded MT", "Arimo", "Archivo", "Barlow", "Bebas Neue", "Bitter", "Bookman", "Calibri", "Cabin", "Candara", "Century", "Century Gothic", "Comic Sans MS", "Constantia", "Courier", "Courier New", "Crimson Text", "DM Mono", "DM Sans", "DM Serif Display", "DM Serif Text", "Dosis", "Droid Sans", "Exo", "Fira Code", "Fira Sans", "Franklin Gothic Medium", "Garamond", "Geneva", "Georgia", "Gill Sans", "Helvetica", "Impact", "Inconsolata", "Indie Flower", "Inter", "Josefin Sans", "Karla", "Lato", "Lexend", "Lucida Bright", "Lucida Console", "Lucida Sans Unicode", "Manrope", "Merriweather", "Merriweather Sans", "Montserrat", "Myriad", "Noto Sans", "Nunito", "Nunito Sans", "Open Sans", "Optima", "Orbitron", "Oswald", "Pacifico", "Palatino", "Perpetua", "PT Sans", "PT Serif", "Poppins", "Prompt", "Public Sans", "Quicksand", "Rajdhani", "Recursive", "Roboto", "Roboto Condensed", "Rockwell", "Rubik", "Segoe Print", "Segoe Script", "Segoe UI", "Sora", "Source Sans Pro", "Space Mono", "Tahoma", "Taviraj", "Times", "Times New Roman", "Titillium Web", "Trebuchet MS", "Ubuntu", "Varela Round", "Verdana", "Work Sans"], Y = ["monospace", "sans-serif", "serif"];
|
|
496
|
-
function
|
|
406
|
+
function P(n, t) {
|
|
497
407
|
if (!n) throw new Error("Canvas context not supported");
|
|
498
408
|
return n.font = "72px ".concat(t), n.measureText("WwMmLli0Oo").width;
|
|
499
409
|
}
|
|
@@ -555,7 +465,7 @@ function te() {
|
|
|
555
465
|
}
|
|
556
466
|
return 0;
|
|
557
467
|
}
|
|
558
|
-
|
|
468
|
+
E().name != "Firefox" && v("fonts", function() {
|
|
559
469
|
var n = this;
|
|
560
470
|
return new Promise(function(t, r) {
|
|
561
471
|
try {
|
|
@@ -566,8 +476,8 @@ M().name != "Firefox" && v("fonts", function() {
|
|
|
566
476
|
return y(this, function(d) {
|
|
567
477
|
switch (d.label) {
|
|
568
478
|
case 0:
|
|
569
|
-
return document.body ? [3, 2] : [4, (u = 50, new Promise(function(
|
|
570
|
-
return setTimeout(
|
|
479
|
+
return document.body ? [3, 2] : [4, (u = 50, new Promise(function(g) {
|
|
480
|
+
return setTimeout(g, u, a);
|
|
571
481
|
}))];
|
|
572
482
|
case 1:
|
|
573
483
|
return d.sent(), [3, 0];
|
|
@@ -586,10 +496,10 @@ M().name != "Firefox" && v("fonts", function() {
|
|
|
586
496
|
var i, e, c, d;
|
|
587
497
|
return y(this, function(u) {
|
|
588
498
|
return i = s.createElement("canvas"), e = i.getContext("2d"), c = Y.map(function(a) {
|
|
589
|
-
return
|
|
499
|
+
return P(e, a);
|
|
590
500
|
}), d = {}, J.forEach(function(a) {
|
|
591
|
-
var
|
|
592
|
-
c.includes(
|
|
501
|
+
var g = P(e, a);
|
|
502
|
+
c.includes(g) || (d[a] = g);
|
|
593
503
|
}), t(d), [2];
|
|
594
504
|
});
|
|
595
505
|
});
|
|
@@ -656,11 +566,11 @@ M().name != "Firefox" && v("fonts", function() {
|
|
|
656
566
|
});
|
|
657
567
|
}), v("system", function() {
|
|
658
568
|
return new Promise(function(n) {
|
|
659
|
-
var t =
|
|
569
|
+
var t = E();
|
|
660
570
|
n({ platform: window.navigator.platform, cookieEnabled: window.navigator.cookieEnabled, productSub: navigator.productSub, product: navigator.product, useragent: navigator.userAgent, hardwareConcurrency: navigator.hardwareConcurrency, browser: { name: t.name, version: t.version }, applePayVersion: te() });
|
|
661
571
|
});
|
|
662
572
|
});
|
|
663
|
-
var h, ne =
|
|
573
|
+
var h, ne = E().name !== "SamsungBrowser" ? 1 : 3, l = null;
|
|
664
574
|
v("webgl", function() {
|
|
665
575
|
return w(this, void 0, void 0, function() {
|
|
666
576
|
var n;
|
|
@@ -691,22 +601,22 @@ v("webgl", function() {
|
|
|
691
601
|
if (l.attachShader(e, s), l.attachShader(e, i), l.linkProgram(e), !l.getProgramParameter(e, l.LINK_STATUS)) throw new Error("Shader program linking failed: " + l.getProgramInfoLog(e));
|
|
692
602
|
l.useProgram(e);
|
|
693
603
|
for (var c = 137, d = new Float32Array(4 * c), u = 2 * Math.PI / c, a = 0; a < c; a++) {
|
|
694
|
-
var
|
|
695
|
-
d[4 * a] = 0, d[4 * a + 1] = 0, d[4 * a + 2] = Math.cos(
|
|
604
|
+
var g = a * u;
|
|
605
|
+
d[4 * a] = 0, d[4 * a + 1] = 0, d[4 * a + 2] = Math.cos(g) * (h.width / 2), d[4 * a + 3] = Math.sin(g) * (h.height / 2);
|
|
696
606
|
}
|
|
697
|
-
var
|
|
698
|
-
l.bindBuffer(l.ARRAY_BUFFER,
|
|
699
|
-
var
|
|
700
|
-
l.enableVertexAttribArray(
|
|
701
|
-
var
|
|
702
|
-
return l.readPixels(0, 0, h.width, h.height, l.RGBA, l.UNSIGNED_BYTE,
|
|
607
|
+
var U = l.createBuffer();
|
|
608
|
+
l.bindBuffer(l.ARRAY_BUFFER, U), l.bufferData(l.ARRAY_BUFFER, d, l.STATIC_DRAW);
|
|
609
|
+
var I = l.getAttribLocation(e, "position");
|
|
610
|
+
l.enableVertexAttribArray(I), l.vertexAttribPointer(I, 2, l.FLOAT, !1, 0, 0), l.viewport(0, 0, h.width, h.height), l.clearColor(0, 0, 0, 1), l.clear(l.COLOR_BUFFER_BIT), l.drawArrays(l.LINES, 0, 2 * c);
|
|
611
|
+
var R = new Uint8ClampedArray(h.width * h.height * 4);
|
|
612
|
+
return l.readPixels(0, 0, h.width, h.height, l.RGBA, l.UNSIGNED_BYTE, R), new ImageData(R, h.width, h.height);
|
|
703
613
|
} catch {
|
|
704
614
|
return new ImageData(1, 1);
|
|
705
615
|
} finally {
|
|
706
616
|
l && (l.bindBuffer(l.ARRAY_BUFFER, null), l.useProgram(null), l.viewport(0, 0, l.drawingBufferWidth, l.drawingBufferHeight), l.clearColor(0, 0, 0, 0));
|
|
707
617
|
}
|
|
708
618
|
}();
|
|
709
|
-
}), [2, { commonImageHash:
|
|
619
|
+
}), [2, { commonImageHash: x(_(n, h.width, h.height).data.toString()).toString() }];
|
|
710
620
|
} catch {
|
|
711
621
|
return [2, { webgl: "unsupported" }];
|
|
712
622
|
}
|
|
@@ -750,7 +660,7 @@ class ie {
|
|
|
750
660
|
limit: t.limit ?? 20
|
|
751
661
|
// Default to 20 if not provided
|
|
752
662
|
};
|
|
753
|
-
t.offset !== void 0 && (o.offset = t.offset), t.
|
|
663
|
+
t.offset !== void 0 && (o.offset = t.offset), t.order_by && (o.order_by = t.order_by, o.sort = t.sort === "desc" || t.sort === "asc" ? t.sort : "asc");
|
|
754
664
|
const s = {
|
|
755
665
|
method: "POST",
|
|
756
666
|
headers: {
|
|
@@ -784,8 +694,6 @@ class ie {
|
|
|
784
694
|
const s = {
|
|
785
695
|
event_name: t,
|
|
786
696
|
properties: {
|
|
787
|
-
searchcraft_organization_id: this.config.organizationId,
|
|
788
|
-
searchcraft_application_id: this.config.applicationId,
|
|
789
697
|
searchcraft_index_names: this.config.index,
|
|
790
698
|
...r
|
|
791
699
|
},
|
|
@@ -825,7 +733,7 @@ class ie {
|
|
|
825
733
|
*/
|
|
826
734
|
async initMeasure() {
|
|
827
735
|
if (!this.config.userId) {
|
|
828
|
-
const t = await
|
|
736
|
+
const t = await H();
|
|
829
737
|
this.userId = t;
|
|
830
738
|
}
|
|
831
739
|
this.sendMeasureEvent("sdk_initialized");
|
|
@@ -862,26 +770,31 @@ class ie {
|
|
|
862
770
|
* @returns {QueryObject} - A properly formatted query object.
|
|
863
771
|
*/
|
|
864
772
|
buildQueryObject(t) {
|
|
865
|
-
var i;
|
|
866
773
|
const r = [];
|
|
867
774
|
let o = "should";
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
775
|
+
return t.facetPathsForIndexFields && Object.keys(t.facetPathsForIndexFields).forEach(
|
|
776
|
+
(s) => {
|
|
777
|
+
var e;
|
|
778
|
+
const i = (e = t.facetPathsForIndexFields) == null ? void 0 : e[s];
|
|
779
|
+
i && (o = "must", r.push({
|
|
780
|
+
occur: o,
|
|
781
|
+
normal: {
|
|
782
|
+
ctx: i.value
|
|
783
|
+
}
|
|
784
|
+
}));
|
|
785
|
+
}
|
|
786
|
+
), t.rangeValueForIndexFields && Object.keys(t.rangeValueForIndexFields).forEach(
|
|
787
|
+
(s) => {
|
|
788
|
+
var e;
|
|
789
|
+
const i = (e = t.rangeValueForIndexFields) == null ? void 0 : e[s];
|
|
790
|
+
i && (o = "must", r.push({
|
|
791
|
+
occur: o,
|
|
792
|
+
normal: {
|
|
793
|
+
ctx: i.value
|
|
794
|
+
}
|
|
795
|
+
}));
|
|
883
796
|
}
|
|
884
|
-
|
|
797
|
+
), t.sort === "desc" ? t.order_by = "date_published" : t.order_by = "", r.push({
|
|
885
798
|
occur: o,
|
|
886
799
|
// Valid, as 'occur' is a required property in QueryItem
|
|
887
800
|
[t.mode]: { ctx: t.query }
|
|
@@ -889,7 +802,7 @@ class ie {
|
|
|
889
802
|
}), r;
|
|
890
803
|
}
|
|
891
804
|
}
|
|
892
|
-
var
|
|
805
|
+
var O = /* @__PURE__ */ ((n) => (n[n.DEBUG = 0] = "DEBUG", n[n.INFO = 1] = "INFO", n[n.WARN = 2] = "WARN", n[n.ERROR = 3] = "ERROR", n))(O || {});
|
|
893
806
|
class ae {
|
|
894
807
|
constructor(t) {
|
|
895
808
|
p(this, "logLevel");
|
|
@@ -897,7 +810,7 @@ class ae {
|
|
|
897
810
|
this.logLevel = t.logLevel || 1, this.logFormatter = t.logFormatter || this.defaultFormatter;
|
|
898
811
|
}
|
|
899
812
|
defaultFormatter(t, r) {
|
|
900
|
-
return `[${
|
|
813
|
+
return `[${O[t]}] ${( new Date()).toISOString()}: ${r}`;
|
|
901
814
|
}
|
|
902
815
|
debug(t) {
|
|
903
816
|
this.logLevel <= 0 && console.log(this.logFormatter(0, t));
|
|
@@ -920,86 +833,101 @@ const useSearchcraftStore = zustand.create((set, get) => {
|
|
|
920
833
|
const log = (level, message) => {
|
|
921
834
|
if (debuggerInstance) {
|
|
922
835
|
switch (level) {
|
|
923
|
-
case
|
|
836
|
+
case O.DEBUG:
|
|
924
837
|
debuggerInstance.debug(message);
|
|
925
838
|
break;
|
|
926
|
-
case
|
|
839
|
+
case O.INFO:
|
|
927
840
|
debuggerInstance.info(message);
|
|
928
841
|
break;
|
|
929
|
-
case
|
|
842
|
+
case O.WARN:
|
|
930
843
|
debuggerInstance.warn(message);
|
|
931
844
|
break;
|
|
932
|
-
case
|
|
845
|
+
case O.ERROR:
|
|
933
846
|
debuggerInstance.error(message);
|
|
934
847
|
break;
|
|
935
848
|
}
|
|
936
849
|
}
|
|
937
850
|
};
|
|
938
851
|
return {
|
|
852
|
+
resetFacetPaths: () => {
|
|
853
|
+
set({
|
|
854
|
+
facetPathsForIndexFields: {},
|
|
855
|
+
});
|
|
856
|
+
},
|
|
857
|
+
addFacetPathsForIndexField: (data) => set((state) => ({
|
|
858
|
+
facetPathsForIndexFields: Object.assign(Object.assign({}, state.facetPathsForIndexFields), { [data.fieldName]: data }),
|
|
859
|
+
})),
|
|
860
|
+
removeFacetPathsForIndexField: (fieldName) => set((state) => {
|
|
861
|
+
const currentPaths = state.facetPathsForIndexFields;
|
|
862
|
+
delete currentPaths[fieldName];
|
|
863
|
+
return {
|
|
864
|
+
facetPathsForIndexFields: Object.assign({}, currentPaths),
|
|
865
|
+
};
|
|
866
|
+
}),
|
|
867
|
+
addRangeValueForIndexField: (data) => set((state) => ({
|
|
868
|
+
rangeValueForIndexFields: Object.assign(Object.assign({}, state.rangeValueForIndexFields), { [data.fieldName]: data }),
|
|
869
|
+
})),
|
|
870
|
+
removeRangeValueForIndexField: (fieldName) => set((state) => {
|
|
871
|
+
const currentValues = state.rangeValueForIndexFields;
|
|
872
|
+
delete currentValues[fieldName];
|
|
873
|
+
return {
|
|
874
|
+
rangeValueForIndexFields: Object.assign({}, currentValues),
|
|
875
|
+
};
|
|
876
|
+
}),
|
|
877
|
+
setSearchMode: (mode) => set({ searchMode: mode }),
|
|
878
|
+
setSortType: (type) => set({ sortType: type }),
|
|
879
|
+
searchMode: 'fuzzy',
|
|
880
|
+
sortType: 'asc',
|
|
881
|
+
facetPathsForIndexFields: {},
|
|
882
|
+
rangeValueForIndexFields: {},
|
|
939
883
|
query: '',
|
|
940
884
|
isRequesting: false,
|
|
941
885
|
searchResults: null,
|
|
942
886
|
facets: null,
|
|
943
887
|
getSearchcraftInstance: () => searchcraft,
|
|
944
|
-
selectedFilters: [],
|
|
945
888
|
searchParams: {
|
|
946
889
|
mode: 'fuzzy',
|
|
947
890
|
sort: 'asc',
|
|
948
891
|
},
|
|
949
|
-
setQuery: (query) => set({ query }),
|
|
892
|
+
setQuery: (query) => set({ query, facetPathsForIndexFields: {} }),
|
|
950
893
|
setSearchResults: (results) => set({ searchResults: results }),
|
|
951
894
|
setFacets: (facets) => set({ facets }),
|
|
952
|
-
setSelectedFilters: (filters) => set({ selectedFilters: filters }),
|
|
953
895
|
setIsRequesting: (isRequesting) => set({ isRequesting }),
|
|
954
|
-
setSearchParams: (params) => set((state) => ({
|
|
955
|
-
searchParams: Object.assign(Object.assign({}, state.searchParams), params),
|
|
956
|
-
})),
|
|
957
|
-
setYearsRange: (yearsRange) => set((state) => ({
|
|
958
|
-
searchParams: Object.assign(Object.assign({}, state.searchParams), { yearsRange }),
|
|
959
|
-
})),
|
|
960
896
|
search: async () => {
|
|
961
|
-
const
|
|
897
|
+
const state = get();
|
|
962
898
|
if (!searchcraft) {
|
|
963
899
|
throw new Error('Searchcraft instance is not initialized.');
|
|
964
900
|
}
|
|
965
|
-
setIsRequesting(true);
|
|
966
|
-
log(
|
|
967
|
-
const filters = filterPaths(selectedFilters);
|
|
901
|
+
state.setIsRequesting(true);
|
|
902
|
+
log(O.INFO, `Starting search with query: "${state.query}"`);
|
|
968
903
|
try {
|
|
969
|
-
const
|
|
970
|
-
query,
|
|
971
|
-
mode:
|
|
972
|
-
sort:
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
counts: Object.fromEntries(filters.map((path) => [path, 1])),
|
|
977
|
-
},
|
|
978
|
-
}
|
|
979
|
-
: null,
|
|
980
|
-
yearsRange: searchParams.yearsRange,
|
|
981
|
-
};
|
|
982
|
-
const results = await searchcraft.search(searchRequest);
|
|
983
|
-
setSearchResults(results);
|
|
904
|
+
const results = await searchcraft.search({
|
|
905
|
+
query: state.query,
|
|
906
|
+
mode: state.searchMode,
|
|
907
|
+
sort: state.sortType,
|
|
908
|
+
facetPathsForIndexFields: state.facetPathsForIndexFields,
|
|
909
|
+
rangeValueForIndexFields: state.rangeValueForIndexFields,
|
|
910
|
+
});
|
|
984
911
|
const updatedFacets = results.data.facets || null;
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
log(
|
|
912
|
+
state.setSearchResults(results);
|
|
913
|
+
state.setFacets(updatedFacets);
|
|
914
|
+
log(O.DEBUG, `Search results: ${JSON.stringify(results)}`);
|
|
915
|
+
log(O.DEBUG, `Updated facets: ${JSON.stringify(updatedFacets)}`);
|
|
988
916
|
}
|
|
989
917
|
catch (error) {
|
|
990
918
|
console.error(`Search failed: ${error.message}`);
|
|
991
|
-
log(
|
|
919
|
+
log(O.ERROR, `Search failed with error: ${error.message}`);
|
|
992
920
|
}
|
|
993
921
|
finally {
|
|
994
|
-
setIsRequesting(false);
|
|
922
|
+
state.setIsRequesting(false);
|
|
995
923
|
}
|
|
996
924
|
},
|
|
997
925
|
initialize: (searchcraftInstance, debug = false) => {
|
|
998
926
|
searchcraft = searchcraftInstance;
|
|
999
927
|
debuggerInstance = debug
|
|
1000
|
-
? new ae({ logLevel:
|
|
928
|
+
? new ae({ logLevel: O.DEBUG })
|
|
1001
929
|
: null;
|
|
1002
|
-
log(
|
|
930
|
+
log(O.INFO, 'Searchcraft store initialized.');
|
|
1003
931
|
},
|
|
1004
932
|
};
|
|
1005
933
|
});
|
|
@@ -1008,15 +936,6 @@ const useThemeStore = zustand.create((set) => ({
|
|
|
1008
936
|
toggleTheme: () => set((state) => ({ theme: state.theme === 'light' ? 'dark' : 'light' })),
|
|
1009
937
|
}));
|
|
1010
938
|
|
|
1011
|
-
|
|
1012
|
-
exports.flattenFacets = flattenFacets;
|
|
1013
|
-
exports.formatNumberWithCommas = formatNumberWithCommas;
|
|
1014
|
-
exports.getFormattedTimeFromNow = getFormattedTimeFromNow;
|
|
1015
|
-
exports.ie = ie;
|
|
1016
|
-
exports.parseCustomStyles = parseCustomStyles;
|
|
1017
|
-
exports.parseSearchKeys = parseSearchKeys;
|
|
1018
|
-
exports.serializeStyles = serializeStyles;
|
|
1019
|
-
exports.useSearchcraftStore = useSearchcraftStore;
|
|
1020
|
-
exports.useThemeStore = useThemeStore;
|
|
939
|
+
export { useThemeStore as a, ie as i, useSearchcraftStore as u };
|
|
1021
940
|
|
|
1022
|
-
//# sourceMappingURL=store-
|
|
941
|
+
//# sourceMappingURL=store-52436995.js.map
|