@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.
Files changed (344) hide show
  1. package/README.md +198 -0
  2. package/dist/cjs/{index-264ebadc.js → index-c8a8e492.js} +29 -3
  3. package/dist/cjs/index-c8a8e492.js.map +1 -0
  4. package/dist/cjs/index.cjs.js +4 -5
  5. package/dist/cjs/index.cjs.js.map +1 -1
  6. package/dist/cjs/loader.cjs.js +2 -2
  7. package/dist/cjs/{package-35d3b670.js → package-ccc7e307.js} +3 -3
  8. package/dist/cjs/package-ccc7e307.js.map +1 -0
  9. package/dist/cjs/searchcraft-auto-search-form.cjs.entry.js +160 -0
  10. package/dist/cjs/searchcraft-auto-search-form.cjs.entry.js.map +1 -0
  11. package/dist/cjs/searchcraft-base-search-form.cjs.entry.js +8 -11
  12. package/dist/cjs/searchcraft-base-search-form.cjs.entry.js.map +1 -1
  13. package/dist/cjs/searchcraft-base-search-result.cjs.entry.js +74 -0
  14. package/dist/cjs/searchcraft-base-search-result.cjs.entry.js.map +1 -0
  15. package/dist/cjs/searchcraft-base-search-results.cjs.entry.js +129 -0
  16. package/dist/cjs/searchcraft-base-search-results.cjs.entry.js.map +1 -0
  17. package/dist/cjs/searchcraft-button-icon.cjs.entry.js +1 -1
  18. package/dist/cjs/searchcraft-button.cjs.entry.js +3 -8
  19. package/dist/cjs/searchcraft-button.cjs.entry.js.map +1 -1
  20. package/dist/cjs/searchcraft-check-icon_2.cjs.entry.js +28 -0
  21. package/dist/cjs/searchcraft-check-icon_2.cjs.entry.js.map +1 -0
  22. package/dist/cjs/searchcraft-clear-icon-set.cjs.entry.js +30 -0
  23. package/dist/cjs/searchcraft-clear-icon-set.cjs.entry.js.map +1 -0
  24. package/dist/cjs/searchcraft-error-message_3.cjs.entry.js +95 -0
  25. package/dist/cjs/searchcraft-error-message_3.cjs.entry.js.map +1 -0
  26. package/dist/cjs/searchcraft-facet-list_3.cjs.entry.js +183 -0
  27. package/dist/cjs/searchcraft-facet-list_3.cjs.entry.js.map +1 -0
  28. package/dist/cjs/searchcraft-filter-panel.cjs.entry.js +134 -0
  29. package/dist/cjs/searchcraft-filter-panel.cjs.entry.js.map +1 -0
  30. package/dist/cjs/searchcraft-javascript-sdk.cjs.js +2 -2
  31. package/dist/cjs/searchcraft-results-info.cjs.entry.js +46 -0
  32. package/dist/cjs/searchcraft-results-info.cjs.entry.js.map +1 -0
  33. package/dist/cjs/searchcraft-search-icon-set.cjs.entry.js +33 -0
  34. package/dist/cjs/searchcraft-search-icon-set.cjs.entry.js.map +1 -0
  35. package/dist/cjs/searchcraft-spinner-dark.cjs.entry.js +3 -3
  36. package/dist/cjs/searchcraft-spinner-dark.cjs.entry.js.map +1 -1
  37. package/dist/cjs/searchcraft-spinner-light.cjs.entry.js +3 -3
  38. package/dist/cjs/searchcraft-spinner-light.cjs.entry.js.map +1 -1
  39. package/dist/{esm/store-b519dd0b.js → cjs/store-72205332.js} +139 -205
  40. package/dist/cjs/store-72205332.js.map +1 -0
  41. package/dist/cjs/utils-4ee2b88d.js +169 -0
  42. package/dist/cjs/utils-4ee2b88d.js.map +1 -0
  43. package/dist/collection/collection-manifest.json +2 -4
  44. package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.js +61 -95
  45. package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.js.map +1 -1
  46. package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.module.css +98 -9
  47. package/dist/collection/components/searchcraft-base-search-form/searchcraft-base-search-form.js +31 -16
  48. package/dist/collection/components/searchcraft-base-search-form/searchcraft-base-search-form.js.map +1 -1
  49. package/dist/collection/components/searchcraft-base-search-form/searchcraft-base-search-form.module.css +94 -8
  50. package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js +125 -153
  51. package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js.map +1 -1
  52. package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.module.css +139 -206
  53. package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js +138 -89
  54. package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js.map +1 -1
  55. package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.module.css +105 -23
  56. package/dist/collection/components/searchcraft-button/searchcraft-button.js +2 -8
  57. package/dist/collection/components/searchcraft-button/searchcraft-button.js.map +1 -1
  58. package/dist/collection/components/searchcraft-button/searchcraft-button.module.css +107 -36
  59. package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js +1 -22
  60. package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js.map +1 -1
  61. package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.module.css +101 -15
  62. package/dist/collection/components/searchcraft-facet-list/searchcraft-facet-list.js +140 -0
  63. package/dist/collection/components/searchcraft-facet-list/searchcraft-facet-list.js.map +1 -0
  64. package/dist/collection/components/searchcraft-facet-list/searchcraft-facet-list.module.css +216 -0
  65. package/dist/collection/components/searchcraft-filter-panel/searchcraft-filter-panel.js +166 -0
  66. package/dist/collection/components/searchcraft-filter-panel/searchcraft-filter-panel.js.map +1 -0
  67. package/dist/collection/components/searchcraft-filter-panel/searchcraft-filter-panel.module.css +118 -0
  68. package/dist/collection/components/searchcraft-input/searchcraft-input.js +36 -125
  69. package/dist/collection/components/searchcraft-input/searchcraft-input.js.map +1 -1
  70. package/dist/collection/components/searchcraft-input/searchcraft-input.module.css +158 -209
  71. package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js +1 -12
  72. package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js.map +1 -1
  73. package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.module.css +102 -14
  74. package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.js +1 -2
  75. package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.js.map +1 -1
  76. package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.module.css +103 -9
  77. package/dist/collection/components/searchcraft-slider/searchcraft-slider.js +79 -62
  78. package/dist/collection/components/searchcraft-slider/searchcraft-slider.js.map +1 -1
  79. package/dist/collection/components/searchcraft-slider/searchcraft-slider.module.css +106 -7
  80. package/dist/collection/components/searchcraft-spinner-dark/searchcraft-spinner-dark.js +1 -1
  81. package/dist/collection/components/searchcraft-spinner-dark/searchcraft-spinner-dark.module.css +103 -4
  82. package/dist/collection/components/searchcraft-spinner-light/searchcraft-spinner-light.js +1 -1
  83. package/dist/collection/components/searchcraft-spinner-light/searchcraft-spinner-light.module.css +102 -3
  84. package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.js +50 -65
  85. package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.js.map +1 -1
  86. package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.module.css +135 -9
  87. package/dist/collection/index.js +2 -1
  88. package/dist/collection/index.js.map +1 -1
  89. package/dist/collection/provider/store.js +45 -31
  90. package/dist/collection/provider/store.js.map +1 -1
  91. package/dist/collection/types/index.js +3 -0
  92. package/dist/collection/types/index.js.map +1 -0
  93. package/dist/collection/types/searchcraft-base-search-results.types.js +2 -0
  94. package/dist/collection/types/searchcraft-base-search-results.types.js.map +1 -0
  95. package/dist/collection/types/searchcraft-filter-panel.types.js +2 -0
  96. package/dist/collection/types/searchcraft-filter-panel.types.js.map +1 -0
  97. package/dist/collection/utils/utils.js +114 -35
  98. package/dist/collection/utils/utils.js.map +1 -1
  99. package/dist/components/index.js +7 -11
  100. package/dist/components/index.js.map +1 -1
  101. package/dist/components/{p-bbf9973a.js → p-04d13314.js} +2 -2
  102. package/dist/components/{p-bbf9973a.js.map → p-04d13314.js.map} +1 -1
  103. package/dist/components/p-0deddac7.js +161 -0
  104. package/dist/components/p-0deddac7.js.map +1 -0
  105. package/dist/components/p-37f54c0b.js +54 -0
  106. package/dist/components/p-37f54c0b.js.map +1 -0
  107. package/dist/components/{p-6b353c3e.js → p-5639be85.js} +23 -3
  108. package/dist/components/p-5639be85.js.map +1 -0
  109. package/dist/components/p-68897c11.js +124 -0
  110. package/dist/components/p-68897c11.js.map +1 -0
  111. package/dist/components/{p-b0c1fd63.js → p-69eed21e.js} +3 -3
  112. package/dist/components/p-69eed21e.js.map +1 -0
  113. package/dist/components/p-8062f0ea.js +82 -0
  114. package/dist/components/p-8062f0ea.js.map +1 -0
  115. package/dist/components/p-9f2b8375.js +33 -0
  116. package/dist/components/p-9f2b8375.js.map +1 -0
  117. package/dist/components/p-ace4e6a0.js +35 -0
  118. package/dist/components/p-ace4e6a0.js.map +1 -0
  119. package/dist/components/p-b1a59f07.js +101 -0
  120. package/dist/components/p-b1a59f07.js.map +1 -0
  121. package/dist/components/{p-727bfc38.js → p-be63dcac.js} +126 -110
  122. package/dist/components/p-be63dcac.js.map +1 -0
  123. package/dist/components/p-c8bc1e4f.js +40 -0
  124. package/dist/components/p-c8bc1e4f.js.map +1 -0
  125. package/dist/components/{p-aad03c2a.js → p-de50441f.js} +2 -2
  126. package/dist/components/{p-aad03c2a.js.map → p-de50441f.js.map} +1 -1
  127. package/dist/components/p-e3c8b1ef.js +91 -0
  128. package/dist/components/p-e3c8b1ef.js.map +1 -0
  129. package/dist/components/p-ebf021b5.js +49 -0
  130. package/dist/components/p-ebf021b5.js.map +1 -0
  131. package/dist/components/searchcraft-auto-search-form.js +64 -74
  132. package/dist/components/searchcraft-auto-search-form.js.map +1 -1
  133. package/dist/components/searchcraft-base-search-form.js +20 -52
  134. package/dist/components/searchcraft-base-search-form.js.map +1 -1
  135. package/dist/components/searchcraft-base-search-result.js +1 -1
  136. package/dist/components/searchcraft-base-search-results.js +75 -53
  137. package/dist/components/searchcraft-base-search-results.js.map +1 -1
  138. package/dist/components/searchcraft-button-icon.js +1 -1
  139. package/dist/components/searchcraft-button.js +1 -1
  140. package/dist/components/searchcraft-check-icon.js +1 -1
  141. package/dist/components/searchcraft-clear-icon-set.js +39 -1
  142. package/dist/components/searchcraft-clear-icon-set.js.map +1 -1
  143. package/dist/components/searchcraft-dash-icon.js +1 -1
  144. package/dist/components/searchcraft-error-message.js +1 -1
  145. package/dist/components/searchcraft-facet-list.d.ts +11 -0
  146. package/dist/components/searchcraft-facet-list.js +8 -0
  147. package/dist/components/searchcraft-facet-list.js.map +1 -0
  148. package/dist/components/searchcraft-filter-panel.d.ts +11 -0
  149. package/dist/components/searchcraft-filter-panel.js +184 -0
  150. package/dist/components/searchcraft-filter-panel.js.map +1 -0
  151. package/dist/components/searchcraft-input-label.js +1 -1
  152. package/dist/components/searchcraft-input.js +1 -1
  153. package/dist/components/searchcraft-results-info.js +5 -6
  154. package/dist/components/searchcraft-results-info.js.map +1 -1
  155. package/dist/components/searchcraft-search-icon-set.js +44 -1
  156. package/dist/components/searchcraft-search-icon-set.js.map +1 -1
  157. package/dist/components/searchcraft-slider.js +1 -104
  158. package/dist/components/searchcraft-slider.js.map +1 -1
  159. package/dist/components/searchcraft-spinner-dark.js +1 -1
  160. package/dist/components/searchcraft-spinner-light.js +3 -3
  161. package/dist/components/searchcraft-spinner-light.js.map +1 -1
  162. package/dist/components/searchcraft-toggle-button.js +1 -93
  163. package/dist/components/searchcraft-toggle-button.js.map +1 -1
  164. package/dist/esm/{index-d851fb46.js → index-88dc5f88.js} +29 -3
  165. package/dist/esm/index-88dc5f88.js.map +1 -0
  166. package/dist/esm/index.js +2 -1
  167. package/dist/esm/index.js.map +1 -1
  168. package/dist/esm/loader.js +3 -3
  169. package/dist/esm/{package-82baadd7.js → package-ee16f835.js} +3 -3
  170. package/dist/esm/package-ee16f835.js.map +1 -0
  171. package/dist/esm/searchcraft-auto-search-form.entry.js +156 -0
  172. package/dist/esm/searchcraft-auto-search-form.entry.js.map +1 -0
  173. package/dist/esm/searchcraft-base-search-form.entry.js +8 -11
  174. package/dist/esm/searchcraft-base-search-form.entry.js.map +1 -1
  175. package/dist/esm/searchcraft-base-search-result.entry.js +70 -0
  176. package/dist/esm/searchcraft-base-search-result.entry.js.map +1 -0
  177. package/dist/esm/searchcraft-base-search-results.entry.js +125 -0
  178. package/dist/esm/searchcraft-base-search-results.entry.js.map +1 -0
  179. package/dist/esm/searchcraft-button-icon.entry.js +1 -1
  180. package/dist/esm/searchcraft-button.entry.js +3 -8
  181. package/dist/esm/searchcraft-button.entry.js.map +1 -1
  182. package/dist/esm/searchcraft-check-icon_2.entry.js +23 -0
  183. package/dist/esm/searchcraft-check-icon_2.entry.js.map +1 -0
  184. package/dist/{components/p-62e6b69c.js → esm/searchcraft-clear-icon-set.entry.js} +7 -24
  185. package/dist/esm/searchcraft-clear-icon-set.entry.js.map +1 -0
  186. package/dist/esm/searchcraft-error-message_3.entry.js +89 -0
  187. package/dist/esm/searchcraft-error-message_3.entry.js.map +1 -0
  188. package/dist/esm/searchcraft-facet-list_3.entry.js +177 -0
  189. package/dist/esm/searchcraft-facet-list_3.entry.js.map +1 -0
  190. package/dist/esm/searchcraft-filter-panel.entry.js +130 -0
  191. package/dist/esm/searchcraft-filter-panel.entry.js.map +1 -0
  192. package/dist/esm/searchcraft-javascript-sdk.js +3 -3
  193. package/dist/esm/searchcraft-results-info.entry.js +42 -0
  194. package/dist/esm/searchcraft-results-info.entry.js.map +1 -0
  195. package/dist/{components/p-5a872bdf.js → esm/searchcraft-search-icon-set.entry.js} +7 -26
  196. package/dist/esm/searchcraft-search-icon-set.entry.js.map +1 -0
  197. package/dist/esm/searchcraft-spinner-dark.entry.js +3 -3
  198. package/dist/esm/searchcraft-spinner-dark.entry.js.map +1 -1
  199. package/dist/esm/searchcraft-spinner-light.entry.js +3 -3
  200. package/dist/esm/searchcraft-spinner-light.entry.js.map +1 -1
  201. package/dist/{cjs/store-e3bbdd49.js → esm/store-52436995.js} +136 -217
  202. package/dist/esm/store-52436995.js.map +1 -0
  203. package/dist/esm/utils-89a02921.js +161 -0
  204. package/dist/esm/utils-89a02921.js.map +1 -0
  205. package/dist/searchcraft-javascript-sdk/index.esm.js +1 -1
  206. package/dist/searchcraft-javascript-sdk/p-08bd95f1.entry.js +2 -0
  207. package/dist/searchcraft-javascript-sdk/p-08bd95f1.entry.js.map +1 -0
  208. package/dist/searchcraft-javascript-sdk/p-0deddac7.js +2 -0
  209. package/dist/searchcraft-javascript-sdk/p-0deddac7.js.map +1 -0
  210. package/dist/searchcraft-javascript-sdk/p-15f9891d.entry.js +2 -0
  211. package/dist/searchcraft-javascript-sdk/p-15f9891d.entry.js.map +1 -0
  212. package/dist/searchcraft-javascript-sdk/p-2419a8c5.entry.js +2 -0
  213. package/dist/searchcraft-javascript-sdk/p-2419a8c5.entry.js.map +1 -0
  214. package/dist/searchcraft-javascript-sdk/p-343adbe3.entry.js +2 -0
  215. package/dist/searchcraft-javascript-sdk/p-343adbe3.entry.js.map +1 -0
  216. package/dist/searchcraft-javascript-sdk/p-3a2d9be9.entry.js +2 -0
  217. package/dist/searchcraft-javascript-sdk/p-3a2d9be9.entry.js.map +1 -0
  218. package/dist/searchcraft-javascript-sdk/p-4278ff89.entry.js +2 -0
  219. package/dist/searchcraft-javascript-sdk/p-4278ff89.entry.js.map +1 -0
  220. package/dist/searchcraft-javascript-sdk/p-4c32c87d.js +3 -0
  221. package/dist/searchcraft-javascript-sdk/p-4c32c87d.js.map +1 -0
  222. package/dist/searchcraft-javascript-sdk/p-56413bef.entry.js +2 -0
  223. package/dist/searchcraft-javascript-sdk/p-56413bef.entry.js.map +1 -0
  224. package/dist/searchcraft-javascript-sdk/p-69eed21e.js +2 -0
  225. package/dist/searchcraft-javascript-sdk/{p-99356c9a.entry.js → p-69f64bdd.entry.js} +2 -2
  226. package/dist/searchcraft-javascript-sdk/p-7c59b3cd.entry.js +2 -0
  227. package/dist/searchcraft-javascript-sdk/p-7c59b3cd.entry.js.map +1 -0
  228. package/dist/searchcraft-javascript-sdk/p-93e9de71.entry.js +2 -0
  229. package/dist/searchcraft-javascript-sdk/p-93e9de71.entry.js.map +1 -0
  230. package/dist/searchcraft-javascript-sdk/p-9647ae41.entry.js +2 -0
  231. package/dist/searchcraft-javascript-sdk/p-9647ae41.entry.js.map +1 -0
  232. package/dist/searchcraft-javascript-sdk/p-a613a6ba.entry.js +2 -0
  233. package/dist/searchcraft-javascript-sdk/p-a613a6ba.entry.js.map +1 -0
  234. package/dist/searchcraft-javascript-sdk/p-acc645c7.entry.js +2 -0
  235. package/dist/searchcraft-javascript-sdk/p-acc645c7.entry.js.map +1 -0
  236. package/dist/searchcraft-javascript-sdk/p-bb03e946.js +11 -0
  237. package/dist/searchcraft-javascript-sdk/p-bb03e946.js.map +1 -0
  238. package/dist/searchcraft-javascript-sdk/p-bf80bbee.entry.js +2 -0
  239. package/dist/searchcraft-javascript-sdk/p-bf80bbee.entry.js.map +1 -0
  240. package/dist/searchcraft-javascript-sdk/p-f4612b94.entry.js +2 -0
  241. package/dist/searchcraft-javascript-sdk/p-f4612b94.entry.js.map +1 -0
  242. package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js +1 -1
  243. package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js.map +1 -1
  244. package/dist/types/components/searchcraft-auto-search-form/searchcraft-auto-search-form.d.ts +6 -6
  245. package/dist/types/components/searchcraft-base-search-form/searchcraft-base-search-form.d.ts +3 -2
  246. package/dist/types/components/searchcraft-base-search-result/searchcraft-base-search-result.d.ts +16 -18
  247. package/dist/types/components/searchcraft-base-search-results/searchcraft-base-search-results.d.ts +15 -6
  248. package/dist/types/components/searchcraft-button/searchcraft-button.d.ts +0 -2
  249. package/dist/types/components/searchcraft-error-message/searchcraft-error-message.d.ts +0 -1
  250. package/dist/types/components/searchcraft-facet-list/searchcraft-facet-list.d.ts +21 -0
  251. package/dist/types/components/searchcraft-filter-panel/searchcraft-filter-panel.d.ts +25 -0
  252. package/dist/types/components/searchcraft-input/searchcraft-input.d.ts +4 -10
  253. package/dist/types/components/searchcraft-input-label/searchcraft-input-label.d.ts +0 -2
  254. package/dist/types/components/searchcraft-slider/searchcraft-slider.d.ts +11 -12
  255. package/dist/types/components/searchcraft-toggle-button/searchcraft-toggle-button.d.ts +4 -9
  256. package/dist/types/components.d.ts +123 -185
  257. package/dist/types/index.d.ts +2 -1
  258. package/dist/types/provider/store.d.ts +15 -9
  259. package/dist/types/types/index.d.ts +2 -0
  260. package/dist/types/types/searchcraft-base-search-results.types.d.ts +17 -0
  261. package/dist/types/types/searchcraft-filter-panel.types.d.ts +42 -0
  262. package/dist/types/utils/utils.d.ts +23 -15
  263. package/package.json +2 -2
  264. package/dist/cjs/index-264ebadc.js.map +0 -1
  265. package/dist/cjs/package-35d3b670.js.map +0 -1
  266. package/dist/cjs/searchcraft-auto-search-form_17.cjs.entry.js +0 -867
  267. package/dist/cjs/searchcraft-auto-search-form_17.cjs.entry.js.map +0 -1
  268. package/dist/cjs/store-e3bbdd49.js.map +0 -1
  269. package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.js +0 -94
  270. package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.js.map +0 -1
  271. package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.module.css +0 -33
  272. package/dist/collection/components/searchcraft-filters-list/searchcraft-filters-list.js +0 -168
  273. package/dist/collection/components/searchcraft-filters-list/searchcraft-filters-list.js.map +0 -1
  274. package/dist/collection/components/searchcraft-filters-list/searchcraft-filters-list.module.css +0 -111
  275. package/dist/collection/components/searchcraft-input-caption/searchcraft-input-caption.js +0 -121
  276. package/dist/collection/components/searchcraft-input-caption/searchcraft-input-caption.js.map +0 -1
  277. package/dist/collection/components/searchcraft-input-caption/searchcraft-input-caption.module.css +0 -79
  278. package/dist/collection/components/searchcraft-input-icon/searchcraft-input-icon.js +0 -109
  279. package/dist/collection/components/searchcraft-input-icon/searchcraft-input-icon.js.map +0 -1
  280. package/dist/collection/components/searchcraft-input-icon/searchcraft-input-icon.module.css +0 -17
  281. package/dist/components/p-4f939ba2.js +0 -53
  282. package/dist/components/p-4f939ba2.js.map +0 -1
  283. package/dist/components/p-5015a359.js +0 -39
  284. package/dist/components/p-5015a359.js.map +0 -1
  285. package/dist/components/p-54848b4d.js +0 -136
  286. package/dist/components/p-54848b4d.js.map +0 -1
  287. package/dist/components/p-5a872bdf.js.map +0 -1
  288. package/dist/components/p-62c40862.js +0 -91
  289. package/dist/components/p-62c40862.js.map +0 -1
  290. package/dist/components/p-62e6b69c.js.map +0 -1
  291. package/dist/components/p-69ee3b9a.js +0 -59
  292. package/dist/components/p-69ee3b9a.js.map +0 -1
  293. package/dist/components/p-6b353c3e.js.map +0 -1
  294. package/dist/components/p-727bfc38.js.map +0 -1
  295. package/dist/components/p-7c280820.js +0 -33
  296. package/dist/components/p-7c280820.js.map +0 -1
  297. package/dist/components/p-7d385ffb.js +0 -60
  298. package/dist/components/p-7d385ffb.js.map +0 -1
  299. package/dist/components/p-8524c749.js +0 -54
  300. package/dist/components/p-8524c749.js.map +0 -1
  301. package/dist/components/p-b0c1fd63.js.map +0 -1
  302. package/dist/components/p-b38d171d.js +0 -47
  303. package/dist/components/p-b38d171d.js.map +0 -1
  304. package/dist/components/p-cd9a038a.js +0 -105
  305. package/dist/components/p-cd9a038a.js.map +0 -1
  306. package/dist/components/searchcraft-clear-input-button.d.ts +0 -11
  307. package/dist/components/searchcraft-clear-input-button.js +0 -8
  308. package/dist/components/searchcraft-clear-input-button.js.map +0 -1
  309. package/dist/components/searchcraft-filters-list.d.ts +0 -11
  310. package/dist/components/searchcraft-filters-list.js +0 -151
  311. package/dist/components/searchcraft-filters-list.js.map +0 -1
  312. package/dist/components/searchcraft-input-caption.d.ts +0 -11
  313. package/dist/components/searchcraft-input-caption.js +0 -8
  314. package/dist/components/searchcraft-input-caption.js.map +0 -1
  315. package/dist/components/searchcraft-input-icon.d.ts +0 -11
  316. package/dist/components/searchcraft-input-icon.js +0 -8
  317. package/dist/components/searchcraft-input-icon.js.map +0 -1
  318. package/dist/esm/index-d851fb46.js.map +0 -1
  319. package/dist/esm/package-82baadd7.js.map +0 -1
  320. package/dist/esm/searchcraft-auto-search-form_17.entry.js +0 -847
  321. package/dist/esm/searchcraft-auto-search-form_17.entry.js.map +0 -1
  322. package/dist/esm/store-b519dd0b.js.map +0 -1
  323. package/dist/searchcraft-javascript-sdk/p-1f3ae7f3.entry.js +0 -2
  324. package/dist/searchcraft-javascript-sdk/p-1f3ae7f3.entry.js.map +0 -1
  325. package/dist/searchcraft-javascript-sdk/p-201cb2dc.entry.js +0 -2
  326. package/dist/searchcraft-javascript-sdk/p-201cb2dc.entry.js.map +0 -1
  327. package/dist/searchcraft-javascript-sdk/p-2c220368.entry.js +0 -2
  328. package/dist/searchcraft-javascript-sdk/p-2c220368.entry.js.map +0 -1
  329. package/dist/searchcraft-javascript-sdk/p-39c0ca33.entry.js +0 -2
  330. package/dist/searchcraft-javascript-sdk/p-39c0ca33.entry.js.map +0 -1
  331. package/dist/searchcraft-javascript-sdk/p-476829a4.entry.js +0 -2
  332. package/dist/searchcraft-javascript-sdk/p-476829a4.entry.js.map +0 -1
  333. package/dist/searchcraft-javascript-sdk/p-b0c1fd63.js +0 -2
  334. package/dist/searchcraft-javascript-sdk/p-b42eaa55.js +0 -3
  335. package/dist/searchcraft-javascript-sdk/p-b42eaa55.js.map +0 -1
  336. package/dist/searchcraft-javascript-sdk/p-d5f8dda2.js +0 -11
  337. package/dist/searchcraft-javascript-sdk/p-d5f8dda2.js.map +0 -1
  338. package/dist/types/components/searchcraft-clear-input-button/searchcraft-clear-input-button.d.ts +0 -10
  339. package/dist/types/components/searchcraft-filters-list/searchcraft-filters-list.d.ts +0 -34
  340. package/dist/types/components/searchcraft-input-caption/searchcraft-input-caption.d.ts +0 -9
  341. package/dist/types/components/searchcraft-input-icon/searchcraft-input-icon.d.ts +0 -9
  342. package/readme.md +0 -11
  343. /package/dist/searchcraft-javascript-sdk/{p-b0c1fd63.js.map → p-69eed21e.js.map} +0 -0
  344. /package/dist/searchcraft-javascript-sdk/{p-99356c9a.entry.js.map → p-69f64bdd.entry.js.map} +0 -0
