@searchcraft/javascript-sdk 0.3.0 → 0.3.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.
Files changed (224) hide show
  1. package/dist/cjs/{index-6c5282a0.js → index-264ebadc.js} +290 -9
  2. package/dist/cjs/index-264ebadc.js.map +1 -0
  3. package/dist/cjs/index.cjs.js +1 -1
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/cjs/package-35d3b670.js +68 -0
  6. package/dist/cjs/package-35d3b670.js.map +1 -0
  7. package/dist/cjs/{searchcraft-auto-search-form_19.cjs.entry.js → searchcraft-auto-search-form_17.cjs.entry.js} +126 -120
  8. package/dist/cjs/searchcraft-auto-search-form_17.cjs.entry.js.map +1 -0
  9. package/dist/cjs/searchcraft-base-search-form.cjs.entry.js +13 -5
  10. package/dist/cjs/searchcraft-base-search-form.cjs.entry.js.map +1 -1
  11. package/dist/cjs/searchcraft-button-icon.cjs.entry.js +1 -1
  12. package/dist/cjs/searchcraft-button.cjs.entry.js +4 -4
  13. package/dist/cjs/searchcraft-button.cjs.entry.js.map +1 -1
  14. package/dist/cjs/searchcraft-javascript-sdk.cjs.js +2 -2
  15. package/dist/cjs/searchcraft-spinner-dark.cjs.entry.js +22 -0
  16. package/dist/cjs/searchcraft-spinner-dark.cjs.entry.js.map +1 -0
  17. package/dist/cjs/searchcraft-spinner-light.cjs.entry.js +22 -0
  18. package/dist/cjs/searchcraft-spinner-light.cjs.entry.js.map +1 -0
  19. package/dist/cjs/store-e3bbdd49.js +1022 -0
  20. package/dist/cjs/store-e3bbdd49.js.map +1 -0
  21. package/dist/collection/assets/searchcraft-button-icons.js.map +1 -1
  22. package/dist/collection/assets/searchcraft-check-icon.js.map +1 -1
  23. package/dist/collection/assets/searchcraft-clear-icon-set.js.map +1 -1
  24. package/dist/collection/assets/searchcraft-dash-icon.js.map +1 -1
  25. package/dist/collection/assets/searchcraft-search-icon-set.js.map +1 -1
  26. package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.js +18 -10
  27. package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.js.map +1 -1
  28. package/dist/collection/components/searchcraft-base-search-form/searchcraft-base-search-form.js +17 -10
  29. package/dist/collection/components/searchcraft-base-search-form/searchcraft-base-search-form.js.map +1 -1
  30. package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js +76 -26
  31. package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js.map +1 -1
  32. package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.module.css +42 -22
  33. package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js +50 -10
  34. package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js.map +1 -1
  35. package/dist/collection/components/searchcraft-button/searchcraft-button.js +2 -3
  36. package/dist/collection/components/searchcraft-button/searchcraft-button.js.map +1 -1
  37. package/dist/collection/components/searchcraft-button/searchcraft-button.module.css +4 -33
  38. package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.js +4 -5
  39. package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.js.map +1 -1
  40. package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.module.css +3 -3
  41. package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js +3 -4
  42. package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js.map +1 -1
  43. package/dist/collection/components/searchcraft-filters-list/searchcraft-filters-list.js +6 -10
  44. package/dist/collection/components/searchcraft-filters-list/searchcraft-filters-list.js.map +1 -1
  45. package/dist/collection/components/searchcraft-filters-list/searchcraft-filters-list.module.css +26 -25
  46. package/dist/collection/components/searchcraft-input/searchcraft-input.js +20 -21
  47. package/dist/collection/components/searchcraft-input/searchcraft-input.js.map +1 -1
  48. package/dist/collection/components/searchcraft-input/searchcraft-input.module.css +44 -52
  49. package/dist/collection/components/searchcraft-input-caption/searchcraft-input-caption.js +2 -3
  50. package/dist/collection/components/searchcraft-input-caption/searchcraft-input-caption.js.map +1 -1
  51. package/dist/collection/components/searchcraft-input-icon/searchcraft-input-icon.js +2 -2
  52. package/dist/collection/components/searchcraft-input-icon/searchcraft-input-icon.js.map +1 -1
  53. package/dist/collection/components/searchcraft-input-icon/searchcraft-input-icon.module.css +2 -2
  54. package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js +1 -2
  55. package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js.map +1 -1
  56. package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.module.css +1 -1
  57. package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.js +5 -3
  58. package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.js.map +1 -1
  59. package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.module.css +14 -4
  60. package/dist/collection/components/searchcraft-slider/searchcraft-slider.js +34 -8
  61. package/dist/collection/components/searchcraft-slider/searchcraft-slider.js.map +1 -1
  62. package/dist/collection/components/searchcraft-slider/searchcraft-slider.module.css +37 -23
  63. package/dist/collection/components/searchcraft-spinner-dark/searchcraft-spinner-dark.js.map +1 -1
  64. package/dist/collection/components/searchcraft-spinner-light/searchcraft-spinner-light.js.map +1 -1
  65. package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.js +4 -2
  66. package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.js.map +1 -1
  67. package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.module.css +7 -7
  68. package/dist/collection/index.js.map +1 -1
  69. package/dist/collection/provider/store.js +1 -0
  70. package/dist/collection/provider/store.js.map +1 -1
  71. package/dist/collection/utils/utils.js +3 -0
  72. package/dist/collection/utils/utils.js.map +1 -1
  73. package/dist/components/index.js +3 -3
  74. package/dist/components/{p-8c38185e.js → p-4f939ba2.js} +7 -7
  75. package/dist/components/p-4f939ba2.js.map +1 -0
  76. package/dist/components/{p-498c7ef9.js → p-5015a359.js} +4 -5
  77. package/dist/components/p-5015a359.js.map +1 -0
  78. package/dist/components/{p-27a6ca57.js → p-54848b4d.js} +35 -48
  79. package/dist/components/p-54848b4d.js.map +1 -0
  80. package/dist/components/{p-a3bd1bc8.js → p-5a872bdf.js} +2 -2
  81. package/dist/components/{p-a3bd1bc8.js.map → p-5a872bdf.js.map} +1 -1
  82. package/dist/components/{p-7d1bcd2d.js → p-62c40862.js} +5 -2
  83. package/dist/components/p-62c40862.js.map +1 -0
  84. package/dist/components/{p-70722ab2.js → p-62e6b69c.js} +2 -2
  85. package/dist/components/{p-70722ab2.js.map → p-62e6b69c.js.map} +1 -1
  86. package/dist/components/{p-6237f03e.js → p-69ee3b9a.js} +5 -6
  87. package/dist/components/p-69ee3b9a.js.map +1 -0
  88. package/dist/components/{p-7498e493.js → p-6b353c3e.js} +290 -9
  89. package/dist/components/p-6b353c3e.js.map +1 -0
  90. package/dist/components/p-727bfc38.js +925 -0
  91. package/dist/components/p-727bfc38.js.map +1 -0
  92. package/dist/components/{p-bc3f9025.js → p-7c280820.js} +2 -2
  93. package/dist/components/{p-bc3f9025.js.map → p-7c280820.js.map} +1 -1
  94. package/dist/components/{p-4468fba3.js → p-7d385ffb.js} +7 -8
  95. package/dist/components/p-7d385ffb.js.map +1 -0
  96. package/dist/components/p-8524c749.js +54 -0
  97. package/dist/components/p-8524c749.js.map +1 -0
  98. package/dist/components/{p-e5471fcf.js → p-aad03c2a.js} +2 -2
  99. package/dist/components/{p-e5471fcf.js.map → p-aad03c2a.js.map} +1 -1
  100. package/dist/components/p-b0c1fd63.js +66 -0
  101. package/dist/components/p-b0c1fd63.js.map +1 -0
  102. package/dist/components/{p-ae84b899.js → p-b38d171d.js} +5 -6
  103. package/dist/components/p-b38d171d.js.map +1 -0
  104. package/dist/components/{p-d3187f5a.js → p-bbf9973a.js} +2 -2
  105. package/dist/components/{p-d3187f5a.js.map → p-bbf9973a.js.map} +1 -1
  106. package/dist/components/p-cd9a038a.js +105 -0
  107. package/dist/components/p-cd9a038a.js.map +1 -0
  108. package/dist/components/searchcraft-auto-search-form.js +32 -36
  109. package/dist/components/searchcraft-auto-search-form.js.map +1 -1
  110. package/dist/components/searchcraft-base-search-form.js +34 -33
  111. package/dist/components/searchcraft-base-search-form.js.map +1 -1
  112. package/dist/components/searchcraft-base-search-result.js +1 -1
  113. package/dist/components/searchcraft-base-search-results.js +21 -15
  114. package/dist/components/searchcraft-base-search-results.js.map +1 -1
  115. package/dist/components/searchcraft-button-icon.js +1 -1
  116. package/dist/components/searchcraft-button.js +1 -1
  117. package/dist/components/searchcraft-check-icon.js +1 -1
  118. package/dist/components/searchcraft-clear-icon-set.js +1 -1
  119. package/dist/components/searchcraft-clear-input-button.js +1 -1
  120. package/dist/components/searchcraft-dash-icon.js +1 -1
  121. package/dist/components/searchcraft-error-message.js +1 -1
  122. package/dist/components/searchcraft-filters-list.js +12 -16
  123. package/dist/components/searchcraft-filters-list.js.map +1 -1
  124. package/dist/components/searchcraft-input-caption.js +1 -1
  125. package/dist/components/searchcraft-input-icon.js +1 -1
  126. package/dist/components/searchcraft-input-label.js +1 -1
  127. package/dist/components/searchcraft-input.js +1 -1
  128. package/dist/components/searchcraft-results-info.js +9 -7
  129. package/dist/components/searchcraft-results-info.js.map +1 -1
  130. package/dist/components/searchcraft-search-icon-set.js +1 -1
  131. package/dist/components/searchcraft-slider.js +20 -11
  132. package/dist/components/searchcraft-slider.js.map +1 -1
  133. package/dist/components/searchcraft-spinner-dark.js +1 -1
  134. package/dist/components/searchcraft-spinner-light.js +29 -1
  135. package/dist/components/searchcraft-spinner-light.js.map +1 -1
  136. package/dist/components/searchcraft-toggle-button.js +8 -6
  137. package/dist/components/searchcraft-toggle-button.js.map +1 -1
  138. package/dist/esm/{index-0ac5bb53.js → index-d851fb46.js} +290 -9
  139. package/dist/esm/index-d851fb46.js.map +1 -0
  140. package/dist/esm/index.js +1 -1
  141. package/dist/esm/loader.js +3 -3
  142. package/dist/esm/package-82baadd7.js +66 -0
  143. package/dist/esm/package-82baadd7.js.map +1 -0
  144. package/dist/esm/{searchcraft-auto-search-form_19.entry.js → searchcraft-auto-search-form_17.entry.js} +125 -117
  145. package/dist/esm/searchcraft-auto-search-form_17.entry.js.map +1 -0
  146. package/dist/esm/searchcraft-base-search-form.entry.js +13 -5
  147. package/dist/esm/searchcraft-base-search-form.entry.js.map +1 -1
  148. package/dist/esm/searchcraft-button-icon.entry.js +1 -1
  149. package/dist/esm/searchcraft-button.entry.js +4 -4
  150. package/dist/esm/searchcraft-button.entry.js.map +1 -1
  151. package/dist/esm/searchcraft-javascript-sdk.js +3 -3
  152. package/dist/esm/searchcraft-spinner-dark.entry.js +18 -0
  153. package/dist/esm/searchcraft-spinner-dark.entry.js.map +1 -0
  154. package/dist/esm/searchcraft-spinner-light.entry.js +18 -0
  155. package/dist/esm/searchcraft-spinner-light.entry.js.map +1 -0
  156. package/dist/esm/store-b519dd0b.js +1011 -0
  157. package/dist/esm/store-b519dd0b.js.map +1 -0
  158. package/dist/searchcraft-javascript-sdk/index.esm.js +1 -1
  159. package/dist/searchcraft-javascript-sdk/p-1f3ae7f3.entry.js +2 -0
  160. package/dist/searchcraft-javascript-sdk/p-1f3ae7f3.entry.js.map +1 -0
  161. package/dist/searchcraft-javascript-sdk/p-201cb2dc.entry.js +2 -0
  162. package/dist/searchcraft-javascript-sdk/p-201cb2dc.entry.js.map +1 -0
  163. package/dist/searchcraft-javascript-sdk/p-2c220368.entry.js +2 -0
  164. package/dist/searchcraft-javascript-sdk/p-2c220368.entry.js.map +1 -0
  165. package/dist/searchcraft-javascript-sdk/p-39c0ca33.entry.js +2 -0
  166. package/dist/searchcraft-javascript-sdk/p-39c0ca33.entry.js.map +1 -0
  167. package/dist/searchcraft-javascript-sdk/p-476829a4.entry.js +2 -0
  168. package/dist/searchcraft-javascript-sdk/p-476829a4.entry.js.map +1 -0
  169. package/dist/searchcraft-javascript-sdk/{p-5ec960bd.entry.js → p-99356c9a.entry.js} +2 -2
  170. package/dist/searchcraft-javascript-sdk/p-b0c1fd63.js +2 -0
  171. package/dist/searchcraft-javascript-sdk/p-b0c1fd63.js.map +1 -0
  172. package/dist/searchcraft-javascript-sdk/p-b42eaa55.js +3 -0
  173. package/dist/searchcraft-javascript-sdk/p-b42eaa55.js.map +1 -0
  174. package/dist/searchcraft-javascript-sdk/p-d5f8dda2.js +11 -0
  175. package/dist/searchcraft-javascript-sdk/p-d5f8dda2.js.map +1 -0
  176. package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js +1 -1
  177. package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js.map +1 -1
  178. package/dist/types/components/searchcraft-auto-search-form/searchcraft-auto-search-form.d.ts +2 -2
  179. package/dist/types/components/searchcraft-base-search-form/searchcraft-base-search-form.d.ts +2 -2
  180. package/dist/types/components/searchcraft-base-search-result/searchcraft-base-search-result.d.ts +6 -3
  181. package/dist/types/components/searchcraft-base-search-results/searchcraft-base-search-results.d.ts +3 -0
  182. package/dist/types/components/searchcraft-error-message/searchcraft-error-message.d.ts +0 -6
  183. package/dist/types/components/searchcraft-filters-list/searchcraft-filters-list.d.ts +1 -1
  184. package/dist/types/components/searchcraft-input/searchcraft-input.d.ts +3 -3
  185. package/dist/types/components/searchcraft-slider/searchcraft-slider.d.ts +5 -0
  186. package/dist/types/components.d.ts +48 -22
  187. package/dist/types/provider/store.d.ts +2 -1
  188. package/dist/types/utils/utils.d.ts +1 -0
  189. package/package.json +1 -1
  190. package/dist/cjs/index-6c5282a0.js.map +0 -1
  191. package/dist/cjs/searchcraft-auto-search-form_19.cjs.entry.js.map +0 -1
  192. package/dist/cjs/store-f3bec622.js +0 -406
  193. package/dist/cjs/store-f3bec622.js.map +0 -1
  194. package/dist/components/p-07edaa9b.js +0 -67
  195. package/dist/components/p-07edaa9b.js.map +0 -1
  196. package/dist/components/p-27a6ca57.js.map +0 -1
  197. package/dist/components/p-4468fba3.js.map +0 -1
  198. package/dist/components/p-498c7ef9.js.map +0 -1
  199. package/dist/components/p-6237f03e.js.map +0 -1
  200. package/dist/components/p-7498e493.js.map +0 -1
  201. package/dist/components/p-7d1bcd2d.js.map +0 -1
  202. package/dist/components/p-8c38185e.js.map +0 -1
  203. package/dist/components/p-ae84b899.js.map +0 -1
  204. package/dist/components/p-bfb22305.js +0 -33
  205. package/dist/components/p-bfb22305.js.map +0 -1
  206. package/dist/components/p-c31274dd.js +0 -89
  207. package/dist/components/p-c31274dd.js.map +0 -1
  208. package/dist/components/p-ff049f0a.js +0 -313
  209. package/dist/components/p-ff049f0a.js.map +0 -1
  210. package/dist/esm/index-0ac5bb53.js.map +0 -1
  211. package/dist/esm/searchcraft-auto-search-form_19.entry.js.map +0 -1
  212. package/dist/esm/store-6af9ea01.js +0 -396
  213. package/dist/esm/store-6af9ea01.js.map +0 -1
  214. package/dist/searchcraft-javascript-sdk/p-05416a3e.entry.js +0 -2
  215. package/dist/searchcraft-javascript-sdk/p-05416a3e.entry.js.map +0 -1
  216. package/dist/searchcraft-javascript-sdk/p-0880cfbb.js +0 -3
  217. package/dist/searchcraft-javascript-sdk/p-0880cfbb.js.map +0 -1
  218. package/dist/searchcraft-javascript-sdk/p-1ab836bf.js +0 -11
  219. package/dist/searchcraft-javascript-sdk/p-1ab836bf.js.map +0 -1
  220. package/dist/searchcraft-javascript-sdk/p-3cb77ee1.entry.js +0 -2
  221. package/dist/searchcraft-javascript-sdk/p-3cb77ee1.entry.js.map +0 -1
  222. package/dist/searchcraft-javascript-sdk/p-72382d90.entry.js +0 -2
  223. package/dist/searchcraft-javascript-sdk/p-72382d90.entry.js.map +0 -1
  224. /package/dist/searchcraft-javascript-sdk/{p-5ec960bd.entry.js.map → p-99356c9a.entry.js.map} +0 -0
