@inploi/plugin-job-search 8.3.0 → 8.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,19 +1,19 @@
1
- import { l as f, _ as y, k as T, J as ao, g as yo, c as ko, f as no, K as _o, a as zo, i as So, T as Yo, b as Do, I as Fo, d as Ao, U as Eo, E as $o } from "./utils-65ec6e7e.js";
2
- import { e as rr } from "./utils-65ec6e7e.js";
1
+ import { l as u, _ as y, k as U, J as ao, g as xo, c as yo, K as ko, a as _o, i as zo, T as So, b as Yo, I as Do, d as Fo, U as Ao, E as Eo, e as $o } from "./utils-c371d06a.js";
2
+ import { f as rr } from "./utils-c371d06a.js";
3
3
  import { createPlugin as Co } from "@inploi/sdk";
4
- var Lo = "diffed", so = "__c", G = "__s", U = "__c", fo = "__k", V = "__d", L = "__s", lo = /[\s\n\\/='"\0<>]/, co = /^(xlink|xmlns|xml)([A-Z])/, Po = /^(?:accessK|auto[A-Z]|cell|ch|col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|src[A-Z]|tabI|useM|item[A-Z])/, To = /^ac|^ali|arabic|basel|cap|clipPath$|clipRule$|color|dominant|enable|fill|flood|font|glyph[^R]|horiz|image|letter|lighting|marker[^WUH]|overline|panose|pointe|paint|rendering|shape|stop|strikethrough|stroke|text[^L]|transform|underline|unicode|units|^v[^i]|^w|^xH/, Uo = /* @__PURE__ */ new Set(["draggable", "spellcheck"]);
5
- function uo(o) {
4
+ var Lo = "diffed", no = "__c", G = "__s", P = "__c", vo = "__k", V = "__d", C = "__s", so = /[\s\n\\/='"\0<>]/, lo = /^(xlink|xmlns|xml)([A-Z])/, Uo = /^(?:accessK|auto[A-Z]|cell|ch|col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|src[A-Z]|tabI|useM|item[A-Z])/, Po = /^ac|^ali|arabic|basel|cap|clipPath$|clipRule$|color|dominant|enable|fill|flood|font|glyph[^R]|horiz|image|letter|lighting|marker[^WUH]|overline|panose|pointe|paint|rendering|shape|stop|strikethrough|stroke|text[^L]|transform|underline|unicode|units|^v[^i]|^w|^xH/, To = /* @__PURE__ */ new Set(["draggable", "spellcheck"]);
5
+ function fo(o) {
6
6
  o.__g !== void 0 ? o.__g |= 8 : o[V] = !0;
7
7
  }
8
- function Io(o) {
8
+ function Mo(o) {
9
9
  o.__g !== void 0 ? o.__g &= -9 : o[V] = !1;
10
10
  }
11
- function po(o) {
11
+ function co(o) {
12
12
  return o.__g !== void 0 ? !!(8 & o.__g) : o[V] === !0;
13
13
  }
14
- var Mo = /["&<]/;
14
+ var Io = /["&<]/;
15
15
  function H(o) {
16
- if (o.length === 0 || Mo.test(o) === !1)
16
+ if (o.length === 0 || Io.test(o) === !1)
17
17
  return o;
18
18
  for (var t = 0, e = 0, i = "", l = ""; e < o.length; e++) {
19
19
  switch (o.charCodeAt(e)) {
@@ -33,42 +33,42 @@ function H(o) {
33
33
  }
34
34
  return e !== t && (i += o.slice(t, e)), i;
35
35
  }
36
- var ho = {}, Xo = /* @__PURE__ */ new Set(["animation-iteration-count", "border-image-outset", "border-image-slice", "border-image-width", "box-flex", "box-flex-group", "box-ordinal-group", "column-count", "fill-opacity", "flex", "flex-grow", "flex-negative", "flex-order", "flex-positive", "flex-shrink", "flood-opacity", "font-weight", "grid-column", "grid-row", "line-clamp", "line-height", "opacity", "order", "orphans", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-miterlimit", "stroke-opacity", "stroke-width", "tab-size", "widows", "z-index", "zoom"]), Zo = /[A-Z]/g;
36
+ var po = {}, Xo = /* @__PURE__ */ new Set(["animation-iteration-count", "border-image-outset", "border-image-slice", "border-image-width", "box-flex", "box-flex-group", "box-ordinal-group", "column-count", "fill-opacity", "flex", "flex-grow", "flex-negative", "flex-order", "flex-positive", "flex-shrink", "flood-opacity", "font-weight", "grid-column", "grid-row", "line-clamp", "line-height", "opacity", "order", "orphans", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-miterlimit", "stroke-opacity", "stroke-width", "tab-size", "widows", "z-index", "zoom"]), Zo = /[A-Z]/g;
37
37
  function Ro(o) {
38
38
  var t = "";
39
39
  for (var e in o) {
40
40
  var i = o[e];
41
41
  if (i != null && i !== "") {
42
- var l = e[0] == "-" ? e : ho[e] || (ho[e] = e.replace(Zo, "-$&").toLowerCase()), p = ";";
42
+ var l = e[0] == "-" ? e : po[e] || (po[e] = e.replace(Zo, "-$&").toLowerCase()), p = ";";
43
43
  typeof i != "number" || l.startsWith("--") || Xo.has(l) || (p = "px;"), t = t + l + ":" + i + p;
44
44
  }
45
45
  }
46
46
  return t || void 0;
47
47
  }
48
- function wo() {
48
+ function ho() {
49
49
  this.__d = !0;
50
50
  }
51
51
  function Wo(o, t) {
52
- return { __v: o, context: t, props: o.props, setState: wo, forceUpdate: wo, __d: !0, __h: new Array(0) };
52
+ return { __v: o, context: t, props: o.props, setState: ho, forceUpdate: ho, __d: !0, __h: new Array(0) };
53
53
  }
54
- var Q, A, X, M, oo = {}, bo = [], P = Array.isArray, K = Object.assign, g = "", q = "<!--$s-->", B = "<!--/$s-->";
54
+ var Q, F, X, I, oo = {}, wo = [], L = Array.isArray, K = Object.assign, g = "", q = "<!--$s-->", B = "<!--/$s-->";
55
55
  function Ho(o, t, e) {
56
- var i = f[G];
57
- f[G] = !0, Q = f.__b, A = f[Lo], X = f.__r, M = f.unmount;
58
- var l = y(T, null);
59
- l[fo] = [o];
56
+ var i = u[G];
57
+ u[G] = !0, Q = u.__b, F = u[Lo], X = u.__r, I = u.unmount;
58
+ var l = y(U, null);
59
+ l[vo] = [o];
60
60
  try {
61
61
  var p = k(o, t || oo, !1, void 0, l, !1, e);
62
- return P(p) ? p.join(g) : p;
62
+ return L(p) ? p.join(g) : p;
63
63
  } catch (r) {
64
64
  throw r.then ? new Error('Use "renderToStringAsync" for suspenseful rendering.') : r;
65
65
  } finally {
66
- f[so] && f[so](o, bo), f[G] = i, bo.length = 0;
66
+ u[no] && u[no](o, wo), u[G] = i, wo.length = 0;
67
67
  }
68
68
  }
69
- function go(o, t) {
69
+ function bo(o, t) {
70
70
  var e, i = o.type, l = !0;
71
- return o[U] ? (l = !1, (e = o[U]).state = e[L]) : e = new i(o.props, t), o[U] = e, e.__v = o, e.props = o.props, e.context = t, uo(e), e.state == null && (e.state = oo), e[L] == null && (e[L] = e.state), i.getDerivedStateFromProps ? e.state = K({}, e.state, i.getDerivedStateFromProps(e.props, e.state)) : l && e.componentWillMount ? (e.componentWillMount(), e.state = e[L] !== e.state ? e[L] : e.state) : !l && e.componentWillUpdate && e.componentWillUpdate(), X && X(o), e.render(e.props, e.state, t);
71
+ return o[P] ? (l = !1, (e = o[P]).state = e[C]) : e = new i(o.props, t), o[P] = e, e.__v = o, e.props = o.props, e.context = t, fo(e), e.state == null && (e.state = oo), e[C] == null && (e[C] = e.state), i.getDerivedStateFromProps ? e.state = K({}, e.state, i.getDerivedStateFromProps(e.props, e.state)) : l && e.componentWillMount ? (e.componentWillMount(), e.state = e[C] !== e.state ? e[C] : e.state) : !l && e.componentWillUpdate && e.componentWillUpdate(), X && X(o), e.render(e.props, e.state, t);
72
72
  }
73
73
  function k(o, t, e, i, l, p, r) {
74
74
  if (o == null || o === !0 || o === !1 || o === g)
@@ -76,110 +76,110 @@ function k(o, t, e, i, l, p, r) {
76
76
  var m = typeof o;
77
77
  if (m != "object")
78
78
  return m == "function" ? g : m == "string" ? H(o) : o + g;
79
- if (P(o)) {
80
- var h, u = g;
81
- l[fo] = o;
82
- for (var Y = o.length, v = 0; v < Y; v++) {
83
- var D = o[v];
84
- if (D != null && typeof D != "boolean") {
85
- var _, j = k(D, t, e, i, l, p, r);
86
- typeof j == "string" ? u += j : (h || (h = new Array(Y)), u && h.push(u), u = g, P(j) ? (_ = h).push.apply(_, j) : h.push(j));
79
+ if (L(o)) {
80
+ var d, v = g;
81
+ l[vo] = o;
82
+ for (var Y = o.length, _ = 0; _ < Y; _++) {
83
+ var f = o[_];
84
+ if (f != null && typeof f != "boolean") {
85
+ var A, j = k(f, t, e, i, l, p, r);
86
+ typeof j == "string" ? v += j : (d || (d = new Array(Y)), v && d.push(v), v = g, L(j) ? (A = d).push.apply(A, j) : d.push(j));
87
87
  }
88
88
  }
89
- return h ? (u && h.push(u), h) : u;
89
+ return d ? (v && d.push(v), d) : v;
90
90
  }
91
91
  if (o.constructor !== void 0)
92
92
  return g;
93
93
  o.__ = l, Q && Q(o);
94
- var n = o.type, d = o.props;
95
- if (typeof n == "function") {
96
- var E, a, b, Z = t;
97
- if (n === T) {
98
- if ("tpl" in d) {
99
- for (var R = g, I = 0; I < d.tpl.length; I++)
100
- if (R += d.tpl[I], d.exprs && I < d.exprs.length) {
101
- var $ = d.exprs[I];
102
- if ($ == null)
94
+ var h = o.type, a = o.props;
95
+ if (typeof h == "function") {
96
+ var T, n, w, Z = t;
97
+ if (h === U) {
98
+ if ("tpl" in a) {
99
+ for (var R = g, M = 0; M < a.tpl.length; M++)
100
+ if (R += a.tpl[M], a.exprs && M < a.exprs.length) {
101
+ var E = a.exprs[M];
102
+ if (E == null)
103
103
  continue;
104
- typeof $ != "object" || $.constructor !== void 0 && !P($) ? R += $ : R += k($, t, e, i, o, p, r);
104
+ typeof E != "object" || E.constructor !== void 0 && !L(E) ? R += E : R += k(E, t, e, i, o, p, r);
105
105
  }
106
106
  return R;
107
107
  }
108
- if ("UNSTABLE_comment" in d)
109
- return "<!--" + H(d.UNSTABLE_comment) + "-->";
110
- a = d.children;
108
+ if ("UNSTABLE_comment" in a)
109
+ return "<!--" + H(a.UNSTABLE_comment) + "-->";
110
+ n = a.children;
111
111
  } else {
112
- if ((E = n.contextType) != null) {
113
- var ro = t[E.__c];
114
- Z = ro ? ro.props.value : E.__;
112
+ if ((T = h.contextType) != null) {
113
+ var ro = t[T.__c];
114
+ Z = ro ? ro.props.value : T.__;
115
115
  }
116
- var eo = n.prototype && typeof n.prototype.render == "function";
116
+ var eo = h.prototype && typeof h.prototype.render == "function";
117
117
  if (eo)
118
- a = /**#__NOINLINE__**/
119
- go(o, Z), b = o[U];
118
+ n = /**#__NOINLINE__**/
119
+ bo(o, Z), w = o[P];
120
120
  else {
121
- o[U] = b = /**#__NOINLINE__**/
121
+ o[P] = w = /**#__NOINLINE__**/
122
122
  Wo(o, Z);
123
- for (var mo = 0; po(b) && mo++ < 25; ) {
124
- Io(b), X && X(o);
123
+ for (var uo = 0; co(w) && uo++ < 25; ) {
124
+ Mo(w), X && X(o);
125
125
  try {
126
- a = n.call(b, d, Z);
127
- } catch (w) {
128
- throw p && w && typeof w.then == "function" && (o._suspended = !0), w;
126
+ n = h.call(w, a, Z);
127
+ } catch (b) {
128
+ throw p && b && typeof b.then == "function" && (o._suspended = !0), b;
129
129
  }
130
130
  }
131
- uo(b);
131
+ fo(w);
132
132
  }
133
- if (b.getChildContext != null && (t = K({}, t, b.getChildContext())), eo && f.errorBoundaries && (n.getDerivedStateFromError || b.componentDidCatch)) {
134
- a = a != null && a.type === T && a.key == null && a.props.tpl == null ? a.props.children : a;
133
+ if (w.getChildContext != null && (t = K({}, t, w.getChildContext())), eo && u.errorBoundaries && (h.getDerivedStateFromError || w.componentDidCatch)) {
134
+ n = n != null && n.type === U && n.key == null && n.props.tpl == null ? n.props.children : n;
135
135
  try {
136
- return k(a, t, e, i, o, p, !1);
137
- } catch (w) {
138
- return n.getDerivedStateFromError && (b[L] = n.getDerivedStateFromError(w)), b.componentDidCatch && b.componentDidCatch(w, oo), po(b) ? (a = go(o, t), (b = o[U]).getChildContext != null && (t = K({}, t, b.getChildContext())), k(a = a != null && a.type === T && a.key == null && a.props.tpl == null ? a.props.children : a, t, e, i, o, p, r)) : g;
136
+ return k(n, t, e, i, o, p, !1);
137
+ } catch (b) {
138
+ return h.getDerivedStateFromError && (w[C] = h.getDerivedStateFromError(b)), w.componentDidCatch && w.componentDidCatch(b, oo), co(w) ? (n = bo(o, t), (w = o[P]).getChildContext != null && (t = K({}, t, w.getChildContext())), k(n = n != null && n.type === U && n.key == null && n.props.tpl == null ? n.props.children : n, t, e, i, o, p, r)) : g;
139
139
  } finally {
140
- A && A(o), M && M(o);
140
+ F && F(o), I && I(o);
141
141
  }
142
142
  }
143
143
  }
144
- a = a != null && a.type === T && a.key == null && a.props.tpl == null ? a.props.children : a;
144
+ n = n != null && n.type === U && n.key == null && n.props.tpl == null ? n.props.children : n;
145
145
  try {
146
- var z = k(a, t, e, i, o, p, r);
147
- return A && A(o), f.unmount && f.unmount(o), o._suspended ? typeof z == "string" ? q + z + B : P(z) ? (z.unshift(q), z.push(B), z) : z.then(function(w) {
148
- return q + w + B;
146
+ var z = k(n, t, e, i, o, p, r);
147
+ return F && F(o), u.unmount && u.unmount(o), o._suspended ? typeof z == "string" ? q + z + B : L(z) ? (z.unshift(q), z.push(B), z) : z.then(function(b) {
148
+ return q + b + B;
149
149
  }) : z;
150
- } catch (w) {
150
+ } catch (b) {
151
151
  if (!p && r && r.onError) {
152
152
  var to = function O(W) {
153
- return r.onError(W, o, function(C, jo) {
153
+ return r.onError(W, o, function($, mo) {
154
154
  try {
155
- return k(C, t, e, i, jo, p, r);
156
- } catch (xo) {
157
- return O(xo);
155
+ return k($, t, e, i, mo, p, r);
156
+ } catch (jo) {
157
+ return O(jo);
158
158
  }
159
159
  });
160
- }(w);
160
+ }(b);
161
161
  if (to !== void 0)
162
162
  return to;
163
- var io = f.__e;
164
- return io && io(w, o), g;
163
+ var io = u.__e;
164
+ return io && io(b, o), g;
165
165
  }
166
- if (!p || !w || typeof w.then != "function")
167
- throw w;
168
- return w.then(function O() {
166
+ if (!p || !b || typeof b.then != "function")
167
+ throw b;
168
+ return b.then(function O() {
169
169
  try {
170
- var W = k(a, t, e, i, o, p, r);
170
+ var W = k(n, t, e, i, o, p, r);
171
171
  return o._suspended ? q + W + B : W;
172
- } catch (C) {
173
- if (!C || typeof C.then != "function")
174
- throw C;
175
- return C.then(O);
172
+ } catch ($) {
173
+ if (!$ || typeof $.then != "function")
174
+ throw $;
175
+ return $.then(O);
176
176
  }
177
177
  });
178
178
  }
179
179
  }
180
- var S, F = "<" + n, x = g;
181
- for (var s in d) {
182
- var c = d[s];
180
+ var S, D = "<" + h, x = g;
181
+ for (var s in a) {
182
+ var c = a[s];
183
183
  if (typeof (c = Bo(c) ? c.value : c) != "function" || s === "class" || s === "className") {
184
184
  switch (s) {
185
185
  case "children":
@@ -191,12 +191,12 @@ function k(o, t, e, i, l, p, r) {
191
191
  case "__source":
192
192
  continue;
193
193
  case "htmlFor":
194
- if ("for" in d)
194
+ if ("for" in a)
195
195
  continue;
196
196
  s = "for";
197
197
  break;
198
198
  case "className":
199
- if ("class" in d)
199
+ if ("class" in a)
200
200
  continue;
201
201
  s = "class";
202
202
  break;
@@ -208,7 +208,7 @@ function k(o, t, e, i, l, p, r) {
208
208
  break;
209
209
  case "defaultValue":
210
210
  case "value":
211
- switch (s = "value", n) {
211
+ switch (s = "value", h) {
212
212
  case "textarea":
213
213
  S = c;
214
214
  continue;
@@ -216,7 +216,7 @@ function k(o, t, e, i, l, p, r) {
216
216
  i = c;
217
217
  continue;
218
218
  case "option":
219
- i != c || "selected" in d || (F += " selected");
219
+ i != c || "selected" in a || (D += " selected");
220
220
  }
221
221
  break;
222
222
  case "dangerouslySetInnerHTML":
@@ -232,23 +232,23 @@ function k(o, t, e, i, l, p, r) {
232
232
  s = "http-equiv";
233
233
  break;
234
234
  default:
235
- if (co.test(s))
236
- s = s.replace(co, "$1:$2").toLowerCase();
235
+ if (lo.test(s))
236
+ s = s.replace(lo, "$1:$2").toLowerCase();
237
237
  else {
238
- if (lo.test(s))
238
+ if (so.test(s))
239
239
  continue;
240
- s[4] !== "-" && !Uo.has(s) || c == null ? e ? To.test(s) && (s = s === "panose1" ? "panose-1" : s.replace(/([A-Z])/g, "-$1").toLowerCase()) : Po.test(s) && (s = s.toLowerCase()) : c += g;
240
+ s[4] !== "-" && !To.has(s) || c == null ? e ? Po.test(s) && (s = s === "panose1" ? "panose-1" : s.replace(/([A-Z])/g, "-$1").toLowerCase()) : Uo.test(s) && (s = s.toLowerCase()) : c += g;
241
241
  }
242
242
  }
243
- c != null && c !== !1 && (F = c === !0 || c === g ? F + " " + s : F + " " + s + '="' + (typeof c == "string" ? H(c) : c + g) + '"');
243
+ c != null && c !== !1 && (D = c === !0 || c === g ? D + " " + s : D + " " + s + '="' + (typeof c == "string" ? H(c) : c + g) + '"');
244
244
  }
245
245
  }
246
- if (lo.test(n))
247
- throw new Error(n + " is not a valid HTML tag name in " + F + ">");
248
- if (x || (typeof S == "string" ? x = H(S) : S != null && S !== !1 && S !== !0 && (x = k(S, t, n === "svg" || n !== "foreignObject" && e, i, o, p, r))), A && A(o), M && M(o), !x && qo.has(n))
249
- return F + "/>";
250
- var J = "</" + n + ">", N = F + ">";
251
- return P(x) ? [N].concat(x, [J]) : typeof x != "string" ? [N, x, J] : N + x + J;
246
+ if (so.test(h))
247
+ throw new Error(h + " is not a valid HTML tag name in " + D + ">");
248
+ if (x || (typeof S == "string" ? x = H(S) : S != null && S !== !1 && S !== !0 && (x = k(S, t, h === "svg" || h !== "foreignObject" && e, i, o, p, r))), F && F(o), I && I(o), !x && qo.has(h))
249
+ return D + "/>";
250
+ var J = "</" + h + ">", N = D + ">";
251
+ return L(x) ? [N].concat(x, [J]) : typeof x != "string" ? [N, x, J] : N + x + J;
252
252
  }
253
253
  var qo = /* @__PURE__ */ new Set(["area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]);
254
254
  function Bo(o) {
@@ -293,16 +293,16 @@ const Jo = `.inploi-job-search{font-size:16px}.inploi-job-search *,.inploi-job-s
293
293
  const l = No(e), p = ({
294
294
  params: r
295
295
  }) => {
296
- var m, h;
297
- return y($o, { Fallback: Eo }, [
298
- y(Yo, {
296
+ var m, d;
297
+ return y(Eo, { Fallback: Ao }, [
298
+ y(So, {
299
299
  terms: r.terms,
300
- locale: ((m = r.i18n) == null ? void 0 : m.locale) ?? ((h = r.i18n) == null ? void 0 : h.fallbackLocale),
300
+ locale: ((m = r.i18n) == null ? void 0 : m.locale) ?? ((d = r.i18n) == null ? void 0 : d.fallbackLocale),
301
301
  children: [
302
302
  y("style", { id: "inploi-job-search-styles" }, Jo),
303
- y("style", { id: "inploi-job-search-theme" }, Do(r)),
304
- y(Fo, { theme: r.theme }),
305
- y(Ao, {
303
+ y("style", { id: "inploi-job-search-theme" }, Yo(r)),
304
+ y(Do, { theme: r.theme }),
305
+ y(Fo, {
306
306
  properties: r.properties,
307
307
  rpcClient: t,
308
308
  analytics: i,
@@ -319,92 +319,98 @@ const Jo = `.inploi-job-search{font-size:16px}.inploi-job-search *,.inploi-job-s
319
319
  * Useful when server-side rendering to avoid CLS.
320
320
  */
321
321
  prerender: async (r) => {
322
- var u, Y, v, D, _;
323
- const m = typeof r.initialState == "function" ? r.initialState(r) : r.initialState, h = r.withData ? await yo({
322
+ var v, Y, _, f, A;
323
+ const m = typeof r.initialState == "function" ? r.initialState(r) : r.initialState, d = r.withData ? await xo({
324
324
  state: m,
325
325
  rpcClient: t,
326
- t: ko({
326
+ t: yo({
327
327
  overrides: r.terms ?? {},
328
- locale: ((u = r.i18n) == null ? void 0 : u.locale) ?? ((Y = r.i18n) == null ? void 0 : Y.fallbackLocale)
328
+ locale: ((v = r.i18n) == null ? void 0 : v.locale) ?? ((Y = r.i18n) == null ? void 0 : Y.fallbackLocale)
329
329
  }),
330
- prioritySegment: (v = r.results) == null ? void 0 : v.prioritySegment,
331
- locale: (D = r.i18n) == null ? void 0 : D.locale,
332
- fallbackLocale: (_ = r.i18n) == null ? void 0 : _.fallbackLocale
330
+ prioritySegment: (_ = r.results) == null ? void 0 : _.prioritySegment,
331
+ locale: (f = r.i18n) == null ? void 0 : f.locale,
332
+ fallbackLocale: (A = r.i18n) == null ? void 0 : A.fallbackLocale
333
333
  }).then((j) => ({ jobs: j })).catch(() => {
334
334
  }) : void 0;
335
335
  return {
336
336
  html: Ho(
337
337
  y(
338
- T,
338
+ U,
339
339
  {},
340
340
  y(p, {
341
341
  params: {
342
342
  ...r,
343
- initialData: h
343
+ initialData: d
344
344
  }
345
345
  })
346
346
  )
347
347
  ),
348
- data: h
348
+ data: d
349
349
  };
350
350
  },
351
351
  /** Renders the Job Search Plugin inside the container element. */
352
352
  render: async (r) => {
353
- var _, j;
353
+ var j, h;
354
354
  const m = typeof r.initialState == "function" ? r.initialState(r) : r.initialState;
355
- let h = no(m.filters);
356
- const u = r.initialData ? _o : zo, Y = l.getRenderTargetElement(r.widgetId);
357
- So(
355
+ let d = { filters: m.filters, geo: m.geo };
356
+ const v = () => {
357
+ var a;
358
+ return $o(d, ((a = r.geolocation) == null ? void 0 : a.distanceUnit) ?? "miles");
359
+ }, Y = r.initialData ? ko : _o, _ = l.getRenderTargetElement(r.widgetId);
360
+ zo(
358
361
  typeof window < "u",
359
362
  "the `render` method of JobSearch cannot be called in non-browser environments. Use `prerender` instead."
360
363
  );
361
- let v;
362
- if (u(y(p, { params: { ...r, onStateChange: (n) => {
363
- r.onStateChange(n), n.filters && (h = no(n.filters)), v && n.filters && v.setFilters(h);
364
- } } }), Y), r.feedback)
364
+ let f;
365
+ if (Y(y(p, { params: { ...r, onStateChange: (a) => {
366
+ r.onStateChange(a), !(!a.filters && !("geo" in a)) && (d = {
367
+ filters: a.filters ?? d.filters,
368
+ geo: "geo" in a ? a.geo : d.geo
369
+ }, f == null || f.setFilters(v()));
370
+ } } }), _), r.feedback)
365
371
  if (r.feedback.plugin instanceof Promise)
366
- r.feedback.plugin.then(({ feedbackPlugin: n }) => {
367
- var E, a;
372
+ r.feedback.plugin.then(({ feedbackPlugin: a }) => {
373
+ var n, w;
368
374
  if (!r.feedback)
369
375
  return;
370
- const d = n()({ apiClient: o, rpcClient: t, logger: e, analytics: i });
371
- vo({
372
- instance: d,
376
+ const T = a()({ apiClient: o, rpcClient: t, logger: e, analytics: i });
377
+ go({
378
+ instance: T,
373
379
  theme: {
374
380
  ...r.theme,
375
- ...(E = r.feedback.params) == null ? void 0 : E.theme
381
+ ...(n = r.feedback.params) == null ? void 0 : n.theme
376
382
  },
377
- terms: ((a = r.feedback.params) == null ? void 0 : a.terms) ?? {}
383
+ terms: ((w = r.feedback.params) == null ? void 0 : w.terms) ?? {}
378
384
  });
379
385
  });
380
386
  else {
381
- const n = r.feedback.plugin({ apiClient: o, rpcClient: t, logger: e, analytics: i });
382
- vo({
383
- instance: n,
387
+ const a = r.feedback.plugin({ apiClient: o, rpcClient: t, logger: e, analytics: i });
388
+ go({
389
+ instance: a,
384
390
  theme: {
385
391
  ...r.theme,
386
- ...(_ = r.feedback.params) == null ? void 0 : _.theme
392
+ ...(j = r.feedback.params) == null ? void 0 : j.theme
387
393
  },
388
- terms: ((j = r.feedback.params) == null ? void 0 : j.terms) ?? {}
394
+ terms: ((h = r.feedback.params) == null ? void 0 : h.terms) ?? {}
389
395
  });
390
396
  }
391
- r.alerts && (r.alerts.plugin instanceof Promise ? r.alerts.plugin.then(({ jobAlertsPlugin: n }) => {
392
- r.alerts && (v = n()({ apiClient: o, rpcClient: t, logger: e, analytics: i }), v.render({
397
+ r.alerts && (r.alerts.plugin instanceof Promise ? r.alerts.plugin.then(({ jobAlertsPlugin: a }) => {
398
+ r.alerts && (f = a()({ apiClient: o, rpcClient: t, logger: e, analytics: i }), f.render({
393
399
  config: r.alerts.params.config,
394
400
  terms: r.alerts.params.terms,
395
- initialFilters: h,
401
+ initialFilters: v(),
396
402
  theme: r.theme
397
403
  }));
398
- }) : (v = r.alerts.plugin({ apiClient: o, rpcClient: t, logger: e, analytics: i }), v.render({
404
+ }) : (f = r.alerts.plugin({ apiClient: o, rpcClient: t, logger: e, analytics: i }), f.render({
399
405
  config: r.alerts.params.config,
400
406
  terms: r.alerts.params.terms,
401
- initialFilters: h,
407
+ initialFilters: v(),
402
408
  theme: r.theme
403
409
  })));
404
410
  }
405
411
  };
406
412
  });
407
- function vo(o) {
413
+ function go(o) {
408
414
  o.instance.render({
409
415
  key: "job-search",
410
416
  size: "sm",
@@ -273,6 +273,8 @@ export declare const getAvailableFilters: ({ rpcClient, state, t, signal, locale
273
273
  }[];
274
274
  }>;
275
275
  export type GetAvailableFiltersResponse = Awaited<ReturnType<typeof getAvailableFilters>>;
276
+ /** The countries the company's live jobs give, as their feeds spell them. */
277
+ export declare const getJobCountries: (rpcClient: InploiRpcClient) => Promise<string[]>;
276
278
  export declare const getJobSearchResults: ({ rpcClient, signal, state, page, t, prioritySegment, locale, fallbackLocale, }: {
277
279
  rpcClient: InploiRpcClient;
278
280
  signal?: AbortSignal;
@@ -0,0 +1,8 @@
1
+ /** Where location search looks when a hub's jobs name no country it can read. */
2
+ export declare const DEFAULT_SEARCH_COUNTRIES: string[];
3
+ /**
4
+ * The countries a hub's location search covers, as the geocoder's ISO codes, read from the free text its live
5
+ * jobs give as their country ("United Kingdom", "England", "GB", "Republic of Ireland"). Values that name no
6
+ * country are left out; when none is left, the search covers the United Kingdom.
7
+ */
8
+ export declare const searchCountries: (jobCountries: string[]) => string[];
@@ -0,0 +1 @@
1
+ export {};
@@ -2,9 +2,10 @@ export type DistanceUnit = 'miles' | 'km';
2
2
  export declare const milesToMeters: (miles: number) => number;
3
3
  export declare const kmToMeters: (km: number) => number;
4
4
  /**
5
- * Formats a distance already expressed in `unit`, e.g. `20 mi`, `2.5 km` or, on a German page, `2,5 km`.
5
+ * Formats a distance already expressed in `unit`, e.g. `20 mi`, `2.5 km` or, on a German page, `2,5 km`,
6
+ * to at most `maximumFractionDigits` decimals.
6
7
  * The page's language wins over `locale`: the widget's `i18n.locale` chooses which jobs are shown, while the
7
8
  * number sits in text written in the page's language (PROD-7117).
8
9
  */
9
- export declare const createDistanceFormatter: (locale: string | undefined, unit: DistanceUnit) => Intl.NumberFormat;
10
+ export declare const createDistanceFormatter: (locale: string | undefined, unit: DistanceUnit, maximumFractionDigits?: number) => Intl.NumberFormat;
10
11
  export declare const formatDistanceMeters: (meters: number, unit: DistanceUnit, locale: string | undefined) => string;