@nosto/search-js 3.25.5 → 3.25.6

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 (112) hide show
  1. package/dist/AutocompletePageProvider-D48n1GB-.js +37 -0
  2. package/dist/AutocompletePageProvider-DzjwKsBp.cjs +1 -0
  3. package/dist/BaseElement-BnP6tQrH.cjs +1 -0
  4. package/dist/BaseElement-C25wjvSR.js +19 -0
  5. package/dist/CategoryPageProvider-B6w4FHhB.cjs +1 -0
  6. package/dist/CategoryPageProvider-BYw7KGoS.js +30 -0
  7. package/dist/ErrorBoundary-BtAe8lXu.cjs +1 -0
  8. package/dist/ErrorBoundary-Bxyssvki.js +11 -0
  9. package/dist/InfiniteScrollWithObserver-8imjYGGz.js +226 -0
  10. package/dist/InfiniteScrollWithObserver-k7oYk4f9.cjs +1 -0
  11. package/dist/SerpPageProvider-BgRZJNth.cjs +1 -0
  12. package/dist/SerpPageProvider-fg14kNV9.js +30 -0
  13. package/dist/baseConfig-Che6Adb6.js +50 -0
  14. package/dist/baseConfig-jLd7jchq.cjs +1 -0
  15. package/dist/cl-CYT5y6Dn.cjs +1 -0
  16. package/dist/cl-G5KK1qHD.js +6 -0
  17. package/dist/core/core.cjs.js +1 -1
  18. package/dist/core/core.es.js +8 -8
  19. package/dist/currencies/currencies.cjs.js +1 -1
  20. package/dist/currencies/currencies.es.js +61 -65
  21. package/dist/disableNativeAutocomplete-CcR_Ek_P.js +26 -0
  22. package/dist/disableNativeAutocomplete-CjBGhRWW.cjs +1 -0
  23. package/dist/eventBusDispatch-B6VswTu8.cjs +1 -0
  24. package/dist/eventBusDispatch-DnFmEqYe.js +15 -0
  25. package/dist/eventBusSubscribe-C6qT1aOO.js +22 -0
  26. package/dist/eventBusSubscribe-c9a_PP0j.cjs +1 -0
  27. package/dist/index.es-Ba4tuzxb.cjs +1 -0
  28. package/dist/index.es-jSYcbRvi.js +25 -0
  29. package/dist/{isBot-B05pQGIe.js → isBot-CPesLwHL.js} +18 -17
  30. package/dist/isBot-CkyQfegP.cjs +1 -0
  31. package/dist/jsxRuntime.module-BRdvPAre.js +30 -0
  32. package/dist/jsxRuntime.module-Ba9fccPy.cjs +1 -0
  33. package/dist/parseNumber-BH_92pM8.cjs +1 -0
  34. package/dist/parseNumber-DFsrGj64.js +9 -0
  35. package/dist/pick-0KNFTqKn.cjs +1 -0
  36. package/dist/pick-B8ymxJme.js +6 -0
  37. package/dist/preact/autocomplete/autocomplete.cjs.js +1 -1
  38. package/dist/preact/autocomplete/autocomplete.es.js +49 -42
  39. package/dist/preact/category/category.cjs.js +1 -1
  40. package/dist/preact/category/category.es.js +9 -4
  41. package/dist/preact/common/common.cjs.js +1 -1
  42. package/dist/preact/common/common.es.js +27 -31
  43. package/dist/preact/events/events.cjs.js +1 -1
  44. package/dist/preact/events/events.es.js +3 -8
  45. package/dist/preact/hooks/hooks.cjs.js +1 -1
  46. package/dist/preact/hooks/hooks.es.js +495 -508
  47. package/dist/preact/inject/inject.cjs.js +1 -1
  48. package/dist/preact/inject/inject.es.js +318 -301
  49. package/dist/preact/legacy/legacy.cjs.js +1 -1
  50. package/dist/preact/legacy/legacy.es.js +8 -10
  51. package/dist/preact/serp/serp.cjs.js +1 -1
  52. package/dist/preact/serp/serp.es.js +28 -18
  53. package/dist/search-BeFE0Ezr.cjs +1 -0
  54. package/dist/search-C2WGFf4C.js +155 -0
  55. package/dist/storage-B3FIcJQv.cjs +1 -0
  56. package/dist/storage-DeAo7M3s.js +115 -0
  57. package/dist/thumbnails/thumbnails.cjs.js +1 -1
  58. package/dist/thumbnails/thumbnails.es.js +93 -97
  59. package/dist/unique-BXFI_-3F.cjs +1 -0
  60. package/dist/unique-DSDxyj90.js +37 -0
  61. package/dist/useActions-BmWNZAES.js +182 -0
  62. package/dist/useActions-boQy-Vp0.cjs +1 -0
  63. package/dist/useHistory-BMkSr69f.js +24 -0
  64. package/dist/useHistory-GRnuHgQ5.cjs +1 -0
  65. package/dist/useLoadMore-B9LiuhfV.cjs +1 -0
  66. package/dist/useLoadMore-BkJV7F21.js +38 -0
  67. package/dist/utils/utils.cjs.js +1 -1
  68. package/dist/utils/utils.es.js +9 -28
  69. package/package.json +4 -4
  70. package/dist/AutocompletePageProvider-CFEbt11-.cjs +0 -1
  71. package/dist/AutocompletePageProvider-CQePqAhB.js +0 -35
  72. package/dist/BaseElement-CIHACCWd.cjs +0 -1
  73. package/dist/BaseElement-DD_4UwDm.js +0 -24
  74. package/dist/CategoryPageProvider-037sXEh9.cjs +0 -1
  75. package/dist/CategoryPageProvider-DVL9lsCU.js +0 -26
  76. package/dist/ErrorBoundary-DFs5vnv-.js +0 -11
  77. package/dist/ErrorBoundary-DNPL7EwP.cjs +0 -1
  78. package/dist/InfiniteScrollWithObserver-BliG4dEl.cjs +0 -1
  79. package/dist/InfiniteScrollWithObserver-DvkEUZUE.js +0 -205
  80. package/dist/SerpPageProvider-BzrNPc7g.js +0 -26
  81. package/dist/SerpPageProvider-CxqiX9Zo.cjs +0 -1
  82. package/dist/baseConfig-BOOw0mWW.cjs +0 -1
  83. package/dist/baseConfig-Cf28X268.js +0 -48
  84. package/dist/cl-B00bZ7jc.cjs +0 -1
  85. package/dist/cl-CcykAxZN.js +0 -6
  86. package/dist/disableNativeAutocomplete-Bkta_WR2.js +0 -27
  87. package/dist/disableNativeAutocomplete-DI6zaZII.cjs +0 -1
  88. package/dist/eventBusDispatch-BKQcSHAB.cjs +0 -1
  89. package/dist/eventBusDispatch-DPR2Vwd4.js +0 -20
  90. package/dist/eventBusSubscribe-B5E7dTzk.js +0 -26
  91. package/dist/eventBusSubscribe-C4H9Nv1Z.cjs +0 -1
  92. package/dist/index.es-Dp6Iaxz3.cjs +0 -1
  93. package/dist/index.es-XNBESE3P.js +0 -26
  94. package/dist/isBot-C-qPIZyF.cjs +0 -1
  95. package/dist/jsxRuntime.module-B3sGoTIU.cjs +0 -1
  96. package/dist/jsxRuntime.module-Bzuv3cXw.js +0 -13
  97. package/dist/parseNumber-FsZ8w61u.cjs +0 -1
  98. package/dist/parseNumber-QA48nJLp.js +0 -11
  99. package/dist/pick-DReBictn.js +0 -9
  100. package/dist/pick-rYi1lc2m.cjs +0 -1
  101. package/dist/search-BchLEATK.cjs +0 -1
  102. package/dist/search-D1jQPG6P.js +0 -156
  103. package/dist/storage-9KuhFI9v.cjs +0 -1
  104. package/dist/storage-B97DRj5i.js +0 -121
  105. package/dist/unique-C1G3v2Y8.cjs +0 -1
  106. package/dist/unique-CCu7ChUL.js +0 -39
  107. package/dist/useActions-BD6dgsX8.js +0 -260
  108. package/dist/useActions-DIlSparF.cjs +0 -1
  109. package/dist/useHistory-DLCyHMo1.cjs +0 -1
  110. package/dist/useHistory-sjFYeR68.js +0 -27
  111. package/dist/useLoadMore-BMOT8Dfn.js +0 -33
  112. package/dist/useLoadMore-vCpwy6JC.cjs +0 -1