@@ -1,847 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h, F as Fragment } from './index-d851fb46.js';
2
- import { c as classNames } from './index-72ac5051.js';
3
- import { u as useSearchcraftStore, i as ie, p as parseCustomStyles, a as parseSearchKeys, s as serializeStyles, e as extractDynamicProperties, g as getFormattedTimeFromNow, f as flattenFacets, c as formatNumberWithCommas } from './store-b519dd0b.js';
4
- import { p as packageJson } from './package-82baadd7.js';
5
-
6
- 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%}";
7
- const SearchcraftAutoSearchFormStyle0 = searchcraftAutoSearchFormModuleCss;
8
-
9
- const SearchcraftAutoSearchForm = class {
10
- constructor(hostRef) {
11
- registerInstance(this, hostRef);
12
- this.inputClearedOrNoResults = createEvent(this, "inputClearedOrNoResults", 7);
13
- this.querySubmit = createEvent(this, "querySubmit", 7);
14
- this.debounceTimeout = null;
15
- this.debounceDelay = 0;
16
- this.searchStore = useSearchcraftStore.getState();
17
- this.handleInputChange = (event) => {
18
- this.query = event.detail;
19
- this.searchStore.setQuery(this.query);
20
- if (this.query.trim() === '') {
21
- this.searchResults = null;
22
- this.inputClearedOrNoResults.emit();
23
- this.searchStore.setSearchResults(null);
24
- }
25
- };
26
- this.handleInputKeyUp = (event) => {
27
- const target = event.detail;
28
- if (target === this.query) {
29
- return;
30
- }
31
- this.query = target;
32
- if (this.debounceTimeout) {
33
- clearTimeout(this.debounceTimeout);
34
- }
35
- this.debounceTimeout = setTimeout(() => {
36
- if (this.query.trim() === '') {
37
- this.searchResults = null;
38
- this.searchStore.setSearchResults(null);
39
- this.inputClearedOrNoResults.emit();
40
- }
41
- else {
42
- this.searchStore.setQuery(this.query);
43
- this.querySubmit.emit(this.query);
44
- this.runSearch();
45
- }
46
- }, this.debounceDelay);
47
- };
48
- this.handleClearInput = () => {
49
- if (this.query === '' && !this.searchResults) {
50
- return;
51
- }
52
- this.query = '';
53
- this.searchResults = null;
54
- this.searchStore.setQuery('');
55
- this.searchStore.setSearchResults(null);
56
- if (typeof this.clearInput === 'function') {
57
- this.clearInput();
58
- }
59
- if (this.debounceTimeout) {
60
- clearTimeout(this.debounceTimeout);
61
- }
62
- this.error = false;
63
- this.inputClearedOrNoResults.emit();
64
- };
65
- this.runSearch = async () => {
66
- if (this.query.trim() === '') {
67
- this.error = true;
68
- this.inputClearedOrNoResults.emit();
69
- }
70
- else {
71
- this.error = false;
72
- this.searchStore.setQuery(this.query);
73
- this.searchStore.setSelectedFilters([]);
74
- try {
75
- await this.searchStore.search();
76
- }
77
- catch (error) {
78
- this.error = true;
79
- this.inputClearedOrNoResults.emit();
80
- }
81
- }
82
- };
83
- this.handleFormSubmit = async (event) => {
84
- event.preventDefault();
85
- await this.runSearch();
86
- };
87
- this.autoSearchFormClass = '';
88
- this.clearInput = () => { };
89
- this.config = {
90
- readKey: '',
91
- endpointURL: '',
92
- index: [],
93
- organizationId: '',
94
- applicationId: '',
95
- };
96
- this.customStylesForInput = {};
97
- this.inputCaptionValue = '';
98
- this.inputIconHeight = 20;
99
- this.inputIconWidth = 20;
100
- this.labelForInput = '';
101
- this.placeholderValue = 'Search here';
102
- this.rightToLeftOrientation = false;
103
- this.searchContainerClass = '';
104
- this.error = false;
105
- this.isRequesting = false;
106
- this.query = '';
107
- this.searchResults = null;
108
- }
109
- componentDidLoad() {
110
- const searchcraft = new ie(this.config, {
111
- sdkName: packageJson.name,
112
- sdkVersion: packageJson.version,
113
- });
114
- this.searchStore.initialize(searchcraft, true);
115
- this.unsubscribe = useSearchcraftStore.subscribe((state) => {
116
- this.isRequesting = state.isRequesting;
117
- this.searchResults = Object.assign({}, state.searchResults);
118
- });
119
- }
120
- disconnectedCallback() {
121
- if (this.unsubscribe) {
122
- this.unsubscribe();
123
- }
124
- }
125
- render() {
126
- const formClass = this.rightToLeftOrientation ? 'formRTL' : 'formLTR';
127
- const parsedCustomStyles = parseCustomStyles(this.customStylesForInput);
128
- return (h("form", { key: '3f8e9a36e827b3f1f8d591622a1c824e7ccc6f83', class: classNames(`${formClass}`, 'searchcraft-auto-search-form'), onSubmit: this.handleFormSubmit }, h("searchcraft-input-label", { key: 'daf9b6aab7185e045891a975ac70a3bf3b7ff75f', label: this.labelForInput }), 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 && (h("searchcraft-error-message", { key: '988624eb1ff71adde2a2e38ab8adb868a5a12469', errorMessage: 'Please enter a search query.' }))));
129
- }
130
- };
131
- SearchcraftAutoSearchForm.style = SearchcraftAutoSearchFormStyle0;
132
-
133
- 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}";
134
- const SearchcraftBaseSearchResultStyle0 = searchcraftBaseSearchResultModuleCss;
135
-
136
- const SearchcraftBaseSearchResult = class {
137
- constructor(hostRef) {
138
- registerInstance(this, hostRef);
139
- this.buttonCallback = createEvent(this, "buttonCallback", 7);
140
- this.keyDownCallback = createEvent(this, "keyDownCallback", 7);
141
- this.resultCallback = createEvent(this, "resultCallback", 7);
142
- this.buttonCallback = () => { };
143
- this.keyDownCallback = () => { };
144
- this.resultCallback = () => { };
145
- this.searchcraftStore = useSearchcraftStore.getState();
146
- this.handleButtonClick = () => {
147
- this.buttonCallback();
148
- };
149
- this.handleClick = () => {
150
- var _a, _b, _c;
151
- const searchcraft = this.searchcraftStore.getSearchcraftInstance();
152
- if (searchcraft) {
153
- const document_position = this.documentPosition;
154
- const search_term = this.searchcraftStore.query;
155
- 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;
156
- searchcraft.sendMeasureEvent('document_clicked', {
157
- document_position,
158
- number_of_documents,
159
- search_term,
160
- });
161
- }
162
- };
163
- this.parseStyles = () => {
164
- try {
165
- return JSON.parse(this.customStyles);
166
- }
167
- catch (error) {
168
- console.error('Error parsing custom styles:', error);
169
- return {};
170
- }
171
- };
172
- this.buttonText = '';
173
- this.customStyles = '{}';
174
- this.titleContent = '';
175
- this.imageDescription = '';
176
- this.imageSource = '';
177
- this.isInteractive = false;
178
- this.linkHref = '';
179
- this.primaryContent = '';
180
- this.secondaryContent = '';
181
- this.subtitleContent = '';
182
- this.tertiaryContent = '';
183
- this.themeMode = 'light';
184
- this.placeImageRight = false;
185
- this.documentPosition = 0;
186
- }
187
- render() {
188
- const isLightTheme = this.themeMode === 'light';
189
- const styles = this.parseStyles();
190
- const imageStyle = isLightTheme ? 'imageLight' : 'imageDark';
191
- const imageContainer = this.imageSource && (h("div", { key: '53541a311548a653d43505356b9a4f25a417093f', class: classNames('imageContainer', 'searchcraft-base-search-result-image-container') }, h("img", { key: '919a46fd856b521a548c2ce6bab8b360507469c2', alt: this.imageDescription, class: classNames(imageStyle, 'searchcraft-search-result-image'), src: this.imageSource, style: styles.image || {} })));
192
- const contentContainer = (h("div", { key: '944700daf2a0b683769bad992253a8482f71f685', class: classNames('contentContainer', 'searchcraft-base-search-result-content-container') }, h("h2", { key: '623096e2c7cf5f11bac7127cb00342386866089e', class: classNames(isLightTheme ? 'titleLight' : 'titleDark', 'searchcraft-base-search-result-title'), style: styles.title || {} }, this.titleContent), h("h3", { key: '2928f4d872e90d99fac31b75c9fecfee7e2a9a41', class: classNames(isLightTheme ? 'subtitleContentLight' : 'subtitleContentDark', 'searchcraft-base-search-result-subtitle'), style: styles.subtitle || {} }, this.subtitleContent), h("p", { key: '93bd00c9482d492a2d3d6262dba33044d4470d2c', class: classNames(isLightTheme ? 'primaryContentLight' : 'primaryContentDark', 'searchcraft-base-search-result-primary-content'), style: styles.primaryContent || {} }, this.primaryContent), h("div", { key: 'dc3bce7c0f75d121ba3068b3717fd5d934036012', class: classNames('secondaryContentContainer', 'searchcraft-base-search-result-secondary-content-container') }, h("p", { key: '80624ec83a0a7086142b6a35b4ac65d1fdb76a4e', class: classNames(isLightTheme ? 'secondaryContentLight' : 'secondaryContentDark', 'searchcraft-base-search-result-secondary-content'), style: styles.secondaryContent || {} }, this.secondaryContent), h("p", { key: '53bdb3471b16fd4a1f525d99472c3a4d5662b722', class: classNames(`${isLightTheme ? 'tertiaryContentLight' : 'tertiaryContentDark'}${this.tertiaryContent ? ' hasContent' : ''}`, 'searchcraft-base-search-result-tertiary-content'), style: styles.tertiaryContent || {} }, this.tertiaryContent)), this.buttonText && (h("button", { key: '442dc9aebe748ef06710e196382a80bf006a383e', onClick: this.handleButtonClick, style: styles.button || {}, type: 'button' }, this.buttonText))));
193
- return (h("a", { key: '2cf6a6d3768266f6d46e700588083aade92142f7', class: classNames(this.isInteractive
194
- ? isLightTheme
195
- ? 'interactiveResultContainerLight'
196
- : 'interactiveResultContainerDark'
197
- : '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 ? (h(Fragment, null, contentContainer, imageContainer)) : (h(Fragment, null, imageContainer, contentContainer))));
198
- }
199
- };
200
- SearchcraftBaseSearchResult.style = SearchcraftBaseSearchResultStyle0;
201
-
202
- const searchcraftBaseSearchResultsModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.resultsContainer{display:flex;flex-direction:column;justify-content:center;margin:16px 0}.resultsContainer>p{align-self:center}.resultsContainer>div{margin-bottom:20px}.resultsContainer>div img{height:300px;width:200px}.adSection{align-items:center;background-color:#F1F1F1;border:1px solid #DCDDDE;border-radius:16px;display:flex;flex-direction:column;font-size:16px;justify-content:center;margin:auto;min-height:150px;text-align:center;width:100%}.adSection p{margin-top:5px}.emptyState{text-align:center;width:100%}.errorMessageContainer{text-align:center}";
203
- const SearchcraftBaseSearchResultsStyle0 = searchcraftBaseSearchResultsModuleCss;
204
-
205
- const SearchcraftBaseSearchResults = class {
206
- constructor(hostRef) {
207
- registerInstance(this, hostRef);
208
- this.noResults = createEvent(this, "noResults", 7);
209
- this.adInterval = 4;
210
- this.customStylesForResults = {};
211
- this.documentAttributesForDisplay = '';
212
- this.fallbackElement = null;
213
- this.formatTime = true;
214
- this.placeAdAtEnd = false;
215
- this.placeAdAtStart = true;
216
- this.placeResultImageRight = false;
217
- this.isInteractive = false;
218
- this.hasSearched = false;
219
- this.query = '';
220
- this.searchResults = null;
221
- }
222
- componentDidLoad() {
223
- if (!this.documentAttributesForDisplay ||
224
- this.documentAttributesForDisplay.length === 0) {
225
- console.warn('No document attributes provided; using empty keys array.');
226
- this.documentAttributesForDisplay = '';
227
- }
228
- this.unsubscribe = useSearchcraftStore.subscribe((state) => {
229
- if (state.query.length > 0) {
230
- this.hasSearched = true;
231
- }
232
- else {
233
- this.hasSearched = false;
234
- }
235
- this.searchResults = Object.assign({}, state.searchResults);
236
- this.query = state.query;
237
- });
238
- const { searchResults, query } = useSearchcraftStore.getState();
239
- this.searchResults = searchResults;
240
- this.query = query;
241
- }
242
- disconnectedCallback() {
243
- if (this.unsubscribe) {
244
- this.unsubscribe();
245
- }
246
- }
247
- render() {
248
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
249
- if (!this.hasSearched) {
250
- return (h("div", { class: classNames('emptyState', 'searchcraft-search-results-empty-state-container') }, h("slot", { name: 'empty-search' })));
251
- }
252
- if (!((_a = this.searchResults) === null || _a === void 0 ? void 0 : _a.data)) {
253
- return;
254
- }
255
- const parsedSearchKeys = parseSearchKeys(this.documentAttributesForDisplay);
256
- const serializedStyles = typeof this.customStylesForResults === 'string'
257
- ? this.customStylesForResults
258
- : serializeStyles(this.customStylesForResults);
259
- const resultsComponents = (_d = (_c = (_b = this.searchResults) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.hits) === null || _d === void 0 ? void 0 : _d.map((document, index) => {
260
- const { doc: result } = document;
261
- const dynamicProperties = extractDynamicProperties(result, parsedSearchKeys);
262
- if (this.formatTime) {
263
- for (const key of parsedSearchKeys) {
264
- if (dynamicProperties[key]) {
265
- const value = dynamicProperties[key];
266
- if (typeof value === 'string' &&
267
- !Number.isNaN(Date.parse(value))) {
268
- dynamicProperties[key] = getFormattedTimeFromNow(value);
269
- }
270
- }
271
- }
272
- }
273
- return (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}`, "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 }));
274
- });
275
- const finalComponents = [];
276
- if (this.placeAdAtStart) {
277
- finalComponents.push(h("div", { key: 'ad-section-start', class: classNames('adSection', 'searchcraft-beginning-injected-ad-section') }, h("span", null, "##"), h("p", null, " Ad Impressions")));
278
- }
279
- if (this.adInterval > 0) {
280
- resultsComponents.forEach((component, index) => {
281
- finalComponents.push(component);
282
- if ((index + 1) % this.adInterval === 0) {
283
- finalComponents.push(h("div", { key: `ad-section-${index + 1}`, class: classNames('adSection', 'searchcraft-dynamic-injected-ad-section') }, h("span", null, "##"), h("p", null, " Ad Impressions")));
284
- }
285
- });
286
- }
287
- else {
288
- finalComponents.push(...resultsComponents);
289
- }
290
- if (this.placeAdAtEnd) {
291
- finalComponents.push(h("div", { key: 'ad-section-end', class: classNames('adSection', 'searchcraft-end-injected-ad-section') }, h("span", null, "##"), h("p", null, " Ad Impressions")));
292
- }
293
- 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) {
294
- this.noResults.emit();
295
- }
296
- return (h("div", { class: classNames('resultsContainer', 'searchcraft-search-results-container') }, finalComponents, this.query.length > 0 &&
297
- ((_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 && (h("div", { class: classNames('errorMessageContainer', 'searchcraft-search-results-error-message-container') }, h("searchcraft-error-message", { "error-message": `No search results found for "${this.query}" query` })))));
298
- }
299
- };
300
- SearchcraftBaseSearchResults.style = SearchcraftBaseSearchResultsStyle0;
301
-
302
- const SearchcraftCheckIcon = class {
303
- constructor(hostRef) {
304
- registerInstance(this, hostRef);
305
- }
306
- render() {
307
- return (h("svg", { key: '3db200942b79612a38293544a029c6854dfa4beb', width: '16', height: '16', viewBox: '0 0 16 16', fill: 'none' }, h("title", { key: 'b7b6af8651edb5cc0e054ed775b9029c6c93535e' }, "Checkbox Check"), h("path", { key: '7c74edc45f007245e4c6e4fd5d37dbc6dad20de0', d: 'M13.9999 2L5.74988 10L1.99988 6.36364', stroke: 'white', "stroke-width": '3', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
308
- }
309
- };
310
-
311
- const SearchcraftClearIconSet = class {
312
- constructor(hostRef) {
313
- registerInstance(this, hostRef);
314
- this.type = 'clear-light';
315
- }
316
- render() {
317
- switch (this.type) {
318
- case 'clear-light':
319
- return (h("svg", { width: '22', height: '22', viewBox: '0 0 22 22', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'icon-title' }, h("title", { id: 'icon-title' }, "Searchcraft Clear Input Icon Light"), h("path", { d: 'M14 8L8 14M8 8L14 14M21 11C21 16.5228 16.5228 21 11 21C5.47715 21 1 16.5228 1 11C1 5.47715 5.47715 1 11 1C16.5228 1 21 5.47715 21 11Z', stroke: 'black', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
320
- case 'clear-dark':
321
- return (h("svg", { width: '22', height: '22', viewBox: '0 0 22 22', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'icon-title' }, h("title", { id: 'icon-title' }, "Searchcraft Clear Input Icon Dark"), h("path", { d: 'M14 8L8 14M8 8L14 14M21 11C21 16.5228 16.5228 21 11 21C5.47715 21 1 16.5228 1 11C1 5.47715 5.47715 1 11 1C16.5228 1 21 5.47715 21 11Z', stroke: 'white', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
322
- case 'arrow-light':
323
- return (h("svg", { width: '20', height: '21', viewBox: '0 0 20 21', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'icon-title' }, h("title", { id: 'icon-title' }, "Searchcraft Arrow Right Icon Light"), h("path", { d: 'M7.5 15.0444L12.5 10.0444L7.5 5.04443', stroke: '#737373', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
324
- case 'arrow-dark':
325
- return (h("svg", { width: '8', height: '12', viewBox: '0 0 8 12', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'icon-title' }, h("title", { id: 'icon-title' }, "Searchcraft Arrow Right Icon Dark"), h("path", { d: 'M1.5 11L6.5 6L1.5 1', stroke: '#BFBFBF', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
326
- default:
327
- return null;
328
- }
329
- }
330
- };
331
-
332
- 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}";
333
- const SearchcraftClearInputButtonStyle0 = searchcraftClearInputButtonModuleCss;
334
-
335
- const SearchcraftClearInputButton = class {
336
- constructor(hostRef) {
337
- registerInstance(this, hostRef);
338
- this.clearInput = createEvent(this, "clearInput", 7);
339
- this.isLightTheme = () => {
340
- return this.theme === 'light';
341
- };
342
- this.handleClearClick = (event) => {
343
- event.preventDefault();
344
- this.clearInput.emit();
345
- };
346
- this.isRequesting = false;
347
- this.rightToLeftOrientation = false;
348
- this.theme = 'light';
349
- }
350
- render() {
351
- return this.rightToLeftOrientation ? (h("button", { class: classNames('inputClearButtonRTL', 'searchcraft-clear-input-button-rtl'), onClick: this.handleClearClick, type: 'button' }, this.isLightTheme ? (h("searchcraft-clear-icon-set", { type: 'clear-light' })) : (h("searchcraft-clear-icon-set", { type: 'clear-dark' })))) : (h("button", { class: classNames('inputClearButtonLTR', 'searchcraft-clear-input-button-ltr'), onClick: this.handleClearClick, type: 'button' }, this.isLightTheme ? (h("searchcraft-clear-icon-set", { type: 'clear-light' })) : (h("searchcraft-clear-icon-set", { type: 'clear-dark' }))));
352
- }
353
- };
354
- SearchcraftClearInputButton.style = SearchcraftClearInputButtonStyle0;
355
-
356
- const SearchcraftDashIcon = class {
357
- constructor(hostRef) {
358
- registerInstance(this, hostRef);
359
- }
360
- render() {
361
- return (h("svg", { key: '4d0c3ab69a973ec8b1d89f52082e4b98ce17e39d', width: '14', height: '3', viewBox: '0 0 14 3', fill: 'none' }, h("title", { key: '99a099dcd6a163ba5b8c1f5b80f9ebfde2152778' }, "Checkbox Dash"), h("line", { key: '49f030f69ff1d37139f868ffb94b5f24442dce37', x1: '1.5', y1: '1.5', x2: '12.5', y2: '1.5', stroke: 'white', "stroke-width": '3', "stroke-linecap": 'round' })));
362
- }
363
- };
364
-
365
- const searchcraftErrorMessageModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.errorMessageLight{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#990000}.errorMessageDark{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#FFB3B3}";
366
- const SearchcraftErrorMessageStyle0 = searchcraftErrorMessageModuleCss;
367
-
368
- const SearchcraftErrorMessage = class {
369
- constructor(hostRef) {
370
- registerInstance(this, hostRef);
371
- this.errorMessage = undefined;
372
- this.theme = 'light';
373
- }
374
- render() {
375
- const errorMessageStyle = this.theme === 'light' ? 'errorMessageLight' : 'errorMessageDark';
376
- return (h("p", { key: '877438178c5fe951ff4cd184de7130e4e46739a1', class: classNames(errorMessageStyle, 'searchcraft-error-message') }, this.errorMessage || 'Search term is required.'));
377
- }
378
- };
379
- SearchcraftErrorMessage.style = SearchcraftErrorMessageStyle0;
380
-
381
- 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}";
382
- const SearchcraftFiltersListStyle0 = searchcraftFiltersListModuleCss;
383
-
384
- const SearchcraftFiltersList = class {
385
- constructor(hostRef) {
386
- registerInstance(this, hostRef);
387
- this.filtersUpdated = createEvent(this, "filtersUpdated", 7);
388
- this.searchStore = useSearchcraftStore.getState();
389
- this.autoSearchFormElement = null;
390
- this.handleSearchRequest = () => {
391
- this.selectedFilters = [];
392
- this.searchStore.setSelectedFilters([]);
393
- this.emitFiltersUpdate();
394
- };
395
- this.formatLabel = (label, count) => `${label.replace(/-/g, ' ').replace(/\b\w/g, (char) => char.toUpperCase())} (${count})`;
396
- this.filters = [];
397
- this.dynamicFilters = [];
398
- this.selectedFilters = [];
399
- this.query = '';
400
- this.isRequesting = false;
401
- this.resultsCount = 0;
402
- }
403
- connectedCallback() {
404
- var _a;
405
- const state = this.searchStore;
406
- const facets = (_a = state.searchResults) === null || _a === void 0 ? void 0 : _a.data.facets;
407
- if (facets) {
408
- this.populateFiltersFromFacets(facets);
409
- }
410
- this.unsubscribe = useSearchcraftStore.subscribe((state) => {
411
- var _a, _b, _c, _d, _e;
412
- const query = (_a = state.query) === null || _a === void 0 ? void 0 : _a.trim();
413
- const facets = (_b = state.searchResults) === null || _b === void 0 ? void 0 : _b.data.facets;
414
- this.query = query || '';
415
- this.isRequesting = state.isRequesting;
416
- this.resultsCount = ((_e = (_d = (_c = state.searchResults) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.hits) === null || _e === void 0 ? void 0 : _e.length) || 0;
417
- if (facets && this.selectedFilters.length === 0) {
418
- this.populateFiltersFromFacets(facets);
419
- }
420
- });
421
- this.autoSearchFormElement = document.querySelector('searchcraft-auto-search-form');
422
- if (this.autoSearchFormElement) {
423
- this.autoSearchFormElement.addEventListener('querySubmit', this.handleSearchRequest);
424
- }
425
- }
426
- disconnectedCallback() {
427
- if (this.unsubscribe) {
428
- this.unsubscribe();
429
- }
430
- if (this.autoSearchFormElement) {
431
- this.autoSearchFormElement.removeEventListener('querySubmit', this.handleSearchRequest);
432
- }
433
- }
434
- populateFiltersFromFacets(facets) {
435
- var _a;
436
- const flattened = flattenFacets(((_a = facets[0]) === null || _a === void 0 ? void 0 : _a.section) || []);
437
- this.dynamicFilters = flattened.map((filter) => ({
438
- label: filter.label,
439
- value: filter.value,
440
- count: filter.count,
441
- children: filter.children || [],
442
- }));
443
- }
444
- handleCheckboxChange(value, isChecked, isParent = false) {
445
- var _a;
446
- if (isParent) {
447
- const parentFilter = this.dynamicFilters.find((filter) => filter.value === value);
448
- const childValues = ((_a = parentFilter === null || parentFilter === void 0 ? void 0 : parentFilter.children) === null || _a === void 0 ? void 0 : _a.map((child) => child.value)) || [];
449
- if (!isChecked) {
450
- this.selectedFilters = this.selectedFilters.filter((filter) => filter !== value && !childValues.includes(filter));
451
- }
452
- else {
453
- this.selectedFilters = [...this.selectedFilters, value];
454
- }
455
- }
456
- else {
457
- this.selectedFilters = isChecked
458
- ? [...this.selectedFilters, value]
459
- : this.selectedFilters.filter((filter) => filter !== value);
460
- }
461
- this.emitFiltersUpdate();
462
- }
463
- emitFiltersUpdate() {
464
- this.filtersUpdated.emit(this.selectedFilters);
465
- this.searchStore.setSelectedFilters(this.selectedFilters);
466
- this.searchStore.search();
467
- }
468
- render() {
469
- if (!this.query || this.resultsCount === 0) {
470
- return null;
471
- }
472
- return (h("div", { class: classNames('filtersListContainer', 'searchcraft-filters-list-container') }, this.dynamicFilters.map((filter) => {
473
- const isChildSelected = filter.children
474
- ? filter.children.some((child) => this.selectedFilters.includes(child.value))
475
- : false;
476
- return (h("div", { key: filter.value, class: classNames('searchcraft-filters-list-item') }, h("label", { class: classNames('filterCheckboxLabel', 'searchcraft-filters-list-checkbox-label') }, h("input", { checked: this.selectedFilters.includes(filter.value), onChange: (event) => this.handleCheckboxChange(filter.value, event.target.checked, true), type: 'checkbox' }), isChildSelected ? (h("div", { class: classNames('dashContainer', 'searchcraft-filter-list-dash-container') }, h("searchcraft-dash-icon", null))) : (h("div", { class: classNames('checkContainer', 'searchcraft-filter-list-check-container') }, h("searchcraft-check-icon", null))), this.formatLabel(filter.label, filter.count)), filter.children && filter.children.length > 0 && (h(Fragment, null, filter.children.map((child) => (h("label", { key: child.value, class: classNames('childFilterCheckboxLabel', 'searchcraft-child-filter-checkbox-label'), style: {
477
- display: this.selectedFilters.includes(filter.value)
478
- ? 'flex'
479
- : 'none',
480
- } }, h("input", { checked: this.selectedFilters.includes(child.value), onChange: (event) => this.handleCheckboxChange(child.value, event.target.checked), type: 'checkbox' }), h("div", { class: classNames('checkContainer', 'searchcraft-filter-list-check-container') }, h("searchcraft-check-icon", null)), this.formatLabel(child.label.includes('/')
481
- ? child.label.split('/').pop() || child.label
482
- : child.label, child.count))))))));
483
- })));
484
- }
485
- };
486
- SearchcraftFiltersList.style = SearchcraftFiltersListStyle0;
487
-
488
- 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%}";
489
- const SearchcraftInputStyle0 = searchcraftInputModuleCss;
490
-
491
- const SearchcraftInput = class {
492
- constructor(hostRef) {
493
- registerInstance(this, hostRef);
494
- this.clearInput = createEvent(this, "clearInput", 7);
495
- this.searchInputChange = createEvent(this, "searchInputChange", 7);
496
- this.inputKeyUp = createEvent(this, "inputKeyUp", 7);
497
- this.handleInputChange = (event) => {
498
- const input = event.target;
499
- this.searchInputChange.emit(input.value);
500
- };
501
- this.handleInputKeyUp = (event) => {
502
- const input = event.target;
503
- this.inputKeyUp.emit(input.value);
504
- };
505
- this.handleClearInput = () => {
506
- if (this.query === '') {
507
- return;
508
- }
509
- this.query = '';
510
- if (this.clearInput) {
511
- this.clearInput.emit();
512
- }
513
- };
514
- this.customStyles = {};
515
- this.error = false;
516
- this.formClassName = '';
517
- this.inputCaptionClassName = '';
518
- this.inputCaptionValue = '';
519
- this.inputClassName = '';
520
- this.inputIconHeight = 20;
521
- this.inputIconWidth = 20;
522
- this.isRequesting = false;
523
- this.placeholderValue = 'Enter Search';
524
- this.rightToLeftOrientation = false;
525
- this.query = '';
526
- this.theme = 'light';
527
- }
528
- get isLightTheme() {
529
- return this.theme === 'light';
530
- }
531
- render() {
532
- const containerClassName = this.rightToLeftOrientation
533
- ? 'inputContainerRTL'
534
- : 'inputContainerLTR';
535
- const inputClassName = this.error
536
- ? this.isLightTheme
537
- ? 'inputErrorLightRTL'
538
- : 'inputErrorDarkRTL'
539
- : this.isLightTheme
540
- ? 'inputLightLTR'
541
- : 'inputDarkLTR';
542
- const validatedCustomStyles = parseCustomStyles(this.customStyles);
543
- const placeholderStyle = {
544
- fontSize: validatedCustomStyles.placeholderFontSize || '16px',
545
- };
546
- return (h("div", { key: '931c969802f73f4fa4d44ea591b506e5d1f9caf1', class: classNames(containerClassName, this.formClassName, 'searchcraft-input-form') }, this.rightToLeftOrientation ? (h(Fragment, null, h("input", { autoComplete: 'off', class: 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 }), h("style", null, `
547
- #searchcraft-input-id::placeholder {
548
- font-size: ${placeholderStyle.fontSize};
549
- }
550
- `), this.inputCaptionValue && (h("searchcraft-input-caption", { inputCaptionClassName: this.inputCaptionClassName, inputCaptionValue: this.inputCaptionValue, rightToLeftOrientation: this.rightToLeftOrientation })), this.query.length > 0 && (h("searchcraft-clear-input-button", { isRequesting: this.isRequesting, onClearInput: this.handleClearInput, rightToLeftOrientation: this.rightToLeftOrientation })), h("searchcraft-input-icon", { error: this.error, height: this.inputIconHeight, rightToLeftOrientation: this.rightToLeftOrientation, width: this.inputIconWidth }))) : (h(Fragment, null, h("searchcraft-input-icon", { error: this.error, height: this.inputIconHeight, rightToLeftOrientation: this.rightToLeftOrientation, width: this.inputIconWidth }), h("input", { autoComplete: 'off', class: 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 }), h("style", null, `
551
- #searchcraft-input-id::placeholder {
552
- font-size: ${placeholderStyle.fontSize};
553
- }
554
- `), this.inputCaptionValue && (h("searchcraft-input-caption", { inputCaptionClassName: this.inputCaptionClassName, inputCaptionValue: this.inputCaptionValue, rightToLeftOrientation: this.rightToLeftOrientation })), this.query.length > 0 && (h("searchcraft-clear-input-button", { isRequesting: this.isRequesting, onClearInput: this.handleClearInput, rightToLeftOrientation: this.rightToLeftOrientation }))))));
555
- }
556
- };
557
- SearchcraftInput.style = SearchcraftInputStyle0;
558
-
559
- const searchcraftInputCaptionModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.inputCaptionLightLTR{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#404040}.inputCaptionDarkLTR{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#E6E6E6}.inputCaptionErrorLightLTR{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#990000}.inputCaptionErrorDarkLTR{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#FFB3B3}.inputCaptionLightRTL{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#404040;text-align:right}.inputCaptionDarkRTL{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#E6E6E6;text-align:right}.inputCaptionErrorLightRTL{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#990000;text-align:right}.inputCaptionErrorDarkRTL{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#FFB3B3;text-align:right}";
560
- const SearchcraftInputCaptionStyle0 = searchcraftInputCaptionModuleCss;
561
-
562
- const SearchcraftInputCaption = class {
563
- constructor(hostRef) {
564
- registerInstance(this, hostRef);
565
- this.error = undefined;
566
- this.inputCaptionClassName = '';
567
- this.inputCaptionValue = 'Enter Search';
568
- this.rightToLeftOrientation = false;
569
- this.theme = 'light';
570
- }
571
- isLightTheme() {
572
- return this.theme === 'light';
573
- }
574
- render() {
575
- return this.rightToLeftOrientation ? (h("p", { class: classNames(this.error
576
- ? this.isLightTheme
577
- ? 'inputCaptionErrorLightRTL'
578
- : 'inputCaptionErrorDarkRTL'
579
- : this.isLightTheme
580
- ? 'inputCaptionLightRTL'
581
- : 'inputCaptionDarkRTL', this.inputCaptionClassName, 'searchcraft-input-caption') }, this.inputCaptionValue)) : (h("p", { class: classNames(this.error
582
- ? this.isLightTheme
583
- ? 'inputCaptionErrorLightLTR'
584
- : 'inputCaptionErrorDarkLTR'
585
- : this.isLightTheme
586
- ? 'inputCaptionLightLTR'
587
- : 'inputCaptionDarkLTR', this.inputCaptionClassName, 'searchcraft-input-caption') }, this.inputCaptionValue));
588
- }
589
- };
590
- SearchcraftInputCaption.style = SearchcraftInputCaptionStyle0;
591
-
592
- 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%)}";
593
- const SearchcraftInputIconStyle0 = searchcraftInputIconModuleCss;
594
-
595
- const SearchcraftInputIcon = class {
596
- constructor(hostRef) {
597
- registerInstance(this, hostRef);
598
- this.error = undefined;
599
- this.height = 20;
600
- this.rightToLeftOrientation = false;
601
- this.width = 20;
602
- this.theme = 'light';
603
- }
604
- isLightTheme() {
605
- return this.theme === 'light';
606
- }
607
- render() {
608
- return this.error ? (h("div", { class: classNames(this.rightToLeftOrientation ? 'inputIconRTL' : 'inputIconLTR', 'searchcraft-input-icon-container') }, this.isLightTheme() ? (h("searchcraft-search-icon-set", { height: this.height, type: 'error-light', width: this.width })) : (h("searchcraft-search-icon-set", { height: this.height, type: 'error-dark', width: this.width })))) : (h("div", { class: classNames(this.rightToLeftOrientation ? 'inputIconRTL' : 'inputIconLTR', 'searchcraft-input-icon-container') }, this.isLightTheme() ? (h("searchcraft-search-icon-set", { height: this.height, type: 'search-light', width: this.width })) : (h("searchcraft-search-icon-set", { height: this.height, type: 'search-dark', width: this.width }))));
609
- }
610
- };
611
- SearchcraftInputIcon.style = SearchcraftInputIconStyle0;
612
-
613
- 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}";
614
- const SearchcraftInputLabelStyle0 = searchcraftInputLabelModuleCss;
615
-
616
- const SearchcraftInputLabel = class {
617
- constructor(hostRef) {
618
- registerInstance(this, hostRef);
619
- this.inputLabelClassName = '';
620
- this.label = undefined;
621
- this.theme = 'light';
622
- }
623
- isLightTheme() {
624
- return this.theme === 'light';
625
- }
626
- render() {
627
- if (!this.label) {
628
- return null;
629
- }
630
- const labelStyle = this.isLightTheme() ? 'labelLight' : 'labelDark';
631
- return (h("label", { class: classNames(labelStyle, this.inputLabelClassName, 'searchcraft-input-label'), htmlFor: 'searchcraft-input-id' }, this.label));
632
- }
633
- };
634
- SearchcraftInputLabel.style = SearchcraftInputLabelStyle0;
635
-
636
- 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}}";
637
- const SearchcraftResultsInfoStyle0 = searchcraftResultsInfoModuleCss;
638
-
639
- const SearchcraftResultsInfo = class {
640
- constructor(hostRef) {
641
- registerInstance(this, hostRef);
642
- this.isRequesting = false;
643
- this.resultsCount = 0;
644
- this.responseTime = '';
645
- this.query = '';
646
- }
647
- connectedCallback() {
648
- this.unsubscribe = useSearchcraftStore.subscribe((state) => {
649
- var _a, _b, _c, _d;
650
- this.isRequesting = state.isRequesting;
651
- this.resultsCount = ((_b = (_a = state.searchResults) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.count) || 0;
652
- 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);
653
- this.query = state.query || '';
654
- });
655
- }
656
- disconnectedCallback() {
657
- if (this.unsubscribe) {
658
- this.unsubscribe();
659
- }
660
- }
661
- render() {
662
- if (!this.query || this.resultsCount === 0) {
663
- return null;
664
- }
665
- const formattedResults = formatNumberWithCommas(this.resultsCount);
666
- return (h("div", { class: classNames('resultsInfoContainer', 'searchcraft-results-info-container') }, h("p", { class: classNames('resultsInfoContent', 'searchcraft-results-info-content') }, formattedResults, " results found in ", this.responseTime, "ms")));
667
- }
668
- };
669
- SearchcraftResultsInfo.style = SearchcraftResultsInfoStyle0;
670
-
671
- const SearchcraftSearchIconSet = class {
672
- constructor(hostRef) {
673
- registerInstance(this, hostRef);
674
- this.type = 'search-dark';
675
- this.width = 20;
676
- this.height = 20;
677
- }
678
- render() {
679
- const { width, height } = this;
680
- switch (this.type) {
681
- case 'search-light':
682
- return (h("svg", { width: width, height: height, viewBox: '0 0 20 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'searchcraft-title' }, h("title", { id: 'searchcraft-title' }, "Searchcraft Search Icon Light"), h("path", { d: 'M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z', stroke: '#404040', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
683
- case 'search-dark':
684
- return (h("svg", { width: width, height: height, viewBox: '0 0 18 18', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'searchcraft-title' }, h("title", { id: 'searchcraft-title' }, "Searchcraft Search Icon Dark"), h("path", { d: 'M16.5 16.5L12.875 12.875M14.8333 8.16667C14.8333 11.8486 11.8486 14.8333 8.16667 14.8333C4.48477 14.8333 1.5 11.8486 1.5 8.16667C1.5 4.48477 4.48477 1.5 8.16667 1.5C11.8486 1.5 14.8333 4.48477 14.8333 8.16667Z', stroke: '#E6E6E6', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
685
- case 'error-light':
686
- return (h("svg", { width: width, height: height, viewBox: '0 0 20 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'searchcraft-title' }, h("title", { id: 'searchcraft-title' }, "Searchcraft Error Search Icon Light"), h("path", { d: 'M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z', stroke: '#737373', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
687
- case 'error-dark':
688
- return (h("svg", { width: width, height: height, viewBox: '0 0 18 18', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', "aria-labelledby": 'searchcraft-title' }, h("title", { id: 'searchcraft-title' }, "Searchcraft Error Search Icon Dark"), h("path", { d: 'M16.5 16.5L12.875 12.875M14.8333 8.16667C14.8333 11.8486 11.8486 14.8333 8.16667 14.8333C4.48477 14.8333 1.5 11.8486 1.5 8.16667C1.5 4.48477 4.48477 1.5 8.16667 1.5C11.8486 1.5 14.8333 4.48477 14.8333 8.16667Z', stroke: '#BFBFBF', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' })));
689
- default:
690
- return null;
691
- }
692
- }
693
- };
694
-
695
- 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}";
696
- const SearchcraftSliderStyle0 = searchcraftSliderModuleCss;
697
-
698
- const SearchcraftSlider = class {
699
- constructor(hostRef) {
700
- registerInstance(this, hostRef);
701
- this.rangeChanged = createEvent(this, "rangeChanged", 7);
702
- this.searchStore = useSearchcraftStore.getState();
703
- this.updateYears = async () => {
704
- this.searchStore.setYearsRange([this.startYear, this.endYear]);
705
- this.rangeChanged.emit({
706
- startYear: this.startYear,
707
- endYear: this.endYear,
708
- });
709
- try {
710
- if (typeof this.query === 'string' && this.query.trim() !== '') {
711
- await this.searchStore.search();
712
- }
713
- else {
714
- console.warn('Query is missing or empty, skipping search request.');
715
- }
716
- }
717
- catch (error) {
718
- console.error('Search failed:', error);
719
- }
720
- };
721
- this.handleStartYearChange = (event) => {
722
- const value = Number.parseInt(event.target.value, 10);
723
- if (value <= this.endYear) {
724
- this.startYear = value;
725
- this.updateYears();
726
- }
727
- };
728
- this.handleEndYearChange = (event) => {
729
- const value = Number.parseInt(event.target.value, 10);
730
- if (value >= this.startYear) {
731
- this.endYear = value;
732
- this.updateYears();
733
- }
734
- };
735
- this.maxYear = new Date().getFullYear();
736
- this.minYear = 2014;
737
- this.endYear = this.maxYear;
738
- this.hasSearched = false;
739
- this.query = '';
740
- this.resultsCount = 0;
741
- this.startYear = this.minYear;
742
- }
743
- componentDidLoad() {
744
- this.unsubscribe = useSearchcraftStore.subscribe((state) => {
745
- var _a, _b, _c;
746
- if (state.query.length > 0) {
747
- this.hasSearched = true;
748
- this.resultsCount = ((_c = (_b = (_a = state.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;
749
- }
750
- this.query = state.query;
751
- });
752
- }
753
- disconnectedCallback() {
754
- if (this.unsubscribe) {
755
- this.unsubscribe();
756
- }
757
- }
758
- render() {
759
- if (!this.query || this.resultsCount === 0) {
760
- return null;
761
- }
762
- const rangeMin = this.minYear;
763
- const rangeMax = this.maxYear;
764
- const startPercent = ((this.startYear - rangeMin) / (rangeMax - rangeMin)) * 100;
765
- const endPercent = ((this.endYear - rangeMin) / (rangeMax - rangeMin)) * 100;
766
- return (h("div", { class: classNames('sliderContainer', 'searchcraft-slider-container') }, h("div", { class: classNames('rangeContainer', 'searchcraft-slider-range-container') }, h("div", { class: classNames('activeRange', 'searchcraft-slider-active-range'), style: {
767
- left: `${startPercent}%`,
768
- width: `${endPercent - startPercent}%`,
769
- } }), h("input", { class: classNames('rangeSlider', 'searchcraft-slider-range-slider-start-thumb'), max: this.maxYear, min: this.minYear, onInput: this.handleStartYearChange, step: '1', type: 'range', value: this.startYear }), h("input", { class: classNames('rangeSlider', 'searchcraft-slider-range-slider-end-thumb'), max: this.maxYear, min: this.minYear, onInput: this.handleEndYearChange, step: '1', type: 'range', value: this.endYear })), h("div", { class: classNames('yearLabels', 'searchcraft-slider-year-label-container') }, h("span", { class: classNames('yearLabel', 'searchcraft-slider-start-year-label') }, this.startYear), h("span", { class: classNames('yearLabel', 'searchcraft-slider-end-year-label') }, this.endYear))));
770
- }
771
- };
772
- SearchcraftSlider.style = SearchcraftSliderStyle0;
773
-
774
- 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)}";
775
- const SearchcraftToggleButtonStyle0 = searchcraftToggleButtonModuleCss;
776
-
777
- const SearchcraftToggleButton = class {
778
- constructor(hostRef) {
779
- registerInstance(this, hostRef);
780
- this.autoSearchFormElement = null;
781
- this.searchStore = useSearchcraftStore.getState();
782
- this.handleSearchRequest = () => {
783
- this.isActive = false;
784
- this.searchStore.setSearchParams({
785
- mode: 'fuzzy',
786
- sort: 'asc',
787
- });
788
- };
789
- this.handleToggle = async () => {
790
- this.isActive = !this.isActive;
791
- if (this.type === 'mode') {
792
- const mode = this.isActive ? 'normal' : 'fuzzy';
793
- this.searchStore.setSearchParams({
794
- mode,
795
- });
796
- }
797
- else if (this.type === 'sort') {
798
- const sort = this.isActive ? 'desc' : 'asc';
799
- this.searchStore.setSearchParams({
800
- sort,
801
- });
802
- }
803
- try {
804
- await this.searchStore.search();
805
- }
806
- catch (error) {
807
- console.error('Search failed:', error);
808
- }
809
- };
810
- this.type = 'mode';
811
- this.isActive = false;
812
- this.query = '';
813
- this.resultsCount = 0;
814
- }
815
- componentDidLoad() {
816
- this.unsubscribe = useSearchcraftStore.subscribe((state) => {
817
- var _a, _b, _c;
818
- this.query = state.query || '';
819
- this.resultsCount = ((_c = (_b = (_a = state.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;
820
- });
821
- this.autoSearchFormElement = document.querySelector('searchcraft-auto-search-form');
822
- if (this.autoSearchFormElement) {
823
- this.autoSearchFormElement.addEventListener('querySubmit', this.handleSearchRequest);
824
- }
825
- }
826
- disconnectedCallback() {
827
- if (this.unsubscribe) {
828
- this.unsubscribe();
829
- }
830
- if (this.autoSearchFormElement) {
831
- this.autoSearchFormElement.addEventListener('querySubmit', this.handleSearchRequest);
832
- }
833
- }
834
- render() {
835
- if (!this.query || this.resultsCount === 0) {
836
- return null;
837
- }
838
- const toggleContainerStyle = `toggleWrapper ${this.isActive ? 'active' : ''}`;
839
- const toggleSwitchStyle = `toggleSwitch ${this.isActive ? 'active' : ''}`;
840
- return (h("button", { class: classNames(toggleContainerStyle, 'searchcraft-toggle-button-container'), onClick: this.handleToggle, type: 'button' }, h("div", { class: classNames(toggleSwitchStyle, 'searchcraft-toggle-switch') })));
841
- }
842
- };
843
- SearchcraftToggleButton.style = SearchcraftToggleButtonStyle0;
844
-
845
- export { SearchcraftAutoSearchForm as searchcraft_auto_search_form, SearchcraftBaseSearchResult as searchcraft_base_search_result, SearchcraftBaseSearchResults as searchcraft_base_search_results, SearchcraftCheckIcon as searchcraft_check_icon, SearchcraftClearIconSet as searchcraft_clear_icon_set, SearchcraftClearInputButton as searchcraft_clear_input_button, SearchcraftDashIcon as searchcraft_dash_icon, SearchcraftErrorMessage as searchcraft_error_message, SearchcraftFiltersList as searchcraft_filters_list, SearchcraftInput as searchcraft_input, SearchcraftInputCaption as searchcraft_input_caption, SearchcraftInputIcon as searchcraft_input_icon, SearchcraftInputLabel as searchcraft_input_label, SearchcraftResultsInfo as searchcraft_results_info, SearchcraftSearchIconSet as searchcraft_search_icon_set, SearchcraftSlider as searchcraft_slider, SearchcraftToggleButton as searchcraft_toggle_button };
846
-
847
- //# sourceMappingURL=searchcraft-auto-search-form_17.entry.js.map