webim-adapter 2.7.12 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -868,7 +868,13 @@ var Qe = {
868
868
  item: "Item {n}",
869
869
  frame: "Embedded content",
870
870
  video: "Video",
871
- transcript: "Transcript"
871
+ transcript: "Transcript",
872
+ close: "Close",
873
+ prevItem: "Previous",
874
+ nextItem: "Next",
875
+ openItem: "Open {name}",
876
+ itemOf: "{n} of {total}",
877
+ gallery: "Gallery"
872
878
  },
873
879
  tr: {
874
880
  skip: "Ana içeriğe geç",
@@ -896,7 +902,13 @@ var Qe = {
896
902
  item: "Öğe {n}",
897
903
  frame: "Gömülü içerik",
898
904
  video: "Video",
899
- transcript: "Metin dökümü"
905
+ transcript: "Metin dökümü",
906
+ close: "Kapat",
907
+ prevItem: "Önceki",
908
+ nextItem: "Sonraki",
909
+ openItem: "{name} öğesini aç",
910
+ itemOf: "{n} / {total}",
911
+ gallery: "Galeri"
900
912
  }
901
913
  };
902
914
  function $e(e) {
@@ -14706,35 +14718,555 @@ function jl({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
14706
14718
  }), /* @__PURE__ */ g("span", { children: "Pick a .riv file in the Settings panel." })]
14707
14719
  }) : null;
14708
14720
  }