@@ -2,9 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-6c5282a0.js');
6
- const store = require('./store-f3bec622.js');
5
+ const index = require('./index-264ebadc.js');
7
6
  const index$1 = require('./index-5b0b9d4c.js');
7
+ const store = require('./store-e3bbdd49.js');
8
+ const _package = require('./package-35d3b670.js');
8
9
 
9
10
  const searchcraftAutoSearchFormModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.formLTR{font-family:var(--font-stack);text-align:left;width:100%}.formRTL{font-family:var(--font-stack);text-align:right;width:100%}";
10
11
  const SearchcraftAutoSearchFormStyle0 = searchcraftAutoSearchFormModuleCss;
@@ -22,6 +23,7 @@ const SearchcraftAutoSearchForm = class {
22
23
  this.searchStore.setQuery(this.query);
23
24
  if (this.query.trim() === '') {
24
25
  this.searchResults = null;
26
+ this.inputClearedOrNoResults.emit();
25
27
  this.searchStore.setSearchResults(null);
26
28
  }
27
29
  };
@@ -38,6 +40,7 @@ const SearchcraftAutoSearchForm = class {
38
40
  if (this.query.trim() === '') {
39
41
  this.searchResults = null;
40
42
  this.searchStore.setSearchResults(null);
43
+ this.inputClearedOrNoResults.emit();
41
44
  }
42
45
  else {
43
46
  this.searchStore.setQuery(this.query);
@@ -88,9 +91,11 @@ const SearchcraftAutoSearchForm = class {
88
91
  this.autoSearchFormClass = '';
89
92
  this.clearInput = () => { };
90
93
  this.config = {
91
- apiKey: '',
94
+ readKey: '',
92
95
  endpointURL: '',
93
96
  index: [],
97
+ organizationId: '',
98
+ applicationId: '',
94
99
  };
95
100
  this.customStylesForInput = {};
96
101
  this.inputCaptionValue = '';
@@ -106,7 +111,10 @@ const SearchcraftAutoSearchForm = class {
106
111
  this.searchResults = null;
107
112
  }
108
113
  componentDidLoad() {
109
- const searchcraft = new store.g(this.config);
114
+ const searchcraft = new store.ie(this.config, {
115
+ sdkName: _package.packageJson.name,
116
+ sdkVersion: _package.packageJson.version,
117
+ });
110
118
  this.searchStore.initialize(searchcraft, true);
111
119
  this.unsubscribe = store.useSearchcraftStore.subscribe((state) => {
112
120
  this.isRequesting = state.isRequesting;
@@ -121,12 +129,12 @@ const SearchcraftAutoSearchForm = class {
121
129
  render() {
122
130
  const formClass = this.rightToLeftOrientation ? 'formRTL' : 'formLTR';
123
131
  const parsedCustomStyles = store.parseCustomStyles(this.customStylesForInput);
124
- return (index.h("form", { key: '6f59f4b7d525c62fce6b21712519e3880c6756a2', class: `${formClass}`, onSubmit: this.handleFormSubmit }, index.h("searchcraft-input-label", { key: 'cbaa772a365131dbfcffec9e2a28438f1c978efe', label: this.labelForInput }), index.h("searchcraft-input", { key: '70a4933978df3878720e1189a15481123e12eba5', customStyles: parsedCustomStyles, "input-caption-value": this.inputCaptionValue, "input-icon-height": this.inputIconHeight, "input-icon-width": this.inputIconWidth, "is-requesting": this.isRequesting, onClearInput: this.handleClearInput, onInputKeyUp: this.handleInputKeyUp, onSearchInputChange: this.handleInputChange, "placeholder-value": this.placeholderValue, query: this.query, "right-to-left-orientation": this.rightToLeftOrientation }), this.error && (index.h("searchcraft-error-message", { key: 'd665a04dcc8999a09afa47f1a20156f12db6600c', errorMessage: 'Please enter a search query.' }))));
132
+ return (index.h("form", { key: '3f8e9a36e827b3f1f8d591622a1c824e7ccc6f83', class: index$1.classNames(`${formClass}`, 'searchcraft-auto-search-form'), onSubmit: this.handleFormSubmit }, index.h("searchcraft-input-label", { key: 'daf9b6aab7185e045891a975ac70a3bf3b7ff75f', label: this.labelForInput }), index.h("searchcraft-input", { key: '655e92d562a73dcf9857f24075c65c6bbe2215f5', customStyles: parsedCustomStyles, "input-caption-value": this.inputCaptionValue, "input-icon-height": this.inputIconHeight, "input-icon-width": this.inputIconWidth, "is-requesting": this.isRequesting, onClearInput: this.handleClearInput, onInputKeyUp: this.handleInputKeyUp, onSearchInputChange: this.handleInputChange, "placeholder-value": this.placeholderValue, query: this.query, "right-to-left-orientation": this.rightToLeftOrientation }), this.error && (index.h("searchcraft-error-message", { key: '988624eb1ff71adde2a2e38ab8adb868a5a12469', errorMessage: 'Please enter a search query.' }))));
125
133
  }
126
134
  };
127
135
  SearchcraftAutoSearchForm.style = SearchcraftAutoSearchFormStyle0;
128
136
 
129
- const searchcraftBaseSearchResultModuleCss = "@charset \"UTF-8\";:root{--font-stack:Helvetica, Arial, sans-serif}.interactiveResultContainerLight{align-items:flex-start;border-radius:16px;display:flex;flex-direction:column;gap:16px;padding:8px;position:relative;background-color:#FAFAFA}@media (min-width: 600px){.interactiveResultContainerLight{flex-direction:row}}.interactiveResultContainerDark{align-items:flex-start;border-radius:16px;display:flex;flex-direction:column;gap:16px;padding:8px;position:relative;background-color:#2E2E2E}@media (min-width: 600px){.interactiveResultContainerDark{flex-direction:row}}.resultContainer{align-items:flex-start;display:flex;flex-direction:column;gap:16px}@media (min-width: 600px){.resultContainer{flex-direction:row}}.interactiveIconLarge{display:inline-block;position:absolute;right:5px;top:8px}@media (max-width: 600px){.interactiveIconLarge{display:none}}.interactiveIconSmall{display:inline-block;position:absolute;right:5px;top:-2px}@media (min-width: 600px){.interactiveIconSmall{display:none}}.imageContainer{max-width:100%}.contentContainer{max-height:100%;max-width:100%}@media (min-width: 600px){.contentContainer{max-width:50%}}.secondaryContentContainer{display:flex}.imageLight{border-radius:8px;max-height:100%;max-width:100%;border:1px solid #D9D9D9}.imageDark{border-radius:8px;max-height:100%;max-width:100%;border:1px solid #333}.headingLight{font-family:var(--font-stack);font-size:16px;font-weight:700;line-height:20px;margin-bottom:4px;margin-top:0;position:relative;-webkit-font-smoothing:antialiased;color:#292929}.headingDark{font-family:var(--font-stack);font-size:16px;font-weight:700;line-height:20px;margin-bottom:4px;margin-top:0;position:relative;-webkit-font-smoothing:antialiased;color:#FFF}.subheadingLight{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-bottom:4px;margin-top:0px;-webkit-font-smoothing:antialiased;color:#737373}.subheadingDark{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-bottom:4px;margin-top:0px;-webkit-font-smoothing:antialiased;color:#BFBFBF}.primaryContentLight{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;-webkit-font-smoothing:antialiased;color:#404040}.primaryContentDark{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;-webkit-font-smoothing:antialiased;color:#E6E6E6}.secondaryContentLight{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;-webkit-font-smoothing:antialiased;color:#404040}.secondaryContentLight::after{content:\"•\";color:#404040;font-size:1em;margin-left:5px;margin-right:5px}.secondaryContentDark{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;-webkit-font-smoothing:antialiased;color:#E6E6E6}.tertiaryContentLight{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;-webkit-font-smoothing:antialiased;color:#404040}.tertiaryContentDark{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;-webkit-font-smoothing:antialiased;color:#E6E6E6}";
137
+ const searchcraftBaseSearchResultModuleCss = "@charset \"UTF-8\";:root{--font-stack:Helvetica, Arial, sans-serif}.interactiveResultContainerLight{align-items:flex-start;border-radius:16px;display:flex;flex-direction:column;gap:16px;padding:8px;position:relative;background-color:#F7F7F7}@media (min-width: 900px){.interactiveResultContainerLight{flex-direction:row;justify-content:space-between}}.interactiveResultContainerDark{align-items:flex-start;border-radius:16px;display:flex;flex-direction:column;gap:16px;padding:8px;position:relative;background-color:#2E2E2E}@media (min-width: 900px){.interactiveResultContainerDark{flex-direction:row;justify-content:space-between}}.resultContainer{align-items:flex-start;display:flex;flex-direction:column;gap:16px;all:unset;display:inline;color:inherit;text-decoration:none}.resultContainer:hover{cursor:pointer}@media (min-width: 900px){.resultContainer{flex-direction:row}}.interactiveIconLarge{display:inline-block;position:absolute;right:5px;top:8px}@media (max-width: 900px){.interactiveIconLarge{display:none}}.interactiveIconSmall{display:inline-block;position:absolute;right:5px;top:-2px}@media (min-width: 900px){.interactiveIconSmall{display:none}}.imageContainer{max-width:100%}@media (min-width: 900px){.imageContainer{max-width:400px}}.contentContainer{max-height:100%;max-width:100%}@media (min-width: 900px){.contentContainer{max-width:50%}}.secondaryContentContainer{display:flex}.imageLight{border-radius:8px;max-height:100%;max-width:100%}.imageDark{border-radius:8px;max-height:100%;max-width:100%}.titleLight{font-family:var(--font-stack);font-size:16px;font-weight:700;line-height:20px;margin-bottom:4px;margin-top:0;position:relative;-webkit-font-smoothing:antialiased;color:#292929}.titleDark{font-family:var(--font-stack);font-size:16px;font-weight:700;line-height:20px;margin-bottom:4px;margin-top:0;position:relative;-webkit-font-smoothing:antialiased;color:#FFFFFF}.subtitleContentLight{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-bottom:4px;margin-top:0px;-webkit-font-smoothing:antialiased;color:#737373}.subtitleContentDark{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-bottom:4px;margin-top:0px;-webkit-font-smoothing:antialiased;color:#BFBFBF}.primaryContentLight{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;-webkit-font-smoothing:antialiased;color:#404040}.primaryContentDark{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;-webkit-font-smoothing:antialiased;color:#E6E6E6}.secondaryContentLight{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;-webkit-font-smoothing:antialiased;color:#404040}.secondaryContentDark{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;-webkit-font-smoothing:antialiased;color:#E6E6E6}.tertiaryContentLight{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;-webkit-font-smoothing:antialiased;color:#404040}.tertiaryContentLight.hasContent::before{color:#404040;content:\"•\";font-size:10px;margin-left:5px;margin-right:5px}.tertiaryContentDark{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;-webkit-font-smoothing:antialiased;color:#E6E6E6}.tertiaryContentDark.hasContent::before{color:#404040;content:\"•\";font-size:10px;margin-left:5px;margin-right:5px}";
130
138
  const SearchcraftBaseSearchResultStyle0 = searchcraftBaseSearchResultModuleCss;
131
139
 
132
140
  const SearchcraftBaseSearchResult = class {
@@ -135,49 +143,62 @@ const SearchcraftBaseSearchResult = class {
135
143
  this.buttonCallback = index.createEvent(this, "buttonCallback", 7);
136
144
  this.keyDownCallback = index.createEvent(this, "keyDownCallback", 7);
137
145
  this.resultCallback = index.createEvent(this, "resultCallback", 7);
138
- this.buttonCallback = () => { }; // Callback for button click
139
- this.keyDownCallback = () => { }; // Callback for key down event
140
- this.resultCallback = () => { }; // Callback for result container click
146
+ this.buttonCallback = () => { };
147
+ this.keyDownCallback = () => { };
148
+ this.resultCallback = () => { };
149
+ this.searchcraftStore = store.useSearchcraftStore.getState();
141
150
  this.handleButtonClick = () => {
142
151
  this.buttonCallback();
143
152
  };
144
- this.handleContainerClick = () => {
145
- if (this.isInteractive) {
146
- this.resultCallback();
153
+ this.handleClick = () => {
154
+ var _a, _b, _c;
155
+ const searchcraft = this.searchcraftStore.getSearchcraftInstance();
156
+ if (searchcraft) {
157
+ const document_position = this.documentPosition;
158
+ const search_term = this.searchcraftStore.query;
159
+ const number_of_documents = ((_c = (_b = (_a = this.searchcraftStore.searchResults) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.hits) === null || _c === void 0 ? void 0 : _c.length) || 0;
160
+ searchcraft.sendMeasureEvent('document_clicked', {
161
+ document_position,
162
+ number_of_documents,
163
+ search_term,
164
+ });
165
+ }
166
+ };
167
+ this.parseStyles = () => {
168
+ try {
169
+ return JSON.parse(this.customStyles);
170
+ }
171
+ catch (error) {
172
+ console.error('Error parsing custom styles:', error);
173
+ return {};
147
174
  }
148
175
  };
149
176
  this.buttonText = '';
150
177
  this.customStyles = '{}';
151
- this.headingText = '';
178
+ this.titleContent = '';
152
179
  this.imageDescription = '';
153
180
  this.imageSource = '';
154
181
  this.isInteractive = false;
182
+ this.linkHref = '';
155
183
  this.primaryContent = '';
156
184
  this.secondaryContent = '';
157
- this.subheadingText = '';
185
+ this.subtitleContent = '';
158
186
  this.tertiaryContent = '';
159
187
  this.themeMode = 'light';
160
188
  this.placeImageRight = false;
161
- }
162
- parseStyles() {
163
- try {
164
- return JSON.parse(this.customStyles);
165
- }
166
- catch (error) {
167
- console.error('Error parsing custom styles:', error);
168
- return {};
169
- }
189
+ this.documentPosition = 0;
170
190
  }
171
191
  render() {
172
192
  const isLightTheme = this.themeMode === 'light';
173
193
  const styles = this.parseStyles();
174
- const imageContainer = this.imageSource && (index.h("div", { key: '5446a636265cf330a7e67f7539dad7e25077ecda', class: 'imageContainer' }, index.h("img", { key: '59529cce35008eb171f4ee634ed94ff96e716dad', alt: this.imageDescription, class: isLightTheme ? 'imageLight' : 'imageDark', src: this.imageSource, style: styles.image || {} })));
175
- const contentContainer = (index.h("div", { key: 'fd052ef1e3dedcf5b1467b6b0760d0be349c1faf', class: 'contentContainer' }, index.h("h2", { key: '1d1eca475651641b34d477ea7e2ea2f3eb7a2c49', class: isLightTheme ? 'headingLight' : 'headingDark', style: styles.heading || {} }, this.headingText), index.h("h3", { key: '9fcf054f634d088b72b67a2675b67a89f651285b', class: isLightTheme ? 'subheadingLight' : 'subheadingDark', style: styles.subheading || {} }, this.subheadingText), index.h("p", { key: '477078081008771a462abb042232b84f1e72ddd5', class: isLightTheme ? 'primaryContentLight' : 'primaryContentDark', style: styles.primaryContent || {} }, this.primaryContent), index.h("div", { key: '716ea0fe1efbd18f0b6313baac80834fbab53001', class: 'secondaryContentContainer' }, index.h("p", { key: '340dad3f568e5cc2b0a1b412b92a335b9afb7a0f', class: isLightTheme ? 'secondaryContentLight' : 'secondaryContentDark', style: styles.secondaryContent || {} }, this.secondaryContent), index.h("p", { key: 'b0c940aab4b48d4e560aabe7551b3c1a0a4ef3ae', class: isLightTheme ? 'tertiaryContentLight' : 'tertiaryContentDark', style: styles.tertiaryContent || {} }, this.tertiaryContent)), this.buttonText && (index.h("button", { key: 'd9a08ff62c8bc7d2b13bb42872e2391290de0712', onClick: this.handleButtonClick, style: styles.button || {}, type: 'button' }, this.buttonText))));
176
- return (index.h("div", { key: '310676a0e48c3a3d76559b3e3012db1681a55499', class: this.isInteractive
194
+ const imageStyle = isLightTheme ? 'imageLight' : 'imageDark';
195
+ const imageContainer = this.imageSource && (index.h("div", { key: '53541a311548a653d43505356b9a4f25a417093f', class: index$1.classNames('imageContainer', 'searchcraft-base-search-result-image-container') }, index.h("img", { key: '919a46fd856b521a548c2ce6bab8b360507469c2', alt: this.imageDescription, class: index$1.classNames(imageStyle, 'searchcraft-search-result-image'), src: this.imageSource, style: styles.image || {} })));
196
+ const contentContainer = (index.h("div", { key: '944700daf2a0b683769bad992253a8482f71f685', class: index$1.classNames('contentContainer', 'searchcraft-base-search-result-content-container') }, index.h("h2", { key: '623096e2c7cf5f11bac7127cb00342386866089e', class: index$1.classNames(isLightTheme ? 'titleLight' : 'titleDark', 'searchcraft-base-search-result-title'), style: styles.title || {} }, this.titleContent), index.h("h3", { key: '2928f4d872e90d99fac31b75c9fecfee7e2a9a41', class: index$1.classNames(isLightTheme ? 'subtitleContentLight' : 'subtitleContentDark', 'searchcraft-base-search-result-subtitle'), style: styles.subtitle || {} }, this.subtitleContent), index.h("p", { key: '93bd00c9482d492a2d3d6262dba33044d4470d2c', class: index$1.classNames(isLightTheme ? 'primaryContentLight' : 'primaryContentDark', 'searchcraft-base-search-result-primary-content'), style: styles.primaryContent || {} }, this.primaryContent), index.h("div", { key: 'dc3bce7c0f75d121ba3068b3717fd5d934036012', class: index$1.classNames('secondaryContentContainer', 'searchcraft-base-search-result-secondary-content-container') }, index.h("p", { key: '80624ec83a0a7086142b6a35b4ac65d1fdb76a4e', class: index$1.classNames(isLightTheme ? 'secondaryContentLight' : 'secondaryContentDark', 'searchcraft-base-search-result-secondary-content'), style: styles.secondaryContent || {} }, this.secondaryContent), index.h("p", { key: '53bdb3471b16fd4a1f525d99472c3a4d5662b722', class: index$1.classNames(`${isLightTheme ? 'tertiaryContentLight' : 'tertiaryContentDark'}${this.tertiaryContent ? ' hasContent' : ''}`, 'searchcraft-base-search-result-tertiary-content'), style: styles.tertiaryContent || {} }, this.tertiaryContent)), this.buttonText && (index.h("button", { key: '442dc9aebe748ef06710e196382a80bf006a383e', onClick: this.handleButtonClick, style: styles.button || {}, type: 'button' }, this.buttonText))));
197
+ return (index.h("a", { key: '2cf6a6d3768266f6d46e700588083aade92142f7', class: index$1.classNames(this.isInteractive
177
198
  ? isLightTheme
178
199
  ? 'interactiveResultContainerLight'
179
200
  : 'interactiveResultContainerDark'
180
- : 'resultContainer', onKeyDown: this.keyDownCallback, onClick: this.handleContainerClick, style: styles.container || {}, tabindex: '0' }, this.placeImageRight ? (index.h(index.Fragment, null, contentContainer, imageContainer)) : (index.h(index.Fragment, null, imageContainer, contentContainer))));
201
+ : 'resultContainer', 'searchcraft-search-result-container'), onKeyDown: this.keyDownCallback, onClick: this.handleClick, href: this.linkHref, rel: 'noreferrer', style: styles.container || {}, tabindex: '0', target: '_blank' }, this.placeImageRight ? (index.h(index.Fragment, null, contentContainer, imageContainer)) : (index.h(index.Fragment, null, imageContainer, contentContainer))));
181
202
  }
182
203
  };
183
204
  SearchcraftBaseSearchResult.style = SearchcraftBaseSearchResultStyle0;
@@ -188,6 +209,7 @@ const SearchcraftBaseSearchResultsStyle0 = searchcraftBaseSearchResultsModuleCss
188
209
  const SearchcraftBaseSearchResults = class {
189
210
  constructor(hostRef) {
190
211
  index.registerInstance(this, hostRef);
212
+ this.noResults = index.createEvent(this, "noResults", 7);
191
213
  this.adInterval = 4;
192
214
  this.customStylesForResults = {};
193
215
  this.documentAttributesForDisplay = '';
@@ -196,6 +218,7 @@ const SearchcraftBaseSearchResults = class {
196
218
  this.placeAdAtEnd = false;
197
219
  this.placeAdAtStart = true;
198
220
  this.placeResultImageRight = false;
221
+ this.isInteractive = false;
199
222
  this.hasSearched = false;
200
223
  this.query = '';
201
224
  this.searchResults = null;
@@ -226,9 +249,9 @@ const SearchcraftBaseSearchResults = class {
226
249
  }
227
250
  }
228
251
  render() {
229
- var _a, _b, _c, _d, _e, _f, _g;
252
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
230
253
  if (!this.hasSearched) {
231
- return (index.h("div", { class: 'emptyState' }, index.h("slot", { name: 'empty-search' })));
254
+ return (index.h("div", { class: index$1.classNames('emptyState', 'searchcraft-search-results-empty-state-container') }, index.h("slot", { name: 'empty-search' })));
232
255
  }
233
256
  if (!((_a = this.searchResults) === null || _a === void 0 ? void 0 : _a.data)) {
234
257
  return;
@@ -251,17 +274,17 @@ const SearchcraftBaseSearchResults = class {
251
274
  }
252
275
  }
253
276
  }
254
- return (index.h("searchcraft-base-search-result", { "button-callback": () => console.log('button callback'), "custom-styles": serializedStyles, "image-source": dynamicProperties[parsedSearchKeys[parsedSearchKeys.length - 1]], "is-interactive": true, key: `${document.document_id}-${index$1}`, "keydown-callback": () => console.log('keydown'), "heading-text": dynamicProperties[parsedSearchKeys[0]], "place-image-right": this.placeResultImageRight, "primary-content": dynamicProperties[parsedSearchKeys[2]], "result-callback": () => console.log('interactive element'), "secondary-content": dynamicProperties[parsedSearchKeys[3]], "subheading-text": dynamicProperties[parsedSearchKeys[1]], "tertiary-content": dynamicProperties[parsedSearchKeys[4]] }));
277
+ return (index.h("searchcraft-base-search-result", { "button-callback": () => console.log('button callback'), "custom-styles": serializedStyles, "image-source": dynamicProperties[parsedSearchKeys[5]], "is-interactive": this.isInteractive, key: `${document.document_id}-${index$1}`, "keydown-callback": () => console.log('keydown'), linkHref: dynamicProperties[parsedSearchKeys[6]], "place-image-right": this.placeResultImageRight, "primary-content": dynamicProperties[parsedSearchKeys[2]], "result-callback": () => console.log('interactive element'), "secondary-content": dynamicProperties[parsedSearchKeys[3]], "subtitle-content": dynamicProperties[parsedSearchKeys[1]], "tertiary-content": dynamicProperties[parsedSearchKeys[4]], "title-content": dynamicProperties[parsedSearchKeys[0]], "document-position": index$1 }));
255
278
  });
256
279
  const finalComponents = [];
257
280
  if (this.placeAdAtStart) {
258
- finalComponents.push(index.h("div", { key: 'ad-section-start', class: 'adSection' }, index.h("span", null, "##"), index.h("p", null, " Ad Impressions")));
281
+ finalComponents.push(index.h("div", { key: 'ad-section-start', class: index$1.classNames('adSection', 'searchcraft-beginning-injected-ad-section') }, index.h("span", null, "##"), index.h("p", null, " Ad Impressions")));
259
282
  }
260
283
  if (this.adInterval > 0) {
261
- resultsComponents.forEach((component, index$1) => {
284
+ resultsComponents.forEach((component, index$2) => {
262
285
  finalComponents.push(component);
263
- if ((index$1 + 1) % this.adInterval === 0) {
264
- finalComponents.push(index.h("div", { key: `ad-section-${index$1 + 1}`, class: 'adSection' }, index.h("span", null, "##"), index.h("p", null, " Ad Impressions")));
286
+ if ((index$2 + 1) % this.adInterval === 0) {
287
+ finalComponents.push(index.h("div", { key: `ad-section-${index$2 + 1}`, class: index$1.classNames('adSection', 'searchcraft-dynamic-injected-ad-section') }, index.h("span", null, "##"), index.h("p", null, " Ad Impressions")));
265
288
  }
266
289
  });
267
290
  }
@@ -269,10 +292,13 @@ const SearchcraftBaseSearchResults = class {
269
292
  finalComponents.push(...resultsComponents);
270
293
  }
271
294
  if (this.placeAdAtEnd) {
272
- finalComponents.push(index.h("div", { key: 'ad-section-end', class: 'adSection' }, index.h("span", null, "##"), index.h("p", null, " Ad Impressions")));
295
+ finalComponents.push(index.h("div", { key: 'ad-section-end', class: index$1.classNames('adSection', 'searchcraft-end-injected-ad-section') }, index.h("span", null, "##"), index.h("p", null, " Ad Impressions")));
296
+ }
297
+ if (this.query.length > 0 && ((_g = (_f = (_e = this.searchResults) === null || _e === void 0 ? void 0 : _e.data) === null || _f === void 0 ? void 0 : _f.hits) === null || _g === void 0 ? void 0 : _g.length) === 0) {
298
+ this.noResults.emit();
273
299
  }
274
- return (index.h("div", { class: 'resultsContainer' }, finalComponents, this.query.length > 0 &&
275
- ((_g = (_f = (_e = this.searchResults) === null || _e === void 0 ? void 0 : _e.data) === null || _f === void 0 ? void 0 : _f.hits) === null || _g === void 0 ? void 0 : _g.length) === 0 && (index.h("div", { class: 'errorMessageContainer' }, index.h("searchcraft-error-message", { "error-message": `No search results found for "${this.query}" query` })))));
300
+ return (index.h("div", { class: index$1.classNames('resultsContainer', 'searchcraft-search-results-container') }, finalComponents, this.query.length > 0 &&
301
+ ((_k = (_j = (_h = this.searchResults) === null || _h === void 0 ? void 0 : _h.data) === null || _j === void 0 ? void 0 : _j.hits) === null || _k === void 0 ? void 0 : _k.length) === 0 && (index.h("div", { class: index$1.classNames('errorMessageContainer', 'searchcraft-search-results-error-message-container') }, index.h("searchcraft-error-message", { "error-message": `No search results found for "${this.query}" query` })))));
276
302
  }
277
303
  };
278
304
  SearchcraftBaseSearchResults.style = SearchcraftBaseSearchResultsStyle0;
@@ -307,13 +333,16 @@ const SearchcraftClearIconSet = class {
307
333
  }
308
334
  };
309
335
 
310
- const searchcraftClearInputButtonModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.inputClearButtonLTR{align-items:center;background:none;border:none;display:flex;height:20px;justify-content:center;padding:0;position:absolute;right:0;top:50%;transform:translateY(-50%);width:20px}.inputClearButtonRTL{align-items:center;background:none;border:none;display:flex;height:20px;justify-content:center;left:0px;padding:0;position:absolute;top:50%;transform:translateY(-50%);width:20px}";
336
+ const searchcraftClearInputButtonModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.inputClearButtonLTR{align-items:center;background:none;border:none;display:flex;height:20px;justify-content:center;padding:0;position:absolute;right:16px;top:52%;transform:translateY(-50%);width:20px}.inputClearButtonRTL{align-items:center;background:none;border:none;display:flex;height:20px;justify-content:center;left:0px;padding:0;position:absolute;top:52%;transform:translateY(-50%);width:20px}";
311
337
  const SearchcraftClearInputButtonStyle0 = searchcraftClearInputButtonModuleCss;
312
338
 
313
339
  const SearchcraftClearInputButton = class {
314
340
  constructor(hostRef) {
315
341
  index.registerInstance(this, hostRef);
316
342
  this.clearInput = index.createEvent(this, "clearInput", 7);
343
+ this.isLightTheme = () => {
344
+ return this.theme === 'light';
345
+ };
317
346
  this.handleClearClick = (event) => {
318
347
  event.preventDefault();
319
348
  this.clearInput.emit();
@@ -322,11 +351,8 @@ const SearchcraftClearInputButton = class {
322
351
  this.rightToLeftOrientation = false;
323
352
  this.theme = 'light';
324
353
  }
325
- isLightTheme() {
326
- return this.theme === 'light';
327
- }
328
354
  render() {
329
- return this.rightToLeftOrientation ? (index.h("button", { class: index$1.classNames('inputClearButtonRTL', '.sc-clear-input-button-rtl'), onClick: this.handleClearClick, type: 'button' }, this.isRequesting ? (this.isLightTheme ? (index.h("searchcraft-spinner-light", null)) : (index.h("searchcraft-spinner-dark", null))) : this.isLightTheme ? (index.h("searchcraft-clear-icon-set", { type: 'clear-light' })) : (index.h("searchcraft-clear-icon-set", { type: 'clear-dark' })))) : (index.h("button", { class: index$1.classNames('inputClearButtonLTR', '.sc-clear-input-button-ltr'), onClick: this.handleClearClick, type: 'button' }, this.isRequesting ? (this.isLightTheme ? (index.h("searchcraft-spinner-light", null)) : (index.h("searchcraft-spinner-dark", null))) : this.isLightTheme ? (index.h("searchcraft-clear-icon-set", { type: 'clear-light' })) : (index.h("searchcraft-clear-icon-set", { type: 'clear-dark' }))));
355
+ return this.rightToLeftOrientation ? (index.h("button", { class: index$1.classNames('inputClearButtonRTL', 'searchcraft-clear-input-button-rtl'), onClick: this.handleClearClick, type: 'button' }, this.isLightTheme ? (index.h("searchcraft-clear-icon-set", { type: 'clear-light' })) : (index.h("searchcraft-clear-icon-set", { type: 'clear-dark' })))) : (index.h("button", { class: index$1.classNames('inputClearButtonLTR', 'searchcraft-clear-input-button-ltr'), onClick: this.handleClearClick, type: 'button' }, this.isLightTheme ? (index.h("searchcraft-clear-icon-set", { type: 'clear-light' })) : (index.h("searchcraft-clear-icon-set", { type: 'clear-dark' }))));
330
356
  }
331
357
  };
332
358
  SearchcraftClearInputButton.style = SearchcraftClearInputButtonStyle0;
@@ -351,12 +377,12 @@ const SearchcraftErrorMessage = class {
351
377
  }
352
378
  render() {
353
379
  const errorMessageStyle = this.theme === 'light' ? 'errorMessageLight' : 'errorMessageDark';
354
- return (index.h("p", { key: '7c26f9a1b2589d57a81f7909c456e712d9b7fe79', class: index$1.classNames(errorMessageStyle) }, this.errorMessage || 'Search term is required.'));
380
+ return (index.h("p", { key: '877438178c5fe951ff4cd184de7130e4e46739a1', class: index$1.classNames(errorMessageStyle, 'searchcraft-error-message') }, this.errorMessage || 'Search term is required.'));
355
381
  }
356
382
  };
357
383
  SearchcraftErrorMessage.style = SearchcraftErrorMessageStyle0;
358
384
 
359
- const searchcraftFiltersListModuleCss = ".filtersList{width:100%}.checkboxLabel{align-items:center;color:#292929;display:flex;font-family:\"Source Sans Pro\";font-size:14px;font-weight:600;gap:14px;position:relative;-webkit-font-smoothing:antialiased}.checkboxLabel input[type=checkbox]{align-items:center;appearance:none;background-color:#EDEDED;border:1px solid #D9D9D9;border-radius:8px;cursor:pointer;display:flex;height:24px;justify-content:center;width:24px}.checkboxLabel input[type=checkbox]:focus{outline:2px solid #007DB3}.checkboxLabel input[type=checkbox]:checked{background-color:#007DB3;position:relative}.checkboxLabel input[type=checkbox]:checked+.checkContainer{display:block}.checkboxLabel input[type=checkbox]:checked+.dashContainer{display:block}.remainingFilterListCheckbox{margin-left:16px}.childCheckboxLabel{align-items:center;color:#292929;display:flex;font-family:\"Source Sans Pro\";font-size:14px;font-weight:600;gap:12px;position:relative}.childCheckboxLabel input[type=checkbox]{align-items:center;appearance:none;background-color:#EDEDED;border:1px solid #D9D9D9;border-radius:8px;cursor:pointer;display:flex;height:24px;justify-content:center;position:relative;width:24px;-webkit-font-smoothing:antialiased}.childCheckboxLabel input[type=checkbox]:focus{outline:2px solid #007DB3}.childCheckboxLabel input[type=checkbox]:checked{background-color:#007DB3;position:relative}.childCheckboxLabel input[type=checkbox]:checked+.checkContainer{display:block}.childCheckboxLabel 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}";
385
+ const searchcraftFiltersListModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.filtersListContainer{width:100%}.filterCheckboxLabel{align-items:center;color:#292929;display:flex;font-family:var(--font-stack);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:#EBEBEB;border:1px solid #D9D9D9;border-radius:8px;cursor:pointer;display:flex;height:24px;justify-content:center;width:24px}.filterCheckboxLabel input[type=checkbox]:focus{outline:2px solid #000000}.filterCheckboxLabel input[type=checkbox]:checked{background-color:#000000;position:relative}.filterCheckboxLabel input[type=checkbox]:checked+.checkContainer{display:block}.filterCheckboxLabel input[type=checkbox]:checked+.dashContainer{display:block}.childFilterCheckboxLabel{align-items:center;color:#292929;display:flex;font-family:var(--font-stack);font-size:14px;font-weight:600;gap:12px;margin-left:24px;position:relative}.childFilterCheckboxLabel input[type=checkbox]{align-items:center;appearance:none;background-color:#EBEBEB;border:1px solid #D9D9D9;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 #000000}.childFilterCheckboxLabel input[type=checkbox]:checked{background-color:#000000;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}";
360
386
  const SearchcraftFiltersListStyle0 = searchcraftFiltersListModuleCss;
361
387
 
362
388
  const SearchcraftFiltersList = class {
@@ -370,6 +396,7 @@ const SearchcraftFiltersList = class {
370
396
  this.searchStore.setSelectedFilters([]);
371
397
  this.emitFiltersUpdate();
372
398
  };
399
+ this.formatLabel = (label, count) => `${label.replace(/-/g, ' ').replace(/\b\w/g, (char) => char.toUpperCase())} (${count})`;
373
400
  this.filters = [];
374
401
  this.dynamicFilters = [];
375
402
  this.selectedFilters = [];
@@ -424,7 +451,6 @@ const SearchcraftFiltersList = class {
424
451
  const parentFilter = this.dynamicFilters.find((filter) => filter.value === value);
425
452
  const childValues = ((_a = parentFilter === null || parentFilter === void 0 ? void 0 : parentFilter.children) === null || _a === void 0 ? void 0 : _a.map((child) => child.value)) || [];
426
453
  if (!isChecked) {
427
- // Remove children from selectedFilters when parent is unchecked
428
454
  this.selectedFilters = this.selectedFilters.filter((filter) => filter !== value && !childValues.includes(filter));
429
455
  }
430
456
  else {
@@ -443,23 +469,19 @@ const SearchcraftFiltersList = class {
443
469
  this.searchStore.setSelectedFilters(this.selectedFilters);
444
470
  this.searchStore.search();
445
471
  }
446
- formatLabel(label, count) {
447
- return `${label.replace(/-/g, ' ').replace(/\b\w/g, (char) => char.toUpperCase())} (${count})`;
448
- }
449
472
  render() {
450
473
  if (!this.query || this.resultsCount === 0) {
451
474
  return null;
452
475
  }
453
- return (index.h("div", { class: 'filtersList' }, this.dynamicFilters.map((filter) => {
476
+ return (index.h("div", { class: index$1.classNames('filtersListContainer', 'searchcraft-filters-list-container') }, this.dynamicFilters.map((filter) => {
454
477
  const isChildSelected = filter.children
455
478
  ? filter.children.some((child) => this.selectedFilters.includes(child.value))
456
479
  : false;
457
- return (index.h("div", { key: filter.value, class: 'filterItem' }, index.h("label", { class: 'checkboxLabel' }, index.h("input", { checked: this.selectedFilters.includes(filter.value), onChange: (event) => this.handleCheckboxChange(filter.value, event.target.checked, true), type: 'checkbox' }), isChildSelected ? (index.h("div", { class: 'dashContainer' }, index.h("searchcraft-dash-icon", null))) : (index.h("div", { class: 'checkContainer' }, index.h("searchcraft-check-icon", null))), this.formatLabel(filter.label, filter.count)), filter.children && filter.children.length > 0 && (index.h("div", { class: 'childrenContainer' }, filter.children.map((child) => (index.h("label", { key: child.value, class: 'childCheckboxLabel', style: {
458
- marginLeft: '20px',
480
+ return (index.h("div", { key: filter.value, class: index$1.classNames('searchcraft-filters-list-item') }, index.h("label", { class: index$1.classNames('filterCheckboxLabel', 'searchcraft-filters-list-checkbox-label') }, index.h("input", { checked: this.selectedFilters.includes(filter.value), onChange: (event) => this.handleCheckboxChange(filter.value, event.target.checked, true), type: 'checkbox' }), isChildSelected ? (index.h("div", { class: index$1.classNames('dashContainer', 'searchcraft-filter-list-dash-container') }, index.h("searchcraft-dash-icon", null))) : (index.h("div", { class: index$1.classNames('checkContainer', 'searchcraft-filter-list-check-container') }, index.h("searchcraft-check-icon", null))), this.formatLabel(filter.label, filter.count)), filter.children && filter.children.length > 0 && (index.h(index.Fragment, null, filter.children.map((child) => (index.h("label", { key: child.value, class: index$1.classNames('childFilterCheckboxLabel', 'searchcraft-child-filter-checkbox-label'), style: {
459
481
  display: this.selectedFilters.includes(filter.value)
460
482
  ? 'flex'
461
483
  : 'none',
462
- } }, index.h("input", { type: 'checkbox', checked: this.selectedFilters.includes(child.value), onChange: (event) => this.handleCheckboxChange(child.value, event.target.checked) }), index.h("div", { class: 'checkContainer' }, index.h("searchcraft-check-icon", null)), this.formatLabel(child.label.includes('/')
484
+ } }, index.h("input", { checked: this.selectedFilters.includes(child.value), onChange: (event) => this.handleCheckboxChange(child.value, event.target.checked), type: 'checkbox' }), index.h("div", { class: index$1.classNames('checkContainer', 'searchcraft-filter-list-check-container') }, index.h("searchcraft-check-icon", null)), this.formatLabel(child.label.includes('/')
463
485
  ? child.label.split('/').pop() || child.label
464
486
  : child.label, child.count))))))));
465
487
  })));
@@ -467,7 +489,7 @@ const SearchcraftFiltersList = class {
467
489
  };
468
490
  SearchcraftFiltersList.style = SearchcraftFiltersListStyle0;
469
491
 
470
- const searchcraftInputModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.inputContainerLTR{position:relative;width:100%}.inputContainerRTL{position:relative;width:100%;margin-left:8px}.inputLightLTR{border:none;border-radius:8px;font-family:\"Brygada 1918\";outline:none;padding-bottom:15px;padding-top:15px;width:100%;background-color:#EDEDED;color:#292929;margin-right:8px;padding-left:36px;padding-right:16px}.inputLightLTR::placeholder{font-family:\"Brygada 1918\";font-size:16px;font-weight:600}.inputLightLTR::placeholder{color:#737373}.inputLightLTR:focus{outline:2px solid #000}.inputDarkLTR{border:none;border-radius:8px;font-family:\"Brygada 1918\";outline:none;padding-bottom:15px;padding-top:15px;width:100%;background-color:#1A1A1A;color:#FFF;margin-right:8px;padding-left:36px;padding-right:16px}.inputDarkLTR::placeholder{font-family:\"Brygada 1918\";font-size:16px;font-weight:600}.inputDarkLTR::placeholder{color:#BFBFBF}.inputDarkLTR:focus{outline:2px solid #FFF}.inputErrorLightLTR{border:none;border-radius:8px;font-family:\"Brygada 1918\";outline:none;padding-bottom:15px;padding-top:15px;width:100%;background-color:#EDEDED;color:#292929;outline:2px solid #c00;margin-right:8px;padding-left:36px;padding-right:16px}.inputErrorLightLTR::placeholder{font-family:\"Brygada 1918\";font-size:16px;font-weight:600}.inputErrorLightLTR::placeholder{color:#737373}.inputErrorLightLTR:focus{outline:2px solid #000}.inputErrorLightLTR:focus-visible{outline:2px solid #c00}.inputErrorDarkLTR{border:none;border-radius:8px;font-family:\"Brygada 1918\";outline:none;padding-bottom:15px;padding-top:15px;width:100%;background-color:#1A1A1A;color:#FFF;outline:2px solid #FFB3B3;margin-right:8px;padding-left:36px;padding-right:16px}.inputErrorDarkLTR::placeholder{font-family:\"Brygada 1918\";font-size:16px;font-weight:600}.inputErrorDarkLTR::placeholder{color:#BFBFBF}.inputErrorDarkLTR:focus{outline:2px solid #FFF}.inputErrorDarkLTR:focus-visible{outline:2px solid #FFB3B3}.inputLightRTL{border:none;border-radius:8px;font-family:\"Brygada 1918\";outline:none;padding-bottom:15px;padding-top:15px;width:100%;background-color:#EDEDED;color:#292929;margin-left:8px;padding-left:16px;padding-right:36px;text-align:right}.inputLightRTL::placeholder{font-family:\"Brygada 1918\";font-size:16px;font-weight:600}.inputLightRTL::placeholder{color:#737373}.inputLightRTL:focus{outline:2px solid #000}.inputDarkRTL{border:none;border-radius:8px;font-family:\"Brygada 1918\";outline:none;padding-bottom:15px;padding-top:15px;width:100%;background-color:#1A1A1A;color:#FFF;margin-left:8px;padding-left:16px;padding-right:36px;text-align:right}.inputDarkRTL::placeholder{font-family:\"Brygada 1918\";font-size:16px;font-weight:600}.inputDarkRTL::placeholder{color:#BFBFBF}.inputDarkRTL:focus{outline:2px solid #FFF}.inputErrorLightRTL{border:none;border-radius:8px;font-family:\"Brygada 1918\";outline:none;padding-bottom:15px;padding-top:15px;width:100%;background-color:#EDEDED;color:#292929;outline:2px solid #c00;margin-left:8px;padding-left:16px;padding-right:36px;text-align:right}.inputErrorLightRTL::placeholder{font-family:\"Brygada 1918\";font-size:16px;font-weight:600}.inputErrorLightRTL::placeholder{color:#737373}.inputErrorLightRTL:focus{outline:2px solid #000}.inputErrorLightRTL:focus-visible{outline:2px solid #c00}.inputErrorDarkRTL{border:none;border-radius:8px;font-family:\"Brygada 1918\";outline:none;padding-bottom:15px;padding-top:15px;width:100%;background-color:#1A1A1A;color:#FFF;outline:2px solid #FFB3B3;margin-left:8px;padding-left:16px;padding-right:36px;text-align:right}.inputErrorDarkRTL::placeholder{font-family:\"Brygada 1918\";font-size:16px;font-weight:600}.inputErrorDarkRTL::placeholder{color:#BFBFBF}.inputErrorDarkRTL:focus{outline:2px solid #FFF}.inputErrorDarkRTL:focus-visible{outline:2px solid #FFB3B3}.inputWrapper{align-items:center;display:flex;position:relative;width:100%}";
492
+ const searchcraftInputModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.inputContainerLTR{position:relative;width:100%}.inputContainerRTL{position:relative;width:100%;margin-left:8px}.inputLightLTR{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;background-color:#F3F3F3;color:#292929;margin-right:8px;padding-left:36px;padding-right:16px}.inputLightLTR::placeholder{font-family:var(--font-stack);font-size:16px;font-weight:400}.inputLightLTR::placeholder{color:#737373}.inputLightLTR:focus{outline:2px solid #000000}.inputDarkLTR{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;background-color:#1A1A1A;color:#FFFFFF;margin-right:8px;padding-left:36px;padding-right:16px}.inputDarkLTR::placeholder{font-family:var(--font-stack);font-size:16px;font-weight:400}.inputDarkLTR::placeholder{color:#BFBFBF}.inputDarkLTR:focus{outline:2px solid #FFFFFF}.inputErrorLightLTR{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;background-color:#F3F3F3;color:#292929;outline:2px solid #CC0000;margin-right:8px;padding-left:36px;padding-right:16px}.inputErrorLightLTR::placeholder{font-family:var(--font-stack);font-size:16px;font-weight:400}.inputErrorLightLTR::placeholder{color:#737373}.inputErrorLightLTR:focus{outline:2px solid #000000}.inputErrorLightLTR:focus-visible{outline:2px solid #CC0000}.inputErrorDarkLTR{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;background-color:#1A1A1A;color:#FFFFFF;outline:2px solid #FFB3B3;margin-right:8px;padding-left:36px;padding-right:16px}.inputErrorDarkLTR::placeholder{font-family:var(--font-stack);font-size:16px;font-weight:400}.inputErrorDarkLTR::placeholder{color:#BFBFBF}.inputErrorDarkLTR:focus{outline:2px solid #FFFFFF}.inputErrorDarkLTR:focus-visible{outline:2px solid #FFB3B3}.inputLightRTL{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;background-color:#F3F3F3;color:#292929;margin-left:8px;padding-left:16px;padding-right:36px;text-align:right}.inputLightRTL::placeholder{font-family:var(--font-stack);font-size:16px;font-weight:400}.inputLightRTL::placeholder{color:#737373}.inputLightRTL:focus{outline:2px solid #000000}.inputDarkRTL{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;background-color:#1A1A1A;color:#FFFFFF;margin-left:8px;padding-left:16px;padding-right:36px;text-align:right}.inputDarkRTL::placeholder{font-family:var(--font-stack);font-size:16px;font-weight:400}.inputDarkRTL::placeholder{color:#BFBFBF}.inputDarkRTL:focus{outline:2px solid #FFFFFF}.inputErrorLightRTL{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;background-color:#F3F3F3;color:#292929;outline:2px solid #CC0000;margin-left:8px;padding-left:16px;padding-right:36px;text-align:right}.inputErrorLightRTL::placeholder{font-family:var(--font-stack);font-size:16px;font-weight:400}.inputErrorLightRTL::placeholder{color:#737373}.inputErrorLightRTL:focus{outline:2px solid #000000}.inputErrorLightRTL:focus-visible{outline:2px solid #CC0000}.inputErrorDarkRTL{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;background-color:#1A1A1A;color:#FFFFFF;outline:2px solid #FFB3B3;margin-left:8px;padding-left:16px;padding-right:36px;text-align:right}.inputErrorDarkRTL::placeholder{font-family:var(--font-stack);font-size:16px;font-weight:400}.inputErrorDarkRTL::placeholder{color:#BFBFBF}.inputErrorDarkRTL:focus{outline:2px solid #FFFFFF}.inputErrorDarkRTL:focus-visible{outline:2px solid #FFB3B3}.inputWrapper{align-items:center;display:flex;position:relative;width:100%}";
471
493
  const SearchcraftInputStyle0 = searchcraftInputModuleCss;
472
494
 
473
495
  const SearchcraftInput = class {
@@ -476,6 +498,23 @@ const SearchcraftInput = class {
476
498
  this.clearInput = index.createEvent(this, "clearInput", 7);
477
499
  this.searchInputChange = index.createEvent(this, "searchInputChange", 7);
478
500
  this.inputKeyUp = index.createEvent(this, "inputKeyUp", 7);
501
+ this.handleInputChange = (event) => {
502
+ const input = event.target;
503
+ this.searchInputChange.emit(input.value);
504
+ };
505
+ this.handleInputKeyUp = (event) => {
506
+ const input = event.target;
507
+ this.inputKeyUp.emit(input.value);
508
+ };
509
+ this.handleClearInput = () => {
510
+ if (this.query === '') {
511
+ return;
512
+ }
513
+ this.query = '';
514
+ if (this.clearInput) {
515
+ this.clearInput.emit();
516
+ }
517
+ };
479
518
  this.customStyles = {};
480
519
  this.error = false;
481
520
  this.formClassName = '';
@@ -493,39 +532,22 @@ const SearchcraftInput = class {
493
532
  get isLightTheme() {
494
533
  return this.theme === 'light';
495
534
  }
496
- handleInputChange(event) {
497
- const input = event.target;
498
- this.searchInputChange.emit(input.value);
499
- }
500
- handleInputKeyUp(event) {
501
- const input = event.target;
502
- this.inputKeyUp.emit(input.value);
503
- }
504
- handleClearInput() {
505
- if (this.query === '') {
506
- return;
507
- }
508
- this.query = '';
509
- if (this.clearInput) {
510
- this.clearInput.emit();
511
- }
512
- }
513
535
  render() {
514
536
  const containerClassName = this.rightToLeftOrientation
515
537
  ? 'inputContainerRTL'
516
538
  : 'inputContainerLTR';
517
- const inputClassName = index$1.classNames(this.error
539
+ const inputClassName = this.error
518
540
  ? this.isLightTheme
519
541
  ? 'inputErrorLightRTL'
520
542
  : 'inputErrorDarkRTL'
521
543
  : this.isLightTheme
522
544
  ? 'inputLightLTR'
523
- : 'inputDarkLTR', 'searchcraft-input');
545
+ : 'inputDarkLTR';
524
546
  const validatedCustomStyles = store.parseCustomStyles(this.customStyles);
525
547
  const placeholderStyle = {
526
548
  fontSize: validatedCustomStyles.placeholderFontSize || '16px',
527
549
  };
528
- return (index.h("div", { key: '7047cbe1692a4c8f11232d7f65e00824703d8b50', class: index$1.classNames(containerClassName, this.formClassName, 'searchcraft-input-form') }, this.rightToLeftOrientation ? (index.h(index.Fragment, null, index.h("input", { autoComplete: 'off', class: index$1.classNames(inputClassName, 'searchcraft-input'), id: 'searchcraft-input-id', onChange: this.handleInputChange.bind(this), onKeyUp: this.handleInputKeyUp.bind(this), placeholder: this.placeholderValue, type: 'text', value: this.query, style: validatedCustomStyles }), index.h("style", null, `
550
+ return (index.h("div", { key: '931c969802f73f4fa4d44ea591b506e5d1f9caf1', class: index$1.classNames(containerClassName, this.formClassName, 'searchcraft-input-form') }, this.rightToLeftOrientation ? (index.h(index.Fragment, null, index.h("input", { autoComplete: 'off', class: index$1.classNames(inputClassName, 'searchcraft-input'), id: 'searchcraft-input-id', onChange: this.handleInputChange.bind(this), onKeyUp: this.handleInputKeyUp.bind(this), placeholder: this.placeholderValue, style: validatedCustomStyles, type: 'text', value: this.query }), index.h("style", null, `
529
551
  #searchcraft-input-id::placeholder {
530
552
  font-size: ${placeholderStyle.fontSize};
531
553
  }
@@ -560,18 +582,18 @@ const SearchcraftInputCaption = class {
560
582
  : 'inputCaptionErrorDarkRTL'
561
583
  : this.isLightTheme
562
584
  ? 'inputCaptionLightRTL'
563
- : 'inputCaptionDarkRTL', this.inputCaptionClassName, '.searchcraft-input-caption') }, this.inputCaptionValue)) : (index.h("p", { class: index$1.classNames(this.error
585
+ : 'inputCaptionDarkRTL', this.inputCaptionClassName, 'searchcraft-input-caption') }, this.inputCaptionValue)) : (index.h("p", { class: index$1.classNames(this.error
564
586
  ? this.isLightTheme
565
587
  ? 'inputCaptionErrorLightLTR'
566
588
  : 'inputCaptionErrorDarkLTR'
567
589
  : this.isLightTheme
568
590
  ? 'inputCaptionLightLTR'
569
- : 'inputCaptionDarkLTR', this.inputCaptionClassName, '.searchcraft-input-caption') }, this.inputCaptionValue));
591
+ : 'inputCaptionDarkLTR', this.inputCaptionClassName, 'searchcraft-input-caption') }, this.inputCaptionValue));
570
592
  }
571
593
  };
572
594
  SearchcraftInputCaption.style = SearchcraftInputCaptionStyle0;
573
595
 
574
- const searchcraftInputIconModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.inputIconLTR{left:15px;position:absolute;top:50%;transform:translateY(-50%)}.inputIconRTL{position:absolute;right:15px;top:50%;transform:translateY(-50%)}";
596
+ const searchcraftInputIconModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.inputIconLTR{left:15px;position:absolute;top:52%;transform:translateY(-50%)}.inputIconRTL{position:absolute;right:15px;top:52%;transform:translateY(-50%)}";
575
597
  const SearchcraftInputIconStyle0 = searchcraftInputIconModuleCss;
576
598
 
577
599
  const SearchcraftInputIcon = class {
@@ -587,12 +609,12 @@ const SearchcraftInputIcon = class {
587
609
  return this.theme === 'light';
588
610
  }
589
611
  render() {
590
- return this.error ? (index.h("div", { class: this.rightToLeftOrientation ? 'inputIconRTL' : 'inputIconLTR' }, this.isLightTheme() ? (index.h("searchcraft-search-icon-set", { height: this.height, type: 'error-light', width: this.width })) : (index.h("searchcraft-search-icon-set", { height: this.height, type: 'error-dark', width: this.width })))) : (index.h("div", { class: this.rightToLeftOrientation ? 'inputIconRTL' : 'inputIconLTR' }, this.isLightTheme() ? (index.h("searchcraft-search-icon-set", { height: this.height, type: 'search-light', width: this.width })) : (index.h("searchcraft-search-icon-set", { height: this.height, type: 'search-dark', width: this.width }))));
612
+ return this.error ? (index.h("div", { class: index$1.classNames(this.rightToLeftOrientation ? 'inputIconRTL' : 'inputIconLTR', 'searchcraft-input-icon-container') }, this.isLightTheme() ? (index.h("searchcraft-search-icon-set", { height: this.height, type: 'error-light', width: this.width })) : (index.h("searchcraft-search-icon-set", { height: this.height, type: 'error-dark', width: this.width })))) : (index.h("div", { class: index$1.classNames(this.rightToLeftOrientation ? 'inputIconRTL' : 'inputIconLTR', 'searchcraft-input-icon-container') }, this.isLightTheme() ? (index.h("searchcraft-search-icon-set", { height: this.height, type: 'search-light', width: this.width })) : (index.h("searchcraft-search-icon-set", { height: this.height, type: 'search-dark', width: this.width }))));
591
613
  }
592
614
  };
593
615
  SearchcraftInputIcon.style = SearchcraftInputIconStyle0;
594
616
 
595
- const searchcraftInputLabelModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.labelLight{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#292929}.labelDark{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#FFF}";
617
+ const searchcraftInputLabelModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.labelLight{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#292929}.labelDark{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#FFFFFF}";
596
618
  const SearchcraftInputLabelStyle0 = searchcraftInputLabelModuleCss;
597
619
 
598
620
  const SearchcraftInputLabel = class {
@@ -610,12 +632,12 @@ const SearchcraftInputLabel = class {
610
632
  return null;
611
633
  }
612
634
  const labelStyle = this.isLightTheme() ? 'labelLight' : 'labelDark';
613
- return (index.h("label", { class: index$1.classNames(labelStyle, this.inputLabelClassName), htmlFor: 'searchcraft-input-id' }, this.label));
635
+ return (index.h("label", { class: index$1.classNames(labelStyle, this.inputLabelClassName, 'searchcraft-input-label'), htmlFor: 'searchcraft-input-id' }, this.label));
614
636
  }
615
637
  };
616
638
  SearchcraftInputLabel.style = SearchcraftInputLabelStyle0;
617
639
 
618
- const searchcraftResultsInfoModuleCss = ".container{border-bottom:1px solid #D9D9D9;display:flex;justify-content:flex-start;width:100%}.resultsInfo{color:#292929;font-size:18px;font-weight:600;line-height:20px;margin:0;margin-bottom:8px}";
640
+ const searchcraftResultsInfoModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.resultsInfoContainer{border-bottom:1px solid #D9D9D9;display:flex;justify-content:flex-start;width:100%}.resultsInfoContent{color:#292929;font-family:var(--font-stack);font-size:18px;font-weight:600;line-height:20px;margin:24px 0 8px}@media (max-width: 900px){.resultsInfoContent{margin:0;margin-bottom:8px}}";
619
641
  const SearchcraftResultsInfoStyle0 = searchcraftResultsInfoModuleCss;
620
642
 
621
643
  const SearchcraftResultsInfo = class {
@@ -632,7 +654,7 @@ const SearchcraftResultsInfo = class {
632
654
  this.isRequesting = state.isRequesting;
633
655
  this.resultsCount = ((_b = (_a = state.searchResults) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.count) || 0;
634
656
  this.responseTime = ((((_d = (_c = state.searchResults) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.time_taken) || 0) * 1000).toFixed(2);
635
- this.query = state.query || ''; // Update query from store
657
+ this.query = state.query || '';
636
658
  });
637
659
  }
638
660
  disconnectedCallback() {
@@ -644,7 +666,8 @@ const SearchcraftResultsInfo = class {
644
666
  if (!this.query || this.resultsCount === 0) {
645
667
  return null;
646
668
  }
647
- return (index.h("div", { class: 'container' }, index.h("p", { class: 'resultsInfo' }, this.resultsCount, " results found in ", this.responseTime, "ms")));
669
+ const formattedResults = store.formatNumberWithCommas(this.resultsCount);
670
+ return (index.h("div", { class: index$1.classNames('resultsInfoContainer', 'searchcraft-results-info-container') }, index.h("p", { class: index$1.classNames('resultsInfoContent', 'searchcraft-results-info-content') }, formattedResults, " results found in ", this.responseTime, "ms")));
648
671
  }
649
672
  };
650
673
  SearchcraftResultsInfo.style = SearchcraftResultsInfoStyle0;
@@ -673,15 +696,20 @@ const SearchcraftSearchIconSet = class {
673
696
  }
674
697
  };
675
698
 
676
- const searchcraftSliderModuleCss = ".sliderContainer{display:flex;flex-direction:column;gap:10px;font-family:Arial, sans-serif;align-items:center;width:100%}.rangeContainer{display:flex;position:relative;width:100%;align-items:center}.rangeContainer .activeRange{background:#007DB3;border-radius:2px;height:4px;position:absolute;top:50%;transform:translateY(-50%);z-index:0}.rangeContainer .rangeSlider{width:100%;height:4px;background:transparent;border-radius:2px;outline:none;-webkit-appearance:none;appearance:none;position:absolute;margin:0}.rangeContainer .rangeSlider::-webkit-slider-thumb{-webkit-appearance:none;width:20px;height:20px;background-color:#FFF;border-radius:50%;border:2px solid #e6e6e6;cursor:pointer}.rangeContainer .rangeSlider::-moz-range-thumb{width:20px;height:20px;background-color:#FFF;border-radius:50%;border:2px solid #e6e6e6;cursor:pointer}.yearLabels{display:flex;justify-content:space-between;width:100%;margin-top:10px;font-size:15px;font-weight:600;font-family:\"Source Sans Pro\", sans-serif;color:#666}.yearLabel{min-width:30px;text-align:center}";
699
+ const searchcraftSliderModuleCss = ".sliderContainer{align-items:center;display:flex;flex-direction:column;gap:10px;width:100%}.rangeContainer{align-items:center;background-color:#D9D9D9;border-radius:999px;display:flex;position:relative;height:4px;width:100%}.rangeContainer::-webkit-slider-runnable-track{pointer-events:none}.rangeContainer .activeRange{background-color:#000000;border-radius:2px;height:4px;position:absolute;top:50%;transform:translateY(-50%);z-index:0}.rangeContainer .activeRange::-webkit-slider-runnable-track{pointer-events:none}.rangeContainer .activeRange::-moz-range-track{pointer-events:none}.rangeContainer .rangeSlider{appearance:none;background:transparent;border-radius:2px;height:4px;margin:0;outline:none;pointer-events:none;position:absolute;width:100%;-webkit-appearance:none}.rangeContainer .rangeSlider::-webkit-slider-thumb{background-color:#FFFFFF;border-radius:50%;border:2px solid #E6E6E6;cursor:pointer;height:20px;pointer-events:all;width:20px;-webkit-appearance:none}.rangeContainer .rangeSlider::-moz-range-thumb{background-color:#FFFFFF;border-radius:50%;border:2px solid #E6E6E6;cursor:pointer;height:20px;pointer-events:all;width:20px}.yearLabels{color:#292929;display:flex;font-family:\"Source Sans Pro\", sans-serif;font-size:15px;font-weight:600;justify-content:space-between;margin-top:10px;width:100%}.yearLabel{min-width:30px;text-align:center}";
677
700
  const SearchcraftSliderStyle0 = searchcraftSliderModuleCss;
678
701
 
679
702
  const SearchcraftSlider = class {
680
703
  constructor(hostRef) {
681
704
  index.registerInstance(this, hostRef);
705
+ this.rangeChanged = index.createEvent(this, "rangeChanged", 7);
682
706
  this.searchStore = store.useSearchcraftStore.getState();
683
707
  this.updateYears = async () => {
684
708
  this.searchStore.setYearsRange([this.startYear, this.endYear]);
709
+ this.rangeChanged.emit({
710
+ startYear: this.startYear,
711
+ endYear: this.endYear,
712
+ });
685
713
  try {
686
714
  if (typeof this.query === 'string' && this.query.trim() !== '') {
687
715
  await this.searchStore.search();
@@ -696,13 +724,17 @@ const SearchcraftSlider = class {
696
724
  };
697
725
  this.handleStartYearChange = (event) => {
698
726
  const value = Number.parseInt(event.target.value, 10);
699
- this.startYear = Math.min(value, this.endYear);
700
- this.updateYears();
727
+ if (value <= this.endYear) {
728
+ this.startYear = value;
729
+ this.updateYears();
730
+ }
701
731
  };
702
732
  this.handleEndYearChange = (event) => {
703
733
  const value = Number.parseInt(event.target.value, 10);
704
- this.endYear = Math.max(value, this.startYear);
705
- this.updateYears();
734
+ if (value >= this.startYear) {
735
+ this.endYear = value;
736
+ this.updateYears();
737
+ }
706
738
  };
707
739
  this.maxYear = new Date().getFullYear();
708
740
  this.minYear = 2014;
@@ -735,41 +767,15 @@ const SearchcraftSlider = class {
735
767
  const rangeMax = this.maxYear;
736
768
  const startPercent = ((this.startYear - rangeMin) / (rangeMax - rangeMin)) * 100;
737
769
  const endPercent = ((this.endYear - rangeMin) / (rangeMax - rangeMin)) * 100;
738
- return (index.h("div", { class: 'sliderContainer' }, index.h("div", { class: 'rangeContainer' }, index.h("div", { class: 'activeRange', style: {
770
+ return (index.h("div", { class: index$1.classNames('sliderContainer', 'searchcraft-slider-container') }, index.h("div", { class: index$1.classNames('rangeContainer', 'searchcraft-slider-range-container') }, index.h("div", { class: index$1.classNames('activeRange', 'searchcraft-slider-active-range'), style: {
739
771
  left: `${startPercent}%`,
740
772
  width: `${endPercent - startPercent}%`,
741
- } }), index.h("input", { class: 'rangeSlider', max: this.maxYear, min: this.minYear, onInput: this.handleStartYearChange, step: '1', type: 'range', value: this.startYear }), index.h("input", { class: 'rangeSlider', max: this.maxYear, min: this.minYear, onInput: this.handleEndYearChange, step: '1', type: 'range', value: this.endYear })), index.h("div", { class: 'yearLabels' }, index.h("span", { class: 'yearLabel' }, this.startYear), index.h("span", { class: 'yearLabel' }, this.endYear))));
773
+ } }), index.h("input", { class: index$1.classNames('rangeSlider', 'searchcraft-slider-range-slider-start-thumb'), max: this.maxYear, min: this.minYear, onInput: this.handleStartYearChange, step: '1', type: 'range', value: this.startYear }), index.h("input", { class: index$1.classNames('rangeSlider', 'searchcraft-slider-range-slider-end-thumb'), max: this.maxYear, min: this.minYear, onInput: this.handleEndYearChange, step: '1', type: 'range', value: this.endYear })), index.h("div", { class: index$1.classNames('yearLabels', 'searchcraft-slider-year-label-container') }, index.h("span", { class: index$1.classNames('yearLabel', 'searchcraft-slider-start-year-label') }, this.startYear), index.h("span", { class: index$1.classNames('yearLabel', 'searchcraft-slider-end-year-label') }, this.endYear))));
742
774
  }
743
775
  };
744
776
  SearchcraftSlider.style = SearchcraftSliderStyle0;
745
777
 
746
- const searchcraftSpinnerDarkModuleCss = ".spinnerContainer{background-color:transparent;height:20px;width:20px}.spinnerDark{animation:spinning 1s linear infinite;background:conic-gradient(#000 50%, #FFFFFF);clip-path:circle(50%);height:100%;mask-image:radial-gradient(circle at center, rgba(0, 0, 0, 0) 6.6666666667px, rgb(0, 0, 0) 6.6666666667px);width:100%}.spinnerLight{animation:spinning 1s linear infinite;background:conic-gradient(#737373 50%, #FFFFFF);clip-path:circle(50%);height:100%;mask-image:radial-gradient(circle at center, rgba(0, 0, 0, 0) 6.6666666667px, rgb(0, 0, 0) 6.6666666667px);width:100%}@keyframes spinning{0%{transform:rotate(0deg)}50%{transform:rotate(180deg)}100%{transform:rotate(360deg)}}";
747
- const SearchcraftSpinnerDarkStyle0 = searchcraftSpinnerDarkModuleCss;
748
-
749
- const SearchcraftSpinnerDark = class {
750
- constructor(hostRef) {
751
- index.registerInstance(this, hostRef);
752
- }
753
- render() {
754
- return (index.h("div", { key: 'be34b9a3ecec05fdc169145a5db5a4f37bbd404b', class: 'spinnerContainer' }, index.h("div", { key: 'b59ffd2fe8dd3ac990003bff3085cb571c08730e', class: 'spinnerDark' })));
755
- }
756
- };
757
- SearchcraftSpinnerDark.style = SearchcraftSpinnerDarkStyle0;
758
-
759
- const searchcraftSpinnerLightModuleCss = ".spinnerContainer{background-color:transparent;height:20px;width:20px}.spinnerLight{animation:spinning 1s linear infinite;background:conic-gradient(#737373 50%, #FFFFFF);clip-path:circle(50%);height:100%;mask-image:radial-gradient(circle at center, rgba(0, 0, 0, 0) 6.6666666667px, rgb(0, 0, 0) 6.6666666667px);width:100%}@keyframes spinning{0%{transform:rotate(0deg)}50%{transform:rotate(180deg)}100%{transform:rotate(360deg)}}";
760
- const SearchcraftSpinnerLightStyle0 = searchcraftSpinnerLightModuleCss;
761
-
762
- const SearchcraftSpinnerLight = class {
763
- constructor(hostRef) {
764
- index.registerInstance(this, hostRef);
765
- }
766
- render() {
767
- return (index.h("div", { key: 'a4f73eee03d4d7253c04c47995315bd121e8ded3', class: 'spinnerContainer' }, index.h("div", { key: '53e3486ef7a2fa6029a6107bae2c0655b1608a12', class: 'spinnerLight' })));
768
- }
769
- };
770
- SearchcraftSpinnerLight.style = SearchcraftSpinnerLightStyle0;
771
-
772
- const searchcraftToggleButtonModuleCss = ".toggle-wrapper{background:#ddd;border:none;border-radius:16px;box-shadow:0px 0px 0px 1px rgba(0, 0, 0, 0.05);cursor:pointer;height:26px;margin-left:10px;position:relative;width:44px}.toggle-wrapper.active{background:#007DB3;box-shadow:0px 0px 0px 1px rgba(0, 0, 0, 0.05)}.toggle-wrapper .toggle-switch{background:#fff;border-radius:50%;height:18px;left:4px;position:absolute;top:calc(50% - 9px);transition:transform 0.3s ease;width:18px}.toggle-wrapper .toggle-switch.active{transform:translateX(16px)}";
778
+ const searchcraftToggleButtonModuleCss = ".toggleWrapper{background:#D9D9D9;border:none;border-radius:16px;box-shadow:0px 0px 0px 1px rgba(0, 0, 0, 0.05);cursor:pointer;height:26px;margin-left:10px;position:relative;width:44px}.toggleWrapper.active{background:#000000;box-shadow:0px 0px 0px 1px rgba(0, 0, 0, 0.05)}.toggleWrapper .toggleSwitch{background:#FFFFFF;border-radius:50%;height:18px;left:4px;position:absolute;top:calc(50% - 9px);transition:transform 0.3s ease;width:18px}.toggleWrapper .toggleSwitch.active{transform:translateX(16px)}";
773
779
  const SearchcraftToggleButtonStyle0 = searchcraftToggleButtonModuleCss;
774
780
 
775
781
  const SearchcraftToggleButton = class {
@@ -833,7 +839,9 @@ const SearchcraftToggleButton = class {
833
839
  if (!this.query || this.resultsCount === 0) {
834
840
  return null;
835
841
  }
836
- return (index.h("button", { class: `toggle-wrapper ${this.isActive ? 'active' : ''}`, onClick: this.handleToggle, type: 'button' }, index.h("div", { class: `toggle-switch ${this.isActive ? 'active' : ''}` })));
842
+ const toggleContainerStyle = `toggleWrapper ${this.isActive ? 'active' : ''}`;
843
+ const toggleSwitchStyle = `toggleSwitch ${this.isActive ? 'active' : ''}`;
844
+ return (index.h("button", { class: index$1.classNames(toggleContainerStyle, 'searchcraft-toggle-button-container'), onClick: this.handleToggle, type: 'button' }, index.h("div", { class: index$1.classNames(toggleSwitchStyle, 'searchcraft-toggle-switch') })));
837
845
  }
838
846
  };
839
847
  SearchcraftToggleButton.style = SearchcraftToggleButtonStyle0;
@@ -854,8 +862,6 @@ exports.searchcraft_input_label = SearchcraftInputLabel;
854
862
  exports.searchcraft_results_info = SearchcraftResultsInfo;
855
863
  exports.searchcraft_search_icon_set = SearchcraftSearchIconSet;
856
864
  exports.searchcraft_slider = SearchcraftSlider;
857
- exports.searchcraft_spinner_dark = SearchcraftSpinnerDark;
858
- exports.searchcraft_spinner_light = SearchcraftSpinnerLight;
859
865
  exports.searchcraft_toggle_button = SearchcraftToggleButton;
860
866
 
861
- //# sourceMappingURL=searchcraft-auto-search-form_19.cjs.entry.js.map
867
+ //# sourceMappingURL=searchcraft-auto-search-form_17.cjs.entry.js.map