webim-adapter 2.6.6 → 2.6.7

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.
@@ -2341,43 +2341,56 @@ function cr(e, t, n = "directions", r = "") {
2341
2341
  let i = `${e},${t}`;
2342
2342
  return n === "place" ? `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(i)}${r ? "&query_place_id=" : ""}` : `https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(i)}`;
2343
2343
  }
2344
- var lr = (e, t, n = 13) => `https://www.openstreetmap.org/?mlat=${e}&mlon=${t}#map=${Math.round(Number(n) || 13)}/${e}/${t}`;
2345
- function ur({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize: a = 22, pinLink: o = "directions", link: s = !1, label: l = "", style: u, nodeRef: p, inert: m }) {
2346
- let h = d(null), [v, y] = f(1200);
2344
+ var lr = "https://tile.openstreetmap.org/{z}/{x}/{y}.png", ur = (e) => {
2345
+ let t = String(e ?? "").trim();
2346
+ return /^https?:\/\//i.test(t) && t.includes("{z}") && t.includes("{x}") && t.includes("{y}") ? t : lr;
2347
+ }, dr = (e) => {
2348
+ try {
2349
+ return new URL(e.replace(/[{}]/g, "")).host;
2350
+ } catch {
2351
+ return e;
2352
+ }
2353
+ }, fr = (e, t, n = 13) => `https://www.openstreetmap.org/?mlat=${e}&mlon=${t}#map=${Math.round(Number(n) || 13)}/${e}/${t}`;
2354
+ function pr({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize: a = 22, pinLink: o = "directions", link: s = !1, label: l = "", tileUrl: u = "", tileError: p = "", style: m, nodeRef: h, inert: v }) {
2355
+ let y = d(null), [b, x] = f(1200), S = ur(u), [C, w] = f({
2356
+ key: "",
2357
+ failed: 0,
2358
+ loaded: 0
2359
+ });
2347
2360
  c(() => {
2348
- let e = h.current;
2361
+ let e = y.current;
2349
2362
  if (!e || typeof ResizeObserver > "u") return;
2350
- let t = () => y((t) => e.clientWidth && e.clientWidth !== t ? e.clientWidth : t);
2363
+ let t = () => x((t) => e.clientWidth && e.clientWidth !== t ? e.clientWidth : t);
2351
2364
  t();
2352
2365
  let n = new ResizeObserver(t);
2353
2366
  return n.observe(e), () => n.disconnect();
2354
2367
  }, []);
2355
- let b = (Array.isArray(e) ? e : []).filter(sr), x = sr({
2368
+ let T = (Array.isArray(e) ? e : []).filter(sr), E = sr({
2356
2369
  lat: t,
2357
2370
  lng: n
2358
2371
  }) ? {
2359
2372
  lat: or(t, 90),
2360
2373
  lng: or(n, 180)
2361
- } : b.length ? {
2362
- lat: b.reduce((e, t) => e + or(t.lat, 90), 0) / b.length,
2363
- lng: b.reduce((e, t) => e + or(t.lng, 180), 0) / b.length
2364
- } : null, S = Math.max(80, Number(i) || 320), C = or(r, 19) ? Math.min(Math.max(Math.round(Number(r)), 1), 19) : (() => {
2365
- if (b.length < 2) return 13;
2374
+ } : T.length ? {
2375
+ lat: T.reduce((e, t) => e + or(t.lat, 90), 0) / T.length,
2376
+ lng: T.reduce((e, t) => e + or(t.lng, 180), 0) / T.length
2377
+ } : null, D = Math.max(80, Number(i) || 320), O = or(r, 19) ? Math.min(Math.max(Math.round(Number(r)), 1), 19) : (() => {
2378
+ if (T.length < 2) return 13;
2366
2379
  for (let e = 19; e >= 1; e--) {
2367
- let t = b.map((t) => ar(or(t.lat, 90), or(t.lng, 180), e)), n = Math.max(...t.map((e) => e.x)) - Math.min(...t.map((e) => e.x)), r = Math.max(...t.map((e) => e.y)) - Math.min(...t.map((e) => e.y));
2368
- if (n <= v * .8 && r <= S * .7) return e;
2380
+ let t = T.map((t) => ar(or(t.lat, 90), or(t.lng, 180), e)), n = Math.max(...t.map((e) => e.x)) - Math.min(...t.map((e) => e.x)), r = Math.max(...t.map((e) => e.y)) - Math.min(...t.map((e) => e.y));
2381
+ if (n <= b * .8 && r <= D * .7) return e;
2369
2382
  }
2370
2383
  return 1;
2371
- })(), w = {
2384
+ })(), k = {
2372
2385
  width: "100%",
2373
- ...G(u)
2386
+ ...G(m)
2374
2387
  };
2375
- if (!x) return /* @__PURE__ */ g("div", {
2388
+ if (!E) return /* @__PURE__ */ g("div", {
2376
2389
  ref: (e) => {
2377
- h.current = e, typeof p == "function" && p(e);
2390
+ y.current = e, typeof h == "function" && h(e);
2378
2391
  },
2379
2392
  style: {
2380
- ...w,
2393
+ ...k,
2381
2394
  minHeight: 80,
2382
2395
  display: "grid",
2383
2396
  placeItems: "center",
@@ -2388,51 +2401,85 @@ function ur({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
2388
2401
  },
2389
2402
  children: "Set the coordinates in Settings"
2390
2403
  });
2391
- let T = ar(x.lat, x.lng, C), E = {
2392
- x: T.x - v / 2,
2393
- y: T.y - S / 2
2394
- }, D = [], O = [];
2395
- for (let e = Math.floor(E.x / rr); e <= Math.floor((E.x + v) / rr); e++) D.push(e);
2396
- for (let e = Math.floor(E.y / rr); e <= Math.floor((E.y + S) / rr); e++) O.push(e);
2397
- let k = 2 ** C;
2404
+ let A = ar(E.lat, E.lng, O), j = {
2405
+ x: A.x - b / 2,
2406
+ y: A.y - D / 2
2407
+ }, M = [], N = [];
2408
+ for (let e = Math.floor(j.x / rr); e <= Math.floor((j.x + b) / rr); e++) M.push(e);
2409
+ for (let e = Math.floor(j.y / rr); e <= Math.floor((j.y + D) / rr); e++) N.push(e);
2410
+ let P = 2 ** O, F = `${S}|${O}`, I = C.key === F ? C : {
2411
+ key: F,
2412
+ failed: 0,
2413
+ loaded: 0
2414
+ }, L = (e) => w((t) => {
2415
+ let n = t.key === F ? t : {
2416
+ key: F,
2417
+ failed: 0,
2418
+ loaded: 0
2419
+ };
2420
+ return {
2421
+ ...n,
2422
+ [e]: n[e] + 1
2423
+ };
2424
+ }), R = I.failed > 0 && I.loaded === 0;
2398
2425
  return /* @__PURE__ */ _("div", {
2399
2426
  ref: (e) => {
2400
- h.current = e, typeof p == "function" && p(e);
2427
+ y.current = e, typeof h == "function" && h(e);
2401
2428
  },
2402
- style: w,
2429
+ style: k,
2403
2430
  children: [/* @__PURE__ */ _("div", {
2404
2431
  role: "img",
2405
2432
  "aria-label": l || "Map",
2406
2433
  ...X("map"),
2407
2434
  style: {
2408
2435
  position: "relative",
2409
- height: S,
2436
+ height: D,
2410
2437
  overflow: "hidden",
2411
2438
  borderRadius: "inherit",
2412
2439
  background: "var(--page-surface, #e5e7eb)"
2413
2440
  },
2414
2441
  children: [
2415
- O.map((e) => D.map((t) => {
2416
- let n = (t % k + k) % k;
2417
- return e < 0 || e >= k ? null : /* @__PURE__ */ g("img", {
2418
- src: `https://tile.openstreetmap.org/${C}/${n}/${e}.png`,
2442
+ N.map((e) => M.map((t) => {
2443
+ let n = (t % P + P) % P;
2444
+ return e < 0 || e >= P ? null : /* @__PURE__ */ g("img", {
2445
+ src: S.replace("{z}", O).replace("{x}", n).replace("{y}", e),
2419
2446
  alt: "",
2447
+ onLoad: () => L("loaded"),
2448
+ onError: (e) => {
2449
+ e.currentTarget.style.visibility = "hidden", L("failed");
2450
+ },
2420
2451
  width: rr,
2421
2452
  height: rr,
2422
2453
  loading: "lazy",
2423
2454
  style: {
2424
2455
  position: "absolute",
2425
- left: Math.round(t * rr - E.x),
2426
- top: Math.round(e * rr - E.y),
2456
+ left: Math.round(t * rr - j.x),
2457
+ top: Math.round(e * rr - j.y),
2427
2458
  width: rr,
2428
2459
  height: rr,
2429
2460
  userSelect: "none",
2430
2461
  pointerEvents: "none"
2431
2462
  }
2432
- }, `${t}-${e}`);
2463
+ }, `${F}:${t}-${e}`);
2433
2464
  })),
2434
- b.map((e, t) => {
2435
- let n = ar(or(e.lat, 90), or(e.lng, 180), C), r = n.x - E.x, i = n.y - E.y, s = e.color || "var(--page-accent, #dc2626)", c = o === "none" || m ? null : cr(or(e.lat, 90), or(e.lng, 180), o, e.title);
2465
+ R && v && p ? /* @__PURE__ */ g("div", {
2466
+ style: {
2467
+ ...ke,
2468
+ position: "absolute",
2469
+ left: 12,
2470
+ right: 12,
2471
+ top: 12,
2472
+ padding: "8px 12px",
2473
+ borderRadius: 8,
2474
+ background: "rgba(15, 23, 42, 0.78)",
2475
+ color: "#fff",
2476
+ fontSize: 12,
2477
+ lineHeight: 1.45
2478
+ },
2479
+ children: p.replace("{host}", dr(S))
2480
+ }) : null,
2481
+ T.map((e, t) => {
2482
+ let n = ar(or(e.lat, 90), or(e.lng, 180), O), r = n.x - j.x, i = n.y - j.y, s = e.color || "var(--page-accent, #dc2626)", c = o === "none" || v ? null : cr(or(e.lat, 90), or(e.lng, 180), o, e.title);
2436
2483
  return /* @__PURE__ */ _(c ? "a" : "span", {
2437
2484
  ...X("pin"),
2438
2485
  href: c || void 0,
@@ -2473,8 +2520,8 @@ function ur({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
2473
2520
  viewBox: "0 0 24 24",
2474
2521
  fill: s,
2475
2522
  style: { display: "block" },
2476
- children: [/* @__PURE__ */ g("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }), dr[e.icon] ? /* @__PURE__ */ g("path", {
2477
- d: dr[e.icon],
2523
+ children: [/* @__PURE__ */ g("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }), mr[e.icon] ? /* @__PURE__ */ g("path", {
2524
+ d: mr[e.icon],
2478
2525
  transform: "translate(12 10.5) scale(0.46) translate(-12 -12)",
2479
2526
  fill: "none",
2480
2527
  stroke: "#fff",
@@ -2494,7 +2541,7 @@ function ur({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
2494
2541
  href: "https://www.openstreetmap.org/copyright",
2495
2542
  target: "_blank",
2496
2543
  rel: "noopener noreferrer",
2497
- onClick: m ? (e) => e.preventDefault() : void 0,
2544
+ onClick: v ? (e) => e.preventDefault() : void 0,
2498
2545
  ...X("credit"),
2499
2546
  style: {
2500
2547
  position: "absolute",
@@ -2511,10 +2558,10 @@ function ur({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
2511
2558
  })
2512
2559
  ]
2513
2560
  }), s ? /* @__PURE__ */ g("a", {
2514
- href: lr(x.lat, x.lng, C),
2561
+ href: fr(E.lat, E.lng, O),
2515
2562
  target: "_blank",
2516
2563
  rel: "noopener noreferrer",
2517
- onClick: m ? (e) => e.preventDefault() : void 0,
2564
+ onClick: v ? (e) => e.preventDefault() : void 0,
2518
2565
  ...X("link"),
2519
2566
  style: {
2520
2567
  display: "inline-block",
@@ -2526,7 +2573,7 @@ function ur({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
2526
2573
  }) : null]
2527
2574
  });
2528
2575
  }
2529
- var dr = {
2576
+ var mr = {
2530
2577
  check: "M4 12l5 5L20 6",
2531
2578
  close: "M6 6l12 12M18 6L6 18",
2532
2579
  plus: "M12 5v14M5 12h14",
@@ -2624,8 +2671,8 @@ var dr = {
2624
2671
  droplet: "M12 3s6 6.4 6 10.5a6 6 0 0 1-12 0C6 9.4 12 3 12 3z",
2625
2672
  leaf: "M4 20c0-8 6-14 16-14 0 10-6 14-12 14H4zM8 16c2-4 5-6 8-7"
2626
2673
  };
2627
- function fr({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i = 2, color: a = "", href: o = "", target: s = "", label: c = "", style: l, nodeRef: u, inert: d }) {
2628
- let f = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], p = n && f.length > 0, m = f.length ? f : [dr[e] ?? dr.star], h = Math.min(Math.max(Number(r) || 24, 8), 240), _ = a === "accent" ? "var(--page-accent, currentColor)" : a || "currentColor", v = /* @__PURE__ */ g("svg", {
2674
+ function hr({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i = 2, color: a = "", href: o = "", target: s = "", label: c = "", style: l, nodeRef: u, inert: d }) {
2675
+ let f = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], p = n && f.length > 0, m = f.length ? f : [mr[e] ?? mr.star], h = Math.min(Math.max(Number(r) || 24, 8), 240), _ = a === "accent" ? "var(--page-accent, currentColor)" : a || "currentColor", v = /* @__PURE__ */ g("svg", {
2629
2676
  ...X("glyph"),
2630
2677
  viewBox: "0 0 24 24",
2631
2678
  width: h,
@@ -2662,7 +2709,7 @@ function fr({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i
2662
2709
  children: v
2663
2710
  });
2664
2711
  }
2665
- function pr(e, t = {}, n = 0) {
2712
+ function gr(e, t = {}, n = 0) {
2666
2713
  let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" : Jt(e), a = Math.max(0, Number(n) || 0), o = [];
2667
2714
  for (let e of r) {
2668
2715
  let n = e.data ?? e, r = Kt(n, t.imageField), s = (Array.isArray(r) ? r : [r]).map((e) => e && typeof e == "object" ? e.url ?? e.src ?? "" : e).filter((e) => typeof e == "string" && e.trim()), c = t.nameField ? i(Kt(n, t.nameField)) : i(n.name), l = t.hrefField ? i(Kt(n, t.hrefField)) : "";
@@ -2675,7 +2722,7 @@ function pr(e, t = {}, n = 0) {
2675
2722
  }
2676
2723
  return o;
2677
2724
  }
2678
- function mr({ images: e = [], source: t = "", entry: n = "", imageField: r = "", nameField: i = "", hrefField: a = "", limit: o = 0, emptyText: l = "", columns: u = 3, gap: d = 8, showNames: p = !1, lightbox: m = !0, style: v, nodeRef: y, inert: b }) {
2725
+ function _r({ images: e = [], source: t = "", entry: n = "", imageField: r = "", nameField: i = "", hrefField: a = "", limit: o = 0, emptyText: l = "", columns: u = 3, gap: d = 8, showNames: p = !1, lightbox: m = !0, style: v, nodeRef: y, inert: b }) {
2679
2726
  let { tenant: x, apiUrl: S } = s(Y), C = s(Pt)?.[t], [w, T] = f(null), [E, D] = f(() => /* @__PURE__ */ new Set());
2680
2727
  c(() => {
2681
2728
  if (!t || C) return;
@@ -2693,7 +2740,7 @@ function mr({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
2693
2740
  C
2694
2741
  ]);
2695
2742
  let O = C ?? w ?? [], k = n ? O.filter((e) => e?.id === n || e?.data?.slug === n || e?.slug === n) : O, A = Math.max(0, Number(o) || 0), j = t ? (() => {
2696
- let e = pr(k, {
2743
+ let e = gr(k, {
2697
2744
  imageField: r,
2698
2745
  nameField: i,
2699
2746
  hrefField: a
@@ -2902,19 +2949,19 @@ function mr({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
2902
2949
  ]
2903
2950
  });
2904
2951
  }
2905
- var hr = {
2952
+ var vr = {
2906
2953
  color: "inherit",
2907
2954
  textDecoration: "none",
2908
2955
  fontSize: 14,
2909
2956
  opacity: .85
2910
- }, gr = Qt({
2957
+ }, yr = Qt({
2911
2958
  background: "var(--page-surface, #f2f2f2)",
2912
2959
  color: "var(--page-text, #111827)",
2913
2960
  border: "1px solid rgba(148, 163, 184, 0.25)",
2914
2961
  boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
2915
2962
  zIndex: 60
2916
2963
  });
2917
- function _r(e, t = {}, n = "dropdown") {
2964
+ function br(e, t = {}, n = "dropdown") {
2918
2965
  let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], i = (e) => Array.isArray(e) ? e[0] : e, a = (e) => e == null ? "" : Jt(e), o = r.map((e) => {
2919
2966
  let n = e.data ?? {}, r = t.parentField ? i(n[t.parentField]) : null;
2920
2967
  return {
@@ -2956,7 +3003,7 @@ function _r(e, t = {}, n = "dropdown") {
2956
3003
  type: e.children.length ? n : "link"
2957
3004
  }));
2958
3005
  }
2959
- function vr({ brand: e, logo: n, brandHref: r, brandTarget: i, links: a = [], style: o, nodeRef: l, menu: u = "auto", breakpoint: d = 768, source: p = "", labelField: m = "", hrefField: v = "", imageField: y = "", descField: b = "", parentField: x = "", submenu: S = "dropdown" }) {
3006
+ function xr({ brand: e, logo: n, brandHref: r, brandTarget: i, links: a = [], style: o, nodeRef: l, menu: u = "auto", breakpoint: d = 768, source: p = "", labelField: m = "", hrefField: v = "", imageField: y = "", descField: b = "", parentField: x = "", submenu: S = "dropdown" }) {
2960
3007
  let [C, w] = f(null), [T, E] = f(!1), [D, O] = f(!1), [k, A] = f(null), { tenant: j, apiUrl: M } = s(Y), N = s(Pt)?.[p], [P, F] = f(null);
2961
3008
  c(() => {
2962
3009
  if (!p || N) return;
@@ -2977,7 +3024,7 @@ function vr({ brand: e, logo: n, brandHref: r, brandTarget: i, links: a = [], st
2977
3024
  let e = new ResizeObserver(() => E(C.offsetWidth < d));
2978
3025
  return e.observe(C), () => e.disconnect();
2979
3026
  }, [C, d]);
2980
- let I = p ? _r(N ?? P ?? [], {
3027
+ let I = p ? br(N ?? P ?? [], {
2981
3028
  labelField: m,
2982
3029
  hrefField: v,
2983
3030
  imageField: y,
@@ -3008,7 +3055,7 @@ function vr({ brand: e, logo: n, brandHref: r, brandTarget: i, links: a = [], st
3008
3055
  ...X("sublink", n && "sublink-card"),
3009
3056
  href: e.href || "#",
3010
3057
  style: {
3011
- ...hr,
3058
+ ...vr,
3012
3059
  display: n ? "block" : "flex",
3013
3060
  alignItems: n ? void 0 : "center",
3014
3061
  gap: n ? void 0 : 10,
@@ -3114,7 +3161,7 @@ function vr({ brand: e, logo: n, brandHref: r, brandTarget: i, links: a = [], st
3114
3161
  if (!t.length) return /* @__PURE__ */ g("a", {
3115
3162
  ...X("link"),
3116
3163
  href: e.href || "#",
3117
- style: hr,
3164
+ style: vr,
3118
3165
  children: e.label
3119
3166
  }, e.key);
3120
3167
  let n = e.type === "mega";
@@ -3129,7 +3176,7 @@ function vr({ brand: e, logo: n, brandHref: r, brandTarget: i, links: a = [], st
3129
3176
  ...X("link"),
3130
3177
  href: e.href || "#",
3131
3178
  style: {
3132
- ...hr,
3179
+ ...vr,
3133
3180
  cursor: "pointer"
3134
3181
  },
3135
3182
  children: [
@@ -3147,7 +3194,7 @@ function vr({ brand: e, logo: n, brandHref: r, brandTarget: i, links: a = [], st
3147
3194
  }), k === e.key && (n ? /* @__PURE__ */ g("div", {
3148
3195
  ...X("mega-panel"),
3149
3196
  style: {
3150
- ...gr,
3197
+ ...yr,
3151
3198
  position: "absolute",
3152
3199
  left: 0,
3153
3200
  right: 0,
@@ -3164,7 +3211,7 @@ function vr({ brand: e, logo: n, brandHref: r, brandTarget: i, links: a = [], st
3164
3211
  }) : /* @__PURE__ */ g("div", {
3165
3212
  ...X("dropdown-panel"),
3166
3213
  style: {
3167
- ...gr,
3214
+ ...yr,
3168
3215
  position: "absolute",
3169
3216
  top: "100%",
3170
3217
  left: 0,
@@ -3195,7 +3242,7 @@ function vr({ brand: e, logo: n, brandHref: r, brandTarget: i, links: a = [], st
3195
3242
  ...X("mobile-link"),
3196
3243
  href: e.href || "#",
3197
3244
  style: {
3198
- ...hr,
3245
+ ...vr,
3199
3246
  padding: "10px 4px",
3200
3247
  fontWeight: (e.children ?? []).length ? 600 : 400,
3201
3248
  opacity: 1
@@ -3206,7 +3253,7 @@ function vr({ brand: e, logo: n, brandHref: r, brandTarget: i, links: a = [], st
3206
3253
  ]
3207
3254
  });
3208
3255
  }
3209
- function yr({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
3256
+ function Sr({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
3210
3257
  let [i, a] = f(0), o = e.length ? Math.min(i, e.length - 1) : 0;
3211
3258
  return e.length ? /* @__PURE__ */ _("div", {
3212
3259
  ref: r,
@@ -3249,13 +3296,13 @@ function yr({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
3249
3296
  }, e.key))]
3250
3297
  }) : null;
3251
3298
  }
3252
- function br({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i, padY: a, headerBg: o, headerColor: s, openBg: c, openColor: l, borderColor: u, style: d, nodeRef: p }) {
3299
+ function Cr({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i, padY: a, headerBg: o, headerColor: s, openBg: c, openColor: l, borderColor: u, style: d, nodeRef: p }) {
3253
3300
  let [m, h] = f(() => new Set(e.length ? [e[0].key] : []));
3254
3301
  if (!e.length) return null;
3255
3302
  let v = (e, t) => typeof e == "string" && e ? e : t, y = (e, t) => {
3256
3303
  let n = Number(e);
3257
3304
  return e === "" || e == null || !Number.isFinite(n) ? t : n;
3258
- }, b = dr[r], x = (e) => h((t) => {
3305
+ }, b = mr[r], x = (e) => h((t) => {
3259
3306
  let r = new Set(n ? t : []);
3260
3307
  return t.has(e) ? r.delete(e) : r.add(e), r;
3261
3308
  });
@@ -3336,11 +3383,11 @@ function br({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i,
3336
3383
  })
3337
3384
  });
3338
3385
  }
3339
- var xr = {
3386
+ var wr = {
3340
3387
  display: "flex",
3341
3388
  flexDirection: "column",
3342
3389
  gap: "12px"
3343
- }, Sr = {
3390
+ }, Tr = {
3344
3391
  fontSize: "14px",
3345
3392
  fontWeight: 500,
3346
3393
  color: "var(--page-text, #111827)"
@@ -3354,18 +3401,18 @@ var xr = {
3354
3401
  boxSizing: "border-box",
3355
3402
  backgroundColor: "var(--page-surface, #f2f2f2)",
3356
3403
  color: "var(--page-text, #111827)"
3357
- }), Cr = {
3404
+ }), Er = {
3358
3405
  display: "flex",
3359
3406
  alignItems: "center",
3360
3407
  gap: "8px",
3361
3408
  fontSize: "14px",
3362
3409
  color: "var(--page-text, #111827)"
3363
- }, wr = (e) => e ? {
3410
+ }, Dr = (e) => e ? {
3364
3411
  readOnly: !0,
3365
3412
  tabIndex: -1,
3366
3413
  onMouseDown: (e) => e.preventDefault()
3367
3414
  } : {};
3368
- function Tr(e, t) {
3415
+ function Or(e, t) {
3369
3416
  if (!e) return !0;
3370
3417
  let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
3371
3418
  switch (e.op) {
@@ -3379,11 +3426,11 @@ function Tr(e, t) {
3379
3426
  default: return !1;
3380
3427
  }
3381
3428
  }
3382
- var Er = {
3429
+ var kr = {
3383
3430
  display: "flex",
3384
3431
  flexDirection: "column",
3385
3432
  gap: 6
3386
- }, Dr = Qt({
3433
+ }, Ar = Qt({
3387
3434
  font: "inherit",
3388
3435
  fontSize: 15,
3389
3436
  padding: "10px 12px",
@@ -3394,18 +3441,18 @@ var Er = {
3394
3441
  width: "100%",
3395
3442
  boxSizing: "border-box"
3396
3443
  });
3397
- function Or(e, t) {
3444
+ function jr(e, t) {
3398
3445
  let n = Array.isArray(e?.options) ? e.options : [];
3399
3446
  if (!e?.parentField) return n;
3400
3447
  let r = t?.[e.parentField];
3401
3448
  return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
3402
3449
  }
3403
- var kr = "g-recaptcha-response", Ar = (e) => e?.type === "recaptcha" ? kr : e?.name;
3404
- function jr({ field: e, value: t, onChange: n, inert: r, values: i }) {
3450
+ var Mr = "g-recaptcha-response", Nr = (e) => e?.type === "recaptcha" ? Mr : e?.name;
3451
+ function Pr({ field: e, value: t, onChange: n, inert: r, values: i }) {
3405
3452
  let a = /* @__PURE__ */ _("span", {
3406
3453
  ...X("label"),
3407
3454
  style: {
3408
- ...Sr,
3455
+ ...Tr,
3409
3456
  fontSize: 14
3410
3457
  },
3411
3458
  children: [e.label, e.required ? " *" : ""]
@@ -3415,7 +3462,7 @@ function jr({ field: e, value: t, onChange: n, inert: r, values: i }) {
3415
3462
  required: e.required || void 0,
3416
3463
  placeholder: e.placeholder || void 0,
3417
3464
  disabled: r || void 0,
3418
- style: Dr,
3465
+ style: Ar,
3419
3466
  value: t ?? "",
3420
3467
  onChange: (t) => n(e.name, t.target.value)
3421
3468
  };
@@ -3446,11 +3493,11 @@ function jr({ field: e, value: t, onChange: n, inert: r, values: i }) {
3446
3493
  borderRadius: 8,
3447
3494
  display: "block"
3448
3495
  }
3449
- }) : null : e.type === "recaptcha" ? /* @__PURE__ */ g(Ir, {
3496
+ }) : null : e.type === "recaptcha" ? /* @__PURE__ */ g(zr, {
3450
3497
  theme: e.captchaTheme,
3451
3498
  size: e.captchaSize,
3452
3499
  inert: r,
3453
- onChange: (e) => n(kr, e)
3500
+ onChange: (e) => n(Mr, e)
3454
3501
  }) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ g(Bn, {
3455
3502
  url: e.src,
3456
3503
  style: { width: "100%" }
@@ -3465,7 +3512,7 @@ function jr({ field: e, value: t, onChange: n, inert: r, values: i }) {
3465
3512
  }
3466
3513
  }) : null : /* @__PURE__ */ _("label", {
3467
3514
  ...X("field"),
3468
- style: Er,
3515
+ style: kr,
3469
3516
  children: [
3470
3517
  a,
3471
3518
  e.type === "textarea" || e.multiline ? /* @__PURE__ */ g("textarea", {
@@ -3473,7 +3520,7 @@ function jr({ field: e, value: t, onChange: n, inert: r, values: i }) {
3473
3520
  ...X("textarea"),
3474
3521
  rows: 4,
3475
3522
  style: {
3476
- ...Dr,
3523
+ ...Ar,
3477
3524
  resize: "vertical"
3478
3525
  }
3479
3526
  }) : e.type === "select" ? /* @__PURE__ */ _("select", {
@@ -3483,7 +3530,7 @@ function jr({ field: e, value: t, onChange: n, inert: r, values: i }) {
3483
3530
  children: [/* @__PURE__ */ g("option", {
3484
3531
  value: "",
3485
3532
  children: e.placeholder || "—"
3486
- }), Or(e, i).map((e, t) => /* @__PURE__ */ g("option", {
3533
+ }), jr(e, i).map((e, t) => /* @__PURE__ */ g("option", {
3487
3534
  value: typeof e == "string" ? e : e.value,
3488
3535
  children: typeof e == "string" ? e : e.label ?? e.value
3489
3536
  }, t))]
@@ -3533,7 +3580,7 @@ function jr({ field: e, value: t, onChange: n, inert: r, values: i }) {
3533
3580
  ]
3534
3581
  });
3535
3582
  }
3536
- function Mr({ style: e, action: t, method: n, name: r, enctype: i, formSlug: a, auto: o, submitLabel: l, nodeRef: u, inert: d, children: p, linked: m, show: v }) {
3583
+ function Fr({ style: e, action: t, method: n, name: r, enctype: i, formSlug: a, auto: o, submitLabel: l, nodeRef: u, inert: d, children: p, linked: m, show: v }) {
3537
3584
  let { tenant: y, apiUrl: b } = s(Y), [x, S] = f("form"), [C, w] = f(null), [T, E] = f({}), [D, O] = f(0), k = d ? v || "form" : x;
3538
3585
  c(() => {
3539
3586
  if (!o || !a) return;
@@ -3555,11 +3602,11 @@ function Mr({ style: e, action: t, method: n, name: r, enctype: i, formSlug: a,
3555
3602
  section: e,
3556
3603
  fields: []
3557
3604
  }) : A[A.length - 1].fields.push(e);
3558
- let j = A.filter((e) => e.section || e.fields.length), M = j.filter((e) => !e.section || Tr(e.section.condition, T)).map((e) => ({
3605
+ let j = A.filter((e) => e.section || e.fields.length), M = j.filter((e) => !e.section || Or(e.section.condition, T)).map((e) => ({
3559
3606
  ...e,
3560
- fields: e.fields.filter((e) => Tr(e.condition, T))
3607
+ fields: e.fields.filter((e) => Or(e.condition, T))
3561
3608
  })), N = j.length > 1, P = Math.min(D, Math.max(0, M.length - 1)), F = N ? M[P]?.fields ?? [] : M.flatMap((e) => e.fields), I = F.filter((e) => {
3562
- let t = T[Ar(e)];
3609
+ let t = T[Nr(e)];
3563
3610
  return e.required && (t == null || t === "" || t === !1);
3564
3611
  }), L = P >= M.length - 1, R = (e, t) => E((n) => {
3565
3612
  let r = {
@@ -3615,11 +3662,11 @@ function Mr({ style: e, action: t, method: n, name: r, enctype: i, formSlug: a,
3615
3662
  }
3616
3663
  },
3617
3664
  style: {
3618
- ...xr,
3665
+ ...wr,
3619
3666
  display: k === "success" ? "none" : "flex"
3620
3667
  },
3621
3668
  children: o && a ? /* @__PURE__ */ _(h, { children: [
3622
- N && /* @__PURE__ */ g(fi, {
3669
+ N && /* @__PURE__ */ g(hi, {
3623
3670
  steps: M.map((e) => ({ label: e.section?.label ?? "Start" })),
3624
3671
  active: P + 1,
3625
3672
  style: { marginBottom: 8 }
@@ -3633,9 +3680,9 @@ function Mr({ style: e, action: t, method: n, name: r, enctype: i, formSlug: a,
3633
3680
  },
3634
3681
  children: M[P].section.help
3635
3682
  }),
3636
- F.map((e) => /* @__PURE__ */ g(jr, {
3683
+ F.map((e) => /* @__PURE__ */ g(Pr, {
3637
3684
  field: e,
3638
- value: T[Ar(e)],
3685
+ value: T[Nr(e)],
3639
3686
  values: T,
3640
3687
  onChange: R,
3641
3688
  inert: d
@@ -3710,10 +3757,10 @@ function Mr({ style: e, action: t, method: n, name: r, enctype: i, formSlug: a,
3710
3757
  ]
3711
3758
  });
3712
3759
  }
3713
- var Nr = null, Pr = null, Fr = (e) => {
3760
+ var Ir = null, Lr = null, Rr = (e) => {
3714
3761
  let t = typeof e == "string" && e.trim() ? e.trim() : "";
3715
- if (Nr && Pr === t) return Nr;
3716
- if (Nr && typeof window < "u") {
3762
+ if (Ir && Lr === t) return Ir;
3763
+ if (Ir && typeof window < "u") {
3717
3764
  for (let e of ["grecaptcha", "___grecaptcha_cfg"]) try {
3718
3765
  delete window[e];
3719
3766
  } catch {
@@ -3721,22 +3768,22 @@ var Nr = null, Pr = null, Fr = (e) => {
3721
3768
  }
3722
3769
  document.querySelectorAll("script[src*=\"recaptcha\"]").forEach((e) => e.remove());
3723
3770
  }
3724
- return Pr = t, Nr = new Promise((e) => {
3771
+ return Lr = t, Ir = new Promise((e) => {
3725
3772
  if (typeof window > "u") return;
3726
3773
  if (window.grecaptcha?.render) return e(window.grecaptcha);
3727
3774
  window.__webimRecaptchaReady = () => e(window.grecaptcha);
3728
3775
  let n = document.createElement("script");
3729
3776
  n.src = `https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit${t ? `&hl=${encodeURIComponent(t)}` : ""}`, n.async = !0, document.head.appendChild(n);
3730
- }), Nr;
3777
+ }), Ir;
3731
3778
  };
3732
- function Ir({ siteKey: e, theme: t, size: n, hl: r, style: i, nodeRef: a, inert: o, onChange: l }) {
3779
+ function zr({ siteKey: e, theme: t, size: n, hl: r, style: i, nodeRef: a, inert: o, onChange: l }) {
3733
3780
  let u = s(Y), f = u?.settings && typeof u.settings == "object" ? u.settings["google.recaptchaKey"] : "", p = typeof e == "string" && e.trim() || (typeof f == "string" ? f.trim() : ""), m = d(null), h = d(l);
3734
3781
  if (h.current = l, c(() => {
3735
3782
  if (o || !p || !m.current) return;
3736
3783
  let e = !0, i = (t) => {
3737
3784
  e && typeof h.current == "function" && h.current(t);
3738
3785
  };
3739
- return Fr(r).then((r) => {
3786
+ return Rr(r).then((r) => {
3740
3787
  if (!(!e || !m.current || !r?.render)) {
3741
3788
  m.current.innerHTML = "", i("");
3742
3789
  try {
@@ -3818,17 +3865,17 @@ function Ir({ siteKey: e, theme: t, size: n, hl: r, style: i, nodeRef: a, inert:
3818
3865
  children: /* @__PURE__ */ g("div", { ref: m })
3819
3866
  }) : null;
3820
3867
  }
3821
- function Lr({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
3868
+ function Br({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
3822
3869
  return /* @__PURE__ */ g("label", {
3823
3870
  ref: r,
3824
3871
  style: {
3825
- ...Sr,
3872
+ ...Tr,
3826
3873
  ...G(n)
3827
3874
  },
3828
3875
  children: _n(t, e, i)
3829
3876
  });
3830
3877
  }
3831
- function Rr({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
3878
+ function Vr({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
3832
3879
  return /* @__PURE__ */ g("input", {
3833
3880
  ref: a,
3834
3881
  type: e,
@@ -3839,10 +3886,10 @@ function Rr({ type: e = "text", name: t, placeholder: n, required: r, style: i,
3839
3886
  ...Z,
3840
3887
  ...G(i)
3841
3888
  },
3842
- ...wr(o)
3889
+ ...Dr(o)
3843
3890
  });
3844
3891
  }
3845
- function zr({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
3892
+ function Hr({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
3846
3893
  return /* @__PURE__ */ g("textarea", {
3847
3894
  ref: a,
3848
3895
  name: e || void 0,
@@ -3854,14 +3901,14 @@ function zr({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
3854
3901
  resize: "vertical",
3855
3902
  ...G(i)
3856
3903
  },
3857
- ...wr(o)
3904
+ ...Dr(o)
3858
3905
  });
3859
3906
  }
3860
- function Br({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
3907
+ function Ur({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
3861
3908
  return /* @__PURE__ */ _("label", {
3862
3909
  ref: o,
3863
3910
  style: {
3864
- ...Cr,
3911
+ ...Er,
3865
3912
  ...G(a)
3866
3913
  },
3867
3914
  children: [/* @__PURE__ */ g("input", {
@@ -3879,7 +3926,7 @@ function Br({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
3879
3926
  }), t]
3880
3927
  });
3881
3928
  }
3882
- function Vr({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
3929
+ function Wr({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
3883
3930
  return /* @__PURE__ */ _("select", {
3884
3931
  ref: a,
3885
3932
  name: e || void 0,
@@ -3902,7 +3949,7 @@ function Vr({ name: e, placeholder: t, options: n = [], required: r, style: i, n
3902
3949
  }, t))]
3903
3950
  });
3904
3951
  }
3905
- function Hr({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
3952
+ function Gr({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
3906
3953
  let [s, c] = f(null);
3907
3954
  return /* @__PURE__ */ _("label", {
3908
3955
  ref: a,
@@ -3935,7 +3982,7 @@ function Hr({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
3935
3982
  ]
3936
3983
  });
3937
3984
  }
3938
- function Ur({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
3985
+ function Kr({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
3939
3986
  return /* @__PURE__ */ g("button", {
3940
3987
  ref: n,
3941
3988
  type: r ? "button" : "submit",
@@ -3955,7 +4002,7 @@ function Ur({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
3955
4002
  children: e
3956
4003
  });
3957
4004
  }
3958
- function Wr({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
4005
+ function qr({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
3959
4006
  let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
3960
4007
  return /* @__PURE__ */ g("div", {
3961
4008
  ref: r,
@@ -3972,12 +4019,12 @@ function Wr({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
3972
4019
  }, t))
3973
4020
  });
3974
4021
  }
3975
- function Gr(e, t) {
4022
+ function Jr(e, t) {
3976
4023
  if (e === "" || e == null) return t;
3977
4024
  let n = Number(e);
3978
4025
  return Number.isFinite(n) && n >= 0 ? n : t;
3979
4026
  }
3980
- function Kr({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, imageField: i, titleField: a = "name", textField: o, custom: l, templateId: u, renderTemplate: d, paged: p, filters: m, parentField: h, topLevel: v, childrenOf: y, gap: b, style: x, nodeRef: S }) {
4027
+ function Yr({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, imageField: i, titleField: a = "name", textField: o, custom: l, templateId: u, renderTemplate: d, paged: p, filters: m, parentField: h, topLevel: v, childrenOf: y, gap: b, style: x, nodeRef: S }) {
3981
4028
  let { tenant: C, apiUrl: w, locale: T } = s(Y), E = s(Rt), D = s(Pt), O = s(zt), k = y ? null : e, A = !!h && !y, [, j] = f(0);
3982
4029
  c(() => {
3983
4030
  if (typeof window > "u") return;
@@ -4018,11 +4065,11 @@ function Kr({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
4018
4065
  let z = Math.max(1, Number(t) || 6), B = y ? O?.all ?? [] : F ?? L ?? [], V = y ? O?.parentField : h, ee = y ? O?.collection : k, te = y ? Vt(B, V, O?.entry) : A && v ? B.filter((e) => Bt(e, h).length === 0) : B, H = p && (F || y || A || k.startsWith("api:")) ? te.slice((I - 1) * z, I * z) : te.slice(0, z), ne = Math.min(Math.max(Number(r) || 3, 1), 6), U = n === "list" ? {
4019
4066
  display: "flex",
4020
4067
  flexDirection: "column",
4021
- gap: Gr(b, 20)
4068
+ gap: Jr(b, 20)
4022
4069
  } : {
4023
4070
  display: "grid",
4024
4071
  gridTemplateColumns: `repeat(${ne}, minmax(0, 1fr))`,
4025
- gap: Gr(b, 24)
4072
+ gap: Jr(b, 24)
4026
4073
  }, W = d ?? (u && E?.render ? (e) => E.render(u, e) : null);
4027
4074
  return l && W ? /* @__PURE__ */ g("div", {
4028
4075
  ref: S,
@@ -4112,7 +4159,7 @@ function Kr({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
4112
4159
  })
4113
4160
  });
4114
4161
  }
4115
- function qr({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
4162
+ function Xr({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
4116
4163
  let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : It(), s = {
4117
4164
  height: 34,
4118
4165
  padding: "0 12px",
@@ -4162,7 +4209,7 @@ function qr({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
4162
4209
  defaultValue: o[e.name] ?? "",
4163
4210
  ...X("select"),
4164
4211
  style: s,
4165
- ...wr(i),
4212
+ ...Dr(i),
4166
4213
  children: [/* @__PURE__ */ g("option", {
4167
4214
  value: "",
4168
4215
  children: e.label || e.name
@@ -4178,7 +4225,7 @@ function qr({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
4178
4225
  defaultValue: o[e.name] ?? "",
4179
4226
  ...X("select"),
4180
4227
  style: s,
4181
- ...wr(i),
4228
+ ...Dr(i),
4182
4229
  children: [
4183
4230
  /* @__PURE__ */ g("option", {
4184
4231
  value: "",
@@ -4200,7 +4247,7 @@ function qr({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
4200
4247
  placeholder: e.label || e.name,
4201
4248
  ...X("input"),
4202
4249
  style: s,
4203
- ...wr(i)
4250
+ ...Dr(i)
4204
4251
  }, e.name)), /* @__PURE__ */ g("button", {
4205
4252
  type: "submit",
4206
4253
  ...X("button"),
@@ -4214,12 +4261,12 @@ function qr({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
4214
4261
  fontWeight: 600,
4215
4262
  cursor: i ? "default" : "pointer"
4216
4263
  },
4217
- ...wr(i),
4264
+ ...Dr(i),
4218
4265
  children: t
4219
4266
  })]
4220
4267
  });
4221
4268
  }
4222
- function Jr({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
4269
+ function Zr({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
4223
4270
  return e.length ? /* @__PURE__ */ g("nav", {
4224
4271
  ref: r,
4225
4272
  "aria-label": "Breadcrumb",
@@ -4274,7 +4321,7 @@ function Jr({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
4274
4321
  })
4275
4322
  }) : null;
4276
4323
  }
4277
- function Yr({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", source: i, pageSize: a = 6, align: o, hideEmpty: l, inert: u, style: d, nodeRef: p }) {
4324
+ function Qr({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", source: i, pageSize: a = 6, align: o, hideEmpty: l, inert: u, style: d, nodeRef: p }) {
4278
4325
  let { tenant: m, apiUrl: h } = s(Y), v = s(Pt), [y, b] = f(null), x = i ? Number(v?.[`${i}:total`]) : NaN;
4279
4326
  c(() => {
4280
4327
  if (!i || Number.isFinite(x)) return;
@@ -4362,15 +4409,15 @@ function Yr({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sou
4362
4409
  ]
4363
4410
  });
4364
4411
  }
4365
- var Xr = "webim.page_mode", Zr = () => {
4412
+ var $r = "webim.page_mode", ei = () => {
4366
4413
  if (typeof window > "u") return "auto";
4367
4414
  try {
4368
- let e = window.localStorage.getItem(Xr);
4415
+ let e = window.localStorage.getItem($r);
4369
4416
  return e === "light" || e === "dark" ? e : "auto";
4370
4417
  } catch {
4371
4418
  return "auto";
4372
4419
  }
4373
- }, Qr = (e) => {
4420
+ }, ti = (e) => {
4374
4421
  let t = {
4375
4422
  width: 16,
4376
4423
  height: 16,
@@ -4402,13 +4449,13 @@ var Xr = "webim.page_mode", Zr = () => {
4402
4449
  rx: "2"
4403
4450
  }), /* @__PURE__ */ g("path", { d: "M8 21h8M12 17v4" })]
4404
4451
  });
4405
- }, $r = {
4452
+ }, ni = {
4406
4453
  light: "Light theme",
4407
4454
  dark: "Dark theme",
4408
4455
  auto: "Follow the device theme"
4409
4456
  };
4410
- function ei({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
4411
- let [a, o] = f(i ? "auto" : Zr), s = d(null), l = (e) => {
4457
+ function ri({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
4458
+ let [a, o] = f(i ? "auto" : ei), s = d(null), l = (e) => {
4412
4459
  s.current = e, typeof r == "function" && r(e);
4413
4460
  };
4414
4461
  c(() => {
@@ -4416,7 +4463,7 @@ function ei({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
4416
4463
  let e = s.current?.closest?.(".webim-page");
4417
4464
  e && (a === "light" || a === "dark" ? e.setAttribute("data-webim-mode", a) : e.removeAttribute("data-webim-mode"));
4418
4465
  try {
4419
- a === "auto" ? window.localStorage.removeItem(Xr) : window.localStorage.setItem(Xr, a);
4466
+ a === "auto" ? window.localStorage.removeItem($r) : window.localStorage.setItem($r, a);
4420
4467
  } catch {}
4421
4468
  }, [a, i]);
4422
4469
  let u = t === !1 ? ["light", "dark"] : [
@@ -4452,8 +4499,8 @@ function ei({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
4452
4499
  children: u.map((e) => /* @__PURE__ */ g("button", {
4453
4500
  ...X("option", e === p && "option-active"),
4454
4501
  type: "button",
4455
- title: $r[e],
4456
- "aria-label": $r[e],
4502
+ title: ni[e],
4503
+ "aria-label": ni[e],
4457
4504
  "aria-pressed": e === p,
4458
4505
  onClick: i ? void 0 : () => o(e),
4459
4506
  style: {
@@ -4464,15 +4511,15 @@ function ei({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
4464
4511
  background: e === p ? "var(--page-accent, #111827)" : "transparent",
4465
4512
  opacity: e === p ? 1 : .7
4466
4513
  },
4467
- children: Qr(e)
4514
+ children: ti(e)
4468
4515
  }, e))
4469
4516
  });
4470
4517
  let h = u[(u.indexOf(p) + 1) % u.length];
4471
4518
  return /* @__PURE__ */ g("button", {
4472
4519
  ref: l,
4473
4520
  type: "button",
4474
- title: $r[p],
4475
- "aria-label": `Theme: ${$r[p]} — switch to ${$r[h]}`,
4521
+ title: ni[p],
4522
+ "aria-label": `Theme: ${ni[p]} — switch to ${ni[h]}`,
4476
4523
  onClick: i ? void 0 : () => o(h),
4477
4524
  style: {
4478
4525
  ...m,
@@ -4481,10 +4528,10 @@ function ei({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
4481
4528
  border: "1px solid rgba(148, 163, 184, 0.4)",
4482
4529
  ...G(n)
4483
4530
  },
4484
- children: Qr(p)
4531
+ children: ti(p)
4485
4532
  });
4486
4533
  }
4487
- function ti(e) {
4534
+ function ii(e) {
4488
4535
  let t = e?.parentElement;
4489
4536
  for (; t && t !== document.body;) {
4490
4537
  let e = getComputedStyle(t).overflowY;
@@ -4493,7 +4540,7 @@ function ti(e) {
4493
4540
  }
4494
4541
  return window;
4495
4542
  }
4496
- var ni = (e) => e === window ? window.scrollY : e.scrollTop, ri = {
4543
+ var ai = (e) => e === window ? window.scrollY : e.scrollTop, oi = {
4497
4544
  "bottom-right": (e) => ({
4498
4545
  right: e,
4499
4546
  bottom: e
@@ -4507,11 +4554,11 @@ var ni = (e) => e === window ? window.scrollY : e.scrollTop, ri = {
4507
4554
  bottom: e,
4508
4555
  transform: "translateX(-50%)"
4509
4556
  })
4510
- }, ii = {
4557
+ }, si = {
4511
4558
  linear: (e) => e,
4512
4559
  out: (e) => 1 - (1 - e) ** 3,
4513
4560
  inout: (e) => e < .5 ? 4 * e * e * e : 1 - (-2 * e + 2) ** 3 / 2
4514
- }, ai = (e) => {
4561
+ }, ci = (e) => {
4515
4562
  let t = e.getBoundingClientRect(), n = e.parentElement;
4516
4563
  for (; n && n !== document.body;) {
4517
4564
  let e = getComputedStyle(n);
@@ -4519,12 +4566,12 @@ var ni = (e) => e === window ? window.scrollY : e.scrollTop, ri = {
4519
4566
  n = n.parentElement;
4520
4567
  }
4521
4568
  return !n || n === document.body ? Math.max(document.documentElement.scrollHeight - (t.bottom + window.scrollY), 0) : Math.max(n.scrollHeight - (t.bottom - n.getBoundingClientRect().top + n.scrollTop), 0);
4522
- }, oi = (e, t) => {
4569
+ }, li = (e, t) => {
4523
4570
  let n = typeof e == "number" ? e : parseFloat(e);
4524
4571
  return Number.isFinite(n) ? n : t;
4525
4572
  };
4526
- function si(e, { locale: t, decimals: n = 0, separator: r = "auto" } = {}) {
4527
- let i = Math.min(Math.max(Math.round(oi(n, 0)), 0), 6);
4573
+ function ui(e, { locale: t, decimals: n = 0, separator: r = "auto" } = {}) {
4574
+ let i = Math.min(Math.max(Math.round(li(n, 0)), 0), 6);
4528
4575
  try {
4529
4576
  return new Intl.NumberFormat(t || void 0, {
4530
4577
  minimumFractionDigits: i,
@@ -4535,8 +4582,8 @@ function si(e, { locale: t, decimals: n = 0, separator: r = "auto" } = {}) {
4535
4582
  return e.toFixed(i);
4536
4583
  }
4537
4584
  }
4538
- function ci({ from: e, to: t, duration: n, delay: r, decimals: i, prefix: a, suffix: o, separator: l, easing: u, trigger: p, offset: m, once: h, label: v, align: y, style: b, nodeRef: x, inert: S }) {
4539
- let { locale: C } = s(Y), w = Math.max(oi(m, 0), 0), T = oi(e, 0), E = oi(t, 100), [D, O] = f(E), k = d(null), [A, j] = f(!1);
4585
+ function di({ from: e, to: t, duration: n, delay: r, decimals: i, prefix: a, suffix: o, separator: l, easing: u, trigger: p, offset: m, once: h, label: v, align: y, style: b, nodeRef: x, inert: S }) {
4586
+ let { locale: C } = s(Y), w = Math.max(li(m, 0), 0), T = li(e, 0), E = li(t, 100), [D, O] = f(E), k = d(null), [A, j] = f(!1);
4540
4587
  return c(() => {
4541
4588
  let e = k.current;
4542
4589
  if (S || !A || !e) {
@@ -4544,7 +4591,7 @@ function ci({ from: e, to: t, duration: n, delay: r, decimals: i, prefix: a, suf
4544
4591
  return;
4545
4592
  }
4546
4593
  O(T);
4547
- let t = Math.max(oi(n, 2e3), 0), i = Math.max(oi(r, 0), 0), a = ii[u] || ii.out, o = typeof window < "u" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, s = 0, c = 0, l = !1, d = () => {
4594
+ let t = Math.max(li(n, 2e3), 0), i = Math.max(li(r, 0), 0), a = si[u] || si.out, o = typeof window < "u" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, s = 0, c = 0, l = !1, d = () => {
4548
4595
  if (cancelAnimationFrame(s), clearTimeout(c), o || t === 0) {
4549
4596
  O(E);
4550
4597
  return;
@@ -4564,7 +4611,7 @@ function ci({ from: e, to: t, duration: n, delay: r, decimals: i, prefix: a, suf
4564
4611
  let t = e.some((e) => e.isIntersecting);
4565
4612
  t && (!l || h === !1) ? (l = !0, d()) : !t && h === !1 && (cancelAnimationFrame(s), clearTimeout(c), O(T));
4566
4613
  }, {
4567
- rootMargin: `0px 0px -${Math.min(w, Math.floor(ai(e)))}px 0px`,
4614
+ rootMargin: `0px 0px -${Math.min(w, Math.floor(ci(e)))}px 0px`,
4568
4615
  threshold: w > 0 ? 0 : .3
4569
4616
  });
4570
4617
  return f.observe(e), () => {
@@ -4605,7 +4652,7 @@ function ci({ from: e, to: t, duration: n, delay: r, decimals: i, prefix: a, suf
4605
4652
  },
4606
4653
  children: [
4607
4654
  a || "",
4608
- si(D, {
4655
+ ui(D, {
4609
4656
  locale: C,
4610
4657
  decimals: i,
4611
4658
  separator: l
@@ -4624,7 +4671,7 @@ function ci({ from: e, to: t, duration: n, delay: r, decimals: i, prefix: a, suf
4624
4671
  }) : null]
4625
4672
  });
4626
4673
  }
4627
- function li({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth: a, bg: o, fg: s, style: l, nodeRef: u, inert: d, frame: p, builder: m }) {
4674
+ function fi({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth: a, bg: o, fg: s, style: l, nodeRef: u, inert: d, frame: p, builder: m }) {
4628
4675
  let [h, v] = f(!!d), [y, b] = f(null), x = (e) => {
4629
4676
  b(e), typeof u == "function" && u(e);
4630
4677
  };
@@ -4635,8 +4682,8 @@ function li({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
4635
4682
  }
4636
4683
  if (!y) return;
4637
4684
  let e = Number(i) >= 0 ? Number(i) : 300, t = () => {
4638
- let t = ti(y), n = m && !(t === window ? document.documentElement.scrollHeight > window.innerHeight : t.scrollHeight > t.clientHeight);
4639
- v(n || ni(t) > e);
4685
+ let t = ii(y), n = m && !(t === window ? document.documentElement.scrollHeight > window.innerHeight : t.scrollHeight > t.clientHeight);
4686
+ v(n || ai(t) > e);
4640
4687
  };
4641
4688
  return t(), document.addEventListener("scroll", t, {
4642
4689
  capture: !0,
@@ -4650,7 +4697,7 @@ function li({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
4650
4697
  ]);
4651
4698
  let S = () => {
4652
4699
  if (d) return;
4653
- let e = ti(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = a === !1 || t ? "auto" : "smooth";
4700
+ let e = ii(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = a === !1 || t ? "auto" : "smooth";
4654
4701
  e === window ? window.scrollTo({
4655
4702
  top: 0,
4656
4703
  behavior: n
@@ -4658,7 +4705,7 @@ function li({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
4658
4705
  top: 0,
4659
4706
  behavior: n
4660
4707
  });
4661
- }, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E = ri[n] ? n : "bottom-right", D = p ? {
4708
+ }, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E = oi[n] ? n : "bottom-right", D = p ? {
4662
4709
  position: "fixed",
4663
4710
  zIndex: 5,
4664
4711
  bottom: (p.bottom ?? 0) + C,
@@ -4671,7 +4718,7 @@ function li({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
4671
4718
  } : {
4672
4719
  position: "fixed",
4673
4720
  zIndex: 2147482e3,
4674
- ...ri[E](C)
4721
+ ...oi[E](C)
4675
4722
  };
4676
4723
  return /* @__PURE__ */ _("button", {
4677
4724
  ref: x,
@@ -4726,7 +4773,7 @@ function li({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
4726
4773
  }) : null]
4727
4774
  });
4728
4775
  }
4729
- var ui = {
4776
+ var pi = {
4730
4777
  facebook: {
4731
4778
  label: "Facebook",
4732
4779
  color: "#1877f2",
@@ -4793,8 +4840,8 @@ var ui = {
4793
4840
  d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z"
4794
4841
  }
4795
4842
  };
4796
- function di({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
4797
- let l = Array.isArray(e) ? e.filter((e) => e && ui[e.network]) : [];
4843
+ function mi({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
4844
+ let l = Array.isArray(e) ? e.filter((e) => e && pi[e.network]) : [];
4798
4845
  if (!l.length) return null;
4799
4846
  let u = Math.min(Math.max(Number(r) || 18, 10), 64), d = Math.round(u * 1.9), f = Number.isFinite(Number(i)) ? Number(i) : 10, p = (e) => n === "accent" ? "var(--page-accent, #111827)" : n === "inherit" ? "currentColor" : e.color, m = c ? (e) => e.preventDefault() : void 0;
4800
4847
  return /* @__PURE__ */ g("div", {
@@ -4807,7 +4854,7 @@ function di({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
4807
4854
  ...G(o)
4808
4855
  },
4809
4856
  children: l.map((e, r) => {
4810
- let i = ui[e.network], o = t !== "outline" && t !== "plain", s = o ? n === "accent" ? "var(--page-accent-text, #ffffff)" : n === "inherit" ? "var(--page-bg, #ffffff)" : "#ffffff" : p(i);
4857
+ let i = pi[e.network], o = t !== "outline" && t !== "plain", s = o ? n === "accent" ? "var(--page-accent-text, #ffffff)" : n === "inherit" ? "var(--page-bg, #ffffff)" : "#ffffff" : p(i);
4811
4858
  return /* @__PURE__ */ g("a", {
4812
4859
  ...X("link", /^[a-z]+$/.test(e.network ?? "") && `link-${e.network}`),
4813
4860
  href: e.url || "#",
@@ -4843,7 +4890,7 @@ function di({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
4843
4890
  })
4844
4891
  });
4845
4892
  }
4846
- function fi({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
4893
+ function hi({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
4847
4894
  if (!e.length) return null;
4848
4895
  let o = Math.min(Math.max(Number(n) || 1, 1), e.length), s = (e) => ({
4849
4896
  width: 32,
@@ -4926,7 +4973,7 @@ function fi({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
4926
4973
  })
4927
4974
  });
4928
4975
  }
4929
- var pi = {
4976
+ var gi = {
4930
4977
  small: {
4931
4978
  w: 132,
4932
4979
  h: 46,
@@ -4948,21 +4995,21 @@ var pi = {
4948
4995
  title: 12.5,
4949
4996
  avatar: 46
4950
4997
  }
4951
- }, mi = (e) => pi[e] ?? pi.medium;
4952
- pi.medium.w, pi.medium.h;
4953
- var hi = (e) => String(e?.group ?? "").trim(), gi = (e) => {
4998
+ }, _i = (e) => gi[e] ?? gi.medium;
4999
+ gi.medium.w, gi.medium.h;
5000
+ var vi = (e) => String(e?.group ?? "").trim(), yi = (e) => {
4954
5001
  let t = [], n = /* @__PURE__ */ new Map();
4955
5002
  return e.forEach((e, r) => {
4956
- let i = hi(e) || `#${r}`;
5003
+ let i = vi(e) || `#${r}`;
4957
5004
  n.has(i) || (n.set(i, []), t.push(i)), n.get(i).push(e);
4958
5005
  }), t.flatMap((e) => n.get(e));
4959
5006
  };
4960
- function _i(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top" } = {}) {
4961
- let i = mi(t), a = n ? i.h : i.w, o = n ? 16 : 20, s = (n ? i.w : i.h) + (n ? 56 : 48), c = Array.isArray(e) ? e.filter((e) => e && e.id) : [], l = new Set(c.map((e) => e.id)), u = /* @__PURE__ */ new Map(), d = [];
5007
+ function bi(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top" } = {}) {
5008
+ let i = _i(t), a = n ? i.h : i.w, o = n ? 16 : 20, s = (n ? i.w : i.h) + (n ? 56 : 48), c = Array.isArray(e) ? e.filter((e) => e && e.id) : [], l = new Set(c.map((e) => e.id)), u = /* @__PURE__ */ new Map(), d = [];
4962
5009
  for (let e of c) e.parent && l.has(e.parent) && e.parent !== e.id ? (u.has(e.parent) || u.set(e.parent, []), u.get(e.parent).push(e)) : d.push(e);
4963
- d = gi(d);
4964
- for (let [e, t] of u) u.set(e, gi(t));
4965
- let f = (e, t) => o + (hi(e) !== hi(t) && (hi(e) || hi(t)) ? 24 : 0), p = /* @__PURE__ */ new Map(), m = (e, t) => {
5010
+ d = yi(d);
5011
+ for (let [e, t] of u) u.set(e, yi(t));
5012
+ let f = (e, t) => o + (vi(e) !== vi(t) && (vi(e) || vi(t)) ? 24 : 0), p = /* @__PURE__ */ new Map(), m = (e, t) => {
4966
5013
  if (t.has(e.id)) return 0;
4967
5014
  t.add(e.id);
4968
5015
  let n = u.get(e.id) ?? [], r = n.reduce((e, r, i) => e + m(r, t) + (i ? f(n[i - 1], r) : 0), 0), i = Math.max(a, r);
@@ -4978,7 +5025,7 @@ function _i(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top"
4978
5025
  x: m,
4979
5026
  y: b
4980
5027
  });
4981
- let x = hi(e);
5028
+ let x = vi(e);
4982
5029
  if (x) {
4983
5030
  let t = `${e.parent && l.has(e.parent) && e.parent !== e.id ? e.parent : ""}|${x}`;
4984
5031
  _.has(t) || _.set(t, {
@@ -5052,18 +5099,18 @@ function _i(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top"
5052
5099
  horizontal: n
5053
5100
  };
5054
5101
  }
5055
- var vi = (e, t) => {
5102
+ var xi = (e, t) => {
5056
5103
  let n = String(e ?? "");
5057
5104
  return n.length > t ? `${n.slice(0, t - 1)}…` : n;
5058
- }, yi = (e) => {
5105
+ }, Si = (e) => {
5059
5106
  let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
5060
5107
  if (!t) return "#ffffff";
5061
5108
  let n = t[1];
5062
5109
  n.length === 3 && (n = [...n].map((e) => e + e).join(""));
5063
5110
  let r = parseInt(n, 16);
5064
5111
  return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
5065
- }, bi = (e) => !!(e?.cv?.trim?.() || e?.photo);
5066
- function xi(e, t = {}) {
5112
+ }, Ci = (e) => !!(e?.cv?.trim?.() || e?.photo);
5113
+ function wi(e, t = {}) {
5067
5114
  let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : Jt(e);
5068
5115
  return n.map((e) => {
5069
5116
  let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
@@ -5079,11 +5126,11 @@ function xi(e, t = {}) {
5079
5126
  };
5080
5127
  });
5081
5128
  }
5082
- var Si = {
5129
+ var Ti = {
5083
5130
  size: 36,
5084
5131
  pad: 10
5085
5132
  };
5086
- function Ci({ node: e, onClose: t }) {
5133
+ function Ei({ node: e, onClose: t }) {
5087
5134
  return c(() => {
5088
5135
  let e = (e) => e.key === "Escape" && t();
5089
5136
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
@@ -5204,7 +5251,7 @@ function Ci({ node: e, onClose: t }) {
5204
5251
  })
5205
5252
  });
5206
5253
  }
5207
- function wi({ nodes: e = [], source: t, nameField: n, titleField: r, photoField: i, parentField: a, cvField: o, hrefField: u, groupField: d, groupTitles: p = "top", groupBg: m = "", size: v = "medium", horizontal: y = !1, style: b, nodeRef: x, interactive: S = !0 }) {
5254
+ function Di({ nodes: e = [], source: t, nameField: n, titleField: r, photoField: i, parentField: a, cvField: o, hrefField: u, groupField: d, groupTitles: p = "top", groupBg: m = "", size: v = "medium", horizontal: y = !1, style: b, nodeRef: x, interactive: S = !0 }) {
5208
5255
  let C = l(), [w, T] = f(null), { tenant: E, apiUrl: D } = s(Y), O = s(Pt)?.[t], [k, A] = f(null);
5209
5256
  c(() => {
5210
5257
  if (!t || O) return;
@@ -5221,7 +5268,7 @@ function wi({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
5221
5268
  D,
5222
5269
  O
5223
5270
  ]);
5224
- let j = t ? xi(O ?? k ?? [], {
5271
+ let j = t ? wi(O ?? k ?? [], {
5225
5272
  nameField: n,
5226
5273
  titleField: r,
5227
5274
  photoField: i,
@@ -5229,7 +5276,7 @@ function wi({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
5229
5276
  cvField: o,
5230
5277
  hrefField: u,
5231
5278
  groupField: d
5232
- }) : e, M = mi(v), { boxes: N, links: P, groups: F, width: I, height: L } = _i(j, {
5279
+ }) : e, M = _i(v), { boxes: N, links: P, groups: F, width: I, height: L } = bi(j, {
5233
5280
  size: v,
5234
5281
  horizontal: y,
5235
5282
  groupTitles: p
@@ -5287,8 +5334,8 @@ function wi({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
5287
5334
  fontSize: M.title + 1,
5288
5335
  fontWeight: "600",
5289
5336
  opacity: "0.55",
5290
- fill: r ? yi(e.color || m) : "var(--page-text, #111827)",
5291
- children: vi(e.title, Math.floor(e.width / 7))
5337
+ fill: r ? Si(e.color || m) : "var(--page-text, #111827)",
5338
+ children: xi(e.title, Math.floor(e.width / 7))
5292
5339
  })] }, `group-${t}`);
5293
5340
  }),
5294
5341
  P.map((e, t) => /* @__PURE__ */ g("path", {
@@ -5298,7 +5345,7 @@ function wi({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
5298
5345
  strokeWidth: "1.5"
5299
5346
  }, t)),
5300
5347
  N.map(({ node: e, x: t, y: n }) => {
5301
- let r = R.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? yi(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? yi(e.color2) : s, l = S && (bi(e) || e.href), u = () => bi(e) ? T(e) : window.open(e.href, "_blank", "noreferrer"), d = e.photo ? t + Si.pad + M.avatar + 8 : t + M.w / 2, f = e.photo ? "start" : "middle", p = e.photo ? Math.floor((M.w - M.avatar - 26) / 7) : Math.floor(M.w / 7.6), m = M.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
5348
+ let r = R.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? Si(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Si(e.color2) : s, l = S && (Ci(e) || e.href), u = () => Ci(e) ? T(e) : window.open(e.href, "_blank", "noreferrer"), d = e.photo ? t + Ti.pad + M.avatar + 8 : t + M.w / 2, f = e.photo ? "start" : "middle", p = e.photo ? Math.floor((M.w - M.avatar - 26) / 7) : Math.floor(M.w / 7.6), m = M.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
5302
5349
  return /* @__PURE__ */ _("g", {
5303
5350
  onClick: l ? u : void 0,
5304
5351
  style: l ? { cursor: "pointer" } : void 0,
@@ -5362,13 +5409,13 @@ function wi({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
5362
5409
  e.photo && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("clipPath", {
5363
5410
  id: `${C}-${e.id}`,
5364
5411
  children: /* @__PURE__ */ g("circle", {
5365
- cx: t + Si.pad + M.avatar / 2,
5412
+ cx: t + Ti.pad + M.avatar / 2,
5366
5413
  cy: n + M.h / 2,
5367
5414
  r: M.avatar / 2
5368
5415
  })
5369
5416
  }), /* @__PURE__ */ g("image", {
5370
5417
  href: e.photo,
5371
- x: t + Si.pad,
5418
+ x: t + Ti.pad,
5372
5419
  y: n + (M.h - M.avatar) / 2,
5373
5420
  width: M.avatar,
5374
5421
  height: M.avatar,
@@ -5382,7 +5429,7 @@ function wi({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
5382
5429
  fontSize: M.title,
5383
5430
  fontWeight: "600",
5384
5431
  fill: s,
5385
- children: vi(e.title, p + 4)
5432
+ children: xi(e.title, p + 4)
5386
5433
  }), e.name && /* @__PURE__ */ g("text", {
5387
5434
  x: d,
5388
5435
  y: n + m + m / 2 + M.name * .35,
@@ -5390,7 +5437,7 @@ function wi({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
5390
5437
  fontSize: M.name,
5391
5438
  fontWeight: "600",
5392
5439
  fill: c,
5393
- children: vi(e.name, p)
5440
+ children: xi(e.name, p)
5394
5441
  })] }) : /* @__PURE__ */ _(h, { children: [v[0] && /* @__PURE__ */ g("text", {
5395
5442
  x: d,
5396
5443
  y: n + (v[1] ? M.h * .43 : M.h * .57),
@@ -5398,7 +5445,7 @@ function wi({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
5398
5445
  fontSize: M.name,
5399
5446
  fontWeight: "600",
5400
5447
  fill: s,
5401
- children: vi(v[0], p)
5448
+ children: xi(v[0], p)
5402
5449
  }), v[1] && /* @__PURE__ */ g("text", {
5403
5450
  x: d,
5404
5451
  y: n + M.h * .73,
@@ -5406,19 +5453,19 @@ function wi({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
5406
5453
  fontSize: M.title,
5407
5454
  opacity: "0.7",
5408
5455
  fill: s,
5409
- children: vi(v[1], p + 4)
5456
+ children: xi(v[1], p + 4)
5410
5457
  })] })
5411
5458
  ]
5412
5459
  }, e.id);
5413
5460
  })
5414
5461
  ]
5415
- }), w && /* @__PURE__ */ g(Ci, {
5462
+ }), w && /* @__PURE__ */ g(Ei, {
5416
5463
  node: w,
5417
5464
  onClose: () => T(null)
5418
5465
  })]
5419
5466
  });
5420
5467
  }
5421
- function Ti({ value: e, onCommit: t, style: n, hint: r }) {
5468
+ function Oi({ value: e, onCommit: t, style: n, hint: r }) {
5422
5469
  let [i, a] = f(!1), o = d(null);
5423
5470
  return c(() => {
5424
5471
  if (!i || !o.current) return;
@@ -5448,7 +5495,7 @@ function Ti({ value: e, onCommit: t, style: n, hint: r }) {
5448
5495
  children: e ?? ""
5449
5496
  });
5450
5497
  }
5451
- var Ei = 360, Di = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;\n font-size: 11px;\n line-height: 16px;\n min-width: 20px;\n text-align: center;\n padding: 1px 4px;\n user-select: none;\n color: #e2e8f0;\n background: rgba(148, 163, 184, 0.16);\n}\n.wb-tedit-btn:hover { background: #4f46e5; color: #fff; }\n.wb-tedit-btn[data-hint] { position: relative; }\n.wb-tedit-btn[data-hint]:hover::after {\n content: attr(data-hint);\n position: absolute;\n bottom: calc(100% + 6px);\n left: 50%;\n transform: translateX(-50%);\n padding: 3px 6px;\n border-radius: 5px;\n background: #1e293b;\n border: 1px solid rgba(148, 163, 184, 0.35);\n color: #e2e8f0;\n font-size: 10px;\n line-height: 14px;\n white-space: nowrap;\n pointer-events: none;\n z-index: 6;\n}\n.wb-tedit-grip { position: absolute; top: 0; right: -3px; width: 6px; height: 100%; cursor: col-resize; }\n.wb-tedit-grip:hover { background: rgba(99, 102, 241, 0.55); }\n.wb-tedit-rowgrip { position: absolute; left: 0; right: 0; bottom: -3px; height: 6px; cursor: row-resize; }\n.wb-tedit-rowgrip:hover { background: rgba(99, 102, 241, 0.55); }\n.wb-tedit-cellon { outline: 2px solid rgba(99, 102, 241, 0.75); outline-offset: -2px; }\n.wb-tedit-bar {\n position: absolute;\n z-index: 5;\n display: flex;\n align-items: center;\n gap: 3px;\n padding: 4px 5px;\n border-radius: 8px;\n background: #0f172a;\n border: 1px solid rgba(148, 163, 184, 0.35);\n box-shadow: 0 6px 18px rgba(15, 23, 42, 0.35);\n white-space: nowrap;\n}\n.wb-tedit-sep { width: 1px; align-self: stretch; margin: 0 2px; background: rgba(148, 163, 184, 0.3); }\n.wb-tedit-at { font-size: 10px; color: #94a3b8; padding-right: 2px; }\n", Oi = (e, t) => e && t ? `cell-${e}-${t}` : "", ki = (e) => {
5498
+ var ki = 360, Ai = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;\n font-size: 11px;\n line-height: 16px;\n min-width: 20px;\n text-align: center;\n padding: 1px 4px;\n user-select: none;\n color: #e2e8f0;\n background: rgba(148, 163, 184, 0.16);\n}\n.wb-tedit-btn:hover { background: #4f46e5; color: #fff; }\n.wb-tedit-btn[data-hint] { position: relative; }\n.wb-tedit-btn[data-hint]:hover::after {\n content: attr(data-hint);\n position: absolute;\n bottom: calc(100% + 6px);\n left: 50%;\n transform: translateX(-50%);\n padding: 3px 6px;\n border-radius: 5px;\n background: #1e293b;\n border: 1px solid rgba(148, 163, 184, 0.35);\n color: #e2e8f0;\n font-size: 10px;\n line-height: 14px;\n white-space: nowrap;\n pointer-events: none;\n z-index: 6;\n}\n.wb-tedit-grip { position: absolute; top: 0; right: -3px; width: 6px; height: 100%; cursor: col-resize; }\n.wb-tedit-grip:hover { background: rgba(99, 102, 241, 0.55); }\n.wb-tedit-rowgrip { position: absolute; left: 0; right: 0; bottom: -3px; height: 6px; cursor: row-resize; }\n.wb-tedit-rowgrip:hover { background: rgba(99, 102, 241, 0.55); }\n.wb-tedit-cellon { outline: 2px solid rgba(99, 102, 241, 0.75); outline-offset: -2px; }\n.wb-tedit-bar {\n position: absolute;\n z-index: 5;\n display: flex;\n align-items: center;\n gap: 3px;\n padding: 4px 5px;\n border-radius: 8px;\n background: #0f172a;\n border: 1px solid rgba(148, 163, 184, 0.35);\n box-shadow: 0 6px 18px rgba(15, 23, 42, 0.35);\n white-space: nowrap;\n}\n.wb-tedit-sep { width: 1px; align-self: stretch; margin: 0 2px; background: rgba(148, 163, 184, 0.3); }\n.wb-tedit-at { font-size: 10px; color: #94a3b8; padding-right: 2px; }\n", ji = (e, t) => e && t ? `cell-${e}-${t}` : "", Mi = (e) => {
5452
5499
  if (!e || typeof e != "object") return e ?? "";
5453
5500
  let t = String(e.text ?? "");
5454
5501
  return typeof e.href == "string" && e.href ? /* @__PURE__ */ g("a", {
@@ -5459,7 +5506,7 @@ var Ei = 360, Di = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;
5459
5506
  children: t
5460
5507
  }) : t;
5461
5508
  };
5462
- function Ai({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], colKeys: i = [], heights: a = [], spans: o, linked: l, source: u, limit: p = 10, header: m = !0, striped: v = !0, bordered: y = !1, compact: b = !1, padX: x, padY: S, paged: C, emptyText: w, stickyHeader: T, headerBg: E, headerColor: D, headerAlign: O, borderColor: k, maxHeight: A, style: j, nodeRef: M, edit: N }) {
5509
+ function Ni({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], colKeys: i = [], heights: a = [], spans: o, linked: l, source: u, limit: p = 10, header: m = !0, striped: v = !0, bordered: y = !1, compact: b = !1, padX: x, padY: S, paged: C, emptyText: w, stickyHeader: T, headerBg: E, headerColor: D, headerAlign: O, borderColor: k, maxHeight: A, style: j, nodeRef: M, edit: N }) {
5463
5510
  let P = d(null), F = d(null), [I, L] = f(null), [R, z] = f(null), B = (e, t) => () => L({
5464
5511
  r: e,
5465
5512
  c: t
@@ -5473,7 +5520,7 @@ function Ai({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
5473
5520
  }
5474
5521
  let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
5475
5522
  top: r.bottom - n.top + 4,
5476
- left: Math.max(0, Math.min(r.left - n.left, n.width - Ei))
5523
+ left: Math.max(0, Math.min(r.left - n.left, n.width - ki))
5477
5524
  };
5478
5525
  (R?.top !== i.top || R?.left !== i.left) && z(i);
5479
5526
  }), c(() => {
@@ -5529,7 +5576,7 @@ function Ai({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
5529
5576
  window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
5530
5577
  }, xe = /* @__PURE__ */ new Set();
5531
5578
  o && ie.forEach((t, n) => e.forEach((e, t) => {
5532
- let a = o[Oi(r[n], i[t])];
5579
+ let a = o[ji(r[n], i[t])];
5533
5580
  if (!a) return;
5534
5581
  let s = Math.max(1, Number(a.c) || 1), c = Math.max(1, Number(a.r) || 1);
5535
5582
  for (let e = 0; e < c; e++) for (let r = 0; r < s; r++) (e || r) && xe.add(`${n + e},${t + r}`);
@@ -5552,7 +5599,7 @@ function Ai({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
5552
5599
  },
5553
5600
  onClick: n,
5554
5601
  children: e
5555
- }, t), q = I && I.r < ie.length && I.c < e.length ? I : null, J = (e, t) => N?.labels?.[e] ?? t, we = q ? o?.[Oi(r[q.r], i[q.c])] : null, Te = Math.max(1, Number(we?.c) || 1), Ee = Math.max(1, Number(we?.r) || 1);
5602
+ }, t), q = I && I.r < ie.length && I.c < e.length ? I : null, J = (e, t) => N?.labels?.[e] ?? t, we = q ? o?.[ji(r[q.r], i[q.c])] : null, Te = Math.max(1, Number(we?.c) || 1), Ee = Math.max(1, Number(we?.r) || 1);
5556
5603
  return /* @__PURE__ */ _("div", {
5557
5604
  ref: (e) => {
5558
5605
  F.current = e, typeof M == "function" && M(e);
@@ -5563,7 +5610,7 @@ function Ai({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
5563
5610
  ...ve
5564
5611
  },
5565
5612
  children: [
5566
- N && /* @__PURE__ */ g("style", { children: Di }),
5613
+ N && /* @__PURE__ */ g("style", { children: Ai }),
5567
5614
  N && q && R && /* @__PURE__ */ _("div", {
5568
5615
  className: "wb-tedit-bar",
5569
5616
  style: {
@@ -5633,7 +5680,7 @@ function Ai({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
5633
5680
  } : N ? { position: "relative" } : null,
5634
5681
  ...le
5635
5682
  },
5636
- children: N ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(Ti, {
5683
+ children: N ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(Oi, {
5637
5684
  value: t.label ?? t,
5638
5685
  onCommit: (e) => N.header(n, e),
5639
5686
  hint: J("editCell", "Double-click to edit"),
@@ -5664,7 +5711,7 @@ function Ai({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
5664
5711
  },
5665
5712
  children: e.map((e, a) => {
5666
5713
  if (xe.has(`${n},${a}`)) return null;
5667
- let s = Oi(r[n], i[a]), c = l?.[s], u = o?.[s], d = Math.max(1, Number(u?.c) || 1), f = Math.max(1, Number(u?.r) || 1);
5714
+ let s = ji(r[n], i[a]), c = l?.[s], u = o?.[s], d = Math.max(1, Number(u?.c) || 1), f = Math.max(1, Number(u?.r) || 1);
5668
5715
  return /* @__PURE__ */ _("td", {
5669
5716
  ...X("cell"),
5670
5717
  className: N ? `wb-tedit-cell${I?.r === n && I?.c === a ? " wb-tedit-cellon" : ""}` : void 0,
@@ -5678,7 +5725,7 @@ function Ai({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
5678
5725
  ...N ? { position: "relative" } : null,
5679
5726
  ...le
5680
5727
  },
5681
- children: [c ?? ki(t?.[a]), N && ye && /* @__PURE__ */ g("span", {
5728
+ children: [c ?? Mi(t?.[a]), N && ye && /* @__PURE__ */ g("span", {
5682
5729
  className: "wb-tedit-rowgrip",
5683
5730
  title: J("rowHeight", "Drag to set the row height — double-click to fit the content"),
5684
5731
  onPointerDown: Se(n),
@@ -5693,7 +5740,7 @@ function Ai({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
5693
5740
  ]
5694
5741
  });
5695
5742
  }
5696
- var ji = {
5743
+ var Pi = {
5697
5744
  small: {
5698
5745
  cell: 62,
5699
5746
  font: 10.5,
@@ -5718,8 +5765,8 @@ var ji = {
5718
5765
  pad: 8,
5719
5766
  gap: 4
5720
5767
  }
5721
- }, Mi = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, Ni = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), Pi = 366;
5722
- function Fi(e, t = {}) {
5768
+ }, Fi = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, Ii = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), Li = 366;
5769
+ function Ri(e, t = {}) {
5723
5770
  let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : Jt(e), a = (e) => {
5724
5771
  let t = i(r(e)), n = t ? new Date(t) : null;
5725
5772
  return n && !Number.isNaN(n.getTime()) ? n : null;
@@ -5736,7 +5783,7 @@ function Fi(e, t = {}) {
5736
5783
  } : null;
5737
5784
  }).filter(Boolean);
5738
5785
  }
5739
- function Ii(e) {
5786
+ function zi(e) {
5740
5787
  return (Array.isArray(e) ? e : []).map((e, t) => {
5741
5788
  let n = e?.start ? new Date(e.start) : null;
5742
5789
  if (!n || Number.isNaN(n.getTime())) return null;
@@ -5751,19 +5798,19 @@ function Ii(e) {
5751
5798
  };
5752
5799
  }).filter(Boolean);
5753
5800
  }
5754
- function Li(e) {
5801
+ function Bi(e) {
5755
5802
  let t = /* @__PURE__ */ new Map();
5756
5803
  for (let n of e) {
5757
- let e = Ni(n.start), r = n.end ? Ni(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), Pi);
5804
+ let e = Ii(n.start), r = n.end ? Ii(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), Li);
5758
5805
  for (let r = 0; r <= i; r += 1) {
5759
- let i = Mi(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
5806
+ let i = Fi(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
5760
5807
  t.has(i) || t.set(i, []), t.get(i).push(n);
5761
5808
  }
5762
5809
  }
5763
5810
  for (let e of t.values()) e.sort((e, t) => e.start - t.start);
5764
5811
  return t;
5765
5812
  }
5766
- function Ri({ events: e = [], source: t = "", titleField: n = "", startField: r = "", endField: i = "", hrefField: a = "", colorField: o = "", variant: l = "month", size: u = "medium", accent: d = "", eventBg: p = "", eventText: m = "", borderColor: v = "", weekStart: y = "monday", max: b = 3, emptyText: x = "No events", style: S, nodeRef: C, interactive: w = !0 }) {
5813
+ function Vi({ events: e = [], source: t = "", titleField: n = "", startField: r = "", endField: i = "", hrefField: a = "", colorField: o = "", variant: l = "month", size: u = "medium", accent: d = "", eventBg: p = "", eventText: m = "", borderColor: v = "", weekStart: y = "monday", max: b = 3, emptyText: x = "No events", style: S, nodeRef: C, interactive: w = !0 }) {
5767
5814
  let { tenant: T, apiUrl: E, locale: D } = s(Y), O = s(Pt)?.[t], [k, A] = f(null), [j, M] = f(() => {
5768
5815
  let e = /* @__PURE__ */ new Date();
5769
5816
  return {
@@ -5786,13 +5833,13 @@ function Ri({ events: e = [], source: t = "", titleField: n = "", startField: r
5786
5833
  E,
5787
5834
  O
5788
5835
  ]);
5789
- let N = ji[u] ?? ji.medium, P = d || "var(--page-accent, #4f46e5)", F = v || "var(--page-border, rgba(148, 163, 184, 0.35))", I = p || P, L = m || "var(--page-accent-text, #ffffff)", R = t ? Fi(O ?? k ?? [], {
5836
+ let N = Pi[u] ?? Pi.medium, P = d || "var(--page-accent, #4f46e5)", F = v || "var(--page-border, rgba(148, 163, 184, 0.35))", I = p || P, L = m || "var(--page-accent-text, #ffffff)", R = t ? Ri(O ?? k ?? [], {
5790
5837
  titleField: n,
5791
5838
  startField: r,
5792
5839
  endField: i,
5793
5840
  hrefField: a,
5794
5841
  colorField: o
5795
- }) : Ii(e), z = Li(R), B = D || void 0, V = (e, t) => {
5842
+ }) : zi(e), z = Bi(R), B = D || void 0, V = (e, t) => {
5796
5843
  let n = /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("span", {
5797
5844
  ...X("event-dot"),
5798
5845
  style: {
@@ -5935,9 +5982,9 @@ function Ri({ events: e = [], source: t = "", titleField: n = "", startField: r
5935
5982
  })]
5936
5983
  });
5937
5984
  }
5938
- let U = new Date(j.year, j.month, 1), W = y === "sunday" ? 0 : 1, K = (U.getDay() - W + 7) % 7, re = new Date(j.year, j.month + 1, 0).getDate(), ie = Math.ceil((K + re) / 7), ae = Mi(/* @__PURE__ */ new Date()), oe = new Intl.DateTimeFormat(B, { weekday: "short" }), se = [];
5985
+ let U = new Date(j.year, j.month, 1), W = y === "sunday" ? 0 : 1, K = (U.getDay() - W + 7) % 7, re = new Date(j.year, j.month + 1, 0).getDate(), ie = Math.ceil((K + re) / 7), ae = Fi(/* @__PURE__ */ new Date()), oe = new Intl.DateTimeFormat(B, { weekday: "short" }), se = [];
5939
5986
  for (let e = 0; e < ie * 7; e += 1) {
5940
- let t = e - K + 1, n = t >= 1 && t <= re, r = Mi(new Date(j.year, j.month, t)), i = n ? z.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === ae;
5987
+ let t = e - K + 1, n = t >= 1 && t <= re, r = Fi(new Date(j.year, j.month, t)), i = n ? z.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === ae;
5941
5988
  se.push(/* @__PURE__ */ _("div", {
5942
5989
  ...X("day", !n && "day-outside", o && "day-today"),
5943
5990
  style: {
@@ -6007,12 +6054,12 @@ function Ri({ events: e = [], source: t = "", titleField: n = "", startField: r
6007
6054
  ]
6008
6055
  });
6009
6056
  }
6010
- var zi = {
6057
+ var Hi = {
6011
6058
  small: 36,
6012
6059
  medium: 56,
6013
6060
  large: 88
6014
6061
  };
6015
- function Bi(e, t = {}) {
6062
+ function Ui(e, t = {}) {
6016
6063
  let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], r = (e) => e == null ? "" : Jt(e);
6017
6064
  return n.map((e) => {
6018
6065
  let n = e.data ?? e, i = Kt(n, t.imageField), a = Array.isArray(i) ? i[0] : i, o = a && typeof a == "object" ? a.url ?? a.src ?? "" : a, s = t.nameField ? r(Kt(n, t.nameField)) : r(n.name);
@@ -6023,7 +6070,7 @@ function Bi(e, t = {}) {
6023
6070
  };
6024
6071
  }).filter((e) => e.src);
6025
6072
  }
6026
- function Vi({ logos: e = [], source: t = "", imageField: n = "", nameField: r = "", hrefField: i = "", variant: a = "step", size: o = "medium", perView: l = 5, gap: u = 48, hold: p = 3, slideMs: m = 500, direction: v = "left", arrows: y = "show", pauseOnHover: b = !0, grayscale: x = !0, newTab: S = !0, emptyText: C = "", style: w, nodeRef: T, inert: E }) {
6073
+ function Wi({ logos: e = [], source: t = "", imageField: n = "", nameField: r = "", hrefField: i = "", variant: a = "step", size: o = "medium", perView: l = 5, gap: u = 48, hold: p = 3, slideMs: m = 500, direction: v = "left", arrows: y = "show", pauseOnHover: b = !0, grayscale: x = !0, newTab: S = !0, emptyText: C = "", style: w, nodeRef: T, inert: E }) {
6027
6074
  let { tenant: D, apiUrl: O } = s(Y), k = s(Pt)?.[t], [A, j] = f(null), M = d(null), N = d(null), [P, F] = f(0), [I, L] = f(0), [R, z] = f(0), [B, V] = f(!0), [ee, te] = f(!1), [H, ne] = f(!1);
6028
6075
  c(() => {
6029
6076
  if (!t || k) return;
@@ -6063,11 +6110,11 @@ function Vi({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
6063
6110
  t = !1, r.forEach((e) => e.removeEventListener("load", n));
6064
6111
  };
6065
6112
  });
6066
- let U = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], W = t ? Bi(k ?? A ?? [], {
6113
+ let U = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], W = t ? Ui(k ?? A ?? [], {
6067
6114
  imageField: n,
6068
6115
  nameField: r,
6069
6116
  hrefField: i
6070
- }) : U, K = zi[o] ?? zi.medium, re = Number.isFinite(Number(u)) ? Math.max(0, Number(u)) : 48, ie = a === "marquee" ? "step" : a, ae = Math.min(3e4, Math.max(300, (Number(p) || 3) * 1e3)), oe = Math.min(3e3, Math.max(100, Number(m) || 500)), se = Math.min(12, Math.max(1, Math.round(Number(l) || 5))), ce = (I || K * 3) + re, le = P ? Math.max(1, Math.floor(P / ce)) : se, ue = Math.min(se, le), de = P ? Math.min(ce, P / ue) : ce;
6117
+ }) : U, K = Hi[o] ?? Hi.medium, re = Number.isFinite(Number(u)) ? Math.max(0, Number(u)) : 48, ie = a === "marquee" ? "step" : a, ae = Math.min(3e4, Math.max(300, (Number(p) || 3) * 1e3)), oe = Math.min(3e3, Math.max(100, Number(m) || 500)), se = Math.min(12, Math.max(1, Math.round(Number(l) || 5))), ce = (I || K * 3) + re, le = P ? Math.max(1, Math.floor(P / ce)) : se, ue = Math.min(se, le), de = P ? Math.min(ce, P / ue) : ce;
6071
6118
  if (!W.length) return /* @__PURE__ */ g("div", {
6072
6119
  ref: T,
6073
6120
  style: {
@@ -6258,7 +6305,7 @@ function Vi({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
6258
6305
  xe,
6259
6306
  q ? J(1) : null
6260
6307
  ] }),
6261
- /* @__PURE__ */ g(Hi, {
6308
+ /* @__PURE__ */ g(Gi, {
6262
6309
  running: he,
6263
6310
  every: ae + oe,
6264
6311
  slide: oe,
@@ -6272,7 +6319,7 @@ function Vi({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
6272
6319
  ]
6273
6320
  });
6274
6321
  }
6275
- function Hi({ running: e, every: t, slide: n, step: r, index: i, total: a, home: o, setIndex: s, setAnimate: l }) {
6322
+ function Gi({ running: e, every: t, slide: n, step: r, index: i, total: a, home: o, setIndex: s, setAnimate: l }) {
6276
6323
  c(() => {
6277
6324
  if (!e) return;
6278
6325
  let n = setInterval(() => {
@@ -6308,13 +6355,13 @@ function Hi({ running: e, every: t, slide: n, step: r, index: i, total: a, home:
6308
6355
  l
6309
6356
  ]), null;
6310
6357
  }
6311
- var Ui = {
6358
+ var Ki = {
6312
6359
  tablet: 991,
6313
6360
  mobileLandscape: 767,
6314
6361
  mobile: 478
6315
- }, Wi = "M4 6h16M4 12h16M4 18h16", Gi = (e) => e && dr[e] ? dr[e] : Wi;
6316
- function Ki({ drawerId: e = "", breakpoint: t = "tablet", side: n = "left", width: r = 300, trigger: i = "button", triggerLabel: a = "", icon: s = "", title: u = "", showClose: p = !0, backdropClose: v = !0, closeOnLink: y = !0, forceMode: b, frame: x, editorOpen: S = !0, editorLabel: C = "Drawer", linked: w, style: T, nodeRef: E, inert: D = !1 }) {
6317
- let [O, k] = f(!1), A = `wb-drw-${l().replace(/[^\w-]/g, "")}`, j = d(null), M = t === "always" ? "" : `(max-width: ${Ui[t] ?? 991}px)`, N = o(() => b ? b === "drawer" : !M || typeof window < "u" && window.matchMedia(M).matches, [b, M]), P = d(null), [F, I] = f(null);
6362
+ }, qi = "M4 6h16M4 12h16M4 18h16", Ji = (e) => e && mr[e] ? mr[e] : qi;
6363
+ function Yi({ drawerId: e = "", breakpoint: t = "tablet", side: n = "left", width: r = 300, trigger: i = "button", triggerLabel: a = "", icon: s = "", title: u = "", showClose: p = !0, backdropClose: v = !0, closeOnLink: y = !0, forceMode: b, frame: x, editorOpen: S = !0, editorLabel: C = "Drawer", linked: w, style: T, nodeRef: E, inert: D = !1 }) {
6364
+ let [O, k] = f(!1), A = `wb-drw-${l().replace(/[^\w-]/g, "")}`, j = d(null), M = t === "always" ? "" : `(max-width: ${Ki[t] ?? 991}px)`, N = o(() => b ? b === "drawer" : !M || typeof window < "u" && window.matchMedia(M).matches, [b, M]), P = d(null), [F, I] = f(null);
6318
6365
  c(() => {
6319
6366
  if (D || typeof window > "u") return;
6320
6367
  let e = () => {
@@ -6534,7 +6581,7 @@ function Ki({ drawerId: e = "", breakpoint: t = "tablet", side: n = "left", widt
6534
6581
  strokeLinecap: "round",
6535
6582
  strokeLinejoin: "round",
6536
6583
  "aria-hidden": "true",
6537
- children: /* @__PURE__ */ g("path", { d: Gi(s) })
6584
+ children: /* @__PURE__ */ g("path", { d: Ji(s) })
6538
6585
  }), a ? /* @__PURE__ */ g("span", { children: a }) : null]
6539
6586
  }),
6540
6587
  H && i !== "button" && !ne && /* @__PURE__ */ _("div", {
@@ -6579,8 +6626,8 @@ function Ki({ drawerId: e = "", breakpoint: t = "tablet", side: n = "left", widt
6579
6626
  ]
6580
6627
  });
6581
6628
  }
6582
- function qi({ target: e = "", breakpoint: t = "tablet", label: n = "", icon: r = "", forceMode: i, style: a, nodeRef: o, inert: s = !1 }) {
6583
- let c = `wb-dbt-${l().replace(/[^\w-]/g, "")}`, u = Ui[t], d = i || t === "always" || !u ? "" : `@media (min-width: ${u + 1}px) { .${c} { display: none !important; } }`, f = i === "inline";
6629
+ function Xi({ target: e = "", breakpoint: t = "tablet", label: n = "", icon: r = "", forceMode: i, style: a, nodeRef: o, inert: s = !1 }) {
6630
+ let c = `wb-dbt-${l().replace(/[^\w-]/g, "")}`, u = Ki[t], d = i || t === "always" || !u ? "" : `@media (min-width: ${u + 1}px) { .${c} { display: none !important; } }`, f = i === "inline";
6584
6631
  return /* @__PURE__ */ _(h, { children: [d ? /* @__PURE__ */ g("style", { children: d }) : null, /* @__PURE__ */ _("button", {
6585
6632
  ref: o,
6586
6633
  type: "button",
@@ -6614,20 +6661,20 @@ function qi({ target: e = "", breakpoint: t = "tablet", label: n = "", icon: r =
6614
6661
  strokeLinecap: "round",
6615
6662
  strokeLinejoin: "round",
6616
6663
  "aria-hidden": "true",
6617
- children: /* @__PURE__ */ g("path", { d: Gi(r) })
6664
+ children: /* @__PURE__ */ g("path", { d: Ji(r) })
6618
6665
  }), n ? /* @__PURE__ */ g("span", {
6619
6666
  ...X("label"),
6620
6667
  children: n
6621
6668
  }) : null]
6622
6669
  })] });
6623
6670
  }
6624
- var Ji = {
6671
+ var Zi = {
6625
6672
  small: 380,
6626
6673
  medium: 560,
6627
6674
  large: 820,
6628
6675
  full: "100%"
6629
6676
  };
6630
- function Yi({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open", openOn: r = "trigger", delay: i = 0, size: a = "medium", title: o = "", showClose: s = !0, backdropClose: l = !0, position: u = "center", actions: p = [], showCloseAction: m = !1, closeLabel: h = "Close", actionsAlign: v = "right", linked: y, style: b, nodeRef: x, inert: S = !1 }) {
6677
+ function Qi({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open", openOn: r = "trigger", delay: i = 0, size: a = "medium", title: o = "", showClose: s = !0, backdropClose: l = !0, position: u = "center", actions: p = [], showCloseAction: m = !1, closeLabel: h = "Close", actionsAlign: v = "right", linked: y, style: b, nodeRef: x, inert: S = !1 }) {
6631
6678
  let [C, w] = f(!1), T = d(null);
6632
6679
  c(() => {
6633
6680
  if (S || !e) return;
@@ -6652,7 +6699,7 @@ function Yi({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
6652
6699
  document.removeEventListener("keydown", e), document.body.style.overflow = t;
6653
6700
  };
6654
6701
  }, [S, C]);
6655
- let E = Ji[a] ?? Ji.medium, D = (e) => {
6702
+ let E = Zi[a] ?? Zi.medium, D = (e) => {
6656
6703
  let t = e.variant ?? "primary", n = {
6657
6704
  padding: "9px 16px",
6658
6705
  borderRadius: 6,
@@ -6830,7 +6877,7 @@ function Yi({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
6830
6877
  })]
6831
6878
  });
6832
6879
  }
6833
- function Xi({ dropdownId: e = "", trigger: t = "button", triggerLabel: n = "Menu", openOn: r = "hover", align: i = "left", panelWidth: a = "", offset: o = 8, editorOpen: s = !0, linked: l, style: u, nodeRef: p, inert: m = !1 }) {
6880
+ function $i({ dropdownId: e = "", trigger: t = "button", triggerLabel: n = "Menu", openOn: r = "hover", align: i = "left", panelWidth: a = "", offset: o = 8, editorOpen: s = !0, linked: l, style: u, nodeRef: p, inert: m = !1 }) {
6834
6881
  let [h, v] = f(!1), y = d(null), b = d(null), x = r !== "click", S = () => {
6835
6882
  b.current && clearTimeout(b.current), b.current = null;
6836
6883
  }, C = () => {
@@ -6933,15 +6980,15 @@ function Xi({ dropdownId: e = "", trigger: t = "button", triggerLabel: n = "Menu
6933
6980
  }), E]
6934
6981
  });
6935
6982
  }
6936
- var Zi = {
6983
+ var ea = {
6937
6984
  PageRoot: ln,
6938
6985
  MarkdownBlock: On,
6939
- CalendarBlock: Ri,
6940
- LogoCarousel: Vi,
6941
- DialogBlock: Yi,
6942
- DrawerBlock: Ki,
6943
- DrawerTrigger: qi,
6944
- DropdownBlock: Xi,
6986
+ CalendarBlock: Vi,
6987
+ LogoCarousel: Wi,
6988
+ DialogBlock: Qi,
6989
+ DrawerBlock: Yi,
6990
+ DrawerTrigger: Xi,
6991
+ DropdownBlock: $i,
6945
6992
  Section: un,
6946
6993
  Container: dn,
6947
6994
  LinkBlock: fn,
@@ -6954,24 +7001,24 @@ var Zi = {
6954
7001
  BoxBlock: Yn,
6955
7002
  SliderBlock: tr,
6956
7003
  CanvasSlider: nr,
6957
- TabsBlock: yr,
6958
- QuickStack: Wr,
6959
- CollectionList: Kr,
6960
- CollectionSearch: qr,
6961
- BreadcrumbsBlock: Jr,
6962
- PaginationBlock: Yr,
6963
- StepperBlock: fi,
6964
- SocialLinksBlock: di,
6965
- ThemeModeBlock: ei,
6966
- ScrollTopBlock: li,
6967
- CounterBlock: ci,
6968
- OrgChartBlock: wi,
6969
- TableBlock: Ai,
6970
- IconBlock: fr,
6971
- MapBlock: ur,
6972
- MasonryBlock: mr,
6973
- AccordionBlock: br,
6974
- NavbarBlock: vr,
7004
+ TabsBlock: Sr,
7005
+ QuickStack: qr,
7006
+ CollectionList: Yr,
7007
+ CollectionSearch: Xr,
7008
+ BreadcrumbsBlock: Zr,
7009
+ PaginationBlock: Qr,
7010
+ StepperBlock: hi,
7011
+ SocialLinksBlock: mi,
7012
+ ThemeModeBlock: ri,
7013
+ ScrollTopBlock: fi,
7014
+ CounterBlock: di,
7015
+ OrgChartBlock: Di,
7016
+ TableBlock: Ni,
7017
+ IconBlock: hr,
7018
+ MapBlock: pr,
7019
+ MasonryBlock: _r,
7020
+ AccordionBlock: Cr,
7021
+ NavbarBlock: xr,
6975
7022
  ListBlock: jn,
6976
7023
  TextSpan: vn,
6977
7024
  QuoteBlock: An,
@@ -6983,55 +7030,55 @@ var Zi = {
6983
7030
  IframeBlock: Vn,
6984
7031
  PdfBlock: Un,
6985
7032
  EmbedBlock: Kn,
6986
- FormBlock: Mr,
6987
- FormLabel: Lr,
6988
- FormInput: Rr,
6989
- FormTextarea: zr,
6990
- FormCheckbox: (e) => /* @__PURE__ */ g(Br, {
7033
+ FormBlock: Fr,
7034
+ FormLabel: Br,
7035
+ FormInput: Vr,
7036
+ FormTextarea: Hr,
7037
+ FormCheckbox: (e) => /* @__PURE__ */ g(Ur, {
6991
7038
  kind: "checkbox",
6992
7039
  ...e
6993
7040
  }),
6994
- FormRadio: (e) => /* @__PURE__ */ g(Br, {
7041
+ FormRadio: (e) => /* @__PURE__ */ g(Ur, {
6995
7042
  kind: "radio",
6996
7043
  ...e
6997
7044
  }),
6998
- FormSelect: Vr,
6999
- FormFile: Hr,
7000
- FormRecaptcha: Ir,
7001
- FormSubmit: Ur
7002
- }, Qi = {
7045
+ FormSelect: Wr,
7046
+ FormFile: Gr,
7047
+ FormRecaptcha: zr,
7048
+ FormSubmit: Kr
7049
+ }, ta = {
7003
7050
  id: "auth",
7004
7051
  label: "Accounts",
7005
7052
  category: "Apps",
7006
7053
  keys: ["SiteLoginForm", "SiteAccountMenu"],
7007
7054
  ssr: "shell",
7008
7055
  settings: ["site.authRedirect"]
7009
- }, $i = r({
7056
+ }, na = r({
7010
7057
  user: null,
7011
7058
  status: "idle",
7012
7059
  ensure: () => {},
7013
7060
  refresh: () => {},
7014
7061
  signOut: () => {}
7015
7062
  });
7016
- function ea(e, t) {
7063
+ function ra(e, t) {
7017
7064
  return t ? /^https?:\/\//i.test(t) ? t : `${e.replace(/\/+$/, "")}${t.startsWith("/") ? t : `/${t}`}` : "";
7018
7065
  }
7019
- function ta(e) {
7066
+ function ia(e) {
7020
7067
  let t = e && typeof e == "object" ? e["site.session"] : null, n = t && typeof t == "object" && !Array.isArray(t) ? t : {}, r = (e) => typeof e == "string" ? e.trim() : "", i = r(n.url), a = r(n.mePath), o = r(n.logoutPath);
7021
7068
  return {
7022
7069
  mode: n.mode === "custom" || n.mode === "off" ? n.mode : "system",
7023
7070
  url: i,
7024
7071
  mePath: a,
7025
7072
  logoutPath: o,
7026
- meUrl: ea(i, a),
7027
- logoutUrl: ea(i, o),
7073
+ meUrl: ra(i, a),
7074
+ logoutUrl: ra(i, o),
7028
7075
  loginPage: r(n.loginPage),
7029
7076
  userPath: r(n.userPath),
7030
7077
  auth: n.auth === "bearer" ? "bearer" : "cookies",
7031
7078
  tokenKey: r(n.tokenKey) || "webim_session_token"
7032
7079
  };
7033
7080
  }
7034
- function na(e, t) {
7081
+ function aa(e, t) {
7035
7082
  if (!t) return e ?? null;
7036
7083
  let n = e;
7037
7084
  for (let e of t.split(".")) {
@@ -7040,26 +7087,26 @@ function na(e, t) {
7040
7087
  }
7041
7088
  return n ?? null;
7042
7089
  }
7043
- function ra(e) {
7090
+ function oa(e) {
7044
7091
  try {
7045
7092
  return window.localStorage.getItem(e) || "";
7046
7093
  } catch {
7047
7094
  return "";
7048
7095
  }
7049
7096
  }
7050
- function ia(e) {
7097
+ function sa(e) {
7051
7098
  try {
7052
7099
  window.localStorage.removeItem(e);
7053
7100
  } catch {}
7054
7101
  }
7055
- var aa = () => {
7056
- let e = s($i);
7102
+ var ca = () => {
7103
+ let e = s(na);
7057
7104
  return c(() => {
7058
7105
  e.ensure();
7059
7106
  }, [e]), e;
7060
7107
  };
7061
- function oa({ children: e, initialUser: t, disabled: n, apiUrl: r, tenant: i }) {
7062
- let a = s(Y), l = r || a?.apiUrl || "/api", p = i || a?.tenant || "", m = u(() => ta(a?.settings), [a?.settings]), [h, _] = f(t ?? null), [v, y] = f(t ? "user" : n ? "guest" : "idle"), b = d(!1), x = o((e, t) => fetch(`${l}${e}`, {
7108
+ function la({ children: e, initialUser: t, disabled: n, apiUrl: r, tenant: i }) {
7109
+ let a = s(Y), l = r || a?.apiUrl || "/api", p = i || a?.tenant || "", m = u(() => ia(a?.settings), [a?.settings]), [h, _] = f(t ?? null), [v, y] = f(t ? "user" : n ? "guest" : "idle"), b = d(!1), x = o((e, t) => fetch(`${l}${e}`, {
7063
7110
  ...t,
7064
7111
  credentials: "include",
7065
7112
  headers: {
@@ -7071,9 +7118,9 @@ function oa({ children: e, initialUser: t, disabled: n, apiUrl: r, tenant: i })
7071
7118
  if (n) return Promise.resolve(null);
7072
7119
  if (m.mode === "off") return Promise.resolve(S(null));
7073
7120
  if (m.mode === "custom") {
7074
- let e = m.auth === "bearer" ? ra(m.tokenKey) : "";
7121
+ let e = m.auth === "bearer" ? oa(m.tokenKey) : "";
7075
7122
  return !m.meUrl || m.auth === "bearer" && !e ? Promise.resolve(S(null)) : fetch(m.meUrl, { ...m.auth === "bearer" ? { headers: { authorization: `Bearer ${e}` } } : { credentials: "include" } }).then((e) => e.ok ? e.json() : null).then((e) => {
7076
- let t = na(e, m.userPath);
7123
+ let t = aa(e, m.userPath);
7077
7124
  return S(t && typeof t == "object" ? t : null);
7078
7125
  }).catch(() => S(null));
7079
7126
  }
@@ -7086,12 +7133,12 @@ function oa({ children: e, initialUser: t, disabled: n, apiUrl: r, tenant: i })
7086
7133
  ]), w = o(() => {
7087
7134
  if (m.mode === "off") return S(null), Promise.resolve();
7088
7135
  if (m.mode === "custom") {
7089
- let e = m.auth === "bearer" ? ra(m.tokenKey) : "";
7136
+ let e = m.auth === "bearer" ? oa(m.tokenKey) : "";
7090
7137
  return (m.logoutUrl ? fetch(m.logoutUrl, {
7091
7138
  method: "post",
7092
7139
  ...m.auth === "bearer" ? { headers: e ? { authorization: `Bearer ${e}` } : {} } : { credentials: "include" }
7093
7140
  }).catch(() => {}) : Promise.resolve()).then(() => {
7094
- m.auth === "bearer" && ia(m.tokenKey), S(null);
7141
+ m.auth === "bearer" && sa(m.tokenKey), S(null);
7095
7142
  });
7096
7143
  }
7097
7144
  return x("/site/logout", { method: "post" }).catch(() => {}).then(() => {
@@ -7141,18 +7188,18 @@ function oa({ children: e, initialUser: t, disabled: n, apiUrl: r, tenant: i })
7141
7188
  m.loginPage,
7142
7189
  C,
7143
7190
  w
7144
- ]), /* @__PURE__ */ g($i.Provider, {
7191
+ ]), /* @__PURE__ */ g(na.Provider, {
7145
7192
  value: E,
7146
7193
  children: e
7147
7194
  });
7148
7195
  }
7149
- function sa({ when: e, children: t }) {
7150
- let { status: n } = aa();
7196
+ function ua({ when: e, children: t }) {
7197
+ let { status: n } = ca();
7151
7198
  return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
7152
7199
  }
7153
7200
  //#endregion
7154
7201
  //#region ../ui/src/components/builder/apps/auth/views.jsx
7155
- function ca({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: r = "Password", nameLabel: i = "Name", submitLabel: a, style: o, nodeRef: c, inert: l, linked: u, show: d }) {
7202
+ function da({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: r = "Password", nameLabel: i = "Name", submitLabel: a, style: o, nodeRef: c, inert: l, linked: u, show: d }) {
7156
7203
  let { tenant: p, apiUrl: m, settings: h } = s(Y), [v, y] = f("form"), [b, x] = f(""), [S, C] = f(!1), w = e === "register", T = l ? d || "form" : v, E = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", D = async (e) => {
7157
7204
  if (e.preventDefault(), l) return;
7158
7205
  let n = new FormData(e.currentTarget);
@@ -7203,7 +7250,7 @@ function ca({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
7203
7250
  w ? /* @__PURE__ */ _("label", {
7204
7251
  ...X("label"),
7205
7252
  style: {
7206
- ...Sr,
7253
+ ...Tr,
7207
7254
  display: "grid",
7208
7255
  gap: 6
7209
7256
  },
@@ -7212,13 +7259,13 @@ function ca({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
7212
7259
  name: "name",
7213
7260
  type: "text",
7214
7261
  style: Z,
7215
- ...wr(l)
7262
+ ...Dr(l)
7216
7263
  })]
7217
7264
  }) : null,
7218
7265
  /* @__PURE__ */ _("label", {
7219
7266
  ...X("label"),
7220
7267
  style: {
7221
- ...Sr,
7268
+ ...Tr,
7222
7269
  display: "grid",
7223
7270
  gap: 6
7224
7271
  },
@@ -7228,13 +7275,13 @@ function ca({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
7228
7275
  type: "email",
7229
7276
  required: !l,
7230
7277
  style: Z,
7231
- ...wr(l)
7278
+ ...Dr(l)
7232
7279
  })]
7233
7280
  }),
7234
7281
  /* @__PURE__ */ _("label", {
7235
7282
  ...X("label"),
7236
7283
  style: {
7237
- ...Sr,
7284
+ ...Tr,
7238
7285
  display: "grid",
7239
7286
  gap: 6
7240
7287
  },
@@ -7244,7 +7291,7 @@ function ca({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
7244
7291
  type: "password",
7245
7292
  required: !l,
7246
7293
  style: Z,
7247
- ...wr(l)
7294
+ ...Dr(l)
7248
7295
  })]
7249
7296
  }),
7250
7297
  /* @__PURE__ */ g("button", {
@@ -7285,8 +7332,8 @@ function ca({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
7285
7332
  ]
7286
7333
  });
7287
7334
  }
7288
- function la({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
7289
- let { user: c, status: l, signOut: u } = aa(), d = a ? s || "user" : l, f = a ? {
7335
+ function fa({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
7336
+ let { user: c, status: l, signOut: u } = ca(), d = a ? s || "user" : l, f = a ? {
7290
7337
  name: "Ada Lovelace",
7291
7338
  email: "ada@example.com"
7292
7339
  } : c;
@@ -7308,7 +7355,7 @@ function la({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
7308
7355
  /* @__PURE__ */ _("span", {
7309
7356
  ...X("greeting"),
7310
7357
  style: {
7311
- ...Sr,
7358
+ ...Tr,
7312
7359
  fontWeight: 600
7313
7360
  },
7314
7361
  children: [
@@ -7320,7 +7367,7 @@ function la({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
7320
7367
  n && f?.email ? /* @__PURE__ */ g("span", {
7321
7368
  ...X("email"),
7322
7369
  style: {
7323
- ...Sr,
7370
+ ...Tr,
7324
7371
  opacity: .7
7325
7372
  },
7326
7373
  children: f.email
@@ -7337,7 +7384,7 @@ function la({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
7337
7384
  fontSize: 14,
7338
7385
  cursor: a ? "default" : "pointer"
7339
7386
  },
7340
- ...wr(a),
7387
+ ...Dr(a),
7341
7388
  children: t
7342
7389
  })
7343
7390
  ]
@@ -7354,40 +7401,40 @@ function la({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
7354
7401
  }
7355
7402
  //#endregion
7356
7403
  //#region ../ui/src/components/builder/apps/consent/manifest.js
7357
- var ua = {
7404
+ var pa = {
7358
7405
  id: "consent",
7359
7406
  label: "Cookie consent",
7360
7407
  category: "Apps",
7361
7408
  keys: ["CookieConsent"],
7362
7409
  ssr: "shell",
7363
7410
  settings: []
7364
- }, da = "webim.cookie_consent";
7365
- function fa() {
7411
+ }, ma = "webim.cookie_consent";
7412
+ function ha() {
7366
7413
  try {
7367
- let e = window.localStorage.getItem(da), t = e ? JSON.parse(e) : null;
7414
+ let e = window.localStorage.getItem(ma), t = e ? JSON.parse(e) : null;
7368
7415
  return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
7369
7416
  } catch {
7370
7417
  return "";
7371
7418
  }
7372
7419
  }
7373
- function pa(e) {
7420
+ function ga(e) {
7374
7421
  try {
7375
7422
  document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
7376
7423
  } catch {}
7377
7424
  }
7378
- function ma(e) {
7425
+ function _a(e) {
7379
7426
  try {
7380
- window.localStorage.setItem(da, JSON.stringify({
7427
+ window.localStorage.setItem(ma, JSON.stringify({
7381
7428
  choice: e,
7382
7429
  at: (/* @__PURE__ */ new Date()).toISOString()
7383
7430
  }));
7384
7431
  } catch {}
7385
- pa(e);
7432
+ ga(e);
7386
7433
  try {
7387
7434
  window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
7388
7435
  } catch {}
7389
7436
  }
7390
- var ha = {
7437
+ var va = {
7391
7438
  bottom: {
7392
7439
  left: 0,
7393
7440
  right: 0,
@@ -7409,18 +7456,18 @@ var ha = {
7409
7456
  maxWidth: 400
7410
7457
  }
7411
7458
  };
7412
- function ga({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: i, linkHref: a, position: o, linked: s, style: l, nodeRef: u, inert: d }) {
7459
+ function ya({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: i, linkHref: a, position: o, linked: s, style: l, nodeRef: u, inert: d }) {
7413
7460
  let [p, m] = f(!!d), [v, y] = f(null), b = (e) => {
7414
7461
  y(e), typeof u == "function" && u(e);
7415
7462
  };
7416
7463
  if (c(() => {
7417
7464
  if (d) return;
7418
- let e = fa();
7419
- e ? pa(e) : m(!0);
7465
+ let e = ha();
7466
+ e ? ga(e) : m(!0);
7420
7467
  }, [d, v]), !p) return null;
7421
7468
  let x = (e) => () => {
7422
- d || (ma(e), m(!1));
7423
- }, S = ha[o] ?? ha.bottom, C = {
7469
+ d || (_a(e), m(!1));
7470
+ }, S = va[o] ?? va.bottom, C = {
7424
7471
  appearance: "none",
7425
7472
  font: "inherit",
7426
7473
  fontSize: 14,
@@ -7505,37 +7552,37 @@ function ga({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
7505
7552
  }
7506
7553
  //#endregion
7507
7554
  //#region ../ui/src/components/builder/apps/language/manifest.js
7508
- var _a = {
7555
+ var ba = {
7509
7556
  id: "language",
7510
7557
  label: "Language",
7511
7558
  category: "Apps",
7512
7559
  keys: ["SiteLanguagePicker"],
7513
7560
  ssr: "prefetch",
7514
7561
  settings: ["locales"]
7515
- }, va = {
7562
+ }, xa = {
7516
7563
  id: "search",
7517
7564
  label: "Search",
7518
7565
  category: "Apps",
7519
7566
  keys: ["SiteSearch"],
7520
7567
  ssr: "prefetch",
7521
7568
  settings: []
7522
- }, ya = 50, ba = 2e3;
7523
- function xa() {
7569
+ }, Sa = 50, Ca = 2e3;
7570
+ function wa() {
7524
7571
  return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
7525
7572
  }
7526
- function Sa(e, t) {
7573
+ function Ta(e, t) {
7527
7574
  let n = e?.data ?? {}, r = [];
7528
7575
  for (let e of Object.values(n)) {
7529
7576
  let t = e == null ? "" : Jt(e);
7530
- if (t && r.push(t), r.join(" ").length > ba) break;
7577
+ if (t && r.push(t), r.join(" ").length > Ca) break;
7531
7578
  }
7532
- return r.join(" ").slice(0, ba).toLocaleLowerCase(t || void 0);
7579
+ return r.join(" ").slice(0, Ca).toLocaleLowerCase(t || void 0);
7533
7580
  }
7534
- function Ca({ placeholder: e = "Search…", buttonLabel: t = "Search", showButton: n = !0, live: r = !1, layout: a = "inline", includePages: o = !0, collections: l = [], limit: u = 10, emptyText: p = "Nothing found", hint: m = "", style: h, nodeRef: v, inert: y = !1, sample: b = !1 }) {
7535
- let { tenant: x, apiUrl: S, locale: C } = s(Y), [w, T] = f(() => xa()), [E, D] = f(() => xa()), [O, k] = f(null), [A, j] = f(!1), M = d(null), N = a === "popup";
7581
+ function Ea({ placeholder: e = "Search…", buttonLabel: t = "Search", showButton: n = !0, live: r = !1, layout: a = "inline", includePages: o = !0, collections: l = [], limit: u = 10, emptyText: p = "Nothing found", hint: m = "", style: h, nodeRef: v, inert: y = !1, sample: b = !1 }) {
7582
+ let { tenant: x, apiUrl: S, locale: C } = s(Y), [w, T] = f(() => wa()), [E, D] = f(() => wa()), [O, k] = f(null), [A, j] = f(!1), M = d(null), N = a === "popup";
7536
7583
  c(() => {
7537
7584
  let e = () => {
7538
- let e = xa();
7585
+ let e = wa();
7539
7586
  T(e), D(e);
7540
7587
  };
7541
7588
  return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
@@ -7586,7 +7633,7 @@ function Ca({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
7586
7633
  });
7587
7634
  }
7588
7635
  else for (let t of e.rows) {
7589
- if (!Sa(t, C).includes(P)) continue;
7636
+ if (!Ta(t, C).includes(P)) continue;
7590
7637
  let n = t?.data ?? {}, r = Jt(n.name) || "Untitled", i = Jt(n.slug);
7591
7638
  F.push({
7592
7639
  key: `entry:${t.id}`,
@@ -7595,7 +7642,7 @@ function Ca({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
7595
7642
  kind: "entry"
7596
7643
  });
7597
7644
  }
7598
- let I = F.slice(0, Math.min(Math.max(1, u), ya)), L = (e) => {
7645
+ let I = F.slice(0, Math.min(Math.max(1, u), Sa)), L = (e) => {
7599
7646
  if (y) {
7600
7647
  e.preventDefault(), T(E), j(!0);
7601
7648
  return;
@@ -7748,7 +7795,7 @@ function Ca({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
7748
7795
  }
7749
7796
  //#endregion
7750
7797
  //#region ../ui/src/components/builder/apps/shop/manifest.js
7751
- var wa = {
7798
+ var Da = {
7752
7799
  id: "shop",
7753
7800
  label: "Shop",
7754
7801
  category: "Shop",
@@ -7763,7 +7810,7 @@ var wa = {
7763
7810
  ],
7764
7811
  ssr: "shell",
7765
7812
  settings: ["shop.enabled"]
7766
- }, Ta = "webim.cart.", Ea = "webim.currency.", Da = /* @__PURE__ */ new Map(), Oa = {
7813
+ }, Oa = "webim.cart.", ka = "webim.currency.", Aa = /* @__PURE__ */ new Map(), ja = {
7767
7814
  get(e) {
7768
7815
  try {
7769
7816
  return window.localStorage.getItem(e) ?? "";
@@ -7777,7 +7824,7 @@ var wa = {
7777
7824
  } catch {}
7778
7825
  }
7779
7826
  };
7780
- function ka(e) {
7827
+ function Ma(e) {
7781
7828
  if (typeof window > "u") return !1;
7782
7829
  try {
7783
7830
  return new URL(e, window.location.href).origin === window.location.origin;
@@ -7788,7 +7835,7 @@ function ka(e) {
7788
7835
  async function Q(e, t, n, { method: r = "GET", body: i } = {}) {
7789
7836
  let a = await fetch(`${e}${n}`, {
7790
7837
  method: r,
7791
- ...ka(e) ? { credentials: "include" } : {},
7838
+ ...Ma(e) ? { credentials: "include" } : {},
7792
7839
  headers: {
7793
7840
  ...t ? { "x-tenant": t } : {},
7794
7841
  ...i ? { "content-type": "application/json" } : {}
@@ -7804,7 +7851,7 @@ async function Q(e, t, n, { method: r = "GET", body: i } = {}) {
7804
7851
  }
7805
7852
  return o.payload;
7806
7853
  }
7807
- var Aa = {
7854
+ var Na = {
7808
7855
  id: "",
7809
7856
  currency: "",
7810
7857
  lines: [],
@@ -7819,25 +7866,25 @@ var Aa = {
7819
7866
  shipping_total: 0,
7820
7867
  total: 0
7821
7868
  };
7822
- function ja(e, t) {
7823
- let n = `${Ta}${t || "default"}`, r = `${Ea}${t || "default"}`, i = /* @__PURE__ */ new Set(), a = {
7824
- cart: Aa,
7869
+ function Pa(e, t) {
7870
+ let n = `${Oa}${t || "default"}`, r = `${ka}${t || "default"}`, i = /* @__PURE__ */ new Set(), a = {
7871
+ cart: Na,
7825
7872
  loading: !1,
7826
7873
  loaded: !1,
7827
7874
  error: null,
7828
- currency: Oa.get(r)
7875
+ currency: ja.get(r)
7829
7876
  }, o = null, s = () => i.forEach((e) => e()), c = (e) => {
7830
7877
  a = {
7831
7878
  ...a,
7832
7879
  ...e
7833
7880
  }, s();
7834
- }, l = (e) => (e && typeof e == "object" && (e.id && Oa.set(n, e.id), c({
7881
+ }, l = (e) => (e && typeof e == "object" && (e.id && ja.set(n, e.id), c({
7835
7882
  cart: e,
7836
7883
  loaded: !0,
7837
7884
  error: null
7838
7885
  })), e), u = () => {
7839
7886
  if (o) return o;
7840
- let r = Oa.get(n), i = new URLSearchParams({
7887
+ let r = ja.get(n), i = new URLSearchParams({
7841
7888
  ...r ? { id: r } : {},
7842
7889
  ...a.currency ? { currency: a.currency } : {}
7843
7890
  }).toString();
@@ -7853,7 +7900,7 @@ function ja(e, t) {
7853
7900
  return l(await Q(e, t, "/store/cart", {
7854
7901
  method: "POST",
7855
7902
  body: {
7856
- cart_id: Oa.get(n) || void 0,
7903
+ cart_id: ja.get(n) || void 0,
7857
7904
  product_id: r,
7858
7905
  variant_id: i ?? null,
7859
7906
  quantity: o,
@@ -7865,7 +7912,7 @@ function ja(e, t) {
7865
7912
  }
7866
7913
  };
7867
7914
  return typeof window < "u" && window.addEventListener("storage", (e) => {
7868
- e.key === r && c({ currency: Oa.get(r) }), (e.key === n || e.key === r) && u();
7915
+ e.key === r && c({ currency: ja.get(r) }), (e.key === n || e.key === r) && u();
7869
7916
  }), {
7870
7917
  getState: () => a,
7871
7918
  subscribe: (e) => (i.add(e), () => i.delete(e)),
@@ -7881,7 +7928,7 @@ function ja(e, t) {
7881
7928
  return l(await Q(e, t, "/store/cart/coupon", {
7882
7929
  method: "POST",
7883
7930
  body: {
7884
- cart_id: Oa.get(n),
7931
+ cart_id: ja.get(n),
7885
7932
  code: r
7886
7933
  }
7887
7934
  }));
@@ -7889,64 +7936,64 @@ function ja(e, t) {
7889
7936
  c({ loading: !1 });
7890
7937
  }
7891
7938
  },
7892
- setCountry: async (r, i) => Oa.get(n) ? l(await Q(e, t, "/store/cart/country", {
7939
+ setCountry: async (r, i) => ja.get(n) ? l(await Q(e, t, "/store/cart/country", {
7893
7940
  method: "POST",
7894
7941
  body: {
7895
- cart_id: Oa.get(n),
7942
+ cart_id: ja.get(n),
7896
7943
  country: r,
7897
7944
  ...i !== void 0 && { postal_code: i }
7898
7945
  }
7899
7946
  })) : a.cart,
7900
- setDelivery: async (r) => Oa.get(n) ? l(await Q(e, t, "/store/cart/delivery", {
7947
+ setDelivery: async (r) => ja.get(n) ? l(await Q(e, t, "/store/cart/delivery", {
7901
7948
  method: "POST",
7902
7949
  body: {
7903
- cart_id: Oa.get(n),
7950
+ cart_id: ja.get(n),
7904
7951
  delivery: r
7905
7952
  }
7906
7953
  })) : a.cart,
7907
7954
  setCurrency: async (i) => {
7908
- if (Oa.set(r, i), c({ currency: i }), !Oa.get(n)) return u();
7955
+ if (ja.set(r, i), c({ currency: i }), !ja.get(n)) return u();
7909
7956
  try {
7910
7957
  return l(await Q(e, t, "/store/cart/currency", {
7911
7958
  method: "POST",
7912
7959
  body: {
7913
- cart_id: Oa.get(n),
7960
+ cart_id: ja.get(n),
7914
7961
  currency: i
7915
7962
  }
7916
7963
  }));
7917
7964
  } catch {
7918
- return Oa.set(r, ""), c({ currency: "" }), u();
7965
+ return ja.set(r, ""), c({ currency: "" }), u();
7919
7966
  }
7920
7967
  },
7921
7968
  reset: () => {
7922
- Oa.set(n, ""), c({ cart: Aa });
7969
+ ja.set(n, ""), c({ cart: Na });
7923
7970
  },
7924
- cartId: () => Oa.get(n)
7971
+ cartId: () => ja.get(n)
7925
7972
  };
7926
7973
  }
7927
- function Ma(e, t) {
7974
+ function Fa(e, t) {
7928
7975
  let n = `${e}|${t}`;
7929
- return Da.has(n) || Da.set(n, ja(e, t)), Da.get(n);
7976
+ return Aa.has(n) || Aa.set(n, Pa(e, t)), Aa.get(n);
7930
7977
  }
7931
- function Na(e, t) {
7978
+ function Ia(e, t) {
7932
7979
  let n = Array.isArray(e?.currencies) ? e.currencies : [];
7933
7980
  return t && n.includes(t) ? t : e?.currency || "";
7934
7981
  }
7935
- var Pa = "AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW".split(" ");
7936
- function Fa(e, t = [], n = null) {
7982
+ var La = "AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW".split(" ");
7983
+ function Ra(e, t = [], n = null) {
7937
7984
  let r;
7938
7985
  try {
7939
7986
  r = new Intl.DisplayNames([e || "en"], { type: "region" });
7940
7987
  } catch {
7941
7988
  r = { of: (e) => e };
7942
7989
  }
7943
- let i = (n ?? Pa).map((e) => ({
7990
+ let i = (n ?? La).map((e) => ({
7944
7991
  code: e,
7945
7992
  name: r.of(e) ?? e
7946
7993
  })), a = i.filter((e) => t.includes(e.code)).sort((t, n) => t.name.localeCompare(n.name, e || void 0)), o = i.filter((e) => !t.includes(e.code)).sort((t, n) => t.name.localeCompare(n.name, e || void 0));
7947
7994
  return [...a, ...o];
7948
7995
  }
7949
- function Ia(e, t, n) {
7996
+ function za(e, t, n) {
7950
7997
  let r = t || "USD";
7951
7998
  try {
7952
7999
  let t = new Intl.NumberFormat(n || void 0, {
@@ -7958,7 +8005,7 @@ function Ia(e, t, n) {
7958
8005
  return `${(Number(e || 0) / 100).toFixed(2)} ${r}`;
7959
8006
  }
7960
8007
  }
7961
- var La = {
8008
+ var Ba = {
7962
8009
  en: {
7963
8010
  add: "Add to cart",
7964
8011
  adding: "Adding…",
@@ -8290,24 +8337,24 @@ var La = {
8290
8337
  no: "Hayır"
8291
8338
  }
8292
8339
  };
8293
- function Ra(e) {
8294
- let t = La[String(e || "").toLowerCase().split("-")[0]] ?? La.en, n = (e, n) => {
8295
- let r = t[e] ?? La.en[e] ?? e;
8340
+ function Va(e) {
8341
+ let t = Ba[String(e || "").toLowerCase().split("-")[0]] ?? Ba.en, n = (e, n) => {
8342
+ let r = t[e] ?? Ba.en[e] ?? e;
8296
8343
  return n ? r.replace(/\{(\w+)\}/g, (e, t) => t in n ? String(n[t]) : e) : r;
8297
8344
  };
8298
- return n.has = (e) => e in La.en, n;
8345
+ return n.has = (e) => e in Ba.en, n;
8299
8346
  }
8300
- var za = (e, t) => t?.code && e.has(t.code) ? e(t.code) : t?.message ?? "", Ba = /* @__PURE__ */ new Map();
8301
- function Va(e, t) {
8347
+ var Ha = (e, t) => t?.code && e.has(t.code) ? e(t.code) : t?.message ?? "", Ua = /* @__PURE__ */ new Map();
8348
+ function Wa(e, t) {
8302
8349
  let n = `${e}|${t}`;
8303
- return Ba.has(n) || Ba.set(n, Q(e, t, "/store/policies").then((e) => Array.isArray(e) ? e : []).catch(() => (Ba.delete(n), []))), Ba.get(n);
8350
+ return Ua.has(n) || Ua.set(n, Q(e, t, "/store/policies").then((e) => Array.isArray(e) ? e : []).catch(() => (Ua.delete(n), []))), Ua.get(n);
8304
8351
  }
8305
- function Ha(e) {
8352
+ function Ga(e) {
8306
8353
  let t = /* @__PURE__ */ new Date(), n = Math.max(0, Math.round(Number(e) || 0));
8307
8354
  for (; n > 0;) t.setDate(t.getDate() + 1), t.getDay() !== 0 && t.getDay() !== 6 && --n;
8308
8355
  return t;
8309
8356
  }
8310
- function Ua(e, t, n, r) {
8357
+ function Ka(e, t, n, r) {
8311
8358
  let i = (e) => e != null && Number.isFinite(Number(e));
8312
8359
  if (!i(n) && !i(r)) return "";
8313
8360
  let a;
@@ -8322,7 +8369,7 @@ function Ua(e, t, n, r) {
8322
8369
  day: "numeric"
8323
8370
  });
8324
8371
  }
8325
- let o = a.format(Ha(i(n) ? n : r)), s = a.format(Ha(i(r) ? r : n));
8372
+ let o = a.format(Ga(i(n) ? n : r)), s = a.format(Ga(i(r) ? r : n));
8326
8373
  return o === s ? e("arrives", { date: o }) : e("arrivesRange", {
8327
8374
  from: o,
8328
8375
  to: s
@@ -8330,7 +8377,7 @@ function Ua(e, t, n, r) {
8330
8377
  }
8331
8378
  //#endregion
8332
8379
  //#region ../ui/src/components/builder/apps/shop/engagement.jsx
8333
- var Wa = "var(--page-muted, rgba(100,116,139,1))", Ga = "1px solid var(--page-border, #d1d5db)", Ka = "var(--page-surface, #f2f2f2)", qa = "#f59e0b", Ja = {
8380
+ var qa = "var(--page-muted, rgba(100,116,139,1))", Ja = "1px solid var(--page-border, #d1d5db)", Ya = "var(--page-surface, #f2f2f2)", Xa = "#f59e0b", Za = {
8334
8381
  ...rn,
8335
8382
  border: 0,
8336
8383
  borderRadius: "8px",
@@ -8338,14 +8385,14 @@ var Wa = "var(--page-muted, rgba(100,116,139,1))", Ga = "1px solid var(--page-bo
8338
8385
  fontSize: "14px",
8339
8386
  fontWeight: 600,
8340
8387
  fontFamily: "inherit"
8341
- }, Ya = {
8342
- ...Ja,
8388
+ }, Qa = {
8389
+ ...Za,
8343
8390
  backgroundColor: "transparent",
8344
8391
  color: "var(--page-text, #111827)",
8345
- border: Ga
8392
+ border: Ja
8346
8393
  };
8347
- function Xa() {
8348
- let { tenant: e, apiUrl: t, locale: n, settings: r } = s(Y), i = u(() => Ra(n), [n]), a = (e) => r?.[e] !== !1;
8394
+ function $a() {
8395
+ let { tenant: e, apiUrl: t, locale: n, settings: r } = s(Y), i = u(() => Va(n), [n]), a = (e) => r?.[e] !== !1;
8349
8396
  return {
8350
8397
  tenant: e,
8351
8398
  apiUrl: t || "/api",
@@ -8356,12 +8403,12 @@ function Xa() {
8356
8403
  favoritesOn: a("shop.favorites"),
8357
8404
  moderated: r?.["shop.reviewModeration"] !== "auto",
8358
8405
  loginHref: () => {
8359
- let e = ta(r).loginPage || "/login", t = typeof window > "u" ? "" : `${window.location.pathname}${window.location.search}`;
8406
+ let e = ia(r).loginPage || "/login", t = typeof window > "u" ? "" : `${window.location.pathname}${window.location.search}`;
8360
8407
  return t ? `${e}${e.includes("?") ? "&" : "?"}next=${encodeURIComponent(t)}` : e;
8361
8408
  }
8362
8409
  };
8363
8410
  }
8364
- var Za = (e, t) => {
8411
+ var eo = (e, t) => {
8365
8412
  try {
8366
8413
  return new Intl.NumberFormat(t || void 0, {
8367
8414
  notation: "compact",
@@ -8370,7 +8417,7 @@ var Za = (e, t) => {
8370
8417
  } catch {
8371
8418
  return String(e);
8372
8419
  }
8373
- }, Qa = (e, t) => {
8420
+ }, to = (e, t) => {
8374
8421
  try {
8375
8422
  return new Intl.DateTimeFormat(t || void 0, {
8376
8423
  day: "numeric",
@@ -8380,8 +8427,8 @@ var Za = (e, t) => {
8380
8427
  } catch {
8381
8428
  return String(e).slice(0, 10);
8382
8429
  }
8383
- }, $a = "M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3l-5.9 3.3 1.3-6.6-4.9-4.6 6.6-.8z";
8384
- function eo({ fill: e = 0, size: t = 16, clipId: n }) {
8430
+ }, no = "M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3l-5.9 3.3 1.3-6.6-4.9-4.6 6.6-.8z";
8431
+ function ro({ fill: e = 0, size: t = 16, clipId: n }) {
8385
8432
  return /* @__PURE__ */ _("svg", {
8386
8433
  width: t,
8387
8434
  height: t,
@@ -8399,18 +8446,18 @@ function eo({ fill: e = 0, size: t = 16, clipId: n }) {
8399
8446
  })
8400
8447
  }) }),
8401
8448
  /* @__PURE__ */ g("path", {
8402
- d: $a,
8449
+ d: no,
8403
8450
  fill: "var(--page-border, #d1d5db)"
8404
8451
  }),
8405
8452
  e > 0 && /* @__PURE__ */ g("path", {
8406
- d: $a,
8407
- fill: qa,
8453
+ d: no,
8454
+ fill: Xa,
8408
8455
  clipPath: `url(#${n})`
8409
8456
  })
8410
8457
  ]
8411
8458
  });
8412
8459
  }
8413
- function to({ value: e = 0, size: t = 16 }) {
8460
+ function io({ value: e = 0, size: t = 16 }) {
8414
8461
  let n = l().replace(/:/g, "");
8415
8462
  return /* @__PURE__ */ g("span", {
8416
8463
  role: "img",
@@ -8427,14 +8474,14 @@ function to({ value: e = 0, size: t = 16 }) {
8427
8474
  2,
8428
8475
  3,
8429
8476
  4
8430
- ].map((r) => /* @__PURE__ */ g(eo, {
8477
+ ].map((r) => /* @__PURE__ */ g(ro, {
8431
8478
  fill: Math.max(0, Math.min(1, e - r)),
8432
8479
  size: t,
8433
8480
  clipId: `${n}-${r}`
8434
8481
  }, r))
8435
8482
  });
8436
8483
  }
8437
- function no({ value: e, onChange: t, size: n = 28, label: r }) {
8484
+ function ao({ value: e, onChange: t, size: n = 28, label: r }) {
8438
8485
  let i = l().replace(/:/g, ""), [a, o] = f(0), s = a || e;
8439
8486
  return /* @__PURE__ */ g("span", {
8440
8487
  role: "radiogroup",
@@ -8465,7 +8512,7 @@ function no({ value: e, onChange: t, size: n = 28, label: r }) {
8465
8512
  cursor: "pointer",
8466
8513
  lineHeight: 0
8467
8514
  },
8468
- children: /* @__PURE__ */ g(eo, {
8515
+ children: /* @__PURE__ */ g(ro, {
8469
8516
  fill: +(s >= r),
8470
8517
  size: n,
8471
8518
  clipId: `${i}-${r}`
@@ -8473,8 +8520,8 @@ function no({ value: e, onChange: t, size: n = 28, label: r }) {
8473
8520
  }, r))
8474
8521
  });
8475
8522
  }
8476
- function ro(e, { inert: t }) {
8477
- let { tenant: n, apiUrl: r, favoritesOn: i } = Xa(), [a, o] = f({
8523
+ function oo(e, { inert: t }) {
8524
+ let { tenant: n, apiUrl: r, favoritesOn: i } = $a(), [a, o] = f({
8478
8525
  favorited: !1,
8479
8526
  count: null
8480
8527
  });
@@ -8514,7 +8561,7 @@ function ro(e, { inert: t }) {
8514
8561
  toggle: s
8515
8562
  };
8516
8563
  }
8517
- var io = (e) => /* @__PURE__ */ g("svg", {
8564
+ var so = (e) => /* @__PURE__ */ g("svg", {
8518
8565
  width: "20",
8519
8566
  height: "20",
8520
8567
  viewBox: "0 0 24 24",
@@ -8527,8 +8574,8 @@ var io = (e) => /* @__PURE__ */ g("svg", {
8527
8574
  strokeWidth: "1.8"
8528
8575
  })
8529
8576
  });
8530
- function ao({ product: e, inert: t = !1, sample: n = !1 }) {
8531
- let { locale: r, words: i, reviewsOn: a, questionsOn: o, favoritesOn: s, loginHref: c } = Xa(), l = e?.sample ? "" : e?.slug || e?.id || "", u = ro(l, { inert: t || !l }), [d, p] = f(""), m = n ? 29 : e?.rating_count ?? 0, h = n ? 4.3 : Number(e?.rating_avg ?? 0), v = n ? 110 : e?.questions_count ?? 0, y = n ? 1300 : u.count ?? e?.favorites_count ?? 0, b = (e) => (n) => {
8577
+ function co({ product: e, inert: t = !1, sample: n = !1 }) {
8578
+ let { locale: r, words: i, reviewsOn: a, questionsOn: o, favoritesOn: s, loginHref: c } = $a(), l = e?.sample ? "" : e?.slug || e?.id || "", u = oo(l, { inert: t || !l }), [d, p] = f(""), m = n ? 29 : e?.rating_count ?? 0, h = n ? 4.3 : Number(e?.rating_avg ?? 0), v = n ? 110 : e?.questions_count ?? 0, y = n ? 1300 : u.count ?? e?.favorites_count ?? 0, b = (e) => (n) => {
8532
8579
  n.preventDefault(), !t && document.getElementById(e)?.scrollIntoView({
8533
8580
  behavior: "smooth",
8534
8581
  block: "start"
@@ -8537,7 +8584,7 @@ function ao({ product: e, inert: t = !1, sample: n = !1 }) {
8537
8584
  if (!(t || !l)) try {
8538
8585
  await u.toggle();
8539
8586
  } catch (e) {
8540
- e?.code === "LOGIN_REQUIRED" ? window.location.assign(c()) : p(za(i, e));
8587
+ e?.code === "LOGIN_REQUIRED" ? window.location.assign(c()) : p(Ha(i, e));
8541
8588
  }
8542
8589
  }, S = [];
8543
8590
  return a && m > 0 && S.push(/* @__PURE__ */ _("span", {
@@ -8555,13 +8602,13 @@ function ao({ product: e, inert: t = !1, sample: n = !1 }) {
8555
8602
  maximumFractionDigits: 1
8556
8603
  })
8557
8604
  }),
8558
- /* @__PURE__ */ g(to, { value: h }),
8605
+ /* @__PURE__ */ g(io, { value: h }),
8559
8606
  /* @__PURE__ */ g("a", {
8560
8607
  href: "#reviews",
8561
8608
  onClick: b("reviews"),
8562
8609
  ...X("rating-link"),
8563
8610
  style: { color: "inherit" },
8564
- children: m === 1 ? i("reviewsOne") : i("reviewsCount", { n: Za(m, r) })
8611
+ children: m === 1 ? i("reviewsOne") : i("reviewsCount", { n: eo(m, r) })
8565
8612
  })
8566
8613
  ]
8567
8614
  }, "r")), o && v > 0 && S.push(/* @__PURE__ */ g("a", {
@@ -8569,7 +8616,7 @@ function ao({ product: e, inert: t = !1, sample: n = !1 }) {
8569
8616
  onClick: b("questions"),
8570
8617
  ...X("qa-link"),
8571
8618
  style: { color: "inherit" },
8572
- children: i("qaCount", { n: Za(v, r) })
8619
+ children: i("qaCount", { n: eo(v, r) })
8573
8620
  }, "q")), !S.length && !s ? null : /* @__PURE__ */ _("div", {
8574
8621
  ...X("engagement"),
8575
8622
  style: {
@@ -8588,7 +8635,7 @@ function ao({ product: e, inert: t = !1, sample: n = !1 }) {
8588
8635
  },
8589
8636
  children: S.flatMap((e, t) => t ? [/* @__PURE__ */ g("span", {
8590
8637
  ...X("separator"),
8591
- style: { color: Wa },
8638
+ style: { color: qa },
8592
8639
  children: "•"
8593
8640
  }, `s${t}`), e] : [e])
8594
8641
  }),
@@ -8606,22 +8653,22 @@ function ao({ product: e, inert: t = !1, sample: n = !1 }) {
8606
8653
  "aria-label": u.favorited ? i("unfavorite") : i("favorite"),
8607
8654
  title: u.favorited ? i("unfavorite") : i("favorite"),
8608
8655
  style: {
8609
- ...Ya,
8656
+ ...Qa,
8610
8657
  padding: "7px",
8611
8658
  borderRadius: "999px",
8612
8659
  lineHeight: 0
8613
8660
  },
8614
- children: io(u.favorited)
8661
+ children: so(u.favorited)
8615
8662
  }), y > 0 && /* @__PURE__ */ g("span", {
8616
8663
  ...X("favorites-count"),
8617
8664
  style: { fontWeight: 600 },
8618
- children: y === 1 ? i("lovedByOne") : i("lovedBy", { n: Za(y, r) })
8665
+ children: y === 1 ? i("lovedByOne") : i("lovedBy", { n: eo(y, r) })
8619
8666
  })]
8620
8667
  }),
8621
8668
  d && /* @__PURE__ */ g("span", {
8622
8669
  ...X("note"),
8623
8670
  style: {
8624
- color: Wa,
8671
+ color: qa,
8625
8672
  fontSize: "13px"
8626
8673
  },
8627
8674
  children: d
@@ -8629,7 +8676,7 @@ function ao({ product: e, inert: t = !1, sample: n = !1 }) {
8629
8676
  ]
8630
8677
  });
8631
8678
  }
8632
- var oo = {
8679
+ var lo = {
8633
8680
  data: [{
8634
8681
  id: "s1",
8635
8682
  author: "Ayşe Y.",
@@ -8665,8 +8712,8 @@ var oo = {
8665
8712
  ]
8666
8713
  }
8667
8714
  };
8668
- function so({ product: e, inert: t = !1, sample: n = !1 }) {
8669
- let { tenant: r, apiUrl: i, locale: a, words: o, reviewsOn: s, moderated: l, loginHref: u } = Xa(), d = aa(), p = e?.sample ? "" : e?.slug || e?.id || "", [m, h] = f(null), [v, y] = f("newest"), [b, x] = f(0), [S, C] = f(5), [w, T] = f(0), [E, D] = f({
8715
+ function uo({ product: e, inert: t = !1, sample: n = !1 }) {
8716
+ let { tenant: r, apiUrl: i, locale: a, words: o, reviewsOn: s, moderated: l, loginHref: u } = $a(), d = ca(), p = e?.sample ? "" : e?.slug || e?.id || "", [m, h] = f(null), [v, y] = f("newest"), [b, x] = f(0), [S, C] = f(5), [w, T] = f(0), [E, D] = f({
8670
8717
  rating: 0,
8671
8718
  title: "",
8672
8719
  body: ""
@@ -8704,7 +8751,7 @@ function so({ product: e, inert: t = !1, sample: n = !1 }) {
8704
8751
  w,
8705
8752
  s
8706
8753
  ]), !s) return null;
8707
- let P = n || !p ? oo : m, F = P?.summary ?? {
8754
+ let P = n || !p ? lo : m, F = P?.summary ?? {
8708
8755
  average: 0,
8709
8756
  count: 0,
8710
8757
  histogram: [
@@ -8742,7 +8789,7 @@ function so({ product: e, inert: t = !1, sample: n = !1 }) {
8742
8789
  body: E
8743
8790
  }), k(!1), N(o(l ? "reviewPending" : "reviewThanks")), T((e) => e + 1);
8744
8791
  } catch (e) {
8745
- e?.code === "LOGIN_REQUIRED" ? window.location.assign(u()) : N(za(o, e));
8792
+ e?.code === "LOGIN_REQUIRED" ? window.location.assign(u()) : N(Ha(o, e));
8746
8793
  } finally {
8747
8794
  j(!1);
8748
8795
  }
@@ -8794,14 +8841,14 @@ function so({ product: e, inert: t = !1, sample: n = !1 }) {
8794
8841
  maximumFractionDigits: 1
8795
8842
  }) : "–"
8796
8843
  }),
8797
- /* @__PURE__ */ g(to, {
8844
+ /* @__PURE__ */ g(io, {
8798
8845
  value: F.average,
8799
8846
  size: 18
8800
8847
  }),
8801
8848
  /* @__PURE__ */ g("span", {
8802
8849
  ...X("reviews-count"),
8803
8850
  style: {
8804
- color: Wa,
8851
+ color: qa,
8805
8852
  fontSize: "13px"
8806
8853
  },
8807
8854
  children: F.count === 1 ? o("reviewsOne") : o("reviewsCount", { n: F.count })
@@ -8853,7 +8900,7 @@ function so({ product: e, inert: t = !1, sample: n = !1 }) {
8853
8900
  style: {
8854
8901
  height: "8px",
8855
8902
  borderRadius: "4px",
8856
- background: Ka,
8903
+ background: Ya,
8857
8904
  overflow: "hidden"
8858
8905
  },
8859
8906
  children: /* @__PURE__ */ g("span", {
@@ -8862,13 +8909,13 @@ function so({ product: e, inert: t = !1, sample: n = !1 }) {
8862
8909
  display: "block",
8863
8910
  height: "100%",
8864
8911
  width: `${n / B * 100}%`,
8865
- background: qa
8912
+ background: Xa
8866
8913
  }
8867
8914
  })
8868
8915
  }),
8869
8916
  /* @__PURE__ */ g("span", {
8870
8917
  style: {
8871
- color: Wa,
8918
+ color: qa,
8872
8919
  textAlign: "right"
8873
8920
  },
8874
8921
  children: n
@@ -8883,7 +8930,7 @@ function so({ product: e, inert: t = !1, sample: n = !1 }) {
8883
8930
  type: "button",
8884
8931
  onClick: R,
8885
8932
  ...X("review-button"),
8886
- style: Ja,
8933
+ style: Za,
8887
8934
  children: o(L || t ? I ? "editReview" : "writeReview" : "signInToReview")
8888
8935
  })
8889
8936
  })
@@ -8897,7 +8944,7 @@ function so({ product: e, inert: t = !1, sample: n = !1 }) {
8897
8944
  flexDirection: "column",
8898
8945
  gap: "10px",
8899
8946
  padding: "16px",
8900
- border: Ga,
8947
+ border: Ja,
8901
8948
  borderRadius: "12px"
8902
8949
  },
8903
8950
  children: [
@@ -8909,7 +8956,7 @@ function so({ product: e, inert: t = !1, sample: n = !1 }) {
8909
8956
  gap: "12px",
8910
8957
  fontWeight: 600
8911
8958
  },
8912
- children: [o("yourRating"), /* @__PURE__ */ g(no, {
8959
+ children: [o("yourRating"), /* @__PURE__ */ g(ao, {
8913
8960
  value: E.rating,
8914
8961
  label: o("yourRating"),
8915
8962
  onChange: (e) => D((t) => ({
@@ -8954,13 +9001,13 @@ function so({ product: e, inert: t = !1, sample: n = !1 }) {
8954
9001
  type: "submit",
8955
9002
  disabled: A,
8956
9003
  ...X("submit-button"),
8957
- style: Ja,
9004
+ style: Za,
8958
9005
  children: o("submitReview")
8959
9006
  }), /* @__PURE__ */ g("button", {
8960
9007
  type: "button",
8961
9008
  onClick: () => k(!1),
8962
9009
  ...X("cancel-button"),
8963
- style: Ya,
9010
+ style: Qa,
8964
9011
  children: "✕"
8965
9012
  })]
8966
9013
  })
@@ -8970,7 +9017,7 @@ function so({ product: e, inert: t = !1, sample: n = !1 }) {
8970
9017
  ...X("note"),
8971
9018
  style: {
8972
9019
  margin: 0,
8973
- color: Wa
9020
+ color: qa
8974
9021
  },
8975
9022
  children: M
8976
9023
  }),
@@ -9014,7 +9061,7 @@ function so({ product: e, inert: t = !1, sample: n = !1 }) {
9014
9061
  onClick: () => x(0),
9015
9062
  ...X("filter-chip"),
9016
9063
  style: {
9017
- ...Ya,
9064
+ ...Qa,
9018
9065
  padding: "6px 12px"
9019
9066
  },
9020
9067
  children: [o("starsN", { n: b }), " ✕"]
@@ -9024,7 +9071,7 @@ function so({ product: e, inert: t = !1, sample: n = !1 }) {
9024
9071
  ...X("empty"),
9025
9072
  style: {
9026
9073
  margin: 0,
9027
- color: Wa
9074
+ color: qa
9028
9075
  },
9029
9076
  children: o("noReviews")
9030
9077
  }),
@@ -9037,7 +9084,7 @@ function so({ product: e, inert: t = !1, sample: n = !1 }) {
9037
9084
  ...X("review"),
9038
9085
  style: {
9039
9086
  padding: "16px 0",
9040
- borderTop: Ga,
9087
+ borderTop: Ja,
9041
9088
  display: "flex",
9042
9089
  flexDirection: "column",
9043
9090
  gap: "6px"
@@ -9051,7 +9098,7 @@ function so({ product: e, inert: t = !1, sample: n = !1 }) {
9051
9098
  flexWrap: "wrap"
9052
9099
  },
9053
9100
  children: [
9054
- /* @__PURE__ */ g(to, { value: e.rating }),
9101
+ /* @__PURE__ */ g(io, { value: e.rating }),
9055
9102
  e.title && /* @__PURE__ */ g("strong", {
9056
9103
  ...X("review-title"),
9057
9104
  children: e.title
@@ -9062,8 +9109,8 @@ function so({ product: e, inert: t = !1, sample: n = !1 }) {
9062
9109
  fontSize: "12px",
9063
9110
  padding: "2px 8px",
9064
9111
  borderRadius: "999px",
9065
- background: Ka,
9066
- color: Wa
9112
+ background: Ya,
9113
+ color: qa
9067
9114
  },
9068
9115
  children: o("awaitingApproval")
9069
9116
  })
@@ -9082,12 +9129,12 @@ function so({ product: e, inert: t = !1, sample: n = !1 }) {
9082
9129
  ...X("meta"),
9083
9130
  style: {
9084
9131
  fontSize: "13px",
9085
- color: Wa
9132
+ color: qa
9086
9133
  },
9087
9134
  children: [
9088
9135
  e.author || o("anonymous"),
9089
9136
  " · ",
9090
- Qa(e.created_at, a),
9137
+ to(e.created_at, a),
9091
9138
  e.verified && /* @__PURE__ */ _("span", {
9092
9139
  ...X("verified"),
9093
9140
  style: {
@@ -9104,7 +9151,7 @@ function so({ product: e, inert: t = !1, sample: n = !1 }) {
9104
9151
  marginTop: "4px",
9105
9152
  padding: "10px 12px",
9106
9153
  borderRadius: "8px",
9107
- background: Ka,
9154
+ background: Ya,
9108
9155
  fontSize: "14px"
9109
9156
  },
9110
9157
  children: [/* @__PURE__ */ g("strong", {
@@ -9112,7 +9159,7 @@ function so({ product: e, inert: t = !1, sample: n = !1 }) {
9112
9159
  style: {
9113
9160
  display: "block",
9114
9161
  fontSize: "12px",
9115
- color: Wa,
9162
+ color: qa,
9116
9163
  marginBottom: "2px"
9117
9164
  },
9118
9165
  children: o("shopReply")
@@ -9129,7 +9176,7 @@ function so({ product: e, inert: t = !1, sample: n = !1 }) {
9129
9176
  onClick: () => C((e) => e + 10),
9130
9177
  ...X("load-more"),
9131
9178
  style: {
9132
- ...Ya,
9179
+ ...Qa,
9133
9180
  alignSelf: "center"
9134
9181
  },
9135
9182
  children: o("loadMore")
@@ -9137,7 +9184,7 @@ function so({ product: e, inert: t = !1, sample: n = !1 }) {
9137
9184
  ]
9138
9185
  });
9139
9186
  }
9140
- var co = {
9187
+ var fo = {
9141
9188
  data: [{
9142
9189
  id: "q1",
9143
9190
  author: "Can D.",
@@ -9150,8 +9197,8 @@ var co = {
9150
9197
  filtered: 1
9151
9198
  }
9152
9199
  };
9153
- function lo({ product: e, inert: t = !1, sample: n = !1 }) {
9154
- let { tenant: r, apiUrl: i, locale: a, words: o, questionsOn: s, loginHref: l } = Xa(), u = aa(), d = e?.sample ? "" : e?.slug || e?.id || "", [p, m] = f(null), [h, v] = f(5), [y, b] = f(0), [x, S] = f(""), [C, w] = f(!1), [T, E] = f("");
9200
+ function po({ product: e, inert: t = !1, sample: n = !1 }) {
9201
+ let { tenant: r, apiUrl: i, locale: a, words: o, questionsOn: s, loginHref: l } = $a(), u = ca(), d = e?.sample ? "" : e?.slug || e?.id || "", [p, m] = f(null), [h, v] = f(5), [y, b] = f(0), [x, S] = f(""), [C, w] = f(!1), [T, E] = f("");
9155
9202
  if (c(() => {
9156
9203
  if (!s || !d) return;
9157
9204
  let e = !0;
@@ -9172,7 +9219,7 @@ function lo({ product: e, inert: t = !1, sample: n = !1 }) {
9172
9219
  y,
9173
9220
  s
9174
9221
  ]), !s) return null;
9175
- let D = n || !d ? co : p, O = u.status === "user", k = async (e) => {
9222
+ let D = n || !d ? fo : p, O = u.status === "user", k = async (e) => {
9176
9223
  if (e.preventDefault(), !(t || x.trim().length < 3)) {
9177
9224
  if (!O) {
9178
9225
  window.location.assign(l());
@@ -9185,7 +9232,7 @@ function lo({ product: e, inert: t = !1, sample: n = !1 }) {
9185
9232
  body: { question: x.trim() }
9186
9233
  }), S(""), E(o("questionPending")), b((e) => e + 1);
9187
9234
  } catch (e) {
9188
- e?.code === "LOGIN_REQUIRED" ? window.location.assign(l()) : E(za(o, e));
9235
+ e?.code === "LOGIN_REQUIRED" ? window.location.assign(l()) : E(Ha(o, e));
9189
9236
  } finally {
9190
9237
  w(!1);
9191
9238
  }
@@ -9231,7 +9278,7 @@ function lo({ product: e, inert: t = !1, sample: n = !1 }) {
9231
9278
  type: "submit",
9232
9279
  disabled: C || x.trim().length < 3,
9233
9280
  ...X("submit-button"),
9234
- style: Ja,
9281
+ style: Za,
9235
9282
  children: o("submitQuestion")
9236
9283
  })]
9237
9284
  }) : /* @__PURE__ */ g("p", {
@@ -9247,7 +9294,7 @@ function lo({ product: e, inert: t = !1, sample: n = !1 }) {
9247
9294
  ...X("note"),
9248
9295
  style: {
9249
9296
  margin: 0,
9250
- color: Wa
9297
+ color: qa
9251
9298
  },
9252
9299
  children: T
9253
9300
  }),
@@ -9255,7 +9302,7 @@ function lo({ product: e, inert: t = !1, sample: n = !1 }) {
9255
9302
  ...X("empty"),
9256
9303
  style: {
9257
9304
  margin: 0,
9258
- color: Wa
9305
+ color: qa
9259
9306
  },
9260
9307
  children: o("noQuestions")
9261
9308
  }),
@@ -9268,7 +9315,7 @@ function lo({ product: e, inert: t = !1, sample: n = !1 }) {
9268
9315
  ...X("question"),
9269
9316
  style: {
9270
9317
  padding: "14px 0",
9271
- borderTop: Ga,
9318
+ borderTop: Ja,
9272
9319
  display: "flex",
9273
9320
  flexDirection: "column",
9274
9321
  gap: "6px"
@@ -9309,7 +9356,7 @@ function lo({ product: e, inert: t = !1, sample: n = !1 }) {
9309
9356
  ...X("badge"),
9310
9357
  style: {
9311
9358
  fontSize: "12px",
9312
- color: Wa
9359
+ color: qa
9313
9360
  },
9314
9361
  children: o("awaitingAnswer")
9315
9362
  }),
@@ -9317,12 +9364,12 @@ function lo({ product: e, inert: t = !1, sample: n = !1 }) {
9317
9364
  ...X("meta"),
9318
9365
  style: {
9319
9366
  fontSize: "12px",
9320
- color: Wa
9367
+ color: qa
9321
9368
  },
9322
9369
  children: [
9323
9370
  e.author || o("anonymous"),
9324
9371
  " · ",
9325
- Qa(e.created_at, a)
9372
+ to(e.created_at, a)
9326
9373
  ]
9327
9374
  })
9328
9375
  ]
@@ -9333,7 +9380,7 @@ function lo({ product: e, inert: t = !1, sample: n = !1 }) {
9333
9380
  onClick: () => v((e) => e + 10),
9334
9381
  ...X("load-more"),
9335
9382
  style: {
9336
- ...Ya,
9383
+ ...Qa,
9337
9384
  alignSelf: "center"
9338
9385
  },
9339
9386
  children: o("loadMore")
@@ -9343,8 +9390,8 @@ function lo({ product: e, inert: t = !1, sample: n = !1 }) {
9343
9390
  }
9344
9391
  //#endregion
9345
9392
  //#region ../ui/src/components/builder/apps/shop/specs.jsx
9346
- var uo = "1px solid var(--page-border, #d1d5db)", fo = "var(--page-muted, rgba(100,116,139,1))", po = (e) => /^(https?:)?\/\//i.test(String(e)) || String(e).startsWith("/") ? String(e) : "";
9347
- function mo(e, t, n, r) {
9393
+ var mo = "1px solid var(--page-border, #d1d5db)", ho = "var(--page-muted, rgba(100,116,139,1))", go = (e) => /^(https?:)?\/\//i.test(String(e)) || String(e).startsWith("/") ? String(e) : "";
9394
+ function _o(e, t, n, r) {
9348
9395
  let i = n || void 0;
9349
9396
  switch (e.type) {
9350
9397
  case "integer":
@@ -9367,7 +9414,7 @@ function mo(e, t, n, r) {
9367
9414
  gap: "6px"
9368
9415
  },
9369
9416
  children: [
9370
- n === 5 && /* @__PURE__ */ g(to, { value: Number(t) }),
9417
+ n === 5 && /* @__PURE__ */ g(io, { value: Number(t) }),
9371
9418
  Number(t).toLocaleString(i),
9372
9419
  " / ",
9373
9420
  n
@@ -9399,12 +9446,12 @@ function mo(e, t, n, r) {
9399
9446
  height: "14px",
9400
9447
  borderRadius: "4px",
9401
9448
  background: t,
9402
- border: uo,
9449
+ border: mo,
9403
9450
  display: "inline-block"
9404
9451
  } }), t]
9405
9452
  });
9406
9453
  case "link": {
9407
- let e = po(t);
9454
+ let e = go(t);
9408
9455
  return e ? /* @__PURE__ */ g("a", {
9409
9456
  href: e,
9410
9457
  target: "_blank",
@@ -9413,7 +9460,7 @@ function mo(e, t, n, r) {
9413
9460
  children: t
9414
9461
  }) : String(t);
9415
9462
  }
9416
- case "image": return po(t) ? /* @__PURE__ */ g("img", {
9463
+ case "image": return go(t) ? /* @__PURE__ */ g("img", {
9417
9464
  src: t,
9418
9465
  alt: e.name,
9419
9466
  style: {
@@ -9424,14 +9471,14 @@ function mo(e, t, n, r) {
9424
9471
  }
9425
9472
  }) : "";
9426
9473
  case "video":
9427
- case "file": return po(t) ? /* @__PURE__ */ g("a", {
9474
+ case "file": return go(t) ? /* @__PURE__ */ g("a", {
9428
9475
  href: t,
9429
9476
  target: "_blank",
9430
9477
  rel: "noopener noreferrer",
9431
9478
  style: { color: "var(--page-accent, #111827)" },
9432
9479
  children: String(t).split("/").pop()
9433
9480
  }) : "";
9434
- case "media": return (Array.isArray(t) ? t : [t]).filter(po).map((e, t) => /* @__PURE__ */ g("a", {
9481
+ case "media": return (Array.isArray(t) ? t : [t]).filter(go).map((e, t) => /* @__PURE__ */ g("a", {
9435
9482
  href: e,
9436
9483
  target: "_blank",
9437
9484
  rel: "noopener noreferrer",
@@ -9471,7 +9518,7 @@ function mo(e, t, n, r) {
9471
9518
  default: return String(t);
9472
9519
  }
9473
9520
  }
9474
- function ho({ specs: e, locale: t, words: n }) {
9521
+ function vo({ specs: e, locale: t, words: n }) {
9475
9522
  return !Array.isArray(e) || !e.length ? null : /* @__PURE__ */ _("section", {
9476
9523
  ...X("specs"),
9477
9524
  style: {
@@ -9490,7 +9537,7 @@ function ho({ specs: e, locale: t, words: n }) {
9490
9537
  role: "table",
9491
9538
  ...X("specs-table"),
9492
9539
  style: {
9493
- border: uo,
9540
+ border: mo,
9494
9541
  borderRadius: "10px",
9495
9542
  overflow: "hidden"
9496
9543
  },
@@ -9504,13 +9551,13 @@ function ho({ specs: e, locale: t, words: n }) {
9504
9551
  gridTemplateColumns: "minmax(120px, 34%) 1fr",
9505
9552
  gap: "16px",
9506
9553
  padding: "10px 14px",
9507
- borderTop: r ? uo : 0,
9554
+ borderTop: r ? mo : 0,
9508
9555
  fontSize: "14px"
9509
9556
  },
9510
9557
  children: [/* @__PURE__ */ g("span", {
9511
9558
  role: "rowheader",
9512
9559
  ...X("spec-name"),
9513
- style: { color: fo },
9560
+ style: { color: ho },
9514
9561
  children: e.name
9515
9562
  }), /* @__PURE__ */ g("span", {
9516
9563
  role: "cell",
@@ -9521,7 +9568,7 @@ function ho({ specs: e, locale: t, words: n }) {
9521
9568
  gap: "4px 10px",
9522
9569
  alignItems: "center"
9523
9570
  },
9524
- children: i.map((r, a) => /* @__PURE__ */ _("span", { children: [mo(e, r, t, n), a < i.length - 1 && e.type !== "color" ? "," : ""] }, a))
9571
+ children: i.map((r, a) => /* @__PURE__ */ _("span", { children: [_o(e, r, t, n), a < i.length - 1 && e.type !== "color" ? "," : ""] }, a))
9525
9572
  })]
9526
9573
  }, e.key);
9527
9574
  })
@@ -9530,7 +9577,7 @@ function ho({ specs: e, locale: t, words: n }) {
9530
9577
  }
9531
9578
  //#endregion
9532
9579
  //#region ../ui/src/components/builder/apps/shop/views.jsx
9533
- var $ = "var(--page-muted, rgba(100,116,139,1))", go = "1px solid var(--page-border, #d1d5db)", _o = "var(--page-surface, #f2f2f2)", vo = {
9580
+ var $ = "var(--page-muted, rgba(100,116,139,1))", yo = "1px solid var(--page-border, #d1d5db)", bo = "var(--page-surface, #f2f2f2)", xo = {
9534
9581
  ...rn,
9535
9582
  border: 0,
9536
9583
  borderRadius: "8px",
@@ -9539,14 +9586,14 @@ var $ = "var(--page-muted, rgba(100,116,139,1))", go = "1px solid var(--page-bor
9539
9586
  fontWeight: 600,
9540
9587
  fontFamily: "inherit",
9541
9588
  textAlign: "center"
9542
- }, yo = {
9543
- ...vo,
9589
+ }, So = {
9590
+ ...xo,
9544
9591
  backgroundColor: "transparent",
9545
9592
  color: "var(--page-text, #111827)",
9546
- border: go
9593
+ border: yo
9547
9594
  };
9548
- function bo() {
9549
- let { tenant: e, apiUrl: t, locale: n, param: r, settings: i } = s(Y), a = u(() => Ra(n), [n]), c = i?.["shop.orderPrefix"], l = i?.["shop.orderSuffix"], d = o((e) => `${typeof c == "string" ? c : "#"}${e}${typeof l == "string" ? l : ""}`, [c, l]);
9595
+ function Co() {
9596
+ let { tenant: e, apiUrl: t, locale: n, param: r, settings: i } = s(Y), a = u(() => Va(n), [n]), c = i?.["shop.orderPrefix"], l = i?.["shop.orderSuffix"], d = o((e) => `${typeof c == "string" ? c : "#"}${e}${typeof l == "string" ? l : ""}`, [c, l]);
9550
9597
  return {
9551
9598
  tenant: e,
9552
9599
  apiUrl: t || "/api",
@@ -9556,8 +9603,8 @@ function bo() {
9556
9603
  orderId: d
9557
9604
  };
9558
9605
  }
9559
- function xo(e, t, n = !0) {
9560
- let r = u(() => Ma(e, t), [e, t]), i = p(r.subscribe, r.getState, r.getState);
9606
+ function wo(e, t, n = !0) {
9607
+ let r = u(() => Fa(e, t), [e, t]), i = p(r.subscribe, r.getState, r.getState);
9561
9608
  return c(() => {
9562
9609
  n && !i.loaded && !i.loading && r.load();
9563
9610
  }, [n, r]), {
@@ -9565,8 +9612,8 @@ function xo(e, t, n = !0) {
9565
9612
  ...i
9566
9613
  };
9567
9614
  }
9568
- var So = (e) => typeof window > "u" ? "" : new URLSearchParams(window.location.search).get(e) ?? "";
9569
- function Co({ value: e, label: t, onCommit: n }) {
9615
+ var To = (e) => typeof window > "u" ? "" : new URLSearchParams(window.location.search).get(e) ?? "";
9616
+ function Eo({ value: e, label: t, onCommit: n }) {
9570
9617
  let [r, i] = f(null), a = () => {
9571
9618
  if (r === null) return;
9572
9619
  let t = Math.max(1, Math.round(Number(r)) || 1);
@@ -9590,12 +9637,12 @@ function Co({ value: e, label: t, onCommit: n }) {
9590
9637
  }
9591
9638
  });
9592
9639
  }
9593
- var wo = "/product/{slug}", To = (e) => !e || e === "/product?product={slug}" ? wo : e, Eo = (e, t) => String(To(e)).replace(/\{slug\}/g, encodeURIComponent(t.slug)).replace(/\{id\}/g, t.id);
9594
- function Do(e) {
9640
+ var Do = "/product/{slug}", Oo = (e) => !e || e === "/product?product={slug}" ? Do : e, ko = (e, t) => String(Oo(e)).replace(/\{slug\}/g, encodeURIComponent(t.slug)).replace(/\{id\}/g, t.id);
9641
+ function Ao(e) {
9595
9642
  let t = e.variants?.length ? e.variants.map((e) => e.stock) : [e.stock];
9596
9643
  return t.some((e) => e == null) ? null : t.reduce((e, t) => e + Number(t), 0);
9597
9644
  }
9598
- function Oo({ product: e, variant: t, locale: n, size: r = 16 }) {
9645
+ function jo({ product: e, variant: t, locale: n, size: r = 16 }) {
9599
9646
  let i = e.currency, a = t?.price ?? e.price;
9600
9647
  return /* @__PURE__ */ _("span", {
9601
9648
  ...X("price"),
@@ -9608,7 +9655,7 @@ function Oo({ product: e, variant: t, locale: n, size: r = 16 }) {
9608
9655
  children: [/* @__PURE__ */ g("span", {
9609
9656
  ...X("price-current"),
9610
9657
  style: { fontWeight: 700 },
9611
- children: Ia(a, i, n)
9658
+ children: za(a, i, n)
9612
9659
  }), e.compare_at_price > a && /* @__PURE__ */ g("span", {
9613
9660
  ...X("price-old"),
9614
9661
  style: {
@@ -9616,11 +9663,11 @@ function Oo({ product: e, variant: t, locale: n, size: r = 16 }) {
9616
9663
  textDecoration: "line-through",
9617
9664
  fontSize: "0.85em"
9618
9665
  },
9619
- children: Ia(e.compare_at_price, i, n)
9666
+ children: za(e.compare_at_price, i, n)
9620
9667
  })]
9621
9668
  });
9622
9669
  }
9623
- var ko = [
9670
+ var Mo = [
9624
9671
  1,
9625
9672
  2,
9626
9673
  3
@@ -9636,8 +9683,8 @@ var ko = [
9636
9683
  currency: "USD",
9637
9684
  sample: !0
9638
9685
  }));
9639
- function Ao({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/product/{slug}", showButton: i = !0, buttonLabel: a = "", emptyText: o = "", collection: s = "", source: l = "catalog", loginHref: u = "", style: d, nodeRef: p, inert: m = !1, sample: h = !1, noNavigate: v = !1 }) {
9640
- let { tenant: y, apiUrl: b, locale: x, words: S } = bo(), C = Xa(), [w, T] = f(null), [E, D] = f(null), [O, k] = f(""), [A, j] = f({}), [M, N] = f(!1), { store: P, currency: F } = xo(b, y, !m), I = l === "favorites";
9686
+ function No({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/product/{slug}", showButton: i = !0, buttonLabel: a = "", emptyText: o = "", collection: s = "", source: l = "catalog", loginHref: u = "", style: d, nodeRef: p, inert: m = !1, sample: h = !1, noNavigate: v = !1 }) {
9687
+ let { tenant: y, apiUrl: b, locale: x, words: S } = Co(), C = $a(), [w, T] = f(null), [E, D] = f(null), [O, k] = f(""), [A, j] = f({}), [M, N] = f(!1), { store: P, currency: F } = wo(b, y, !m), I = l === "favorites";
9641
9688
  c(() => {
9642
9689
  let e = !0, n = Math.max(1, Math.min(100, Number(t) || 12)), r = F ? `&currency=${encodeURIComponent(F)}` : "";
9643
9690
  if (I && m) {
@@ -9646,7 +9693,7 @@ function Ao({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
9646
9693
  }
9647
9694
  return N(!1), Promise.all([Q(b, y, I ? `/store/my/favorites?limit=${n}${r}` : `/store/products?limit=${n}${r}${s ? `&collection=${encodeURIComponent(s)}` : ""}`), Q(b, y, "/store/config")]).then(([t, n]) => {
9648
9695
  if (!e) return;
9649
- let r = Na(n, F);
9696
+ let r = Ia(n, F);
9650
9697
  D(n), T(Array.isArray(t?.data) ? t.data.map((e) => ({
9651
9698
  ...e,
9652
9699
  currency: r
@@ -9665,7 +9712,7 @@ function Ao({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
9665
9712
  I,
9666
9713
  m
9667
9714
  ]);
9668
- let L = w?.length || !h ? w ?? [] : ko, R = async (e) => {
9715
+ let L = w?.length || !h ? w ?? [] : Mo, R = async (e) => {
9669
9716
  if (!(m || e.sample)) {
9670
9717
  k(e.id);
9671
9718
  try {
@@ -9676,7 +9723,7 @@ function Ao({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
9676
9723
  } catch (t) {
9677
9724
  j((n) => ({
9678
9725
  ...n,
9679
- [e.id]: za(S, t)
9726
+ [e.id]: Ha(S, t)
9680
9727
  }));
9681
9728
  } finally {
9682
9729
  k("");
@@ -9721,7 +9768,7 @@ function Ao({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
9721
9768
  gap: `${n}px`
9722
9769
  },
9723
9770
  children: L.map((e) => {
9724
- let t = Do(e) === 0, n = Eo(r, e);
9771
+ let t = Ao(e) === 0, n = ko(r, e);
9725
9772
  return /* @__PURE__ */ _("div", {
9726
9773
  ...X("card"),
9727
9774
  style: {
@@ -9744,7 +9791,7 @@ function Ao({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
9744
9791
  aspectRatio: "1 / 1",
9745
9792
  borderRadius: "10px",
9746
9793
  overflow: "hidden",
9747
- background: _o
9794
+ background: bo
9748
9795
  },
9749
9796
  children: e.images?.[0] && /* @__PURE__ */ g("img", {
9750
9797
  src: e.images[0],
@@ -9777,16 +9824,16 @@ function Ao({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
9777
9824
  color: $
9778
9825
  },
9779
9826
  children: [
9780
- /* @__PURE__ */ g(to, {
9827
+ /* @__PURE__ */ g(io, {
9781
9828
  value: Number(e.rating_avg),
9782
9829
  size: 14
9783
9830
  }),
9784
9831
  "(",
9785
- Za(e.rating_count, x),
9832
+ eo(e.rating_count, x),
9786
9833
  ")"
9787
9834
  ]
9788
9835
  }),
9789
- /* @__PURE__ */ g(Oo, {
9836
+ /* @__PURE__ */ g(jo, {
9790
9837
  product: e,
9791
9838
  locale: x
9792
9839
  }),
@@ -9795,7 +9842,7 @@ function Ao({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
9795
9842
  onClick: v ? (e) => e.preventDefault() : void 0,
9796
9843
  ...X("choose-button"),
9797
9844
  style: {
9798
- ...yo,
9845
+ ...So,
9799
9846
  display: "block"
9800
9847
  },
9801
9848
  children: S("choose")
@@ -9805,7 +9852,7 @@ function Ao({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
9805
9852
  onClick: () => R(e),
9806
9853
  ...X("add-button", t && "add-button-sold-out"),
9807
9854
  style: {
9808
- ...vo,
9855
+ ...xo,
9809
9856
  opacity: t ? .5 : 1
9810
9857
  },
9811
9858
  children: t ? S("soldOut") : O === e.id ? S("adding") : a || S("add")
@@ -9825,24 +9872,24 @@ function Ao({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
9825
9872
  ]
9826
9873
  });
9827
9874
  }
9828
- function jo({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuestions: r = !0, showSpecs: i = !0, style: a, nodeRef: o, inert: s = !1, sample: l = !1, noNavigate: u = !1 }) {
9829
- let { tenant: d, apiUrl: p, locale: m, param: h, words: v } = bo(), [y, b] = f(null), [x, S] = f(!1), [C, w] = f(0), [T, E] = f(""), [D, O] = f(1), [k, A] = f(!1), [j, M] = f(""), { store: N, currency: P } = xo(p, d, !s), F = e || h || So("product"), I = P ? `?currency=${encodeURIComponent(P)}` : "";
9875
+ function Po({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuestions: r = !0, showSpecs: i = !0, style: a, nodeRef: o, inert: s = !1, sample: l = !1, noNavigate: u = !1 }) {
9876
+ let { tenant: d, apiUrl: p, locale: m, param: h, words: v } = Co(), [y, b] = f(null), [x, S] = f(!1), [C, w] = f(0), [T, E] = f(""), [D, O] = f(1), [k, A] = f(!1), [j, M] = f(""), { store: N, currency: P } = wo(p, d, !s), F = e || h || To("product"), I = P ? `?currency=${encodeURIComponent(P)}` : "";
9830
9877
  if (c(() => {
9831
9878
  let e = !0;
9832
9879
  return S(!1), (async () => {
9833
9880
  let t = await Q(p, d, "/store/config"), n = F ? await Q(p, d, `/store/products/${encodeURIComponent(F)}${I}`) : l || u ? (await Q(p, d, `/store/products?limit=1${P ? `&currency=${encodeURIComponent(P)}` : ""}`))?.data?.[0] : null;
9834
9881
  if (e) {
9835
9882
  if (!n) {
9836
- S(!0), b(l ? ko[0] : null);
9883
+ S(!0), b(l ? Mo[0] : null);
9837
9884
  return;
9838
9885
  }
9839
9886
  b({
9840
9887
  ...n,
9841
- currency: Na(t, P)
9888
+ currency: Ia(t, P)
9842
9889
  }), E((e) => n.variants?.some((t) => t.id === e) ? e : n.variants?.[0]?.id ?? ""), w(0);
9843
9890
  }
9844
9891
  })().catch(() => {
9845
- e && (S(!0), b(l ? ko[0] : null));
9892
+ e && (S(!0), b(l ? Mo[0] : null));
9846
9893
  }), () => {
9847
9894
  e = !1;
9848
9895
  };
@@ -9869,7 +9916,7 @@ function jo({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
9869
9916
  try {
9870
9917
  await N.add(y.id, L?.id ?? null, Math.max(1, Number(D) || 1)), M(v("added"));
9871
9918
  } catch (e) {
9872
- M(za(v, e));
9919
+ M(Ha(v, e));
9873
9920
  } finally {
9874
9921
  A(!1);
9875
9922
  }
@@ -9904,7 +9951,7 @@ function jo({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
9904
9951
  aspectRatio: "1 / 1",
9905
9952
  borderRadius: "12px",
9906
9953
  overflow: "hidden",
9907
- background: _o
9954
+ background: bo
9908
9955
  },
9909
9956
  children: y.images?.[C] && /* @__PURE__ */ g("img", {
9910
9957
  src: y.images[C],
@@ -9935,8 +9982,8 @@ function jo({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
9935
9982
  borderRadius: "8px",
9936
9983
  overflow: "hidden",
9937
9984
  cursor: "pointer",
9938
- border: t === C ? "2px solid var(--page-accent, #111827)" : go,
9939
- background: _o
9985
+ border: t === C ? "2px solid var(--page-accent, #111827)" : yo,
9986
+ background: bo
9940
9987
  },
9941
9988
  children: /* @__PURE__ */ g("img", {
9942
9989
  src: e,
@@ -9967,12 +10014,12 @@ function jo({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
9967
10014
  },
9968
10015
  children: y.name
9969
10016
  }),
9970
- /* @__PURE__ */ g(ao, {
10017
+ /* @__PURE__ */ g(co, {
9971
10018
  product: y,
9972
10019
  inert: s,
9973
10020
  sample: l && !!y.sample
9974
10021
  }),
9975
- /* @__PURE__ */ g(Oo, {
10022
+ /* @__PURE__ */ g(jo, {
9976
10023
  product: y,
9977
10024
  variant: L,
9978
10025
  locale: m,
@@ -9993,7 +10040,7 @@ function jo({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
9993
10040
  onClick: () => E(e.id),
9994
10041
  ...X("variant", e.id === T && "variant-selected", t && "variant-sold-out"),
9995
10042
  style: {
9996
- ...yo,
10043
+ ...So,
9997
10044
  padding: "8px 14px",
9998
10045
  opacity: t ? .45 : 1,
9999
10046
  textDecoration: t ? "line-through" : "none",
@@ -10028,7 +10075,7 @@ function jo({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
10028
10075
  onClick: B,
10029
10076
  ...X("add-button", z && "add-button-sold-out"),
10030
10077
  style: {
10031
- ...vo,
10078
+ ...xo,
10032
10079
  flex: 1,
10033
10080
  opacity: z ? .5 : 1
10034
10081
  },
@@ -10059,17 +10106,17 @@ function jo({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
10059
10106
  ]
10060
10107
  })]
10061
10108
  }),
10062
- i && /* @__PURE__ */ g(ho, {
10109
+ i && /* @__PURE__ */ g(vo, {
10063
10110
  specs: y.specs,
10064
10111
  locale: m,
10065
10112
  words: v
10066
10113
  }),
10067
- n && /* @__PURE__ */ g(so, {
10114
+ n && /* @__PURE__ */ g(uo, {
10068
10115
  product: y,
10069
10116
  inert: s,
10070
10117
  sample: l && !!y.sample
10071
10118
  }),
10072
- r && /* @__PURE__ */ g(lo, {
10119
+ r && /* @__PURE__ */ g(po, {
10073
10120
  product: y,
10074
10121
  inert: s,
10075
10122
  sample: l && !!y.sample
@@ -10077,13 +10124,13 @@ function jo({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
10077
10124
  ]
10078
10125
  });
10079
10126
  }
10080
- function Mo(e) {
10081
- return /* @__PURE__ */ g(Ao, {
10127
+ function Fo(e) {
10128
+ return /* @__PURE__ */ g(No, {
10082
10129
  ...e,
10083
10130
  source: "favorites"
10084
10131
  });
10085
10132
  }
10086
- var No = /* @__PURE__ */ _("svg", {
10133
+ var Io = /* @__PURE__ */ _("svg", {
10087
10134
  width: "20",
10088
10135
  height: "20",
10089
10136
  viewBox: "0 0 24 24",
@@ -10096,8 +10143,8 @@ var No = /* @__PURE__ */ _("svg", {
10096
10143
  ...X("icon"),
10097
10144
  children: [/* @__PURE__ */ g("path", { d: "M6 7h12l-1 13H7L6 7Z" }), /* @__PURE__ */ g("path", { d: "M9 7a3 3 0 0 1 6 0" })]
10098
10145
  });
10099
- function Po({ href: e = "/cart", label: t = "", showLabel: n = !1, style: r, nodeRef: i, inert: a = !1, sample: o = !1, noNavigate: s = !1 }) {
10100
- let { tenant: c, apiUrl: l, words: u } = bo(), { cart: d } = xo(l, c, !a), f = o && !d.count ? 2 : d.count;
10146
+ function Lo({ href: e = "/cart", label: t = "", showLabel: n = !1, style: r, nodeRef: i, inert: a = !1, sample: o = !1, noNavigate: s = !1 }) {
10147
+ let { tenant: c, apiUrl: l, words: u } = Co(), { cart: d } = wo(l, c, !a), f = o && !d.count ? 2 : d.count;
10101
10148
  return /* @__PURE__ */ _("a", {
10102
10149
  ref: i,
10103
10150
  href: e,
@@ -10114,7 +10161,7 @@ function Po({ href: e = "/cart", label: t = "", showLabel: n = !1, style: r, nod
10114
10161
  ...G(r)
10115
10162
  },
10116
10163
  children: [
10117
- No,
10164
+ Io,
10118
10165
  n && /* @__PURE__ */ g("span", {
10119
10166
  ...X("label"),
10120
10167
  children: t || u("cart")
@@ -10142,7 +10189,7 @@ function Po({ href: e = "/cart", label: t = "", showLabel: n = !1, style: r, nod
10142
10189
  ]
10143
10190
  });
10144
10191
  }
10145
- function Fo(e, t, n) {
10192
+ function Ro(e, t, n) {
10146
10193
  if (t === "code") return e;
10147
10194
  try {
10148
10195
  if (t === "name") return `${new Intl.DisplayNames([n || "en"], { type: "currency" }).of(e) ?? e} (${e})`;
@@ -10155,8 +10202,8 @@ function Fo(e, t, n) {
10155
10202
  return e;
10156
10203
  }
10157
10204
  }
10158
- function Io({ display: e = "symbol", label: t = "", style: n, nodeRef: r, inert: i = !1 }) {
10159
- let { tenant: a, apiUrl: o, locale: s } = bo(), { store: l, currency: u } = xo(o, a, !i), [d, p] = f(null), m = {
10205
+ function zo({ display: e = "symbol", label: t = "", style: n, nodeRef: r, inert: i = !1 }) {
10206
+ let { tenant: a, apiUrl: o, locale: s } = Co(), { store: l, currency: u } = wo(o, a, !i), [d, p] = f(null), m = {
10160
10207
  display: "inline-flex",
10161
10208
  alignItems: "center",
10162
10209
  gap: 8,
@@ -10190,7 +10237,7 @@ function Io({ display: e = "symbol", label: t = "", style: n, nodeRef: r, inert:
10190
10237
  }) : null, /* @__PURE__ */ g("select", {
10191
10238
  "aria-label": t || "Currency",
10192
10239
  ...X("select"),
10193
- value: Na(d, u),
10240
+ value: Ia(d, u),
10194
10241
  onChange: i ? void 0 : (e) => l.setCurrency(e.target.value === d.currency ? "" : e.target.value),
10195
10242
  onKeyDown: i ? (e) => e.preventDefault() : void 0,
10196
10243
  style: {
@@ -10204,24 +10251,24 @@ function Io({ display: e = "symbol", label: t = "", style: n, nodeRef: r, inert:
10204
10251
  },
10205
10252
  children: h.map((t) => /* @__PURE__ */ g("option", {
10206
10253
  value: t,
10207
- children: Fo(t, e, s)
10254
+ children: Ro(t, e, s)
10208
10255
  }, t))
10209
10256
  })]
10210
10257
  });
10211
10258
  }
10212
- var Lo = {
10259
+ var Bo = {
10213
10260
  display: "flex",
10214
10261
  flexDirection: "column",
10215
10262
  gap: "6px",
10216
10263
  fontSize: "13px"
10217
- }, Ro = {
10264
+ }, Vo = {
10218
10265
  margin: "0 0 12px",
10219
10266
  fontSize: "18px"
10220
10267
  };
10221
- function zo({ label: e, required: t, children: n }) {
10268
+ function Ho({ label: e, required: t, children: n }) {
10222
10269
  return /* @__PURE__ */ _("label", {
10223
10270
  ...X("field"),
10224
- style: Lo,
10271
+ style: Bo,
10225
10272
  children: [/* @__PURE__ */ _("span", {
10226
10273
  ...X("field-label"),
10227
10274
  style: { fontWeight: 500 },
@@ -10233,7 +10280,7 @@ function zo({ label: e, required: t, children: n }) {
10233
10280
  }), n]
10234
10281
  });
10235
10282
  }
10236
- var Bo = [{
10283
+ var Uo = [{
10237
10284
  id: "ship:standard",
10238
10285
  type: "shipping",
10239
10286
  name: "Standard",
@@ -10249,7 +10296,7 @@ var Bo = [{
10249
10296
  min_days: null,
10250
10297
  max_days: null,
10251
10298
  detail: "Main Street 1"
10252
- }], Vo = {
10299
+ }], Wo = {
10253
10300
  name: "",
10254
10301
  email: "",
10255
10302
  phone: "",
@@ -10264,8 +10311,8 @@ var Bo = [{
10264
10311
  recipient: "",
10265
10312
  gift_message: ""
10266
10313
  };
10267
- function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample: i = !1, noNavigate: a = !1 }) {
10268
- let { tenant: o, apiUrl: s, locale: l, words: d, orderId: p } = bo(), { store: m, cart: h, loaded: v } = xo(s, o, !r), [y, b] = f(null), [x, S] = f(Vo), [C, w] = f(""), [T, E] = f(!1), [D, O] = f(""), [k, A] = f(null), [j, M] = f(""), [N, P] = f(!1), F = !r && So("cancelled") === "1", I = (e) => Ia(e, h.currency || y?.currency, l);
10314
+ function Go({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample: i = !1, noNavigate: a = !1 }) {
10315
+ let { tenant: o, apiUrl: s, locale: l, words: d, orderId: p } = Co(), { store: m, cart: h, loaded: v } = wo(s, o, !r), [y, b] = f(null), [x, S] = f(Wo), [C, w] = f(""), [T, E] = f(!1), [D, O] = f(""), [k, A] = f(null), [j, M] = f(""), [N, P] = f(!1), F = !r && To("cancelled") === "1", I = (e) => za(e, h.currency || y?.currency, l);
10269
10316
  c(() => {
10270
10317
  Q(s, o, "/store/config").then((e) => {
10271
10318
  b(e), w((t) => t || e?.methods?.[0] || "");
@@ -10274,15 +10321,15 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10274
10321
  methods: []
10275
10322
  }));
10276
10323
  }, [s, o]), c(() => {
10277
- let e = So("order");
10324
+ let e = To("order");
10278
10325
  r || !e || F || Q(s, o, `/store/orders/${encodeURIComponent(e)}`).then((e) => {
10279
10326
  A(e), e?.payment_status === "paid" && m.reset();
10280
- }).catch((e) => O(za(d, e)));
10327
+ }).catch((e) => O(Ha(d, e)));
10281
10328
  }, [s, o]);
10282
10329
  let L = (e) => (t) => S((n) => ({
10283
10330
  ...n,
10284
10331
  [e]: t.target.value
10285
- })), R = u(() => Fa(l, y?.zone_countries ?? [], y && !y.ships_elsewhere && y.zone_countries?.length ? y.zone_countries : null), [l, y]);
10332
+ })), R = u(() => Ra(l, y?.zone_countries ?? [], y && !y.ships_elsewhere && y.zone_countries?.length ? y.zone_countries : null), [l, y]);
10286
10333
  c(() => {
10287
10334
  h.country && !x.country && S((e) => ({
10288
10335
  ...e,
@@ -10295,7 +10342,7 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10295
10342
  try {
10296
10343
  await m.setCoupon(e), M("");
10297
10344
  } catch (e) {
10298
- O(za(d, e));
10345
+ O(Ha(d, e));
10299
10346
  } finally {
10300
10347
  P(!1);
10301
10348
  }
@@ -10352,13 +10399,13 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10352
10399
  }
10353
10400
  A(t?.order ?? null), m.reset();
10354
10401
  } catch (e) {
10355
- O(za(d, e));
10402
+ O(Ha(d, e));
10356
10403
  } finally {
10357
10404
  E(!1);
10358
10405
  }
10359
10406
  }
10360
- }, V = { ...G(t) }, ee = r && i && !h.lines.length ? !0 : h.requires_shipping !== !1, te = Array.isArray(h.discounts) ? h.discounts : [], H = te.filter((e) => e.type !== "shipping"), ne = te.find((e) => e.type === "shipping") ?? null, U = r && i && !h.lines.length ? Bo : Array.isArray(h.delivery_options) ? h.delivery_options : [], W = U.find((e) => e.id === h.delivery) ?? (r && i ? U[0] : null), K = W?.type === "pickup", re = (e) => {
10361
- r || e === h.delivery || (O(""), m.setDelivery(e).catch((e) => O(za(d, e))));
10407
+ }, V = { ...G(t) }, ee = r && i && !h.lines.length ? !0 : h.requires_shipping !== !1, te = Array.isArray(h.discounts) ? h.discounts : [], H = te.filter((e) => e.type !== "shipping"), ne = te.find((e) => e.type === "shipping") ?? null, U = r && i && !h.lines.length ? Uo : Array.isArray(h.delivery_options) ? h.delivery_options : [], W = U.find((e) => e.id === h.delivery) ?? (r && i ? U[0] : null), K = W?.type === "pickup", re = (e) => {
10408
+ r || e === h.delivery || (O(""), m.setDelivery(e).catch((e) => O(Ha(d, e))));
10362
10409
  };
10363
10410
  if (k) {
10364
10411
  let t = k.payment_status === "paid";
@@ -10386,7 +10433,7 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10386
10433
  style: {
10387
10434
  padding: "12px",
10388
10435
  borderRadius: "8px",
10389
- background: _o
10436
+ background: bo
10390
10437
  },
10391
10438
  children: En(k.instructions_content)
10392
10439
  }) : k.instructions ? /* @__PURE__ */ g("pre", {
@@ -10395,7 +10442,7 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10395
10442
  margin: 0,
10396
10443
  padding: "12px",
10397
10444
  borderRadius: "8px",
10398
- background: _o,
10445
+ background: bo,
10399
10446
  whiteSpace: "pre-wrap",
10400
10447
  fontFamily: "inherit"
10401
10448
  },
@@ -10406,7 +10453,7 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10406
10453
  style: {
10407
10454
  padding: "12px",
10408
10455
  borderRadius: "8px",
10409
- background: _o
10456
+ background: bo
10410
10457
  },
10411
10458
  children: [
10412
10459
  /* @__PURE__ */ g("div", {
@@ -10430,13 +10477,13 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10430
10477
  /* @__PURE__ */ g("div", { children: d("pickupNote") })
10431
10478
  ]
10432
10479
  }),
10433
- !k.delivery.location && Ua(d, l, k.delivery.min_days, k.delivery.max_days) && /* @__PURE__ */ g("div", {
10480
+ !k.delivery.location && Ka(d, l, k.delivery.min_days, k.delivery.max_days) && /* @__PURE__ */ g("div", {
10434
10481
  ...X("delivery-detail"),
10435
10482
  style: {
10436
10483
  fontSize: "14px",
10437
10484
  color: $
10438
10485
  },
10439
- children: Ua(d, l, k.delivery.min_days, k.delivery.max_days)
10486
+ children: Ka(d, l, k.delivery.min_days, k.delivery.max_days)
10440
10487
  })
10441
10488
  ]
10442
10489
  }),
@@ -10449,14 +10496,14 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10449
10496
  children: [
10450
10497
  d("total"),
10451
10498
  ": ",
10452
- Ia(k.total, k.currency, l)
10499
+ za(k.total, k.currency, l)
10453
10500
  ]
10454
10501
  }),
10455
- !t && /* @__PURE__ */ g(qo, {
10502
+ !t && /* @__PURE__ */ g(Xo, {
10456
10503
  reference: k.transfer_reference,
10457
10504
  words: d
10458
10505
  }),
10459
- /* @__PURE__ */ g(Jo, {
10506
+ /* @__PURE__ */ g(Zo, {
10460
10507
  downloads: k.downloads,
10461
10508
  apiUrl: s,
10462
10509
  words: d,
@@ -10468,7 +10515,7 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10468
10515
  onClick: a ? (e) => e.preventDefault() : void 0,
10469
10516
  ...X("continue-button"),
10470
10517
  style: {
10471
- ...yo,
10518
+ ...So,
10472
10519
  alignSelf: "flex-start"
10473
10520
  },
10474
10521
  children: d("continue")
@@ -10476,7 +10523,7 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10476
10523
  ]
10477
10524
  });
10478
10525
  }
10479
- let ie = r && i && !h.lines.length ? ko.slice(0, 2).map((e) => ({
10526
+ let ie = r && i && !h.lines.length ? Mo.slice(0, 2).map((e) => ({
10480
10527
  ...e,
10481
10528
  product_id: e.id,
10482
10529
  variant_id: null,
@@ -10522,7 +10569,7 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10522
10569
  onClick: a ? (e) => e.preventDefault() : void 0,
10523
10570
  ...X("continue-button"),
10524
10571
  style: {
10525
- ...yo,
10572
+ ...So,
10526
10573
  alignSelf: "flex-start"
10527
10574
  },
10528
10575
  children: d("continue")
@@ -10560,7 +10607,7 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10560
10607
  ...X("section"),
10561
10608
  children: [/* @__PURE__ */ g("h3", {
10562
10609
  ...X("heading"),
10563
- style: Ro,
10610
+ style: Vo,
10564
10611
  children: d("contact")
10565
10612
  }), /* @__PURE__ */ _("div", {
10566
10613
  ...X("fields"),
@@ -10568,7 +10615,7 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10568
10615
  display: "grid",
10569
10616
  gap: "12px"
10570
10617
  },
10571
- children: [/* @__PURE__ */ g(zo, {
10618
+ children: [/* @__PURE__ */ g(Ho, {
10572
10619
  label: d("name"),
10573
10620
  required: !0,
10574
10621
  children: /* @__PURE__ */ g("input", {
@@ -10585,7 +10632,7 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10585
10632
  gridTemplateColumns: "1fr 1fr",
10586
10633
  gap: "12px"
10587
10634
  },
10588
- children: [/* @__PURE__ */ g(zo, {
10635
+ children: [/* @__PURE__ */ g(Ho, {
10589
10636
  label: d("email"),
10590
10637
  required: !0,
10591
10638
  children: /* @__PURE__ */ g("input", {
@@ -10596,7 +10643,7 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10596
10643
  onChange: L("email"),
10597
10644
  autoComplete: "email"
10598
10645
  })
10599
- }), /* @__PURE__ */ g(zo, {
10646
+ }), /* @__PURE__ */ g(Ho, {
10600
10647
  label: d("phone"),
10601
10648
  children: /* @__PURE__ */ g("input", {
10602
10649
  type: "tel",
@@ -10615,7 +10662,7 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10615
10662
  children: [
10616
10663
  /* @__PURE__ */ g("h3", {
10617
10664
  ...X("heading"),
10618
- style: Ro,
10665
+ style: Vo,
10619
10666
  children: d("delivery")
10620
10667
  }),
10621
10668
  /* @__PURE__ */ g("div", {
@@ -10627,17 +10674,17 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10627
10674
  gridTemplateColumns: "1fr 1fr",
10628
10675
  gap: "12px"
10629
10676
  },
10630
- children: [/* @__PURE__ */ g(zo, {
10677
+ children: [/* @__PURE__ */ g(Ho, {
10631
10678
  label: d("postal"),
10632
10679
  children: /* @__PURE__ */ g("input", {
10633
10680
  ...X("input"),
10634
10681
  style: Z,
10635
10682
  value: x.postal_code,
10636
10683
  onChange: L("postal_code"),
10637
- onBlur: () => !r && x.country && m.setCountry(x.country, x.postal_code).catch((e) => O(za(d, e))),
10684
+ onBlur: () => !r && x.country && m.setCountry(x.country, x.postal_code).catch((e) => O(Ha(d, e))),
10638
10685
  autoComplete: "postal-code"
10639
10686
  })
10640
- }), /* @__PURE__ */ g(zo, {
10687
+ }), /* @__PURE__ */ g(Ho, {
10641
10688
  label: d("country"),
10642
10689
  required: !K,
10643
10690
  children: /* @__PURE__ */ _("select", {
@@ -10650,7 +10697,7 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10650
10697
  S((e) => ({
10651
10698
  ...e,
10652
10699
  country: t
10653
- })), r || m.setCountry(t, x.postal_code).catch((e) => O(za(d, e)));
10700
+ })), r || m.setCountry(t, x.postal_code).catch((e) => O(Ha(d, e)));
10654
10701
  },
10655
10702
  children: [/* @__PURE__ */ g("option", {
10656
10703
  value: "",
@@ -10679,7 +10726,7 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10679
10726
  gap: "8px"
10680
10727
  },
10681
10728
  children: U.map((e) => {
10682
- let t = Ua(d, l, e.min_days, e.max_days);
10729
+ let t = Ka(d, l, e.min_days, e.max_days);
10683
10730
  return /* @__PURE__ */ _("label", {
10684
10731
  ...X("delivery-option", W?.id === e.id && "delivery-option-selected"),
10685
10732
  style: {
@@ -10688,7 +10735,7 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10688
10735
  gap: "10px",
10689
10736
  padding: "12px",
10690
10737
  borderRadius: "8px",
10691
- border: W?.id === e.id ? "1px solid var(--page-accent, #4f46e5)" : go,
10738
+ border: W?.id === e.id ? "1px solid var(--page-accent, #4f46e5)" : yo,
10692
10739
  cursor: "pointer"
10693
10740
  },
10694
10741
  children: [
@@ -10751,7 +10798,7 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10751
10798
  ...X("section"),
10752
10799
  children: [/* @__PURE__ */ g("h3", {
10753
10800
  ...X("heading"),
10754
- style: Ro,
10801
+ style: Vo,
10755
10802
  children: d("address")
10756
10803
  }), /* @__PURE__ */ _("div", {
10757
10804
  ...X("fields"),
@@ -10760,7 +10807,7 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10760
10807
  gap: "12px"
10761
10808
  },
10762
10809
  children: [
10763
- /* @__PURE__ */ g(zo, {
10810
+ /* @__PURE__ */ g(Ho, {
10764
10811
  label: d("line1"),
10765
10812
  required: !0,
10766
10813
  children: /* @__PURE__ */ g("input", {
@@ -10771,7 +10818,7 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10771
10818
  autoComplete: "address-line1"
10772
10819
  })
10773
10820
  }),
10774
- /* @__PURE__ */ g(zo, {
10821
+ /* @__PURE__ */ g(Ho, {
10775
10822
  label: d("line2"),
10776
10823
  children: /* @__PURE__ */ g("input", {
10777
10824
  ...X("input"),
@@ -10788,7 +10835,7 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10788
10835
  gridTemplateColumns: "1fr 1fr",
10789
10836
  gap: "12px"
10790
10837
  },
10791
- children: [/* @__PURE__ */ g(zo, {
10838
+ children: [/* @__PURE__ */ g(Ho, {
10792
10839
  label: d("city"),
10793
10840
  required: !0,
10794
10841
  children: /* @__PURE__ */ g("input", {
@@ -10798,7 +10845,7 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10798
10845
  onChange: L("city"),
10799
10846
  autoComplete: "address-level2"
10800
10847
  })
10801
- }), /* @__PURE__ */ g(zo, {
10848
+ }), /* @__PURE__ */ g(Ho, {
10802
10849
  label: d("region"),
10803
10850
  children: /* @__PURE__ */ g("input", {
10804
10851
  ...X("input"),
@@ -10809,7 +10856,7 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10809
10856
  })
10810
10857
  })]
10811
10858
  }),
10812
- /* @__PURE__ */ g(zo, {
10859
+ /* @__PURE__ */ g(Ho, {
10813
10860
  label: d("note"),
10814
10861
  children: /* @__PURE__ */ g("textarea", {
10815
10862
  rows: 2,
@@ -10864,7 +10911,7 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10864
10911
  display: "grid",
10865
10912
  gap: "12px"
10866
10913
  },
10867
- children: [ee && !K && /* @__PURE__ */ g(zo, {
10914
+ children: [ee && !K && /* @__PURE__ */ g(Ho, {
10868
10915
  label: d("giftRecipient"),
10869
10916
  children: /* @__PURE__ */ g("input", {
10870
10917
  ...X("input"),
@@ -10874,7 +10921,7 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10874
10921
  maxLength: 200,
10875
10922
  autoComplete: "off"
10876
10923
  })
10877
- }), /* @__PURE__ */ g(zo, {
10924
+ }), /* @__PURE__ */ g(Ho, {
10878
10925
  label: d("giftMessage"),
10879
10926
  children: /* @__PURE__ */ g("textarea", {
10880
10927
  rows: 3,
@@ -10895,7 +10942,7 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10895
10942
  children: [
10896
10943
  /* @__PURE__ */ g("h3", {
10897
10944
  ...X("heading"),
10898
- style: Ro,
10945
+ style: Vo,
10899
10946
  children: d("payment")
10900
10947
  }),
10901
10948
  !oe.length && !r && /* @__PURE__ */ g("p", {
@@ -10920,7 +10967,7 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10920
10967
  gap: "10px",
10921
10968
  padding: "12px",
10922
10969
  borderRadius: "8px",
10923
- border: go,
10970
+ border: yo,
10924
10971
  cursor: "pointer"
10925
10972
  },
10926
10973
  children: [/* @__PURE__ */ g("input", {
@@ -10947,13 +10994,13 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10947
10994
  gap: "14px",
10948
10995
  padding: "20px",
10949
10996
  borderRadius: "12px",
10950
- background: _o
10997
+ background: bo
10951
10998
  },
10952
10999
  children: [
10953
11000
  /* @__PURE__ */ g("h3", {
10954
11001
  ...X("summary-title"),
10955
11002
  style: {
10956
- ...Ro,
11003
+ ...Vo,
10957
11004
  margin: 0
10958
11005
  },
10959
11006
  children: d("cart")
@@ -11016,13 +11063,13 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11016
11063
  gap: "8px",
11017
11064
  marginTop: "4px"
11018
11065
  },
11019
- children: [/* @__PURE__ */ g(Co, {
11066
+ children: [/* @__PURE__ */ g(Eo, {
11020
11067
  value: e.quantity,
11021
11068
  label: d("quantity"),
11022
- onCommit: (t) => !r && m.setLine(e.product_id, e.variant_id, t).catch((e) => O(za(d, e)))
11069
+ onCommit: (t) => !r && m.setLine(e.product_id, e.variant_id, t).catch((e) => O(Ha(d, e)))
11023
11070
  }), /* @__PURE__ */ g("button", {
11024
11071
  type: "button",
11025
- onClick: () => !r && m.setLine(e.product_id, e.variant_id, 0).catch((e) => O(za(d, e))),
11072
+ onClick: () => !r && m.setLine(e.product_id, e.variant_id, 0).catch((e) => O(Ha(d, e))),
11026
11073
  ...X("remove-button"),
11027
11074
  style: {
11028
11075
  background: "none",
@@ -11072,7 +11119,7 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11072
11119
  style: {
11073
11120
  padding: "4px 10px",
11074
11121
  borderRadius: "999px",
11075
- border: go,
11122
+ border: yo,
11076
11123
  fontWeight: 600,
11077
11124
  letterSpacing: "0.04em"
11078
11125
  },
@@ -11120,7 +11167,7 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11120
11167
  onClick: () => z(j.trim()),
11121
11168
  ...X("coupon-button"),
11122
11169
  style: {
11123
- ...yo,
11170
+ ...So,
11124
11171
  padding: "8px 14px"
11125
11172
  },
11126
11173
  children: d("apply")
@@ -11137,7 +11184,7 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11137
11184
  /* @__PURE__ */ _("div", {
11138
11185
  ...X("totals"),
11139
11186
  style: {
11140
- borderTop: go,
11187
+ borderTop: yo,
11141
11188
  paddingTop: "12px",
11142
11189
  display: "grid",
11143
11190
  gap: "6px",
@@ -11252,13 +11299,13 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11252
11299
  ...X("submit-button"),
11253
11300
  disabled: T || !C || h.shipping_available === !1,
11254
11301
  style: {
11255
- ...vo,
11302
+ ...xo,
11256
11303
  width: "100%",
11257
11304
  padding: "12px"
11258
11305
  },
11259
11306
  children: d(T ? "placing" : "placeOrder")
11260
11307
  }),
11261
- /* @__PURE__ */ g(Wo, {
11308
+ /* @__PURE__ */ g(qo, {
11262
11309
  apiUrl: s,
11263
11310
  tenant: o,
11264
11311
  words: d,
@@ -11270,7 +11317,7 @@ function Ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11270
11317
  })]
11271
11318
  });
11272
11319
  }
11273
- var Uo = [
11320
+ var Ko = [
11274
11321
  "refund",
11275
11322
  "privacy",
11276
11323
  "terms",
@@ -11281,12 +11328,12 @@ var Uo = [
11281
11328
  fields: {},
11282
11329
  updated_at: null
11283
11330
  }));
11284
- function Wo({ apiUrl: e, tenant: t, words: n, locale: r, sample: i, inert: a }) {
11285
- let [o, s] = f(i ? Uo : []), [l, u] = f(null);
11331
+ function qo({ apiUrl: e, tenant: t, words: n, locale: r, sample: i, inert: a }) {
11332
+ let [o, s] = f(i ? Ko : []), [l, u] = f(null);
11286
11333
  if (c(() => {
11287
11334
  if (i) return;
11288
11335
  let n = !0;
11289
- return Va(e, t).then((e) => n && s(e)), () => {
11336
+ return Wa(e, t).then((e) => n && s(e)), () => {
11290
11337
  n = !1;
11291
11338
  };
11292
11339
  }, [
@@ -11329,12 +11376,12 @@ function Wo({ apiUrl: e, tenant: t, words: n, locale: r, sample: i, inert: a })
11329
11376
  display: "flex",
11330
11377
  flexWrap: "wrap",
11331
11378
  gap: "6px 14px",
11332
- borderTop: go,
11379
+ borderTop: yo,
11333
11380
  paddingTop: "10px"
11334
11381
  },
11335
11382
  children: o.map(m)
11336
11383
  }),
11337
- l && /* @__PURE__ */ g(Go, {
11384
+ l && /* @__PURE__ */ g(Jo, {
11338
11385
  policy: l,
11339
11386
  words: n,
11340
11387
  locale: r,
@@ -11343,7 +11390,7 @@ function Wo({ apiUrl: e, tenant: t, words: n, locale: r, sample: i, inert: a })
11343
11390
  ]
11344
11391
  });
11345
11392
  }
11346
- function Go({ policy: e, words: t, locale: n, onClose: r }) {
11393
+ function Jo({ policy: e, words: t, locale: n, onClose: r }) {
11347
11394
  c(() => {
11348
11395
  let e = (e) => {
11349
11396
  e.key === "Escape" && r();
@@ -11381,7 +11428,7 @@ function Go({ policy: e, words: t, locale: n, onClose: r }) {
11381
11428
  style: {
11382
11429
  background: "var(--page-bg, #fff)",
11383
11430
  color: "var(--page-text, #111827)",
11384
- border: go,
11431
+ border: yo,
11385
11432
  borderRadius: "12px",
11386
11433
  width: "min(720px, 100%)",
11387
11434
  maxHeight: "85vh",
@@ -11396,7 +11443,7 @@ function Go({ policy: e, words: t, locale: n, onClose: r }) {
11396
11443
  alignItems: "center",
11397
11444
  gap: "12px",
11398
11445
  padding: "16px 20px",
11399
- borderBottom: go
11446
+ borderBottom: yo
11400
11447
  },
11401
11448
  children: [/* @__PURE__ */ g("strong", {
11402
11449
  ...X("modal-title"),
@@ -11411,7 +11458,7 @@ function Go({ policy: e, words: t, locale: n, onClose: r }) {
11411
11458
  "aria-label": t("close"),
11412
11459
  ...X("modal-close"),
11413
11460
  style: {
11414
- ...yo,
11461
+ ...So,
11415
11462
  padding: "4px 10px"
11416
11463
  },
11417
11464
  children: "×"
@@ -11465,12 +11512,12 @@ function Go({ policy: e, words: t, locale: n, onClose: r }) {
11465
11512
  })
11466
11513
  });
11467
11514
  }
11468
- var Ko = {
11515
+ var Yo = {
11469
11516
  year: "numeric",
11470
11517
  month: "short",
11471
11518
  day: "numeric"
11472
11519
  };
11473
- function qo({ reference: e, words: t }) {
11520
+ function Xo({ reference: e, words: t }) {
11474
11521
  let [n, r] = f(!1);
11475
11522
  if (!e) return null;
11476
11523
  let i = () => {
@@ -11518,7 +11565,7 @@ function qo({ reference: e, words: t }) {
11518
11565
  onClick: i,
11519
11566
  ...X("copy-button"),
11520
11567
  style: {
11521
- ...yo,
11568
+ ...So,
11522
11569
  padding: "6px 12px"
11523
11570
  },
11524
11571
  children: t(n ? "copied" : "copy")
@@ -11535,7 +11582,7 @@ function qo({ reference: e, words: t }) {
11535
11582
  ]
11536
11583
  });
11537
11584
  }
11538
- function Jo({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
11585
+ function Zo({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
11539
11586
  let a = Array.isArray(e) ? e.filter((e) => e && e.token && !e.revoked_at) : [];
11540
11587
  if (!a.length) return null;
11541
11588
  let o = (e) => {
@@ -11565,7 +11612,7 @@ function Jo({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
11565
11612
  alignItems: "center",
11566
11613
  gap: "12px",
11567
11614
  padding: "10px 12px",
11568
- border: go,
11615
+ border: yo,
11569
11616
  borderRadius: "8px"
11570
11617
  },
11571
11618
  children: [/* @__PURE__ */ _("div", {
@@ -11595,7 +11642,7 @@ function Jo({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
11595
11642
  onClick: i ? (e) => e.preventDefault() : void 0,
11596
11643
  ...X("download-button"),
11597
11644
  style: {
11598
- ...vo,
11645
+ ...xo,
11599
11646
  padding: "6px 14px",
11600
11647
  textDecoration: "none",
11601
11648
  fontSize: "14px"
@@ -11613,7 +11660,7 @@ function Jo({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
11613
11660
  })]
11614
11661
  });
11615
11662
  }
11616
- function Yo({ tracking: e, words: t, noNavigate: n }) {
11663
+ function Qo({ tracking: e, words: t, noNavigate: n }) {
11617
11664
  let r = typeof e?.carrier == "string" ? e.carrier : "", i = typeof e?.number == "string" ? e.number : "", a = typeof e?.url == "string" && /^https?:\/\//i.test(e.url) ? e.url : "";
11618
11665
  return !r && !i && !a ? null : /* @__PURE__ */ _("div", {
11619
11666
  ...X("tracking"),
@@ -11648,8 +11695,8 @@ function Yo({ tracking: e, words: t, noNavigate: n }) {
11648
11695
  ]
11649
11696
  });
11650
11697
  }
11651
- function Xo({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, inert: i = !1, sample: a = !1, noNavigate: o = !1 }) {
11652
- let { tenant: s, apiUrl: l, locale: u, words: d, orderId: p } = bo(), [m, h] = f(null), [v, y] = f(!1), [b, x] = f("");
11698
+ function $o({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, inert: i = !1, sample: a = !1, noNavigate: o = !1 }) {
11699
+ let { tenant: s, apiUrl: l, locale: u, words: d, orderId: p } = Co(), [m, h] = f(null), [v, y] = f(!1), [b, x] = f("");
11653
11700
  c(() => {
11654
11701
  if (i) return;
11655
11702
  let e = !0;
@@ -11684,7 +11731,7 @@ function Xo({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
11684
11731
  items: []
11685
11732
  }] : m ?? [], C = (e) => {
11686
11733
  try {
11687
- return new Intl.DateTimeFormat(u || void 0, Ko).format(new Date(e));
11734
+ return new Intl.DateTimeFormat(u || void 0, Yo).format(new Date(e));
11688
11735
  } catch {
11689
11736
  return String(e).slice(0, 10);
11690
11737
  }
@@ -11727,7 +11774,7 @@ function Xo({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
11727
11774
  S.map((e) => /* @__PURE__ */ _("div", {
11728
11775
  ...X("order", b === e.id && "order-open"),
11729
11776
  style: {
11730
- border: go,
11777
+ border: yo,
11731
11778
  borderRadius: "10px",
11732
11779
  overflow: "hidden"
11733
11780
  },
@@ -11768,13 +11815,13 @@ function Xo({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
11768
11815
  fontSize: "13px",
11769
11816
  padding: "2px 10px",
11770
11817
  borderRadius: "999px",
11771
- background: _o
11818
+ background: bo
11772
11819
  },
11773
11820
  children: [d(`st_${e.status}`), e.payment_status === "paid" ? "" : ` · ${d(`pay_${e.payment_status}`)}`]
11774
11821
  }),
11775
11822
  /* @__PURE__ */ g("strong", {
11776
11823
  ...X("order-total"),
11777
- children: Ia(e.total, e.currency, u)
11824
+ children: za(e.total, e.currency, u)
11778
11825
  })
11779
11826
  ]
11780
11827
  }), b === e.id && e.items?.length > 0 && /* @__PURE__ */ _("div", {
@@ -11804,19 +11851,19 @@ function Xo({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
11804
11851
  })
11805
11852
  ] }), /* @__PURE__ */ g("span", {
11806
11853
  ...X("order-item-price"),
11807
- children: Ia(t.total, e.currency, u)
11854
+ children: za(t.total, e.currency, u)
11808
11855
  })]
11809
11856
  }, t.id)),
11810
- e.payment_status === "unpaid" && e.status !== "cancelled" && /* @__PURE__ */ g(qo, {
11857
+ e.payment_status === "unpaid" && e.status !== "cancelled" && /* @__PURE__ */ g(Xo, {
11811
11858
  reference: e.transfer_reference,
11812
11859
  words: d
11813
11860
  }),
11814
- /* @__PURE__ */ g(Yo, {
11861
+ /* @__PURE__ */ g(Qo, {
11815
11862
  tracking: e.tracking,
11816
11863
  words: d,
11817
11864
  noNavigate: o
11818
11865
  }),
11819
- /* @__PURE__ */ g(Jo, {
11866
+ /* @__PURE__ */ g(Zo, {
11820
11867
  downloads: e.downloads,
11821
11868
  apiUrl: l,
11822
11869
  words: d,
@@ -11831,21 +11878,21 @@ function Xo({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
11831
11878
  }
11832
11879
  //#endregion
11833
11880
  //#region ../ui/src/components/builder/apps/language/views.jsx
11834
- function Zo(e) {
11881
+ function es(e) {
11835
11882
  let t = e?.locales, n = [typeof t?.default == "string" && t.default.trim() ? t.default.trim() : "", ...Array.isArray(t?.enabled) ? t.enabled : []].filter((e) => typeof e == "string" && e.trim());
11836
11883
  return [...new Set(n.map((e) => e.trim()))];
11837
11884
  }
11838
- var Qo = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
11839
- function $o(e, t) {
11885
+ var ts = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
11886
+ function ns(e, t) {
11840
11887
  let n = String(e ?? "").toUpperCase();
11841
11888
  if (t === "code") return n;
11842
11889
  let r = "";
11843
11890
  try {
11844
- r = Qo(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
11891
+ r = ts(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
11845
11892
  } catch {}
11846
11893
  return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
11847
11894
  }
11848
- function es(e, t) {
11895
+ function rs(e, t) {
11849
11896
  let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
11850
11897
  if (typeof window > "u") return n || "?";
11851
11898
  try {
@@ -11855,8 +11902,8 @@ function es(e, t) {
11855
11902
  return n || "/";
11856
11903
  }
11857
11904
  }
11858
- function ts({ variant: e, display: t, separator: n, label: r, style: a, nodeRef: o, inert: c }) {
11859
- let l = s(Y), u = Zo(l?.settings), d = u[0] ?? "", f = u.includes(l?.locale) ? l.locale : d, p = {
11905
+ function is({ variant: e, display: t, separator: n, label: r, style: a, nodeRef: o, inert: c }) {
11906
+ let l = s(Y), u = es(l?.settings), d = u[0] ?? "", f = u.includes(l?.locale) ? l.locale : d, p = {
11860
11907
  display: "inline-flex",
11861
11908
  alignItems: "center",
11862
11909
  gap: 8,
@@ -11894,7 +11941,7 @@ function ts({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
11894
11941
  children: n ?? "·"
11895
11942
  }), /* @__PURE__ */ g("a", {
11896
11943
  ...X("link", e === f && "link-current"),
11897
- href: es(e, e === d),
11944
+ href: rs(e, e === d),
11898
11945
  hrefLang: e,
11899
11946
  "aria-current": e === f ? "true" : void 0,
11900
11947
  onClick: c ? (e) => e.preventDefault() : void 0,
@@ -11904,7 +11951,7 @@ function ts({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
11904
11951
  textDecoration: "none",
11905
11952
  cursor: c ? "default" : "pointer"
11906
11953
  },
11907
- children: $o(e, t)
11954
+ children: ns(e, t)
11908
11955
  })]
11909
11956
  }, e))]
11910
11957
  }) : /* @__PURE__ */ _("div", {
@@ -11916,7 +11963,7 @@ function ts({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
11916
11963
  value: f,
11917
11964
  onChange: c ? void 0 : (e) => {
11918
11965
  let t = e.target.value;
11919
- window.location.assign(es(t, t === d));
11966
+ window.location.assign(rs(t, t === d));
11920
11967
  },
11921
11968
  onKeyDown: c ? (e) => e.preventDefault() : void 0,
11922
11969
  style: {
@@ -11932,54 +11979,54 @@ function ts({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
11932
11979
  ...X("option", e === f && "option-current"),
11933
11980
  key: e,
11934
11981
  value: e
11935
- }, $o(e, t)))
11982
+ }, ns(e, t)))
11936
11983
  })]
11937
11984
  });
11938
11985
  }
11939
11986
  //#endregion
11940
11987
  //#region ../ui/src/components/builder/apps/index.js
11941
- var ns = [
11942
- Qi,
11943
- _a,
11944
- ua,
11945
- va,
11946
- wa
11947
- ], rs = {
11948
- SiteLoginForm: ca,
11949
- SiteAccountMenu: la,
11950
- SiteLanguagePicker: ts,
11951
- CookieConsent: ga,
11952
- SiteSearch: Ca,
11953
- ShopProductGrid: Ao,
11954
- ShopProduct: jo,
11955
- ShopCartButton: Po,
11956
- ShopCheckout: Ho,
11957
- ShopOrderHistory: Xo,
11958
- ShopCurrencyPicker: Io,
11959
- ShopFavorites: Mo
11988
+ var as = [
11989
+ ta,
11990
+ ba,
11991
+ pa,
11992
+ xa,
11993
+ Da
11994
+ ], os = {
11995
+ SiteLoginForm: da,
11996
+ SiteAccountMenu: fa,
11997
+ SiteLanguagePicker: is,
11998
+ CookieConsent: ya,
11999
+ SiteSearch: Ea,
12000
+ ShopProductGrid: No,
12001
+ ShopProduct: Po,
12002
+ ShopCartButton: Lo,
12003
+ ShopCheckout: Go,
12004
+ ShopOrderHistory: $o,
12005
+ ShopCurrencyPicker: zo,
12006
+ ShopFavorites: Fo
11960
12007
  };
11961
- new Set(ns.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
12008
+ new Set(as.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
11962
12009
  //#endregion
11963
12010
  //#region ../ui/src/components/builder/three/runtime.js
11964
- var is = "0.185.1", as = "4.2.0", os = "https://cdn.jsdelivr.net/npm", ss = `${os}/three@${is}/+esm`, cs = `${os}/@google/model-viewer@${as}/dist/model-viewer.min.js`, ls = (e) => import(
12011
+ var ss = "0.185.1", cs = "4.2.0", ls = "https://cdn.jsdelivr.net/npm", us = `${ls}/three@${ss}/+esm`, ds = `${ls}/@google/model-viewer@${cs}/dist/model-viewer.min.js`, fs = (e) => import(
11965
12012
  /* @vite-ignore */
11966
12013
  /* webpackIgnore: true */
11967
12014
  e
11968
- ), us = /* @__PURE__ */ new Map();
11969
- function ds(e) {
11970
- if (us.has(e)) return us.get(e);
12015
+ ), ps = /* @__PURE__ */ new Map();
12016
+ function ms(e) {
12017
+ if (ps.has(e)) return ps.get(e);
11971
12018
  if (typeof window > "u") return new Promise(() => {});
11972
- let t = ls(e).catch((t) => {
11973
- throw us.delete(e), t;
12019
+ let t = fs(e).catch((t) => {
12020
+ throw ps.delete(e), t;
11974
12021
  });
11975
- return us.set(e, t), t;
12022
+ return ps.set(e, t), t;
11976
12023
  }
11977
- var fs = () => ds(ss), ps = (e) => ds(`${os}/three@${is}/examples/jsm/${e}/+esm`);
11978
- function ms() {
11979
- return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) : ds(cs);
12024
+ var hs = () => ms(us), gs = (e) => ms(`${ls}/three@${ss}/examples/jsm/${e}/+esm`);
12025
+ function _s() {
12026
+ return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) : ms(ds);
11980
12027
  }
11981
- var hs = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, gs = (e = 2) => Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, e);
11982
- function _s(e, t) {
12028
+ var vs = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, ys = (e = 2) => Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, e);
12029
+ function bs(e, t) {
11983
12030
  let n = 0, r = 0, i = 0, a = !0, o = (e) => {
11984
12031
  n = requestAnimationFrame(o), i ||= e;
11985
12032
  let a = r ? (e - r) / 1e3 : 0;
@@ -11998,7 +12045,7 @@ function _s(e, t) {
11998
12045
  s(), l?.disconnect(), document.removeEventListener("visibilitychange", c);
11999
12046
  };
12000
12047
  }
12001
- function vs(e, t, n = {}) {
12048
+ function xs(e, t, n = {}) {
12002
12049
  let r = {
12003
12050
  radius: n.distance ?? 4,
12004
12051
  polar: n.polar ?? Math.PI / 2.4,
@@ -12047,13 +12094,13 @@ function vs(e, t, n = {}) {
12047
12094
  }
12048
12095
  //#endregion
12049
12096
  //#region ../ui/src/components/builder/three/views.jsx
12050
- var ys = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, bs = (e, t) => (Number.isFinite(Number(e)) ? Number(e) : t) / 100, xs = (e) => (Number.isFinite(Number(e)) ? Number(e) : 0) * Math.PI / 180, Ss = (e) => typeof e == "string" && !!e.trim();
12051
- function Cs({ label: e, note: t, height: n, nodeRef: r, style: i }) {
12097
+ var Ss = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, Cs = (e, t) => (Number.isFinite(Number(e)) ? Number(e) : t) / 100, ws = (e) => (Number.isFinite(Number(e)) ? Number(e) : 0) * Math.PI / 180, Ts = (e) => typeof e == "string" && !!e.trim();
12098
+ function Es({ label: e, note: t, height: n, nodeRef: r, style: i }) {
12052
12099
  return /* @__PURE__ */ _("div", {
12053
12100
  ref: r,
12054
12101
  style: {
12055
12102
  ...G(i),
12056
- minHeight: ys(n, 320),
12103
+ minHeight: Ss(n, 320),
12057
12104
  display: "flex",
12058
12105
  flexDirection: "column",
12059
12106
  alignItems: "center",
@@ -12081,24 +12128,24 @@ function Cs({ label: e, note: t, height: n, nodeRef: r, style: i }) {
12081
12128
  }) : null]
12082
12129
  });
12083
12130
  }
12084
- function ws({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: a, rotateDelay: o, cameraControls: s, ar: l, exposure: u, shadow: d, fieldOfView: p, environment: m, style: h, nodeRef: _, inert: v }) {
12131
+ function Ds({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: a, rotateDelay: o, cameraControls: s, ar: l, exposure: u, shadow: d, fieldOfView: p, environment: m, style: h, nodeRef: _, inert: v }) {
12085
12132
  let [y, b] = f(typeof window < "u" && !!window.customElements?.get("model-viewer")), [x, S] = f(!1);
12086
12133
  c(() => {
12087
12134
  if (y || !e) return;
12088
12135
  let t = !0;
12089
- return ms().then(() => t && b(!0), () => t && S(!0)), () => {
12136
+ return _s().then(() => t && b(!0), () => t && S(!0)), () => {
12090
12137
  t = !1;
12091
12138
  };
12092
12139
  }, [y, e]);
12093
12140
  let C = {
12094
12141
  display: "block",
12095
12142
  width: "100%",
12096
- minHeight: ys(r, 360),
12097
- height: ys(r, 360),
12143
+ minHeight: Ss(r, 360),
12144
+ height: Ss(r, 360),
12098
12145
  backgroundColor: i || "transparent",
12099
12146
  ...G(h)
12100
12147
  };
12101
- if (!e) return v ? /* @__PURE__ */ g(Cs, {
12148
+ if (!e) return v ? /* @__PURE__ */ g(Es, {
12102
12149
  nodeRef: _,
12103
12150
  style: h,
12104
12151
  height: r,
@@ -12133,13 +12180,13 @@ function ws({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: a, rotate
12133
12180
  poster: t || void 0,
12134
12181
  style: C,
12135
12182
  "camera-controls": w(!v && s !== !1),
12136
- "auto-rotate": w(T && !hs()),
12137
- "auto-rotate-delay": T ? String(ys(o, 0)) : void 0,
12183
+ "auto-rotate": w(T && !vs()),
12184
+ "auto-rotate-delay": T ? String(Ss(o, 0)) : void 0,
12138
12185
  "rotation-per-second": "18deg",
12139
12186
  ar: w(!v && l === !0),
12140
12187
  "ar-modes": "webxr scene-viewer quick-look",
12141
- "shadow-intensity": String(bs(d, 100)),
12142
- exposure: String(bs(u, 100)),
12188
+ "shadow-intensity": String(Cs(d, 100)),
12189
+ exposure: String(Cs(u, 100)),
12143
12190
  "field-of-view": p ? `${Number(p)}deg` : void 0,
12144
12191
  "environment-image": m && m !== "neutral" ? m : "neutral",
12145
12192
  "interaction-prompt": v ? "none" : void 0,
@@ -12157,7 +12204,7 @@ function ws({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: a, rotate
12157
12204
  }) : null
12158
12205
  });
12159
12206
  }
12160
- var Ts = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }"].join("\n"), Es = [
12207
+ var Os = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }"].join("\n"), ks = [
12161
12208
  "precision highp float;",
12162
12209
  "uniform vec2 u_res;",
12163
12210
  "uniform float u_time;",
@@ -12180,7 +12227,7 @@ var Ts = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
12180
12227
  " return v;",
12181
12228
  "}",
12182
12229
  ""
12183
- ].join("\n"), Ds = {
12230
+ ].join("\n"), As = {
12184
12231
  gradient: [
12185
12232
  "void main(){",
12186
12233
  " vec2 uv = gl_FragCoord.xy / u_res;",
@@ -12232,7 +12279,7 @@ var Ts = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
12232
12279
  "}"
12233
12280
  ].join("\n")
12234
12281
  };
12235
- function Os(e, t) {
12282
+ function js(e, t) {
12236
12283
  let n = /^#?([0-9a-f]{6})$/i.exec(String(e ?? "").trim());
12237
12284
  if (!n) return t;
12238
12285
  let r = parseInt(n[1], 16);
@@ -12242,7 +12289,7 @@ function Os(e, t) {
12242
12289
  (r & 255) / 255
12243
12290
  ];
12244
12291
  }
12245
- function ks(e, t, n) {
12292
+ function Ms(e, t, n) {
12246
12293
  let r = e.createShader(t);
12247
12294
  if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
12248
12295
  let t = e.getShaderInfoLog(r);
@@ -12250,13 +12297,13 @@ function ks(e, t, n) {
12250
12297
  }
12251
12298
  return r;
12252
12299
  }
12253
- function As({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, scale: o, height: s, interactive: l, style: u, nodeRef: p, inert: m }) {
12300
+ function Ns({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, scale: o, height: s, interactive: l, style: u, nodeRef: p, inert: m }) {
12254
12301
  let h = d(null), v = d(null), y = d(null), [b, x] = f("");
12255
12302
  c(() => () => {
12256
12303
  let e = y.current;
12257
12304
  y.current = null, e?.getExtension("WEBGL_lose_context")?.loseContext();
12258
12305
  }, []);
12259
- let S = typeof t == "string" && t.trim() ? t : Ds[e] ?? Ds.gradient, C = String(n ?? ""), w = String(r ?? ""), T = String(i ?? ""), E = bs(a, 100), D = Math.max(.05, bs(o, 100));
12306
+ let S = typeof t == "string" && t.trim() ? t : As[e] ?? As.gradient, C = String(n ?? ""), w = String(r ?? ""), T = String(i ?? ""), E = Cs(a, 100), D = Math.max(.05, Cs(o, 100));
12260
12307
  return c(() => {
12261
12308
  let e = h.current, t = v.current;
12262
12309
  if (!e || !t) return;
@@ -12271,7 +12318,7 @@ function As({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, sca
12271
12318
  }
12272
12319
  let r = null;
12273
12320
  try {
12274
- let e = ks(n, n.VERTEX_SHADER, Ts), t = ks(n, n.FRAGMENT_SHADER, Es + S);
12321
+ let e = Ms(n, n.VERTEX_SHADER, Os), t = Ms(n, n.FRAGMENT_SHADER, ks + S);
12275
12322
  if (r = n.createProgram(), n.attachShader(r, e), n.attachShader(r, t), n.linkProgram(r), !n.getProgramParameter(r, n.LINK_STATUS)) throw Error(n.getProgramInfoLog(r) || "Link failed");
12276
12323
  x("");
12277
12324
  } catch (e) {
@@ -12307,28 +12354,28 @@ function As({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, sca
12307
12354
  };
12308
12355
  l !== !1 && t.addEventListener("pointermove", u);
12309
12356
  let d = () => {
12310
- let r = gs(), i = Math.max(1, Math.round(t.clientWidth * r)), a = Math.max(1, Math.round(t.clientHeight * r));
12357
+ let r = ys(), i = Math.max(1, Math.round(t.clientWidth * r)), a = Math.max(1, Math.round(t.clientHeight * r));
12311
12358
  (e.width !== i || e.height !== a) && (e.width = i, e.height = a, n.viewport(0, 0, i, a));
12312
12359
  }, f = typeof ResizeObserver > "u" ? null : new ResizeObserver(d);
12313
12360
  f?.observe(t), d();
12314
- let p = hs(), m = {
12315
- a: Os(C, [
12361
+ let p = vs(), m = {
12362
+ a: js(C, [
12316
12363
  .35,
12317
12364
  .4,
12318
12365
  .95
12319
12366
  ]),
12320
- b: Os(w, [
12367
+ b: js(w, [
12321
12368
  .05,
12322
12369
  .06,
12323
12370
  .16
12324
12371
  ]),
12325
- c: Os(T, [
12372
+ c: js(T, [
12326
12373
  .95,
12327
12374
  .35,
12328
12375
  .6
12329
12376
  ])
12330
12377
  }, g = {};
12331
- return g.stop = _s(t, (t, r) => {
12378
+ return g.stop = bs(t, (t, r) => {
12332
12379
  d(), n.uniform2f(s.res, e.width, e.height), n.uniform1f(s.time, (p ? 0 : r) * E), n.uniform2f(s.mouse, c.x, c.y), n.uniform3fv(s.a, m.a), n.uniform3fv(s.b, m.b), n.uniform3fv(s.c, m.c), n.uniform1f(s.scale, D), n.drawArrays(n.TRIANGLES, 0, 3), p && g.stop?.();
12333
12380
  }), () => {
12334
12381
  g.stop?.(), f?.disconnect(), t.removeEventListener("pointermove", u), n.deleteProgram(r), n.deleteBuffer(i);
@@ -12347,7 +12394,7 @@ function As({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, sca
12347
12394
  },
12348
12395
  style: {
12349
12396
  position: "relative",
12350
- minHeight: ys(s, 320),
12397
+ minHeight: Ss(s, 320),
12351
12398
  overflow: "hidden",
12352
12399
  ...G(u)
12353
12400
  },
@@ -12379,7 +12426,7 @@ function As({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, sca
12379
12426
  }) : null]
12380
12427
  });
12381
12428
  }
12382
- function js(e, t) {
12429
+ function Ps(e, t) {
12383
12430
  let n = new e.Scene(), r = new e.BoxGeometry();
12384
12431
  r.deleteAttribute("uv");
12385
12432
  let i = new e.Mesh(r, new e.MeshBasicMaterial({
@@ -12395,23 +12442,23 @@ function js(e, t) {
12395
12442
  let o = new e.PMREMGenerator(t), s = o.fromScene(n, .04);
12396
12443
  return o.dispose(), r.dispose(), n.traverse((e) => e.material?.dispose?.()), s.texture;
12397
12444
  }
12398
- var Ms = /* @__PURE__ */ new Map();
12399
- function Ns(e) {
12400
- if (Ms.has(e)) return Ms.get(e);
12401
- let t = ps("loaders/GLTFLoader.js").then((t) => new Promise((n, r) => {
12445
+ var Fs = /* @__PURE__ */ new Map();
12446
+ function Is(e) {
12447
+ if (Fs.has(e)) return Fs.get(e);
12448
+ let t = gs("loaders/GLTFLoader.js").then((t) => new Promise((n, r) => {
12402
12449
  new t.GLTFLoader().load(e, (e) => n(e.scene), void 0, r);
12403
12450
  })).catch((t) => {
12404
- throw Ms.delete(e), t;
12451
+ throw Fs.delete(e), t;
12405
12452
  });
12406
- return Ms.set(e, t), t;
12453
+ return Fs.set(e, t), t;
12407
12454
  }
12408
- function Ps(e, t) {
12455
+ function Ls(e, t) {
12409
12456
  let n = new e.Box3().setFromObject(t);
12410
12457
  if (n.isEmpty()) return t;
12411
12458
  let r = n.getSize(new e.Vector3()), i = n.getCenter(new e.Vector3()), a = Math.max(r.x, r.y, r.z) || 1, o = new e.Group();
12412
12459
  return t.position.sub(i), t.scale.multiplyScalar(1 / a), t.position.multiplyScalar(1 / a), o.add(t), o;
12413
12460
  }
12414
- var Fs = {
12461
+ var Rs = {
12415
12462
  box: (e) => new e.BoxGeometry(1, 1, 1, 1, 1, 1),
12416
12463
  sphere: (e) => new e.SphereGeometry(.62, 48, 32),
12417
12464
  torus: (e) => new e.TorusGeometry(.5, .2, 24, 64),
@@ -12420,50 +12467,50 @@ var Fs = {
12420
12467
  cylinder: (e) => new e.CylinderGeometry(.45, .45, 1.1, 48),
12421
12468
  plane: (e) => new e.PlaneGeometry(1.4, 1.4),
12422
12469
  capsule: (e) => new e.CapsuleGeometry(.35, .6, 8, 32)
12423
- }, Is = (e, t) => Number.isFinite(Number(e)) ? Number(e) : t;
12424
- function Ls({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate: i, spinSpeed: a, controls: o, ground: s, height: l, style: u, nodeRef: p, inert: m }) {
12425
- let h = d(null), [_, v] = f(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = i !== !1 && !hs(), S = o !== !1 && !m;
12470
+ }, zs = (e, t) => Number.isFinite(Number(e)) ? Number(e) : t;
12471
+ function Bs({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate: i, spinSpeed: a, controls: o, ground: s, height: l, style: u, nodeRef: p, inert: m }) {
12472
+ let h = d(null), [_, v] = f(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = i !== !1 && !vs(), S = o !== !1 && !m;
12426
12473
  return c(() => {
12427
12474
  let e = h.current;
12428
12475
  if (!e) return;
12429
12476
  let i = !0, o = null;
12430
- return fs().then((c) => {
12477
+ return hs().then((c) => {
12431
12478
  if (!i || !e) return;
12432
12479
  let l = new c.WebGLRenderer({
12433
12480
  antialias: !0,
12434
12481
  alpha: !t
12435
12482
  });
12436
- l.setPixelRatio(gs()), l.shadowMap.enabled = s !== !1, l.shadowMap.type = c.PCFSoftShadowMap, l.outputColorSpace = c.SRGBColorSpace, l.toneMapping = c.ACESFilmicToneMapping, l.domElement.style.display = "block", l.domElement.style.width = "100%", l.domElement.style.height = "100%", e.appendChild(l.domElement);
12483
+ l.setPixelRatio(ys()), l.shadowMap.enabled = s !== !1, l.shadowMap.type = c.PCFSoftShadowMap, l.outputColorSpace = c.SRGBColorSpace, l.toneMapping = c.ACESFilmicToneMapping, l.domElement.style.display = "block", l.domElement.style.width = "100%", l.domElement.style.height = "100%", e.appendChild(l.domElement);
12437
12484
  let u = new c.Scene();
12438
- t && (u.background = new c.Color(t)), u.environment = js(c, l);
12439
- let d = new c.PerspectiveCamera(Is(r, 45), 1, .1, 400), f = vs(d, l.domElement, {
12440
- distance: Is(n, 5),
12485
+ t && (u.background = new c.Color(t)), u.environment = Ps(c, l);
12486
+ let d = new c.PerspectiveCamera(zs(r, 45), 1, .1, 400), f = xs(d, l.domElement, {
12487
+ distance: zs(n, 5),
12441
12488
  enableZoom: S
12442
12489
  }), p = new c.DirectionalLight(16777215, 2.2);
12443
12490
  p.position.set(4, 7, 5), p.castShadow = s !== !1, p.shadow.mapSize.set(1024, 1024), p.shadow.camera.near = .5, p.shadow.camera.far = 30, u.add(p, new c.AmbientLight(16777215, .35));
12444
12491
  let m = [], h = new c.Group(), g = (e, t) => {
12445
- let n = Is(t.scale, 1);
12446
- e.position.set(Is(t.x, 0), Is(t.y, 0), Is(t.z, 0)), e.rotation.set(xs(t.rx), xs(t.ry), xs(t.rz)), e.scale.setScalar(n > 0 ? n : 1), e.userData.spin = xs(t.spin);
12492
+ let n = zs(t.scale, 1);
12493
+ e.position.set(zs(t.x, 0), zs(t.y, 0), zs(t.z, 0)), e.rotation.set(ws(t.rx), ws(t.ry), ws(t.rz)), e.scale.setScalar(n > 0 ? n : 1), e.userData.spin = ws(t.spin);
12447
12494
  };
12448
12495
  for (let e of y) {
12449
12496
  if (e.shape === "model") {
12450
- if (!Ss(e.src)) continue;
12497
+ if (!Ts(e.src)) continue;
12451
12498
  let t = new c.Group();
12452
- g(t, e), h.add(t), Ns(e.src).then((e) => {
12499
+ g(t, e), h.add(t), Is(e.src).then((e) => {
12453
12500
  if (!i) return;
12454
- let n = Ps(c, e.clone(!0));
12501
+ let n = Ls(c, e.clone(!0));
12455
12502
  n.traverse((e) => {
12456
12503
  e.isMesh && (e.castShadow = !0, e.receiveShadow = !0);
12457
12504
  }), t.add(n);
12458
12505
  }, () => {});
12459
12506
  continue;
12460
12507
  }
12461
- let t = (Fs[e.shape] ?? Fs.box)(c), n = new c.MeshStandardMaterial({
12508
+ let t = (Rs[e.shape] ?? Rs.box)(c), n = new c.MeshStandardMaterial({
12462
12509
  color: /^#?[0-9a-f]{6}$/i.test(String(e.color ?? "")) ? e.color : "#6366f1",
12463
- metalness: Math.min(1, Math.max(0, bs(e.metalness, 10))),
12464
- roughness: Math.min(1, Math.max(0, bs(e.roughness, 35))),
12465
- transparent: bs(e.opacity, 100) < 1,
12466
- opacity: Math.min(1, Math.max(0, bs(e.opacity, 100))),
12510
+ metalness: Math.min(1, Math.max(0, Cs(e.metalness, 10))),
12511
+ roughness: Math.min(1, Math.max(0, Cs(e.roughness, 35))),
12512
+ transparent: Cs(e.opacity, 100) < 1,
12513
+ opacity: Math.min(1, Math.max(0, Cs(e.opacity, 100))),
12467
12514
  flatShading: e.flat === !0,
12468
12515
  wireframe: e.wireframe === !0,
12469
12516
  side: e.shape === "plane" ? c.DoubleSide : c.FrontSide
@@ -12474,14 +12521,14 @@ function Ls({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
12474
12521
  let _ = null;
12475
12522
  if (s !== !1) {
12476
12523
  let e = new c.ShadowMaterial({ opacity: .22 }), t = new c.PlaneGeometry(60, 60);
12477
- _ = new c.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y = Is(s === !0 ? 0 : s, -.85), _.receiveShadow = !0, u.add(_), m.push(t, e);
12524
+ _ = new c.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y = zs(s === !0 ? 0 : s, -.85), _.receiveShadow = !0, u.add(_), m.push(t, e);
12478
12525
  }
12479
12526
  let v = () => {
12480
12527
  let t = Math.max(1, e.clientWidth), n = Math.max(1, e.clientHeight);
12481
12528
  l.setSize(t, n, !1), d.aspect = t / n, d.updateProjectionMatrix();
12482
12529
  }, b = typeof ResizeObserver > "u" ? null : new ResizeObserver(v);
12483
12530
  b?.observe(e), v();
12484
- let C = xs(Number.isFinite(Number(a)) ? a : 20), w = _s(e, (e) => {
12531
+ let C = ws(Number.isFinite(Number(a)) ? a : 20), w = bs(e, (e) => {
12485
12532
  f.autoSpin(x ? C : 0, e), f.update();
12486
12533
  for (let t of h.children) t.userData.spin && (t.rotation.y += t.userData.spin * e);
12487
12534
  l.render(u, d);
@@ -12505,7 +12552,7 @@ function Ls({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
12505
12552
  a,
12506
12553
  S,
12507
12554
  s
12508
- ]), _ && m ? /* @__PURE__ */ g(Cs, {
12555
+ ]), _ && m ? /* @__PURE__ */ g(Es, {
12509
12556
  nodeRef: p,
12510
12557
  style: u,
12511
12558
  height: l,
@@ -12516,27 +12563,27 @@ function Ls({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
12516
12563
  h.current = e, typeof p == "function" && p(e);
12517
12564
  },
12518
12565
  style: {
12519
- minHeight: ys(l, 380),
12520
- height: ys(l, 380),
12566
+ minHeight: Ss(l, 380),
12567
+ height: Ss(l, 380),
12521
12568
  overflow: "hidden",
12522
12569
  touchAction: S ? "pan-y" : void 0,
12523
12570
  ...G(u)
12524
12571
  }
12525
12572
  });
12526
12573
  }
12527
- function Rs({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a }) {
12574
+ function Vs({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a }) {
12528
12575
  let o = d(null), [s, l] = f("");
12529
12576
  return c(() => {
12530
12577
  let t = o.current;
12531
12578
  if (a || !t || typeof e != "string" || !e.trim()) return;
12532
12579
  let r = !0, i = null;
12533
- return fs().then((a) => {
12580
+ return hs().then((a) => {
12534
12581
  if (!r || !t) return;
12535
12582
  let o = new a.WebGLRenderer({
12536
12583
  antialias: !0,
12537
12584
  alpha: !n
12538
12585
  });
12539
- o.setPixelRatio(gs()), o.outputColorSpace = a.SRGBColorSpace, o.domElement.style.display = "block", o.domElement.style.width = "100%", o.domElement.style.height = "100%", t.appendChild(o.domElement);
12586
+ o.setPixelRatio(ys()), o.outputColorSpace = a.SRGBColorSpace, o.domElement.style.display = "block", o.domElement.style.width = "100%", o.domElement.style.height = "100%", t.appendChild(o.domElement);
12540
12587
  let s = new a.Scene();
12541
12588
  n && (s.background = new a.Color(n));
12542
12589
  let c = new a.PerspectiveCamera(45, 1, .1, 1e3);
@@ -12559,7 +12606,7 @@ function Rs({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a
12559
12606
  o.setSize(e, n, !1), c.aspect = e / n, c.updateProjectionMatrix();
12560
12607
  }, f = typeof ResizeObserver > "u" ? null : new ResizeObserver(d);
12561
12608
  f?.observe(t), d();
12562
- let p = !1, m = _s(t, (e, t) => {
12609
+ let p = !1, m = bs(t, (e, t) => {
12563
12610
  if (!p && typeof u?.frame == "function") try {
12564
12611
  u.frame(e, t);
12565
12612
  } catch (e) {
@@ -12581,7 +12628,7 @@ function Rs({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a
12581
12628
  e,
12582
12629
  a,
12583
12630
  n
12584
- ]), a ? /* @__PURE__ */ g(Cs, {
12631
+ ]), a ? /* @__PURE__ */ g(Es, {
12585
12632
  nodeRef: i,
12586
12633
  style: r,
12587
12634
  height: t,
@@ -12592,8 +12639,8 @@ function Rs({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a
12592
12639
  o.current = e, typeof i == "function" && i(e);
12593
12640
  },
12594
12641
  style: {
12595
- minHeight: ys(t, 380),
12596
- height: ys(t, 380),
12642
+ minHeight: Ss(t, 380),
12643
+ height: Ss(t, 380),
12597
12644
  overflow: "hidden",
12598
12645
  position: "relative",
12599
12646
  touchAction: "pan-y",
@@ -12616,30 +12663,30 @@ function Rs({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a
12616
12663
  }) : null
12617
12664
  });
12618
12665
  }
12619
- var zs = {
12620
- ModelViewerBlock: ws,
12621
- ShaderBlock: As,
12622
- SceneBlock: Ls,
12623
- ThreeCanvasBlock: Rs
12624
- }, Bs = "2.44.0", Vs = "https://cdn.jsdelivr.net/npm", Hs = `${Vs}/@rive-app/canvas@${Bs}/+esm`, Us = `${Vs}/@rive-app/canvas@${Bs}/rive.wasm`, Ws = (e) => import(
12666
+ var Hs = {
12667
+ ModelViewerBlock: Ds,
12668
+ ShaderBlock: Ns,
12669
+ SceneBlock: Bs,
12670
+ ThreeCanvasBlock: Vs
12671
+ }, Us = "2.44.0", Ws = "https://cdn.jsdelivr.net/npm", Gs = `${Ws}/@rive-app/canvas@${Us}/+esm`, Ks = `${Ws}/@rive-app/canvas@${Us}/rive.wasm`, qs = (e) => import(
12625
12672
  /* @vite-ignore */
12626
12673
  /* webpackIgnore: true */
12627
12674
  e
12628
- ), Gs = null;
12629
- function Ks() {
12630
- return typeof window > "u" ? new Promise(() => {}) : Gs || (Gs = Ws(Hs).then((e) => {
12675
+ ), Js = null;
12676
+ function Ys() {
12677
+ return typeof window > "u" ? new Promise(() => {}) : Js || (Js = qs(Gs).then((e) => {
12631
12678
  let t = e?.default ?? e;
12632
- return t?.RuntimeLoader?.setWasmUrl && t.RuntimeLoader.setWasmUrl(Us), t;
12679
+ return t?.RuntimeLoader?.setWasmUrl && t.RuntimeLoader.setWasmUrl(Ks), t;
12633
12680
  }).catch((e) => {
12634
- throw Gs = null, e;
12635
- }), Gs);
12681
+ throw Js = null, e;
12682
+ }), Js);
12636
12683
  }
12637
- var qs = /* @__PURE__ */ new Map(), Js = {
12684
+ var Xs = /* @__PURE__ */ new Map(), Zs = {
12638
12685
  56: "number",
12639
12686
  58: "trigger",
12640
12687
  59: "boolean"
12641
- }, Ys = /* @__PURE__ */ new Set();
12642
- function Xs(e, t) {
12688
+ }, Qs = /* @__PURE__ */ new Set();
12689
+ function $s(e, t) {
12643
12690
  if (!e || !t) return;
12644
12691
  let n = (Array.isArray(t.artboards) ? t.artboards : []).map((e) => ({
12645
12692
  name: String(e?.name ?? ""),
@@ -12648,15 +12695,15 @@ function Xs(e, t) {
12648
12695
  name: String(e?.name ?? ""),
12649
12696
  inputs: (Array.isArray(e?.inputs) ? e.inputs : []).map((e) => ({
12650
12697
  name: String(e?.name ?? ""),
12651
- type: Js[e?.type] ?? "unknown"
12698
+ type: Zs[e?.type] ?? "unknown"
12652
12699
  }))
12653
12700
  }))
12654
12701
  }));
12655
- qs.set(e, { artboards: n }), Ys.forEach((t) => t(e));
12702
+ Xs.set(e, { artboards: n }), Qs.forEach((t) => t(e));
12656
12703
  }
12657
12704
  //#endregion
12658
12705
  //#region ../ui/src/components/builder/rive/views.jsx
12659
- var Zs = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, Qs = [
12706
+ var ec = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, tc = [
12660
12707
  "contain",
12661
12708
  "cover",
12662
12709
  "fill",
@@ -12665,7 +12712,7 @@ var Zs = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t,
12665
12712
  "scaleDown",
12666
12713
  "none",
12667
12714
  "layout"
12668
- ], $s = [
12715
+ ], nc = [
12669
12716
  "center",
12670
12717
  "topLeft",
12671
12718
  "topCenter",
@@ -12675,8 +12722,8 @@ var Zs = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t,
12675
12722
  "bottomLeft",
12676
12723
  "bottomCenter",
12677
12724
  "bottomRight"
12678
- ], ec = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, tc = 131;
12679
- function nc(e, t, n, r) {
12725
+ ], rc = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, ic = 131;
12726
+ function ac(e, t, n, r) {
12680
12727
  if (!e || !t || !n) return;
12681
12728
  let i = [];
12682
12729
  try {
@@ -12687,15 +12734,15 @@ function nc(e, t, n, r) {
12687
12734
  let a = i.find((e) => e?.name === n);
12688
12735
  a && (a.type === 58 ? r && a.fire() : a.type === 59 ? a.value = !!r : a.type === 56 && (a.value = +!!r));
12689
12736
  }
12690
- function rc({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o = "stateMachine", stateMachine: s, animation: l, fit: u = "contain", alignment: p = "center", autoplay: m = !0, hoverInput: h, clickInput: v, style: y, nodeRef: b, inert: x }) {
12737
+ function oc({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o = "stateMachine", stateMachine: s, animation: l, fit: u = "contain", alignment: p = "center", autoplay: m = !0, hoverInput: h, clickInput: v, style: y, nodeRef: b, inert: x }) {
12691
12738
  let S = d(null), C = d(null), w = d(null), T = d(""), [E, D] = f(!1), [O, k] = f(!1);
12692
12739
  c(() => {
12693
12740
  let t = C.current, n = S.current;
12694
12741
  if (D(!1), k(!1), !e || !t) return;
12695
12742
  let r = !0, i = null, c = null, d = null;
12696
- return Ks().then((f) => {
12743
+ return Ys().then((f) => {
12697
12744
  if (!r) return;
12698
- let h = o !== "animation", g = m !== !1 && !ec();
12745
+ let h = o !== "animation", g = m !== !1 && !rc();
12699
12746
  try {
12700
12747
  i = new f.Rive({
12701
12748
  src: e,
@@ -12705,8 +12752,8 @@ function rc({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
12705
12752
  animations: !h && l ? l : void 0,
12706
12753
  autoplay: g,
12707
12754
  layout: new f.Layout({
12708
- fit: Qs.includes(u) ? u : "contain",
12709
- alignment: $s.includes(p) ? p : "center"
12755
+ fit: tc.includes(u) ? u : "contain",
12756
+ alignment: nc.includes(p) ? p : "center"
12710
12757
  }),
12711
12758
  shouldDisableRiveListeners: !!x,
12712
12759
  isTouchScrollEnabled: !0,
@@ -12714,7 +12761,7 @@ function rc({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
12714
12761
  if (!r) return;
12715
12762
  i.resizeDrawingSurfaceToCanvas();
12716
12763
  let t = i.contents;
12717
- if (Xs(e, t), h) {
12764
+ if ($s(e, t), h) {
12718
12765
  let e = ((t?.artboards ?? []).find((e) => e.name === (a || i.activeArtboard)) ?? t?.artboards?.[0])?.stateMachines?.[0]?.name ?? "";
12719
12766
  if (T.current = s || e, !s && e) try {
12720
12767
  i.play(e), g || i.pause(e);
@@ -12730,7 +12777,7 @@ function rc({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
12730
12777
  }
12731
12778
  w.current = i, n && (n.rive = i), i.on(f.EventType.RiveEvent, (e) => {
12732
12779
  let t = e?.data;
12733
- x || t?.type !== tc || !t?.url || (t.target === "_self" ? window.location.assign(t.url) : window.open(t.url, t.target || "_blank", "noopener"));
12780
+ x || t?.type !== ic || !t?.url || (t.target === "_self" ? window.location.assign(t.url) : window.open(t.url, t.target || "_blank", "noopener"));
12734
12781
  }), n && typeof ResizeObserver < "u" && (c = new ResizeObserver(() => i?.resizeDrawingSurfaceToCanvas()), c.observe(n)), n && typeof IntersectionObserver < "u" && (d = new IntersectionObserver(([e]) => {
12735
12782
  i && (e?.isIntersecting ? i.startRendering?.() : i.stopRendering?.());
12736
12783
  }), d.observe(n));
@@ -12751,11 +12798,11 @@ function rc({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
12751
12798
  m,
12752
12799
  x
12753
12800
  ]);
12754
- let A = !x && E, j = (e, t) => A && nc(w.current, T.current, e, t), M = {
12801
+ let A = !x && E, j = (e, t) => A && ac(w.current, T.current, e, t), M = {
12755
12802
  position: "relative",
12756
12803
  display: "block",
12757
12804
  width: "100%",
12758
- height: Zs(r, 360),
12805
+ height: ec(r, 360),
12759
12806
  backgroundColor: i || "transparent",
12760
12807
  overflow: "hidden",
12761
12808
  ...G(y)
@@ -12817,35 +12864,35 @@ function rc({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
12817
12864
  }), /* @__PURE__ */ g("span", { children: "Pick a .riv file in the Settings panel." })]
12818
12865
  }) : null;
12819
12866
  }
12820
- var ic = { RiveBlock: rc }, ac = /* @__PURE__ */ new Map();
12821
- function oc(e) {
12822
- if (ac.has(e)) return ac.get(e);
12867
+ var sc = { RiveBlock: oc }, cc = /* @__PURE__ */ new Map();
12868
+ function lc(e) {
12869
+ if (cc.has(e)) return cc.get(e);
12823
12870
  let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
12824
12871
  /* @vite-ignore */
12825
12872
  /* webpackIgnore: true */
12826
12873
  t
12827
12874
  ).finally(() => URL.revokeObjectURL(t));
12828
- return ac.set(e, n), n;
12875
+ return cc.set(e, n), n;
12829
12876
  }
12830
- function sc(e) {
12877
+ function uc(e) {
12831
12878
  let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
12832
12879
  return n && typeof n == "object" ? n : {};
12833
12880
  }
12834
12881
  //#endregion
12835
12882
  //#region ../ui/src/components/builder/plugins/view.jsx
12836
- async function cc(e, t) {
12837
- let n = await oc(e);
12883
+ async function dc(e, t) {
12884
+ let n = await lc(e);
12838
12885
  return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
12839
12886
  }
12840
- var lc = {
12887
+ var fc = {
12841
12888
  padding: "10px 12px",
12842
12889
  border: "1px dashed rgba(148, 163, 184, 0.5)",
12843
12890
  borderRadius: 8,
12844
12891
  fontSize: 12,
12845
12892
  opacity: .6
12846
12893
  };
12847
- function uc({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
12848
- let a = s(Y), o = sc(a?.settings)[e], l = d(null), u = d(null), f = {
12894
+ function pc({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
12895
+ let a = s(Y), o = uc(a?.settings)[e], l = d(null), u = d(null), f = {
12849
12896
  tenant: a?.tenant ?? "",
12850
12897
  apiUrl: a?.apiUrl ?? "/api",
12851
12898
  locale: a?.locale ?? "",
@@ -12857,7 +12904,7 @@ function uc({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
12857
12904
  let e = l.current;
12858
12905
  if (!o?.code || !e) return;
12859
12906
  let n = !0;
12860
- return cc(o.code, t).then((e) => {
12907
+ return dc(o.code, t).then((e) => {
12861
12908
  if (!(!n || !e || !l.current)) {
12862
12909
  u.current = e;
12863
12910
  try {
@@ -12887,7 +12934,7 @@ function uc({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
12887
12934
  }) : /* @__PURE__ */ _("div", {
12888
12935
  ref: i,
12889
12936
  style: {
12890
- ...lc,
12937
+ ...fc,
12891
12938
  ...G(r)
12892
12939
  },
12893
12940
  children: [
@@ -12899,7 +12946,7 @@ function uc({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
12899
12946
  }
12900
12947
  //#endregion
12901
12948
  //#region ../ui/src/components/builder/render.jsx
12902
- function dc(e, t) {
12949
+ function mc(e, t) {
12903
12950
  let n = { "data-wb": e };
12904
12951
  t.htmlId && (n.id = t.htmlId);
12905
12952
  let r = ae(t.classNames);
@@ -12913,7 +12960,7 @@ function dc(e, t) {
12913
12960
  classes: r
12914
12961
  };
12915
12962
  }
12916
- function fc({ View: e, markup: t, ...r }) {
12963
+ function hc({ View: e, markup: t, ...r }) {
12917
12964
  let i = e(r);
12918
12965
  if (!a(i) || typeof i.type != "string") return i;
12919
12966
  let o = [i.props.className, ...t.classes].filter(Boolean).join(" ");
@@ -12922,14 +12969,14 @@ function fc({ View: e, markup: t, ...r }) {
12922
12969
  ...o ? { className: o } : {}
12923
12970
  });
12924
12971
  }
12925
- var pc = {
12926
- ...Zi,
12927
- ...rs,
12928
- ...zs,
12929
- ...ic,
12930
- PluginBlock: uc
12972
+ var gc = {
12973
+ ...ea,
12974
+ ...os,
12975
+ ...Hs,
12976
+ ...sc,
12977
+ PluginBlock: pc
12931
12978
  };
12932
- function mc(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
12979
+ function _c(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
12933
12980
  let o = n[e];
12934
12981
  if (!o || o.hidden) return null;
12935
12982
  let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
@@ -12937,19 +12984,19 @@ function mc(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
12937
12984
  let n = o.props?.componentId, s = r?.[n];
12938
12985
  if (!s?.template || i.has(n)) return null;
12939
12986
  let l = new Set(i).add(n);
12940
- return /* @__PURE__ */ g(t, { children: mc(s.template.rootId, s.template.nodes, r, l, $e(c.values, a)) }, e);
12987
+ return /* @__PURE__ */ g(t, { children: _c(s.template.rootId, s.template.nodes, r, l, $e(c.values, a)) }, e);
12941
12988
  }
12942
- let l = pc[s];
12989
+ let l = gc[s];
12943
12990
  if (!l) return null;
12944
- let u = (o.nodes ?? []).map((e) => mc(e, n, r, i, a)).filter(Boolean), d = Object.entries(o.linkedNodes ?? {}), f = d.length ? Object.fromEntries(d.map(([e, t]) => [e, mc(t, n, r, i, a)])) : void 0, p = /* @__PURE__ */ g(typeof l == "function" ? fc : l, {
12991
+ let u = (o.nodes ?? []).map((e) => _c(e, n, r, i, a)).filter(Boolean), d = Object.entries(o.linkedNodes ?? {}), f = d.length ? Object.fromEntries(d.map(([e, t]) => [e, _c(t, n, r, i, a)])) : void 0, p = /* @__PURE__ */ g(typeof l == "function" ? hc : l, {
12945
12992
  ...typeof l == "function" ? {
12946
12993
  View: l,
12947
- markup: dc(e, c)
12994
+ markup: mc(e, c)
12948
12995
  } : null,
12949
12996
  ...c,
12950
12997
  ...s === "CollectionList" ? {
12951
12998
  templateId: o.linkedNodes?.card,
12952
- renderTemplate: o.linkedNodes?.card ? (e) => mc(o.linkedNodes.card, n, r, i, {
12999
+ renderTemplate: o.linkedNodes?.card ? (e) => _c(o.linkedNodes.card, n, r, i, {
12953
13000
  ...a,
12954
13001
  mapProps: a?.mapProps ? (t, n) => a.mapProps(e(t, n), n) : e
12955
13002
  }) : void 0
@@ -12959,7 +13006,7 @@ function mc(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
12959
13006
  t && (t.setAttribute("data-wb", e), pe(t, c), fe(t, a?.events === !1 ? [] : c.events));
12960
13007
  },
12961
13008
  children: u.length ? u : void 0
12962
- }, e), m = c.when && c.when !== "always" ? /* @__PURE__ */ g(sa, {
13009
+ }, e), m = c.when && c.when !== "always" ? /* @__PURE__ */ g(ua, {
12963
13010
  when: c.when,
12964
13011
  children: p
12965
13012
  }, e) : p;
@@ -12970,9 +13017,9 @@ function mc(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
12970
13017
  }
12971
13018
  //#endregion
12972
13019
  //#region ../ui/src/components/builder/PageRenderer.jsx
12973
- var hc = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), gc = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(Re(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
13020
+ var vc = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), yc = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(Re(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
12974
13021
  .webim-page[data-webim-mode="dark"] { ${Object.entries(Re(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
12975
- function _c({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: a, animations: o, tenant: s, apiUrl: l, datasets: d, locale: f, direction: p, settings: m, siteUser: h, param: v }) {
13022
+ function bc({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: a, animations: o, tenant: s, apiUrl: l, datasets: d, locale: f, direction: p, settings: m, siteUser: h, param: v }) {
12976
13023
  let y = a?.js?.trim(), x = m && m["site.code"] && typeof m["site.code"] == "object" ? m["site.code"] : null, S = typeof x?.js == "string" ? x.js.trim() : "", C = typeof x?.css == "string" ? x.css.trim() : "";
12977
13024
  if (c(() => {
12978
13025
  if (!S) return;
@@ -12990,11 +13037,11 @@ function _c({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
12990
13037
  minHeight: "100%",
12991
13038
  display: "flex",
12992
13039
  flexDirection: "column"
12993
- }, k = mc("ROOT", e, n), A = u(() => ({ render: (t, r) => mc(t, e, n, void 0, { mapProps: r }) }), [e, n]), j = Ee(e, n), M = Te(e, n), N = a?.css?.trim(), P = H(o), F = Le(t), I = [F.font, F.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !Pe[e]), L = [.../* @__PURE__ */ new Set([...O(e, n), ...I])].map((e) => /* @__PURE__ */ g("link", {
13040
+ }, k = _c("ROOT", e, n), A = u(() => ({ render: (t, r) => _c(t, e, n, void 0, { mapProps: r }) }), [e, n]), j = Ee(e, n), M = Te(e, n), N = a?.css?.trim(), P = H(o), F = Le(t), I = [F.font, F.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !Pe[e]), L = [.../* @__PURE__ */ new Set([...O(e, n), ...I])].map((e) => /* @__PURE__ */ g("link", {
12994
13041
  rel: "stylesheet",
12995
13042
  precedence: "default",
12996
13043
  href: T(e)
12997
- }, e)), R = gc(F), z = Ue(t);
13044
+ }, e)), R = yc(F), z = Ue(t);
12998
13045
  return r === "auto" ? /* @__PURE__ */ g(Y.Provider, {
12999
13046
  value: {
13000
13047
  tenant: s || "",
@@ -13003,7 +13050,7 @@ function _c({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
13003
13050
  settings: m ?? null,
13004
13051
  param: v || ""
13005
13052
  },
13006
- children: /* @__PURE__ */ g(oa, {
13053
+ children: /* @__PURE__ */ g(la, {
13007
13054
  initialUser: h,
13008
13055
  children: /* @__PURE__ */ g(Pt.Provider, {
13009
13056
  value: d ?? null,
@@ -13018,8 +13065,8 @@ function _c({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
13018
13065
  ...i
13019
13066
  },
13020
13067
  children: [
13021
- /* @__PURE__ */ g("style", { children: `.webim-page { ${hc(Re(F.light))} }
13022
- @media (prefers-color-scheme: dark) { .webim-page { ${hc(Re(F.dark))} } }` }),
13068
+ /* @__PURE__ */ g("style", { children: `.webim-page { ${vc(Re(F.light))} }
13069
+ @media (prefers-color-scheme: dark) { .webim-page { ${vc(Re(F.dark))} } }` }),
13023
13070
  /* @__PURE__ */ g("style", { children: R }),
13024
13071
  L,
13025
13072
  /* @__PURE__ */ g("style", { children: E }),
@@ -13042,7 +13089,7 @@ function _c({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
13042
13089
  settings: m ?? null,
13043
13090
  param: v || ""
13044
13091
  },
13045
- children: /* @__PURE__ */ g(oa, {
13092
+ children: /* @__PURE__ */ g(la, {
13046
13093
  initialUser: h,
13047
13094
  children: /* @__PURE__ */ g(Pt.Provider, {
13048
13095
  value: d ?? null,
@@ -13076,8 +13123,8 @@ function _c({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
13076
13123
  }
13077
13124
  //#endregion
13078
13125
  //#region src/WebimContent.jsx
13079
- function vc({ bundle: e, mode: t = "auto", style: n }) {
13080
- return e?.blocks?.ROOT ? /* @__PURE__ */ g(_c, {
13126
+ function xc({ bundle: e, mode: t = "auto", style: n }) {
13127
+ return e?.blocks?.ROOT ? /* @__PURE__ */ g(bc, {
13081
13128
  blocks: e.blocks,
13082
13129
  theme: e.theme,
13083
13130
  components: e.components,
@@ -13096,24 +13143,24 @@ function vc({ bundle: e, mode: t = "auto", style: n }) {
13096
13143
  }
13097
13144
  //#endregion
13098
13145
  //#region src/fetchPage.js
13099
- var yc = async (e) => {
13146
+ var Sc = async (e) => {
13100
13147
  let t = await e.json().catch(() => null);
13101
13148
  if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
13102
13149
  return t?.payload ?? t;
13103
13150
  };
13104
- async function bc({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
13151
+ async function Cc({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
13105
13152
  if (!e) throw Error("fetchPage: apiUrl is required");
13106
13153
  if (!n) throw Error("fetchPage: slug is required");
13107
13154
  let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
13108
13155
  ...t ? { "x-tenant": t } : {},
13109
13156
  ...a ? { authorization: `Bearer ${a}` } : {}
13110
- }, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(yc), c(`${l}/settings/public`, { headers: u }).then(yc)]), p = Ye({
13157
+ }, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(Sc), c(`${l}/settings/public`, { headers: u }).then(Sc)]), p = Ye({
13111
13158
  page: d,
13112
13159
  settings: f,
13113
13160
  tenant: t,
13114
13161
  apiUrl: l,
13115
13162
  locale: r
13116
- }), m = [...new Set(xc(p.blocks, p.components).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : [
13163
+ }), m = [...new Set(wc(p.blocks, p.components).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : [
13117
13164
  "TableBlock",
13118
13165
  "OrgChartBlock",
13119
13166
  "NavbarBlock",
@@ -13122,7 +13169,7 @@ async function bc({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
13122
13169
  "LogoCarousel"
13123
13170
  ].includes(e?.type?.resolvedName) ? e.props?.source : null).filter(Boolean))];
13124
13171
  if (m.length) {
13125
- let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(yc).then((e) => {
13172
+ let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(Sc).then((e) => {
13126
13173
  let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
13127
13174
  return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
13128
13175
  }).catch(() => [[t, []]])));
@@ -13134,7 +13181,7 @@ async function bc({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
13134
13181
  __page: Math.floor(h)
13135
13182
  }), p;
13136
13183
  }
13137
- function xc(e, t) {
13184
+ function wc(e, t) {
13138
13185
  let n = [], r = /* @__PURE__ */ new Set(), i = (e) => {
13139
13186
  Object.values(e ?? {}).forEach((e) => {
13140
13187
  n.push(e);
@@ -13146,41 +13193,41 @@ function xc(e, t) {
13146
13193
  }
13147
13194
  //#endregion
13148
13195
  //#region src/ssr.jsx
13149
- var Sc = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
13196
+ var Tc = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
13150
13197
  "&": "&amp;",
13151
13198
  "<": "&lt;",
13152
13199
  ">": "&gt;",
13153
13200
  "\"": "&quot;"
13154
13201
  })[e]);
13155
- function Cc(t, { mode: n = "auto", style: r } = {}) {
13156
- return e(/* @__PURE__ */ g(vc, {
13202
+ function Ec(t, { mode: n = "auto", style: r } = {}) {
13203
+ return e(/* @__PURE__ */ g(xc, {
13157
13204
  bundle: t,
13158
13205
  mode: n,
13159
13206
  style: r
13160
13207
  }));
13161
13208
  }
13162
- function wc(e, { mode: t = "auto", lang: n } = {}) {
13209
+ function Dc(e, { mode: t = "auto", lang: n } = {}) {
13163
13210
  let r = e.seo ?? {}, i = n || e.locale || "en", a = b(e.direction, i), o = Xe(e) || "Page", s = e.custom?.js?.trim(), c = e.settings?.["site.code"], l = typeof c?.js == "string" ? c.js.trim() : "", u = (e) => `<script>${e.replaceAll("<\/script", "<\\/script")}<\/script>`, d = [
13164
13211
  "<meta charset=\"utf-8\"/>",
13165
13212
  "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>",
13166
- `<title>${Sc(o)}</title>`,
13167
- r.description && `<meta name="description" content="${Sc(r.description)}"/>`,
13168
- `<meta property="og:title" content="${Sc(o)}"/>`,
13169
- r.image && `<meta property="og:image" content="${Sc(r.image)}"/>`,
13213
+ `<title>${Tc(o)}</title>`,
13214
+ r.description && `<meta name="description" content="${Tc(r.description)}"/>`,
13215
+ `<meta property="og:title" content="${Tc(o)}"/>`,
13216
+ r.image && `<meta property="og:image" content="${Tc(r.image)}"/>`,
13170
13217
  r.noindex && "<meta name=\"robots\" content=\"noindex\"/>",
13171
13218
  "<style>html,body{margin:0;height:100%}</style>"
13172
13219
  ].filter(Boolean).join("\n");
13173
13220
  return `<!doctype html>
13174
- <html lang="${Sc(i)}"${a ? ` dir="${a}"` : ""}>
13221
+ <html lang="${Tc(i)}"${a ? ` dir="${a}"` : ""}>
13175
13222
  <head>
13176
13223
  ${d}
13177
13224
  </head>
13178
13225
  <body>
13179
- ${Cc(e, { mode: t })}
13226
+ ${Ec(e, { mode: t })}
13180
13227
  ${l ? u(l) : ""}
13181
13228
  ${s ? u(s) : ""}
13182
13229
  </body>
13183
13230
  </html>`;
13184
13231
  }
13185
13232
  //#endregion
13186
- export { Ye as assembleBundle, Xe as documentTitle, bc as fetchPage, Cc as renderBundleHtml, wc as renderPageDocument };
13233
+ export { Ye as assembleBundle, Xe as documentTitle, Cc as fetchPage, Ec as renderBundleHtml, Dc as renderPageDocument };