14709
- var Ml = { RiveBlock: jl }, Nl = /* @__PURE__ */ new Map();
14710
- function Pl(e) {
14711
- if (Nl.has(e)) return Nl.get(e);
14721
+ var Ml = { RiveBlock: jl }, Nl = /\.(mp4|webm|ogv|ogg|mov|m4v)(\?|#|$)/i, Pl = /\.(jpe?g|png|gif|webp|avif|svg|bmp)(\?|#|$)/i, Fl = /\.(pdf|docx?|xlsx?|pptx?|odt|ods|odp|txt|csv|zip|rar|7z|mp3|wav|m4a)(\?|#|$)/i, Il = /vimeo\.com\/(?:video\/)?(\d+)/i, Ll = "data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20320%20240%22%3E%3Crect%20width%3D%22320%22%20height%3D%22240%22%20fill%3D%22%231e293b%22%2F%3E%3Ccircle%20cx%3D%22160%22%20cy%3D%22120%22%20r%3D%2234%22%20fill%3D%22rgba(255%2C255%2C255%2C0.16)%22%2F%3E%3Cpath%20d%3D%22M150%20102%20L178%20120%20L150%20138%20Z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E";
14722
+ function Rl(e, t = "") {
14723
+ let n = String(e ?? "");
14724
+ return Hr(n) && /youtu/i.test(n) ? "youtube" : Il.test(n) ? "vimeo" : String(t).startsWith("video/") || Nl.test(n) ? "video" : String(t).startsWith("image/") || Pl.test(n) ? "image" : t || Fl.test(n) ? "document" : "unknown";
14725
+ }
14726
+ var zl = /* @__PURE__ */ new Map();
14727
+ function Bl(e) {
14728
+ return zl.has(e) || zl.set(e, new Promise((t) => {
14729
+ let n = new Image();
14730
+ n.onload = () => t("image"), n.onerror = () => {
14731
+ fetch(e, { method: "HEAD" }).then((e) => t(String(e.headers.get("content-type") ?? "").startsWith("video/") ? "video" : "drop")).catch(() => t("drop"));
14732
+ }, n.src = e;
14733
+ })), zl.get(e);
14734
+ }
14735
+ function Vl(e, t = 0) {
14736
+ let [n, r] = f({}), i = e.filter((e) => e.kind === "unknown" && !(e.src in n)).map((e) => e.src).join("|");
14737
+ return c(() => {
14738
+ if (!i || typeof window > "u") return;
14739
+ let e = !0;
14740
+ return i.split("|").forEach((t) => {
14741
+ Bl(t).then((n) => e && r((e) => ({
14742
+ ...e,
14743
+ [t]: n
14744
+ })));
14745
+ }), () => {
14746
+ e = !1;
14747
+ };
14748
+ }, [i]), e.map((e) => {
14749
+ if (e.kind !== "unknown") return e;
14750
+ let t = n[e.src] ?? "image";
14751
+ return t === "drop" ? null : {
14752
+ ...e,
14753
+ kind: t,
14754
+ thumb: t === "video" ? Ul(e.src, "video", e.poster) : e.thumb
14755
+ };
14756
+ }).filter(Boolean).slice(0, Math.max(0, Number(t) || 0) || void 0).map((e, t) => ({
14757
+ ...e,
14758
+ index: t + 1
14759
+ }));
14760
+ }
14761
+ var Hl = (e) => e === "video" || e === "youtube" || e === "vimeo";
14762
+ function Ul(e, t, n) {
14763
+ return n || (t === "image" || t === "unknown" ? e : t === "youtube" ? `https://i.ytimg.com/vi/${Hr(e)}/hqdefault.jpg` : Ll);
14764
+ }
14765
+ var Wl = (e) => e == null ? "" : Wn(e), Gl = (e) => (Array.isArray(e) ? e : [e]).map((e) => e && typeof e == "object" ? {
14766
+ url: e.url ?? e.src ?? "",
14767
+ mime: e.mime ?? ""
14768
+ } : {
14769
+ url: e,
14770
+ mime: ""
14771
+ }).filter((e) => typeof e.url == "string" && e.url.trim()), Kl = (e) => {
14772
+ try {
14773
+ return decodeURIComponent(String(e).split(/[?#]/)[0].split("/").pop() ?? "");
14774
+ } catch {
14775
+ return "";
14776
+ }
14777
+ };
14778
+ function ql({ items: e, entries: t, mediaField: n, nameField: r, posterField: i, limit: a }) {
14779
+ let o = Math.max(0, Number(a) || 0), s = [], c = (e) => o && s.length >= o ? !1 : (s.push({
14780
+ ...e,
14781
+ index: s.length + 1
14782
+ }), !0);
14783
+ if (Array.isArray(t)) {
14784
+ for (let e of t) {
14785
+ if (!e || typeof e != "object") continue;
14786
+ let t = e.data ?? e, a = Wl(r ? Hn(t, r) : t.name), o = i ? Gl(Hn(t, i))[0]?.url ?? "" : "";
14787
+ for (let { url: r, mime: i } of Gl(Hn(t, n))) {
14788
+ let t = Rl(r, i);
14789
+ if (t !== "document" && !c({
14790
+ src: r,
14791
+ kind: t,
14792
+ poster: o,
14793
+ thumb: Ul(r, t, o),
14794
+ name: a,
14795
+ alt: a,
14796
+ entry: e
14797
+ })) return s;
14798
+ }
14799
+ }
14800
+ return s;
14801
+ }
14802
+ for (let t of Array.isArray(e) ? e : []) {
14803
+ if (!t || typeof t != "object" || !t.src) continue;
14804
+ let e = Rl(t.src, t.mime), n = t.name || "";
14805
+ if (e !== "document" && !c({
14806
+ src: t.src,
14807
+ kind: e,
14808
+ poster: t.poster,
14809
+ thumb: Ul(t.src, e, t.poster),
14810
+ name: n,
14811
+ alt: t.alt || n,
14812
+ entry: null
14813
+ })) break;
14814
+ }
14815
+ return s;
14816
+ }
14817
+ function Jl(e) {
14818
+ let t = e.entry && typeof e.entry == "object" ? e.entry : { id: `item-${e.index}` };
14819
+ return {
14820
+ ...t,
14821
+ data: {
14822
+ ...t.data ?? {},
14823
+ src: e.src,
14824
+ thumb: e.thumb,
14825
+ name: e.name || Kl(e.src),
14826
+ kind: Hl(e.kind) ? "video" : "image",
14827
+ index: e.index
14828
+ }
14829
+ };
14830
+ }
14831
+ function Yl({ item: e }) {
14832
+ return /* @__PURE__ */ _("span", {
14833
+ ...Z("tile-media"),
14834
+ style: {
14835
+ position: "relative",
14836
+ display: "block",
14837
+ borderRadius: "inherit",
14838
+ overflow: "hidden"
14839
+ },
14840
+ children: [/* @__PURE__ */ g("img", {
14841
+ ...Z("thumb"),
14842
+ src: e.thumb,
14843
+ alt: e.alt || "",
14844
+ loading: "lazy",
14845
+ style: {
14846
+ display: "block",
14847
+ width: "100%",
14848
+ aspectRatio: "1 / 1",
14849
+ objectFit: "cover",
14850
+ borderRadius: "inherit"
14851
+ }
14852
+ }), Hl(e.kind) && /* @__PURE__ */ g(Xl, {})]
14853
+ });
14854
+ }
14855
+ function Xl() {
14856
+ return /* @__PURE__ */ g("span", {
14857
+ ...Z("play"),
14858
+ "aria-hidden": "true",
14859
+ style: {
14860
+ position: "absolute",
14861
+ left: "50%",
14862
+ top: "50%",
14863
+ width: 44,
14864
+ height: 44,
14865
+ marginLeft: -22,
14866
+ marginTop: -22,
14867
+ borderRadius: "50%",
14868
+ background: "rgba(0, 0, 0, 0.55)",
14869
+ display: "flex",
14870
+ alignItems: "center",
14871
+ justifyContent: "center",
14872
+ pointerEvents: "none"
14873
+ },
14874
+ children: /* @__PURE__ */ g("svg", {
14875
+ width: "18",
14876
+ height: "18",
14877
+ viewBox: "0 0 24 24",
14878
+ fill: "#fff",
14879
+ children: /* @__PURE__ */ g("path", { d: "M8 5v14l11-7z" })
14880
+ })
14881
+ });
14882
+ }
14883
+ function Zl({ item: e, autoplay: t }) {
14884
+ let n = {
14885
+ maxWidth: "92vw",
14886
+ maxHeight: "80vh",
14887
+ borderRadius: 8,
14888
+ boxShadow: "0 12px 48px rgba(0,0,0,0.5)",
14889
+ display: "block"
14890
+ };
14891
+ if (e.kind === "youtube" || e.kind === "vimeo") {
14892
+ let r = e.kind === "youtube" ? `https://www.youtube-nocookie.com/embed/${Hr(e.src)}?rel=0${t ? "&autoplay=1" : ""}` : `https://player.vimeo.com/video/${e.src.match(Il)?.[1]}${t ? "?autoplay=1" : ""}`;
14893
+ return /* @__PURE__ */ g("iframe", {
14894
+ ...Z("media"),
14895
+ src: r,
14896
+ title: e.name || "Video",
14897
+ allow: "autoplay; encrypted-media; fullscreen; picture-in-picture",
14898
+ allowFullScreen: !0,
14899
+ style: {
14900
+ ...n,
14901
+ width: "min(92vw, calc(80vh * 16 / 9))",
14902
+ aspectRatio: "16 / 9",
14903
+ border: 0,
14904
+ background: "#000"
14905
+ }
14906
+ });
14907
+ }
14908
+ return e.kind === "video" ? /* @__PURE__ */ g("video", {
14909
+ ...Z("media"),
14910
+ src: e.src,
14911
+ poster: e.thumb === Ll ? void 0 : e.thumb,
14912
+ controls: !0,
14913
+ autoPlay: t,
14914
+ playsInline: !0,
14915
+ style: {
14916
+ ...n,
14917
+ background: "#000"
14918
+ }
14919
+ }) : /* @__PURE__ */ g("img", {
14920
+ ...Z("media"),
14921
+ src: e.src,
14922
+ alt: e.alt || "",
14923
+ style: n
14924
+ });
14925
+ }
14926
+ var Ql = {
14927
+ position: "absolute",
14928
+ top: "50%",
14929
+ transform: "translateY(-50%)",
14930
+ width: 48,
14931
+ height: 48,
14932
+ borderRadius: "50%",
14933
+ border: 0,
14934
+ background: "rgba(255, 255, 255, 0.12)",
14935
+ color: "inherit",
14936
+ cursor: "pointer",
14937
+ display: "flex",
14938
+ alignItems: "center",
14939
+ justifyContent: "center"
14940
+ };
14941
+ function $l({ list: e, index: t, onIndex: n, onClose: r, options: i, locale: a }) {
14942
+ let o = $e(a), { loop: s = !0, caption: l = !0, counter: u = !0, thumbs: f = !1, backdrop: p = "", color: m = "", autoplay: v = !0 } = i, y = e[t], b = d(null), x = e.length, S = s || t > 0, C = s || t < x - 1, w = (e) => n((t) => {
14943
+ let n = t + e;
14944
+ return s ? (n + x) % x : Math.min(Math.max(n, 0), x - 1);
14945
+ });
14946
+ if (c(() => {
14947
+ let e = (e) => {
14948
+ e.key === "Escape" && r(), e.key === "ArrowRight" && w(1), e.key === "ArrowLeft" && w(-1);
14949
+ }, t = document.body, n = t.style.overflow;
14950
+ return window.addEventListener("keydown", e), t.style.overflow = "hidden", b.current?.focus(), () => {
14951
+ window.removeEventListener("keydown", e), t.style.overflow = n;
14952
+ };
14953
+ }, [x, s]), !y) return null;
14954
+ let T = (e) => e.stopPropagation(), E = y.name || Kl(y.src);
14955
+ return /* @__PURE__ */ _("div", {
14956
+ ...Z("backdrop"),
14957
+ role: "dialog",
14958
+ "aria-modal": "true",
14959
+ "aria-label": o("gallery"),
14960
+ onClick: r,
14961
+ style: {
14962
+ position: "fixed",
14963
+ inset: 0,
14964
+ zIndex: 2147483e3,
14965
+ background: p || "rgba(0, 0, 0, 0.88)",
14966
+ color: m || "#fff",
14967
+ display: "flex",
14968
+ flexDirection: "column",
14969
+ alignItems: "center",
14970
+ justifyContent: "center",
14971
+ padding: 24,
14972
+ gap: 12
14973
+ },
14974
+ children: [
14975
+ /* @__PURE__ */ g("div", {
14976
+ ...Z("stage"),
14977
+ onClick: T,
14978
+ style: {
14979
+ display: "flex",
14980
+ alignItems: "center",
14981
+ justifyContent: "center"
14982
+ },
14983
+ children: /* @__PURE__ */ g(Zl, {
14984
+ item: y,
14985
+ autoplay: v
14986
+ }, t)
14987
+ }),
14988
+ (l && E || u && x > 1) && /* @__PURE__ */ _("div", {
14989
+ onClick: T,
14990
+ style: {
14991
+ display: "flex",
14992
+ gap: 12,
14993
+ alignItems: "baseline",
14994
+ fontSize: 14
14995
+ },
14996
+ children: [l && E && /* @__PURE__ */ g("span", {
14997
+ ...Z("caption"),
14998
+ style: { opacity: .9 },
14999
+ children: E
15000
+ }), u && x > 1 && /* @__PURE__ */ g("span", {
15001
+ ...Z("counter"),
15002
+ style: {
15003
+ opacity: .6,
15004
+ fontVariantNumeric: "tabular-nums"
15005
+ },
15006
+ children: o("itemOf", {
15007
+ n: t + 1,
15008
+ total: x
15009
+ })
15010
+ })]
15011
+ }),
15012
+ f && x > 1 && /* @__PURE__ */ g("div", {
15013
+ ...Z("thumbs"),
15014
+ onClick: T,
15015
+ style: {
15016
+ display: "flex",
15017
+ gap: 6,
15018
+ maxWidth: "92vw",
15019
+ overflowX: "auto",
15020
+ padding: 4
15021
+ },
15022
+ children: e.map((e, r) => /* @__PURE__ */ g("button", {
15023
+ type: "button",
15024
+ ...Z("thumb-button", r === t && "thumb-button-active"),
15025
+ "aria-label": o("itemOf", {
15026
+ n: r + 1,
15027
+ total: x
15028
+ }),
15029
+ "aria-current": r === t || void 0,
15030
+ onClick: () => n(r),
15031
+ style: {
15032
+ flexShrink: 0,
15033
+ padding: 0,
15034
+ border: `2px solid ${r === t ? "currentColor" : "transparent"}`,
15035
+ borderRadius: 6,
15036
+ background: "none",
15037
+ cursor: "pointer",
15038
+ opacity: r === t ? 1 : .6
15039
+ },
15040
+ children: /* @__PURE__ */ g("img", {
15041
+ src: e.thumb,
15042
+ alt: "",
15043
+ style: {
15044
+ display: "block",
15045
+ width: 56,
15046
+ height: 42,
15047
+ objectFit: "cover",
15048
+ borderRadius: 4
15049
+ }
15050
+ })
15051
+ }, r))
15052
+ }),
15053
+ /* @__PURE__ */ g("button", {
15054
+ ref: b,
15055
+ type: "button",
15056
+ ...Z("close-button"),
15057
+ "aria-label": o("close"),
15058
+ onClick: r,
15059
+ style: {
15060
+ position: "absolute",
15061
+ top: 16,
15062
+ right: 16,
15063
+ width: 44,
15064
+ height: 44,
15065
+ borderRadius: "50%",
15066
+ border: 0,
15067
+ background: "rgba(255, 255, 255, 0.12)",
15068
+ color: "inherit",
15069
+ cursor: "pointer",
15070
+ fontSize: 24,
15071
+ lineHeight: 1
15072
+ },
15073
+ children: "×"
15074
+ }),
15075
+ x > 1 && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("button", {
15076
+ type: "button",
15077
+ ...Z("arrow", "arrow-prev"),
15078
+ "aria-label": o("prevItem"),
15079
+ disabled: !S,
15080
+ onClick: (e) => {
15081
+ T(e), w(-1);
15082
+ },
15083
+ style: {
15084
+ ...Ql,
15085
+ left: 16,
15086
+ opacity: S ? 1 : .3
15087
+ },
15088
+ children: /* @__PURE__ */ g("svg", {
15089
+ width: "22",
15090
+ height: "22",
15091
+ viewBox: "0 0 24 24",
15092
+ fill: "none",
15093
+ stroke: "currentColor",
15094
+ strokeWidth: "2.2",
15095
+ strokeLinecap: "round",
15096
+ strokeLinejoin: "round",
15097
+ children: /* @__PURE__ */ g("path", { d: "M15 18l-6-6 6-6" })
15098
+ })
15099
+ }), /* @__PURE__ */ g("button", {
15100
+ type: "button",
15101
+ ...Z("arrow", "arrow-next"),
15102
+ "aria-label": o("nextItem"),
15103
+ disabled: !C,
15104
+ onClick: (e) => {
15105
+ T(e), w(1);
15106
+ },
15107
+ style: {
15108
+ ...Ql,
15109
+ right: 16,
15110
+ opacity: C ? 1 : .3
15111
+ },
15112
+ children: /* @__PURE__ */ g("svg", {
15113
+ width: "22",
15114
+ height: "22",
15115
+ viewBox: "0 0 24 24",
15116
+ fill: "none",
15117
+ stroke: "currentColor",
15118
+ strokeWidth: "2.2",
15119
+ strokeLinecap: "round",
15120
+ strokeLinejoin: "round",
15121
+ children: /* @__PURE__ */ g("path", { d: "M9 18l6-6-6-6" })
15122
+ })
15123
+ })] })
15124
+ ]
15125
+ });
15126
+ }
15127
+ function eu(e, t, n) {
15128
+ let [r, i] = f(null);
15129
+ return {
15130
+ open: i,
15131
+ overlay: r !== null && e[r] && typeof document < "u" ? m(/* @__PURE__ */ g($l, {
15132
+ list: e,
15133
+ index: r,
15134
+ onIndex: i,
15135
+ onClose: () => i(null),
15136
+ options: t,
15137
+ locale: n
15138
+ }), document.body) : null
15139
+ };
15140
+ }
15141
+ function tu(e, t, n) {
15142
+ return {
15143
+ role: "button",
15144
+ tabIndex: 0,
15145
+ "aria-label": $e(n)("openItem", { name: t }),
15146
+ onClick: (t) => {
15147
+ t.target?.closest?.("a[href]") || e();
15148
+ },
15149
+ onKeyDown: (t) => {
15150
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), e());
15151
+ }
15152
+ };
15153
+ }
15154
+ function nu(e) {
15155
+ let { tenant: t, apiUrl: n, revision: r, locale: i } = s(X), a = s(An)?.[e], [o, l] = f(null);
15156
+ return c(() => {
15157
+ if (!e || a) return;
15158
+ let r = !0, o = new URLSearchParams({
15159
+ all: "1",
15160
+ ...i ? { locale: i } : {}
15161
+ });
15162
+ return fetch(`${n}/dynamic/${encodeURIComponent(e)}?${o}`, { headers: t ? { "x-tenant": t } : {} }).then((e) => e.json()).then((e) => {
15163
+ let t = Array.isArray(e?.payload) ? e.payload : Array.isArray(e?.payload?.data) ? e.payload.data : [];
15164
+ r && l(t.filter((e) => e && typeof e == "object"));
15165
+ }).catch(() => r && l([])), () => {
15166
+ r = !1;
15167
+ };
15168
+ }, [
15169
+ r,
15170
+ e,
15171
+ t,
15172
+ n,
15173
+ i,
15174
+ a
15175
+ ]), e ? a ?? o : null;
15176
+ }
15177
+ var ru = (e, t) => t ? e.filter((e) => e?.id === t || e?.data?.slug === t || e?.slug === t) : e, iu = (e, t) => ({
15178
+ display: "grid",
15179
+ gridTemplateColumns: `repeat(${Math.min(Math.max(Number(e) || 4, 1), 8)}, minmax(0, 1fr))`,
15180
+ gap: t === "" || t == null || !Number.isFinite(Number(t)) ? 12 : Math.max(0, Number(t))
15181
+ }), au = (e) => ({
15182
+ loop: e.loop !== !1,
15183
+ caption: e.caption !== !1,
15184
+ counter: e.counter !== !1,
15185
+ thumbs: !!e.thumbs,
15186
+ autoplay: e.autoplay !== !1,
15187
+ backdrop: e.backdrop || "",
15188
+ color: e.color || ""
15189
+ });
15190
+ function ou(e) {
15191
+ let { items: t = [], source: n = "", entry: r = "", mediaField: i = "", nameField: a = "", posterField: o = "", limit: c = 0, emptyText: l = "", columns: u = 4, gap: d = "", templateId: f, renderTemplate: p, style: m, nodeRef: v, inert: y } = e, { locale: b } = s(X), x = s(Pn), S = s(Fn), C = nu(n), w = Vl(ql({
15192
+ items: t,
15193
+ entries: n ? ru(C ?? [], r) : null,
15194
+ mediaField: i,
15195
+ nameField: a,
15196
+ posterField: o
15197
+ }), c), { open: T, overlay: E } = eu(w, au(e), b), D = p ?? (f && x?.render ? (e) => x.render(f, e) : null), O = !!n && C === null;
15198
+ return /* @__PURE__ */ _("div", {
15199
+ ref: v,
15200
+ ...Z("grid"),
15201
+ style: {
15202
+ width: "100%",
15203
+ ...iu(u, d),
15204
+ ...q(m)
15205
+ },
15206
+ children: [
15207
+ w.map((t) => {
15208
+ let n = Jl(t);
15209
+ return /* @__PURE__ */ g("div", {
15210
+ ...Z("item", Hl(t.kind) && "item-video"),
15211
+ ...y ? null : tu(() => T(t.index - 1), n.data.name, b),
15212
+ style: {
15213
+ minWidth: 0,
15214
+ position: "relative",
15215
+ cursor: y ? void 0 : "zoom-in"
15216
+ },
15217
+ children: D ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(Fn.Provider, {
15218
+ value: {
15219
+ ...S ?? {},
15220
+ entry: n
15221
+ },
15222
+ children: D((e) => Zn(e, n, b))
15223
+ }), e.playMark !== !1 && Hl(t.kind) && /* @__PURE__ */ g(Xl, {})] }) : /* @__PURE__ */ g(Yl, { item: t })
15224
+ }, `${t.index}-${t.src}`);
15225
+ }),
15226
+ !w.length && !O && (n ? l : null) && /* @__PURE__ */ g("div", {
15227
+ ...Z("empty"),
15228
+ style: {
15229
+ gridColumn: "1 / -1",
15230
+ padding: "24px 12px",
15231
+ fontSize: 13,
15232
+ opacity: .55,
15233
+ textAlign: "center"
15234
+ },
15235
+ children: l
15236
+ }),
15237
+ E
15238
+ ]
15239
+ });
15240
+ }
15241
+ var su = { LightboxGallery: ou }, cu = /* @__PURE__ */ new Map();
15242
+ function lu(e) {
15243
+ if (cu.has(e)) return cu.get(e);
14712
15244
  let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
14713
15245
  /* @vite-ignore */
14714
15246
  /* webpackIgnore: true */
14715
15247
  t
14716
15248
  ).finally(() => URL.revokeObjectURL(t));