@@ -1,205 +0,0 @@
1
- import { u as y } from "./jsxRuntime.module-Bzuv3cXw.js";
2
- import { a as x, u as U } from "./useLoadMore-BMOT8Dfn.js";
3
- import { i as I } from "./storage-B97DRj5i.js";
4
- import { p as A } from "./pick-DReBictn.js";
5
- import { Component as c, options as l, createElement as v, Fragment as d, toChildArray as h } from "preact";
6
- import { useRef as M, useEffect as W } from "preact/hooks";
7
- function V(e, r) {
8
- const t = r.products?.total ?? 0, o = e.products?.from ?? 0, n = e.products?.size ?? 0;
9
- return t > 0 && t > o + n;
10
- }
11
- function ne() {
12
- return !!(window.IntersectionObserver && window.IntersectionObserverEntry && "intersectionRatio" in window.IntersectionObserverEntry.prototype);
13
- }
14
- function H(e, r) {
15
- for (var t in r) e[t] = r[t];
16
- return e;
17
- }
18
- function m(e, r) {
19
- for (var t in e) if (t !== "__source" && !(t in r)) return !0;
20
- for (var o in r) if (o !== "__source" && e[o] !== r[o]) return !0;
21
- return !1;
22
- }
23
- function b(e, r) {
24
- this.props = e, this.context = r;
25
- }
26
- function j(e, r) {
27
- function t(n) {
28
- var i = this.props.ref, u = i == n.ref;
29
- return !u && i && (i.call ? i(null) : i.current = null), r ? !r(this.props, n) || !u : m(this.props, n);
30
- }
31
- function o(n) {
32
- return this.shouldComponentUpdate = t, v(e, n);
33
- }
34
- return o.displayName = "Memo(" + (e.displayName || e.name) + ")", o.prototype.isReactComponent = !0, o.__f = !0, o;
35
- }
36
- (b.prototype = new c()).isPureReactComponent = !0, b.prototype.shouldComponentUpdate = function(e, r) {
37
- return m(this.props, e) || m(this.state, r);
38
- };
39
- var g = l.__b;
40
- l.__b = function(e) {
41
- e.type && e.type.__f && e.ref && (e.props.ref = e.ref, e.ref = null), g && g(e);
42
- };
43
- var z = l.__e;
44
- l.__e = function(e, r, t, o) {
45
- if (e.then) {
46
- for (var n, i = r; i = i.__; ) if ((n = i.__c) && n.__c) return r.__e == null && (r.__e = t.__e, r.__k = t.__k), n.__c(e, r);
47
- }
48
- z(e, r, t, o);
49
- };
50
- var k = l.unmount;
51
- function S(e, r, t) {
52
- return e && (e.__c && e.__c.__H && (e.__c.__H.__.forEach(function(o) {
53
- typeof o.__c == "function" && o.__c();
54
- }), e.__c.__H = null), (e = H({}, e)).__c != null && (e.__c.__P === t && (e.__c.__P = r), e.__c = null), e.__k = e.__k && e.__k.map(function(o) {
55
- return S(o, r, t);
56
- })), e;
57
- }
58
- function C(e, r, t) {
59
- return e && t && (e.__v = null, e.__k = e.__k && e.__k.map(function(o) {
60
- return C(o, r, t);
61
- }), e.__c && e.__c.__P === r && (e.__e && t.appendChild(e.__e), e.__c.__e = !0, e.__c.__P = t)), e;
62
- }
63
- function p() {
64
- this.__u = 0, this.o = null, this.__b = null;
65
- }
66
- function N(e) {
67
- var r = e.__.__c;
68
- return r && r.__a && r.__a(e);
69
- }
70
- function f() {
71
- this.i = null, this.l = null;
72
- }
73
- l.unmount = function(e) {
74
- var r = e.__c;
75
- r && r.__R && r.__R(), r && 32 & e.__u && (e.type = null), k && k(e);
76
- }, (p.prototype = new c()).__c = function(e, r) {
77
- var t = r.__c, o = this;
78
- o.o == null && (o.o = []), o.o.push(t);
79
- var n = N(o.__v), i = !1, u = function() {
80
- i || (i = !0, t.__R = null, n ? n(_) : _());
81
- };
82
- t.__R = u;
83
- var _ = function() {
84
- if (!--o.__u) {
85
- if (o.state.__a) {
86
- var a = o.state.__a;
87
- o.__v.__k[0] = C(a, a.__c.__P, a.__c.__O);
88
- }
89
- var s;
90
- for (o.setState({ __a: o.__b = null }); s = o.o.pop(); ) s.forceUpdate();
91
- }
92
- };
93
- o.__u++ || 32 & r.__u || o.setState({ __a: o.__b = o.__v.__k[0] }), e.then(u, u);
94
- }, p.prototype.componentWillUnmount = function() {
95
- this.o = [];
96
- }, p.prototype.render = function(e, r) {
97
- if (this.__b) {
98
- if (this.__v.__k) {
99
- var t = document.createElement("div"), o = this.__v.__k[0].__c;
100
- this.__v.__k[0] = S(this.__b, t, o.__O = o.__P);
101
- }
102
- this.__b = null;
103
- }
104
- var n = r.__a && v(d, null, e.fallback);
105
- return n && (n.__u &= -33), [v(d, null, r.__a ? null : e.children), n];
106
- };
107
- var O = function(e, r, t) {
108
- if (++t[1] === t[0] && e.l.delete(r), e.props.revealOrder && (e.props.revealOrder[0] !== "t" || !e.l.size)) for (t = e.i; t; ) {
109
- for (; t.length > 3; ) t.pop()();
110
- if (t[1] < t[0]) break;
111
- e.i = t = t[2];
112
- }
113
- };
114
- (f.prototype = new c()).__a = function(e) {
115
- var r = this, t = N(r.__v), o = r.l.get(e);
116
- return o[0]++, function(n) {
117
- var i = function() {
118
- r.props.revealOrder ? (o.push(n), O(r, e, o)) : n();
119
- };
120
- t ? t(i) : i();
121
- };
122
- }, f.prototype.render = function(e) {
123
- this.i = null, this.l = /* @__PURE__ */ new Map();
124
- var r = h(e.children);
125
- e.revealOrder && e.revealOrder[0] === "b" && r.reverse();
126
- for (var t = r.length; t--; ) this.l.set(r[t], this.i = [1, 0, this.i]);
127
- return e.children;
128
- }, f.prototype.componentDidUpdate = f.prototype.componentDidMount = function() {
129
- var e = this;
130
- this.l.forEach(function(r, t) {
131
- O(e, t, r);
132
- });
133
- };
134
- var B = typeof Symbol < "u" && Symbol.for && /* @__PURE__ */ Symbol.for("react.element") || 60103, L = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/, q = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, D = /[A-Z0-9]/g, F = typeof document < "u", T = function(e) {
135
- return (typeof Symbol < "u" && typeof /* @__PURE__ */ Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(e);
136
- };
137
- c.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(e) {
138
- Object.defineProperty(c.prototype, e, { configurable: !0, get: function() {
139
- return this["UNSAFE_" + e];
140
- }, set: function(r) {
141
- Object.defineProperty(this, e, { configurable: !0, writable: !0, value: r });
142
- } });
143
- });
144
- var w = l.event;
145
- function $() {
146
- }
147
- function Z() {
148
- return this.cancelBubble;
149
- }
150
- function G() {
151
- return this.defaultPrevented;
152
- }
153
- l.event = function(e) {
154
- return w && (e = w(e)), e.persist = $, e.isPropagationStopped = Z, e.isDefaultPrevented = G, e.nativeEvent = e;
155
- };
156
- var J = { enumerable: !1, configurable: !0, get: function() {
157
- return this.class;
158
- } }, P = l.vnode;
159
- l.vnode = function(e) {
160
- typeof e.type == "string" && (function(r) {
161
- var t = r.props, o = r.type, n = {}, i = o.indexOf("-") === -1;
162
- for (var u in t) {
163
- var _ = t[u];
164
- if (!(u === "value" && "defaultValue" in t && _ == null || F && u === "children" && o === "noscript" || u === "class" || u === "className")) {
165
- var a = u.toLowerCase();
166
- u === "defaultValue" && "value" in t && t.value == null ? u = "value" : u === "download" && _ === !0 ? _ = "" : a === "translate" && _ === "no" ? _ = !1 : a[0] === "o" && a[1] === "n" ? a === "ondoubleclick" ? u = "ondblclick" : a !== "onchange" || o !== "input" && o !== "textarea" || T(t.type) ? a === "onfocus" ? u = "onfocusin" : a === "onblur" ? u = "onfocusout" : q.test(u) && (u = a) : a = u = "oninput" : i && L.test(u) ? u = u.replace(D, "-$&").toLowerCase() : _ === null && (_ = void 0), a === "oninput" && n[u = a] && (u = "oninputCapture"), n[u] = _;
167
- }
168
- }
169
- o == "select" && n.multiple && Array.isArray(n.value) && (n.value = h(t.children).forEach(function(s) {
170
- s.props.selected = n.value.indexOf(s.props.value) != -1;
171
- })), o == "select" && n.defaultValue != null && (n.value = h(t.children).forEach(function(s) {
172
- s.props.selected = n.multiple ? n.defaultValue.indexOf(s.props.value) != -1 : n.defaultValue == s.props.value;
173
- })), t.class && !t.className ? (n.class = t.class, Object.defineProperty(n, "className", J)) : (t.className && !t.class || t.class && t.className) && (n.class = n.className = t.className), r.props = n;
174
- })(e), e.$$typeof = B, P && P(e);
175
- };
176
- var E = l.__r;
177
- l.__r = function(e) {
178
- E && E(e), e.__c;
179
- };
180
- var R = l.diffed;
181
- l.diffed = function(e) {
182
- R && R(e);
183
- var r = e.props, t = e.__e;
184
- t != null && e.type === "textarea" && "value" in r && r.value !== t.value && (t.value = r.value == null ? "" : r.value);
185
- };
186
- function K({ children: e, pageSize: r, observerOptions: t }) {
187
- const o = M(null), { query: n, response: i } = x((_) => A(_, "query", "response")), { loadMore: u } = U(r);
188
- return W(() => {
189
- let _, a;
190
- return V(n, i) && (_ = o.current, a = new IntersectionObserver((s) => {
191
- s[0]?.isIntersecting && u();
192
- }, t), _ && a.observe(_)), () => {
193
- _ && a.unobserve(_);
194
- };
195
- }, [i]), /* @__PURE__ */ y(d, { children: [
196
- e,
197
- /* @__PURE__ */ y("div", { ref: o, style: { height: "1px" } })
198
- ] });
199
- }
200
- const ue = j(K, I);
201
- export {
202
- ue as I,
203
- V as h,
204
- ne as i
205
- };
@@ -1,26 +0,0 @@
1
- import { u as r } from "./jsxRuntime.module-Bzuv3cXw.js";
2
- import { c as n, S as s, C as c } from "./useActions-BD6dgsX8.js";
3
- import { d as i, u as f, S } from "./baseConfig-Cf28X268.js";
4
- const l = {
5
- ...i,
6
- persistentSearchCache: !1,
7
- preservePageScroll: !1
8
- };
9
- function u(e = {}) {
10
- return {
11
- pageType: "search",
12
- ...l,
13
- ...e
14
- };
15
- }
16
- function g({ config: e, store: t, children: a }) {
17
- const o = t ?? n();
18
- return f(), /* @__PURE__ */ r(c, { value: u(e), children: /* @__PURE__ */ r(s, { value: o, children: [
19
- /* @__PURE__ */ r(S, {}),
20
- a
21
- ] }) });
22
- }
23
- export {
24
- g as S,
25
- u as m
26
- };
@@ -1 +0,0 @@
1
- "use strict";const r=require("./jsxRuntime.module-B3sGoTIU.cjs"),t=require("./useActions-DIlSparF.cjs"),n=require("./baseConfig-BOOw0mWW.cjs"),s={...n.defaultBaseConfig,persistentSearchCache:!1,preservePageScroll:!1};function o(e={}){return{pageType:"search",...s,...e}}function u({config:e,store:i,children:a}){const c=i??t.createStore();return n.useCheckClientScript(),r.u(t.ConfigContext,{value:o(e),children:r.u(t.StoreContext,{value:c,children:[r.u(n.StoreActionsListener,{}),a]})})}exports.SearchPageProvider=u;exports.makeSerpConfig=o;
@@ -1 +0,0 @@
1
- "use strict";const c=require("./useActions-DIlSparF.cjs"),n=require("./eventBusSubscribe-C4H9Nv1Z.cjs"),f=require("./index.es-Dp6Iaxz3.cjs"),b=require("./storage-9KuhFI9v.cjs"),d=require("preact/hooks");function S(){const{pageType:e}=c.useConfig(),{newSearch:i,updateSearch:u,replaceFilter:o,toggleProductFilter:a}=c.useActions();return n.useEventBusSubscribe({event:"actions/newSearch",callback:({query:t,options:r,targetStore:s})=>{e===s&&i(t,r)}}),n.useEventBusSubscribe({event:"actions/updateSearch",callback:({query:t,options:r,targetStore:s})=>{e===s&&u(t,r)}}),n.useEventBusSubscribe({event:"actions/replaceFilter",callback:({field:t,value:r,targetStore:s})=>{e===s&&o(t,r)}}),n.useEventBusSubscribe({event:"actions/toggleProductFilter",callback:({field:t,value:r,active:s,targetStore:l})=>{e===l&&a(t,r,s)}}),null}function g(){d.useEffect(()=>{const e=window.setTimeout(()=>{b.logger.error("Nosto client script has not loaded after 3 seconds.")},3e3);f.s(()=>{window.clearTimeout(e)})},[])}const p={defaultCurrency:"EUR",queryModifications:e=>e};exports.StoreActionsListener=S;exports.defaultBaseConfig=p;exports.useCheckClientScript=g;
@@ -1,48 +0,0 @@
1
- import { b as l, h as f } from "./useActions-BD6dgsX8.js";
2
- import { u as c } from "./eventBusSubscribe-B5E7dTzk.js";
3
- import { s as p } from "./index.es-XNBESE3P.js";
4
- import { l as d } from "./storage-B97DRj5i.js";
5
- import { useEffect as m } from "preact/hooks";
6
- function k() {
7
- const { pageType: e } = l(), { newSearch: n, updateSearch: i, replaceFilter: a, toggleProductFilter: s } = f();
8
- return c({
9
- event: "actions/newSearch",
10
- callback: ({ query: t, options: r, targetStore: o }) => {
11
- e === o && n(t, r);
12
- }
13
- }), c({
14
- event: "actions/updateSearch",
15
- callback: ({ query: t, options: r, targetStore: o }) => {
16
- e === o && i(t, r);
17
- }
18
- }), c({
19
- event: "actions/replaceFilter",
20
- callback: ({ field: t, value: r, targetStore: o }) => {
21
- e === o && a(t, r);
22
- }
23
- }), c({
24
- event: "actions/toggleProductFilter",
25
- callback: ({ field: t, value: r, active: o, targetStore: u }) => {
26
- e === u && s(t, r, o);
27
- }
28
- }), null;
29
- }
30
- function v() {
31
- m(() => {
32
- const e = window.setTimeout(() => {
33
- d.error("Nosto client script has not loaded after 3 seconds.");
34
- }, 3e3);
35
- p(() => {
36
- window.clearTimeout(e);
37
- });
38
- }, []);
39
- }
40
- const C = {
41
- defaultCurrency: "EUR",
42
- queryModifications: (e) => e
43
- };
44
- export {
45
- k as S,
46
- C as d,
47
- v as u
48
- };
@@ -1 +0,0 @@
1
- "use strict";function t(...n){return n.filter(Boolean).join(" ")}exports.cl=t;
@@ -1,6 +0,0 @@
1
- function o(...n) {
2
- return n.filter(Boolean).join(" ");
3
- }
4
- export {
5
- o as c
6
- };
@@ -1,27 +0,0 @@
1
- function y(f, { onClick: d, onFocus: r, onInput: v, onKeyDown: u, onSubmit: l }, { form: c = f.form ?? void 0, nativeSubmit: p } = {}) {
2
- const o = [];
3
- function i(e, s, a) {
4
- e.addEventListener(s, a), o.push(() => e.removeEventListener(s, a));
5
- }
6
- return (u || l) && i(f, "keydown", (e) => {
7
- const s = u?.(f.value, e.key);
8
- u && (e.key === "ArrowDown" || e.key === "ArrowUp") ? e.preventDefault() : l && e.key === "Enter" && (f.value !== "" && !e.repeat && !s && l(f.value), p || e.preventDefault());
9
- }), l && c && (i(c, "submit", (e) => {
10
- p || e.preventDefault(), l(f.value);
11
- }), c.querySelectorAll("[type=submit]").forEach((e) => {
12
- i(e, "click", (s) => {
13
- p || s.preventDefault(), l(f.value);
14
- });
15
- })), d && i(f, "click", () => d(f.value)), r && i(f, "focus", () => r(f.value)), v && i(f, "input", () => v(f.value)), {
16
- destroy() {
17
- o.forEach((e) => e());
18
- }
19
- };
20
- }
21
- function k(f) {
22
- f.setAttribute("autocomplete", "off");
23
- }
24
- export {
25
- y as b,
26
- k as d
27
- };
@@ -1 +0,0 @@
1
- "use strict";function y(f,{onClick:d,onFocus:v,onInput:o,onKeyDown:s,onSubmit:i},{form:c=f.form??void 0,nativeSubmit:p}={}){const r=[];function l(e,u,a){e.addEventListener(u,a),r.push(()=>e.removeEventListener(u,a))}return(s||i)&&l(f,"keydown",e=>{const u=s?.(f.value,e.key);s&&(e.key==="ArrowDown"||e.key==="ArrowUp")?e.preventDefault():i&&e.key==="Enter"&&(f.value!==""&&!e.repeat&&!u&&i(f.value),p||e.preventDefault())}),i&&c&&(l(c,"submit",e=>{p||e.preventDefault(),i(f.value)}),c.querySelectorAll("[type=submit]").forEach(e=>{l(e,"click",u=>{p||u.preventDefault(),i(f.value)})})),d&&l(f,"click",()=>d(f.value)),v&&l(f,"focus",()=>v(f.value)),o&&l(f,"input",()=>o(f.value)),{destroy(){r.forEach(e=>e())}}}function k(f){f.setAttribute("autocomplete","off")}exports.bindInput=y;exports.disableNativeAutocomplete=k;
@@ -1 +0,0 @@
1
- "use strict";const n=require("preact/hooks");function e({event:t,params:s}){window.dispatchEvent(new CustomEvent(`@nosto/search-js/${t}`,{detail:s}))}function o({event:t}){return n.useCallback(s=>{e({event:t,params:s})},[t])}exports.dispatchNostoEvent=e;exports.useEventBusDispatch=o;
@@ -1,20 +0,0 @@
1
- import { useCallback as n } from "preact/hooks";
2
- function o({ event: t, params: s }) {
3
- window.dispatchEvent(
4
- new CustomEvent(`@nosto/search-js/${t}`, {
5
- detail: s
6
- })
7
- );
8
- }
9
- function e({ event: t }) {
10
- return n(
11
- (s) => {
12
- o({ event: t, params: s });
13
- },
14
- [t]
15
- );
16
- }
17
- export {
18
- o as d,
19
- e as u
20
- };
@@ -1,26 +0,0 @@
1
- import { useCallback as r, useEffect as i } from "preact/hooks";
2
- function c({ event: s, callback: n }) {
3
- const e = ((o) => {
4
- const t = o.detail;
5
- n(t);
6
- });
7
- return window.addEventListener(`@nosto/search-js/${s}`, e), () => {
8
- window.removeEventListener(`@nosto/search-js/${s}`, e);
9
- };
10
- }
11
- function u({ event: s, callback: n }) {
12
- const e = r(
13
- (o) => {
14
- const t = o.detail;
15
- n(t);
16
- },
17
- [n]
18
- );
19
- i(() => (window.addEventListener(`@nosto/search-js/${s}`, e), () => {
20
- window.removeEventListener(`@nosto/search-js/${s}`, e);
21
- }), [s, e]);
22
- }
23
- export {
24
- c as s,
25
- u
26
- };
@@ -1 +0,0 @@
1
- "use strict";const r=require("preact/hooks");function i({event:s,callback:n}){const e=(o=>{const t=o.detail;n(t)});return window.addEventListener(`@nosto/search-js/${s}`,e),()=>{window.removeEventListener(`@nosto/search-js/${s}`,e)}}function c({event:s,callback:n}){const e=r.useCallback(o=>{const t=o.detail;n(t)},[n]);r.useEffect(()=>(window.addEventListener(`@nosto/search-js/${s}`,e),()=>{window.removeEventListener(`@nosto/search-js/${s}`,e)}),[s,e])}exports.subscribeToNostoEvent=i;exports.useEventBusSubscribe=c;
@@ -1 +0,0 @@
1
- "use strict";function n(){window.nostojs=window.nostojs??function(o){(window.nostojs.q=window.nostojs.q??[]).push(o)}}async function t(o){return window.nostojs(o)}let i=null;typeof window<"u"&&(n(),t(o=>{i=o.internal.getSettings()}));function u(){return i}async function d(o,s,w){if(!window.Nosto?.addSkuToCart)throw new Error("Nosto addSkuToCart function is not available");await window.Nosto.addSkuToCart(o,s,w)}typeof window<"u"&&n();exports.C=d;exports.i=u;exports.s=t;
@@ -1,26 +0,0 @@
1
- function n() {
2
- window.nostojs = window.nostojs ?? function(o) {
3
- (window.nostojs.q = window.nostojs.q ?? []).push(o);
4
- };
5
- }
6
- async function s(o) {
7
- return window.nostojs(o);
8
- }
9
- let t = null;
10
- typeof window < "u" && (n(), s((o) => {
11
- t = o.internal.getSettings();
12
- }));
13
- function d() {
14
- return t;
15
- }
16
- async function u(o, i, w) {
17
- if (!window.Nosto?.addSkuToCart)
18
- throw new Error("Nosto addSkuToCart function is not available");
19
- await window.Nosto.addSkuToCart(o, i, w);
20
- }
21
- typeof window < "u" && n();
22
- export {
23
- u as C,
24
- d as i,
25
- s
26
- };
@@ -1 +0,0 @@
1
- "use strict";var r=" daum[ /]| deusu/|(?:^|[^g])news(?!sapphire)|(?<! (?:channel/|google/))google(?!(app|/google| pixel))|(?<! cu)bots?(?:\\b|_)|(?<!(?:lib))http|(?<!cam)scan|24x7|@[a-z][\\w-]+\\.|\\(\\)|\\.com\\b|\\b\\w+\\.ai|\\bmanus-user/|\\bort/|\\bperl\\b|\\bsecurityheaders\\b|\\btime/|\\||^[\\w \\.\\-\\(?:\\):%]+(?:/v?\\d+(?:\\.\\d+)?(?:\\.\\d{1,10})*?)?(?:,|$)|^[^ ]{50,}$|^\\d+\\b|^\\W|^\\w*search\\b|^\\w+/[\\w\\(\\)]*$|^\\w+/\\d\\.\\d\\s\\([\\w@]+\\)$|^active|^ad muncher|^amaya|^apache/|^avsdevicesdk/|^azure|^biglotron|^bot|^bw/|^clamav[ /]|^client/|^cobweb/|^custom|^ddg[_-]android|^discourse|^dispatch/\\d|^downcast/|^duckduckgo|^email|^facebook|^getright/|^gozilla/|^hobbit|^hotzonu|^hwcdn/|^igetter/|^jeode/|^jetty/|^jigsaw|^microsoft bits|^movabletype|^mozilla/\\d\\.\\d\\s[\\w\\.-]+$|^mozilla/\\d\\.\\d\\s\\((?:compatible;)?(?:\\s?[\\w\\d-.]+\\/\\d+\\.\\d+)?\\)$|^navermailapp|^netsurf|^offline|^openai/|^owler|^php|^postman|^python|^rank|^read|^reed|^rest|^rss|^snapchat|^space bison|^svn|^swcd |^taringa|^thumbor/|^track|^w3c|^webbandit/|^webcopier|^wget|^whatsapp|^wordpress|^xenu link sleuth|^yahoo|^yandex|^zdm/\\d|^zoom marketplace/|advisor|agent\\b|analyzer|archive|ask jeeves/teoma|audit|bit\\.ly/|bluecoat drtr|browsex|burpcollaborator|capture|catch|check\\b|checker|chrome-lighthouse|chromeframe|classifier|cloudflare|convertify|crawl|cypress/|dareboost|datanyze|dejaclick|detect|dmbrowser|download|exaleadcloudview|feed|fetcher|firephp|functionize|grab|headless|httrack|hubspot marketing grader|ibisbrowser|infrawatch|insight|inspect|iplabel|java(?!;)|library|linkcheck|mail\\.ru/|manager|measure|monitor\\b|neustar wpm|node\\b|nutch|offbyone|onetrust|optimize|pageburst|pagespeed|parser|phantomjs|pingdom|powermarks|preview|proxy|ptst[ /]\\d|retriever|rexx;|rigor|rss\\b|scrape|server|sogou|sparkler/|speedcurve|spider|splash|statuscake|supercleaner|synapse|synthetic|tools|torrent|transcoder|url|validator|virtuoso|wappalyzer|webglance|webkit2png|whatcms/|xtate/",t=/bot|crawl|http|lighthouse|scan|search|spider/i,e;function o(){if(e instanceof RegExp)return e;try{e=new RegExp(r,"i")}catch{e=t}return e}function s(a){return!!a&&o().test(a)}function i(){return s(navigator.userAgent)}exports.isBot=i;
@@ -1 +0,0 @@
1
- "use strict";const i=require("preact");var s=0;function p(e,_,f,t,l,c){_||(_={});var n,o,r=_;if("ref"in r)for(o in r={},_)o=="ref"?n=_[o]:r[o]=_[o];var u={type:e,props:r,key:f,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--s,__i:-1,__u:0,__source:l,__self:c};if(typeof e=="function"&&(n=e.defaultProps))for(o in n)r[o]===void 0&&(r[o]=n[o]);return i.options.vnode&&i.options.vnode(u),u}exports.u=p;
@@ -1,13 +0,0 @@
1
- import { options as i } from "preact";
2
- var v = 0;
3
- function t(f, _, u, c, l, p) {
4
- _ || (_ = {});
5
- var n, o, r = _;
6
- if ("ref" in r) for (o in r = {}, _) o == "ref" ? n = _[o] : r[o] = _[o];
7
- var e = { type: f, props: r, key: u, ref: n, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --v, __i: -1, __u: 0, __source: l, __self: p };
8
- if (typeof f == "function" && (n = f.defaultProps)) for (o in n) r[o] === void 0 && (r[o] = n[o]);
9
- return i.vnode && i.vnode(e), e;
10
- }
11
- export {
12
- t as u
13
- };
@@ -1 +0,0 @@
1
- "use strict";function t(r){if(typeof r=="number")return r;if(typeof r!="string")return;const e=Number(r);return isNaN(e)?void 0:e}exports.parseNumber=t;
@@ -1,11 +0,0 @@
1
- function e(r) {
2
- if (typeof r == "number")
3
- return r;
4
- if (typeof r != "string")
5
- return;
6
- const t = Number(r);
7
- return isNaN(t) ? void 0 : t;
8
- }
9
- export {
10
- e as p
11
- };
@@ -1,9 +0,0 @@
1
- function t(r, ...c) {
2
- return c.reduce(
3
- (e, n) => (e[n] = r[n], e),
4
- {}
5
- );
6
- }
7
- export {
8
- t as p
9
- };
@@ -1 +0,0 @@
1
- "use strict";function r(i,...n){return n.reduce((c,e)=>(c[e]=i[e],c),{})}exports.pick=r;
@@ -1 +0,0 @@
1
- "use strict";const g=require("./index.es-Dp6Iaxz3.cjs"),o=require("./storage-9KuhFI9v.cjs");async function y(t,{hitDecorators:e,...n},s){const r=await s(t,n);if(!r.products?.hits?.length||!e?.length)return r;const c=i=>e.reduce((u,a)=>a(u),i);return{...r,products:{...r.products,hits:r.products.hits.map(c)}}}const h="nosto:search-js:cache",m=60*1e3;function S(t,e){o.setSessionStorageItem(h,{query:t,result:e,created:Date.now()})}function C(t){const e=o.getSessionStorageItem(h);if(!e||!R(e))return null;const n=l(e.query);return!o.isEqual(l(t),n)||Date.now()-e.created>m?null:e.result}function l(t){const e={...t,time:void 0,products:{...t.products,size:void 0}};return JSON.parse(JSON.stringify(e))}function R(t){return typeof t=="object"&&t!==null&&"query"in t&&"result"in t&&"created"in t}async function b(t,{usePersistentCache:e,...n},s){if(!e)return s(t,n);const r=await k(t,n,s);return S(t,r),r}async function k(t,e,n){const{from:s=0,size:r=0}=t.products||{},c=C(t);if(!c)return await n(t,e);const i=c?.products?.size??0,u=c?.products?.hits??[];if(r===i)return c;if(r<i)return{...c,products:{...c.products,size:r,hits:u.slice(0,r),total:c.products?.total||0}};const a=r-u.length,p=s>0?s+1:r-a,w={...t,products:{...t.products,from:p,size:a}},f=await n(w,e);return{...c,products:{...c.products,size:r,hits:[...c.products?.hits||[],...f.products?.hits||[]],total:f.products?.total||0}}}const T=3e4,d=new Map;function z(t,e){const n=d.get(t);if(!n)return;const s=Date.now()-n.created>T,r=o.isEqual(e,n.query);if(s||!r){d.delete(t);return}return n.result}function E(t,e,n){d.set(t,{query:e,result:n,created:Date.now()})}async function _(t,e,n){if(!e.useMemoryCache)return n(t,e);const s=JSON.stringify(t),r=z(s,t);if(r)return r;const c=await n(t,e);return E(s,t,c),c}async function N(t,e,n){if(!e.redirect)return n(t,e);const s=await n(t,e);if(s.keywords?.hits?.length){const r=s.keywords.hits.find(c=>c.keyword===t.query&&c._redirect);r&&r._redirect&&(window.location.href=r._redirect)}return s}function W(t){return new Promise(e=>setTimeout(e,t))}async function D(t,{maxRetries:e=0,retryInterval:n=0,...s},r){let c=0;for(;;)try{return await r(t,s)}catch(i){if(c>=e)throw i;if(!M(i))throw o.logger.info("Skipping retry logic for",i),i;c++,await W(n)}}function M(t){return!t||typeof t!="object"?!1:!("status"in t)||O(t.status)}function O(t){return typeof t=="number"&&(t<400||t>=500)}async function j(t,e={}){const n=await new Promise(g.s);return J(n.search,D,N,_,b,y)(t,e)}function J(t,...e){return e.reduce((n,s)=>(r,c)=>s(r,c,n),t)}exports.search=j;
@@ -1,156 +0,0 @@
1
- import { s as m } from "./index.es-XNBESE3P.js";
2
- import { d as g, a as y, i as l, l as S } from "./storage-B97DRj5i.js";
3
- async function C(t, { hitDecorators: e, ...n }, s) {
4
- const r = await s(t, n);
5
- if (!r.products?.hits?.length || !e?.length)
6
- return r;
7
- const c = (o) => e.reduce((i, a) => a(i), o);
8
- return {
9
- ...r,
10
- products: {
11
- ...r.products,
12
- hits: r.products.hits.map(c)
13
- }
14
- };
15
- }
16
- const h = "nosto:search-js:cache", R = 60 * 1e3;
17
- function b(t, e) {
18
- g(h, { query: t, result: e, created: Date.now() });
19
- }
20
- function k(t) {
21
- const e = y(h);
22
- if (!e || !T(e))
23
- return null;
24
- const n = d(e.query);
25
- return !l(d(t), n) || Date.now() - e.created > R ? null : e.result;
26
- }
27
- function d(t) {
28
- const e = {
29
- ...t,
30
- time: void 0,
31
- products: {
32
- ...t.products,
33
- size: void 0
34
- }
35
- };
36
- return JSON.parse(JSON.stringify(e));
37
- }
38
- function T(t) {
39
- return typeof t == "object" && t !== null && "query" in t && "result" in t && "created" in t;
40
- }
41
- async function z(t, { usePersistentCache: e, ...n }, s) {
42
- if (!e)
43
- return s(t, n);
44
- const r = await E(t, n, s);
45
- return b(t, r), r;
46
- }
47
- async function E(t, e, n) {
48
- const { from: s = 0, size: r = 0 } = t.products || {}, c = k(t);
49
- if (!c)
50
- return await n(t, e);
51
- const o = c?.products?.size ?? 0, i = c?.products?.hits ?? [];
52
- if (r === o)
53
- return c;
54
- if (r < o)
55
- return {
56
- ...c,
57
- products: {
58
- ...c.products,
59
- size: r,
60
- hits: i.slice(0, r),
61
- total: c.products?.total || 0
62
- }
63
- };
64
- const a = r - i.length, p = s > 0 ? s + 1 : r - a, w = {
65
- ...t,
66
- products: {
67
- ...t.products,
68
- from: p,
69
- size: a
70
- }
71
- }, f = await n(w, e);
72
- return {
73
- ...c,
74
- products: {
75
- ...c.products,
76
- size: r,
77
- hits: [...c.products?.hits || [], ...f.products?.hits || []],
78
- total: f.products?.total || 0
79
- }
80
- };
81
- }
82
- const N = 3e4, u = /* @__PURE__ */ new Map();
83
- function W(t, e) {
84
- const n = u.get(t);
85
- if (!n) return;
86
- const s = Date.now() - n.created > N, r = l(e, n.query);
87
- if (s || !r) {
88
- u.delete(t);
89
- return;
90
- }
91
- return n.result;
92
- }
93
- function _(t, e, n) {
94
- u.set(t, {
95
- query: e,
96
- result: n,
97
- created: Date.now()
98
- });
99
- }
100
- async function D(t, e, n) {
101
- if (!e.useMemoryCache)
102
- return n(t, e);
103
- const s = JSON.stringify(t), r = W(s, t);
104
- if (r) return r;
105
- const c = await n(t, e);
106
- return _(s, t, c), c;
107
- }
108
- async function M(t, e, n) {
109
- if (!e.redirect)
110
- return n(t, e);
111
- const s = await n(t, e);
112
- if (s.keywords?.hits?.length) {
113
- const r = s.keywords.hits.find((c) => c.keyword === t.query && c._redirect);
114
- r && r._redirect && (window.location.href = r._redirect);
115
- }
116
- return s;
117
- }
118
- function O(t) {
119
- return new Promise((e) => setTimeout(e, t));
120
- }
121
- async function j(t, { maxRetries: e = 0, retryInterval: n = 0, ...s }, r) {
122
- let c = 0;
123
- for (; ; )
124
- try {
125
- return await r(t, s);
126
- } catch (o) {
127
- if (c >= e)
128
- throw o;
129
- if (!J(o))
130
- throw S.info("Skipping retry logic for", o), o;
131
- c++, await O(n);
132
- }
133
- }
134
- function J(t) {
135
- return !t || typeof t != "object" ? !1 : !("status" in t) || V(t.status);
136
- }
137
- function V(t) {
138
- return typeof t == "number" && (t < 400 || t >= 500);
139
- }
140
- async function K(t, e = {}) {
141
- const n = await new Promise(m);
142
- return x(
143
- n.search,
144
- j,
145
- M,
146
- D,
147
- z,
148
- C
149
- )(t, e);
150
- }
151
- function x(t, ...e) {
152
- return e.reduce((n, s) => (r, c) => s(r, c, n), t);
153
- }
154
- export {
155
- K as s
156
- };
@@ -1 +0,0 @@
1
- "use strict";const I=require("./index.es-Dp6Iaxz3.cjs");function u(e){return String(e)==="[object Object]"}function c(e){if(!u(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!u(r)||!r.hasOwnProperty("isPrototypeOf"))}function g(e,t){if(e===t)return!0;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((r,n)=>g(r,t[n]));if(c(e)&&c(t)){const r=Object.entries(e);return r.length!==Object.keys(t).length?!1:r.every(([n,y])=>g(y,t[n]))}return!1}function l(){const e=new Map;return{getItem(t){return e.get(t)??null},setItem(t,r){e.set(t,r)},removeItem(t){e.delete(t)},clear(){e.clear()},key(t){return Array.from(e.keys())[t]??null},get length(){return e.size}}}function a(e){return(...t)=>{I.s(r=>{(r.internal.context.mode.isPreview()?console[e]:r.internal.logger[e])(...t)})}}const i={debug:a("debug"),info:a("info"),warn:a("warn"),error:a("error")};function f(e,t,r){try{const n=JSON.stringify(t);r.setItem(e,n)}catch(n){i.warn(n)}}function m(e,t){try{const r=t.getItem(e);if(r)return JSON.parse(r)}catch(r){i.warn(r)}}function S(e,t){try{t.removeItem(e)}catch(r){i.warn(r)}}let o,s;try{o=window.localStorage,s=window.sessionStorage}catch(e){i.warn(e),o=l(),s=l()}function w(e,t){f(e,t,o)}function h(e,t){f(e,t,s)}function O(e){return m(e,o)}function d(e){return m(e,s)}function v(e){S(e,o)}function j(e){S(e,s)}exports.getLocalStorageItem=O;exports.getSessionStorageItem=d;exports.isEqual=g;exports.isPlainObject=c;exports.logger=i;exports.removeLocalStorageItem=v;exports.removeSessionStorageItem=j;exports.setLocalStorageItem=w;exports.setSessionStorageItem=h;