@oslokommune/punkt-react 17.1.1 → 17.1.3

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.
@@ -9,7 +9,7 @@ var y = Object.create, b = Object.defineProperty, x = Object.getOwnPropertyDescr
9
9
  enumerable: !(r = x(t, s)) || r.enumerable
10
10
  });
11
11
  return e;
12
- }, D = (e, t, n) => (n = e == null ? {} : y(C(e)), E(t || !e || !e.__esModule ? b(n, "default", {
12
+ }, D = (e, t, n) => (n = e == null ? {} : y(C(e)), E(t || !e || !e.__esModule || !w.call(e, "default") ? b(n, "default", {
13
13
  value: e,
14
14
  enumerable: !0
15
15
  }) : n, e)), O = n({}), k = () => s(O), A = i(({ compact: e = !1, skin: t = "borderless", ariaLabelledBy: n, children: r, name: i, className: a }, o) => {
@@ -64,23 +64,23 @@ var j = /* @__PURE__ */ D((/* @__PURE__ */ T(((e, t) => {
64
64
  })();
65
65
  })))(), 1), M = "https://punkt-cdn.oslo.kommune.no/17.1/icons/";
66
66
  typeof window < "u" && (window.pktFetch = window.pktFetch === void 0 ? fetch : window.pktFetch, window.pktIconPath = window.pktIconPath || M);
67
- var N = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\"></svg>", ee = {}, te = 2, ne = 1500, P = typeof Storage < "u" && typeof sessionStorage < "u", re = typeof window < "u" ? d : c, ie = (e, t) => !e || !P ? "" : sessionStorage.getItem(t + e + ".svg") ?? "", ae = (e) => window.pktFetch(e).then((t) => {
67
+ var N = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\"></svg>", P = {}, ee = 2, te = 1500, F = typeof Storage < "u" && typeof sessionStorage < "u", ne = typeof window < "u" ? d : c, re = (e, t) => !e || !F ? "" : sessionStorage.getItem(t + e + ".svg") ?? "", ie = (e) => window.pktFetch(e).then((t) => {
68
68
  if (!t.ok) throw Error("Missing icon: " + e);
69
69
  return t.text();
70
- }), oe = async (e, t = te) => {
70
+ }), ae = async (e, t = ee) => {
71
71
  try {
72
- return await ae(e);
72
+ return await ie(e);
73
73
  } catch {
74
- return t > 0 ? (await new Promise((e) => setTimeout(e, ne)), oe(e, t - 1)) : (console.error("Failed to fetch icon: " + e), N);
74
+ return t > 0 ? (await new Promise((e) => setTimeout(e, te)), ae(e, t - 1)) : (console.error("Failed to fetch icon: " + e), N);
75
75
  }
76
- }, se = async (e, t) => {
76
+ }, oe = async (e, t) => {
77
77
  let n = t + e + ".svg";
78
- return P && sessionStorage.getItem(n) ? sessionStorage.getItem(n) : n in ee ? ee[n] : typeof window < "u" && typeof window.pktFetch == "function" ? (ee[n] = oe(n).then((e) => (e !== N && P && sessionStorage.setItem(n, e), delete ee[n], e)), ee[n]) : N;
79
- }, ce = (e) => {
78
+ return F && sessionStorage.getItem(n) ? sessionStorage.getItem(n) : n in P ? P[n] : typeof window < "u" && typeof window.pktFetch == "function" ? (P[n] = ae(n).then((e) => (e !== N && F && sessionStorage.setItem(n, e), delete P[n], e)), P[n]) : N;
79
+ }, se = (e) => {
80
80
  if (e !== void 0) return e === !0 || e === "true";
81
- }, F = i(function({ name: e = "", path: t, className: n, ariaHidden: r, ariaLabel: i, "aria-hidden": a, "aria-label": o, ...s }, c) {
82
- let l = t ?? (typeof window < "u" ? window.pktIconPath : M), u = p(null), d = ce(r) ?? ce(a), f = i ?? o, m = d === void 0 ? !f : d, h = m ? void 0 : f || e;
83
- re(() => {
81
+ }, I = i(function({ name: e = "", path: t, className: n, ariaHidden: r, ariaLabel: i, "aria-hidden": a, "aria-label": o, ...s }, c) {
82
+ let l = t ?? (typeof window < "u" ? window.pktIconPath : M), u = p(null), d = se(r) ?? se(a), f = i ?? o, m = d === void 0 ? !f : d, h = m ? void 0 : f || e;
83
+ ne(() => {
84
84
  let t = u.current;
85
85
  if (!t) return;
86
86
  let n = (e) => {
@@ -91,13 +91,13 @@ var N = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\"></svg>"
91
91
  t.innerHTML = "";
92
92
  return;
93
93
  }
94
- let r = ie(e, l);
94
+ let r = re(e, l);
95
95
  if (r) {
96
96
  t.innerHTML = r, n(t);
97
97
  return;
98
98
  }
99
99
  let i = !1;
100
- return se(e, l).then((e) => {
100
+ return oe(e, l).then((e) => {
101
101
  if (i) return;
102
102
  let t = u.current;
103
103
  t && (t.innerHTML = e || N, n(t));
@@ -121,43 +121,43 @@ var N = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\"></svg>"
121
121
  "data-path": l
122
122
  });
123
123
  });
124
- F.displayName = "PktIcon";
124
+ I.displayName = "PktIcon";
125
125
  //#endregion
126
126
  //#region src/components/accordion/AccordionItem.tsx
127
- var I = i(({ defaultOpen: e = !1, id: t, title: n, skin: r, compact: i = !1, isOpen: a, children: o, name: s, className: c, onClick: l, onToggle: u }, d) => {
128
- let [f, p] = m(e), { name: v, skin: y } = k(), b = s || v, x = r || y, S = a === void 0 ? f : a;
127
+ var L = i(({ defaultOpen: e = !1, id: t, title: n, skin: r, compact: i = !1, isOpen: a, children: o, name: s, className: c, onClick: l, onToggle: u }, d) => {
128
+ let [f, p] = m(e), { name: v, skin: y } = k(), b = s || v, x = r || y, S = a === void 0 ? f : a, C = (e) => {
129
+ let t = e.currentTarget.open;
130
+ t !== S && (a === void 0 && p(t), u?.(e));
131
+ }, w = (e) => {
132
+ setTimeout(() => {
133
+ l?.(e);
134
+ }, 0);
135
+ }, T = [
136
+ "pkt-accordion-item",
137
+ i && "pkt-accordion-item--compact",
138
+ r && `pkt-accordion-item--${r}`,
139
+ c
140
+ ].filter(Boolean).join(" ");
129
141
  return /* @__PURE__ */ _("details", {
130
142
  ref: d,
131
- className: [
132
- "pkt-accordion-item",
133
- i && "pkt-accordion-item--compact",
134
- r && `pkt-accordion-item--${r}`,
135
- c
136
- ].filter(Boolean).join(" "),
143
+ className: T,
137
144
  id: t,
138
145
  open: S,
139
- onClick: (e) => {
140
- setTimeout(() => {
141
- l?.(e);
142
- }, 0);
143
- },
146
+ onClick: w,
144
147
  name: b,
145
- onToggle: (e) => {
146
- let t = e.currentTarget.open;
147
- t !== S && (a === void 0 && p(t), u?.(e));
148
- },
148
+ onToggle: C,
149
149
  children: [/* @__PURE__ */ _("summary", {
150
150
  className: "pkt-accordion-item__title",
151
151
  id: `pkt-accordion-item-summary-${t}`,
152
- children: [n, x === "plus-minus" ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(F, {
152
+ children: [n, x === "plus-minus" ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(I, {
153
153
  name: "plus-sign",
154
154
  className: "pkt-accordion-item__icon pkt-accordion-item__icon--plus",
155
155
  "aria-hidden": "true"
156
- }), /* @__PURE__ */ g(F, {
156
+ }), /* @__PURE__ */ g(I, {
157
157
  name: "minus-sign",
158
158
  className: "pkt-accordion-item__icon pkt-accordion-item__icon--minus",
159
159
  "aria-hidden": "true"
160
- })] }) : /* @__PURE__ */ g(F, {
160
+ })] }) : /* @__PURE__ */ g(I, {
161
161
  name: "chevron-thin-down",
162
162
  className: "pkt-accordion-item__icon",
163
163
  "aria-hidden": "true"
@@ -175,8 +175,8 @@ var I = i(({ defaultOpen: e = !1, id: t, title: n, skin: r, compact: i = !1, isO
175
175
  });
176
176
  //#endregion
177
177
  //#region src/components/button/Button.tsx
178
- I.displayName = "PktAccordionItem", typeof window < "u" && (window.pktAnimationPath = window.pktAnimationPath || "https://punkt-cdn.oslo.kommune.no/17.1/animations/");
179
- var L = i(({ children: e, className: t, iconName: n = "user", secondIconName: r = "user", iconPath: i, secondIconPath: a, size: o = "medium", fullWidth: s = !1, fullWidthOnMobile: c = !1, skin: l = "primary", type: u = "button", variant: d = "label-only", state: f, color: p, isLoading: m = void 0, disabled: h = void 0, loadingAnimationPath: v = window.pktAnimationPath, ...y }, b) => {
178
+ L.displayName = "PktAccordionItem", typeof window < "u" && (window.pktAnimationPath = window.pktAnimationPath || "https://punkt-cdn.oslo.kommune.no/17.1/animations/");
179
+ var R = i(({ children: e, className: t, iconName: n = "user", secondIconName: r = "user", iconPath: i, secondIconPath: a, size: o = "medium", fullWidth: s = !1, fullWidthOnMobile: c = !1, skin: l = "primary", type: u = "button", variant: d = "label-only", state: f, color: p, isLoading: m = void 0, disabled: h = void 0, loadingAnimationPath: v = window.pktAnimationPath, ...y }, b) => {
180
180
  let x = [
181
181
  t,
182
182
  "pkt-btn",
@@ -198,12 +198,12 @@ var L = i(({ children: e, className: t, iconName: n = "user", secondIconName: r
198
198
  type: u,
199
199
  ref: b,
200
200
  children: [
201
- m && /* @__PURE__ */ g(F, {
201
+ m && /* @__PURE__ */ g(I, {
202
202
  className: "pkt-btn__icon pkt-btn__spinner",
203
203
  name: "spinner-blue",
204
204
  path: v
205
205
  }),
206
- d !== "label-only" && /* @__PURE__ */ g(F, {
206
+ d !== "label-only" && /* @__PURE__ */ g(I, {
207
207
  className: "pkt-btn__icon",
208
208
  name: n,
209
209
  ...i && { path: i }
@@ -212,7 +212,7 @@ var L = i(({ children: e, className: t, iconName: n = "user", secondIconName: r
212
212
  className: "pkt-btn__text",
213
213
  children: e
214
214
  }),
215
- d === "icons-right-and-left" && /* @__PURE__ */ g(F, {
215
+ d === "icons-right-and-left" && /* @__PURE__ */ g(I, {
216
216
  className: "pkt-btn__icon",
217
217
  name: r,
218
218
  ...a && { path: a }
@@ -220,10 +220,10 @@ var L = i(({ children: e, className: t, iconName: n = "user", secondIconName: r
220
220
  ]
221
221
  });
222
222
  });
223
- L.displayName = "PktButton";
223
+ R.displayName = "PktButton";
224
224
  //#endregion
225
225
  //#region src/components/alert/Alert.tsx
226
- var R = ({ children: e, closeAlert: t, compact: n, size: r = n ? "small" : "medium", title: i, date: a, ariaLive: s, "aria-live": c = "polite", role: l = "status", skin: u = "info", className: d, ...f }) => {
226
+ var z = ({ children: e, closeAlert: t, compact: n, size: r = n ? "small" : "medium", title: i, date: a, ariaLive: s, "aria-live": c = "polite", role: l = "status", skin: u = "info", className: d, ...f }) => {
227
227
  let [p, h] = m(!1), v = {
228
228
  "pkt-alert": !0,
229
229
  [`pkt-alert--${r}`]: r,
@@ -248,14 +248,14 @@ var R = ({ children: e, closeAlert: t, compact: n, size: r = n ? "small" : "medi
248
248
  children: /* @__PURE__ */ _("div", {
249
249
  className: (0, j.default)(y),
250
250
  children: [
251
- /* @__PURE__ */ g(F, {
251
+ /* @__PURE__ */ g(I, {
252
252
  className: "pkt-alert__icon",
253
253
  "aria-hidden": "true",
254
254
  name: u === "info" ? "alert-information" : `alert-${u}`
255
255
  }),
256
256
  t && /* @__PURE__ */ g("div", {
257
257
  className: "pkt-alert__close",
258
- children: /* @__PURE__ */ g(L, {
258
+ children: /* @__PURE__ */ g(R, {
259
259
  tabIndex: 0,
260
260
  "aria-label": "close",
261
261
  size: r,
@@ -286,11 +286,11 @@ var R = ({ children: e, closeAlert: t, compact: n, size: r = n ? "small" : "medi
286
286
  })
287
287
  });
288
288
  };
289
- R.displayName = "PktAlert";
289
+ z.displayName = "PktAlert";
290
290
  //#endregion
291
291
  //#region src/components/backlink/BackLink.tsx
292
- var le = i(({ href: e = "/", text: t = "Forsiden", ariaLabel: n, renderLink: r, className: i, ...a }, o) => {
293
- let s = /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(F, {
292
+ var ce = i(({ href: e = "/", text: t = "Forsiden", ariaLabel: n, renderLink: r, className: i, ...a }, o) => {
293
+ let s = /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(I, {
294
294
  className: "pkt-back-link__icon pkt-icon pkt-link__icon",
295
295
  name: "chevron-thin-left",
296
296
  "aria-hidden": "true"
@@ -302,9 +302,9 @@ var le = i(({ href: e = "/", text: t = "Forsiden", ariaLabel: n, renderLink: r,
302
302
  className: t,
303
303
  ...r,
304
304
  children: n
305
- }));
305
+ })), l = ["pkt-back-link", i].filter(Boolean).join(" ");
306
306
  return /* @__PURE__ */ g("nav", {
307
- className: ["pkt-back-link", i].filter(Boolean).join(" "),
307
+ className: l,
308
308
  "aria-label": n || "Gå tilbake til forrige side",
309
309
  ref: o,
310
310
  children: c({
@@ -315,10 +315,10 @@ var le = i(({ href: e = "/", text: t = "Forsiden", ariaLabel: n, renderLink: r,
315
315
  })
316
316
  });
317
317
  });
318
- le.displayName = "PktBackLink";
318
+ ce.displayName = "PktBackLink";
319
319
  //#endregion
320
320
  //#region src/components/breadcrumbs/Breadcrumbs.tsx
321
- var z = i(({ breadcrumbs: e, navigationType: t, renderLink: n, className: r, ...i }, a) => {
321
+ var B = i(({ breadcrumbs: e, navigationType: t, renderLink: n, className: r, ...i }, a) => {
322
322
  let o = e, s = o[o.length - 2], c = [r, "pkt-breadcrumbs"].filter(Boolean).join(" "), l = n || (t === "router" ? ({ href: e, className: t, children: n, props: r }) => /* @__PURE__ */ g(v, {
323
323
  to: e,
324
324
  className: t,
@@ -348,7 +348,7 @@ var z = i(({ breadcrumbs: e, navigationType: t, renderLink: n, className: r, ...
348
348
  }) : l({
349
349
  href: e.href,
350
350
  className: "pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",
351
- children: /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(F, {
351
+ children: /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(I, {
352
352
  className: "pkt-icon pkt-breadcrumbs__icon pkt-link__icon",
353
353
  name: "chevron-thin-right"
354
354
  }), /* @__PURE__ */ g("span", {
@@ -361,7 +361,7 @@ var z = i(({ breadcrumbs: e, navigationType: t, renderLink: n, className: r, ...
361
361
  }), l({
362
362
  href: s.href,
363
363
  className: "pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",
364
- children: /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(F, {
364
+ children: /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(I, {
365
365
  className: "pkt-back-link__icon pkt-icon pkt-link__icon",
366
366
  name: "chevron-thin-left"
367
367
  }), /* @__PURE__ */ g("span", {
@@ -372,87 +372,87 @@ var z = i(({ breadcrumbs: e, navigationType: t, renderLink: n, className: r, ...
372
372
  })]
373
373
  });
374
374
  });
375
- z.displayName = "PktBreadcrumbs";
375
+ B.displayName = "PktBreadcrumbs";
376
376
  //#endregion
377
377
  //#region ../../node_modules/date-fns/constants.js
378
- var B = 365.2425, ue = 6048e5, V = 864e5, H = 3600 * 24;
379
- H * 7, H * B / 12 * 3;
380
- var U = Symbol.for("constructDateFrom");
378
+ var V = 365.2425, le = 6048e5, H = 864e5, U = 86400;
379
+ U * 7, U * V / 12 * 3;
380
+ var W = Symbol.for("constructDateFrom");
381
381
  //#endregion
382
382
  //#region ../../node_modules/date-fns/constructFrom.js
383
- function W(e, t) {
384
- return typeof e == "function" ? e(t) : e && typeof e == "object" && U in e ? e[U](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
383
+ function G(e, t) {
384
+ return typeof e == "function" ? e(t) : e && typeof e == "object" && W in e ? e[W](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
385
385
  }
386
386
  //#endregion
387
387
  //#region ../../node_modules/date-fns/toDate.js
388
- function G(e, t) {
389
- return W(t || e, e);
388
+ function K(e, t) {
389
+ return G(t || e, e);
390
390
  }
391
391
  //#endregion
392
392
  //#region ../../node_modules/date-fns/addDays.js
393
- function de(e, t, n) {
394
- let r = G(e, n?.in);
395
- return isNaN(t) ? W(n?.in || e, NaN) : (t && r.setDate(r.getDate() + t), r);
393
+ function ue(e, t, n) {
394
+ let r = K(e, n?.in);
395
+ return isNaN(t) ? G(n?.in || e, NaN) : (t && r.setDate(r.getDate() + t), r);
396
396
  }
397
397
  //#endregion
398
398
  //#region ../../node_modules/date-fns/_lib/defaultOptions.js
399
- var K = {};
400
- function fe() {
401
- return K;
399
+ var q = {};
400
+ function de() {
401
+ return q;
402
402
  }
403
403
  //#endregion
404
404
  //#region ../../node_modules/date-fns/startOfWeek.js
405
- function pe(e, t) {
406
- let n = fe(), r = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, i = G(e, t?.in), a = i.getDay(), o = (a < r ? 7 : 0) + a - r;
405
+ function fe(e, t) {
406
+ let n = de(), r = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, i = K(e, t?.in), a = i.getDay(), o = (a < r ? 7 : 0) + a - r;
407
407
  return i.setDate(i.getDate() - o), i.setHours(0, 0, 0, 0), i;
408
408
  }
409
409
  //#endregion
410
410
  //#region ../../node_modules/date-fns/startOfISOWeek.js
411
- function me(e, t) {
412
- return pe(e, {
411
+ function pe(e, t) {
412
+ return fe(e, {
413
413
  ...t,
414
414
  weekStartsOn: 1
415
415
  });
416
416
  }
417
417
  //#endregion
418
418
  //#region ../../node_modules/date-fns/getISOWeekYear.js
419
- function q(e, t) {
420
- let n = G(e, t?.in), r = n.getFullYear(), i = W(n, 0);
419
+ function J(e, t) {
420
+ let n = K(e, t?.in), r = n.getFullYear(), i = G(n, 0);
421
421
  i.setFullYear(r + 1, 0, 4), i.setHours(0, 0, 0, 0);
422
- let a = me(i), o = W(n, 0);
422
+ let a = pe(i), o = G(n, 0);
423
423
  o.setFullYear(r, 0, 4), o.setHours(0, 0, 0, 0);
424
- let s = me(o);
424
+ let s = pe(o);
425
425
  return n.getTime() >= a.getTime() ? r + 1 : n.getTime() >= s.getTime() ? r : r - 1;
426
426
  }
427
427
  //#endregion
428
428
  //#region ../../node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
429
- function he(e) {
430
- let t = G(e), n = new Date(Date.UTC(t.getFullYear(), t.getMonth(), t.getDate(), t.getHours(), t.getMinutes(), t.getSeconds(), t.getMilliseconds()));
429
+ function me(e) {
430
+ let t = K(e), n = new Date(Date.UTC(t.getFullYear(), t.getMonth(), t.getDate(), t.getHours(), t.getMinutes(), t.getSeconds(), t.getMilliseconds()));
431
431
  return n.setUTCFullYear(t.getFullYear()), e - +n;
432
432
  }
433
433
  //#endregion
434
434
  //#region ../../node_modules/date-fns/_lib/normalizeDates.js
435
- function J(e, ...t) {
436
- let n = W.bind(null, e || t.find((e) => typeof e == "object"));
435
+ function he(e, ...t) {
436
+ let n = G.bind(null, e || t.find((e) => typeof e == "object"));
437
437
  return t.map(n);
438
438
  }
439
439
  //#endregion
440
440
  //#region ../../node_modules/date-fns/startOfDay.js
441
441
  function Y(e, t) {
442
- let n = G(e, t?.in);
442
+ let n = K(e, t?.in);
443
443
  return n.setHours(0, 0, 0, 0), n;
444
444
  }
445
445
  //#endregion
446
446
  //#region ../../node_modules/date-fns/differenceInCalendarDays.js
447
447
  function X(e, t, n) {
448
- let [r, i] = J(n?.in, e, t), a = Y(r), o = Y(i), s = +a - he(a), c = +o - he(o);
449
- return Math.round((s - c) / V);
448
+ let [r, i] = he(n?.in, e, t), a = Y(r), o = Y(i), s = +a - me(a), c = +o - me(o);
449
+ return Math.round((s - c) / H);
450
450
  }
451
451
  //#endregion
452
452
  //#region ../../node_modules/date-fns/startOfISOWeekYear.js
453
453
  function Z(e, t) {
454
- let n = q(e, t), r = W(t?.in || e, 0);
455
- return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), me(r);
454
+ let n = J(e, t), r = G(t?.in || e, 0);
455
+ return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), pe(r);
456
456
  }
457
457
  //#endregion
458
458
  //#region ../../node_modules/date-fns/isDate.js
@@ -462,18 +462,18 @@ function ge(e) {
462
462
  //#endregion
463
463
  //#region ../../node_modules/date-fns/isValid.js
464
464
  function _e(e) {
465
- return !(!ge(e) && typeof e != "number" || isNaN(+G(e)));
465
+ return !(!ge(e) && typeof e != "number" || isNaN(+K(e)));
466
466
  }
467
467
  //#endregion
468
468
  //#region ../../node_modules/date-fns/endOfDay.js
469
469
  function ve(e, t) {
470
- let n = G(e, t?.in);
470
+ let n = K(e, t?.in);
471
471
  return n.setHours(23, 59, 59, 999), n;
472
472
  }
473
473
  //#endregion
474
474
  //#region ../../node_modules/date-fns/_lib/normalizeInterval.js
475
475
  function ye(e, t) {
476
- let [n, r] = J(e, t.start, t.end);
476
+ let [n, r] = he(e, t.start, t.end);
477
477
  return {
478
478
  start: n,
479
479
  end: r
@@ -488,13 +488,13 @@ function be(e, t) {
488
488
  if (!s) return [];
489
489
  s < 0 && (s = -s, i = !i);
490
490
  let c = [];
491
- for (; +o <= a;) c.push(W(n, o)), o.setDate(o.getDate() + s), o.setHours(0, 0, 0, 0);
491
+ for (; +o <= a;) c.push(G(n, o)), o.setDate(o.getDate() + s), o.setHours(0, 0, 0, 0);
492
492
  return i ? c.reverse() : c;
493
493
  }
494
494
  //#endregion
495
495
  //#region ../../node_modules/date-fns/startOfYear.js
496
496
  function xe(e, t) {
497
- let n = G(e, t?.in);
497
+ let n = K(e, t?.in);
498
498
  return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
499
499
  }
500
500
  //#endregion
@@ -998,36 +998,36 @@ var Ne = {
998
998
  //#endregion
999
999
  //#region ../../node_modules/date-fns/getDayOfYear.js
1000
1000
  function Pe(e, t) {
1001
- let n = G(e, t?.in);
1001
+ let n = K(e, t?.in);
1002
1002
  return X(n, xe(n)) + 1;
1003
1003
  }
1004
1004
  //#endregion
1005
1005
  //#region ../../node_modules/date-fns/getISOWeek.js
1006
1006
  function Fe(e, t) {
1007
- let n = G(e, t?.in), r = me(n) - +Z(n);
1008
- return Math.round(r / ue) + 1;
1007
+ let n = K(e, t?.in), r = pe(n) - +Z(n);
1008
+ return Math.round(r / le) + 1;
1009
1009
  }
1010
1010
  //#endregion
1011
1011
  //#region ../../node_modules/date-fns/getWeekYear.js
1012
1012
  function Ie(e, t) {
1013
- let n = G(e, t?.in), r = n.getFullYear(), i = fe(), a = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? i.firstWeekContainsDate ?? i.locale?.options?.firstWeekContainsDate ?? 1, o = W(t?.in || e, 0);
1013
+ let n = K(e, t?.in), r = n.getFullYear(), i = de(), a = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? i.firstWeekContainsDate ?? i.locale?.options?.firstWeekContainsDate ?? 1, o = G(t?.in || e, 0);
1014
1014
  o.setFullYear(r + 1, 0, a), o.setHours(0, 0, 0, 0);
1015
- let s = pe(o, t), c = W(t?.in || e, 0);
1015
+ let s = fe(o, t), c = G(t?.in || e, 0);
1016
1016
  c.setFullYear(r, 0, a), c.setHours(0, 0, 0, 0);
1017
- let l = pe(c, t);
1017
+ let l = fe(c, t);
1018
1018
  return +n >= +s ? r + 1 : +n >= +l ? r : r - 1;
1019
1019
  }
1020
1020
  //#endregion
1021
1021
  //#region ../../node_modules/date-fns/startOfWeekYear.js
1022
1022
  function Le(e, t) {
1023
- let n = fe(), r = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, i = Ie(e, t), a = W(t?.in || e, 0);
1024
- return a.setFullYear(i, 0, r), a.setHours(0, 0, 0, 0), pe(a, t);
1023
+ let n = de(), r = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, i = Ie(e, t), a = G(t?.in || e, 0);
1024
+ return a.setFullYear(i, 0, r), a.setHours(0, 0, 0, 0), fe(a, t);
1025
1025
  }
1026
1026
  //#endregion
1027
1027
  //#region ../../node_modules/date-fns/getWeek.js
1028
1028
  function Re(e, t) {
1029
- let n = G(e, t?.in), r = pe(n, t) - +Le(n, t);
1030
- return Math.round(r / ue) + 1;
1029
+ let n = K(e, t?.in), r = fe(n, t) - +Le(n, t);
1030
+ return Math.round(r / le) + 1;
1031
1031
  }
1032
1032
  //#endregion
1033
1033
  //#region ../../node_modules/date-fns/_lib/addLeadingZeros.js
@@ -1106,7 +1106,7 @@ var ze = {
1106
1106
  return t === "YY" ? $(a % 100, 2) : t === "Yo" ? n.ordinalNumber(a, { unit: "year" }) : $(a, t.length);
1107
1107
  },
1108
1108
  R: function(e, t) {
1109
- return $(q(e), t.length);
1109
+ return $(J(e), t.length);
1110
1110
  },
1111
1111
  u: function(e, t) {
1112
1112
  return $(e.getFullYear(), t.length);
@@ -1478,9 +1478,7 @@ var Ge = (e, t) => {
1478
1478
  case "PPP":
1479
1479
  a = t.dateTime({ width: "long" });
1480
1480
  break;
1481
- default:
1482
- a = t.dateTime({ width: "full" });
1483
- break;
1481
+ default: a = t.dateTime({ width: "full" });
1484
1482
  }
1485
1483
  return a.replace("{{date}}", Ge(r, t)).replace("{{time}}", Ke(i, t));
1486
1484
  }
@@ -1508,7 +1506,7 @@ function et(e, t, n) {
1508
1506
  //#region ../../node_modules/date-fns/format.js
1509
1507
  var tt = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, nt = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, rt = /^'([^]*?)'?$/, it = /''/g, at = /[a-zA-Z]/;
1510
1508
  function ot(e, t, n) {
1511
- let r = fe(), i = n?.locale ?? r.locale ?? Ne, a = n?.firstWeekContainsDate ?? n?.locale?.options?.firstWeekContainsDate ?? r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, o = n?.weekStartsOn ?? n?.locale?.options?.weekStartsOn ?? r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, s = G(e, n?.in);
1509
+ let r = de(), i = n?.locale ?? r.locale ?? Ne, a = n?.firstWeekContainsDate ?? n?.locale?.options?.firstWeekContainsDate ?? r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, o = n?.weekStartsOn ?? n?.locale?.options?.weekStartsOn ?? r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, s = K(e, n?.in);
1512
1510
  if (!_e(s)) throw RangeError("Invalid time value");
1513
1511
  let c = t.match(nt).map((e) => {
1514
1512
  let t = e[0];
@@ -1558,7 +1556,7 @@ function st(e) {
1558
1556
  //#endregion
1559
1557
  //#region ../../node_modules/date-fns/getISODay.js
1560
1558
  function ct(e, t) {
1561
- let n = G(e, t?.in).getDay();
1559
+ let n = K(e, t?.in).getDay();
1562
1560
  return n === 0 ? 7 : n;
1563
1561
  }
1564
1562
  //#endregion
@@ -1655,7 +1653,7 @@ function yt(e, t) {
1655
1653
  }
1656
1654
  _t(e);
1657
1655
  let S = (t ? n : n + p * 1e3) - +e.internal;
1658
- S && Math.abs(S) < 1800 * 1e3 && (Date.prototype.setTime.call(e, +e + S), _t(e));
1656
+ S && Math.abs(S) < 18e5 && (Date.prototype.setTime.call(e, +e + S), _t(e));
1659
1657
  }
1660
1658
  function bt(e) {
1661
1659
  return Date.UTC(e[0], e.length > 1 ? e[1] : 0, e.length > 2 ? e[2] : 1, ...e.slice(3));
@@ -1881,10 +1879,10 @@ function rn(e) {
1881
1879
  return t === "INPUT" || t === "SELECT" || t === "BUTTON" && !e.dataset?.date;
1882
1880
  }
1883
1881
  function an(e, t, n) {
1884
- let r = de(e, t);
1882
+ let r = ue(e, t);
1885
1883
  if (!r) return null;
1886
1884
  let i = n(`button[data-date="${Et(r)}"]`);
1887
- for (; i instanceof HTMLButtonElement && i.dataset.disabled;) if (r = de(r, t), i = n(`button[data-date="${Et(r)}"]`), !i) return null;
1885
+ for (; i instanceof HTMLButtonElement && i.dataset.disabled;) if (r = ue(r, t), i = n(`button[data-date="${Et(r)}"]`), !i) return null;
1888
1886
  return r;
1889
1887
  }
1890
1888
  function on(e) {
@@ -1937,7 +1935,7 @@ function cn(e) {
1937
1935
  let { selected: t, multiple: n = !1, maxMultiple: r = 0, range: i = !1, earliest: a = null, latest: s = null, excludedates: u, excludeweekdays: d = [], weeknumbers: h = !1, withcontrols: g = !1, currentmonth: _, today: v, strings: y, onDateSelected: b, onClose: x, id: S, className: C } = e, w = l(), T = S ?? w, E = f(() => ({
1938
1936
  ...sn,
1939
1937
  ...y
1940
- }), [y]), D = f(() => v ? Tt(v) : wt(), [v]), O = f(() => u ? u.map((e) => typeof e == "string" ? Tt(e) : e) : [], [u]), k = t !== void 0, [A, j] = m([]), M = k ? t : A, N = f(() => Kt(M), [M]), [ee, te] = m(0), [ne, P] = m(0), [re, ie] = m({}), [ae, oe] = m(null), [se, ce] = m(null), F = p(null), I = p([]), L = p(0), R = p(!1), le = p(!1), z = f(() => ({
1938
+ }), [y]), D = f(() => v ? Tt(v) : wt(), [v]), O = f(() => u ? u.map((e) => typeof e == "string" ? Tt(e) : e) : [], [u]), k = t !== void 0, [A, j] = m([]), M = k ? t : A, N = f(() => Kt(M), [M]), [P, ee] = m(0), [te, F] = m(0), [ne, re] = m({}), [ie, ae] = m(null), [oe, se] = m(null), I = p(null), L = p([]), R = p(0), z = p(!1), ce = p(!1), B = f(() => ({
1941
1939
  earliest: a,
1942
1940
  latest: s,
1943
1941
  excludedates: O,
@@ -1950,10 +1948,12 @@ function cn(e) {
1950
1948
  ]);
1951
1949
  c(() => {
1952
1950
  let e = null;
1953
- if (_ != null && (_ instanceof Date ? e = jt(_) : typeof _ == "string" && (e = Tt(_))), !e || isNaN(e.getTime())) if (M.length > 0 && M[0] !== "") {
1954
- let t = Tt(M[M.length - 1]);
1955
- e = isNaN(t.getTime()) ? jt(D) : t;
1956
- } else e = jt(D);
1951
+ if (_ != null && (_ instanceof Date ? e = jt(_) : typeof _ == "string" && (e = Tt(_))), !e || isNaN(e.getTime())) {
1952
+ if (M.length > 0 && M[0] !== "") {
1953
+ let t = Tt(M[M.length - 1]);
1954
+ e = isNaN(t.getTime()) ? jt(D) : t;
1955
+ } else e = jt(D);
1956
+ }
1957
1957
  if ((!e || isNaN(e.getTime())) && (e = jt(D)), s) {
1958
1958
  let t = typeof s == "string" ? Tt(s) : s;
1959
1959
  !isNaN(t.getTime()) && e > t && (e = t);
@@ -1962,133 +1962,133 @@ function cn(e) {
1962
1962
  let t = typeof a == "string" ? Tt(a) : a;
1963
1963
  !isNaN(t.getTime()) && e < t && (e = t);
1964
1964
  }
1965
- te(e.getFullYear()), P(e.getMonth()), le.current = !0;
1965
+ ee(e.getFullYear()), F(e.getMonth()), ce.current = !0;
1966
1966
  }, []), c(() => {
1967
- if (le.current && !R.current && M.length > 0 && M[0] !== "") {
1967
+ if (ce.current && !z.current && M.length > 0 && M[0] !== "") {
1968
1968
  let e = Tt(M[M.length - 1]);
1969
- isNaN(e.getTime()) || (te(e.getFullYear()), P(e.getMonth()));
1969
+ isNaN(e.getTime()) || (ee(e.getFullYear()), F(e.getMonth()));
1970
1970
  }
1971
1971
  }, [M]), c(() => {
1972
- i && N.length === 2 ? ie(qt(N[0], N[1])) : (!i || N.length < 2) && ie({});
1972
+ i && N.length === 2 ? re(qt(N[0], N[1])) : (!i || N.length < 2) && re({});
1973
1973
  }, [i, N]);
1974
- let B = o((e) => {
1974
+ let V = o((e) => {
1975
1975
  k || j(e), b?.(e);
1976
- }, [k, b]), ue = o(() => {
1976
+ }, [k, b]), le = o(() => {
1977
1977
  x?.();
1978
- }, [x]), V = o((e, t) => {
1979
- te(typeof e == "string" ? parseInt(e) : e), P(typeof t == "string" ? parseInt(t) : t), L.current = 0, ce(null), I.current = [], R.current = !0;
1980
- }, []), H = o(() => {
1981
- let e = ne === 0 ? 11 : ne - 1;
1982
- V(ne === 0 ? ee - 1 : ee, e);
1978
+ }, [x]), H = o((e, t) => {
1979
+ ee(typeof e == "string" ? parseInt(e) : e), F(typeof t == "string" ? parseInt(t) : t), R.current = 0, se(null), L.current = [], z.current = !0;
1980
+ }, []), U = o(() => {
1981
+ let e = te === 0 ? 11 : te - 1, t = te === 0 ? P - 1 : P;
1982
+ H(t, e);
1983
1983
  }, [
1984
- ee,
1985
- ne,
1986
- V
1987
- ]), U = o(() => {
1988
- let e = ne === 11 ? 0 : ne + 1;
1989
- V(ne === 11 ? ee + 1 : ee, e);
1984
+ P,
1985
+ te,
1986
+ H
1987
+ ]), W = o(() => {
1988
+ let e = te === 11 ? 0 : te + 1, t = te === 11 ? P + 1 : P;
1989
+ H(t, e);
1990
1990
  }, [
1991
- ee,
1992
- ne,
1993
- V
1994
- ]), W = o((e) => Ht(e, z), [z]), G = o((e, t) => Ut(e, t, z, {
1991
+ P,
1992
+ te,
1993
+ H
1994
+ ]), G = o((e) => Ht(e, B), [B]), K = o((e, t) => Ut(e, t, B, {
1995
1995
  multiple: n,
1996
1996
  maxMultiple: r,
1997
1997
  selectedCount: M.length
1998
1998
  }), [
1999
- z,
1999
+ B,
2000
2000
  n,
2001
2001
  r,
2002
2002
  M.length
2003
- ]), de = o(() => typeof M == "string" ? M.split(",") : M, [M]), K = o((e) => {
2003
+ ]), ue = o(() => typeof M == "string" ? M.split(",") : M, [M]), q = o((e) => {
2004
2004
  if (!i || N.length !== 1 || !Jt(e, N, O, d) || N[0] >= e) {
2005
- oe(null);
2005
+ ae(null);
2006
2006
  return;
2007
2007
  }
2008
- oe(e), ie(qt(N[0], e));
2008
+ ae(e), re(qt(N[0], e));
2009
2009
  }, [
2010
2010
  i,
2011
2011
  N,
2012
2012
  O,
2013
2013
  d
2014
- ]), fe = o((e) => {
2014
+ ]), de = o((e) => {
2015
2015
  if (!e) return;
2016
2016
  let t;
2017
- if (i) t = Qt(e, de(), {
2017
+ if (i) t = Qt(e, ue(), {
2018
2018
  excludedates: O,
2019
2019
  excludeweekdays: d
2020
- }), k || j(t), t.length === 2 ? (b?.(t), ue()) : (t.length === 1 && ie({}), b?.(t));
2021
- else if (n) t = Zt(e, de(), r), B(t);
2020
+ }), k || j(t), t.length === 2 ? (b?.(t), le()) : (t.length === 1 && re({}), b?.(t));
2021
+ else if (n) t = Zt(e, ue(), r), V(t);
2022
2022
  else {
2023
2023
  let n = Et(e);
2024
- t = M.includes(n) ? [] : [n], B(t), ue();
2024
+ t = M.includes(n) ? [] : [n], V(t), le();
2025
2025
  }
2026
2026
  }, [
2027
2027
  i,
2028
2028
  n,
2029
2029
  r,
2030
- de,
2030
+ ue,
2031
2031
  M,
2032
2032
  O,
2033
2033
  d,
2034
2034
  k,
2035
- B,
2036
- ue,
2035
+ V,
2036
+ le,
2037
2037
  b
2038
- ]), pe = o((e) => {
2039
- let t = Yt(e, de());
2040
- k || j(t), i && t.length === 2 && (b?.(t), ue());
2038
+ ]), fe = o((e) => {
2039
+ let t = Yt(e, ue());
2040
+ k || j(t), i && t.length === 2 && (b?.(t), le());
2041
2041
  }, [
2042
- de,
2042
+ ue,
2043
2043
  k,
2044
2044
  i,
2045
2045
  b,
2046
- ue
2047
- ]), me = o((e) => {
2048
- let t = Xt(e, de());
2046
+ le
2047
+ ]), pe = o((e) => {
2048
+ let t = Xt(e, ue());
2049
2049
  k || j(t);
2050
- }, [de, k]), q = o((e) => {
2051
- let t = Zt(e, de(), r);
2050
+ }, [ue, k]), J = o((e) => {
2051
+ let t = Zt(e, ue(), r);
2052
2052
  k || j(t);
2053
2053
  }, [
2054
- de,
2054
+ ue,
2055
2055
  r,
2056
2056
  k
2057
- ]), he = o(() => {
2058
- let e = Et(jt(D)), t = F.current?.querySelector(`button[data-date="${e}"]`);
2057
+ ]), me = o(() => {
2058
+ let e = Et(jt(D)), t = I.current?.querySelector(`button[data-date="${e}"]`);
2059
2059
  if (t instanceof HTMLButtonElement) {
2060
- ce(e), t.focus();
2060
+ se(e), t.focus();
2061
2061
  return;
2062
2062
  }
2063
- let n = I.current.find((e) => !e.isDisabled);
2063
+ let n = L.current.find((e) => !e.isDisabled);
2064
2064
  if (n) {
2065
- let e = F.current?.querySelector(`button[data-date="${n.currentDateISO}"]`);
2066
- e instanceof HTMLButtonElement && (ce(n.currentDateISO), e.focus());
2065
+ let e = I.current?.querySelector(`button[data-date="${n.currentDateISO}"]`);
2066
+ e instanceof HTMLButtonElement && (se(n.currentDateISO), e.focus());
2067
2067
  }
2068
- }, []), J = o((e, t) => {
2068
+ }, []), he = o((e, t) => {
2069
2069
  let n = e.target;
2070
2070
  if (rn(n)) return;
2071
- if (e.preventDefault(), !se) {
2072
- he();
2071
+ if (e.preventDefault(), !oe) {
2072
+ me();
2073
2073
  return;
2074
2074
  }
2075
- let r = an(kt(se), t, F.current.querySelector.bind(F.current));
2075
+ let r = an(kt(oe), t, I.current.querySelector.bind(I.current));
2076
2076
  if (r) {
2077
- let e = F.current.querySelector(`button[data-date="${Et(r)}"]`);
2078
- e instanceof HTMLButtonElement && !e.dataset.disabled && (ce(Et(r)), e.focus());
2077
+ let e = I.current.querySelector(`button[data-date="${Et(r)}"]`);
2078
+ e instanceof HTMLButtonElement && !e.dataset.disabled && (se(Et(r)), e.focus());
2079
2079
  }
2080
- }, [se, he]);
2080
+ }, [oe, me]);
2081
2081
  return {
2082
2082
  componentId: T,
2083
2083
  strings: E,
2084
2084
  todayDate: D,
2085
- year: ee,
2086
- month: ne,
2085
+ year: P,
2086
+ month: te,
2087
2087
  activeSelected: M,
2088
2088
  _selected: N,
2089
- inRange: re,
2090
- rangeHovered: ae,
2091
- focusedDate: se,
2089
+ inRange: ne,
2090
+ rangeHovered: ie,
2091
+ focusedDate: oe,
2092
2092
  range: i,
2093
2093
  multiple: n,
2094
2094
  weeknumbers: h,
@@ -2098,35 +2098,35 @@ function cn(e) {
2098
2098
  excludedates: O,
2099
2099
  excludeweekdays: d,
2100
2100
  className: C,
2101
- dateConstraints: z,
2102
- calendarRef: F,
2103
- selectableDatesRef: I,
2104
- tabIndexSetRef: L,
2105
- prevMonth: H,
2106
- nextMonth: U,
2107
- changeMonth: V,
2108
- handleDateSelect: fe,
2109
- addToSelected: pe,
2110
- removeFromSelected: me,
2111
- toggleSelectedDate: q,
2112
- handleRangeHover: K,
2113
- isExcluded: W,
2114
- isDayDisabled: G,
2115
- focusOnCurrentDate: he,
2101
+ dateConstraints: B,
2102
+ calendarRef: I,
2103
+ selectableDatesRef: L,
2104
+ tabIndexSetRef: R,
2105
+ prevMonth: U,
2106
+ nextMonth: W,
2107
+ changeMonth: H,
2108
+ handleDateSelect: de,
2109
+ addToSelected: fe,
2110
+ removeFromSelected: pe,
2111
+ toggleSelectedDate: J,
2112
+ handleRangeHover: q,
2113
+ isExcluded: G,
2114
+ isDayDisabled: K,
2115
+ focusOnCurrentDate: me,
2116
2116
  handleKeydown: o((e) => {
2117
2117
  if (e.key === "Escape") {
2118
- e.preventDefault(), ue();
2118
+ e.preventDefault(), le();
2119
2119
  return;
2120
2120
  }
2121
2121
  let t = on(e.key);
2122
- t !== null && J(e.nativeEvent, t);
2123
- }, [ue, J]),
2122
+ t !== null && he(e.nativeEvent, t);
2123
+ }, [le, he]),
2124
2124
  handleFocusOut: o((e) => {
2125
2125
  let t = e.target, n = e.relatedTarget;
2126
- F.current && F.current.contains(n) || t.classList.contains("pkt-hide") || t.closest(".pkt-cal-month-picker") || ue();
2127
- }, [ue]),
2128
- close: ue,
2129
- setFocusedDate: ce
2126
+ I.current && I.current.contains(n) || t.classList.contains("pkt-hide") || t.closest(".pkt-cal-month-picker") || le();
2127
+ }, [le]),
2128
+ close: le,
2129
+ setFocusedDate: se
2130
2130
  };
2131
2131
  }
2132
2132
  //#endregion
@@ -2149,7 +2149,7 @@ var ln = ({ componentId: e, strings: t, year: n, month: r, earliest: i, latest:
2149
2149
  "data-disabled": l ? void 0 : "disabled",
2150
2150
  "aria-disabled": !l || void 0,
2151
2151
  tabIndex: l ? 0 : -1,
2152
- children: [/* @__PURE__ */ g(F, {
2152
+ children: [/* @__PURE__ */ g(I, {
2153
2153
  className: "pkt-btn__icon",
2154
2154
  name: d
2155
2155
  }), /* @__PURE__ */ g("span", {
@@ -2438,7 +2438,7 @@ var hn = i(({ children: e, skin: t, textStyle: n, size: r, closeTag: i, classNam
2438
2438
  "aria-description": E,
2439
2439
  ref: y,
2440
2440
  children: [
2441
- s && /* @__PURE__ */ g(F, {
2441
+ s && /* @__PURE__ */ g(I, {
2442
2442
  className: "pkt-tag__icon",
2443
2443
  name: s
2444
2444
  }),
@@ -2446,7 +2446,7 @@ var hn = i(({ children: e, skin: t, textStyle: n, size: r, closeTag: i, classNam
2446
2446
  ref: C,
2447
2447
  children: e
2448
2448
  }),
2449
- /* @__PURE__ */ g(F, {
2449
+ /* @__PURE__ */ g(I, {
2450
2450
  className: "pkt-tag__close-btn",
2451
2451
  name: "close"
2452
2452
  })
@@ -2455,7 +2455,7 @@ var hn = i(({ children: e, skin: t, textStyle: n, size: r, closeTag: i, classNam
2455
2455
  ...v,
2456
2456
  className: (0, j.default)(D, a),
2457
2457
  ref: y,
2458
- children: [s && /* @__PURE__ */ g(F, {
2458
+ children: [s && /* @__PURE__ */ g(I, {
2459
2459
  className: "pkt-tag__icon",
2460
2460
  name: s,
2461
2461
  "aria-hidden": "true"
@@ -2690,7 +2690,7 @@ var yn = (e) => {
2690
2690
  "aria-expanded": l,
2691
2691
  "aria-controls": `${r}-helptext-expandable`,
2692
2692
  onClick: d,
2693
- children: [/* @__PURE__ */ g(F, {
2693
+ children: [/* @__PURE__ */ g(I, {
2694
2694
  className: "pkt-btn__icon",
2695
2695
  name: l ? "chevron-thin-up" : "chevron-thin-down"
2696
2696
  }), /* @__PURE__ */ g("span", {
@@ -2709,18 +2709,18 @@ wn.displayName = "PktHelptext";
2709
2709
  //#endregion
2710
2710
  //#region src/components/inputwrapper/InputWrapper.tsx
2711
2711
  var Tn = i(({ forId: e, label: t, helptext: n, helptextDropdown: r, helptextDropdownButton: i, counter: a, counterCurrent: o = 0, counterMaxLength: s, optionalTag: c = !1, optionalText: l = "Valgfritt", requiredTag: u = !1, requiredText: d = "Må fylles ut", tagText: f = null, hasError: p = !1, errorMessage: m, disabled: v = !1, inline: y = !1, ariaDescribedby: b, useWrapper: x = !0, children: S, className: C = "", hasFieldset: w = !1, role: T, counterPosition: E = "bottom", size: D = "medium" }, O) => {
2712
- let k = vn(O), A = b || (n ? `${e}-helptext` : void 0), j = !!a, M = j && E === "top", N = j && E === "bottom", ee = [
2712
+ let k = vn(O), A = b || (n ? `${e}-helptext` : void 0), j = !!a, M = j && E === "top", N = j && E === "bottom", P = [
2713
2713
  "pkt-inputwrapper",
2714
2714
  C,
2715
2715
  p ? "pkt-inputwrapper--error" : "",
2716
2716
  v ? "pkt-inputwrapper--disabled" : "",
2717
2717
  y ? "pkt-inputwrapper--inline" : "",
2718
2718
  D ? `pkt-inputwrapper--${D}` : ""
2719
- ].filter(Boolean).join(" "), te = [
2719
+ ].filter(Boolean).join(" "), ee = [
2720
2720
  "pkt-tag",
2721
2721
  "pkt-tag--small",
2722
2722
  "pkt-tag--thin-text"
2723
- ].join(" "), ne = xn(o, s), P = () => j ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _("div", {
2723
+ ].join(" "), te = xn(o, s), F = () => j ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _("div", {
2724
2724
  className: "pkt-input__counter",
2725
2725
  "aria-hidden": "true",
2726
2726
  children: [o, s ? `/${s}` : ""]
@@ -2728,25 +2728,25 @@ var Tn = i(({ forId: e, label: t, helptext: n, helptextDropdown: r, helptextDrop
2728
2728
  className: "pkt-sr-only",
2729
2729
  id: bn(e),
2730
2730
  "aria-live": "polite",
2731
- children: ne ? `Du har brukt ${o} av ${s} tegn` : ""
2732
- })] }) : null, re = () => /* @__PURE__ */ _(h, { children: [
2731
+ children: te ? `Du har brukt ${o} av ${s} tegn` : ""
2732
+ })] }) : null, ne = () => /* @__PURE__ */ _(h, { children: [
2733
2733
  f && /* @__PURE__ */ g("span", {
2734
- className: te + " pkt-tag--gray",
2734
+ className: ee + " pkt-tag--gray",
2735
2735
  children: f
2736
2736
  }),
2737
2737
  c && /* @__PURE__ */ g("span", {
2738
- className: te + " pkt-tag--blue-light",
2738
+ className: ee + " pkt-tag--blue-light",
2739
2739
  children: l
2740
2740
  }),
2741
2741
  u && /* @__PURE__ */ g("span", {
2742
- className: te + " pkt-tag--beige",
2742
+ className: ee + " pkt-tag--beige",
2743
2743
  children: d
2744
2744
  })
2745
- ] }), ie = () => {
2745
+ ] }), re = () => {
2746
2746
  let n = /* @__PURE__ */ _(h, { children: [
2747
2747
  t,
2748
2748
  " ",
2749
- re()
2749
+ ne()
2750
2750
  ] });
2751
2751
  return x ? w ? /* @__PURE__ */ g("legend", {
2752
2752
  className: "pkt-inputwrapper__legend",
@@ -2763,7 +2763,7 @@ var Tn = i(({ forId: e, label: t, helptext: n, helptextDropdown: r, helptextDrop
2763
2763
  id: `${e}-label`,
2764
2764
  children: t
2765
2765
  });
2766
- }, ae = () => {
2766
+ }, ie = () => {
2767
2767
  let t = x ? n : void 0;
2768
2768
  return !t && !r ? null : /* @__PURE__ */ g(wn, {
2769
2769
  forId: e,
@@ -2771,17 +2771,17 @@ var Tn = i(({ forId: e, label: t, helptext: n, helptextDropdown: r, helptextDrop
2771
2771
  helptextDropdown: r,
2772
2772
  helptextDropdownButton: i
2773
2773
  });
2774
- }, oe = D === "medium" ? "small" : "xsmall", se = /* @__PURE__ */ _(h, { children: [
2774
+ }, ae = D === "medium" ? "small" : "xsmall", oe = /* @__PURE__ */ _(h, { children: [
2775
+ re(),
2775
2776
  ie(),
2776
- ae(),
2777
- M && /* @__PURE__ */ g(P, {}),
2777
+ M && /* @__PURE__ */ g(F, {}),
2778
2778
  S,
2779
- N && /* @__PURE__ */ g(P, {}),
2779
+ N && /* @__PURE__ */ g(F, {}),
2780
2780
  p && m && /* @__PURE__ */ g("div", {
2781
2781
  className: "pkt-inputwrapper__alert-wrapper",
2782
- children: /* @__PURE__ */ g(R, {
2782
+ children: /* @__PURE__ */ g(z, {
2783
2783
  skin: "error",
2784
- size: oe,
2784
+ size: ae,
2785
2785
  "aria-live": "assertive",
2786
2786
  role: "alert",
2787
2787
  id: `${e}-error`,
@@ -2790,17 +2790,17 @@ var Tn = i(({ forId: e, label: t, helptext: n, helptextDropdown: r, helptextDrop
2790
2790
  })
2791
2791
  ] });
2792
2792
  return /* @__PURE__ */ g("div", {
2793
- className: ee,
2793
+ className: P,
2794
2794
  role: T,
2795
2795
  "aria-labelledby": T ? `${e}-label` : void 0,
2796
2796
  ...k,
2797
2797
  children: w ? /* @__PURE__ */ g("fieldset", {
2798
2798
  className: "pkt-inputwrapper__fieldset",
2799
2799
  "aria-describedby": A,
2800
- children: se
2800
+ children: oe
2801
2801
  }) : /* @__PURE__ */ g("div", {
2802
2802
  className: "pkt-inputwrapper__fieldset",
2803
- children: se
2803
+ children: oe
2804
2804
  })
2805
2805
  });
2806
2806
  });
@@ -2989,10 +2989,12 @@ var En = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
2989
2989
  let { values: t, options: n, editingSingleValue: r, displayValueAs: i } = e;
2990
2990
  if (r || t.length === 0) return null;
2991
2991
  let a = En(n, t[0]);
2992
- return a ? /* @__PURE__ */ g("span", {
2992
+ if (!a) return null;
2993
+ let o = jn(a, i);
2994
+ return /* @__PURE__ */ g("span", {
2993
2995
  className: "pkt-combobox__value",
2994
- children: jn(a, i)
2995
- }) : null;
2996
+ children: o
2997
+ });
2996
2998
  }, Kn = ({ state: e }) => {
2997
2999
  let { id: t, inputId: n, listboxId: r, values: i, options: a, isOpen: o, multiple: s, typeahead: c, allowUserInput: l, tagPlacement: u, placeholder: d, disabled: f, fullwidth: p, hasError: m, label: h, inputFocus: v, inputRef: y, triggerRef: b, handleInputChange: x, handleInputKeydown: S, handleInputFocus: C, handleInputBlur: w, handleInputClick: T, handlePlaceholderClick: E, handleSelectOnlyKeydown: D, name: O, inputSize: k } = e, A = [
2998
3000
  "pkt-combobox__input",
@@ -3001,29 +3003,29 @@ var En = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
3001
3003
  o && "pkt-combobox__input--open",
3002
3004
  m && "pkt-combobox__input--error",
3003
3005
  f && "pkt-combobox__input--disabled"
3004
- ].filter(Boolean).join(" "), j = ["pkt-combobox__arrow-icon", o && "pkt-combobox__arrow-icon--open"].filter(Boolean).join(" "), M = c || l, N = !M && d && (!i.length || s && u === "outside") && !v, ee = u !== "outside", te = i[0] && En(a, i[0]) ? `${r}-${Dn(a, i[0])}` : void 0, ne = s && i.length > 0 ? `${i.length} valgt` : void 0;
3006
+ ].filter(Boolean).join(" "), j = ["pkt-combobox__arrow-icon", o && "pkt-combobox__arrow-icon--open"].filter(Boolean).join(" "), M = c || l, N = !M && d && (!i.length || s && u === "outside") && !v, P = u !== "outside", ee = i[0] && En(a, i[0]) ? `${r}-${Dn(a, i[0])}` : void 0, te = s && i.length > 0 ? `${i.length} valgt` : void 0, F = M ? { tabIndex: -1 } : {
3007
+ id: `${t}-combobox`,
3008
+ role: "combobox",
3009
+ "aria-expanded": o ? "true" : "false",
3010
+ "aria-controls": r,
3011
+ "aria-haspopup": "listbox",
3012
+ "aria-labelledby": `${t}-combobox-label`,
3013
+ "aria-activedescendant": ee,
3014
+ "aria-description": te,
3015
+ tabIndex: f ? -1 : 0,
3016
+ onKeyDown: D
3017
+ };
3005
3018
  return /* @__PURE__ */ _("div", {
3006
3019
  ref: b,
3007
3020
  className: A,
3008
3021
  onClick: T,
3009
- ...M ? { tabIndex: -1 } : {
3010
- id: `${t}-combobox`,
3011
- role: "combobox",
3012
- "aria-expanded": o ? "true" : "false",
3013
- "aria-controls": r,
3014
- "aria-haspopup": "listbox",
3015
- "aria-labelledby": `${t}-combobox-label`,
3016
- "aria-activedescendant": te,
3017
- "aria-description": ne,
3018
- tabIndex: f ? -1 : 0,
3019
- onKeyDown: D
3020
- },
3022
+ ...F,
3021
3023
  children: [
3022
3024
  N ? /* @__PURE__ */ g("span", {
3023
3025
  className: "pkt-combobox__placeholder",
3024
3026
  onClick: E,
3025
3027
  children: d
3026
- }) : ee ? s ? /* @__PURE__ */ g(Wn, { state: e }) : M ? null : /* @__PURE__ */ g(Gn, { state: e }) : null,
3028
+ }) : P ? s ? /* @__PURE__ */ g(Wn, { state: e }) : M ? null : /* @__PURE__ */ g(Gn, { state: e }) : null,
3027
3029
  M ? /* @__PURE__ */ g("div", {
3028
3030
  className: "pkt-combobox__input-div combobox__input",
3029
3031
  children: /* @__PURE__ */ g("input", {
@@ -3042,8 +3044,8 @@ var En = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
3042
3044
  "aria-label": h,
3043
3045
  "aria-autocomplete": c ? "both" : l ? "list" : "none",
3044
3046
  "aria-controls": r,
3045
- "aria-activedescendant": te,
3046
- "aria-description": ne,
3047
+ "aria-activedescendant": ee,
3048
+ "aria-description": te,
3047
3049
  disabled: f
3048
3050
  })
3049
3051
  }) : /* @__PURE__ */ g("input", {
@@ -3054,7 +3056,7 @@ var En = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
3054
3056
  value: i.join(","),
3055
3057
  readOnly: !0
3056
3058
  }),
3057
- /* @__PURE__ */ g(F, {
3059
+ /* @__PURE__ */ g(I, {
3058
3060
  className: j,
3059
3061
  name: "chevron-thin-down",
3060
3062
  "aria-hidden": "true"
@@ -3062,15 +3064,15 @@ var En = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
3062
3064
  ]
3063
3065
  });
3064
3066
  }, qn = ({ state: e }) => {
3065
- let { listboxId: t, label: n, isOpen: r, options: i, filteredOptions: a, multiple: o, disabled: s, maxIsReached: c, maxlength: l, includeSearch: u, allowUserInput: d, addValueText: f, userInfoMessage: p, searchPlaceholder: m, searchValue: v, handleOptionClick: y, handleOptionKeydown: b, handleSearchInput: x, handleSearchKeydown: S, handleNewOptionClick: C, handleNewOptionKeydown: w, listboxRef: T } = e, E = a.filter((e) => e.selected).length, D = o && E > 0 && l != null && l > 0, O = d && f && !c, k = !!p;
3067
+ let { listboxId: t, label: n, isOpen: r, options: i, filteredOptions: a, multiple: o, disabled: s, maxIsReached: c, maxlength: l, includeSearch: u, allowUserInput: d, addValueText: f, userInfoMessage: p, searchPlaceholder: m, searchValue: v, handleOptionClick: y, handleOptionKeydown: b, handleSearchInput: x, handleSearchKeydown: S, handleNewOptionClick: C, handleNewOptionKeydown: w, listboxRef: T } = e, E = a.filter((e) => e.selected).length, D = o && E > 0 && l != null && l > 0, O = d && f && !c, k = !!p, A = [
3068
+ "pkt-listbox",
3069
+ r && "pkt-listbox__open",
3070
+ "pkt-txt-16-light"
3071
+ ].filter(Boolean).join(" ");
3066
3072
  return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _("div", {
3067
3073
  ref: T,
3068
3074
  id: t,
3069
- className: [
3070
- "pkt-listbox",
3071
- r && "pkt-listbox__open",
3072
- "pkt-txt-16-light"
3073
- ].filter(Boolean).join(" "),
3075
+ className: A,
3074
3076
  role: a.length > 0 ? "listbox" : void 0,
3075
3077
  "aria-label": a.length > 0 ? `Liste: ${n || ""}` : void 0,
3076
3078
  "aria-multiselectable": a.length > 0 && o ? "true" : void 0,
@@ -3081,7 +3083,7 @@ var En = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
3081
3083
  className: "pkt-listbox__search",
3082
3084
  children: [/* @__PURE__ */ g("span", {
3083
3085
  className: "pkt-listbox__search-icon",
3084
- children: /* @__PURE__ */ g(F, { name: "magnifying-glass-small" })
3086
+ children: /* @__PURE__ */ g(I, { name: "magnifying-glass-small" })
3085
3087
  }), /* @__PURE__ */ g("input", {
3086
3088
  className: "pkt-txt-16-light",
3087
3089
  type: "text",
@@ -3108,7 +3110,7 @@ var En = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
3108
3110
  }),
3109
3111
  k && /* @__PURE__ */ _("div", {
3110
3112
  className: "pkt-listbox__banner pkt-listbox__banner--user-message",
3111
- children: [/* @__PURE__ */ g(F, {
3113
+ children: [/* @__PURE__ */ g(I, {
3112
3114
  className: "pkt-listbox__banner-icon",
3113
3115
  name: "exclamation-mark-circle"
3114
3116
  }), p]
@@ -3122,7 +3124,7 @@ var En = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
3122
3124
  onClick: () => C(f),
3123
3125
  onKeyDown: w,
3124
3126
  children: [
3125
- /* @__PURE__ */ g(F, {
3127
+ /* @__PURE__ */ g(I, {
3126
3128
  className: "pkt-listbox__banner-icon",
3127
3129
  name: "plus-sign"
3128
3130
  }),
@@ -3133,7 +3135,7 @@ var En = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
3133
3135
  }),
3134
3136
  i.length === 0 && a.length === 0 && !k && /* @__PURE__ */ _("div", {
3135
3137
  className: "pkt-listbox__banner pkt-listbox__banner--empty",
3136
- children: [/* @__PURE__ */ g(F, {
3138
+ children: [/* @__PURE__ */ g(I, {
3137
3139
  className: "pkt-listbox__banner-icon",
3138
3140
  name: "exclamation-mark-circle"
3139
3141
  }), "Tom liste"]
@@ -3171,7 +3173,7 @@ var En = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
3171
3173
  readOnly: !0,
3172
3174
  "aria-hidden": "true",
3173
3175
  disabled: i
3174
- }) : e.selected ? /* @__PURE__ */ g(F, { name: "check-big" }) : null,
3176
+ }) : e.selected ? /* @__PURE__ */ g(I, { name: "check-big" }) : null,
3175
3177
  /* @__PURE__ */ _("span", {
3176
3178
  className: "pkt-listbox__option-label",
3177
3179
  id: `${t}-option-label-${n}`,
@@ -3205,11 +3207,11 @@ function Jn(e, t) {
3205
3207
  }));
3206
3208
  }
3207
3209
  function Yn(t, n) {
3208
- let { id: r = "", label: i, value: s, defaultValue: l, options: d, defaultOptions: h, multiple: g = !1, maxlength: _, typeahead: v = !1, includeSearch: y = !1, allowUserInput: b = !1, displayValueAs: x = "label", tagPlacement: S, searchPlaceholder: C, placeholder: w, disabled: T = !1, required: E = !1, fullwidth: D = !1, hasError: O = !1, errorMessage: k, helptext: A, helptextDropdown: j, helptextDropdownButton: M, optionalTag: N = !1, optionalText: ee, requiredTag: te = !1, requiredText: ne, tagText: P, useWrapper: re = !0, inline: ie = !1, counter: ae, inputSize: oe = "medium", name: se, className: ce, onChange: F, onValueChange: I, children: L } = t, R = `${r}-input`, le = `${r}-listbox`, z = v || b, B = p(null), ue = p(null), V = p(null), H = p(null), U = p(null), W = o(() => {
3209
- z ? B.current?.focus() : V.current?.focus();
3210
- }, [z]), G = f(() => {
3210
+ let { id: r = "", label: i, value: s, defaultValue: l, options: d, defaultOptions: h, multiple: g = !1, maxlength: _, typeahead: v = !1, includeSearch: y = !1, allowUserInput: b = !1, displayValueAs: x = "label", tagPlacement: S, searchPlaceholder: C, placeholder: w, disabled: T = !1, required: E = !1, fullwidth: D = !1, hasError: O = !1, errorMessage: k, helptext: A, helptextDropdown: j, helptextDropdownButton: M, optionalTag: N = !1, optionalText: P, requiredTag: ee = !1, requiredText: te, tagText: F, useWrapper: ne = !0, inline: re = !1, counter: ie, inputSize: ae = "medium", name: oe, className: se, onChange: I, onValueChange: L, children: R } = t, z = `${r}-input`, ce = `${r}-listbox`, B = v || b, V = p(null), le = p(null), H = p(null), U = p(null), W = p(null), G = o(() => {
3211
+ B ? V.current?.focus() : H.current?.focus();
3212
+ }, [B]), K = f(() => {
3211
3213
  let t = [];
3212
- return e.forEach(L, (e) => {
3214
+ return e.forEach(R, (e) => {
3213
3215
  if (a(e) && e.type === "option") {
3214
3216
  let n = e.props;
3215
3217
  t.push({
@@ -3220,90 +3222,90 @@ function Yn(t, n) {
3220
3222
  });
3221
3223
  }
3222
3224
  }), t;
3223
- }, [L]), de = f(() => h && h.length > 0 ? h.map((e) => ({
3225
+ }, [R]), ue = f(() => h && h.length > 0 ? h.map((e) => ({
3224
3226
  ...e,
3225
3227
  fulltext: kn(e)
3226
3228
  })) : d && d.length > 0 ? d.map((e) => ({
3227
3229
  ...e,
3228
3230
  fulltext: kn(e)
3229
- })) : G.length > 0 ? G.map((e) => ({
3231
+ })) : K.length > 0 ? K.map((e) => ({
3230
3232
  ...e,
3231
3233
  fulltext: kn(e)
3232
3234
  })) : [], [
3233
3235
  h,
3234
3236
  d,
3235
- G
3236
- ]), K = s !== void 0, [fe, pe] = m(() => Mn(s ?? l, g)), me = p(fe);
3237
+ K
3238
+ ]), q = s !== void 0, [de, fe] = m(() => Mn(s ?? l, g)), pe = p(de);
3237
3239
  c(() => {
3238
- K && pe(Mn(s, g));
3240
+ q && fe(Mn(s, g));
3239
3241
  }, [
3240
3242
  s,
3241
- K,
3243
+ q,
3242
3244
  g
3243
3245
  ]);
3244
- let q = K ? Mn(s, g) : fe, [he, J] = m([]), Y = f(() => Jn([...he.filter((e) => !de.some((t) => t.value === e.value)), ...de], q), [
3245
- de,
3246
- he,
3247
- q
3248
- ]), [X, Z] = m(!1), [ge, _e] = m(""), [ve, ye] = m(""), [be, xe] = m(""), [Se, Ce] = m(null), [we, Te] = m(!1), [Ee, De] = m(!1), [Oe, Q] = m(-1), ke = p(!1), Ae = An(q.length, _ ?? null), je = ae ?? (g && _ != null), Me = f(() => ge ? v ? Nn(Y, ge).filtered : On(Y, ge) : Y, [
3246
+ let J = q ? Mn(s, g) : de, [me, he] = m([]), Y = f(() => Jn([...me.filter((e) => !ue.some((t) => t.value === e.value)), ...ue], J), [
3247
+ ue,
3248
+ me,
3249
+ J
3250
+ ]), [X, Z] = m(!1), [ge, _e] = m(""), [ve, ye] = m(""), [be, xe] = m(""), [Se, Ce] = m(null), [we, Te] = m(!1), [Ee, De] = m(!1), [Oe, Q] = m(-1), ke = p(!1), Ae = An(J.length, _ ?? null), je = ie ?? (g && _ != null), Me = f(() => ge ? v ? Nn(Y, ge).filtered : On(Y, ge) : Y, [
3249
3251
  Y,
3250
3252
  ge,
3251
3253
  v
3252
3254
  ]), Ne = f(() => Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set, []), Pe = o((e) => {
3253
- let t = ue.current;
3255
+ let t = le.current;
3254
3256
  if (!t || !Ne) return;
3255
3257
  let n = g ? e.join(",") : e[0] || "";
3256
3258
  Ne.call(t, n), t.dispatchEvent(new Event("input", { bubbles: !0 }));
3257
- }, [Ne, g]), Fe = g ? q.join(",") : q[0] || "";
3259
+ }, [Ne, g]), Fe = g ? J.join(",") : J[0] || "";
3258
3260
  c(() => {
3259
- ue.current && (ue.current.value = Fe);
3261
+ le.current && (le.current.value = Fe);
3260
3262
  }, [Fe]), c(() => {
3261
- if (X || !B.current) return;
3262
- let e = !g && q[0] ? Ln(q[0], Y, x) : "";
3263
- B.current.value !== e && (B.current.value = e);
3263
+ if (X || !V.current) return;
3264
+ let e = !g && J[0] ? Ln(J[0], Y, x) : "";
3265
+ V.current.value !== e && (V.current.value = e);
3264
3266
  }, [
3265
- q,
3267
+ J,
3266
3268
  Y,
3267
3269
  x,
3268
3270
  g,
3269
3271
  X
3270
3272
  ]);
3271
3273
  let Ie = o((e, t = !0) => {
3272
- K || pe(e), t && (I?.(e), Pe(e));
3274
+ q || fe(e), t && (L?.(e), Pe(e));
3273
3275
  }, [
3274
- K,
3275
- I,
3276
+ q,
3277
+ L,
3276
3278
  Pe
3277
3279
  ]), Le = o((e) => {
3278
- if (e && !q.includes(e)) {
3279
- if (g && An(q.length, _ ?? null)) {
3280
- xe("Maks antall valg nådd");
3281
- return;
3282
- }
3283
- Ie(g ? [...q, e] : [e]);
3280
+ if (!e || J.includes(e)) return;
3281
+ if (g && An(J.length, _ ?? null)) {
3282
+ xe("Maks antall valg nådd");
3283
+ return;
3284
3284
  }
3285
+ let t = g ? [...J, e] : [e];
3286
+ Ie(t);
3285
3287
  }, [
3286
- q,
3288
+ J,
3287
3289
  g,
3288
3290
  _,
3289
3291
  Ie
3290
3292
  ]), Re = o((e) => {
3291
3293
  if (!e) return;
3292
- let t = q.filter((t) => t !== e);
3293
- En(Y, e)?.userAdded && J((t) => t.filter((t) => t.value !== e)), Ie(t);
3294
+ let t = J.filter((t) => t !== e);
3295
+ En(Y, e)?.userAdded && he((t) => t.filter((t) => t.value !== e)), Ie(t);
3294
3296
  }, [
3295
- q,
3297
+ J,
3296
3298
  Y,
3297
3299
  Ie
3298
3300
  ]), $ = o(() => {
3299
- J([]), Ie([]);
3301
+ he([]), Ie([]);
3300
3302
  }, [Ie]), ze = o((e) => {
3301
3303
  if (!e || e.trim() === "") return;
3302
3304
  let t;
3303
3305
  if (!g) t = [e];
3304
3306
  else {
3305
- if (En(Y, e) || An(q.length, _ ?? null)) return;
3306
- t = [...q, e];
3307
+ if (En(Y, e) || An(J.length, _ ?? null)) return;
3308
+ t = [...J, e];
3307
3309
  }
3308
3310
  let n = {
3309
3311
  value: e,
@@ -3311,35 +3313,35 @@ function Yn(t, n) {
3311
3313
  userAdded: !0,
3312
3314
  selected: !0
3313
3315
  };
3314
- J((t) => [n, ...t.filter((t) => t.value !== e)]), Ie(t);
3316
+ he((t) => [n, ...t.filter((t) => t.value !== e)]), Ie(t);
3315
3317
  }, [
3316
3318
  g,
3317
3319
  Y,
3318
- q,
3320
+ J,
3319
3321
  _,
3320
3322
  Ie
3321
3323
  ]), Be = o((e = !0, t) => {
3322
- if (Ce(null), e && B.current && B.current.type !== "hidden") {
3324
+ if (Ce(null), e && V.current && V.current.type !== "hidden") {
3323
3325
  _e(""), ye("");
3324
- let e = t === void 0 ? q[0] : t;
3325
- !g && e ? B.current.value = Ln(e, Y, x) : B.current.value = "", g || (De(!1), xe(""));
3326
+ let e = t === void 0 ? J[0] : t;
3327
+ !g && e ? V.current.value = Ln(e, Y, x) : V.current.value = "", g || (De(!1), xe(""));
3326
3328
  }
3327
3329
  }, [
3328
3330
  g,
3329
- q,
3331
+ J,
3330
3332
  Y,
3331
3333
  x
3332
3334
  ]), Ve = o((e) => {
3333
3335
  if (T) return;
3334
3336
  xe(""), Ce(null);
3335
- let t = En(Y, e)?.value || null, n = q.includes(e || t || ""), r = !!t, i = Y.find((t) => t.value === e)?.disabled || !1, a = !e?.trim(), o = !g, s = g, c = An(q.length, _ ?? null), l = !1, u = !0, d = "", f = "", p;
3336
- i || (!r && b && !a ? (ze(e), d = "Ny verdi lagt til", l = s, o && (p = e || "")) : !r && !b ? (o && q[0] && Re(q[0]), u = !1, l = !0, d = "Ingen treff i søket") : n ? (Re(t), l = !0, p = "", o && z && B.current && B.current.type !== "hidden" && (B.current.value = "")) : a && o ? ($(), l = !0, p = "") : o ? (q[0] && Re(q[0]), Le(t), l = !1, p = t || "") : s && !c ? (Le(t), l = !0) : s && c ? (d = "Maks antall valg nådd", u = !1, f = e || "") : (o && $(), d = "Ingen gyldig verdi valgt", u = !1, l = !0, f = e || "", p = ""), Z(l), xe(d), _e(f), Be(u, p), l || (o && z && (ke.current = !0), window.setTimeout(() => {
3337
- W();
3337
+ let t = En(Y, e)?.value || null, n = J.includes(e || t || ""), r = !!t, i = Y.find((t) => t.value === e)?.disabled || !1, a = !e?.trim(), o = !g, s = g, c = An(J.length, _ ?? null), l = !1, u = !0, d = "", f = "", p;
3338
+ i || (!r && b && !a ? (ze(e), d = "Ny verdi lagt til", l = s, o && (p = e || "")) : !r && !b ? (o && J[0] && Re(J[0]), u = !1, l = !0, d = "Ingen treff i søket") : n ? (Re(t), l = !0, p = "", o && B && V.current && V.current.type !== "hidden" && (V.current.value = "")) : a && o ? ($(), l = !0, p = "") : o ? (J[0] && Re(J[0]), Le(t), l = !1, p = t || "") : s && !c ? (Le(t), l = !0) : s && c ? (d = "Maks antall valg nådd", u = !1, f = e || "") : (o && $(), d = "Ingen gyldig verdi valgt", u = !1, l = !0, f = e || "", p = ""), Z(l), xe(d), _e(f), Be(u, p), l || (o && B && (ke.current = !0), window.setTimeout(() => {
3339
+ G();
3338
3340
  }, 0)));
3339
3341
  }, [
3340
3342
  T,
3341
3343
  Y,
3342
- q,
3344
+ J,
3343
3345
  g,
3344
3346
  _,
3345
3347
  b,
@@ -3348,17 +3350,18 @@ function Yn(t, n) {
3348
3350
  $,
3349
3351
  Le,
3350
3352
  Be,
3351
- W
3353
+ G
3352
3354
  ]), He = o(() => {
3353
- if (Te(!1), Ce(null), xe(""), _e(""), B.current && B.current.type !== "hidden") {
3354
- let e = B.current.value, t = q[0];
3355
- if (!g) if (!e) q[0] && Re(q[0]), t = void 0;
3356
- else {
3357
- let n = En(Y, e);
3358
- n && n.value !== q[0] ? (q[0] && Re(q[0]), Le(n.value), t = n.value) : !n && b && (q[0] && Re(q[0]), ze(e), t = e);
3359
- }
3360
- else if (e !== "") {
3361
- let { action: t, value: n } = In(e, q, Y, b, g);
3355
+ if (Te(!1), Ce(null), xe(""), _e(""), V.current && V.current.type !== "hidden") {
3356
+ let e = V.current.value, t = J[0];
3357
+ if (!g) {
3358
+ if (!e) J[0] && Re(J[0]), t = void 0;
3359
+ else {
3360
+ let n = En(Y, e);
3361
+ n && n.value !== J[0] ? (J[0] && Re(J[0]), Le(n.value), t = n.value) : !n && b && (J[0] && Re(J[0]), ze(e), t = e);
3362
+ }
3363
+ } else if (e !== "") {
3364
+ let { action: t, value: n } = In(e, J, Y, b, g);
3362
3365
  switch (t) {
3363
3366
  case "addUserValue":
3364
3367
  ze(n);
@@ -3366,16 +3369,14 @@ function Yn(t, n) {
3366
3369
  case "selectOption":
3367
3370
  Le(n);
3368
3371
  break;
3369
- case "removeValue":
3370
- Re(n);
3371
- break;
3372
+ case "removeValue": Re(n);
3372
3373
  }
3373
3374
  }
3374
- !g && t ? B.current.value = Ln(t, Y, x) : B.current.value = "";
3375
+ !g && t ? V.current.value = Ln(t, Y, x) : V.current.value = "";
3375
3376
  }
3376
3377
  Z(!1), De(!1);
3377
3378
  }, [
3378
- q,
3379
+ J,
3379
3380
  Y,
3380
3381
  b,
3381
3382
  g,
@@ -3385,13 +3386,13 @@ function Yn(t, n) {
3385
3386
  Re
3386
3387
  ]), Ue = o((e) => {
3387
3388
  if (!e.trim().toLowerCase()) {
3388
- Ce(null), xe(""), !g && q[0] && Re(q[0]);
3389
+ Ce(null), xe(""), !g && J[0] && Re(J[0]);
3389
3390
  return;
3390
3391
  }
3391
- let t = Pn(e, q, Y, b);
3392
+ let t = Pn(e, J, Y, b);
3392
3393
  Ce(t.addValueText), xe(t.userInfoMessage);
3393
3394
  }, [
3394
- q,
3395
+ J,
3395
3396
  Y,
3396
3397
  b,
3397
3398
  g,
@@ -3401,7 +3402,7 @@ function Yn(t, n) {
3401
3402
  let t = e.target.value;
3402
3403
  if (ye(t), _e(t), Ue(t), v && t) {
3403
3404
  let { suggestion: n } = Nn(Y, t);
3404
- n?.label && B.current && !e.nativeEvent.inputType?.includes("deleteContent") && (B.current.value = n.label, window.setTimeout(() => B.current?.setSelectionRange(t.length, n.label.length), 0));
3405
+ n?.label && V.current && !e.nativeEvent.inputType?.includes("deleteContent") && (V.current.value = n.label, window.setTimeout(() => V.current?.setSelectionRange(t.length, n.label.length), 0));
3405
3406
  }
3406
3407
  }, [
3407
3408
  T,
@@ -3410,28 +3411,28 @@ function Yn(t, n) {
3410
3411
  Ue
3411
3412
  ]), Ge = o((e) => {
3412
3413
  if (e.key === "Backspace") {
3413
- let t = !B.current?.value;
3414
- if (!ge && t && g && q.length > 0) {
3414
+ let t = !V.current?.value;
3415
+ if (!ge && t && g && J.length > 0) {
3415
3416
  e.preventDefault();
3416
- let t = q[q.length - 1];
3417
+ let t = J[J.length - 1];
3417
3418
  Re(t);
3418
3419
  }
3419
3420
  return;
3420
3421
  }
3421
- if (e.key === "ArrowLeft" && g && q.length > 0 && (B.current?.selectionStart ?? 0) === 0 && !B.current?.value) {
3422
- e.preventDefault(), Q(q.length - 1);
3422
+ if (e.key === "ArrowLeft" && g && J.length > 0 && (V.current?.selectionStart ?? 0) === 0 && !V.current?.value) {
3423
+ e.preventDefault(), Q(J.length - 1);
3423
3424
  return;
3424
3425
  }
3425
3426
  let t = Fn(e.key, e.shiftKey, g);
3426
3427
  if (t && !(e.key === "Tab" && !X)) {
3427
- if (t === "focusListbox" && e.key === "Tab" && !H.current?.querySelector("[role=\"option\"]:not([data-disabled]), [data-type=\"new-option\"]")) {
3428
+ if (t === "focusListbox" && e.key === "Tab" && !U.current?.querySelector("[role=\"option\"]:not([data-disabled]), [data-type=\"new-option\"]")) {
3428
3429
  He();
3429
3430
  return;
3430
3431
  }
3431
3432
  switch (e.preventDefault(), t) {
3432
3433
  case "addValue": {
3433
- let e = B.current?.value.trim() || "";
3434
- if (_e(e), e && q.includes(e)) {
3434
+ let e = V.current?.value.trim() || "";
3435
+ if (_e(e), e && J.includes(e)) {
3435
3436
  Be(!0), xe("Verdien er allerede valgt");
3436
3437
  break;
3437
3438
  }
@@ -3439,21 +3440,19 @@ function Yn(t, n) {
3439
3440
  break;
3440
3441
  }
3441
3442
  case "focusListbox":
3442
- H.current && (X || Z(!0), Un(H.current, {
3443
+ U.current && (X || Z(!0), Un(U.current, {
3443
3444
  disabled: T,
3444
3445
  allowUserInput: b,
3445
3446
  customUserInput: Se,
3446
3447
  includeSearch: y
3447
3448
  }));
3448
3449
  break;
3449
- case "closeOptions":
3450
- Z(!1);
3451
- break;
3450
+ case "closeOptions": Z(!1);
3452
3451
  }
3453
3452
  }
3454
3453
  }, [
3455
3454
  ge,
3456
- q,
3455
+ J,
3457
3456
  g,
3458
3457
  T,
3459
3458
  b,
@@ -3462,26 +3461,26 @@ function Yn(t, n) {
3462
3461
  X,
3463
3462
  Re,
3464
3463
  Ve,
3465
- W
3464
+ G
3466
3465
  ]), Ke = o(() => {
3467
3466
  if (!T) {
3468
3467
  if (ke.current) {
3469
3468
  ke.current = !1, Te(!0);
3470
3469
  return;
3471
3470
  }
3472
- !g && q[0] && B.current && B.current.type !== "hidden" && (De(!0), B.current.value = Ln(q[0], Y, x)), Te(!0), _e(""), Z(!0);
3471
+ !g && J[0] && V.current && V.current.type !== "hidden" && (De(!0), V.current.value = Ln(J[0], Y, x)), Te(!0), _e(""), Z(!0);
3473
3472
  }
3474
3473
  }, [
3475
3474
  T,
3476
3475
  g,
3477
- q,
3476
+ J,
3478
3477
  Y,
3479
3478
  x
3480
3479
  ]), qe = o(() => {
3481
3480
  Te(!1), De(!1);
3482
3481
  }, []), Je = o((e) => {
3483
3482
  if (T || !X) return;
3484
- let t = e.relatedTarget, n = U.current;
3483
+ let t = e.relatedTarget, n = W.current;
3485
3484
  n && t && n.contains(t) || He();
3486
3485
  }, [
3487
3486
  T,
@@ -3492,11 +3491,11 @@ function Yn(t, n) {
3492
3491
  e.preventDefault(), e.stopPropagation();
3493
3492
  return;
3494
3493
  }
3495
- if (z) B.current?.focus();
3494
+ if (B) V.current?.focus();
3496
3495
  else {
3497
3496
  e.stopPropagation(), e.preventDefault();
3498
3497
  let t = !X;
3499
- Z(t), t && H.current && Un(H.current, {
3498
+ Z(t), t && U.current && Un(U.current, {
3500
3499
  disabled: T,
3501
3500
  allowUserInput: b,
3502
3501
  customUserInput: Se,
@@ -3505,21 +3504,21 @@ function Yn(t, n) {
3505
3504
  }
3506
3505
  }, [
3507
3506
  T,
3508
- z,
3507
+ B,
3509
3508
  X,
3510
3509
  b,
3511
3510
  Se,
3512
3511
  y
3513
3512
  ]), Xe = o((e) => {
3514
- T || (e.stopPropagation(), z && B.current ? (B.current.focus(), Te(!0)) : Z((e) => !e));
3515
- }, [T, z]), Ze = o((e) => {
3513
+ T || (e.stopPropagation(), B && V.current ? (V.current.focus(), Te(!0)) : Z((e) => !e));
3514
+ }, [T, B]), Ze = o((e) => {
3516
3515
  if (!T) switch (e.key) {
3517
3516
  case "Enter":
3518
3517
  case " ":
3519
3518
  case "ArrowDown":
3520
3519
  case "ArrowUp":
3521
- e.preventDefault(), X ? Z(!1) : (Z(!0), H.current && window.setTimeout(() => {
3522
- H.current && Un(H.current, {
3520
+ e.preventDefault(), X ? Z(!1) : (Z(!0), U.current && window.setTimeout(() => {
3521
+ U.current && Un(U.current, {
3523
3522
  disabled: T,
3524
3523
  allowUserInput: b && !Ae,
3525
3524
  customUserInput: Se,
@@ -3532,8 +3531,8 @@ function Yn(t, n) {
3532
3531
  break;
3533
3532
  case "Home":
3534
3533
  case "End":
3535
- e.preventDefault(), X || Z(!0), H.current && window.setTimeout(() => {
3536
- H.current && Un(H.current, {
3534
+ e.preventDefault(), X || Z(!0), U.current && window.setTimeout(() => {
3535
+ U.current && Un(U.current, {
3537
3536
  disabled: T,
3538
3537
  allowUserInput: b && !Ae,
3539
3538
  customUserInput: Se,
@@ -3542,16 +3541,14 @@ function Yn(t, n) {
3542
3541
  }, 0);
3543
3542
  break;
3544
3543
  case "ArrowLeft":
3545
- g && q.length > 0 && (e.preventDefault(), Q(q.length - 1));
3544
+ g && J.length > 0 && (e.preventDefault(), Q(J.length - 1));
3546
3545
  break;
3547
3546
  case "Backspace":
3548
- case "Delete":
3549
- if (g && q.length > 0) {
3550
- e.preventDefault();
3551
- let t = q[q.length - 1];
3552
- Re(t);
3553
- }
3554
- break;
3547
+ case "Delete": if (g && J.length > 0) {
3548
+ e.preventDefault();
3549
+ let t = J[J.length - 1];
3550
+ Re(t);
3551
+ }
3555
3552
  }
3556
3553
  }, [
3557
3554
  T,
@@ -3561,7 +3558,7 @@ function Yn(t, n) {
3561
3558
  Se,
3562
3559
  y,
3563
3560
  g,
3564
- q,
3561
+ J,
3565
3562
  Re
3566
3563
  ]), Qe = o((e) => {
3567
3564
  Ve(e);
@@ -3575,64 +3572,58 @@ function Yn(t, n) {
3575
3572
  e.preventDefault(), Bn(e.currentTarget);
3576
3573
  break;
3577
3574
  case "ArrowUp":
3578
- e.preventDefault(), H.current && Vn(e.currentTarget, H.current, y);
3575
+ e.preventDefault(), U.current && Vn(e.currentTarget, U.current, y);
3579
3576
  break;
3580
3577
  case "Escape":
3581
- e.preventDefault(), Z(!1), W();
3582
- break;
3583
- case "Tab":
3584
- He();
3578
+ e.preventDefault(), Z(!1), G();
3585
3579
  break;
3580
+ case "Tab": He();
3586
3581
  }
3587
3582
  }, [
3588
3583
  Ve,
3589
3584
  y,
3590
- W,
3585
+ G,
3591
3586
  He
3592
3587
  ]), et = o((e) => {
3593
- Re(e), Q(-1), z && B.current && (Te(!0), B.current.focus());
3594
- }, [Re, z]), tt = o((e, t) => {
3588
+ Re(e), Q(-1), B && V.current && (Te(!0), V.current.focus());
3589
+ }, [Re, B]), tt = o((e, t) => {
3595
3590
  switch (e.stopPropagation(), e.key) {
3596
3591
  case "ArrowLeft":
3597
3592
  e.preventDefault(), t > 0 && Q(t - 1);
3598
3593
  break;
3599
3594
  case "ArrowRight":
3600
- e.preventDefault(), t < q.length - 1 ? Q(t + 1) : (Q(-1), z && B.current ? B.current.focus() : V.current?.focus());
3595
+ e.preventDefault(), t < J.length - 1 ? Q(t + 1) : (Q(-1), B && V.current ? V.current.focus() : H.current?.focus());
3601
3596
  break;
3602
3597
  case "Backspace":
3603
3598
  case "Delete":
3604
3599
  e.preventDefault();
3605
3600
  {
3606
- let e = q[t], n = t >= q.length - 1 ? t - 1 : t;
3607
- Re(e), n >= 0 ? Q(n) : (Q(-1), z && B.current ? B.current.focus() : V.current?.focus());
3601
+ let e = J[t], n = t >= J.length - 1 ? t - 1 : t;
3602
+ Re(e), n >= 0 ? Q(n) : (Q(-1), B && V.current ? V.current.focus() : H.current?.focus());
3608
3603
  }
3609
3604
  break;
3610
3605
  case "Tab":
3611
3606
  Q(-1);
3612
3607
  break;
3613
- case "Escape":
3614
- e.preventDefault(), Q(-1), z && B.current ? B.current.focus() : V.current?.focus();
3615
- break;
3608
+ case "Escape": e.preventDefault(), Q(-1), B && V.current ? V.current.focus() : H.current?.focus();
3616
3609
  }
3617
3610
  }, [
3618
- q,
3619
- z,
3611
+ J,
3612
+ B,
3620
3613
  Re
3621
3614
  ]), nt = o((e) => {
3622
3615
  _e(e.target.value), Ue(e.target.value);
3623
3616
  }, [Ue]), rt = o((e) => {
3624
3617
  switch (e.key) {
3625
3618
  case "ArrowDown":
3626
- e.preventDefault(), H.current && H.current.querySelector("[role=\"option\"]:not([data-disabled]), [data-type=\"new-option\"]")?.focus();
3619
+ e.preventDefault(), U.current && U.current.querySelector("[role=\"option\"]:not([data-disabled]), [data-type=\"new-option\"]")?.focus();
3627
3620
  break;
3628
3621
  case "Tab":
3629
3622
  He();
3630
3623
  break;
3631
- case "Escape":
3632
- e.preventDefault(), Z(!1), W();
3633
- break;
3624
+ case "Escape": e.preventDefault(), Z(!1), G();
3634
3625
  }
3635
- }, [W, He]), it = o((e) => {
3626
+ }, [G, He]), it = o((e) => {
3636
3627
  Ve(e);
3637
3628
  }, [Ve]), at = o((e) => {
3638
3629
  switch (e.key) {
@@ -3641,60 +3632,58 @@ function Yn(t, n) {
3641
3632
  e.preventDefault(), Ve(e.currentTarget.dataset.value || "");
3642
3633
  break;
3643
3634
  case "ArrowDown":
3644
- e.preventDefault(), H.current && Hn(H.current);
3635
+ e.preventDefault(), U.current && Hn(U.current);
3645
3636
  break;
3646
3637
  case "ArrowUp":
3647
- e.preventDefault(), H.current && Vn(e.currentTarget, H.current, y);
3648
- break;
3649
- case "Escape":
3650
- e.preventDefault(), Z(!1), W();
3638
+ e.preventDefault(), U.current && Vn(e.currentTarget, U.current, y);
3651
3639
  break;
3640
+ case "Escape": e.preventDefault(), Z(!1), G();
3652
3641
  }
3653
3642
  }, [
3654
3643
  Ve,
3655
3644
  y,
3656
- W
3645
+ G
3657
3646
  ]);
3658
3647
  return c(() => {
3659
3648
  if (!X) return;
3660
3649
  let e = (e) => {
3661
3650
  let t = e.target;
3662
- U.current && !U.current.contains(t) && He();
3651
+ W.current && !W.current.contains(t) && He();
3663
3652
  };
3664
3653
  return document.addEventListener("click", e, !0), () => {
3665
3654
  document.removeEventListener("click", e, !0);
3666
3655
  };
3667
3656
  }, [X, He]), c(() => {
3668
- let e = U.current?.closest("form");
3657
+ let e = W.current?.closest("form");
3669
3658
  if (!e) return;
3670
3659
  let t = () => {
3671
3660
  window.setTimeout(() => {
3672
- if (pe(me.current), J([]), ye(""), _e(""), Ce(null), xe(""), ue.current) {
3673
- let e = g ? me.current.join(",") : me.current[0] || "";
3674
- ue.current.value = e;
3661
+ if (fe(pe.current), he([]), ye(""), _e(""), Ce(null), xe(""), le.current) {
3662
+ let e = g ? pe.current.join(",") : pe.current[0] || "";
3663
+ le.current.value = e;
3675
3664
  }
3676
3665
  }, 0);
3677
3666
  };
3678
3667
  return e.addEventListener("reset", t), () => e.removeEventListener("reset", t);
3679
3668
  }, [g]), u(n, () => ({
3680
3669
  get value() {
3681
- return ue.current?.value ?? "";
3670
+ return le.current?.value ?? "";
3682
3671
  },
3683
3672
  set value(e) {
3684
3673
  let t = Array.isArray(e) ? e : e ? String(e).split(",").filter(Boolean) : [];
3685
- K || pe(t), ue.current && (ue.current.value = t.join(","));
3674
+ q || fe(t), le.current && (le.current.value = t.join(","));
3686
3675
  },
3687
3676
  focus() {
3688
- z ? B.current?.focus() : V.current?.focus();
3677
+ B ? V.current?.focus() : H.current?.focus();
3689
3678
  },
3690
3679
  blur() {
3691
- z ? B.current?.blur() : V.current?.blur();
3680
+ B ? V.current?.blur() : H.current?.blur();
3692
3681
  }
3693
- }), [K]), {
3682
+ }), [q]), {
3694
3683
  id: r,
3695
- inputId: R,
3696
- listboxId: le,
3697
- values: q,
3684
+ inputId: z,
3685
+ listboxId: ce,
3686
+ values: J,
3698
3687
  inputValue: ve,
3699
3688
  searchValue: ge,
3700
3689
  options: Y,
@@ -3725,21 +3714,21 @@ function Yn(t, n) {
3725
3714
  helptextDropdown: j,
3726
3715
  helptextDropdownButton: M,
3727
3716
  optionalTag: N,
3728
- optionalText: ee,
3729
- requiredTag: te,
3730
- requiredText: ne,
3731
- tagText: P,
3732
- useWrapper: re,
3733
- inline: ie,
3734
- inputSize: oe,
3735
- name: se,
3736
- className: ce,
3717
+ optionalText: P,
3718
+ requiredTag: ee,
3719
+ requiredText: te,
3720
+ tagText: F,
3721
+ useWrapper: ne,
3722
+ inline: re,
3723
+ inputSize: ae,
3724
+ name: oe,
3725
+ className: se,
3737
3726
  hasCounter: je,
3738
- inputRef: B,
3739
- changeInputRef: ue,
3740
- triggerRef: V,
3741
- listboxRef: H,
3742
- wrapperRef: U,
3727
+ inputRef: V,
3728
+ changeInputRef: le,
3729
+ triggerRef: H,
3730
+ listboxRef: U,
3731
+ wrapperRef: W,
3743
3732
  handleInputChange: We,
3744
3733
  handleInputKeydown: Ge,
3745
3734
  handleInputFocus: Ke,
@@ -3756,7 +3745,7 @@ function Yn(t, n) {
3756
3745
  handleSearchKeydown: rt,
3757
3746
  handleNewOptionClick: it,
3758
3747
  handleNewOptionKeydown: at,
3759
- onChange: F
3748
+ onChange: I
3760
3749
  };
3761
3750
  }
3762
3751
  //#endregion
@@ -4009,7 +3998,7 @@ var Zn = {
4009
3998
  "aria-haspopup": "dialog",
4010
3999
  onClick: b,
4011
4000
  children: y
4012
- }) : s === "icon" ? /* @__PURE__ */ g(L, {
4001
+ }) : s === "icon" ? /* @__PURE__ */ g(R, {
4013
4002
  ref: f,
4014
4003
  skin: "tertiary",
4015
4004
  variant: "icon-only",
@@ -4017,7 +4006,7 @@ var Zn = {
4017
4006
  "aria-haspopup": "dialog",
4018
4007
  onClick: b,
4019
4008
  children: y
4020
- }) : /* @__PURE__ */ g(L, {
4009
+ }) : /* @__PURE__ */ g(R, {
4021
4010
  ref: f,
4022
4011
  "aria-haspopup": "dialog",
4023
4012
  onClick: b,
@@ -4030,7 +4019,7 @@ nr.displayName = "PktConsent";
4030
4019
  var rr = () => {
4031
4020
  let e = navigator.userAgent;
4032
4021
  return !!(/iP(hone|od|ad)/.test(e) || /Macintosh/.test(e) && "ontouchend" in document);
4033
- }, ir = () => rr() ? "text" : "date", ar = (e) => !e || e.length !== 2 ? !0 : Vt(e[0], e[1]), or = (e, t, n, r, i, a, o = "medium") => ({
4022
+ }, ir = () => rr() ? "text" : "date", ar = (e) => !e || e.length !== 2 || Vt(e[0], e[1]), or = (e, t, n, r, i, a, o = "medium") => ({
4034
4023
  "pkt-input": !0,
4035
4024
  "pkt-datepicker__input": !0,
4036
4025
  [`pkt-input--${o}`]: !0,
@@ -4108,18 +4097,18 @@ var rr = () => {
4108
4097
  })
4109
4098
  });
4110
4099
  }, mr = ({ state: e }) => {
4111
- let { id: t, inputId: n, values: r, dateformat: i, multiple: a, range: o, showRangeLabels: s, disabled: c, readOnly: l, required: u, label: d, name: f, placeholder: p, hasError: m, helptext: v, minStr: y, maxStr: b, inputType: x, isIOSDevice: S, strings: C, inputClasses: w, buttonClasses: T, rangeLabelClasses: E, datepickerInputsClasses: D, isInputDisabled: O, inputRef: k, inputRefTo: A, btnRef: j, toggleCalendar: M, handleFocus: N, handleSingleInputChange: ee, handleRangeFromChange: te, handleRangeToChange: ne, handleRangeBlur: P, handleMultipleBlur: re, handleTagRemoved: ie, handleSingleKeydown: ae, handleRangeFromKeydown: oe, handleRangeToKeydown: se, handleMultipleKeydown: ce, restProps: I } = e, L = (e) => {
4100
+ let { id: t, inputId: n, values: r, dateformat: i, multiple: a, range: o, showRangeLabels: s, disabled: c, readOnly: l, required: u, label: d, name: f, placeholder: p, hasError: m, helptext: v, minStr: y, maxStr: b, inputType: x, isIOSDevice: S, strings: C, inputClasses: w, buttonClasses: T, rangeLabelClasses: E, datepickerInputsClasses: D, isInputDisabled: O, inputRef: k, inputRefTo: A, btnRef: j, toggleCalendar: M, handleFocus: N, handleSingleInputChange: P, handleRangeFromChange: ee, handleRangeToChange: te, handleRangeBlur: F, handleMultipleBlur: ne, handleTagRemoved: re, handleSingleKeydown: ie, handleRangeFromKeydown: ae, handleRangeToKeydown: oe, handleMultipleKeydown: se, restProps: L } = e, R = (e) => {
4112
4101
  e.preventDefault(), M();
4113
- }, R = (e) => {
4102
+ }, z = (e) => {
4114
4103
  e.preventDefault(), M();
4115
- }, le = () => /* @__PURE__ */ _("button", {
4104
+ }, ce = () => /* @__PURE__ */ _("button", {
4116
4105
  ref: j,
4117
4106
  className: T,
4118
4107
  type: "button",
4119
4108
  onClick: M,
4120
4109
  disabled: c,
4121
4110
  "aria-label": C.calendar?.buttonAltText ?? "Åpne kalender",
4122
- children: [/* @__PURE__ */ g(F, { name: "calendar" }), /* @__PURE__ */ g("span", {
4111
+ children: [/* @__PURE__ */ g(I, { name: "calendar" }), /* @__PURE__ */ g("span", {
4123
4112
  className: "pkt-btn__text",
4124
4113
  children: C.calendar?.buttonAltText ?? "Åpne kalender"
4125
4114
  })]
@@ -4129,13 +4118,13 @@ var rr = () => {
4129
4118
  dateformat: i,
4130
4119
  idBase: t,
4131
4120
  strings: C,
4132
- onDateRemoved: ie
4121
+ onDateRemoved: re
4133
4122
  }), /* @__PURE__ */ g("div", {
4134
4123
  className: "pkt-datepicker__inputs",
4135
4124
  children: /* @__PURE__ */ _("div", {
4136
4125
  className: "pkt-input__container",
4137
4126
  children: [/* @__PURE__ */ g("input", {
4138
- ...I,
4127
+ ...L,
4139
4128
  ref: k,
4140
4129
  className: w,
4141
4130
  type: x,
@@ -4147,12 +4136,12 @@ var rr = () => {
4147
4136
  "aria-describedby": v ? `${t}-helptext` : void 0,
4148
4137
  "aria-invalid": m,
4149
4138
  "aria-errormessage": m ? `${t}-error` : void 0,
4150
- onClick: L,
4151
- onTouchEnd: R,
4152
- onKeyDown: ce,
4139
+ onClick: R,
4140
+ onTouchEnd: z,
4141
+ onKeyDown: se,
4153
4142
  onFocus: N,
4154
- onBlur: re
4155
- }), le()]
4143
+ onBlur: ne
4144
+ }), ce()]
4156
4145
  })
4157
4146
  })] }) : o ? /* @__PURE__ */ g("div", {
4158
4147
  className: D,
@@ -4164,7 +4153,7 @@ var rr = () => {
4164
4153
  children: C.generic?.from ?? "Fra"
4165
4154
  }),
4166
4155
  /* @__PURE__ */ g("input", {
4167
- ...I,
4156
+ ...L,
4168
4157
  ref: k,
4169
4158
  className: w,
4170
4159
  type: x,
@@ -4181,12 +4170,12 @@ var rr = () => {
4181
4170
  "aria-describedby": v ? `${t}-helptext` : void 0,
4182
4171
  "aria-invalid": m,
4183
4172
  "aria-errormessage": m ? `${t}-error` : void 0,
4184
- onClick: L,
4185
- onTouchEnd: R,
4186
- onKeyDown: oe,
4173
+ onClick: R,
4174
+ onTouchEnd: z,
4175
+ onKeyDown: ae,
4187
4176
  onFocus: N,
4188
- onBlur: P,
4189
- onChange: te
4177
+ onBlur: F,
4178
+ onChange: ee
4190
4179
  }),
4191
4180
  /* @__PURE__ */ g("div", {
4192
4181
  className: E,
@@ -4210,14 +4199,14 @@ var rr = () => {
4210
4199
  disabled: c,
4211
4200
  "aria-label": `${d} ${C.generic?.to ?? "Til"}`,
4212
4201
  "aria-invalid": m,
4213
- onClick: L,
4214
- onTouchEnd: R,
4215
- onKeyDown: se,
4202
+ onClick: R,
4203
+ onTouchEnd: z,
4204
+ onKeyDown: oe,
4216
4205
  onFocus: N,
4217
- onBlur: P,
4218
- onChange: ne
4206
+ onBlur: F,
4207
+ onChange: te
4219
4208
  }),
4220
- le()
4209
+ ce()
4221
4210
  ]
4222
4211
  })
4223
4212
  }) : /* @__PURE__ */ g("div", {
@@ -4225,7 +4214,7 @@ var rr = () => {
4225
4214
  children: /* @__PURE__ */ _("div", {
4226
4215
  className: "pkt-input__container",
4227
4216
  children: [/* @__PURE__ */ g("input", {
4228
- ...I,
4217
+ ...L,
4229
4218
  ref: k,
4230
4219
  className: w,
4231
4220
  type: x,
@@ -4241,13 +4230,13 @@ var rr = () => {
4241
4230
  "aria-describedby": v ? `${t}-helptext` : void 0,
4242
4231
  "aria-invalid": m,
4243
4232
  "aria-errormessage": m ? `${t}-error` : void 0,
4244
- onClick: L,
4245
- onTouchEnd: R,
4246
- onKeyDown: ae,
4233
+ onClick: R,
4234
+ onTouchEnd: z,
4235
+ onKeyDown: ie,
4247
4236
  onFocus: N,
4248
4237
  onBlur: void 0,
4249
- onChange: ee
4250
- }), le()]
4238
+ onChange: P
4239
+ }), ce()]
4251
4240
  })
4252
4241
  });
4253
4242
  }, hr = { calendar: { buttonAltText: "Åpne kalender" } }, gr = {
@@ -4268,27 +4257,27 @@ var rr = () => {
4268
4257
  //#endregion
4269
4258
  //#region src/components/datepicker/useDatepickerState.ts
4270
4259
  function vr(e, t) {
4271
- let { id: n, label: r, value: i, defaultValue: a, dateformat: s = "dd.MM.yyyy", multiple: l = !1, maxlength: d, range: h = !1, showRangeLabels: g = !1, weeknumbers: _ = !1, withcontrols: v = !1, excludedates: y, excludeweekdays: b, currentmonth: x, today: S, calendarOpen: C, timezone: w, fullwidth: T = !1, inputSize: E = "medium", hasFieldset: D = !1, counter: O, inline: k = !1, helptext: A, helptextDropdown: j, helptextDropdownButton: M, hasError: N = !1, errorMessage: ee, optionalTag: te = !1, optionalText: ne, requiredTag: P = !1, requiredText: re, tagText: ie, useWrapper: ae = !0, strings: oe, disabled: se = !1, readOnly: ce = !1, required: F = !1, name: I, min: L, max: R, placeholder: le, onChange: z, onValueChange: B, className: ue, ...V } = e, H = o((e) => e === void 0 ? [] : _r(e), []), U = i !== void 0, W = typeof a == "number" ? void 0 : a, [G, de] = m(() => H(i ?? W)), K = U ? H(i) : G, fe = p(G);
4260
+ let { id: n, label: r, value: i, defaultValue: a, dateformat: s = "dd.MM.yyyy", multiple: l = !1, maxlength: d, range: h = !1, showRangeLabels: g = !1, weeknumbers: _ = !1, withcontrols: v = !1, excludedates: y, excludeweekdays: b, currentmonth: x, today: S, calendarOpen: C, timezone: w, fullwidth: T = !1, inputSize: E = "medium", hasFieldset: D = !1, counter: O, inline: k = !1, helptext: A, helptextDropdown: j, helptextDropdownButton: M, hasError: N = !1, errorMessage: P, optionalTag: ee = !1, optionalText: te, requiredTag: F = !1, requiredText: ne, tagText: re, useWrapper: ie = !0, strings: ae, disabled: oe = !1, readOnly: se = !1, required: I = !1, name: L, min: R, max: z, placeholder: ce, onChange: B, onValueChange: V, className: le, ...H } = e, U = o((e) => e === void 0 ? [] : _r(e), []), W = i !== void 0, G = typeof a == "number" ? void 0 : a, [K, ue] = m(() => U(i ?? G)), q = W ? U(i) : K, de = p(K);
4272
4261
  c(() => {
4273
- U && de(H(i));
4262
+ W && ue(U(i));
4274
4263
  }, [
4275
4264
  i,
4276
- U,
4277
- H
4265
+ W,
4266
+ U
4278
4267
  ]);
4279
- let [pe, me] = m(C ?? !1);
4268
+ let [fe, pe] = m(C ?? !1);
4280
4269
  c(() => {
4281
- C !== void 0 && me(C);
4270
+ C !== void 0 && pe(C);
4282
4271
  }, [C]);
4283
- let q = p(null), he = p(null), J = p(null), Y = p(null), X = p(null), Z = f(() => ir(), []), ge = f(() => rr(), []), _e = f(() => oe ?? (h ? gr : hr), [oe, h]), ve = typeof L == "string" ? L : L === void 0 ? void 0 : String(L), ye = typeof R == "string" ? R : R === void 0 ? void 0 : String(R), be = f(() => {
4284
- let e = or(T, g, l, h, ce, Z, E);
4272
+ let J = p(null), me = p(null), he = p(null), Y = p(null), X = p(null), Z = f(() => ir(), []), ge = f(() => rr(), []), _e = f(() => ae ?? (h ? gr : hr), [ae, h]), ve = typeof R == "string" ? R : R === void 0 ? void 0 : String(R), ye = typeof z == "string" ? z : z === void 0 ? void 0 : String(z), be = f(() => {
4273
+ let e = or(T, g, l, h, se, Z, E);
4285
4274
  return Object.entries(e).filter(([, e]) => e).map(([e]) => e).join(" ");
4286
4275
  }, [
4287
4276
  T,
4288
4277
  g,
4289
4278
  l,
4290
4279
  h,
4291
- ce,
4280
+ se,
4292
4281
  Z,
4293
4282
  E
4294
4283
  ]), xe = Object.entries(sr(E)).filter(([, e]) => e).map(([e]) => e).join(" "), Se = f(() => {
@@ -4297,39 +4286,39 @@ function vr(e, t) {
4297
4286
  }, [g]), Ce = f(() => ["pkt-datepicker__inputs", h && "pkt-input__range-inputs"].filter(Boolean).join(" "), [h, g]), we = f(() => {
4298
4287
  if (x) return x;
4299
4288
  if (ye) return ye.slice(0, 7);
4300
- }, [x, ye]), Te = se || l && d != null && K.length >= d, Ee = O ?? (l && d != null), De = `${n}-input`, Oe = K.join(",");
4289
+ }, [x, ye]), Te = oe || l && d != null && q.length >= d, Ee = O ?? (l && d != null), De = `${n}-input`, Oe = q.join(",");
4301
4290
  c(() => {
4302
- J.current && (J.current.value = Oe);
4291
+ he.current && (he.current.value = Oe);
4303
4292
  }, [Oe]), c(() => {
4304
4293
  w && typeof window < "u" && w !== window.pktTz && (window.pktTz = w);
4305
4294
  }, [w]);
4306
4295
  let Q = o((e, t = !0) => {
4307
- U || de(e), t && B?.(e);
4308
- }, [U, B]), ke = f(() => Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set, []), Ae = o((e) => {
4309
- let t = J.current;
4296
+ W || ue(e), t && V?.(e);
4297
+ }, [W, V]), ke = f(() => Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set, []), Ae = o((e) => {
4298
+ let t = he.current;
4310
4299
  !t || !ke || (ke.call(t, e.join(",")), t.dispatchEvent(new Event("input", { bubbles: !0 })));
4311
4300
  }, [ke]), je = o(() => {
4312
- se || me((e) => !e);
4313
- }, [se]), Me = o(() => {
4314
- me(!1);
4301
+ oe || pe((e) => !e);
4302
+ }, [oe]), Me = o(() => {
4303
+ pe(!1);
4315
4304
  }, []);
4316
4305
  c(() => {
4317
- if (!pe) return;
4306
+ if (!fe) return;
4318
4307
  let e = (e) => {
4319
4308
  let t = e.target;
4320
4309
  X.current && !X.current.contains(t) && !t.closest?.(".pkt-calendar-popup") && Me();
4321
4310
  }, t = (e) => {
4322
- e.key === "Escape" && (Me(), q.current?.focus());
4311
+ e.key === "Escape" && (Me(), J.current?.focus());
4323
4312
  };
4324
4313
  return document.addEventListener("click", e, !0), document.addEventListener("keydown", t), () => {
4325
4314
  document.removeEventListener("click", e, !0), document.removeEventListener("keydown", t);
4326
4315
  };
4327
- }, [pe, Me]);
4316
+ }, [fe, Me]);
4328
4317
  let Ne = o(() => {
4329
- ge && !pe && me(!0);
4330
- }, [ge, pe]), Pe = o((e) => {
4318
+ ge && !fe && pe(!0);
4319
+ }, [ge, fe]), Pe = o((e) => {
4331
4320
  let t = _r(lr(e, l, h));
4332
- Q(t), Ae(t), !l && !h && (Me(), q.current?.focus());
4321
+ Q(t), Ae(t), !l && !h && (Me(), J.current?.focus());
4333
4322
  }, [
4334
4323
  l,
4335
4324
  h,
@@ -4337,38 +4326,38 @@ function vr(e, t) {
4337
4326
  Ae,
4338
4327
  Me
4339
4328
  ]), Fe = o(() => {
4340
- Me(), q.current?.focus();
4329
+ Me(), J.current?.focus();
4341
4330
  }, [Me]), Ie = o((e) => {
4342
4331
  let t = e.target.value, n = t ? [t] : [];
4343
4332
  Q(n), Ae(n);
4344
4333
  }, [Q, Ae]), Le = o((e) => {
4345
- let t = [e.target.value, K[1] ?? ""].filter(Boolean);
4334
+ let t = [e.target.value, q[1] ?? ""].filter(Boolean);
4346
4335
  Q(t), Ae(t);
4347
4336
  }, [
4348
- K,
4337
+ q,
4349
4338
  Q,
4350
4339
  Ae
4351
4340
  ]), Re = o((e) => {
4352
- let t = [K[0] ?? "", e.target.value].filter(Boolean);
4341
+ let t = [q[0] ?? "", e.target.value].filter(Boolean);
4353
4342
  Q(t), Ae(t);
4354
4343
  }, [
4355
- K,
4344
+ q,
4356
4345
  Q,
4357
4346
  Ae
4358
4347
  ]), $ = o(() => {
4359
- K.length === 2 && !ar(K) && (Q([K[0]]), Ae([K[0]]));
4348
+ q.length === 2 && !ar(q) && (Q([q[0]]), Ae([q[0]]));
4360
4349
  }, [
4361
- K,
4350
+ q,
4362
4351
  Q,
4363
4352
  Ae
4364
4353
  ]), ze = o((e) => {
4365
4354
  let t = kt(e), n = ve ? kt(ve) : null, r = ye ? kt(ye) : null;
4366
4355
  if (t && !isNaN(t.getTime()) && (!n || t >= n) && (!r || t <= r)) {
4367
- let t = zt([...K, e], ve, ye, y, b), n = [...new Set(t)];
4356
+ let t = zt([...q, e], ve, ye, y, b), n = [...new Set(t)];
4368
4357
  Q(n), Ae(n);
4369
4358
  }
4370
4359
  }, [
4371
- K,
4360
+ q,
4372
4361
  ve,
4373
4362
  ye,
4374
4363
  y,
@@ -4382,23 +4371,23 @@ function vr(e, t) {
4382
4371
  let t = e.target;
4383
4372
  t.value &&= (ze(t.value.split(",")[0]), "");
4384
4373
  }, [ze]), He = o((e) => {
4385
- let t = K.filter((t) => t !== e);
4374
+ let t = q.filter((t) => t !== e);
4386
4375
  Q(t), Ae(t);
4387
4376
  }, [
4388
- K,
4377
+ q,
4389
4378
  Q,
4390
4379
  Ae
4391
4380
  ]), Ue = o((e) => {
4392
4381
  let t = e?.closest("form");
4393
4382
  t ? t.requestSubmit() : e?.blur();
4394
4383
  }, []), We = o((e) => {
4395
- dr(e.nativeEvent, () => je(), () => Ue(q.current), void 0, () => q.current?.blur());
4384
+ dr(e.nativeEvent, () => je(), () => Ue(J.current), void 0, () => J.current?.blur());
4396
4385
  }, [je, Ue]), Ge = o((e) => {
4397
- dr(e.nativeEvent, () => je(), () => Ue(q.current), () => he.current?.focus(), () => q.current?.blur());
4386
+ dr(e.nativeEvent, () => je(), () => Ue(J.current), () => me.current?.focus(), () => J.current?.blur());
4398
4387
  }, [je, Ue]), Ke = o((e) => {
4399
- dr(e.nativeEvent, () => je(), () => Ue(he.current), void 0, () => he.current?.blur());
4388
+ dr(e.nativeEvent, () => je(), () => Ue(me.current), void 0, () => me.current?.blur());
4400
4389
  }, [je, Ue]), qe = o((e) => {
4401
- dr(e.nativeEvent, () => je(), () => Ue(q.current), void 0, () => q.current?.blur(), Ve);
4390
+ dr(e.nativeEvent, () => je(), () => Ue(J.current), void 0, () => J.current?.blur(), Ve);
4402
4391
  }, [
4403
4392
  je,
4404
4393
  Ue,
@@ -4409,29 +4398,30 @@ function vr(e, t) {
4409
4398
  if (!e) return;
4410
4399
  let t = () => {
4411
4400
  window.setTimeout(() => {
4412
- de(fe.current), me(!1), J.current && (J.current.value = fe.current.join(","));
4401
+ ue(de.current), pe(!1), he.current && (he.current.value = de.current.join(","));
4413
4402
  }, 0);
4414
4403
  };
4415
4404
  return e.addEventListener("reset", t), () => e.removeEventListener("reset", t);
4416
4405
  }, []), u(t, () => ({
4417
4406
  get value() {
4418
- return J.current?.value ?? "";
4407
+ return he.current?.value ?? "";
4419
4408
  },
4420
4409
  set value(e) {
4421
- de(e ? e.split(",").filter(Boolean) : []), J.current && (J.current.value = e ?? "");
4410
+ let t = e ? e.split(",").filter(Boolean) : [];
4411
+ ue(t), he.current && (he.current.value = e ?? "");
4422
4412
  },
4423
4413
  focus() {
4424
- q.current?.focus();
4414
+ J.current?.focus();
4425
4415
  },
4426
4416
  blur() {
4427
- q.current?.blur();
4417
+ J.current?.blur();
4428
4418
  }
4429
4419
  }), []), {
4430
4420
  id: n,
4431
4421
  inputId: De,
4432
4422
  label: r,
4433
- values: K,
4434
- calendarOpen: pe,
4423
+ values: q,
4424
+ calendarOpen: fe,
4435
4425
  dateformat: s,
4436
4426
  multiple: l,
4437
4427
  maxlength: d,
@@ -4441,11 +4431,11 @@ function vr(e, t) {
4441
4431
  withcontrols: v,
4442
4432
  excludedates: y,
4443
4433
  excludeweekdays: b,
4444
- disabled: se,
4445
- readOnly: ce,
4446
- required: F,
4447
- name: I,
4448
- placeholder: le,
4434
+ disabled: oe,
4435
+ readOnly: se,
4436
+ required: I,
4437
+ name: L,
4438
+ placeholder: ce,
4449
4439
  fullwidth: T,
4450
4440
  inputSize: E,
4451
4441
  hasFieldset: D,
@@ -4454,14 +4444,14 @@ function vr(e, t) {
4454
4444
  helptextDropdown: j,
4455
4445
  helptextDropdownButton: M,
4456
4446
  hasError: N,
4457
- errorMessage: ee,
4458
- optionalTag: te,
4459
- optionalText: ne,
4460
- requiredTag: P,
4461
- requiredText: re,
4462
- tagText: ie,
4463
- useWrapper: ae,
4464
- className: ue,
4447
+ errorMessage: P,
4448
+ optionalTag: ee,
4449
+ optionalText: te,
4450
+ requiredTag: F,
4451
+ requiredText: ne,
4452
+ tagText: re,
4453
+ useWrapper: ie,
4454
+ className: le,
4465
4455
  minStr: ve,
4466
4456
  maxStr: ye,
4467
4457
  effectiveCurrentMonth: we,
@@ -4475,12 +4465,12 @@ function vr(e, t) {
4475
4465
  datepickerInputsClasses: Ce,
4476
4466
  isInputDisabled: Te,
4477
4467
  hasCounter: Ee,
4478
- inputRef: q,
4479
- inputRefTo: he,
4480
- changeInputRef: J,
4468
+ inputRef: J,
4469
+ inputRefTo: me,
4470
+ changeInputRef: he,
4481
4471
  btnRef: Y,
4482
4472
  wrapperRef: X,
4483
- onChange: z,
4473
+ onChange: B,
4484
4474
  toggleCalendar: je,
4485
4475
  hideCalendar: Me,
4486
4476
  handleDateSelected: Pe,
@@ -4496,20 +4486,20 @@ function vr(e, t) {
4496
4486
  handleRangeFromKeydown: Ge,
4497
4487
  handleRangeToKeydown: Ke,
4498
4488
  handleMultipleKeydown: qe,
4499
- restProps: V
4489
+ restProps: H
4500
4490
  };
4501
4491
  }
4502
4492
  //#endregion
4503
4493
  //#region src/components/datepicker/Datepicker.tsx
4504
4494
  var yr = i((e, t) => {
4505
- let n = vr(e, t);
4495
+ let n = vr(e, t), r = [
4496
+ "pkt-datepicker",
4497
+ `pkt-datepicker--${n.inputSize}`,
4498
+ n.fullwidth ? "pkt-datepicker--fullwidth" : "",
4499
+ n.className
4500
+ ].filter(Boolean).join(" ");
4506
4501
  return /* @__PURE__ */ _("div", {
4507
- className: [
4508
- "pkt-datepicker",
4509
- `pkt-datepicker--${n.inputSize}`,
4510
- n.fullwidth ? "pkt-datepicker--fullwidth" : "",
4511
- n.className
4512
- ].filter(Boolean).join(" "),
4502
+ className: r,
4513
4503
  id: n.id || void 0,
4514
4504
  children: [
4515
4505
  /* @__PURE__ */ g(Tn, {
@@ -4625,7 +4615,7 @@ function wr(e) {
4625
4615
  }
4626
4616
  }
4627
4617
  function Tr(e) {
4628
- return e < 1024 ? `${Math.round(e)} B` : e < 1024 * 1024 ? `${Math.round(e / 1024)} KB` : e < 1024 * 1024 * 1024 ? `${Math.round(e / (1024 * 1024))} MB` : `${Math.round(e / (1024 * 1024 * 1024))} GB`;
4618
+ return e < 1024 ? `${Math.round(e)} B` : e < 1048576 ? `${Math.round(e / 1024)} KB` : e < 1073741824 ? `${Math.round(e / 1048576)} MB` : `${Math.round(e / 1073741824)} GB`;
4629
4619
  }
4630
4620
  //#endregion
4631
4621
  //#region ../../shared-utils/fileupload/formats.ts
@@ -4853,22 +4843,22 @@ var qr = () => ("00000000000000000" + (Math.random() * 0x10000000000000000).toSt
4853
4843
  O(Array.from(t));
4854
4844
  }, A = (e) => {
4855
4845
  O(e);
4856
- };
4846
+ }, M = (e) => {
4847
+ if (e.preventDefault(), T(!1), d) return;
4848
+ let t = e.dataTransfer.files, n = Array.from(t);
4849
+ A(n);
4850
+ }, N = (e) => {
4851
+ e.preventDefault(), !d && T(!0);
4852
+ }, P = () => {
4853
+ T(!1);
4854
+ }, ee = o((e) => {
4855
+ d || e.target.closest(".pkt-fileupload__drop-zone__placeholder__title__open-file-dialog") || x.current?.click();
4856
+ }, [d]);
4857
4857
  return /* @__PURE__ */ _("div", {
4858
- onDrop: (e) => {
4859
- if (e.preventDefault(), T(!1), d) return;
4860
- let t = e.dataTransfer.files;
4861
- A(Array.from(t));
4862
- },
4863
- onDragOver: (e) => {
4864
- e.preventDefault(), !d && T(!0);
4865
- },
4866
- onDragLeave: () => {
4867
- T(!1);
4868
- },
4869
- onClick: o((e) => {
4870
- d || e.target.closest(".pkt-fileupload__drop-zone__placeholder__title__open-file-dialog") || x.current?.click();
4871
- }, [d]),
4858
+ onDrop: M,
4859
+ onDragOver: N,
4860
+ onDragLeave: P,
4861
+ onClick: ee,
4872
4862
  className: (0, j.default)("pkt-fileupload__drop-zone", {
4873
4863
  "pkt-fileupload__drop-zone--drag-active": w,
4874
4864
  "pkt-fileupload__drop-zone--disabled": d
@@ -4894,7 +4884,7 @@ var qr = () => ("00000000000000000" + (Math.random() * 0x10000000000000000).toSt
4894
4884
  /* @__PURE__ */ _("div", {
4895
4885
  className: "pkt-fileupload__drop-zone__placeholder",
4896
4886
  children: [
4897
- /* @__PURE__ */ g(F, {
4887
+ /* @__PURE__ */ g(I, {
4898
4888
  name: "attachment",
4899
4889
  className: "pkt-fileupload__drop-zone__placeholder__icon",
4900
4890
  "aria-hidden": "true"
@@ -4930,23 +4920,23 @@ var qr = () => ("00000000000000000" + (Math.random() * 0x10000000000000000).toSt
4930
4920
  let t = new DataTransfer();
4931
4921
  for (let n of e) t.items.add(n.file);
4932
4922
  return t.files;
4933
- }, $r = i(({ id: e, ariaDescribedby: t, ariaLabelledby: n, counter: r, hasFieldset: i, counterMaxLength: a, className: o, disabled: s, errorMessage: l, hasError: u, helptext: d, helptextDropdown: f, helptextDropdownButton: p, inline: h, fullwidth: _ = !1, label: v, name: y, optionalTag: b = !1, optionalText: x, requiredTag: S = !1, requiredText: C, tagText: w = null, placeholder: T, rows: E, useWrapper: D = !0, onChange: O, value: k, autoComplete: A = "off", minLength: j, maxLength: M, readOnly: N, skipForwardTestid: ee = !1, inputSize: te = "medium", ...ne }, P) => {
4934
- let re = r ?? (a ?? 0) > 0, ie = [
4923
+ }, $r = i(({ id: e, ariaDescribedby: t, ariaLabelledby: n, counter: r, hasFieldset: i, counterMaxLength: a, className: o, disabled: s, errorMessage: l, hasError: u, helptext: d, helptextDropdown: f, helptextDropdownButton: p, inline: h, fullwidth: _ = !1, label: v, name: y, optionalTag: b = !1, optionalText: x, requiredTag: S = !1, requiredText: C, tagText: w = null, placeholder: T, rows: E, useWrapper: D = !0, onChange: O, value: k, autoComplete: A = "off", minLength: j, maxLength: M, readOnly: N, skipForwardTestid: P = !1, inputSize: ee = "medium", ...te }, F) => {
4924
+ let ne = r ?? (a ?? 0) > 0, re = [
4935
4925
  o,
4936
4926
  "pkt-textinput",
4937
4927
  "pkt-textarea"
4938
- ].filter(Boolean).join(" "), ae = `${e}-input`, oe = `${ae}-label`, se = n || oe, [ce, F] = m(0), I = (e) => {
4939
- re && F(e.currentTarget?.value?.length || 0), O && O(e);
4928
+ ].filter(Boolean).join(" "), ie = `${e}-input`, ae = `${ie}-label`, oe = n || ae, [se, I] = m(0), L = (e) => {
4929
+ ne && I(e.currentTarget?.value?.length || 0), O && O(e);
4940
4930
  };
4941
4931
  return c(() => {
4942
- k !== void 0 && F(k?.length || 0);
4932
+ k !== void 0 && I(k?.length || 0);
4943
4933
  }, [k]), /* @__PURE__ */ g("div", {
4944
- className: ie,
4934
+ className: re,
4945
4935
  children: /* @__PURE__ */ g(Tn, {
4946
4936
  ariaDescribedby: t,
4947
4937
  disabled: s,
4948
4938
  errorMessage: l,
4949
- forId: ae,
4939
+ forId: ie,
4950
4940
  hasError: u,
4951
4941
  helptext: d,
4952
4942
  helptextDropdown: f,
@@ -4959,38 +4949,38 @@ var qr = () => ("00000000000000000" + (Math.random() * 0x10000000000000000).toSt
4959
4949
  requiredText: C,
4960
4950
  tagText: w,
4961
4951
  useWrapper: D,
4962
- counter: re,
4963
- counterCurrent: ce,
4952
+ counter: ne,
4953
+ counterCurrent: se,
4964
4954
  counterMaxLength: a,
4965
4955
  hasFieldset: i ?? !1,
4966
- size: te,
4956
+ size: ee,
4967
4957
  children: /* @__PURE__ */ g("textarea", {
4968
4958
  ref: (e) => {
4969
- F(e?.value?.length || 0), typeof P == "function" && P(e);
4959
+ I(e?.value?.length || 0), typeof F == "function" && F(e);
4970
4960
  },
4971
- className: `pkt-input pkt-input--${te} ${_ ? "pkt-input--fullwidth" : ""} ${a && ce > a ? "pkt-input--counter-error" : ""}`,
4961
+ className: `pkt-input pkt-input--${ee} ${_ ? "pkt-input--fullwidth" : ""} ${a && se > a ? "pkt-input--counter-error" : ""}`,
4972
4962
  name: `${y || e}`,
4973
- id: ae,
4963
+ id: ie,
4974
4964
  placeholder: T,
4975
4965
  disabled: s,
4976
4966
  rows: E,
4977
- "aria-labelledby": se,
4967
+ "aria-labelledby": oe,
4978
4968
  "aria-invalid": u,
4979
4969
  "aria-errormessage": u ? `${e}-error` : void 0,
4980
4970
  "aria-describedby": yn({
4981
- id: ae,
4971
+ id: ie,
4982
4972
  hasHelptext: !!d,
4983
- hasCounter: re,
4973
+ hasCounter: ne,
4984
4974
  ariaDescribedby: t
4985
4975
  }),
4986
- ...ne,
4987
- onChange: I,
4976
+ ...te,
4977
+ onChange: L,
4988
4978
  value: k,
4989
4979
  autoComplete: A,
4990
4980
  minLength: j,
4991
4981
  maxLength: M,
4992
4982
  readOnly: N,
4993
- "data-skip-forward-testid": ee ? "true" : void 0
4983
+ "data-skip-forward-testid": P ? "true" : void 0
4994
4984
  })
4995
4985
  })
4996
4986
  });
@@ -5019,7 +5009,7 @@ var ei = "comments", ti = (e) => {
5019
5009
  disabled: t,
5020
5010
  defaultValue: i?.text
5021
5011
  }),
5022
- /* @__PURE__ */ g(L, {
5012
+ /* @__PURE__ */ g(R, {
5023
5013
  skin: "secondary",
5024
5014
  size: "small",
5025
5015
  disabled: t,
@@ -5032,7 +5022,7 @@ var ei = "comments", ti = (e) => {
5032
5022
  },
5033
5023
  children: o ? "Lagre kommentar" : "Legg til kommentar"
5034
5024
  }),
5035
- /* @__PURE__ */ g(L, {
5025
+ /* @__PURE__ */ g(R, {
5036
5026
  skin: "tertiary",
5037
5027
  size: "small",
5038
5028
  disabled: t,
@@ -5062,22 +5052,25 @@ var ei = "comments", ti = (e) => {
5062
5052
  onClick: r,
5063
5053
  disabled: t,
5064
5054
  "aria-label": "Rediger kommentar",
5065
- children: /* @__PURE__ */ g(F, { name: "edit" })
5055
+ children: /* @__PURE__ */ g(I, { name: "edit" })
5066
5056
  }), /* @__PURE__ */ g("button", {
5067
5057
  type: "button",
5068
5058
  className: "pkt-fileupload__queue-display__item__comment__action",
5069
5059
  onClick: n,
5070
5060
  disabled: t,
5071
5061
  "aria-label": "Slett kommentar",
5072
- children: /* @__PURE__ */ g(F, { name: "trash-can" })
5062
+ children: /* @__PURE__ */ g(I, { name: "trash-can" })
5073
5063
  })]
5074
5064
  })]
5075
5065
  })
5076
- }), ii = ({ comments: e }) => /* @__PURE__ */ g("input", {
5077
- type: "hidden",
5078
- name: `${s(Xr).name}-comments`,
5079
- value: e ? JSON.stringify(e) : ""
5080
- }), ai = (e) => e.getAttribute(ei) ?? [], oi = {
5066
+ }), ii = ({ comments: e }) => {
5067
+ let t = s(Xr);
5068
+ return /* @__PURE__ */ g("input", {
5069
+ type: "hidden",
5070
+ name: `${t.name}-comments`,
5071
+ value: e ? JSON.stringify(e) : ""
5072
+ });
5073
+ }, ai = (e) => e.getAttribute(ei) ?? [], oi = {
5081
5074
  id: "comment",
5082
5075
  title: (e) => (e.attributes?.[ei] ?? []).length > 0 ? "" : "Legg til kommentar",
5083
5076
  ariaLabel: "Legg til kommentar",
@@ -5129,14 +5122,14 @@ var ei = "comments", ti = (e) => {
5129
5122
  e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), o()), e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), r());
5130
5123
  }
5131
5124
  }),
5132
- /* @__PURE__ */ g(L, {
5125
+ /* @__PURE__ */ g(R, {
5133
5126
  skin: "secondary",
5134
5127
  size: "small",
5135
5128
  disabled: t,
5136
5129
  onClick: o,
5137
5130
  children: "Lagre"
5138
5131
  }),
5139
- /* @__PURE__ */ g(L, {
5132
+ /* @__PURE__ */ g(R, {
5140
5133
  skin: "tertiary",
5141
5134
  size: "small",
5142
5135
  disabled: t,
@@ -5144,11 +5137,14 @@ var ei = "comments", ti = (e) => {
5144
5137
  children: "Avbryt"
5145
5138
  })
5146
5139
  ] });
5147
- }, li = ({ targetFilename: e }) => /* @__PURE__ */ g("input", {
5148
- type: "hidden",
5149
- name: `${s(Xr).name}-targetFilename`,
5150
- value: e
5151
- }), ui = (e) => e.getAttribute("targetFilename") || Kr(e.file, ""), di = {
5140
+ }, li = ({ targetFilename: e }) => {
5141
+ let t = s(Xr);
5142
+ return /* @__PURE__ */ g("input", {
5143
+ type: "hidden",
5144
+ name: `${t.name}-targetFilename`,
5145
+ value: e
5146
+ });
5147
+ }, ui = (e) => e.getAttribute("targetFilename") || Kr(e.file, ""), di = {
5152
5148
  id: "rename",
5153
5149
  title: "Rediger",
5154
5150
  ariaLabel: "Rediger filnavn",
@@ -5365,7 +5361,7 @@ var yi = "is-scroll-locked", bi = 0, xi = 0, Si = () => typeof document < "u" &&
5365
5361
  }) : /* @__PURE__ */ g("div", { className: "pkt-modal__headingText" }),
5366
5362
  i ? /* @__PURE__ */ g("div", { className: "pkt-modal__noCloseButton" }) : /* @__PURE__ */ g("div", {
5367
5363
  className: (0, j.default)("pkt-modal__closeButton", { [`pkt-modal__closeButton--${u}`]: !0 }),
5368
- children: /* @__PURE__ */ g(L, {
5364
+ children: /* @__PURE__ */ g(R, {
5369
5365
  onClick: C,
5370
5366
  "aria-label": "close",
5371
5367
  iconName: "close",
@@ -5418,7 +5414,7 @@ var Ai = n({ tail: 5 }), ji = ({ children: e, tail: t }) => {
5418
5414
  }), Pi = ({ cancelTransfer: e, transferItem: t, disabled: n = !1 }) => {
5419
5415
  let r = t.showProgress ?? t.progress !== 0;
5420
5416
  return /* @__PURE__ */ _(h, { children: [
5421
- /* @__PURE__ */ g(F, {
5417
+ /* @__PURE__ */ g(I, {
5422
5418
  name: "document-text",
5423
5419
  className: "pkt-fileupload__queue-display__item__icon pkt-icon--medium",
5424
5420
  "aria-hidden": "true"
@@ -5466,7 +5462,7 @@ var Ai = n({ tail: 5 }), ji = ({ children: e, tail: t }) => {
5466
5462
  }), Ii = ({ transferItem: e, onRemove: t, disabled: n }) => {
5467
5463
  let r = (e.lastProgress ?? 1) * 100;
5468
5464
  return /* @__PURE__ */ _(h, { children: [
5469
- /* @__PURE__ */ g(F, {
5465
+ /* @__PURE__ */ g(I, {
5470
5466
  className: "pkt-fileupload__queue-display__item__icon pkt-icon--medium",
5471
5467
  name: "alert-error",
5472
5468
  "aria-hidden": "true"
@@ -5491,7 +5487,7 @@ var Ai = n({ tail: 5 }), ji = ({ children: e, tail: t }) => {
5491
5487
  })
5492
5488
  ] });
5493
5489
  }, Li = ({ transferItem: e, onRemove: t, disabled: n }) => /* @__PURE__ */ _(h, { children: [
5494
- /* @__PURE__ */ g(F, {
5490
+ /* @__PURE__ */ g(I, {
5495
5491
  className: "pkt-fileupload__queue-display__item__icon pkt-icon--medium",
5496
5492
  name: "alert-error",
5497
5493
  "aria-hidden": "true"
@@ -5527,7 +5523,7 @@ var Ai = n({ tail: 5 }), ji = ({ children: e, tail: t }) => {
5527
5523
  "aria-label": typeof e.ariaLabel == "function" ? e.ariaLabel(t.file) : e.ariaLabel,
5528
5524
  children: n
5529
5525
  }) : null;
5530
- }, Bi = ({ transferItem: e }) => /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(F, {
5526
+ }, Bi = ({ transferItem: e }) => /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(I, {
5531
5527
  name: "document-text",
5532
5528
  className: "pkt-fileupload__queue-display__item__icon pkt-icon--medium",
5533
5529
  "aria-hidden": "true"
@@ -5546,19 +5542,19 @@ var Ai = n({ tail: 5 }), ji = ({ children: e, tail: t }) => {
5546
5542
  src: n,
5547
5543
  alt: e.attributes.targetFilename,
5548
5544
  onError: () => a(!0)
5549
- }) || /* @__PURE__ */ g(F, {
5545
+ }) || /* @__PURE__ */ g(I, {
5550
5546
  name: "document-text",
5551
5547
  className: "pkt-fileupload__queue-display__item__icon pkt-icon--medium"
5552
5548
  }), l = !!t;
5553
5549
  return /* @__PURE__ */ _("div", {
5554
5550
  className: `pkt-fileupload__queue-display__item__thumbnail${n && !i ? "" : " pkt-fileupload__queue-display__item__thumbnail--fallback"}`,
5555
- children: [/* @__PURE__ */ _(L, {
5551
+ children: [/* @__PURE__ */ _(R, {
5556
5552
  className: "pkt-fileupload__queue-display__item__thumbnail__image-wrapper",
5557
5553
  "aria-label": `Forhåndsvis bilde ${e.attributes.targetFilename}`,
5558
5554
  type: "button",
5559
5555
  skin: "secondary",
5560
5556
  onClick: t,
5561
- children: [l && /* @__PURE__ */ g(F, {
5557
+ children: [l && /* @__PURE__ */ g(I, {
5562
5558
  name: "expand",
5563
5559
  className: "pkt-fileupload__queue-display__item__thumbnail__expand-icon",
5564
5560
  "aria-hidden": "true"
@@ -5590,9 +5586,7 @@ var Ai = n({ tail: 5 }), ji = ({ children: e, tail: t }) => {
5590
5586
  case "ArrowRight":
5591
5587
  e.preventDefault(), i("next");
5592
5588
  break;
5593
- case "Escape":
5594
- e.preventDefault(), r();
5595
- break;
5589
+ case "Escape": e.preventDefault(), r();
5596
5590
  }
5597
5591
  };
5598
5592
  return window.addEventListener("keydown", t), () => window.removeEventListener("keydown", t);
@@ -5610,7 +5604,7 @@ var Ai = n({ tail: 5 }), ji = ({ children: e, tail: t }) => {
5610
5604
  children: /* @__PURE__ */ _("div", {
5611
5605
  className: "pkt-fileupload__image-preview",
5612
5606
  children: [
5613
- f && /* @__PURE__ */ g(L, {
5607
+ f && /* @__PURE__ */ g(R, {
5614
5608
  variant: "icon-only",
5615
5609
  iconName: "chevron-thin-left",
5616
5610
  skin: "secondary",
@@ -5626,7 +5620,7 @@ var Ai = n({ tail: 5 }), ji = ({ children: e, tail: t }) => {
5626
5620
  alt: `${d.attributes.targetFilename} - ${n + 1} av ${t.length}`,
5627
5621
  className: "pkt-fileupload__image-preview__image",
5628
5622
  onError: () => u(!0)
5629
- }) : /* @__PURE__ */ g(F, {
5623
+ }) : /* @__PURE__ */ g(I, {
5630
5624
  name: "picture",
5631
5625
  className: "pkt-fileupload__queue-display__item__icon pkt-icon--medium"
5632
5626
  })
@@ -5639,7 +5633,7 @@ var Ai = n({ tail: 5 }), ji = ({ children: e, tail: t }) => {
5639
5633
  t.length
5640
5634
  ]
5641
5635
  }),
5642
- f && /* @__PURE__ */ g(L, {
5636
+ f && /* @__PURE__ */ g(R, {
5643
5637
  variant: "icon-only",
5644
5638
  iconName: "chevron-thin-right",
5645
5639
  skin: "secondary",
@@ -5669,22 +5663,28 @@ var Ai = n({ tail: 5 }), ji = ({ children: e, tail: t }) => {
5669
5663
  operation: e,
5670
5664
  ...t
5671
5665
  })
5672
- })), Gi = (e) => /* @__PURE__ */ g("div", {
5673
- className: "pkt-fileupload__queue-display__item__actions",
5674
- children: Wi(e.operations, e).filter(({ operation: t }) => t.id !== e.activatedOperation?.id).map(({ operation: e, context: t }) => /* @__PURE__ */ g(zi, {
5675
- operation: e,
5676
- context: t
5677
- }, e.id))
5678
- }), Ki = (e) => /* @__PURE__ */ g(h, { children: Wi(e.operations, e).filter(({ operation: e }) => e.renderContent).map(({ operation: e, context: t }) => /* @__PURE__ */ g("div", {
5679
- className: "pkt-fileupload__queue-display__item__operation-content",
5680
- children: e.renderContent(t)
5681
- }, e.id)) }), qi = (e) => {
5666
+ })), Gi = (e) => {
5667
+ let t = Wi(e.operations, e);
5668
+ return /* @__PURE__ */ g("div", {
5669
+ className: "pkt-fileupload__queue-display__item__actions",
5670
+ children: t.filter(({ operation: t }) => t.id !== e.activatedOperation?.id).map(({ operation: e, context: t }) => /* @__PURE__ */ g(zi, {
5671
+ operation: e,
5672
+ context: t
5673
+ }, e.id))
5674
+ });
5675
+ }, Ki = (e) => {
5676
+ let t = Wi(e.operations, e);
5677
+ return /* @__PURE__ */ g(h, { children: t.filter(({ operation: e }) => e.renderContent).map(({ operation: e, context: t }) => /* @__PURE__ */ g("div", {
5678
+ className: "pkt-fileupload__queue-display__item__operation-content",
5679
+ children: e.renderContent(t)
5680
+ }, e.id)) });
5681
+ }, qi = (e) => {
5682
5682
  let { transferItem: t, activatedOperation: n, operations: r, ItemRenderer: i, onPreviewClick: a } = e, o = n ? Ui({
5683
5683
  operation: n,
5684
5684
  ...e
5685
5685
  }) : void 0, s = n?.renderInlineUI || n?.renderExtendedUI ? [] : r;
5686
5686
  return /* @__PURE__ */ _(h, { children: [
5687
- n?.renderInlineUI && o ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(F, {
5687
+ n?.renderInlineUI && o ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(I, {
5688
5688
  name: "document-text",
5689
5689
  className: "pkt-fileupload__queue-display__item__icon"
5690
5690
  }), /* @__PURE__ */ g("div", {
@@ -5773,20 +5773,20 @@ var Ai = n({ tail: 5 }), ji = ({ children: e, tail: t }) => {
5773
5773
  }, Qi = {
5774
5774
  filename: Bi,
5775
5775
  thumbnail: Vi
5776
- }, $i = i(({ value: e, defaultValue: t, id: n, multiple: r = !1, uploadStrategy: i = "form", addCommentsEnabled: a = !1, renameFilesEnabled: s = !1, truncateTail: d = 4, onFilesChanged: h, onFileUploadRequested: v, extraOperations: y = [], itemRenderer: b = Qi.filename, fullwidth: x = !1, allowedFormats: S, formatErrorMessage: C, maxFileSize: w, sizeErrorMessage: T, onFileValidation: E, onFileValidate: D, errorMessage: O, hasError: k = !1, disabled: A = !1, label: M, helptext: N, helptextDropdown: ee, helptextDropdownButton: te, optionalTag: ne, optionalText: P, requiredTag: re, requiredText: ie, tagText: ae, required: oe = !1, enableImagePreview: se = !1, "aria-describedby": ce, "aria-invalid": F, ...I }, L) => {
5777
- let le = l(), z = n ?? `pkt-fileupload-${le}`, B = p(null);
5778
- u(L, () => B.current, []);
5779
- let ue = "transfers" in I ? I.transfers : void 0, [V, H] = m(null), [U, W] = m("");
5776
+ }, $i = i(({ value: e, defaultValue: t, id: n, multiple: r = !1, uploadStrategy: i = "form", addCommentsEnabled: a = !1, renameFilesEnabled: s = !1, truncateTail: d = 4, onFilesChanged: h, onFileUploadRequested: v, extraOperations: y = [], itemRenderer: b = Qi.filename, fullwidth: x = !1, allowedFormats: S, formatErrorMessage: C, maxFileSize: w, sizeErrorMessage: T, onFileValidation: E, onFileValidate: D, errorMessage: O, hasError: k = !1, disabled: A = !1, label: M, helptext: N, helptextDropdown: P, helptextDropdownButton: ee, optionalTag: te, optionalText: F, requiredTag: ne, requiredText: re, tagText: ie, required: ae = !1, enableImagePreview: oe = !1, "aria-describedby": se, "aria-invalid": I, ...L }, R) => {
5777
+ let ce = l(), B = n ?? `pkt-fileupload-${ce}`, V = p(null);
5778
+ u(R, () => V.current, []);
5779
+ let le = "transfers" in L ? L.transfers : void 0, [H, U] = m(null), [W, G] = m("");
5780
5780
  c(() => {
5781
- if (!U) return;
5782
- let e = setTimeout(() => W(""), 1500);
5781
+ if (!W) return;
5782
+ let e = setTimeout(() => G(""), 1500);
5783
5783
  return () => clearTimeout(e);
5784
- }, [U]);
5785
- let G = V ?? O ?? null, de = k || !!V || !!(O && O.trim()), K = G ? `${z}-error` : void 0, fe = [
5786
- ce,
5787
- N ? `${z}-helptext` : void 0,
5788
- K
5789
- ].filter(Boolean).join(" ") || void 0, pe = de || F === !0 || F === "true", me = o((e) => {
5784
+ }, [W]);
5785
+ let K = H ?? O ?? null, ue = k || !!H || !!(O && O.trim()), q = K ? `${B}-error` : void 0, de = [
5786
+ se,
5787
+ N ? `${B}-helptext` : void 0,
5788
+ q
5789
+ ].filter(Boolean).join(" ") || void 0, fe = ue || I === !0 || I === "true", pe = o((e) => {
5790
5790
  let t = jr(e, {
5791
5791
  allowedFormats: S,
5792
5792
  maxFileSize: w,
@@ -5812,24 +5812,24 @@ var Ai = n({ tail: 5 }), ji = ({ children: e, tail: t }) => {
5812
5812
  D
5813
5813
  ]);
5814
5814
  e !== void 0 && t !== void 0 && console.warn("PktFileupload: Både value og defaultValue er angitt. Komponenten kan være enten 'controlled' eller 'uncontrolled', ikke begge deler. Bruk kun én av dem. Se https://react.dev/reference/react-dom/components/input#controlling-an-input-with-a-state-variable"), e !== void 0 && h === void 0 && console.warn("PktFileupload: value-prop er angitt uten onFilesChanged-callback. Når en komponent er 'controlled', må endringer håndteres via en callback. Vennligst legg til onFilesChanged-callback for å håndtere endringer i fil-listen. Se https://react.dev/reference/react-dom/components/input#controlling-an-input-with-a-state-variable");
5815
- let q = e !== void 0, [he, J] = m(() => t ?? []), Y = q ? e : he;
5816
- hi(B, {
5815
+ let J = e !== void 0, [me, he] = m(() => t ?? []), Y = J ? e : me;
5816
+ hi(V, {
5817
5817
  uploadStrategy: i,
5818
- required: oe,
5818
+ required: ae,
5819
5819
  currentFileCount: Y.length,
5820
- onMissingFiles: o(() => H(Cr.requiredMissing), [])
5820
+ onMissingFiles: o(() => U(Cr.requiredMissing), [])
5821
5821
  });
5822
- let X = typeof b == "string" ? Qi[b] : b, Z = b === "thumbnail", ge = typeof I.accept == "string" ? I.accept.trim() : void 0, _e = f(() => kr(ge, S) || void 0, [ge, S]), ve = s && !Z, ye = a && !Z, be = o((e) => {
5822
+ let X = typeof b == "string" ? Qi[b] : b, Z = b === "thumbnail", ge = typeof L.accept == "string" ? L.accept.trim() : void 0, _e = f(() => kr(ge, S) || void 0, [ge, S]), ve = s && !Z, ye = a && !Z, be = o((e) => {
5823
5823
  for (let t of e) {
5824
- let e = me(t.file);
5824
+ let e = pe(t.file);
5825
5825
  if (e) {
5826
- H(e);
5826
+ U(e);
5827
5827
  return;
5828
5828
  }
5829
5829
  }
5830
- H(null);
5830
+ U(null);
5831
5831
  let t = r ? [...Y, ...e] : [e[0]], n = r ? e : [e[0]];
5832
- W(n.length === 1 ? Cr.srFileAdded(n[0].attributes.targetFilename) : Cr.srFilesAdded(n.length)), q || J(t), h?.(t), i === "custom" && v && e.forEach((e) => {
5832
+ G(n.length === 1 ? Cr.srFileAdded(n[0].attributes.targetFilename) : Cr.srFilesAdded(n.length)), J || he(t), h?.(t), i === "custom" && v && e.forEach((e) => {
5833
5833
  v?.(e);
5834
5834
  });
5835
5835
  }, [
@@ -5838,26 +5838,26 @@ var Ai = n({ tail: 5 }), ji = ({ children: e, tail: t }) => {
5838
5838
  r,
5839
5839
  i,
5840
5840
  v,
5841
- me,
5842
- q
5841
+ pe,
5842
+ J
5843
5843
  ]), xe = o((e, t) => {
5844
5844
  let n = Y.map((n) => n.fileId === e ? {
5845
5845
  ...n,
5846
5846
  ...t
5847
5847
  } : n);
5848
- q || J(n), h?.(n);
5848
+ J || he(n), h?.(n);
5849
5849
  }, [
5850
5850
  h,
5851
5851
  Y,
5852
- q
5852
+ J
5853
5853
  ]), Se = o((e) => {
5854
5854
  let t = Y.filter((t) => t.fileId !== e);
5855
- q || J(t), h?.(t), "onTransferCancelled" in I && I.onTransferCancelled && I.onTransferCancelled?.(e);
5855
+ J || he(t), h?.(t), "onTransferCancelled" in L && L.onTransferCancelled && L.onTransferCancelled?.(e);
5856
5856
  }, [
5857
5857
  h,
5858
5858
  Y,
5859
- I,
5860
- q
5859
+ L,
5860
+ J
5861
5861
  ]), { buildAttributeAccessors: Ce } = fi(Y, xe), we = f(() => {
5862
5862
  let e = [];
5863
5863
  return ve && e.push(di), ye && e.push(oi), e.push(...y), e.push(si(Se)), e;
@@ -5866,26 +5866,26 @@ var Ai = n({ tail: 5 }), ji = ({ children: e, tail: t }) => {
5866
5866
  ye,
5867
5867
  y,
5868
5868
  Se
5869
- ]), { totalCount: Te, uploadedCount: Ee, failedCount: De } = f(() => Wr(Y, ue), [Y, ue]), Oe = Cr.fileLabel(Te), Q = /* @__PURE__ */ g("div", {
5869
+ ]), { totalCount: Te, uploadedCount: Ee, failedCount: De } = f(() => Wr(Y, le), [Y, le]), Oe = Cr.fileLabel(Te), Q = /* @__PURE__ */ g("div", {
5870
5870
  className: (0, j.default)("pkt-fileupload", {
5871
5871
  "pkt-fileupload--full-width": x,
5872
- "pkt-fileupload--error": de,
5872
+ "pkt-fileupload--error": ue,
5873
5873
  "pkt-fileupload--disabled": A
5874
5874
  }),
5875
5875
  "aria-disabled": A,
5876
5876
  ...A ? { inert: !0 } : {},
5877
5877
  children: /* @__PURE__ */ _(Xr.Provider, {
5878
5878
  value: {
5879
- name: I.name || "",
5879
+ name: L.name || "",
5880
5880
  multiple: !!r,
5881
- id: z
5881
+ id: B
5882
5882
  },
5883
5883
  children: [
5884
5884
  /* @__PURE__ */ g("div", {
5885
5885
  className: "pkt-sr-only",
5886
5886
  "aria-live": "polite",
5887
5887
  "aria-atomic": "true",
5888
- children: U || (Te > 0 && Ee > 0 ? Cr.srFilesUploadedOfTotal(Ee, Te, Oe) : "")
5888
+ children: W || (Te > 0 && Ee > 0 ? Cr.srFilesUploadedOfTotal(Ee, Te, Oe) : "")
5889
5889
  }),
5890
5890
  /* @__PURE__ */ g("div", {
5891
5891
  className: "pkt-sr-only",
@@ -5894,41 +5894,41 @@ var Ai = n({ tail: 5 }), ji = ({ children: e, tail: t }) => {
5894
5894
  children: Te > 0 && De > 0 && Cr.srFilesFailedOfTotal(De, Te, Oe)
5895
5895
  }),
5896
5896
  /* @__PURE__ */ g(Zr, {
5897
- id: z,
5898
- name: I.name || "",
5897
+ id: B,
5898
+ name: L.name || "",
5899
5899
  value: Y,
5900
5900
  onFilesAdded: be,
5901
5901
  multiple: r,
5902
5902
  uploadStrategy: i,
5903
- ref: B,
5903
+ ref: V,
5904
5904
  accept: Z ? Gr : _e,
5905
5905
  isThumbnailView: Z,
5906
5906
  disabled: A,
5907
- required: oe && i === "form",
5908
- "aria-required": oe ? "true" : void 0,
5909
- "aria-invalid": pe ? "true" : void 0,
5910
- "aria-describedby": fe,
5907
+ required: ae && i === "form",
5908
+ "aria-required": ae ? "true" : void 0,
5909
+ "aria-invalid": fe ? "true" : void 0,
5910
+ "aria-describedby": de,
5911
5911
  hasVisibleLabel: !!M
5912
5912
  }),
5913
- de && G && /* @__PURE__ */ g(R, {
5913
+ ue && K && /* @__PURE__ */ g(z, {
5914
5914
  skin: "error",
5915
5915
  "aria-live": "assertive",
5916
5916
  role: "alert",
5917
5917
  compact: !0,
5918
- id: K,
5918
+ id: q,
5919
5919
  className: "pkt-fileupload__error-alert",
5920
- children: G
5920
+ children: K
5921
5921
  }),
5922
5922
  Y.length > 0 && /* @__PURE__ */ g(Zi, {
5923
5923
  files: Y,
5924
5924
  cancelTransfer: Se,
5925
5925
  truncateTail: d,
5926
- transfers: ue,
5926
+ transfers: le,
5927
5927
  uploadStrategy: i,
5928
5928
  ItemRenderer: X,
5929
- enableImagePreview: Z && se,
5929
+ enableImagePreview: Z && oe,
5930
5930
  disabled: A,
5931
- inputName: I.name || "",
5931
+ inputName: L.name || "",
5932
5932
  buildAttributeAccessors: Ce,
5933
5933
  queueItemOperations: we
5934
5934
  })
@@ -5938,18 +5938,18 @@ var Ai = n({ tail: 5 }), ji = ({ children: e, tail: t }) => {
5938
5938
  return M ? /* @__PURE__ */ g("div", {
5939
5939
  className: "pkt-fileupload-component",
5940
5940
  children: /* @__PURE__ */ g(Tn, {
5941
- forId: z,
5941
+ forId: B,
5942
5942
  label: M,
5943
5943
  helptext: N,
5944
- helptextDropdown: ee,
5945
- helptextDropdownButton: te,
5944
+ helptextDropdown: P,
5945
+ helptextDropdownButton: ee,
5946
5946
  disabled: A,
5947
- hasError: de,
5948
- optionalTag: ne,
5949
- optionalText: P,
5950
- requiredTag: re,
5951
- requiredText: ie,
5952
- tagText: ae,
5947
+ hasError: ue,
5948
+ optionalTag: te,
5949
+ optionalText: F,
5950
+ requiredTag: ne,
5951
+ requiredText: re,
5952
+ tagText: ie,
5953
5953
  className: (0, j.default)("pkt-fileupload-wrapper", { "pkt-fileupload-wrapper--full-width": x }),
5954
5954
  children: Q
5955
5955
  })
@@ -6034,7 +6034,7 @@ function ua(e) {
6034
6034
  } catch {
6035
6035
  return;
6036
6036
  }
6037
- if (!(t.protocol !== "http:" && t.protocol !== "https:")) return la(t.hostname.toLowerCase().replace(/\.$/, ""));
6037
+ if (t.protocol === "http:" || t.protocol === "https:") return la(t.hostname.toLowerCase().replace(/\.$/, ""));
6038
6038
  }
6039
6039
  function da(e, t = sa) {
6040
6040
  if (!e) return;
@@ -6133,7 +6133,7 @@ var ya = ({ link: e, includeConsent: t, consent: n }) => {
6133
6133
  className: "pkt-footer__some-link",
6134
6134
  href: e.url,
6135
6135
  "aria-label": e.text,
6136
- children: /* @__PURE__ */ g(F, {
6136
+ children: /* @__PURE__ */ g(I, {
6137
6137
  className: "pkt-footer__some-icon",
6138
6138
  name: t
6139
6139
  })
@@ -6234,9 +6234,9 @@ var ya = ({ link: e, includeConsent: t, consent: n }) => {
6234
6234
  cookieSecure: b,
6235
6235
  cookieExpiryDays: x,
6236
6236
  onToggleConsent: S
6237
- }, k = o && p, A = a?.filter((e) => e.language) ?? [], j = a?.filter((e) => e.iconName) ?? [], M = D.length > 0 || k || !!a?.length;
6237
+ }, k = o && p, A = a?.filter((e) => e.language) ?? [], j = a?.filter((e) => e.iconName) ?? [], M = D.length > 0 || k || !!a?.length, N = [w, "pkt-footer"].filter(Boolean).join(" ");
6238
6238
  return /* @__PURE__ */ _("footer", {
6239
- className: [w, "pkt-footer"].filter(Boolean).join(" "),
6239
+ className: N,
6240
6240
  ...T,
6241
6241
  children: [M && /* @__PURE__ */ g("div", {
6242
6242
  className: "pkt-footer__band pkt-footer__band--secondary",
@@ -6276,7 +6276,7 @@ var ya = ({ link: e, includeConsent: t, consent: n }) => {
6276
6276
  "aria-label": `til ${e.iconName}`,
6277
6277
  target: e.openInNewTab || d ? "_blank" : "_self",
6278
6278
  rel: e.openInNewTab || d ? "noopener noreferrer" : void 0,
6279
- children: /* @__PURE__ */ g(F, {
6279
+ children: /* @__PURE__ */ g(I, {
6280
6280
  className: "pkt-footer__some-icon",
6281
6281
  name: e.iconName
6282
6282
  })
@@ -6298,7 +6298,7 @@ var ya = ({ link: e, includeConsent: t, consent: n }) => {
6298
6298
  href: e.href,
6299
6299
  target: n ? "_blank" : "_self",
6300
6300
  rel: n ? "noopener noreferrer" : void 0,
6301
- children: [/* @__PURE__ */ g(F, {
6301
+ children: [/* @__PURE__ */ g(I, {
6302
6302
  className: "pkt-footer-simple__link-icon",
6303
6303
  name: "arrow-link"
6304
6304
  }), /* @__PURE__ */ _("span", { children: [e.text, r && /* @__PURE__ */ _("span", {
@@ -6341,9 +6341,9 @@ var ya = ({ link: e, includeConsent: t, consent: n }) => {
6341
6341
  cookieSecure: h,
6342
6342
  cookieExpiryDays: v,
6343
6343
  onToggleConsent: y
6344
- }, E = r && l, D = w.length > 0 || E;
6344
+ }, E = r && l, D = w.length > 0 || E, O = [x, "pkt-footer-simple"].filter(Boolean).join(" ");
6345
6345
  return /* @__PURE__ */ _("footer", {
6346
- className: [x, "pkt-footer-simple"].filter(Boolean).join(" "),
6346
+ className: O,
6347
6347
  ...S,
6348
6348
  children: [D && /* @__PURE__ */ g("div", {
6349
6349
  className: "pkt-footer__band pkt-footer__band--secondary",
@@ -6510,7 +6510,7 @@ var ja = ({ dataUrl: e = br, data: t, locale: n = "nb-NO", open: r = !1, mobileB
6510
6510
  children: /* @__PURE__ */ _("a", {
6511
6511
  className: "pkt-header-menu__service-link",
6512
6512
  href: e.url,
6513
- children: [/* @__PURE__ */ g(F, {
6513
+ children: [/* @__PURE__ */ g(I, {
6514
6514
  className: "pkt-header-menu__service-icon",
6515
6515
  name: ta(e.icon),
6516
6516
  "aria-hidden": "true"
@@ -6526,13 +6526,13 @@ var ja = ({ dataUrl: e = br, data: t, locale: n = "nb-NO", open: r = !1, mobileB
6526
6526
  className: "pkt-header-menu__sections-inner",
6527
6527
  skin: "plus-minus",
6528
6528
  name: "header-menu-accordion",
6529
- children: [/* @__PURE__ */ g(I, {
6529
+ children: [/* @__PURE__ */ g(L, {
6530
6530
  className: "pkt-header-menu__section",
6531
6531
  skin: "plus-minus",
6532
6532
  id: "pkt-header-menu-services",
6533
6533
  title: e.title,
6534
6534
  children: /* @__PURE__ */ g(Ma, { services: e })
6535
- }), t.map((e, t) => /* @__PURE__ */ g(I, {
6535
+ }), t.map((e, t) => /* @__PURE__ */ g(L, {
6536
6536
  className: "pkt-header-menu__section",
6537
6537
  skin: "plus-minus",
6538
6538
  id: `pkt-header-menu-section-${t}`,
@@ -6546,21 +6546,25 @@ var ja = ({ dataUrl: e = br, data: t, locale: n = "nb-NO", open: r = !1, mobileB
6546
6546
  className: "pkt-header-menu__services-title",
6547
6547
  children: e.title
6548
6548
  }), /* @__PURE__ */ g(Ma, { services: e })]
6549
- }), Fa = ({ buttons: e, mobile: t }) => !e || e.length === 0 ? null : /* @__PURE__ */ g("div", {
6550
- className: ["pkt-header-menu__buttons", t && "pkt-header-menu__buttons--mobile"].filter(Boolean).join(" "),
6551
- children: e.map((e) => /* @__PURE__ */ _("a", {
6552
- className: "pkt-btn pkt-btn--secondary pkt-btn--icon-right pkt-btn--small",
6553
- href: e.url,
6554
- children: [/* @__PURE__ */ g(F, {
6555
- className: "pkt-btn__icon",
6556
- name: e.iconName ? ta(e.iconName) : "user",
6557
- "aria-hidden": "true"
6558
- }), /* @__PURE__ */ g("span", {
6559
- className: "pkt-btn__text",
6560
- children: e.text
6561
- })]
6562
- }, e.url))
6563
- }), Ia = ({ sections: e }) => !e || e.length === 0 ? null : /* @__PURE__ */ g("div", {
6549
+ }), Fa = ({ buttons: e, mobile: t }) => {
6550
+ if (!e || e.length === 0) return null;
6551
+ let n = ["pkt-header-menu__buttons", t && "pkt-header-menu__buttons--mobile"].filter(Boolean).join(" ");
6552
+ return /* @__PURE__ */ g("div", {
6553
+ className: n,
6554
+ children: e.map((e) => /* @__PURE__ */ _("a", {
6555
+ className: "pkt-btn pkt-btn--secondary pkt-btn--icon-right pkt-btn--small",
6556
+ href: e.url,
6557
+ children: [/* @__PURE__ */ g(I, {
6558
+ className: "pkt-btn__icon",
6559
+ name: e.iconName ? ta(e.iconName) : "user",
6560
+ "aria-hidden": "true"
6561
+ }), /* @__PURE__ */ g("span", {
6562
+ className: "pkt-btn__text",
6563
+ children: e.text
6564
+ })]
6565
+ }, e.url))
6566
+ });
6567
+ }, Ia = ({ sections: e }) => !e || e.length === 0 ? null : /* @__PURE__ */ g("div", {
6564
6568
  className: "pkt-header-menu__sections",
6565
6569
  children: /* @__PURE__ */ g("div", {
6566
6570
  className: "pkt-header-menu__sections-inner",
@@ -6601,7 +6605,7 @@ var ja = ({ dataUrl: e = br, data: t, locale: n = "nb-NO", open: r = !1, mobileB
6601
6605
  className: "pkt-header-menu__social-link",
6602
6606
  href: e.url,
6603
6607
  "aria-label": e.text,
6604
- children: t ? /* @__PURE__ */ g(F, {
6608
+ children: t ? /* @__PURE__ */ g(I, {
6605
6609
  name: t,
6606
6610
  "aria-hidden": "true"
6607
6611
  }) : /* @__PURE__ */ g("span", { children: e.text })
@@ -6612,7 +6616,7 @@ var ja = ({ dataUrl: e = br, data: t, locale: n = "nb-NO", open: r = !1, mobileB
6612
6616
  "pkt-link--icon-left": !!t && r === "left" || !!(t && !r),
6613
6617
  "pkt-link--icon-right": !!t && r === "right",
6614
6618
  "pkt-link--external": i
6615
- }, u = /* @__PURE__ */ _(h, { children: [t && /* @__PURE__ */ g(F, {
6619
+ }, u = /* @__PURE__ */ _(h, { children: [t && /* @__PURE__ */ g(I, {
6616
6620
  name: t,
6617
6621
  className: "pkt-link__icon"
6618
6622
  }), s] });
@@ -6654,7 +6658,7 @@ var Va = (e) => typeof e.target == "string" ? {
6654
6658
  onClick: () => {
6655
6659
  "onClick" in e && typeof e.onClick == "function" ? e.onClick() : console.error("UserMenuButton item is missing onClick handler or onClick is not a function:", e);
6656
6660
  },
6657
- children: [e.iconName && /* @__PURE__ */ g(F, {
6661
+ children: [e.iconName && /* @__PURE__ */ g(I, {
6658
6662
  name: e.iconName,
6659
6663
  className: "pkt-link__icon",
6660
6664
  "aria-hidden": "true"
@@ -6808,7 +6812,7 @@ var Ga = i(({ appearance: e = "local", inputSize: t = "medium", disabled: n = !1
6808
6812
  e.key === "Enter" && (e.preventDefault(), p(l));
6809
6813
  }),
6810
6814
  ...v
6811
- }), /* @__PURE__ */ g(L, {
6815
+ }), /* @__PURE__ */ g(R, {
6812
6816
  className: `pkt-searchinput__button ${e === "local" ? "pkt-input-icon" : ""}`,
6813
6817
  variant: "icon-only",
6814
6818
  iconName: "magnifying-glass-big",
@@ -6849,64 +6853,64 @@ Ga.displayName = "PktSearchInput";
6849
6853
  //#region src/components/header/HeaderGlobal.tsx
6850
6854
  var Ka = "https://punkt-cdn.oslo.kommune.no/17.1/logos/";
6851
6855
  typeof window < "u" && (window.pktLogoPath = window.pktLogoPath || Ka);
6852
- var qa = "pkt-header-global-menu", Ja = "pkt-header-global-menu-toggle", Ya = "pkt-header-global-search-panel", Xa = "pkt-header-global-search-toggle", Za = i(({ className: e, "data-mode": t, dataUrl: n, data: r, locale: i = "nb-NO", logoLink: a = xr, logoClick: s, logoPath: l = typeof window < "u" ? window.pktLogoPath : Ka, showSearch: u = !0, searchPlaceholder: v, onSearch: y, showContact: b = !0, user: x, userMenu: S, representing: C, canChangeRepresentation: w = !1, changeRepresentation: T, logOutButtonPlacement: E = "none", logOut: D, position: O = "fixed", scrollBehavior: k = "hide", mobileBreakpoint: A = 768, tabletBreakpoint: M = 1024, onDataLoaded: N, onDataError: ee }, te) => {
6853
- let ne = k === "hide", [P, re] = m("none"), [ie, ae] = m(void 0), [oe, se] = m(!1), ce = p(N), I = p(ee);
6856
+ var qa = "pkt-header-global-menu", Ja = "pkt-header-global-menu-toggle", Ya = "pkt-header-global-search-panel", Xa = "pkt-header-global-search-toggle", Za = i(({ className: e, "data-mode": t, dataUrl: n, data: r, locale: i = "nb-NO", logoLink: a = xr, logoClick: s, logoPath: l = typeof window < "u" ? window.pktLogoPath : Ka, showSearch: u = !0, searchPlaceholder: v, onSearch: y, showContact: b = !0, user: x, userMenu: S, representing: C, canChangeRepresentation: w = !1, changeRepresentation: T, logOutButtonPlacement: E = "none", logOut: D, position: O = "fixed", scrollBehavior: k = "hide", mobileBreakpoint: A = 768, tabletBreakpoint: M = 1024, onDataLoaded: N, onDataError: P }, ee) => {
6857
+ let te = k === "hide", [F, ne] = m("none"), [re, ie] = m(void 0), [ae, oe] = m(!1), se = p(N), L = p(P);
6854
6858
  c(() => {
6855
- ce.current = N;
6859
+ se.current = N;
6856
6860
  }, [N]), c(() => {
6857
- I.current = ee;
6858
- }, [ee]);
6859
- let { setRef: R, isMobile: le, isTablet: z, isFixed: B, isSticky: ue, hidden: V, captureFocus: H, flagRestoreFocus: U, restoreFocus: W } = ka({
6860
- forwardedRef: te,
6861
+ L.current = P;
6862
+ }, [P]);
6863
+ let { setRef: z, isMobile: ce, isTablet: B, isFixed: V, isSticky: le, hidden: H, captureFocus: U, flagRestoreFocus: W, restoreFocus: G } = ka({
6864
+ forwardedRef: ee,
6861
6865
  mobileBreakpoint: A,
6862
6866
  tabletBreakpoint: M,
6863
6867
  position: O,
6864
6868
  scrollBehavior: k,
6865
- pauseScrollHide: P !== "none"
6869
+ pauseScrollHide: F !== "none"
6866
6870
  });
6867
- Aa(P === "menu" || P === "search");
6868
- let G = p(null), de = o((e) => {
6869
- G.current = e, R(e);
6870
- }, [R]);
6871
+ Aa(F === "menu" || F === "search");
6872
+ let K = p(null), ue = o((e) => {
6873
+ K.current = e, z(e);
6874
+ }, [z]);
6871
6875
  d(() => {
6872
- if (P !== "menu" && P !== "search") return;
6873
- let e = document.getElementById(P === "menu" ? qa : Ya), t = G.current?.getBoundingClientRect();
6876
+ if (F !== "menu" && F !== "search") return;
6877
+ let e = document.getElementById(F === "menu" ? qa : Ya), t = K.current?.getBoundingClientRect();
6874
6878
  !e || !t || (e.style.setProperty("--pkt-header-global-top", `${t.top}px`), e.style.setProperty("--pkt-header-global-left", `${t.left}px`), e.style.setProperty("--pkt-header-global-width", `${t.width}px`));
6875
6879
  }, [
6876
- P,
6877
- le,
6878
- z
6880
+ F,
6881
+ ce,
6882
+ B
6879
6883
  ]), c(() => {
6880
- r && ce.current?.(r);
6884
+ r && se.current?.(r);
6881
6885
  }, [r]), c(() => {
6882
6886
  if (r) return;
6883
6887
  let e = new AbortController();
6884
6888
  return ga(n, e.signal).then((t) => {
6885
- e.signal.aborted || (ae(t), se(!1), ce.current?.(t));
6889
+ e.signal.aborted || (ie(t), oe(!1), se.current?.(t));
6886
6890
  }).catch((e) => {
6887
- e.name !== "AbortError" && (se(!0), I.current?.(e));
6891
+ e.name !== "AbortError" && (oe(!0), L.current?.(e));
6888
6892
  }), () => e.abort();
6889
6893
  }, [r, n]);
6890
- let K = r ?? ie, fe = f(() => oa(K, i), [K, i]);
6894
+ let q = r ?? re, de = f(() => oa(q, i), [q, i]);
6891
6895
  c(() => {
6892
6896
  let e = (e) => {
6893
6897
  let t = e.target;
6894
- P === "user" && !t.closest(".pkt-header-global__user-container") && !t.closest(".pkt-header-global__user-menu") && re("none"), P === "menu" && !t.closest(".pkt-header-menu") && !t.closest(`#${Ja}`) && re("none"), P === "search" && !t.closest(".pkt-header-global__search-panel-inner") && !t.closest(`#${Xa}`) && re("none");
6898
+ F === "user" && !t.closest(".pkt-header-global__user-container") && !t.closest(".pkt-header-global__user-menu") && ne("none"), F === "menu" && !t.closest(".pkt-header-menu") && !t.closest(`#${Ja}`) && ne("none"), F === "search" && !t.closest(".pkt-header-global__search-panel-inner") && !t.closest(`#${Xa}`) && ne("none");
6895
6899
  }, t = (e) => {
6896
- e.key === "Escape" && P !== "none" && (e.preventDefault(), U(), re("none"));
6900
+ e.key === "Escape" && F !== "none" && (e.preventDefault(), W(), ne("none"));
6897
6901
  };
6898
- if (P !== "none") return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
6902
+ if (F !== "none") return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
6899
6903
  document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
6900
6904
  };
6901
- W();
6905
+ G();
6902
6906
  }, [
6903
- P,
6904
- W,
6905
- U
6907
+ F,
6908
+ G,
6909
+ W
6906
6910
  ]), c(() => {
6907
- if (P !== "menu" && P !== "search") return;
6908
- let e = P === "menu" ? qa : Ya, t = P === "menu" ? Ja : Xa, n = () => document.getElementById(e), r = () => document.getElementById(t), i = (e) => {
6909
- re("none"), (e.querySelector("button") ?? e).focus();
6911
+ if (F !== "menu" && F !== "search") return;
6912
+ let e = F === "menu" ? qa : Ya, t = F === "menu" ? Ja : Xa, n = () => document.getElementById(e), r = () => document.getElementById(t), i = (e) => {
6913
+ ne("none"), (e.querySelector("button") ?? e).focus();
6910
6914
  }, a = (e) => {
6911
6915
  if (e.key !== "Tab") return;
6912
6916
  let t = n(), a = r();
@@ -6925,24 +6929,24 @@ var qa = "pkt-header-global-menu", Ja = "pkt-header-global-menu-toggle", Ya = "p
6925
6929
  let i = n();
6926
6930
  if (!i) return;
6927
6931
  let a = r();
6928
- i.contains(t) || a?.contains(t) || re("none");
6932
+ i.contains(t) || a?.contains(t) || ne("none");
6929
6933
  };
6930
6934
  return document.addEventListener("keydown", a), document.addEventListener("focusin", o), () => {
6931
6935
  document.removeEventListener("keydown", a), document.removeEventListener("focusin", o);
6932
6936
  };
6933
- }, [P]);
6934
- let pe = f(() => {
6937
+ }, [F]);
6938
+ let fe = f(() => {
6935
6939
  if (x?.lastLoggedIn) return typeof x.lastLoggedIn == "string" ? x.lastLoggedIn : new Date(x.lastLoggedIn).toLocaleString("nb-NO", {
6936
6940
  year: "numeric",
6937
6941
  month: "long",
6938
6942
  day: "numeric"
6939
6943
  });
6940
- }, [x?.lastLoggedIn]), me = o((e) => {
6941
- re((t) => t === e ? "none" : (H(), e));
6942
- }, [H]), q = E === "userMenu" || E === "both", he = fe?.search, J = fe?.header?.contact, Y = fe?.i18n?.menu || "Meny", X = fe?.i18n?.search || "Søk", Z = P === "menu", ge = P === "user", _e = P === "search", ve = le, ye = !!(u && he), be = he?.input.id || "pkt-header-global-search", xe = !fe && !oe, Se = /* @__PURE__ */ _("header", {
6943
- className: (0, j.default)("pkt-header-global", le && "pkt-header-global--mobile", z && "pkt-header-global--tablet", B && "pkt-header-global--fixed", ue && "pkt-header-global--sticky", ne && "pkt-header-global--scroll-to-hide", V && "pkt-header-global--hidden", e),
6944
+ }, [x?.lastLoggedIn]), pe = o((e) => {
6945
+ ne((t) => t === e ? "none" : (U(), e));
6946
+ }, [U]), J = E === "userMenu" || E === "both", me = de?.search, he = de?.header?.contact, Y = de?.i18n?.menu || "Meny", X = de?.i18n?.search || "Søk", Z = F === "menu", ge = F === "user", _e = F === "search", ve = ce, ye = !!(u && me), be = me?.input.id || "pkt-header-global-search", xe = !de && !ae, Se = /* @__PURE__ */ _("header", {
6947
+ className: (0, j.default)("pkt-header-global", ce && "pkt-header-global--mobile", B && "pkt-header-global--tablet", V && "pkt-header-global--fixed", le && "pkt-header-global--sticky", te && "pkt-header-global--scroll-to-hide", H && "pkt-header-global--hidden", e),
6944
6948
  "data-mode": t,
6945
- ref: de,
6949
+ ref: ue,
6946
6950
  children: [
6947
6951
  /* @__PURE__ */ g("div", {
6948
6952
  className: "pkt-header-global__logo-area",
@@ -6952,7 +6956,7 @@ var qa = "pkt-header-global-menu", Ja = "pkt-header-global-menu-toggle", Ya = "p
6952
6956
  href: a,
6953
6957
  "aria-label": "Til hovedsiden",
6954
6958
  onClick: s,
6955
- children: /* @__PURE__ */ g(F, {
6959
+ children: /* @__PURE__ */ g(I, {
6956
6960
  name: "oslologo",
6957
6961
  "aria-hidden": "true",
6958
6962
  path: l
@@ -6963,56 +6967,56 @@ var qa = "pkt-header-global-menu", Ja = "pkt-header-global-menu-toggle", Ya = "p
6963
6967
  /* @__PURE__ */ _("div", {
6964
6968
  className: "pkt-header-global__content",
6965
6969
  children: [
6966
- !ve && ye && he && /* @__PURE__ */ g("div", {
6970
+ !ve && ye && me && /* @__PURE__ */ g("div", {
6967
6971
  className: "pkt-header-global__search",
6968
6972
  children: /* @__PURE__ */ g(Ga, {
6969
6973
  appearance: "global",
6970
- inputSize: z ? "small" : "medium",
6974
+ inputSize: B ? "small" : "medium",
6971
6975
  fullwidth: !0,
6972
6976
  id: be,
6973
- name: he.input.name,
6977
+ name: me.input.name,
6974
6978
  "aria-label": X,
6975
- placeholder: v ?? he.input.placeholder,
6976
- action: he.endpoint,
6979
+ placeholder: v ?? me.input.placeholder,
6980
+ action: me.endpoint,
6977
6981
  method: "get",
6978
6982
  onSearch: y,
6979
6983
  onChange: () => {}
6980
6984
  })
6981
6985
  }),
6982
- ve && ye && /* @__PURE__ */ g(L, {
6986
+ ve && ye && /* @__PURE__ */ g(R, {
6983
6987
  id: Xa,
6984
6988
  className: "pkt-header-global__search-toggle",
6985
6989
  skin: "primary",
6986
6990
  color: _e ? void 0 : "yellow",
6987
6991
  variant: "icon-only",
6988
6992
  iconName: _e ? "close" : "magnifying-glass-big",
6989
- size: le ? "small" : "medium",
6993
+ size: ce ? "small" : "medium",
6990
6994
  state: _e ? "active" : "normal",
6991
6995
  "aria-expanded": _e,
6992
6996
  "aria-controls": Ya,
6993
- onClick: () => me("search"),
6997
+ onClick: () => pe("search"),
6994
6998
  children: X
6995
6999
  }),
6996
- /* @__PURE__ */ g(L, {
7000
+ /* @__PURE__ */ g(R, {
6997
7001
  id: Ja,
6998
7002
  className: "pkt-header-global__menu-toggle",
6999
7003
  skin: ve ? "tertiary" : "secondary",
7000
7004
  variant: ve ? "icon-only" : "icon-right",
7001
7005
  iconName: Z ? "close" : "menu",
7002
- size: z ? "small" : "medium",
7006
+ size: B ? "small" : "medium",
7003
7007
  state: Z ? "active" : "normal",
7004
7008
  "aria-expanded": Z,
7005
7009
  "aria-controls": qa,
7006
7010
  disabled: xe,
7007
- onClick: () => me("menu"),
7011
+ onClick: () => pe("menu"),
7008
7012
  children: Y
7009
7013
  }),
7010
- !ve && b && J && !x && /* @__PURE__ */ g("a", {
7011
- className: (0, j.default)("pkt-header-global__contact", "pkt-btn", "pkt-btn--secondary", "pkt-btn--label-only", z ? "pkt-btn--small" : "pkt-btn--medium"),
7012
- href: J.url,
7014
+ !ve && b && he && !x && /* @__PURE__ */ g("a", {
7015
+ className: (0, j.default)("pkt-header-global__contact", "pkt-btn", "pkt-btn--secondary", "pkt-btn--label-only", B ? "pkt-btn--small" : "pkt-btn--medium"),
7016
+ href: he.url,
7013
7017
  children: /* @__PURE__ */ g("span", {
7014
7018
  className: "pkt-btn__text",
7015
- children: J.text
7019
+ children: he.text
7016
7020
  })
7017
7021
  })
7018
7022
  ]
@@ -7021,15 +7025,15 @@ var qa = "pkt-header-global-menu", Ja = "pkt-header-global-menu-toggle", Ya = "p
7021
7025
  className: "pkt-header-global__user",
7022
7026
  children: /* @__PURE__ */ _("div", {
7023
7027
  className: (0, j.default)("pkt-header-global__user-container", ge && "is-open"),
7024
- children: [/* @__PURE__ */ _(L, {
7028
+ children: [/* @__PURE__ */ _(R, {
7025
7029
  className: "pkt-header-global__user-button",
7026
7030
  skin: "secondary",
7027
- size: z ? "small" : "medium",
7031
+ size: B ? "small" : "medium",
7028
7032
  state: ge ? "active" : "normal",
7029
7033
  variant: "icons-right-and-left",
7030
7034
  iconName: "user",
7031
7035
  secondIconName: ge ? "chevron-thin-up" : "chevron-thin-down",
7032
- onClick: () => me("user"),
7036
+ onClick: () => pe("user"),
7033
7037
  children: [/* @__PURE__ */ g("span", {
7034
7038
  className: "pkt-sr-only",
7035
7039
  children: "Brukermeny: "
@@ -7041,22 +7045,22 @@ var qa = "pkt-header-global-menu", Ja = "pkt-header-global-menu-toggle", Ya = "p
7041
7045
  className: "pkt-header-global__user-menu is-open",
7042
7046
  children: /* @__PURE__ */ g(Wa, {
7043
7047
  user: x,
7044
- formattedLastLoggedIn: pe,
7048
+ formattedLastLoggedIn: fe,
7045
7049
  representing: C,
7046
7050
  userMenu: S,
7047
7051
  canChangeRepresentation: w,
7048
7052
  changeRepresentation: T,
7049
- logoutOnClick: q ? D : void 0
7053
+ logoutOnClick: J ? D : void 0
7050
7054
  })
7051
7055
  })]
7052
7056
  })
7053
7057
  })
7054
7058
  ]
7055
7059
  }), Ce = Z && /* @__PURE__ */ g("div", {
7056
- className: (0, j.default)("pkt-header-global__menu", le && "pkt-header-global__menu--mobile", z && !le && "pkt-header-global__menu--tablet"),
7060
+ className: (0, j.default)("pkt-header-global__menu", ce && "pkt-header-global__menu--mobile", B && !ce && "pkt-header-global__menu--tablet"),
7057
7061
  id: qa,
7058
- children: fe ? /* @__PURE__ */ g(ja, {
7059
- data: K,
7062
+ children: de ? /* @__PURE__ */ g(ja, {
7063
+ data: q,
7060
7064
  locale: i,
7061
7065
  open: !0,
7062
7066
  mobileBreakpoint: A
@@ -7067,8 +7071,8 @@ var qa = "pkt-header-global-menu", Ja = "pkt-header-global-menu-toggle", Ya = "p
7067
7071
  children: "Kunne ikke laste meny."
7068
7072
  })
7069
7073
  })
7070
- }), we = _e && ye && he && /* @__PURE__ */ g("div", {
7071
- className: (0, j.default)("pkt-header-global__search-panel", le && "pkt-header-global__search-panel--mobile", z && !le && "pkt-header-global__search-panel--tablet"),
7074
+ }), we = _e && ye && me && /* @__PURE__ */ g("div", {
7075
+ className: (0, j.default)("pkt-header-global__search-panel", ce && "pkt-header-global__search-panel--mobile", B && !ce && "pkt-header-global__search-panel--tablet"),
7072
7076
  id: Ya,
7073
7077
  children: /* @__PURE__ */ g("div", {
7074
7078
  className: "pkt-header-global__search-panel-inner",
@@ -7076,10 +7080,10 @@ var qa = "pkt-header-global-menu", Ja = "pkt-header-global-menu-toggle", Ya = "p
7076
7080
  appearance: "global",
7077
7081
  fullwidth: !0,
7078
7082
  id: be,
7079
- name: he.input.name,
7083
+ name: me.input.name,
7080
7084
  "aria-label": X,
7081
- placeholder: v ?? he.input.placeholder,
7082
- action: he.endpoint,
7085
+ placeholder: v ?? me.input.placeholder,
7086
+ action: me.endpoint,
7083
7087
  method: "get",
7084
7088
  onSearch: y,
7085
7089
  onChange: () => {},
@@ -7087,11 +7091,11 @@ var qa = "pkt-header-global-menu", Ja = "pkt-header-global-menu-toggle", Ya = "p
7087
7091
  })
7088
7092
  })
7089
7093
  });
7090
- return B ? /* @__PURE__ */ _("div", {
7094
+ return V ? /* @__PURE__ */ _("div", {
7091
7095
  className: "pkt-header-global-wrapper",
7092
7096
  children: [
7093
7097
  Se,
7094
- /* @__PURE__ */ g("div", { className: (0, j.default)("pkt-header-global-spacer", le && "pkt-header-global-spacer--mobile", z && !le && "pkt-header-global-spacer--tablet", x && "pkt-header-global-spacer--has-user") }),
7098
+ /* @__PURE__ */ g("div", { className: (0, j.default)("pkt-header-global-spacer", ce && "pkt-header-global-spacer--mobile", B && !ce && "pkt-header-global-spacer--tablet", x && "pkt-header-global-spacer--has-user") }),
7095
7099
  we,
7096
7100
  Ce
7097
7101
  ]
@@ -7104,19 +7108,19 @@ var qa = "pkt-header-global-menu", Ja = "pkt-header-global-menu-toggle", Ya = "p
7104
7108
  Za.displayName = "PktHeaderGlobal";
7105
7109
  //#endregion
7106
7110
  //#region src/components/textinput/Textinput.tsx
7107
- var Qa = i(({ id: e, ariaDescribedby: t, ariaLabelledby: n, autocomplete: r = "off", counter: i, hasFieldset: a, counterMaxLength: o, className: s, disabled: l = !1, errorMessage: u, hasError: d = !1, helptext: f, helptextDropdown: p, helptextDropdownButton: h, iconNameRight: v, inline: y = !1, fullwidth: b = !1, label: x, name: S, optionalTag: C = !1, optionalText: w, requiredTag: T = !1, requiredText: E, tagText: D = null, placeholder: O, prefix: k, suffix: A, type: j = "text", useWrapper: M = !0, omitSearchIcon: N = !1, value: ee, minLength: te, maxLength: ne, min: P, max: re, step: ie, size: ae, readonly: oe, required: se, dataTestid: ce, onChange: I, skipForwardTestid: L = !1, inputSize: R = "medium", ...le }, z) => {
7108
- let B = i ?? (o ?? 0) > 0, ue = [s, "pkt-textinput"].filter(Boolean).join(" "), V = j === "search" && !v && !N, H = j === "date" && ee ? ee.slice(0, 10) : ee, [U, W] = m(ee?.length || 0), G = `${e}`, de = `${G}-label`, K = n || de, fe = (e) => {
7109
- B && W(e.currentTarget?.value?.length || 0), I && I(e);
7111
+ var Qa = i(({ id: e, ariaDescribedby: t, ariaLabelledby: n, autocomplete: r = "off", counter: i, hasFieldset: a, counterMaxLength: o, className: s, disabled: l = !1, errorMessage: u, hasError: d = !1, helptext: f, helptextDropdown: p, helptextDropdownButton: h, iconNameRight: v, inline: y = !1, fullwidth: b = !1, label: x, name: S, optionalTag: C = !1, optionalText: w, requiredTag: T = !1, requiredText: E, tagText: D = null, placeholder: O, prefix: k, suffix: A, type: j = "text", useWrapper: M = !0, omitSearchIcon: N = !1, value: P, minLength: ee, maxLength: te, min: F, max: ne, step: re, size: ie, readonly: ae, required: oe, dataTestid: se, onChange: L, skipForwardTestid: R = !1, inputSize: z = "medium", ...ce }, B) => {
7112
+ let V = i ?? (o ?? 0) > 0, le = [s, "pkt-textinput"].filter(Boolean).join(" "), H = j === "search" && !v && !N, U = j === "date" && P ? P.slice(0, 10) : P, [W, G] = m(P?.length || 0), K = `${e}`, ue = `${K}-label`, q = n || ue, de = (e) => {
7113
+ V && G(e.currentTarget?.value?.length || 0), L && L(e);
7110
7114
  };
7111
7115
  return c(() => {
7112
- ee !== void 0 && W(ee?.length || 0);
7113
- }, [ee]), /* @__PURE__ */ g("div", {
7114
- className: ue,
7116
+ P !== void 0 && G(P?.length || 0);
7117
+ }, [P]), /* @__PURE__ */ g("div", {
7118
+ className: le,
7115
7119
  children: /* @__PURE__ */ g(Tn, {
7116
7120
  ariaDescribedby: t,
7117
7121
  disabled: l,
7118
7122
  errorMessage: u,
7119
- forId: G,
7123
+ forId: K,
7120
7124
  hasError: d,
7121
7125
  helptext: f,
7122
7126
  helptextDropdown: p,
@@ -7129,69 +7133,69 @@ var Qa = i(({ id: e, ariaDescribedby: t, ariaLabelledby: n, autocomplete: r = "o
7129
7133
  requiredText: E,
7130
7134
  tagText: D,
7131
7135
  useWrapper: M,
7132
- counter: B,
7133
- counterCurrent: U,
7136
+ counter: V,
7137
+ counterCurrent: W,
7134
7138
  counterMaxLength: o,
7135
7139
  hasFieldset: a ?? !1,
7136
- size: R,
7140
+ size: z,
7137
7141
  children: /* @__PURE__ */ _("div", {
7138
- className: `pkt-input__container pkt-input__container--${R}`,
7139
- "data-testid": ce,
7140
- "data-skip-forward-testid": L ? "true" : void 0,
7142
+ className: `pkt-input__container pkt-input__container--${z}`,
7143
+ "data-testid": se,
7144
+ "data-skip-forward-testid": R ? "true" : void 0,
7141
7145
  children: [
7142
7146
  k && /* @__PURE__ */ g("div", {
7143
7147
  className: "pkt-input-prefix",
7144
7148
  children: k
7145
7149
  }),
7146
7150
  /* @__PURE__ */ g("input", {
7147
- ...le,
7148
- ref: z,
7149
- className: `pkt-input pkt-input--${R} ${b ? "pkt-input--fullwidth" : ""} ${o && U > o ? "pkt-input--counter-error" : ""}`,
7151
+ ...ce,
7152
+ ref: B,
7153
+ className: `pkt-input pkt-input--${z} ${b ? "pkt-input--fullwidth" : ""} ${o && W > o ? "pkt-input--counter-error" : ""}`,
7150
7154
  type: j,
7151
7155
  name: `${S || e}`,
7152
- value: H,
7153
- id: G,
7156
+ value: U,
7157
+ id: K,
7154
7158
  placeholder: O,
7155
7159
  autoComplete: r,
7156
7160
  disabled: l,
7157
7161
  "aria-invalid": d,
7158
7162
  "aria-errormessage": d ? `${e}-error` : void 0,
7159
7163
  "aria-describedby": yn({
7160
- id: G,
7164
+ id: K,
7161
7165
  hasHelptext: !!f,
7162
- hasCounter: B,
7166
+ hasCounter: V,
7163
7167
  ariaDescribedby: t
7164
7168
  }),
7165
- "aria-labelledby": K,
7166
- min: P,
7167
- max: re,
7168
- onChange: fe,
7169
- step: ie,
7170
- minLength: te,
7171
- maxLength: ne,
7172
- size: ae,
7173
- readOnly: oe,
7174
- required: se
7169
+ "aria-labelledby": q,
7170
+ min: F,
7171
+ max: ne,
7172
+ onChange: de,
7173
+ step: re,
7174
+ minLength: ee,
7175
+ maxLength: te,
7176
+ size: ie,
7177
+ readOnly: ae,
7178
+ required: oe
7175
7179
  }),
7176
7180
  A && /* @__PURE__ */ _("p", {
7177
7181
  className: "pkt-input-suffix",
7178
7182
  children: [
7179
7183
  A,
7180
- v && /* @__PURE__ */ g(F, {
7184
+ v && /* @__PURE__ */ g(I, {
7181
7185
  className: "pkt-input-suffix-icon",
7182
7186
  name: v
7183
7187
  }),
7184
- V && /* @__PURE__ */ g(F, {
7188
+ H && /* @__PURE__ */ g(I, {
7185
7189
  className: "pkt-input-suffix-icon",
7186
7190
  name: "magnifying-glass-big"
7187
7191
  })
7188
7192
  ]
7189
7193
  }),
7190
- !A && v && /* @__PURE__ */ g(F, {
7194
+ !A && v && /* @__PURE__ */ g(I, {
7191
7195
  className: "pkt-input-icon",
7192
7196
  name: v
7193
7197
  }),
7194
- !A && V && /* @__PURE__ */ g(F, {
7198
+ !A && H && /* @__PURE__ */ g(I, {
7195
7199
  className: "pkt-input-icon",
7196
7200
  name: "magnifying-glass-big"
7197
7201
  })
@@ -7205,8 +7209,8 @@ Qa.displayName = "PktTextinput";
7205
7209
  //#region src/components/header/HeaderService.tsx
7206
7210
  var $a = "https://punkt-cdn.oslo.kommune.no/17.1/logos/";
7207
7211
  typeof window < "u" && (window.pktLogoPath = window.pktLogoPath || $a);
7208
- var eo = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n, className: r, compact: i = !1, "data-mode": a, logOutButtonPlacement: s = "none", logOut: l, openedMenu: u, showSearch: d = !1, onSearch: v, onSearchChange: y, searchValue: b, searchPlaceholder: x = "Søk", representing: S, serviceLink: C, serviceClick: w, serviceName: T, user: E, userMenu: D, userMenuFooter: O, userOptions: k, canChangeRepresentation: A = !1, changeRepresentation: M, hideLogo: N = !1, logoLink: ee = xr, logoClick: te, logoPath: ne = typeof window < "u" ? window.pktLogoPath : $a, position: P = "fixed", scrollBehavior: re = "hide", slotMenuVariant: ie = "icon-only", slotMenuText: ae = "Meny" }, oe) => {
7209
- let se = re === "hide";
7212
+ var eo = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n, className: r, compact: i = !1, "data-mode": a, logOutButtonPlacement: s = "none", logOut: l, openedMenu: u, showSearch: d = !1, onSearch: v, onSearchChange: y, searchValue: b, searchPlaceholder: x = "Søk", representing: S, serviceLink: C, serviceClick: w, serviceName: T, user: E, userMenu: D, userMenuFooter: O, userOptions: k, canChangeRepresentation: A = !1, changeRepresentation: M, hideLogo: N = !1, logoLink: P = xr, logoClick: ee, logoPath: te = typeof window < "u" ? window.pktLogoPath : $a, position: F = "fixed", scrollBehavior: ne = "hide", slotMenuVariant: re = "icon-only", slotMenuText: ie = "Meny" }, ae) => {
7213
+ let oe = ne === "hide";
7210
7214
  c(() => {
7211
7215
  O && console.warn("PktHeaderService: The \"userMenuFooter\" prop is deprecated and will be removed in a future version. Please use \"userMenu\" instead.");
7212
7216
  }, [O]), c(() => {
@@ -7214,91 +7218,91 @@ var eo = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
7214
7218
  }, [k]), c(() => {
7215
7219
  E?.shortname && console.warn("PktHeaderService: The \"shortname\" property on the user object is deprecated and will be removed in a future version."), S?.shortname && console.warn("PktHeaderService: The \"shortname\" property on the representing object is deprecated and will be removed in a future version.");
7216
7220
  }, [E?.shortname, S?.shortname]);
7217
- let ce = f(() => {
7221
+ let se = f(() => {
7218
7222
  if (E?.lastLoggedIn) return typeof E.lastLoggedIn == "string" ? E.lastLoggedIn : new Date(E.lastLoggedIn).toLocaleString("nb-NO", {
7219
7223
  year: "numeric",
7220
7224
  month: "long",
7221
7225
  day: "numeric"
7222
7226
  });
7223
- }, [E?.lastLoggedIn]), [I, R] = m(u || "none");
7227
+ }, [E?.lastLoggedIn]), [L, z] = m(u || "none");
7224
7228
  c(() => {
7225
- u !== void 0 && R(u);
7229
+ u !== void 0 && z(u);
7226
7230
  }, [u]);
7227
- let [le, z] = m(!1), [B, ue] = m(!1), V = p(null), H = p(null), U = p(null), W = p(null), G = p(null), { setRef: de, isMobile: K, isTablet: fe, isFixed: pe, isSticky: me, hidden: q, captureFocus: he, flagRestoreFocus: J, restoreFocus: Y } = ka({
7228
- forwardedRef: oe,
7231
+ let [ce, B] = m(!1), [V, le] = m(!1), H = p(null), U = p(null), W = p(null), G = p(null), K = p(null), { setRef: ue, isMobile: q, isTablet: de, isFixed: fe, isSticky: pe, hidden: J, captureFocus: me, flagRestoreFocus: he, restoreFocus: Y } = ka({
7232
+ forwardedRef: ae,
7229
7233
  mobileBreakpoint: e,
7230
7234
  tabletBreakpoint: t,
7231
- position: P,
7232
- scrollBehavior: re
7235
+ position: F,
7236
+ scrollBehavior: ne
7233
7237
  });
7234
- Aa((pe || me) && K && I !== "none");
7238
+ Aa((fe || pe) && q && L !== "none");
7235
7239
  let X = o((e, t) => {
7236
7240
  let n = e.relatedTarget, r;
7237
7241
  switch (t) {
7238
7242
  case "user":
7239
- r = V;
7243
+ r = H;
7240
7244
  break;
7241
7245
  case "slot":
7242
- r = H;
7246
+ r = U;
7243
7247
  break;
7244
7248
  case "search":
7245
- r = U;
7249
+ r = W;
7246
7250
  break;
7247
7251
  default: return;
7248
7252
  }
7249
7253
  let i = r.current;
7250
- i && (!n || !i.contains(n)) && R("none");
7254
+ i && (!n || !i.contains(n)) && z("none");
7251
7255
  }, []);
7252
7256
  c(() => {
7253
7257
  let e = (e) => {
7254
- E && I === "user" && !e.target.closest(".pkt-header-service__user-container") && R("none"), I === "slot" && !e.target.closest(".pkt-header-service__slot-container") && R("none"), I === "search" && !e.target.closest(".pkt-header-service__search-container") && !e.target.closest(".pkt-header-service__search-input") && R("none");
7258
+ E && L === "user" && !e.target.closest(".pkt-header-service__user-container") && z("none"), L === "slot" && !e.target.closest(".pkt-header-service__slot-container") && z("none"), L === "search" && !e.target.closest(".pkt-header-service__search-container") && !e.target.closest(".pkt-header-service__search-input") && z("none");
7255
7259
  }, t = (e) => {
7256
- e.key === "Escape" && I !== "none" && (e.preventDefault(), J(), R("none"));
7260
+ e.key === "Escape" && L !== "none" && (e.preventDefault(), he(), z("none"));
7257
7261
  };
7258
- if (I !== "none") return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
7262
+ if (L !== "none") return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
7259
7263
  document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
7260
7264
  };
7261
7265
  Y();
7262
7266
  }, [
7263
- I,
7267
+ L,
7264
7268
  E,
7265
7269
  Y,
7266
- J
7270
+ he
7267
7271
  ]);
7268
7272
  let Z = o((e) => {
7269
- let t = e === "slot" ? H : U, n = e === "slot" ? W : G;
7270
- if (!t.current || !n.current || !fe || K) return;
7273
+ let t = e === "slot" ? U : W, n = e === "slot" ? G : K;
7274
+ if (!t.current || !n.current || !de || q) return;
7271
7275
  let r = t.current.getBoundingClientRect(), i = n.current.offsetWidth, a = r.left + i > window.innerWidth;
7272
- e === "slot" ? z(a) : ue(a);
7273
- }, [fe, K]), ge = o((e) => {
7274
- if (!fe || I !== "slot") return;
7276
+ e === "slot" ? B(a) : le(a);
7277
+ }, [de, q]), ge = o((e) => {
7278
+ if (!de || L !== "slot") return;
7275
7279
  let t = e.target.closest("a[href], button, [role=\"link\"], [role=\"button\"], [role=\"menuitem\"], [role=\"menuitemradio\"], [role=\"menuitemcheckbox\"]");
7276
- !t || !W.current?.contains(t) || t.closest("[data-pkt-header-keep-open]") || t.disabled || t.getAttribute("aria-disabled") === "true" || R("none");
7277
- }, [fe, I]), _e = o((e) => {
7278
- I === "none" ? (he(), R(e)) : R("none");
7279
- }, [I, he]);
7280
+ !t || !G.current?.contains(t) || t.closest("[data-pkt-header-keep-open]") || t.disabled || t.getAttribute("aria-disabled") === "true" || z("none");
7281
+ }, [de, L]), _e = o((e) => {
7282
+ L === "none" ? (me(), z(e)) : z("none");
7283
+ }, [L, me]);
7280
7284
  c(() => {
7281
- (I === "slot" || I === "search") && requestAnimationFrame(() => {
7282
- Z(I);
7285
+ (L === "slot" || L === "search") && requestAnimationFrame(() => {
7286
+ Z(L);
7283
7287
  });
7284
- }, [I, Z]);
7288
+ }, [L, Z]);
7285
7289
  let ve = /* @__PURE__ */ _("header", {
7286
- className: (0, j.default)("pkt-header-service", i && "pkt-header-service--compact", K && "pkt-header-service--mobile", fe && "pkt-header-service--tablet", pe && "pkt-header-service--fixed", me && "pkt-header-service--sticky", se && "pkt-header-service--scroll-to-hide", q && "pkt-header-service--hidden", r),
7290
+ className: (0, j.default)("pkt-header-service", i && "pkt-header-service--compact", q && "pkt-header-service--mobile", de && "pkt-header-service--tablet", fe && "pkt-header-service--fixed", pe && "pkt-header-service--sticky", oe && "pkt-header-service--scroll-to-hide", J && "pkt-header-service--hidden", r),
7287
7291
  "data-mode": a,
7288
- ref: de,
7292
+ ref: ue,
7289
7293
  children: [
7290
7294
  /* @__PURE__ */ _("div", {
7291
7295
  className: (0, j.default)("pkt-header-service__logo-area", (!T || T === "") && "pkt-header-service__logo-area--without-service"),
7292
7296
  children: [!N && /* @__PURE__ */ g("span", {
7293
7297
  className: "pkt-header-service__logo",
7294
7298
  children: /* @__PURE__ */ g("a", {
7295
- href: ee,
7299
+ href: P,
7296
7300
  "aria-label": "Tilbake til forside",
7297
- onClick: te,
7298
- children: /* @__PURE__ */ g(F, {
7301
+ onClick: ee,
7302
+ children: /* @__PURE__ */ g(I, {
7299
7303
  name: "oslologo",
7300
7304
  "aria-hidden": "true",
7301
- path: ne
7305
+ path: te
7302
7306
  })
7303
7307
  })
7304
7308
  }), T && /* @__PURE__ */ g("span", {
@@ -7318,30 +7322,30 @@ var eo = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
7318
7322
  })
7319
7323
  })]
7320
7324
  }),
7321
- n || d || fe && l && (s === "header" || s === "both") ? /* @__PURE__ */ _("div", {
7325
+ n || d || de && l && (s === "header" || s === "both") ? /* @__PURE__ */ _("div", {
7322
7326
  className: "pkt-header-service__content",
7323
7327
  children: [
7324
7328
  /* @__PURE__ */ _("div", {
7325
- className: (0, j.default)("pkt-header-service__slot-container", I === "slot" && "is-open"),
7329
+ className: (0, j.default)("pkt-header-service__slot-container", L === "slot" && "is-open"),
7326
7330
  onBlur: (e) => X(e, "slot"),
7327
- ref: H,
7328
- children: [fe && n && /* @__PURE__ */ g(L, {
7331
+ ref: U,
7332
+ children: [de && n && /* @__PURE__ */ g(R, {
7329
7333
  skin: "secondary",
7330
- variant: ie,
7334
+ variant: re,
7331
7335
  iconName: "menu",
7332
- size: K ? "small" : "medium",
7333
- state: I === "slot" ? "active" : "normal",
7336
+ size: q ? "small" : "medium",
7337
+ state: L === "slot" ? "active" : "normal",
7334
7338
  onClick: () => _e("slot"),
7335
- "aria-expanded": I === "slot",
7339
+ "aria-expanded": L === "slot",
7336
7340
  "aria-controls": "mobile-slot-menu",
7337
7341
  "aria-label": "Åpne meny",
7338
- children: ae
7342
+ children: ie
7339
7343
  }), /* @__PURE__ */ g("div", {
7340
- className: (0, j.default)("pkt-header-service__slot-content", le && "align-right"),
7344
+ className: (0, j.default)("pkt-header-service__slot-content", ce && "align-right"),
7341
7345
  id: "mobile-slot-menu",
7342
- role: fe ? "group" : void 0,
7343
- "aria-label": fe ? "Meny" : void 0,
7344
- ref: W,
7346
+ role: de ? "group" : void 0,
7347
+ "aria-label": de ? "Meny" : void 0,
7348
+ ref: G,
7345
7349
  onClick: ge,
7346
7350
  children: /* @__PURE__ */ g("div", {
7347
7351
  className: "pkt-contents",
@@ -7349,25 +7353,25 @@ var eo = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
7349
7353
  })
7350
7354
  })]
7351
7355
  }),
7352
- d && /* @__PURE__ */ g(h, { children: fe ? /* @__PURE__ */ _("div", {
7353
- className: (0, j.default)("pkt-header-service__search-container", I === "search" && "is-open"),
7356
+ d && /* @__PURE__ */ g(h, { children: de ? /* @__PURE__ */ _("div", {
7357
+ className: (0, j.default)("pkt-header-service__search-container", L === "search" && "is-open"),
7354
7358
  onBlur: (e) => X(e, "search"),
7355
- ref: U,
7356
- children: [/* @__PURE__ */ g(L, {
7359
+ ref: W,
7360
+ children: [/* @__PURE__ */ g(R, {
7357
7361
  skin: "secondary",
7358
7362
  variant: "icon-only",
7359
7363
  iconName: "magnifying-glass-big",
7360
- size: K ? "small" : "medium",
7364
+ size: q ? "small" : "medium",
7361
7365
  onClick: () => _e("search"),
7362
- state: I === "search" ? "active" : "normal",
7363
- "aria-expanded": I === "search",
7366
+ state: L === "search" ? "active" : "normal",
7367
+ "aria-expanded": L === "search",
7364
7368
  "aria-controls": "mobile-search-menu",
7365
7369
  "aria-label": "Åpne søkefelt",
7366
7370
  children: "Søk"
7367
7371
  }), /* @__PURE__ */ g("div", {
7368
- className: (0, j.default)("pkt-header-service__mobile-menu", I === "search" && "is-open", B && "align-right"),
7369
- ref: G,
7370
- children: I === "search" && /* @__PURE__ */ g(Qa, {
7372
+ className: (0, j.default)("pkt-header-service__mobile-menu", L === "search" && "is-open", V && "align-right"),
7373
+ ref: K,
7374
+ children: L === "search" && /* @__PURE__ */ g(Qa, {
7371
7375
  id: "mobile-search-menu",
7372
7376
  className: "pkt-header-service__search-input",
7373
7377
  type: "search",
@@ -7396,9 +7400,9 @@ var eo = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
7396
7400
  e.key === "Enter" && v?.(e.target.value);
7397
7401
  }
7398
7402
  }) }),
7399
- K && l && (s === "header" || s === "both") && /* @__PURE__ */ g(L, {
7403
+ q && l && (s === "header" || s === "both") && /* @__PURE__ */ g(R, {
7400
7404
  skin: "secondary",
7401
- size: K ? "small" : "medium",
7405
+ size: q ? "small" : "medium",
7402
7406
  variant: "icon-only",
7403
7407
  iconName: "exit",
7404
7408
  onClick: l,
@@ -7406,20 +7410,20 @@ var eo = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
7406
7410
  })
7407
7411
  ]
7408
7412
  }) : null,
7409
- (E || !K && l && (s === "header" || s === "both")) && /* @__PURE__ */ _("div", {
7413
+ (E || !q && l && (s === "header" || s === "both")) && /* @__PURE__ */ _("div", {
7410
7414
  className: "pkt-header-service__user",
7411
7415
  children: [E && /* @__PURE__ */ _("div", {
7412
7416
  className: "pkt-header-service__user-container",
7413
7417
  onBlur: (e) => X(e, "user"),
7414
- ref: V,
7415
- children: [/* @__PURE__ */ _(L, {
7416
- className: (0, j.default)("pkt-header-service__user-button", K && "pkt-header-service__user-button--mobile"),
7418
+ ref: H,
7419
+ children: [/* @__PURE__ */ _(R, {
7420
+ className: (0, j.default)("pkt-header-service__user-button", q && "pkt-header-service__user-button--mobile"),
7417
7421
  skin: "secondary",
7418
- size: K ? "small" : "medium",
7419
- state: I === "user" ? "active" : "normal",
7422
+ size: q ? "small" : "medium",
7423
+ state: L === "user" ? "active" : "normal",
7420
7424
  variant: "icons-right-and-left",
7421
7425
  iconName: "user",
7422
- secondIconName: I === "user" ? "chevron-thin-up" : "chevron-thin-down",
7426
+ secondIconName: L === "user" ? "chevron-thin-up" : "chevron-thin-down",
7423
7427
  onClick: () => _e("user"),
7424
7428
  children: [/* @__PURE__ */ g("span", {
7425
7429
  className: "pkt-sr-only",
@@ -7428,11 +7432,11 @@ var eo = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
7428
7432
  translate: "no",
7429
7433
  children: S?.name || E.name
7430
7434
  })]
7431
- }), I === "user" && E && /* @__PURE__ */ g("div", {
7432
- className: (0, j.default)(K ? "pkt-header-service__mobile-menu" : "pkt-header-service__user-menu", "is-open"),
7435
+ }), L === "user" && E && /* @__PURE__ */ g("div", {
7436
+ className: (0, j.default)(q ? "pkt-header-service__mobile-menu" : "pkt-header-service__user-menu", "is-open"),
7433
7437
  children: /* @__PURE__ */ g(Wa, {
7434
7438
  user: E,
7435
- formattedLastLoggedIn: ce,
7439
+ formattedLastLoggedIn: se,
7436
7440
  representing: S,
7437
7441
  userMenu: D,
7438
7442
  canChangeRepresentation: A,
@@ -7440,7 +7444,7 @@ var eo = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
7440
7444
  logoutOnClick: s === "userMenu" || s === "both" ? l : void 0
7441
7445
  })
7442
7446
  })]
7443
- }), !K && l && (s === "header" || s === "both") && /* @__PURE__ */ g(L, {
7447
+ }), !q && l && (s === "header" || s === "both") && /* @__PURE__ */ g(R, {
7444
7448
  skin: "tertiary",
7445
7449
  size: "medium",
7446
7450
  variant: "icon-right",
@@ -7451,9 +7455,9 @@ var eo = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
7451
7455
  })
7452
7456
  ]
7453
7457
  });
7454
- return pe ? /* @__PURE__ */ _("div", {
7458
+ return fe ? /* @__PURE__ */ _("div", {
7455
7459
  className: "pkt-header-service-wrapper",
7456
- children: [ve, /* @__PURE__ */ g("div", { className: (0, j.default)("pkt-header-service-spacer", i && "pkt-header-service-spacer--compact", E && "pkt-header-service-spacer--has-user", K && "pkt-header-service-spacer--mobile", fe && "pkt-header-service-spacer--tablet") })]
7460
+ children: [ve, /* @__PURE__ */ g("div", { className: (0, j.default)("pkt-header-service-spacer", i && "pkt-header-service-spacer--compact", E && "pkt-header-service-spacer--has-user", q && "pkt-header-service-spacer--mobile", de && "pkt-header-service-spacer--tablet") })]
7457
7461
  }) : ve;
7458
7462
  });
7459
7463
  eo.displayName = "PktHeaderService";
@@ -7490,8 +7494,8 @@ var no = (e) => {
7490
7494
  default: return "medium";
7491
7495
  }
7492
7496
  }, io = i(function({ level: e = 2, size: t, weight: n, visuallyHidden: r, align: i, className: a, children: o, ...s }, c) {
7493
- let l = t ?? no(e), u = n ?? ro(e), d = (0, j.default)("pkt-heading", `pkt-heading--${l}`, `pkt-heading--fw-${u}`, i && `pkt-heading--${i}`, r && "pkt-sr-only", a);
7494
- return /* @__PURE__ */ g(`h${e}`, {
7497
+ let l = t ?? no(e), u = n ?? ro(e), d = (0, j.default)("pkt-heading", `pkt-heading--${l}`, `pkt-heading--fw-${u}`, i && `pkt-heading--${i}`, r && "pkt-sr-only", a), f = `h${e}`;
7498
+ return /* @__PURE__ */ g(f, {
7495
7499
  ...s,
7496
7500
  ref: c,
7497
7501
  className: d,
@@ -7531,7 +7535,7 @@ var oo = ({ children: e, skin: t, title: n, href: r, iconName: i, openInNewTab:
7531
7535
  target: a ? "_blank" : "_self",
7532
7536
  rel: a ? "noopener noreferrer" : void 0,
7533
7537
  children: [
7534
- i && /* @__PURE__ */ g(F, {
7538
+ i && /* @__PURE__ */ g(I, {
7535
7539
  className: "pkt-link__icon",
7536
7540
  name: i
7537
7541
  }),
@@ -7575,7 +7579,7 @@ var so = (e) => {
7575
7579
  className: h,
7576
7580
  children: [n && f && /* @__PURE__ */ _("div", {
7577
7581
  className: "pkt-loader__spinner",
7578
- children: [/* @__PURE__ */ g(F, {
7582
+ children: [/* @__PURE__ */ g(I, {
7579
7583
  name: so(a),
7580
7584
  path: o,
7581
7585
  className: `pkt-loader__svg pkt-loader__${a}`
@@ -7610,7 +7614,7 @@ var lo = ({ children: e, className: t, skin: n, title: i, compact: a, closable:
7610
7614
  onClick: h,
7611
7615
  className: "pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only",
7612
7616
  "aria-label": "Lukk",
7613
- children: /* @__PURE__ */ g(F, {
7617
+ children: /* @__PURE__ */ g(I, {
7614
7618
  name: "close",
7615
7619
  className: "pkt-link__icon"
7616
7620
  })
@@ -7685,47 +7689,50 @@ var uo = i(({ id: e, name: t, label: n, className: r, hasTile: i = !1, disabled:
7685
7689
  uo.displayName = "PktRadioButton";
7686
7690
  //#endregion
7687
7691
  //#region src/components/select/Select.tsx
7688
- var fo = i(({ ariaDescribedby: e, ariaLabelledby: t, children: n, className: r, disabled: i = !1, errorMessage: a, hasError: o, helptext: s, helptextDropdown: c, helptextDropdownButton: l, id: u, inline: d = !1, fullwidth: f = !1, label: p, name: m, optionalTag: h = !1, optionalText: _, requiredTag: v = !1, requiredText: y, tagText: b, useWrapper: x = !0, hasFieldset: S, inputSize: C = "medium", ...w }, T) => /* @__PURE__ */ g("div", {
7689
- className: [r, "pkt-select"].filter(Boolean).join(" "),
7690
- children: /* @__PURE__ */ g(Tn, {
7691
- forId: `${u}-input`,
7692
- label: p,
7693
- helptext: s,
7694
- helptextDropdown: c,
7695
- helptextDropdownButton: l,
7696
- optionalTag: h,
7697
- optionalText: _,
7698
- requiredTag: v,
7699
- requiredText: y,
7700
- tagText: b,
7701
- hasError: o,
7702
- errorMessage: a,
7703
- disabled: i,
7704
- inline: d,
7705
- ariaDescribedby: e,
7706
- useWrapper: x,
7707
- hasFieldset: S ?? !1,
7708
- size: C,
7709
- children: /* @__PURE__ */ g("select", {
7710
- ref: T,
7711
- className: `pkt-input pkt-input--${C} ${f ? "pkt-input--fullwidth" : ""}`,
7712
- "aria-invalid": o,
7713
- "aria-errormessage": o ? `${u}-error` : void 0,
7714
- "aria-describedby": yn({
7715
- id: `${u}-input`,
7716
- hasHelptext: !!s,
7717
- hasCounter: !1,
7718
- ariaDescribedby: e
7719
- }),
7720
- "aria-labelledby": t || void 0,
7692
+ var fo = i(({ ariaDescribedby: e, ariaLabelledby: t, children: n, className: r, disabled: i = !1, errorMessage: a, hasError: o, helptext: s, helptextDropdown: c, helptextDropdownButton: l, id: u, inline: d = !1, fullwidth: f = !1, label: p, name: m, optionalTag: h = !1, optionalText: _, requiredTag: v = !1, requiredText: y, tagText: b, useWrapper: x = !0, hasFieldset: S, inputSize: C = "medium", ...w }, T) => {
7693
+ let E = [r, "pkt-select"].filter(Boolean).join(" ");
7694
+ return /* @__PURE__ */ g("div", {
7695
+ className: E,
7696
+ children: /* @__PURE__ */ g(Tn, {
7697
+ forId: `${u}-input`,
7698
+ label: p,
7699
+ helptext: s,
7700
+ helptextDropdown: c,
7701
+ helptextDropdownButton: l,
7702
+ optionalTag: h,
7703
+ optionalText: _,
7704
+ requiredTag: v,
7705
+ requiredText: y,
7706
+ tagText: b,
7707
+ hasError: o,
7708
+ errorMessage: a,
7721
7709
  disabled: i,
7722
- id: `${u}-input`,
7723
- name: m || u,
7724
- ...w,
7725
- children: n
7710
+ inline: d,
7711
+ ariaDescribedby: e,
7712
+ useWrapper: x,
7713
+ hasFieldset: S ?? !1,
7714
+ size: C,
7715
+ children: /* @__PURE__ */ g("select", {
7716
+ ref: T,
7717
+ className: `pkt-input pkt-input--${C} ${f ? "pkt-input--fullwidth" : ""}`,
7718
+ "aria-invalid": o,
7719
+ "aria-errormessage": o ? `${u}-error` : void 0,
7720
+ "aria-describedby": yn({
7721
+ id: `${u}-input`,
7722
+ hasHelptext: !!s,
7723
+ hasCounter: !1,
7724
+ ariaDescribedby: e
7725
+ }),
7726
+ "aria-labelledby": t || void 0,
7727
+ disabled: i,
7728
+ id: `${u}-input`,
7729
+ name: m || u,
7730
+ ...w,
7731
+ children: n
7732
+ })
7726
7733
  })
7727
- })
7728
- }));
7734
+ });
7735
+ });
7729
7736
  fo.displayName = "PktSelect";
7730
7737
  //#endregion
7731
7738
  //#region src/components/stepper/Step.tsx
@@ -7879,7 +7886,7 @@ var vo = ({ className: e, compact: t = !1, skin: n = "basic", responsiveView: r
7879
7886
  f(l, e, n), typeof u == "function" ? u(e) : u && (u.current = e);
7880
7887
  }
7881
7888
  }, b = /* @__PURE__ */ _(h, { children: [
7882
- a && /* @__PURE__ */ g(F, {
7889
+ a && /* @__PURE__ */ g(I, {
7883
7890
  name: a,
7884
7891
  className: `pkt-icon--small ${a === "check" ? "pkt-tabs__status-icon" : ""}`
7885
7892
  }),
@@ -7955,12 +7962,12 @@ var To = n(null), Eo = () => {
7955
7962
  src: i,
7956
7963
  alt: "",
7957
7964
  "aria-hidden": "true"
7958
- }) : r ? /* @__PURE__ */ g(F, {
7965
+ }) : r ? /* @__PURE__ */ g(I, {
7959
7966
  name: r,
7960
7967
  className: "pkt-tabs__separator-icon"
7961
7968
  }) : null
7962
7969
  }, e), T = (e) => !v || e.length <= 1 ? e : e.flatMap((t, n) => n < e.length - 1 ? [t, w(`separator-${n}`)] : [t]), E = a?.map((e, t) => /* @__PURE__ */ g(wo, {
7963
- active: e.disabled ? !1 : e.active,
7970
+ active: !e.disabled && e.active,
7964
7971
  disabled: e.disabled,
7965
7972
  href: e.href,
7966
7973
  icon: e.icon,
@@ -8052,37 +8059,37 @@ function Ro(e) {
8052
8059
  return e === 3600 || e < 3600 && 3600 % e == 0 && e % 60 == 0;
8053
8060
  }
8054
8061
  function zo(e, t) {
8055
- let { id: n, label: r, value: i, defaultValue: a, min: s, max: l, step: h = 60, hidePicker: g = !1, stepArrows: _ = !1, fullwidth: v = !1, name: y, disabled: b = !1, required: x = !1, helptext: S, helptextDropdown: C, helptextDropdownButton: w, hasError: T = !1, errorMessage: E, optionalTag: D = !1, optionalText: O, requiredTag: k = !1, requiredText: A, tagText: j, inline: M = !1, useWrapper: N = !0, ariaDescribedby: ee, strings: te, className: ne, inputSize: P = "medium", onValueChange: re, onFocus: ie, onBlur: ae } = e, oe = f(() => te ?? Sr, [te]), se = i !== void 0, ce = i === void 0 ? a ?? "" : i ?? "", F = p(ce), [I, L] = m(() => ce), R = se ? i ?? "" : I, [le, z] = m(() => Fo(i === void 0 ? a : i)[0]), [B, ue] = m(() => Fo(i === void 0 ? a : i)[1]), V = p(le), H = p(B), U = o((e) => {
8056
- V.current = e, z(e);
8057
- }, []), W = o((e) => {
8058
- H.current = e, ue(e);
8059
- }, []), [G, de] = m(!1), [K, fe] = m(!1), pe = p(i);
8062
+ let { id: n, label: r, value: i, defaultValue: a, min: s, max: l, step: h = 60, hidePicker: g = !1, stepArrows: _ = !1, fullwidth: v = !1, name: y, disabled: b = !1, required: x = !1, helptext: S, helptextDropdown: C, helptextDropdownButton: w, hasError: T = !1, errorMessage: E, optionalTag: D = !1, optionalText: O, requiredTag: k = !1, requiredText: A, tagText: j, inline: M = !1, useWrapper: N = !0, ariaDescribedby: P, strings: ee, className: te, inputSize: F = "medium", onValueChange: ne, onFocus: re, onBlur: ie } = e, ae = f(() => ee ?? Sr, [ee]), oe = i !== void 0, se = i === void 0 ? a ?? "" : i ?? "", I = p(se), [L, R] = m(() => se), z = oe ? i ?? "" : L, [ce, B] = m(() => Fo(i === void 0 ? a : i)[0]), [V, le] = m(() => Fo(i === void 0 ? a : i)[1]), H = p(ce), U = p(V), W = o((e) => {
8063
+ H.current = e, B(e);
8064
+ }, []), G = o((e) => {
8065
+ U.current = e, le(e);
8066
+ }, []), [K, ue] = m(!1), [q, de] = m(!1), fe = p(i);
8060
8067
  c(() => {
8061
- if (!se || i === pe.current) return;
8062
- pe.current = i;
8068
+ if (!oe || i === fe.current) return;
8069
+ fe.current = i;
8063
8070
  let [e, t] = Fo(i);
8064
- U(e), W(t);
8071
+ W(e), G(t);
8065
8072
  }, [
8066
8073
  i,
8067
- se,
8068
- U,
8069
- W
8074
+ oe,
8075
+ W,
8076
+ G
8070
8077
  ]), c(() => {
8071
8078
  h != null && !Ro(h) && console.warn(`PktTimepicker: step="${h}" er ikke en gyldig verdi. Step må være et multiplum av 60 (hele minutter) eller nøyaktig 3600 (hel time).`);
8072
8079
  }, [h]);
8073
- let me = p(null), q = p(null), he = p(null), J = p(null), Y = p(null), X = p(null), Z = p(0), ge = p(-1), _e = p(0), ve = p(-1), [ye, be] = m(!1), xe = f(() => Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set, []), Se = f(() => Oo(h), [h]), Ce = f(() => ko(s, l), [s, l]), we = f(() => Ao(h), [h]), Te = `${n}-hours`, Ee = `${n}-minutes`, De = `${n}-popup`, Oe = `${n}-input`;
8080
+ let pe = p(null), J = p(null), me = p(null), he = p(null), Y = p(null), X = p(null), Z = p(0), ge = p(-1), _e = p(0), ve = p(-1), [ye, be] = m(!1), xe = f(() => Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set, []), Se = f(() => Oo(h), [h]), Ce = f(() => ko(s, l), [s, l]), we = f(() => Ao(h), [h]), Te = `${n}-hours`, Ee = `${n}-minutes`, De = `${n}-popup`, Oe = `${n}-input`;
8074
8081
  c(() => {
8075
- let e = me.current;
8082
+ let e = pe.current;
8076
8083
  if (!e) return;
8077
- let t = Lo(R, {
8084
+ let t = Lo(z, {
8078
8085
  required: x,
8079
8086
  min: s,
8080
8087
  max: l,
8081
8088
  step: h
8082
8089
  });
8083
- e.setCustomValidity(t.valid ? "" : t.message ?? ""), fe(ye && !t.valid);
8090
+ e.setCustomValidity(t.valid ? "" : t.message ?? ""), de(ye && !t.valid);
8084
8091
  }, [
8085
- R,
8092
+ z,
8086
8093
  x,
8087
8094
  s,
8088
8095
  l,
@@ -8090,28 +8097,28 @@ function zo(e, t) {
8090
8097
  ye
8091
8098
  ]);
8092
8099
  let Q = o((e) => {
8093
- se || L(e);
8100
+ oe || R(e);
8094
8101
  let t = X.current;
8095
- !t || !xe || (xe.call(t, e), t.dispatchEvent(new Event("input", { bubbles: !0 })), re?.(e));
8102
+ !t || !xe || (xe.call(t, e), t.dispatchEvent(new Event("input", { bubbles: !0 })), ne?.(e));
8096
8103
  }, [
8097
- se,
8104
+ oe,
8098
8105
  xe,
8099
- re
8106
+ ne
8100
8107
  ]), ke = o(() => {
8101
- let e = V.current, t = H.current;
8108
+ let e = H.current, t = U.current;
8102
8109
  if (e !== "" && t !== "") {
8103
8110
  let n = Io(e, t);
8104
- n !== R && Q(n);
8105
- } else R !== "" && Q("");
8106
- }, [R, Q]), Ae = o(() => {
8107
- let e = V.current, t = H.current;
8111
+ n !== z && Q(n);
8112
+ } else z !== "" && Q("");
8113
+ }, [z, Q]), Ae = o(() => {
8114
+ let e = H.current, t = U.current;
8108
8115
  if (e !== "" && t !== "") {
8109
8116
  let n = Io(e, t);
8110
- n === R ? X.current?.dispatchEvent(new Event("input", { bubbles: !0 })) : Q(n);
8111
- } else R === "" ? X.current?.dispatchEvent(new Event("input", { bubbles: !0 })) : Q("");
8112
- }, [R, Q]), je = o(() => {
8117
+ n === z ? X.current?.dispatchEvent(new Event("input", { bubbles: !0 })) : Q(n);
8118
+ } else z === "" ? X.current?.dispatchEvent(new Event("input", { bubbles: !0 })) : Q("");
8119
+ }, [z, Q]), je = o(() => {
8113
8120
  be(!0), ke();
8114
- let e = me.current, t = X.current;
8121
+ let e = pe.current, t = X.current;
8115
8122
  if (!e) return;
8116
8123
  let n = Lo(t?.value ?? "", {
8117
8124
  required: x,
@@ -8140,14 +8147,14 @@ function zo(e, t) {
8140
8147
  };
8141
8148
  return e.addEventListener("pointerdown", n, !0), () => e.removeEventListener("pointerdown", n, !0);
8142
8149
  }, [je]), c(() => {
8143
- X.current && (X.current.value = R);
8144
- }, [R]);
8150
+ X.current && (X.current.value = z);
8151
+ }, [z]);
8145
8152
  let Me = o(() => {
8146
- de(!1), ke();
8153
+ ue(!1), ke();
8147
8154
  }, [ke]);
8148
8155
  d(() => {
8149
- if (!G) return;
8150
- let e = J.current;
8156
+ if (!K) return;
8157
+ let e = he.current;
8151
8158
  if (!e) return;
8152
8159
  e.querySelectorAll(".pkt-timepicker-popup__col").forEach((e) => {
8153
8160
  let t = e.querySelector(".pkt-timepicker-popup__option--selected");
@@ -8157,16 +8164,16 @@ function zo(e, t) {
8157
8164
  if (!t) return;
8158
8165
  let n = t.querySelector(".pkt-timepicker-popup__option--selected"), r = t.querySelector(".pkt-timepicker-popup__option");
8159
8166
  (n || r)?.focus();
8160
- }, [G]), c(() => {
8161
- if (!G) return;
8167
+ }, [K]), c(() => {
8168
+ if (!K) return;
8162
8169
  let e = (e) => {
8163
8170
  let t = e.target;
8164
8171
  Y.current && !Y.current.contains(t) && Me();
8165
8172
  };
8166
8173
  return document.addEventListener("click", e, !0), () => document.removeEventListener("click", e, !0);
8167
- }, [G, Me]);
8174
+ }, [K, Me]);
8168
8175
  let Ne = o((e) => {
8169
- let t = J.current;
8176
+ let t = he.current;
8170
8177
  if (!t) return;
8171
8178
  let n = t.querySelectorAll(".pkt-timepicker-popup__col"), r = e === "hour" ? n[0] : n[1];
8172
8179
  if (!r) return;
@@ -8174,56 +8181,56 @@ function zo(e, t) {
8174
8181
  (i || a)?.focus();
8175
8182
  }, []), Pe = o((e, t) => {
8176
8183
  let n = String(e).padStart(2, "0");
8177
- if (t === "hour") U(n), requestAnimationFrame(() => Ne("minute"));
8184
+ if (t === "hour") W(n), requestAnimationFrame(() => Ne("minute"));
8178
8185
  else {
8179
- W(n), de(!1);
8180
- let e = V.current;
8181
- e !== "" && Q(`${e}:${n}`), requestAnimationFrame(() => he.current?.focus());
8186
+ G(n), ue(!1);
8187
+ let e = H.current;
8188
+ e !== "" && Q(`${e}:${n}`), requestAnimationFrame(() => me.current?.focus());
8182
8189
  }
8183
8190
  }, [
8184
8191
  Q,
8185
8192
  Ne,
8186
- U,
8187
- W
8193
+ W,
8194
+ G
8188
8195
  ]), Fe = o((e) => {
8189
- let t = jo(V.current, H.current, e, Se);
8190
- U(t.hours), W(t.minutes), `${t.hours}:${t.minutes}` !== R && Q(`${t.hours}:${t.minutes}`);
8196
+ let t = jo(H.current, U.current, e, Se);
8197
+ W(t.hours), G(t.minutes), `${t.hours}:${t.minutes}` !== z && Q(`${t.hours}:${t.minutes}`);
8191
8198
  }, [
8192
8199
  Se,
8193
- R,
8200
+ z,
8194
8201
  Q,
8195
- U,
8196
- W
8202
+ W,
8203
+ G
8197
8204
  ]), Ie = o((e) => {
8198
- me.current?.setCustomValidity("");
8199
- let t = e.currentTarget, n = H.current;
8205
+ pe.current?.setCustomValidity("");
8206
+ let t = e.currentTarget, n = U.current;
8200
8207
  switch (e.key) {
8201
8208
  case "ArrowUp": {
8202
8209
  e.preventDefault();
8203
- let t = V.current === "" ? 0 : parseInt(V.current, 10), r = String((t + 1) % 24).padStart(2, "0");
8204
- if (U(r), n !== "") {
8210
+ let t = H.current === "" ? 0 : parseInt(H.current, 10), r = String((t + 1) % 24).padStart(2, "0");
8211
+ if (W(r), n !== "") {
8205
8212
  let e = `${r}:${n}`;
8206
- e === R ? X.current?.dispatchEvent(new Event("input", { bubbles: !0 })) : Q(e);
8213
+ e === z ? X.current?.dispatchEvent(new Event("input", { bubbles: !0 })) : Q(e);
8207
8214
  }
8208
8215
  break;
8209
8216
  }
8210
8217
  case "ArrowDown": {
8211
8218
  e.preventDefault();
8212
- let t = V.current === "" ? 0 : parseInt(V.current, 10), r = String((t - 1 + 24) % 24).padStart(2, "0");
8213
- if (U(r), n !== "") {
8219
+ let t = H.current === "" ? 0 : parseInt(H.current, 10), r = String((t - 1 + 24) % 24).padStart(2, "0");
8220
+ if (W(r), n !== "") {
8214
8221
  let e = `${r}:${n}`;
8215
- e === R ? X.current?.dispatchEvent(new Event("input", { bubbles: !0 })) : Q(e);
8222
+ e === z ? X.current?.dispatchEvent(new Event("input", { bubbles: !0 })) : Q(e);
8216
8223
  }
8217
8224
  break;
8218
8225
  }
8219
8226
  case "ArrowRight":
8220
- e.preventDefault(), q.current?.focus();
8227
+ e.preventDefault(), J.current?.focus();
8221
8228
  break;
8222
8229
  case "Backspace":
8223
8230
  case "Delete": {
8224
8231
  e.preventDefault(), Z.current = 0, ge.current = -1;
8225
- let t = V.current;
8226
- t.length > 0 && U(t.slice(0, -1)), Ae();
8232
+ let t = H.current;
8233
+ t.length > 0 && W(t.slice(0, -1)), Ae();
8227
8234
  break;
8228
8235
  }
8229
8236
  case "Tab": break;
@@ -8236,51 +8243,58 @@ function zo(e, t) {
8236
8243
  default: if (/^\d$/.test(e.key)) {
8237
8244
  e.preventDefault();
8238
8245
  let t = parseInt(e.key, 10);
8239
- if (Z.current === 0) ge.current = t, U(String(t).padStart(2, "0")), Z.current = 1, X.current?.dispatchEvent(new Event("input", { bubbles: !0 })), t >= 3 && (ge.current = -1, Z.current = 0, Ae(), q.current?.focus());
8240
- else {
8241
- let e = ge.current * 10 + t;
8242
- U(e <= 23 ? String(e).padStart(2, "0") : String(t).padStart(2, "0")), ge.current = -1, Z.current = 0, Ae(), q.current?.focus();
8246
+ if (Z.current === 0) {
8247
+ ge.current = t;
8248
+ let e = String(t).padStart(2, "0");
8249
+ W(e), Z.current = 1, X.current?.dispatchEvent(new Event("input", { bubbles: !0 })), t >= 3 && (ge.current = -1, Z.current = 0, Ae(), J.current?.focus());
8250
+ } else {
8251
+ let e = ge.current * 10 + t, n = e <= 23 ? String(e).padStart(2, "0") : String(t).padStart(2, "0");
8252
+ W(n), ge.current = -1, Z.current = 0, Ae(), J.current?.focus();
8243
8253
  }
8244
8254
  } else e.preventDefault();
8245
8255
  }
8246
8256
  }, [
8247
- R,
8257
+ z,
8248
8258
  Q,
8249
- U,
8259
+ W,
8250
8260
  Ae,
8251
8261
  je
8252
8262
  ]), Le = o(() => {
8253
- be(!0), V.current !== "" && U(String(parseInt(V.current, 10)).padStart(2, "0")), Z.current = 0, ge.current = -1, ke();
8254
- }, [U, ke]), Re = o((e) => {
8255
- me.current?.setCustomValidity("");
8256
- let t = e.currentTarget, n = V.current;
8263
+ if (be(!0), H.current !== "") {
8264
+ let e = String(parseInt(H.current, 10)).padStart(2, "0");
8265
+ W(e);
8266
+ }
8267
+ Z.current = 0, ge.current = -1, ke();
8268
+ }, [W, ke]), Re = o((e) => {
8269
+ pe.current?.setCustomValidity("");
8270
+ let t = e.currentTarget, n = H.current;
8257
8271
  switch (e.key) {
8258
8272
  case "ArrowUp": {
8259
8273
  e.preventDefault();
8260
- let t = H.current === "" ? 0 : parseInt(H.current, 10), r = String((t + Se) % 60).padStart(2, "0");
8261
- if (W(r), n !== "") {
8274
+ let t = U.current === "" ? 0 : parseInt(U.current, 10), r = String((t + Se) % 60).padStart(2, "0");
8275
+ if (G(r), n !== "") {
8262
8276
  let e = `${n}:${r}`;
8263
- e === R ? X.current?.dispatchEvent(new Event("input", { bubbles: !0 })) : Q(e);
8277
+ e === z ? X.current?.dispatchEvent(new Event("input", { bubbles: !0 })) : Q(e);
8264
8278
  }
8265
8279
  break;
8266
8280
  }
8267
8281
  case "ArrowDown": {
8268
8282
  e.preventDefault();
8269
- let t = H.current === "" ? 0 : parseInt(H.current, 10), r = String((t - Se + 60) % 60).padStart(2, "0");
8270
- if (W(r), n !== "") {
8283
+ let t = U.current === "" ? 0 : parseInt(U.current, 10), r = String((t - Se + 60) % 60).padStart(2, "0");
8284
+ if (G(r), n !== "") {
8271
8285
  let e = `${n}:${r}`;
8272
- e === R ? X.current?.dispatchEvent(new Event("input", { bubbles: !0 })) : Q(e);
8286
+ e === z ? X.current?.dispatchEvent(new Event("input", { bubbles: !0 })) : Q(e);
8273
8287
  }
8274
8288
  break;
8275
8289
  }
8276
8290
  case "ArrowLeft":
8277
- e.preventDefault(), me.current?.focus();
8291
+ e.preventDefault(), pe.current?.focus();
8278
8292
  break;
8279
8293
  case "Backspace":
8280
8294
  case "Delete": {
8281
8295
  e.preventDefault(), _e.current = 0, ve.current = -1;
8282
- let t = H.current;
8283
- t.length > 0 && W(t.slice(0, -1)), Ae();
8296
+ let t = U.current;
8297
+ t.length > 0 && G(t.slice(0, -1)), Ae();
8284
8298
  break;
8285
8299
  }
8286
8300
  case "Tab": break;
@@ -8293,29 +8307,36 @@ function zo(e, t) {
8293
8307
  default: if (/^\d$/.test(e.key)) {
8294
8308
  e.preventDefault();
8295
8309
  let t = parseInt(e.key, 10);
8296
- if (_e.current === 0) ve.current = t, W(String(t).padStart(2, "0")), _e.current = 1, X.current?.dispatchEvent(new Event("input", { bubbles: !0 })), t >= 6 && (ve.current = -1, _e.current = 0, Ae());
8297
- else {
8298
- let e = ve.current * 10 + t;
8299
- W(e <= 59 ? String(e).padStart(2, "0") : String(t).padStart(2, "0")), ve.current = -1, _e.current = 0, Ae();
8310
+ if (_e.current === 0) {
8311
+ ve.current = t;
8312
+ let e = String(t).padStart(2, "0");
8313
+ G(e), _e.current = 1, X.current?.dispatchEvent(new Event("input", { bubbles: !0 })), t >= 6 && (ve.current = -1, _e.current = 0, Ae());
8314
+ } else {
8315
+ let e = ve.current * 10 + t, n = e <= 59 ? String(e).padStart(2, "0") : String(t).padStart(2, "0");
8316
+ G(n), ve.current = -1, _e.current = 0, Ae();
8300
8317
  }
8301
8318
  } else e.preventDefault();
8302
8319
  }
8303
8320
  }, [
8304
8321
  Se,
8305
- R,
8322
+ z,
8306
8323
  Q,
8307
- W,
8324
+ G,
8308
8325
  Ae,
8309
8326
  je
8310
8327
  ]), $ = o(() => {
8311
- be(!0), H.current !== "" && W(String(parseInt(H.current, 10)).padStart(2, "0")), _e.current = 0, ve.current = -1, ke();
8312
- }, [W, ke]), ze = o((e) => {
8328
+ if (be(!0), U.current !== "") {
8329
+ let e = String(parseInt(U.current, 10)).padStart(2, "0");
8330
+ G(e);
8331
+ }
8332
+ _e.current = 0, ve.current = -1, ke();
8333
+ }, [G, ke]), ze = o((e) => {
8313
8334
  let t = document.activeElement, n = t.closest(".pkt-timepicker-popup__col");
8314
8335
  if (!n) return;
8315
8336
  let r = Array.from(n.querySelectorAll(".pkt-timepicker-popup__option")), i = r.indexOf(t), a = (e) => {
8316
8337
  if (!e) return;
8317
8338
  let n = parseInt(e.dataset.value ?? "0", 10), r = String(n).padStart(2, "0");
8318
- t.dataset.type === "hour" ? U(r) : W(r), e.focus();
8339
+ t.dataset.type === "hour" ? W(r) : G(r), e.focus();
8319
8340
  };
8320
8341
  switch (e.key) {
8321
8342
  case "ArrowDown":
@@ -8333,8 +8354,8 @@ function zo(e, t) {
8333
8354
  case "ArrowRight":
8334
8355
  if (e.preventDefault(), t.dataset.type === "hour") {
8335
8356
  let e = parseInt(t.dataset.value ?? "0", 10);
8336
- U(String(e).padStart(2, "0")), requestAnimationFrame(() => {
8337
- J.current?.querySelectorAll(".pkt-timepicker-popup__col").forEach((e) => {
8357
+ W(String(e).padStart(2, "0")), requestAnimationFrame(() => {
8358
+ he.current?.querySelectorAll(".pkt-timepicker-popup__col").forEach((e) => {
8338
8359
  e.querySelector(".pkt-timepicker-popup__option--selected")?.scrollIntoView({ block: "center" });
8339
8360
  }), Ne("minute");
8340
8361
  });
@@ -8343,8 +8364,8 @@ function zo(e, t) {
8343
8364
  case "ArrowLeft":
8344
8365
  if (e.preventDefault(), t.dataset.type === "minute") {
8345
8366
  let e = parseInt(t.dataset.value ?? "0", 10);
8346
- W(String(e).padStart(2, "0")), requestAnimationFrame(() => {
8347
- J.current?.querySelectorAll(".pkt-timepicker-popup__col").forEach((e) => {
8367
+ G(String(e).padStart(2, "0")), requestAnimationFrame(() => {
8368
+ he.current?.querySelectorAll(".pkt-timepicker-popup__col").forEach((e) => {
8348
8369
  e.querySelector(".pkt-timepicker-popup__option--selected")?.scrollIntoView({ block: "center" });
8349
8370
  }), Ne("hour");
8350
8371
  });
@@ -8354,18 +8375,15 @@ function zo(e, t) {
8354
8375
  case " ":
8355
8376
  e.preventDefault(), t.click();
8356
8377
  break;
8357
- case "Escape":
8358
- e.preventDefault(), Me(), he.current?.focus();
8359
- break;
8360
- default: break;
8378
+ case "Escape": e.preventDefault(), Me(), me.current?.focus();
8361
8379
  }
8362
8380
  }, [
8363
8381
  Me,
8364
8382
  Ne,
8365
- U,
8366
- W
8383
+ W,
8384
+ G
8367
8385
  ]), Be = o((e) => {
8368
- let t = J.current;
8386
+ let t = he.current;
8369
8387
  if (!t) return;
8370
8388
  let n = e.relatedTarget;
8371
8389
  (!n || !t.contains(n)) && Me();
@@ -8373,17 +8391,17 @@ function zo(e, t) {
8373
8391
  let t = Y.current;
8374
8392
  if (!t) return;
8375
8393
  let n = e.relatedTarget;
8376
- n && t.contains(n) || ie?.(e);
8377
- }, [ie]), He = o((e) => {
8394
+ n && t.contains(n) || re?.(e);
8395
+ }, [re]), He = o((e) => {
8378
8396
  let t = Y.current;
8379
8397
  if (!t) return;
8380
8398
  let n = e.relatedTarget;
8381
- n && t.contains(n) || ae?.(e);
8382
- }, [ae]), Ue = o(() => {
8383
- b || (G ? Me() : de(!0));
8399
+ n && t.contains(n) || ie?.(e);
8400
+ }, [ie]), Ue = o(() => {
8401
+ b || (K ? Me() : ue(!0));
8384
8402
  }, [
8385
8403
  b,
8386
- G,
8404
+ K,
8387
8405
  Me
8388
8406
  ]);
8389
8407
  return u(t, () => ({
@@ -8392,46 +8410,46 @@ function zo(e, t) {
8392
8410
  },
8393
8411
  set value(e) {
8394
8412
  let t = e ?? "";
8395
- se || L(t);
8413
+ oe || R(t);
8396
8414
  let [n, r] = Fo(t);
8397
- U(n), W(r), X.current && (X.current.value = t);
8415
+ W(n), G(r), X.current && (X.current.value = t);
8398
8416
  },
8399
8417
  focus() {
8400
- me.current?.focus();
8418
+ pe.current?.focus();
8401
8419
  },
8402
8420
  blur() {
8403
- me.current?.blur();
8421
+ pe.current?.blur();
8404
8422
  }
8405
8423
  }), [
8406
- se,
8407
- U,
8408
- W
8424
+ oe,
8425
+ W,
8426
+ G
8409
8427
  ]), c(() => {
8410
8428
  let e = Y.current?.closest("form");
8411
8429
  if (!e) return;
8412
8430
  let t = () => {
8413
8431
  window.setTimeout(() => {
8414
- let e = F.current, [t, n] = Fo(e);
8415
- U(t), W(n), se || L(e), X.current && (X.current.value = e), de(!1), be(!1);
8432
+ let e = I.current, [t, n] = Fo(e);
8433
+ W(t), G(n), oe || R(e), X.current && (X.current.value = e), ue(!1), be(!1);
8416
8434
  }, 0);
8417
8435
  };
8418
8436
  return e.addEventListener("reset", t), () => e.removeEventListener("reset", t);
8419
8437
  }, [
8420
- se,
8421
- U,
8422
- W
8438
+ oe,
8439
+ W,
8440
+ G
8423
8441
  ]), {
8424
8442
  id: n,
8425
8443
  containerRef: Y,
8426
8444
  outerClasses: [
8427
8445
  "pkt-timepicker",
8428
- `pkt-timepicker--${P}`,
8446
+ `pkt-timepicker--${F}`,
8429
8447
  v ? "pkt-timepicker--fullwidth" : "",
8430
8448
  _ ? "pkt-timepicker--stepper" : "",
8431
- ne ?? ""
8449
+ te ?? ""
8432
8450
  ].filter(Boolean).join(" "),
8433
- inputSize: P,
8434
- strings: oe,
8451
+ inputSize: F,
8452
+ strings: ae,
8435
8453
  label: r,
8436
8454
  disabled: b,
8437
8455
  required: x,
@@ -8439,7 +8457,7 @@ function zo(e, t) {
8439
8457
  helptextDropdown: C,
8440
8458
  helptextDropdownButton: w,
8441
8459
  hasError: T,
8442
- isInvalid: K,
8460
+ isInvalid: q,
8443
8461
  errorMessage: E,
8444
8462
  optionalTag: D,
8445
8463
  optionalText: O,
@@ -8448,26 +8466,26 @@ function zo(e, t) {
8448
8466
  tagText: j,
8449
8467
  inline: M,
8450
8468
  useWrapper: N,
8451
- ariaDescribedby: ee,
8469
+ ariaDescribedby: P,
8452
8470
  hidePicker: g,
8453
8471
  stepArrows: _,
8454
8472
  min: s,
8455
8473
  max: l,
8456
8474
  step: h,
8457
- hours: le,
8458
- minutes: B,
8475
+ hours: ce,
8476
+ minutes: V,
8459
8477
  hoursId: Te,
8460
8478
  minutesId: Ee,
8461
8479
  popupId: De,
8462
8480
  hiddenInputId: Oe,
8463
8481
  name: y ?? n,
8464
- isOpen: G,
8482
+ isOpen: K,
8465
8483
  hourOptions: Ce,
8466
8484
  minuteOptions: we,
8467
- hoursInputRef: me,
8468
- minutesInputRef: q,
8469
- buttonRef: he,
8470
- popupRef: J,
8485
+ hoursInputRef: pe,
8486
+ minutesInputRef: J,
8487
+ buttonRef: me,
8488
+ popupRef: he,
8471
8489
  changeInputRef: X,
8472
8490
  handleHoursKeydown: Ie,
8473
8491
  handleHoursBlur: Le,
@@ -8481,7 +8499,7 @@ function zo(e, t) {
8481
8499
  handleClockButtonClick: Ue,
8482
8500
  closePopup: Me,
8483
8501
  stepTimeDelta: Fe,
8484
- effectiveValue: R
8502
+ effectiveValue: z
8485
8503
  };
8486
8504
  }
8487
8505
  //#endregion
@@ -8546,7 +8564,7 @@ var Bo = i((e, t) => {
8546
8564
  "aria-label": i.strings.prevTime,
8547
8565
  disabled: i.disabled,
8548
8566
  onClick: () => i.stepTimeDelta(-1),
8549
- children: [/* @__PURE__ */ g(F, { name: "chevron-thin-left" }), /* @__PURE__ */ g("span", {
8567
+ children: [/* @__PURE__ */ g(I, { name: "chevron-thin-left" }), /* @__PURE__ */ g("span", {
8550
8568
  className: "pkt-btn__text",
8551
8569
  children: i.strings.prevTime
8552
8570
  })]
@@ -8615,7 +8633,7 @@ var Bo = i((e, t) => {
8615
8633
  onChange: () => {},
8616
8634
  onPaste: (e) => e.preventDefault()
8617
8635
  }),
8618
- i.hidePicker && !i.stepArrows && /* @__PURE__ */ g(F, {
8636
+ i.hidePicker && !i.stepArrows && /* @__PURE__ */ g(I, {
8619
8637
  className: "pkt-input-icon pkt-timepicker__icon",
8620
8638
  name: "clock",
8621
8639
  "aria-hidden": !0
@@ -8630,7 +8648,7 @@ var Bo = i((e, t) => {
8630
8648
  "aria-controls": i.popupId,
8631
8649
  disabled: i.disabled,
8632
8650
  onClick: i.handleClockButtonClick,
8633
- children: [/* @__PURE__ */ g(F, { name: "clock" }), /* @__PURE__ */ g("span", {
8651
+ children: [/* @__PURE__ */ g(I, { name: "clock" }), /* @__PURE__ */ g("span", {
8634
8652
  className: "pkt-btn__text",
8635
8653
  children: i.strings.openPicker
8636
8654
  })]
@@ -8641,7 +8659,7 @@ var Bo = i((e, t) => {
8641
8659
  "aria-label": i.strings.nextTime,
8642
8660
  disabled: i.disabled,
8643
8661
  onClick: () => i.stepTimeDelta(1),
8644
- children: [/* @__PURE__ */ g(F, { name: "chevron-thin-right" }), /* @__PURE__ */ g("span", {
8662
+ children: [/* @__PURE__ */ g(I, { name: "chevron-thin-right" }), /* @__PURE__ */ g("span", {
8645
8663
  className: "pkt-btn__text",
8646
8664
  children: i.strings.nextTime
8647
8665
  })]
@@ -8693,4 +8711,4 @@ var Bo = i((e, t) => {
8693
8711
  });
8694
8712
  Bo.displayName = "PktTimepicker";
8695
8713
  //#endregion
8696
- export { Yr as FileItem, Qi as ItemRenderers, A as PktAccordion, I as PktAccordionItem, R as PktAlert, le as PktBackLink, z as PktBreadcrumbs, L as PktButton, mn as PktCalendar, gn as PktCard, _n as PktCheckbox, Xn as PktCombobox, nr as PktConsent, yr as PktDatepicker, $i as PktFileUpload, Ta as PktFooter, Da as PktFooterSimple, to as PktHeader, Za as PktHeaderGlobal, ja as PktHeaderMenu, eo as PktHeaderService, io as PktHeading, wn as PktHelptext, F as PktIcon, ao as PktInput, Tn as PktInputWrapper, Ba as PktLink, oo as PktLinkCard, co as PktLoader, lo as PktMessagebox, ki as PktModal, vi as PktProgressbar, uo as PktRadioButton, Ga as PktSearchInput, fo as PktSelect, go as PktStep, _o as PktStepper, wo as PktTabItem, vo as PktTable, yo as PktTableBody, bo as PktTableDataCell, xo as PktTableHeader, So as PktTableHeaderCell, Co as PktTableRow, Do as PktTabs, hn as PktTag, $r as PktTextarea, Qa as PktTextinput, Bo as PktTimepicker };
8714
+ export { Yr as FileItem, Qi as ItemRenderers, A as PktAccordion, L as PktAccordionItem, z as PktAlert, ce as PktBackLink, B as PktBreadcrumbs, R as PktButton, mn as PktCalendar, gn as PktCard, _n as PktCheckbox, Xn as PktCombobox, nr as PktConsent, yr as PktDatepicker, $i as PktFileUpload, Ta as PktFooter, Da as PktFooterSimple, to as PktHeader, Za as PktHeaderGlobal, ja as PktHeaderMenu, eo as PktHeaderService, io as PktHeading, wn as PktHelptext, I as PktIcon, ao as PktInput, Tn as PktInputWrapper, Ba as PktLink, oo as PktLinkCard, co as PktLoader, lo as PktMessagebox, ki as PktModal, vi as PktProgressbar, uo as PktRadioButton, Ga as PktSearchInput, fo as PktSelect, go as PktStep, _o as PktStepper, wo as PktTabItem, vo as PktTable, yo as PktTableBody, bo as PktTableDataCell, xo as PktTableHeader, So as PktTableHeaderCell, Co as PktTableRow, Do as PktTabs, hn as PktTag, $r as PktTextarea, Qa as PktTextinput, Bo as PktTimepicker };