14717
- return Nl.set(e, n), n;
15249
+ return cu.set(e, n), n;
14718
15250
  }
14719
- function Fl(e) {
15251
+ function uu(e) {
14720
15252
  let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
14721
15253
  return n && typeof n == "object" ? n : {};
14722
15254
  }
14723
15255
  //#endregion
14724
15256
  //#region ../ui/src/components/builder/plugins/view.jsx
14725
- async function Il(e, t) {
14726
- let n = await Pl(e);
15257
+ async function du(e, t) {
15258
+ let n = await lu(e);
14727
15259
  return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
14728
15260
  }
14729
- var Ll = {
15261
+ var fu = {
14730
15262
  padding: "10px 12px",
14731
15263
  border: "1px dashed rgba(148, 163, 184, 0.5)",
14732
15264
  borderRadius: 8,
14733
15265
  fontSize: 12,
14734
15266
  opacity: .6
14735
15267
  };
14736
- function Rl({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
14737
- let a = s(X), o = Fl(a?.settings)[e], l = d(null), u = d(null), f = {
15268
+ function pu({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
15269
+ let a = s(X), o = uu(a?.settings)[e], l = d(null), u = d(null), f = {
14738
15270
  tenant: a?.tenant ?? "",
14739
15271
  apiUrl: a?.apiUrl ?? "/api",
14740
15272
  locale: a?.locale ?? "",
@@ -14746,7 +15278,7 @@ function Rl({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
14746
15278
  let e = l.current;
14747
15279
  if (!o?.code || !e) return;
14748
15280
  let n = !0;
14749
- return Il(o.code, t).then((e) => {
15281
+ return du(o.code, t).then((e) => {
14750
15282
  if (!(!n || !e || !l.current)) {
14751
15283
  u.current = e;
14752
15284
  try {
@@ -14776,7 +15308,7 @@ function Rl({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
14776
15308
  }) : /* @__PURE__ */ _("div", {
14777
15309
  ref: i,
14778
15310
  style: {
14779
- ...Ll,
15311
+ ...fu,
14780
15312
  ...q(r)
14781
15313
  },
14782
15314
  children: [
@@ -14788,7 +15320,7 @@ function Rl({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
14788
15320
  }
14789
15321
  //#endregion
14790
15322
  //#region ../ui/src/components/builder/render.jsx
14791
- function zl(e, t, n) {
15323
+ function mu(e, t, n) {
14792
15324
  let r = { "data-wb": e };
14793
15325
  t.htmlId && (r.id = t.htmlId), n && n.id === e && (r.id = t.htmlId || n.htmlId, r.tabIndex = -1);
14794
15326
  let i = ae(t.classNames);
@@ -14802,7 +15334,7 @@ function zl(e, t, n) {
14802
15334
  classes: i
14803
15335
  };
14804
15336
  }
14805
- function Bl({ View: e, markup: t, ...r }) {
15337
+ function hu({ View: e, markup: t, ...r }) {
14806
15338
  let i = e(r);
14807
15339
  if (!a(i) || typeof i.type != "string") return i;
14808
15340
  let o = [i.props.className, ...t.classes].filter(Boolean).join(" ");
@@ -14811,56 +15343,61 @@ function Bl({ View: e, markup: t, ...r }) {
14811
15343
  ...o ? { className: o } : {}
14812
15344
  });
14813
15345
  }
14814
- var Vl = /* @__PURE__ */ new Set([
15346
+ var gu = /* @__PURE__ */ new Set([
14815
15347
  "FormInput",
14816
15348
  "FormTextarea",
14817
15349
  "FormSelect"
14818
15350
  ]);
14819
- function Hl(e, t, n, r) {
15351
+ function _u(e, t, n, r) {
14820
15352
  if (t.forNode === "__none") return "";
14821
15353
  let i = t.forNode ? n[t.forNode] : null;
14822
15354
  if (!t.forNode) {
14823
15355
  let t = n[r]?.nodes ?? [];
14824
15356
  i = n[t[t.indexOf(e) + 1]] ?? null;
14825
15357
  }
14826
- return !i || !Vl.has(i.type?.resolvedName) ? "" : i.props?.htmlId || $i(i.props?.name) || "";
15358
+ return !i || !gu.has(i.type?.resolvedName) ? "" : i.props?.htmlId || $i(i.props?.name) || "";
14827
15359
  }
14828
- var Ul = "slot-", Wl = {
15360
+ var vu = "slot-", yu = {
14829
15361
  ...To,
14830
15362
  ...jc,
14831
15363
  ...pl,
14832
15364
  ...Ml,
14833
- PluginBlock: Rl
15365
+ ...su,
15366
+ PluginBlock: pu
14834
15367
  };
14835
- function Gl(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
15368
+ function bu(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
14836
15369
  let o = n[e];
14837
15370
  if (!o || o.hidden) return null;
14838
15371
  let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
14839
15372
  if (s === "ComponentInstance") {
14840
15373
  let s = o.props?.componentId, l = r?.[s];
14841
15374
  if (!l?.template || i.has(s)) return null;
14842
- let u = new Set(i).add(s), d = Object.fromEntries(Object.entries(o.linkedNodes ?? {}).filter(([e]) => e.startsWith(Ul)).map(([e, t]) => [e.slice(5), Gl(t, n, r, i, a)]));
14843
- return /* @__PURE__ */ g(t, { children: Gl(l.template.rootId, l.template.nodes, r, u, {
15375
+ let u = new Set(i).add(s), d = Object.fromEntries(Object.entries(o.linkedNodes ?? {}).filter(([e]) => e.startsWith(vu)).map(([e, t]) => [e.slice(5), bu(t, n, r, i, a)]));
15376
+ return /* @__PURE__ */ g(t, { children: bu(l.template.rootId, l.template.nodes, r, u, {
14844
15377
  ...pt(c.values, a),
14845
15378
  slots: d
14846
15379
  }) }, e);
14847
15380
  }
14848
- let l = Wl[s];
15381
+ let l = yu[s];
14849
15382
  if (!l) return null;
14850
- let u = c.compSlot?.id, d = u && a?.slots && Object.hasOwn(a.slots, u) ? a.slots[u] : void 0, f = d === void 0 ? (o.nodes ?? []).map((e) => Gl(e, n, r, i, a)).filter(Boolean) : [d].filter(Boolean), p = Object.entries(o.linkedNodes ?? {}), m = p.length ? Object.fromEntries(p.map(([e, t]) => [e, Gl(t, n, r, i, a)])) : void 0, h = /* @__PURE__ */ g(typeof l == "function" ? Bl : l, {
15383
+ let u = c.compSlot?.id, d = u && a?.slots && Object.hasOwn(a.slots, u) ? a.slots[u] : void 0, f = d === void 0 ? (o.nodes ?? []).map((e) => bu(e, n, r, i, a)).filter(Boolean) : [d].filter(Boolean), p = Object.entries(o.linkedNodes ?? {}), m = p.length ? Object.fromEntries(p.map(([e, t]) => [e, bu(t, n, r, i, a)])) : void 0, h = /* @__PURE__ */ g(typeof l == "function" ? hu : l, {
14851
15384
  ...typeof l == "function" ? {
14852
15385
  View: l,
14853
- markup: zl(e, c, a?.skipTarget)
15386
+ markup: mu(e, c, a?.skipTarget)
14854
15387
  } : null,
14855
15388
  ...c,
14856
15389
  ...s === "CollectionList" ? {
14857
15390
  templateId: o.linkedNodes?.card,
14858
- renderTemplate: o.linkedNodes?.card ? (e) => Gl(o.linkedNodes.card, n, r, i, {
15391
+ renderTemplate: o.linkedNodes?.card ? (e) => bu(o.linkedNodes.card, n, r, i, {
14859
15392
  ...a,
14860
15393
  mapProps: a?.mapProps ? (t, n) => a.mapProps(e(t, n), n) : e
14861
15394
  }) : void 0
14862
15395
  } : null,
14863
- ...s === "FormLabel" ? { htmlFor: Hl(e, c, n, o.parent) } : null,
15396
+ ...s === "LightboxGallery" && o.linkedNodes?.item ? { renderTemplate: (e) => bu(o.linkedNodes.item, n, r, i, {
15397
+ ...a,
15398
+ mapProps: a?.mapProps ? (t, n) => a.mapProps(e(t, n), n) : e
15399
+ }) } : null,
15400
+ ...s === "FormLabel" ? { htmlFor: _u(e, c, n, o.parent) } : null,
14864
15401
  linked: m,
14865
15402
  nodeRef: (t) => {
14866
15403
  t && (t.setAttribute("data-wb", e), pe(t, c), a?.skipTarget?.id === e && (t.id = c.htmlId || a.skipTarget.htmlId, t.tabIndex = -1), fe(t, a?.events === !1 ? [] : c.events));
@@ -14877,9 +15414,9 @@ function Gl(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
14877
15414
  }
14878
15415
  //#endregion
14879
15416
  //#region ../ui/src/components/builder/PageRenderer.jsx
14880
- var Kl = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), ql = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(ze(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
15417
+ var xu = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Su = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(ze(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
14881
15418
  .webim-page[data-webim-mode="dark"] { ${Object.entries(ze(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
14882
- function Jl({ 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: v, param: y }) {
15419
+ function Cu({ 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: v, param: y }) {
14883
15420
  let x = a?.js?.trim(), S = m && m["site.code"] && typeof m["site.code"] == "object" ? m["site.code"] : null, C = typeof S?.js == "string" ? S.js.trim() : "", w = typeof S?.css == "string" ? S.css.trim() : "";
14884
15421
  if (c(() => {
14885
15422
  if (!C) return;
@@ -14897,15 +15434,15 @@ function Jl({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
14897
15434
  minHeight: "100%",
14898
15435
  display: "flex",
14899
15436
  flexDirection: "column"
14900
- }, A = ct(e, n), j = Gl("ROOT", e, n, void 0, A ? { skipTarget: A } : void 0), M = A ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("style", { children: nt }), /* @__PURE__ */ g("a", {
15437
+ }, A = ct(e, n), j = bu("ROOT", e, n, void 0, A ? { skipTarget: A } : void 0), M = A ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("style", { children: nt }), /* @__PURE__ */ g("a", {
14901
15438
  className: "webim-skip",
14902
15439
  href: `#${A.htmlId}`,
14903
15440
  children: $e(f || m?.locales?.default)("skip")
14904
- })] }) : null, N = u(() => ({ render: (t, r) => Gl(t, e, n, void 0, { mapProps: r }) }), [e, n]), P = De(e, n), F = J(e, n), I = a?.css?.trim(), L = G(o), R = Re(t), z = [R.font, R.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !Fe[e]), B = [.../* @__PURE__ */ new Set([...O(e, n), ...z])].map((e) => /* @__PURE__ */ g("link", {
15441
+ })] }) : null, N = u(() => ({ render: (t, r) => bu(t, e, n, void 0, { mapProps: r }) }), [e, n]), P = De(e, n), F = J(e, n), I = a?.css?.trim(), L = G(o), R = Re(t), z = [R.font, R.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !Fe[e]), B = [.../* @__PURE__ */ new Set([...O(e, n), ...z])].map((e) => /* @__PURE__ */ g("link", {
14905
15442
  rel: "stylesheet",
14906
15443
  precedence: "default",
14907
15444
  href: T(e)
14908
- }, e)), V = ql(R), H = We(t);
15445
+ }, e)), V = Su(R), H = We(t);
14909
15446
  return r === "auto" ? /* @__PURE__ */ g(X.Provider, {
14910
15447
  value: {
14911
15448
  tenant: s || "",
@@ -14930,8 +15467,8 @@ function Jl({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
14930
15467
  },
14931
15468
  children: [
14932
15469
  M,
14933
- /* @__PURE__ */ g("style", { children: `.webim-page { ${Kl(ze(R.light))} }
14934
- @media (prefers-color-scheme: dark) { .webim-page { ${Kl(ze(R.dark))} } }` }),
15470
+ /* @__PURE__ */ g("style", { children: `.webim-page { ${xu(ze(R.light))} }
15471
+ @media (prefers-color-scheme: dark) { .webim-page { ${xu(ze(R.dark))} } }` }),
14935
15472
  /* @__PURE__ */ g("style", { children: V }),
14936
15473
  B,
14937
15474
  /* @__PURE__ */ g("style", { children: D }),
@@ -14990,8 +15527,8 @@ function Jl({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
14990
15527
  }
14991
15528
  //#endregion
14992
15529
  //#region src/WebimContent.jsx
14993
- function Yl({ bundle: e, mode: t = "auto", style: n }) {
14994
- return e?.blocks?.ROOT ? /* @__PURE__ */ g(Jl, {
15530
+ function wu({ bundle: e, mode: t = "auto", style: n }) {
15531
+ return e?.blocks?.ROOT ? /* @__PURE__ */ g(Cu, {
14995
15532
  blocks: e.blocks,
14996
15533
  theme: e.theme,
14997
15534
  components: e.components,
@@ -15010,34 +15547,35 @@ function Yl({ bundle: e, mode: t = "auto", style: n }) {
15010
15547
  }
15011
15548
  //#endregion
15012
15549
  //#region src/fetchPage.js
15013
- var Xl = async (e) => {
15550
+ var Tu = async (e) => {
15014
15551
  let t = await e.json().catch(() => null);
15015
15552
  if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
15016
15553
  return t?.payload ?? t;
15017
15554
  };
15018
- async function Zl({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
15555
+ async function Eu({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
15019
15556
  if (!e) throw Error("fetchPage: apiUrl is required");
15020
15557
  if (!n) throw Error("fetchPage: slug is required");
15021
15558
  let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
15022
15559
  ...t ? { "x-tenant": t } : {},
15023
15560
  ...a ? { authorization: `Bearer ${a}` } : {}
15024
- }, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(Xl), c(`${l}/settings/public`, { headers: u }).then(Xl)]), p = Xe({
15561
+ }, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(Tu), c(`${l}/settings/public`, { headers: u }).then(Tu)]), p = Xe({
15025
15562
  page: d,
15026
15563
  settings: f,
15027
15564
  tenant: t,
15028
15565
  apiUrl: l,
15029
15566
  locale: r
15030
- }), m = [...new Set(Ql(p.blocks, p.components).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : [
15567
+ }), m = [...new Set(Du(p.blocks, p.components).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : [
15031
15568
  "TableBlock",
15032
15569
  "OrgChartBlock",
15033
15570
  "NavbarBlock",
15034
15571
  "MenuTreeBlock",
15035
15572
  "CalendarBlock",
15036
15573
  "MasonryBlock",
15574
+ "LightboxGallery",
15037
15575
  "LogoCarousel"
15038
15576
  ].includes(e?.type?.resolvedName) ? e.props?.source : null).filter(Boolean))];
15039
15577
  if (m.length) {
15040
- 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(Xl).then((e) => {
15578
+ 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(Tu).then((e) => {
15041
15579
  let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
15042
15580
  return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
15043
15581
  }).catch(() => [[t, []]])));
@@ -15049,7 +15587,7 @@ async function Zl({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
15049
15587
  __page: Math.floor(h)
15050
15588
  }), p;
15051
15589
  }
15052
- function Ql(e, t) {
15590
+ function Du(e, t) {
15053
15591
  let n = [], r = /* @__PURE__ */ new Set(), i = (e) => {
15054
15592
  Object.values(e ?? {}).forEach((e) => {
15055
15593
  n.push(e);
@@ -15061,41 +15599,41 @@ function Ql(e, t) {
15061
15599
  }
15062
15600
  //#endregion
15063
15601
  //#region src/ssr.jsx
15064
- var $l = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
15602
+ var Ou = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
15065
15603
  "&": "&amp;",
15066
15604
  "<": "&lt;",
15067
15605
  ">": "&gt;",
15068
15606
  "\"": "&quot;"
15069
15607
  })[e]);
15070
- function eu(t, { mode: n = "auto", style: r } = {}) {
15071
- return e(/* @__PURE__ */ g(Yl, {
15608
+ function ku(t, { mode: n = "auto", style: r } = {}) {
15609
+ return e(/* @__PURE__ */ g(wu, {
15072
15610
  bundle: t,
15073
15611
  mode: n,
15074
15612
  style: r
15075
15613
  }));
15076
15614
  }
15077
- function tu(e, { mode: t = "auto", lang: n } = {}) {
15615
+ function Au(e, { mode: t = "auto", lang: n } = {}) {
15078
15616
  let r = e.seo ?? {}, i = n || e.locale || "en", a = b(e.direction, i), o = Ze(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 = [
15079
15617
  "<meta charset=\"utf-8\"/>",
15080
15618
  "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>",
15081
- `<title>${$l(o)}</title>`,
15082
- r.description && `<meta name="description" content="${$l(r.description)}"/>`,
15083
- `<meta property="og:title" content="${$l(o)}"/>`,
15084
- r.image && `<meta property="og:image" content="${$l(r.image)}"/>`,
15619
+ `<title>${Ou(o)}</title>`,
15620
+ r.description && `<meta name="description" content="${Ou(r.description)}"/>`,
15621
+ `<meta property="og:title" content="${Ou(o)}"/>`,
15622
+ r.image && `<meta property="og:image" content="${Ou(r.image)}"/>`,
15085
15623
  r.noindex && "<meta name=\"robots\" content=\"noindex\"/>",
15086
15624
  "<style>html,body{margin:0;height:100%}</style>"
15087
15625
  ].filter(Boolean).join("\n");
15088
15626
  return `<!doctype html>
15089
- <html lang="${$l(i)}"${a ? ` dir="${a}"` : ""}>
15627
+ <html lang="${Ou(i)}"${a ? ` dir="${a}"` : ""}>
15090
15628
  <head>
15091
15629
  ${d}
15092
15630
  </head>
15093
15631
  <body>
15094
- ${eu(e, { mode: t })}
15632
+ ${ku(e, { mode: t })}
15095
15633
  ${l ? u(l) : ""}
15096
15634
  ${s ? u(s) : ""}
15097
15635
  </body>
15098
15636
  </html>`;
15099
15637
  }
15100
15638
  //#endregion
15101
- export { Xe as assembleBundle, Ze as documentTitle, Zl as fetchPage, eu as renderBundleHtml, tu as renderPageDocument };
15639
+ export { Xe as assembleBundle, Ze as documentTitle, Eu as fetchPage, ku as renderBundleHtml, Au as renderPageDocument };