@llmnative/react 1.46.0 → 1.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -3042,7 +3042,16 @@ var Pn = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10
3042
3042
  back: "Back",
3043
3043
  submit: "Submit",
3044
3044
  noAnswer: "No answer",
3045
- answered: "Answered"
3045
+ answered: "Answered",
3046
+ activityCount: "{count} steps",
3047
+ activityFailed: "{count} failed",
3048
+ activityCommands: "Commands",
3049
+ activityHide: "Hide",
3050
+ activityLog: "Whole log",
3051
+ activitySteps: "Steps view",
3052
+ activityFiles: "{count} files changed",
3053
+ activityChanges: "See the changes",
3054
+ activityEmpty: "Nothing yet"
3046
3055
  },
3047
3056
  charts: {
3048
3057
  noData: "No data",
@@ -4288,7 +4297,7 @@ var Hi = "rounded-lg border border-border bg-card text-card-foreground shadow-sm
4288
4297
  }))
4289
4298
  }, e);
4290
4299
  }, sa = ({ menuKey: e, as: t = "ul", badges: n = {}, before: r = void 0, after: i = void 0, wrapperClassName: a = void 0, className: o = void 0, headerClassName: s = void 0, itemClassName: c = void 0, linkClassName: l = void 0, iconClassName: u = void 0, textClassName: d = void 0, badgeClassName: p = void 0, arrowClassName: m = void 0, submenuClassName: h = void 0 }) => {
4291
- let g = Kv(e), _ = J("menu"), v = ({ item: e, index: r }) => {
4300
+ let g = Jv(e), _ = J("menu"), v = ({ item: e, index: r }) => {
4292
4301
  let [i, a] = E(e.active);
4293
4302
  b(() => {
4294
4303
  a(e.active);
@@ -15186,7 +15195,7 @@ function Gp({ columns: e = void 0, records: t = void 0, footer: n = void 0, onRo
15186
15195
  width: "1%",
15187
15196
  whiteSpace: "nowrap"
15188
15197
  }
15189
- }))), Pe = /* @__PURE__ */ f.createElement(mg, {
15198
+ }))), Pe = /* @__PURE__ */ f.createElement(gg, {
15190
15199
  records: xe,
15191
15200
  appendTo: ee,
15192
15201
  wrapperClassName: "px-3 pt-4 pb-2",
@@ -16220,7 +16229,7 @@ function jm({ group: e, expanded: t, openItems: n, showIcons: r, onToggle: i })
16220
16229
  }))));
16221
16230
  }
16222
16231
  function Mm({ menuKey: e, items: t, bottomItems: n = [], defaultCollapsed: r = !1, collapsed: i, onCollapsedChange: a, showIcons: o = !0, showCollapseButton: s = !0, footer: c, header: l, embedded: u = !1 }) {
16223
- let { pathname: d } = M(), p = J("sideNav"), m = Y("sideNav"), h = Kv(e ?? ""), g = t ?? (e ? Tm(h) : []), _ = i !== void 0, [y, x] = E(r), S = i === void 0 ? y : i, C = v((e) => {
16232
+ let { pathname: d } = M(), p = J("sideNav"), m = Y("sideNav"), h = Jv(e ?? ""), g = t ?? (e ? Tm(h) : []), _ = i !== void 0, [y, x] = E(r), S = i === void 0 ? y : i, C = v((e) => {
16224
16233
  let t = typeof e == "function" ? e(S) : e;
16225
16234
  _ ? a?.(t) : x(t);
16226
16235
  }, [
@@ -16349,7 +16358,7 @@ function Fm({ path: e, fromUrl: t, where: n, order: r, fieldMap: i, recordId: a
16349
16358
  dir: n
16350
16359
  };
16351
16360
  }, [r]), d = o.sortable === void 0 || o.sortable === !0 ? u ?? o.sortable : o.sortable;
16352
- return /* @__PURE__ */ f.createElement(Og, {
16361
+ return /* @__PURE__ */ f.createElement(Ag, {
16353
16362
  ...o,
16354
16363
  records: l,
16355
16364
  recordId: a,
@@ -17595,8 +17604,81 @@ function fg({ questions: e, onSubmit: t, numbering: n, allowOther: r = !0, answe
17595
17604
  }), s ?? u.submit))));
17596
17605
  }
17597
17606
  //#endregion
17607
+ //#region src/components/widgets/chat/ChatActivity.tsx
17608
+ function pg({ item: e, className: t }) {
17609
+ let n = Y("chat"), [r, i] = f.useState(!1), a = f.useId(), o = e.detail ?? [], s = e.lines ?? [];
17610
+ return /* @__PURE__ */ f.createElement("li", { className: X("min-w-0 space-y-1", t) }, /* @__PURE__ */ f.createElement("div", { className: "flex min-w-0 items-center gap-2 text-sm" }, /* @__PURE__ */ f.createElement(Q, {
17611
+ name: e.icon ?? "terminal",
17612
+ size: 14,
17613
+ className: "shrink-0 text-muted-foreground"
17614
+ }), /* @__PURE__ */ f.createElement("span", { className: "shrink-0 font-medium" }, e.label), (e.count ?? 1) > 1 && /* @__PURE__ */ f.createElement("span", { className: "shrink-0 rounded-full bg-muted px-2 text-xs text-muted-foreground" }, Vn(n.activityCount, { count: e.count ?? 1 })), (e.failed ?? 0) > 0 && /* @__PURE__ */ f.createElement("span", { className: "shrink-0 rounded-full bg-warning/15 px-2 text-xs text-warning" }, Vn(n.activityFailed, { count: e.failed ?? 0 })), o.length > 0 && /* @__PURE__ */ f.createElement("span", {
17615
+ className: "min-w-0 truncate text-xs text-muted-foreground",
17616
+ title: o.join(", ")
17617
+ }, o.slice(0, 4).join(", "), o.length > 4 ? "…" : ""), s.length > 0 && /* @__PURE__ */ f.createElement("button", {
17618
+ type: "button",
17619
+ onClick: () => i((e) => !e),
17620
+ "aria-expanded": r,
17621
+ "aria-controls": a,
17622
+ className: "ms-auto inline-flex shrink-0 items-center gap-1 rounded-md text-xs text-primary hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
17623
+ }, r ? n.activityHide : n.activityCommands, /* @__PURE__ */ f.createElement(Q, {
17624
+ name: "chevron-down",
17625
+ size: 12,
17626
+ className: X("transition-transform", r && "rotate-180")
17627
+ }))), s.length > 0 && /* @__PURE__ */ f.createElement("pre", {
17628
+ id: a,
17629
+ hidden: !r,
17630
+ className: "max-h-64 overflow-auto whitespace-pre-wrap break-words rounded-md border border-border bg-muted p-2 font-mono text-xs leading-relaxed text-muted-foreground"
17631
+ }, r ? s.join("\n") : null));
17632
+ }
17633
+ function mg({ items: e, files: t = [], onShowChanges: n, log: r, className: i, classNames: a }) {
17634
+ let o = Y("chat"), [s, c] = f.useState(!1);
17635
+ return s && r ? /* @__PURE__ */ f.createElement("div", { className: X("rf-chat-activity min-w-0 space-y-2", i, a?.root) }, /* @__PURE__ */ f.createElement("button", {
17636
+ type: "button",
17637
+ onClick: () => c(!1),
17638
+ className: "inline-flex items-center gap-1 text-xs text-primary hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
17639
+ }, /* @__PURE__ */ f.createElement(Q, {
17640
+ name: "list",
17641
+ size: 12
17642
+ }), o.activitySteps), /* @__PURE__ */ f.createElement("pre", { className: X("max-h-96 overflow-auto whitespace-pre-wrap break-words rounded-md border border-border bg-muted p-3 font-mono text-xs leading-relaxed", a?.log) }, r.join("\n") || o.activityEmpty)) : /* @__PURE__ */ f.createElement("div", { className: X("rf-chat-activity min-w-0 space-y-3", i, a?.root) }, !e.length && /* @__PURE__ */ f.createElement("p", { className: "text-xs text-muted-foreground" }, o.activityEmpty), e.length > 0 && /* @__PURE__ */ f.createElement("ul", { className: "space-y-2" }, e.map((e, t) => e.type === "steps" ? /* @__PURE__ */ f.createElement(pg, {
17643
+ key: t,
17644
+ item: e,
17645
+ className: a?.step
17646
+ }) : e.type === "text" ? /* @__PURE__ */ f.createElement("li", {
17647
+ key: t,
17648
+ className: X("rounded-md bg-card px-3 py-2", a?.text)
17649
+ }, /* @__PURE__ */ f.createElement($h, {
17650
+ content: e.text,
17651
+ className: "text-sm"
17652
+ })) : /* @__PURE__ */ f.createElement("li", {
17653
+ key: t,
17654
+ className: "flex items-center gap-2 text-xs"
17655
+ }, /* @__PURE__ */ f.createElement(Q, {
17656
+ name: e.ok ? "circle-check" : "circle-x",
17657
+ size: 14,
17658
+ className: e.ok ? "text-success" : "text-danger"
17659
+ }), /* @__PURE__ */ f.createElement("span", { className: "text-muted-foreground" }, e.text)))), t.length > 0 && /* @__PURE__ */ f.createElement("div", { className: X("rounded-md border border-border px-3 py-2", a?.files) }, /* @__PURE__ */ f.createElement("div", { className: "flex flex-wrap items-center gap-2" }, /* @__PURE__ */ f.createElement("span", { className: "text-xs font-semibold" }, Vn(o.activityFiles, { count: t.length })), n && /* @__PURE__ */ f.createElement("button", {
17660
+ type: "button",
17661
+ onClick: n,
17662
+ className: "ms-auto inline-flex items-center gap-1 text-xs text-primary hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
17663
+ }, /* @__PURE__ */ f.createElement(Q, {
17664
+ name: "git-compare",
17665
+ size: 12
17666
+ }), o.activityChanges)), /* @__PURE__ */ f.createElement("ul", { className: "mt-1 space-y-0.5" }, t.map((e) => /* @__PURE__ */ f.createElement("li", {
17667
+ key: e,
17668
+ className: "truncate font-mono text-xs text-muted-foreground",
17669
+ title: e
17670
+ }, e)))), r && /* @__PURE__ */ f.createElement("button", {
17671
+ type: "button",
17672
+ onClick: () => c(!0),
17673
+ className: "inline-flex items-center gap-1 text-xs text-primary hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
17674
+ }, /* @__PURE__ */ f.createElement(Q, {
17675
+ name: "terminal",
17676
+ size: 12
17677
+ }), o.activityLog));
17678
+ }
17679
+ //#endregion
17598
17680
  //#region src/components/widgets/TabDynamic.tsx
17599
- var pg = ({ children: e, name: t, onChange: n = void 0, onAdd: r = void 0, onRemove: i = void 0, label: a = "Tab", min: o = 1, max: s = void 0, activeIndex: c = 0, title: l = void 0, readOnly: u = !1, tabPosition: d = "default" }) => {
17681
+ var hg = ({ children: e, name: t, onChange: n = void 0, onAdd: r = void 0, onRemove: i = void 0, label: a = "Tab", min: o = 1, max: s = void 0, activeIndex: c = 0, title: l = void 0, readOnly: u = !1, tabPosition: d = "default" }) => {
17600
17682
  let { value: p, handleChange: m } = yp({
17601
17683
  name: t,
17602
17684
  onChange: n
@@ -17653,7 +17735,7 @@ var pg = ({ children: e, name: t, onChange: n = void 0, onAdd: r = void 0, onRem
17653
17735
  }))),
17654
17736
  content: /* @__PURE__ */ f.createElement("div", { className: Rp() }, C)
17655
17737
  }));
17656
- }, mg = ({ records: e, children: t, limit: n = void 0, page: r = void 0, maxPageButtons: i = void 0, appendTo: a = void 0, before: o = void 0, after: s = void 0, className: c = void 0, wrapperClassName: l = void 0, scrollToTopOnChange: u = void 0, scrollBehavior: d = void 0, align: p = void 0, sticky: m = void 0 }) => {
17738
+ }, gg = ({ records: e, children: t, limit: n = void 0, page: r = void 0, maxPageButtons: i = void 0, appendTo: a = void 0, before: o = void 0, after: s = void 0, className: c = void 0, wrapperClassName: l = void 0, scrollToTopOnChange: u = void 0, scrollBehavior: d = void 0, align: p = void 0, sticky: m = void 0 }) => {
17657
17739
  let h = J("pagination"), g = Y("common"), [_, v] = E(r || 1), [y, x] = E(e.length);
17658
17740
  e.length !== y && (x(e.length), v(1));
17659
17741
  let S = n || e.length, C = Math.ceil(e.length / S), T = (_ - 1) * S, D = T + S, O = w(() => e.slice(T, D), [
@@ -17719,7 +17801,7 @@ var pg = ({ children: e, name: t, onChange: n = void 0, onAdd: r = void 0, onRem
17719
17801
  className: X("inline-flex h-9 min-w-[2.25rem] items-center justify-center rounded-md border bg-background px-3 text-sm transition-colors", M === "disabled" ? "pointer-events-none opacity-40" : "cursor-pointer hover:bg-accent hover:text-accent-foreground")
17720
17802
  }, /* @__PURE__ */ f.createElement("span", null, "»"))))), s);
17721
17803
  return /* @__PURE__ */ f.createElement(f.Fragment, null, t(O, T), a ? H(F, a) : a === void 0 && F);
17722
- }, hg = ({ records: e = void 0, header: t = void 0, footer: n = void 0, overlays: r = void 0, renderItem: i = void 0, onRowClick: a = void 0, onSelectionChange: o = void 0, sortable: s = !1, pagination: c = void 0, gap: l = void 0, columns: u = void 0, groupBy: d = void 0, selectedKeys: p = void 0, before: m = void 0, after: h = void 0, wrapperClassName: g = void 0, className: _ = void 0, headerClassName: y = void 0, scrollClassName: x = void 0, bodyClassName: S = void 0, footerClassName: C = void 0, selectedClassName: D = void 0 }) => {
17804
+ }, _g = ({ records: e = void 0, header: t = void 0, footer: n = void 0, overlays: r = void 0, renderItem: i = void 0, onRowClick: a = void 0, onSelectionChange: o = void 0, sortable: s = !1, pagination: c = void 0, gap: l = void 0, columns: u = void 0, groupBy: d = void 0, selectedKeys: p = void 0, before: m = void 0, after: h = void 0, wrapperClassName: g = void 0, className: _ = void 0, headerClassName: y = void 0, scrollClassName: x = void 0, bodyClassName: S = void 0, footerClassName: C = void 0, selectedClassName: D = void 0 }) => {
17723
17805
  let O = J("gallery"), k = Y("gallery"), A = Y("common"), j = D || O.Gallery.selectedClassName, [M, N] = E(null), P = v((e) => {
17724
17806
  e && N(e);
17725
17807
  }, []), F = l ?? O.Gallery.gap, I = u ?? O.Gallery.rowCols, L = {
@@ -17928,7 +18010,7 @@ var pg = ({ children: e, name: t, onChange: n = void 0, onAdd: r = void 0, onRem
17928
18010
  d,
17929
18011
  U
17930
18012
  ]);
17931
- return he === void 0 ? /* @__PURE__ */ f.createElement("p", { className: "p-4" }, /* @__PURE__ */ f.createElement("span", { className: "mr-2 inline-block h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }), A.loading) : he.length === 0 ? /* @__PURE__ */ f.createElement("p", { className: "p-4" }, A.noDataFound) : /* @__PURE__ */ f.createElement("div", { className: X("flex items-stretch gap-3", g || O.Gallery.wrapperClassName) }, m && /* @__PURE__ */ f.createElement("div", { className: "gallery-before flex shrink-0 items-center self-stretch" }, m), /* @__PURE__ */ f.createElement(Z, { className: X("min-w-0 flex-1 flex flex-col", _ || O.Gallery.className) }, t && /* @__PURE__ */ f.createElement("div", { className: y || O.Gallery.headerClassName }, t), /* @__PURE__ */ f.createElement(Z, { className: X("min-w-0 flex-1", x || O.Gallery.scrollClassName) }, /* @__PURE__ */ f.createElement(mg, {
18013
+ return he === void 0 ? /* @__PURE__ */ f.createElement("p", { className: "p-4" }, /* @__PURE__ */ f.createElement("span", { className: "mr-2 inline-block h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }), A.loading) : he.length === 0 ? /* @__PURE__ */ f.createElement("p", { className: "p-4" }, A.noDataFound) : /* @__PURE__ */ f.createElement("div", { className: X("flex items-stretch gap-3", g || O.Gallery.wrapperClassName) }, m && /* @__PURE__ */ f.createElement("div", { className: "gallery-before flex shrink-0 items-center self-stretch" }, m), /* @__PURE__ */ f.createElement(Z, { className: X("min-w-0 flex-1 flex flex-col", _ || O.Gallery.className) }, t && /* @__PURE__ */ f.createElement("div", { className: y || O.Gallery.headerClassName }, t), /* @__PURE__ */ f.createElement(Z, { className: X("min-w-0 flex-1", x || O.Gallery.scrollClassName) }, /* @__PURE__ */ f.createElement(gg, {
17932
18014
  records: he,
17933
18015
  appendTo: M,
17934
18016
  wrapperClassName: "px-3 pt-4 pb-2",
@@ -17949,12 +18031,12 @@ var pg = ({ children: e, name: t, onChange: n = void 0, onAdd: r = void 0, onRem
17949
18031
  };
17950
18032
  //#endregion
17951
18033
  //#region src/components/widgets/grid-core/GridGalleryView.tsx
17952
- function gg({ records: e, recordId: t, sortable: n, pagination: r, selection: i = !1, selectedKeys: a, onSelectionChange: o, onRowClick: s, groupBy: c, wrapperClassName: l, before: u, after: d, columns: p, overlays: m, renderItem: h }) {
18034
+ function vg({ records: e, recordId: t, sortable: n, pagination: r, selection: i = !1, selectedKeys: a, onSelectionChange: o, onRowClick: s, groupBy: c, wrapperClassName: l, before: u, after: d, columns: p, overlays: m, renderItem: h }) {
17953
18035
  let g = w(() => Lm(t), [t]), _ = w(() => e.reduce((e, t) => (e.set(g(t), t), e), /* @__PURE__ */ new Map()), [g, e]), v = w(() => e.map((e) => ({
17954
18036
  ...e,
17955
18037
  [fo]: g(e)
17956
18038
  })), [e, g]);
17957
- return /* @__PURE__ */ f.createElement(hg, {
18039
+ return /* @__PURE__ */ f.createElement(_g, {
17958
18040
  records: v,
17959
18041
  overlays: m,
17960
18042
  renderItem: h ? (e, t, n) => h(e, t, n) : void 0,
@@ -17990,7 +18072,7 @@ function gg({ records: e, recordId: t, sortable: n, pagination: r, selection: i
17990
18072
  }
17991
18073
  //#endregion
17992
18074
  //#region src/components/widgets/grid-core/useGridActions.tsx
17993
- function _g({ actions: e, form: t, editDeepLink: n, preparedRecords: r, recordId: i, sourcePath: a, db: o, onSave: s, onDelete: c, onComplete: l, audit: u = !1 }) {
18075
+ function yg({ actions: e, form: t, editDeepLink: n, preparedRecords: r, recordId: i, sourcePath: a, db: o, onSave: s, onDelete: c, onComplete: l, audit: u = !1 }) {
17994
18076
  let d = M(), p = N(), m = x(), h = lp(), g = w(() => Lm(i), [i]), _ = w(() => Um(e, !!t), [e, t]), [y, S] = E(null), C = w(() => `${Im(a || "grid-records")}-${Im(m)}`, [m, a]), T = v(() => {
17995
18077
  S(null), n && d.hash.startsWith(`#${C}:`) && p({
17996
18078
  pathname: d.pathname,
@@ -18184,7 +18266,7 @@ function _g({ actions: e, form: t, editDeepLink: n, preparedRecords: r, recordId
18184
18266
  }
18185
18267
  //#endregion
18186
18268
  //#region src/components/widgets/grid-core/useGridColumns.ts
18187
- function vg({ columns: e, records: t, form: n }) {
18269
+ function bg({ columns: e, records: t, form: n }) {
18188
18270
  return w(() => Hm(e, t, n), [
18189
18271
  e,
18190
18272
  n,
@@ -18193,7 +18275,7 @@ function vg({ columns: e, records: t, form: n }) {
18193
18275
  }
18194
18276
  //#endregion
18195
18277
  //#region src/components/widgets/grid-core/useGridPreparedRecords.ts
18196
- function yg({ records: e, onLoad: t }) {
18278
+ function xg({ records: e, onLoad: t }) {
18197
18279
  let [n, r] = E(e), [i, a] = E(!1);
18198
18280
  return b(() => {
18199
18281
  if (!t) {
@@ -18216,7 +18298,7 @@ function yg({ records: e, onLoad: t }) {
18216
18298
  }
18217
18299
  //#endregion
18218
18300
  //#region src/components/widgets/grid-core/useGridSelection.ts
18219
- function bg({ selection: e }) {
18301
+ function Sg({ selection: e }) {
18220
18302
  let t = e !== null && e !== !1 && typeof e == "object", n = e ? typeof e == "string" ? e : e.mode : !1, r = t ? e.defaultKeys : void 0, i = t ? e.onChange : void 0, [a, o] = E(r ?? []), [s, c] = E([]), l = r?.join("\0") ?? "";
18221
18303
  b(() => {
18222
18304
  o(r ?? []), c([]);
@@ -18249,7 +18331,7 @@ function bg({ selection: e }) {
18249
18331
  }
18250
18332
  //#endregion
18251
18333
  //#region src/components/widgets/grid-core/GridCore.tsx
18252
- var xg = (e, t, n, r, i) => t?.kind === "delete" ? typeof t.title == "function" ? t.title(n) : t.title || r : t?.kind === "modal" ? typeof t.title == "function" ? t.title(n) : t.title || Km(e, t, i) : Km(e, t, i), Sg = (e) => {
18334
+ var Cg = (e, t, n, r, i) => t?.kind === "delete" ? typeof t.title == "function" ? t.title(n) : t.title || r : t?.kind === "modal" ? typeof t.title == "function" ? t.title(n) : t.title || Km(e, t, i) : Km(e, t, i), wg = (e) => {
18253
18335
  switch (e.kind) {
18254
18336
  case "select": return "";
18255
18337
  case "multiselect": return [];
@@ -18263,7 +18345,7 @@ var xg = (e, t, n, r, i) => t?.kind === "delete" ? typeof t.title == "function"
18263
18345
  };
18264
18346
  default: return e.defaultValue ?? !1;
18265
18347
  }
18266
- }, Cg = (e, t) => {
18348
+ }, Tg = (e, t) => {
18267
18349
  switch (e.kind) {
18268
18350
  case "select": return typeof t == "string" && t !== "";
18269
18351
  case "multiselect": return Array.isArray(t) && t.length > 0;
@@ -18277,7 +18359,7 @@ var xg = (e, t, n, r, i) => t?.kind === "delete" ? typeof t.title == "function"
18277
18359
  }
18278
18360
  default: return !!t != !!(e.defaultValue ?? !1);
18279
18361
  }
18280
- }, wg = (e, t, n) => {
18362
+ }, Eg = (e, t, n) => {
18281
18363
  switch (e.kind) {
18282
18364
  case "select": return e.predicate(t, n);
18283
18365
  case "multiselect": return e.predicate(t, n);
@@ -18285,7 +18367,7 @@ var xg = (e, t, n, r, i) => t?.kind === "delete" ? typeof t.title == "function"
18285
18367
  case "numberRange": return e.predicate(t, n);
18286
18368
  default: return e.predicate(t, n);
18287
18369
  }
18288
- }, Tg = (e, t, n) => {
18370
+ }, Dg = (e, t, n) => {
18289
18371
  switch (e.kind) {
18290
18372
  case "select": {
18291
18373
  let n = e.options.find((e) => e.value === t);
@@ -18309,10 +18391,10 @@ var xg = (e, t, n, r, i) => t?.kind === "delete" ? typeof t.title == "function"
18309
18391
  }
18310
18392
  default: return e.label;
18311
18393
  }
18312
- }, Eg = "w-full rounded-md border border-input bg-background px-2 py-1.5 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring";
18313
- function Dg({ filter: e, value: t, onChange: n, dict: r }) {
18394
+ }, Og = "w-full rounded-md border border-input bg-background px-2 py-1.5 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring";
18395
+ function kg({ filter: e, value: t, onChange: n, dict: r }) {
18314
18396
  if (e.kind === "select") return /* @__PURE__ */ f.createElement("label", { className: "flex flex-col gap-1.5" }, /* @__PURE__ */ f.createElement("span", { className: "text-sm font-medium text-foreground" }, e.label), /* @__PURE__ */ f.createElement("select", {
18315
- className: Eg,
18397
+ className: Og,
18316
18398
  value: t,
18317
18399
  onChange: (e) => n(e.target.value)
18318
18400
  }, /* @__PURE__ */ f.createElement("option", { value: "" }, r.filtersSelectPlaceholder), e.options.map((e) => /* @__PURE__ */ f.createElement("option", {
@@ -18334,7 +18416,7 @@ function Dg({ filter: e, value: t, onChange: n, dict: r }) {
18334
18416
  let i = t;
18335
18417
  return /* @__PURE__ */ f.createElement("div", { className: "flex flex-col gap-1.5" }, /* @__PURE__ */ f.createElement("span", { className: "text-sm font-medium text-foreground" }, e.label), /* @__PURE__ */ f.createElement("div", { className: "flex flex-col gap-2" }, /* @__PURE__ */ f.createElement("label", { className: "flex flex-col gap-1" }, /* @__PURE__ */ f.createElement("span", { className: "text-xs text-muted-foreground" }, r.filtersRangeFrom), /* @__PURE__ */ f.createElement("input", {
18336
18418
  type: "date",
18337
- className: Eg,
18419
+ className: Og,
18338
18420
  value: i.from,
18339
18421
  onChange: (e) => n({
18340
18422
  ...i,
@@ -18342,7 +18424,7 @@ function Dg({ filter: e, value: t, onChange: n, dict: r }) {
18342
18424
  })
18343
18425
  })), /* @__PURE__ */ f.createElement("label", { className: "flex flex-col gap-1" }, /* @__PURE__ */ f.createElement("span", { className: "text-xs text-muted-foreground" }, r.filtersRangeTo), /* @__PURE__ */ f.createElement("input", {
18344
18426
  type: "date",
18345
- className: Eg,
18427
+ className: Og,
18346
18428
  value: i.to,
18347
18429
  onChange: (e) => n({
18348
18430
  ...i,
@@ -18354,7 +18436,7 @@ function Dg({ filter: e, value: t, onChange: n, dict: r }) {
18354
18436
  let i = t;
18355
18437
  return /* @__PURE__ */ f.createElement("div", { className: "flex flex-col gap-1.5" }, /* @__PURE__ */ f.createElement("span", { className: "text-sm font-medium text-foreground" }, e.label), /* @__PURE__ */ f.createElement("div", { className: "flex flex-col gap-2" }, /* @__PURE__ */ f.createElement("label", { className: "flex flex-col gap-1" }, /* @__PURE__ */ f.createElement("span", { className: "text-xs text-muted-foreground" }, r.filtersRangeMin), /* @__PURE__ */ f.createElement("input", {
18356
18438
  type: "number",
18357
- className: Eg,
18439
+ className: Og,
18358
18440
  value: i.min ?? "",
18359
18441
  onChange: (e) => n({
18360
18442
  ...i,
@@ -18362,7 +18444,7 @@ function Dg({ filter: e, value: t, onChange: n, dict: r }) {
18362
18444
  })
18363
18445
  })), /* @__PURE__ */ f.createElement("label", { className: "flex flex-col gap-1" }, /* @__PURE__ */ f.createElement("span", { className: "text-xs text-muted-foreground" }, r.filtersRangeMax), /* @__PURE__ */ f.createElement("input", {
18364
18446
  type: "number",
18365
- className: Eg,
18447
+ className: Og,
18366
18448
  value: i.max ?? "",
18367
18449
  onChange: (e) => n({
18368
18450
  ...i,
@@ -18381,15 +18463,15 @@ function Dg({ filter: e, value: t, onChange: n, dict: r }) {
18381
18463
  className: X("pointer-events-none absolute inset-0 rounded-full transition-colors duration-200 ease-out peer-focus-visible:ring-2 peer-focus-visible:ring-ring peer-focus-visible:ring-offset-2", i ? "bg-primary" : "bg-muted-foreground/35")
18382
18464
  }, /* @__PURE__ */ f.createElement("span", { className: X("pointer-events-none absolute top-0.5 left-0.5 h-4 w-4 rounded-full bg-background shadow-sm transition-transform duration-200 ease-out", i && "translate-x-4") }))), /* @__PURE__ */ f.createElement("span", { className: "text-sm text-foreground" }, e.label));
18383
18465
  }
18384
- function Og({ records: e, recordId: t, sourcePath: n, columns: r, actions: i, form: a, editDeepLink: o, header: s, footer: c, view: l = "table", views: u, sticky: d, wrapperClassName: p, cardClassName: m, bodyClassName: h, loading: g = !1, title: _, before: y, after: x, sortable: S = !0, pagination: C, selection: T, onRowClick: D, reorderable: O = !1, onReorder: k, groupBy: A, searchable: j, filters: M, onSave: N, onDelete: P, onComplete: F, audit: I = !1, onLoad: L }) {
18385
- let R = J("grid"), z = Y("grid"), B = Y("common"), V = w(() => ({ add: z.buttonAdd }), [z.buttonAdd]), H = Bi(), { preparedRecords: U, loading: ee } = yg({
18466
+ function Ag({ records: e, recordId: t, sourcePath: n, columns: r, actions: i, form: a, editDeepLink: o, header: s, footer: c, view: l = "table", views: u, sticky: d, wrapperClassName: p, cardClassName: m, bodyClassName: h, loading: g = !1, title: _, before: y, after: x, sortable: S = !0, pagination: C, selection: T, onRowClick: D, reorderable: O = !1, onReorder: k, groupBy: A, searchable: j, filters: M, onSave: N, onDelete: P, onComplete: F, audit: I = !1, onLoad: L }) {
18467
+ let R = J("grid"), z = Y("grid"), B = Y("common"), V = w(() => ({ add: z.buttonAdd }), [z.buttonAdd]), H = Bi(), { preparedRecords: U, loading: ee } = xg({
18386
18468
  records: e,
18387
18469
  onLoad: L
18388
- }), te = vg({
18470
+ }), te = bg({
18389
18471
  columns: r,
18390
18472
  records: U,
18391
18473
  form: a
18392
- }), [ne, re] = E(() => Object.fromEntries((M ?? []).map((e) => [e.key, Sg(e)]))), [W, G] = E(!1), ie = v((e, t) => {
18474
+ }), [ne, re] = E(() => Object.fromEntries((M ?? []).map((e) => [e.key, wg(e)]))), [W, G] = E(!1), ie = v((e, t) => {
18393
18475
  re((n) => ({
18394
18476
  ...n,
18395
18477
  [e]: t
@@ -18397,9 +18479,9 @@ function Og({ records: e, recordId: t, sourcePath: n, columns: r, actions: i, fo
18397
18479
  }, []), ae = v((e) => {
18398
18480
  re((t) => ({
18399
18481
  ...t,
18400
- [e.key]: Sg(e)
18482
+ [e.key]: wg(e)
18401
18483
  }));
18402
- }, []), oe = (M ?? []).filter((e) => Cg(e, ne[e.key] ?? Sg(e))), se = w(() => !M || M.length === 0 ? U : U.filter((e) => M.every((t) => wg(t, e, ne[t.key] ?? Sg(t)))), [
18484
+ }, []), oe = (M ?? []).filter((e) => Tg(e, ne[e.key] ?? wg(e))), se = w(() => !M || M.length === 0 ? U : U.filter((e) => M.every((t) => Eg(t, e, ne[t.key] ?? wg(t)))), [
18403
18485
  U,
18404
18486
  M,
18405
18487
  ne
@@ -18414,7 +18496,7 @@ function Og({ records: e, recordId: t, sourcePath: n, columns: r, actions: i, fo
18414
18496
  key: e.key,
18415
18497
  variant: "info",
18416
18498
  className: "inline-flex items-center gap-1"
18417
- }, Tg(e, ne[e.key] ?? Sg(e), z), /* @__PURE__ */ f.createElement(ri, {
18499
+ }, Dg(e, ne[e.key] ?? wg(e), z), /* @__PURE__ */ f.createElement(ri, {
18418
18500
  icon: "x",
18419
18501
  variant: "link",
18420
18502
  ariaLabel: `${z.filtersClearAll} ${e.label}`,
@@ -18429,12 +18511,12 @@ function Og({ records: e, recordId: t, sourcePath: n, columns: r, actions: i, fo
18429
18511
  label: z.filtersClearAll,
18430
18512
  variant: "link",
18431
18513
  disabled: oe.length === 0,
18432
- onClick: () => re(Object.fromEntries(M.map((e) => [e.key, Sg(e)])))
18514
+ onClick: () => re(Object.fromEntries(M.map((e) => [e.key, wg(e)])))
18433
18515
  })
18434
- }, /* @__PURE__ */ f.createElement("div", { className: "flex flex-col gap-5" }, M.map((e) => /* @__PURE__ */ f.createElement(Dg, {
18516
+ }, /* @__PURE__ */ f.createElement("div", { className: "flex flex-col gap-5" }, M.map((e) => /* @__PURE__ */ f.createElement(kg, {
18435
18517
  key: e.key,
18436
18518
  filter: e,
18437
- value: ne[e.key] ?? Sg(e),
18519
+ value: ne[e.key] ?? wg(e),
18438
18520
  onChange: (t) => ie(e.key, t),
18439
18521
  dict: z
18440
18522
  })))) : null, fe = j === !0 ? {} : j || void 0, [pe, me] = E(""), K = w(() => {
@@ -18493,7 +18575,7 @@ function Og({ records: e, recordId: t, sourcePath: n, columns: r, actions: i, fo
18493
18575
  ve.overlays,
18494
18576
  ve.renderItem,
18495
18577
  ke
18496
- ]), { mode: je, activeSelectionKeys: Me, selectionState: Ne, handleSelectionChange: Pe } = bg({ selection: T }), { normalizedActions: Fe, activeAction: Ie, activeActionConfig: q, activeActionBody: Le, activeKey: Re, runAction: ze, close: Be, getActionContext: Ve, getModalActionContext: He, getRecordKey: Ue, formController: We } = _g({
18578
+ ]), { mode: je, activeSelectionKeys: Me, selectionState: Ne, handleSelectionChange: Pe } = Sg({ selection: T }), { normalizedActions: Fe, activeAction: Ie, activeActionConfig: q, activeActionBody: Le, activeKey: Re, runAction: ze, close: Be, getActionContext: Ve, getModalActionContext: He, getRecordKey: Ue, formController: We } = yg({
18497
18579
  actions: i,
18498
18580
  form: a,
18499
18581
  editDeepLink: o,
@@ -18637,7 +18719,7 @@ function Og({ records: e, recordId: t, sourcePath: n, columns: r, actions: i, fo
18637
18719
  bodyClassName: X(R.Grid.Card.bodyClassName, h),
18638
18720
  footerClassName: R.Grid.Card.footerClassName,
18639
18721
  loading: g || ee
18640
- }, ye === "gallery" ? /* @__PURE__ */ f.createElement(gg, {
18722
+ }, ye === "gallery" ? /* @__PURE__ */ f.createElement(vg, {
18641
18723
  records: K,
18642
18724
  recordId: t,
18643
18725
  sortable: st || S,
@@ -18679,7 +18761,7 @@ function Og({ records: e, recordId: t, sourcePath: n, columns: r, actions: i, fo
18679
18761
  size: (q.kind === "modal" || q.kind === "delete") && q.size || R.Grid.Modal.size,
18680
18762
  position: (q.kind === "modal" || q.kind === "delete") && q.position || R.Grid.Modal.position,
18681
18763
  header: at,
18682
- title: xg(Ie.actionKey, q, q.kind === "modal" || q.kind === "delete" ? He(Ie.actionKey, Ie.record) : Ve(Ie.actionKey, Ie.record), z.deleteConfirm, V),
18764
+ title: Cg(Ie.actionKey, q, q.kind === "modal" || q.kind === "delete" ? He(Ie.actionKey, Ie.record) : Ve(Ie.actionKey, Ie.record), z.deleteConfirm, V),
18683
18765
  onClose: Be,
18684
18766
  onSave: q.kind === "modal" && q.footer === void 0 && (Ie.actionKey === "add" || Ie.actionKey === "edit") ? (e) => We.save(e) : void 0,
18685
18767
  onDelete: q.kind === "delete" ? async () => {
@@ -18707,18 +18789,18 @@ function Og({ records: e, recordId: t, sourcePath: n, columns: r, actions: i, fo
18707
18789
  }
18708
18790
  //#endregion
18709
18791
  //#region src/components/widgets/grid-core/GridArray.tsx
18710
- function kg(e) {
18711
- return /* @__PURE__ */ f.createElement(Og, e);
18792
+ function jg(e) {
18793
+ return /* @__PURE__ */ f.createElement(Ag, e);
18712
18794
  }
18713
18795
  //#endregion
18714
18796
  //#region src/components/widgets/Grid.tsx
18715
- function Ag(e) {
18716
- return "records" in e ? /* @__PURE__ */ f.createElement(kg, e) : /* @__PURE__ */ f.createElement(Fm, e);
18797
+ function Mg(e) {
18798
+ return "records" in e ? /* @__PURE__ */ f.createElement(jg, e) : /* @__PURE__ */ f.createElement(Fm, e);
18717
18799
  }
18718
18800
  //#endregion
18719
18801
  //#region src/pages/Users.tsx
18720
- function jg() {
18721
- return /* @__PURE__ */ f.createElement(Ag, {
18802
+ function Ng() {
18803
+ return /* @__PURE__ */ f.createElement(Mg, {
18722
18804
  path: "/users",
18723
18805
  recordId: (e) => `${e.email ?? ""}`.replace("@", "-"),
18724
18806
  form: /* @__PURE__ */ f.createElement(f.Fragment, null, /* @__PURE__ */ f.createElement(Uc, {
@@ -18745,10 +18827,10 @@ function jg() {
18745
18827
  }
18746
18828
  //#endregion
18747
18829
  //#region src/pages/NotFound.tsx
18748
- var Mg = () => {
18830
+ var Pg = () => {
18749
18831
  let e = Y("common");
18750
18832
  return /* @__PURE__ */ f.createElement("div", { className: "flex flex-col justify-center items-center vh-100" }, /* @__PURE__ */ f.createElement("h1", null, "404"), /* @__PURE__ */ f.createElement("p", null, e.notFoundMessage), /* @__PURE__ */ f.createElement(k, { to: "/" }, /* @__PURE__ */ f.createElement(Q, { name: "house-door" }), " ", e.goHome));
18751
- }, Ng = ({ size: e = 28 }) => /* @__PURE__ */ f.createElement("svg", {
18833
+ }, Fg = ({ size: e = 28 }) => /* @__PURE__ */ f.createElement("svg", {
18752
18834
  xmlns: "http://www.w3.org/2000/svg",
18753
18835
  width: e,
18754
18836
  height: e,
@@ -18768,7 +18850,7 @@ var Mg = () => {
18768
18850
  x2: "12.01",
18769
18851
  y1: "17",
18770
18852
  y2: "17"
18771
- })), Pg = ({ open: e }) => /* @__PURE__ */ f.createElement("svg", {
18853
+ })), Ig = ({ open: e }) => /* @__PURE__ */ f.createElement("svg", {
18772
18854
  xmlns: "http://www.w3.org/2000/svg",
18773
18855
  width: "13",
18774
18856
  height: "13",
@@ -18783,7 +18865,7 @@ var Mg = () => {
18783
18865
  transform: e ? "rotate(180deg)" : "none",
18784
18866
  flexShrink: 0
18785
18867
  }
18786
- }, /* @__PURE__ */ f.createElement("polyline", { points: "6 9 12 15 18 9" })), Fg = () => /* @__PURE__ */ f.createElement("svg", {
18868
+ }, /* @__PURE__ */ f.createElement("polyline", { points: "6 9 12 15 18 9" })), Lg = () => /* @__PURE__ */ f.createElement("svg", {
18787
18869
  xmlns: "http://www.w3.org/2000/svg",
18788
18870
  width: "13",
18789
18871
  height: "13",
@@ -18800,7 +18882,7 @@ var Mg = () => {
18800
18882
  y: "8",
18801
18883
  rx: "2",
18802
18884
  ry: "2"
18803
- }), /* @__PURE__ */ f.createElement("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })), Ig = () => /* @__PURE__ */ f.createElement("svg", {
18885
+ }), /* @__PURE__ */ f.createElement("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })), Rg = () => /* @__PURE__ */ f.createElement("svg", {
18804
18886
  xmlns: "http://www.w3.org/2000/svg",
18805
18887
  width: "13",
18806
18888
  height: "13",
@@ -18810,7 +18892,7 @@ var Mg = () => {
18810
18892
  strokeWidth: "2",
18811
18893
  strokeLinecap: "round",
18812
18894
  strokeLinejoin: "round"
18813
- }, /* @__PURE__ */ f.createElement("path", { d: "m22 2-7 20-4-9-9-4Z" }), /* @__PURE__ */ f.createElement("path", { d: "M22 2 11 13" })), Lg = () => /* @__PURE__ */ f.createElement("svg", {
18895
+ }, /* @__PURE__ */ f.createElement("path", { d: "m22 2-7 20-4-9-9-4Z" }), /* @__PURE__ */ f.createElement("path", { d: "M22 2 11 13" })), zg = () => /* @__PURE__ */ f.createElement("svg", {
18814
18896
  xmlns: "http://www.w3.org/2000/svg",
18815
18897
  width: "14",
18816
18898
  height: "14",
@@ -18820,7 +18902,7 @@ var Mg = () => {
18820
18902
  strokeWidth: "2",
18821
18903
  strokeLinecap: "round",
18822
18904
  strokeLinejoin: "round"
18823
- }, /* @__PURE__ */ f.createElement("path", { d: "m8 2 1.88 1.88M14.12 3.88 16 2" }), /* @__PURE__ */ f.createElement("path", { d: "M9 7.13v-1a3.003 3.003 0 1 1 6 0v1" }), /* @__PURE__ */ f.createElement("path", { d: "M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6z" }), /* @__PURE__ */ f.createElement("path", { d: "M12 20v-9" }), /* @__PURE__ */ f.createElement("path", { d: "M6.53 9C4.6 8.8 3 7.1 3 5" }), /* @__PURE__ */ f.createElement("path", { d: "M6 13H2" }), /* @__PURE__ */ f.createElement("path", { d: "M3 21c0-2.1 1.7-3.9 3.8-4" }), /* @__PURE__ */ f.createElement("path", { d: "M20.97 5c0 2.1-1.6 3.8-3.5 4" }), /* @__PURE__ */ f.createElement("path", { d: "M22 13h-4" }), /* @__PURE__ */ f.createElement("path", { d: "M17.2 17c2.1.1 3.8 1.9 3.8 4" })), Rg = (e, t) => ({
18905
+ }, /* @__PURE__ */ f.createElement("path", { d: "m8 2 1.88 1.88M14.12 3.88 16 2" }), /* @__PURE__ */ f.createElement("path", { d: "M9 7.13v-1a3.003 3.003 0 1 1 6 0v1" }), /* @__PURE__ */ f.createElement("path", { d: "M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6z" }), /* @__PURE__ */ f.createElement("path", { d: "M12 20v-9" }), /* @__PURE__ */ f.createElement("path", { d: "M6.53 9C4.6 8.8 3 7.1 3 5" }), /* @__PURE__ */ f.createElement("path", { d: "M6 13H2" }), /* @__PURE__ */ f.createElement("path", { d: "M3 21c0-2.1 1.7-3.9 3.8-4" }), /* @__PURE__ */ f.createElement("path", { d: "M20.97 5c0 2.1-1.6 3.8-3.5 4" }), /* @__PURE__ */ f.createElement("path", { d: "M22 13h-4" }), /* @__PURE__ */ f.createElement("path", { d: "M17.2 17c2.1.1 3.8 1.9 3.8 4" })), Bg = (e, t) => ({
18824
18906
  error: {
18825
18907
  message: e.message,
18826
18908
  stack: e.stack ?? ""
@@ -18831,8 +18913,8 @@ var Mg = () => {
18831
18913
  userAgent: typeof navigator < "u" ? navigator.userAgent : "",
18832
18914
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
18833
18915
  }
18834
- }), zg = (e, t) => {
18835
- let n = Rg(e, t);
18916
+ }), Vg = (e, t) => {
18917
+ let n = Bg(e, t);
18836
18918
  return [
18837
18919
  `Error: ${n.error.message}`,
18838
18920
  "",
@@ -18847,7 +18929,7 @@ var Mg = () => {
18847
18929
  `Timestamp: ${n.context.timestamp}`,
18848
18930
  `Agent: ${n.context.userAgent}`
18849
18931
  ].join("\n");
18850
- }, Bg = ({ children: e }) => /* @__PURE__ */ f.createElement(f.Fragment, null, e(Yn().errorBoundary)), Vg = class extends f.Component {
18932
+ }, Hg = ({ children: e }) => /* @__PURE__ */ f.createElement(f.Fragment, null, e(Yn().errorBoundary)), Ug = class extends f.Component {
18851
18933
  constructor(e) {
18852
18934
  super(e), this.state = {
18853
18935
  error: null,
@@ -18869,7 +18951,7 @@ var Mg = () => {
18869
18951
  };
18870
18952
  copy = () => {
18871
18953
  let { error: e, errorInfo: t } = this.state;
18872
- e && navigator.clipboard?.writeText(zg(e, t)).then(() => {
18954
+ e && navigator.clipboard?.writeText(Vg(e, t)).then(() => {
18873
18955
  this.setState({ copied: !0 }), setTimeout(() => this.setState({ copied: !1 }), 2e3);
18874
18956
  });
18875
18957
  };
@@ -18878,7 +18960,7 @@ var Mg = () => {
18878
18960
  e && n && (this.setState({ reportState: "sending" }), fetch(n, {
18879
18961
  method: "POST",
18880
18962
  headers: { "Content-Type": "application/json" },
18881
- body: JSON.stringify(Rg(e, t))
18963
+ body: JSON.stringify(Bg(e, t))
18882
18964
  }).then((e) => this.setState({ reportState: e.ok ? "sent" : "failed" })).catch(() => this.setState({ reportState: "failed" })));
18883
18965
  };
18884
18966
  render() {
@@ -18888,16 +18970,16 @@ var Mg = () => {
18888
18970
  if (typeof o == "function") return o(e, this.reset);
18889
18971
  if (o != null) return o;
18890
18972
  let u = (e.stack ?? e.message).split("\n").map((e) => e.trim()).filter(Boolean), d = (t?.componentStack ?? "").split("\n").map((e) => e.trim()).filter(Boolean), p = c ? "flex min-h-screen flex-col items-center justify-center bg-background p-8" : "flex min-h-[calc(100vh-4rem)] flex-col items-center justify-center p-8";
18891
- return /* @__PURE__ */ f.createElement(Bg, null, (t) => /* @__PURE__ */ f.createElement("div", { className: p }, /* @__PURE__ */ f.createElement("div", { className: "flex w-full max-w-xl flex-col gap-4 rounded-xl border border-destructive/25 bg-destructive/5 p-6" }, /* @__PURE__ */ f.createElement("div", { className: "flex items-start gap-4" }, /* @__PURE__ */ f.createElement("div", { className: "flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-destructive/12 text-destructive" }, /* @__PURE__ */ f.createElement(Ng, { size: 22 })), /* @__PURE__ */ f.createElement("div", null, /* @__PURE__ */ f.createElement("p", { className: "text-sm font-semibold text-foreground" }, t.title), /* @__PURE__ */ f.createElement("p", { className: "mt-0.5 text-xs text-muted-foreground" }, t.description))), /* @__PURE__ */ f.createElement("div", { className: "rounded-lg border bg-background/60" }, /* @__PURE__ */ f.createElement("button", {
18973
+ return /* @__PURE__ */ f.createElement(Hg, null, (t) => /* @__PURE__ */ f.createElement("div", { className: p }, /* @__PURE__ */ f.createElement("div", { className: "flex w-full max-w-xl flex-col gap-4 rounded-xl border border-destructive/25 bg-destructive/5 p-6" }, /* @__PURE__ */ f.createElement("div", { className: "flex items-start gap-4" }, /* @__PURE__ */ f.createElement("div", { className: "flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-destructive/12 text-destructive" }, /* @__PURE__ */ f.createElement(Fg, { size: 22 })), /* @__PURE__ */ f.createElement("div", null, /* @__PURE__ */ f.createElement("p", { className: "text-sm font-semibold text-foreground" }, t.title), /* @__PURE__ */ f.createElement("p", { className: "mt-0.5 text-xs text-muted-foreground" }, t.description))), /* @__PURE__ */ f.createElement("div", { className: "rounded-lg border bg-background/60" }, /* @__PURE__ */ f.createElement("button", {
18892
18974
  onClick: () => this.setState((e) => ({ detailsOpen: !e.detailsOpen })),
18893
18975
  className: "flex w-full items-center gap-2 px-3 py-2.5 text-left text-xs font-medium text-muted-foreground transition-colors hover:text-foreground"
18894
- }, /* @__PURE__ */ f.createElement(Pg, { open: n }), t.technicalDetails, /* @__PURE__ */ f.createElement("span", { className: "ml-auto truncate max-w-[280px] font-mono text-[11px] text-muted-foreground/70" }, e.message)), n && /* @__PURE__ */ f.createElement("div", { className: "border-t" }, /* @__PURE__ */ f.createElement("pre", { className: "max-h-48 overflow-y-auto px-3 py-3 text-[11px] leading-relaxed text-muted-foreground font-mono whitespace-before-wrap break-all" }, u.join("\n")))), l && /* @__PURE__ */ f.createElement("div", { className: "rounded-lg border border-amber-200/60 bg-amber-50/40 dark:border-amber-900/40 dark:bg-amber-950/20" }, /* @__PURE__ */ f.createElement("button", {
18976
+ }, /* @__PURE__ */ f.createElement(Ig, { open: n }), t.technicalDetails, /* @__PURE__ */ f.createElement("span", { className: "ml-auto truncate max-w-[280px] font-mono text-[11px] text-muted-foreground/70" }, e.message)), n && /* @__PURE__ */ f.createElement("div", { className: "border-t" }, /* @__PURE__ */ f.createElement("pre", { className: "max-h-48 overflow-y-auto px-3 py-3 text-[11px] leading-relaxed text-muted-foreground font-mono whitespace-before-wrap break-all" }, u.join("\n")))), l && /* @__PURE__ */ f.createElement("div", { className: "rounded-lg border border-amber-200/60 bg-amber-50/40 dark:border-amber-900/40 dark:bg-amber-950/20" }, /* @__PURE__ */ f.createElement("button", {
18895
18977
  onClick: () => this.setState((e) => ({ debugOpen: !e.debugOpen })),
18896
18978
  className: "flex w-full items-center gap-2 px-3 py-2.5 text-left text-xs font-medium text-amber-700 dark:text-amber-400 transition-colors hover:opacity-80"
18897
- }, /* @__PURE__ */ f.createElement(Lg, null), /* @__PURE__ */ f.createElement(Pg, { open: r }), t.debugInformation, /* @__PURE__ */ f.createElement("span", { className: "ml-auto text-[10px] font-normal opacity-60" }, "DEV")), r && /* @__PURE__ */ f.createElement("div", { className: "border-t border-amber-200/60 dark:border-amber-900/40 px-3 py-3 space-y-3" }, /* @__PURE__ */ f.createElement("div", { className: "space-y-1" }, /* @__PURE__ */ f.createElement("p", { className: "text-[10px] font-semibold uppercase tracking-wide text-amber-700/70 dark:text-amber-400/70" }, t.context), /* @__PURE__ */ f.createElement("dl", { className: "grid grid-cols-[5rem_1fr] gap-x-2 gap-y-0.5 text-[11px] font-mono" }, /* @__PURE__ */ f.createElement("dt", { className: "text-muted-foreground" }, "URL"), /* @__PURE__ */ f.createElement("dd", { className: "truncate text-foreground" }, typeof window < "u" ? window.location.href : "-"), /* @__PURE__ */ f.createElement("dt", { className: "text-muted-foreground" }, t.time), /* @__PURE__ */ f.createElement("dd", { className: "text-foreground" }, (/* @__PURE__ */ new Date()).toISOString()), /* @__PURE__ */ f.createElement("dt", { className: "text-muted-foreground" }, t.agent), /* @__PURE__ */ f.createElement("dd", { className: "truncate text-foreground opacity-70" }, typeof navigator < "u" ? navigator.userAgent : "-"))), d.length > 0 && /* @__PURE__ */ f.createElement("div", { className: "space-y-1" }, /* @__PURE__ */ f.createElement("p", { className: "text-[10px] font-semibold uppercase tracking-wide text-amber-700/70 dark:text-amber-400/70" }, t.componentTree), /* @__PURE__ */ f.createElement("pre", { className: "max-h-36 overflow-y-auto text-[11px] font-mono leading-relaxed text-foreground/80 whitespace-before-wrap" }, d.join("\n"))), /* @__PURE__ */ f.createElement("button", {
18979
+ }, /* @__PURE__ */ f.createElement(zg, null), /* @__PURE__ */ f.createElement(Ig, { open: r }), t.debugInformation, /* @__PURE__ */ f.createElement("span", { className: "ml-auto text-[10px] font-normal opacity-60" }, "DEV")), r && /* @__PURE__ */ f.createElement("div", { className: "border-t border-amber-200/60 dark:border-amber-900/40 px-3 py-3 space-y-3" }, /* @__PURE__ */ f.createElement("div", { className: "space-y-1" }, /* @__PURE__ */ f.createElement("p", { className: "text-[10px] font-semibold uppercase tracking-wide text-amber-700/70 dark:text-amber-400/70" }, t.context), /* @__PURE__ */ f.createElement("dl", { className: "grid grid-cols-[5rem_1fr] gap-x-2 gap-y-0.5 text-[11px] font-mono" }, /* @__PURE__ */ f.createElement("dt", { className: "text-muted-foreground" }, "URL"), /* @__PURE__ */ f.createElement("dd", { className: "truncate text-foreground" }, typeof window < "u" ? window.location.href : "-"), /* @__PURE__ */ f.createElement("dt", { className: "text-muted-foreground" }, t.time), /* @__PURE__ */ f.createElement("dd", { className: "text-foreground" }, (/* @__PURE__ */ new Date()).toISOString()), /* @__PURE__ */ f.createElement("dt", { className: "text-muted-foreground" }, t.agent), /* @__PURE__ */ f.createElement("dd", { className: "truncate text-foreground opacity-70" }, typeof navigator < "u" ? navigator.userAgent : "-"))), d.length > 0 && /* @__PURE__ */ f.createElement("div", { className: "space-y-1" }, /* @__PURE__ */ f.createElement("p", { className: "text-[10px] font-semibold uppercase tracking-wide text-amber-700/70 dark:text-amber-400/70" }, t.componentTree), /* @__PURE__ */ f.createElement("pre", { className: "max-h-36 overflow-y-auto text-[11px] font-mono leading-relaxed text-foreground/80 whitespace-before-wrap" }, d.join("\n"))), /* @__PURE__ */ f.createElement("button", {
18898
18980
  onClick: this.copy,
18899
18981
  className: "flex items-center gap-1.5 rounded border px-2.5 py-1 text-[11px] font-medium transition-colors hover:bg-accent"
18900
- }, /* @__PURE__ */ f.createElement(Fg, null), i ? t.copied : t.copyDebug))), /* @__PURE__ */ f.createElement("div", { className: "flex flex-wrap items-center gap-2" }, /* @__PURE__ */ f.createElement("button", {
18982
+ }, /* @__PURE__ */ f.createElement(Lg, null), i ? t.copied : t.copyDebug))), /* @__PURE__ */ f.createElement("div", { className: "flex flex-wrap items-center gap-2" }, /* @__PURE__ */ f.createElement("button", {
18901
18983
  onClick: this.reset,
18902
18984
  className: "rounded-md border bg-background px-4 py-1.5 text-sm font-medium shadow-sm transition-colors hover:bg-accent"
18903
18985
  }, t.tryAgain), /* @__PURE__ */ f.createElement("a", {
@@ -18907,15 +18989,15 @@ var Mg = () => {
18907
18989
  onClick: this.sendReport,
18908
18990
  disabled: a === "sending" || a === "sent",
18909
18991
  className: "ml-auto flex items-center gap-1.5 rounded-md border px-4 py-1.5 text-sm font-medium transition-colors hover:bg-accent disabled:opacity-50"
18910
- }, /* @__PURE__ */ f.createElement(Ig, null), a === "idle" && t.sendReport, a === "sending" && t.sending, a === "sent" && t.reportSent, a === "failed" && t.reportFailed)))));
18992
+ }, /* @__PURE__ */ f.createElement(Rg, null), a === "idle" && t.sendReport, a === "sending" && t.sending, a === "sent" && t.reportSent, a === "failed" && t.reportFailed)))));
18911
18993
  }
18912
- }, Hg = async () => {
18994
+ }, Wg = async () => {
18913
18995
  window.google?.accounts?.id || (At([{
18914
18996
  src: "https://accounts.google.com/gsi/client",
18915
18997
  async: !0,
18916
18998
  clean: !0
18917
18999
  }]), await new Promise((e) => setTimeout(e, 0)));
18918
- }, Ug = class {
19000
+ }, Gg = class {
18919
19001
  getConfigurationState() {
18920
19002
  return xi("GoogleAuthProvider", bi(eo("oAuth2"), ["clientId"], "google.oAuth2."));
18921
19003
  }
@@ -18938,7 +19020,7 @@ var Mg = () => {
18938
19020
  async signIn(e = {}) {
18939
19021
  let t = eo("oAuth2");
18940
19022
  if (!this.isConfigured() || !t?.clientId) throw Error("GoogleAuthProvider: missing google.oAuth2.clientId configuration.");
18941
- return await Hg(), new Promise((n, r) => {
19023
+ return await Wg(), new Promise((n, r) => {
18942
19024
  if (!window.google?.accounts?.id) {
18943
19025
  r(/* @__PURE__ */ Error("GoogleAuthProvider: Google Identity Services script is not available."));
18944
19026
  return;
@@ -19019,41 +19101,41 @@ var Mg = () => {
19019
19101
  isAuthenticated() {
19020
19102
  return !!this.getUser();
19021
19103
  }
19022
- }, Wg = g(null), Gg = ({ registry: e, defaultKey: t, children: n }) => {
19104
+ }, Kg = g(null), qg = ({ registry: e, defaultKey: t, children: n }) => {
19023
19105
  let r = w(() => ({
19024
19106
  registry: e,
19025
19107
  defaultKey: t
19026
19108
  }), [e, t]);
19027
- return /* @__PURE__ */ f.createElement(Wg.Provider, { value: r }, n);
19028
- }, Kg = (e) => {
19029
- let t = y(Wg);
19109
+ return /* @__PURE__ */ f.createElement(Kg.Provider, { value: r }, n);
19110
+ }, Jg = (e) => {
19111
+ let t = y(Kg);
19030
19112
  if (!t) return null;
19031
19113
  let n = e ?? t.defaultKey;
19032
19114
  return t.registry[n] ?? null;
19033
- }, qg = g(null), Jg = ({ registry: e, defaultKey: t, children: n }) => {
19115
+ }, Yg = g(null), Xg = ({ registry: e, defaultKey: t, children: n }) => {
19034
19116
  let r = w(() => ({
19035
19117
  registry: e,
19036
19118
  defaultKey: t
19037
19119
  }), [e, t]);
19038
- return /* @__PURE__ */ f.createElement(qg.Provider, { value: r }, n);
19039
- }, Yg = (e) => {
19040
- let t = y(qg);
19120
+ return /* @__PURE__ */ f.createElement(Yg.Provider, { value: r }, n);
19121
+ }, Zg = (e) => {
19122
+ let t = y(Yg);
19041
19123
  if (!t) throw Error("useCredentialsProvider must be used inside <App providers={...} />.");
19042
19124
  let n = e ?? t.defaultKey, r = t.registry[n];
19043
19125
  if (!r) throw Error(`CredentialsProvider '${n}' is not registered. Available: ${Object.keys(t.registry).join(", ")}`);
19044
19126
  return r;
19045
- }, Xg = {
19127
+ }, Qg = {
19046
19128
  key: "@key",
19047
19129
  value: "@value"
19048
- }, Zg = () => Je(), Qg = (e, t, n) => {
19130
+ }, $g = () => Je(), e_ = (e, t, n) => {
19049
19131
  let r = `Error during ${e}: ${String(t)}`;
19050
19132
  if (n) throw Error(r);
19051
19133
  console.error(r);
19052
- }, $g = (e, t) => {
19134
+ }, t_ = (e, t) => {
19053
19135
  if (!e || !(t in e)) return e;
19054
19136
  let { [t]: n, ...r } = e;
19055
19137
  return Object.keys(r).length ? r : void 0;
19056
- }, e_ = (e) => {
19138
+ }, n_ = (e) => {
19057
19139
  let t = typeof e == "object" && e && !Array.isArray(e) ? e : Array.isArray(e) ? { in: e } : { eq: e }, n;
19058
19140
  return t.gt !== void 0 && (n = {
19059
19141
  ...n,
@@ -19071,28 +19153,28 @@ var Mg = () => {
19071
19153
  condition: t,
19072
19154
  clientCondition: n
19073
19155
  };
19074
- }, t_ = (e, t) => {
19156
+ }, r_ = (e, t) => {
19075
19157
  switch (t) {
19076
- case Xg.key: return $e(e, Ze());
19077
- case Xg.value: return $e(e, Qe());
19158
+ case Qg.key: return $e(e, Ze());
19159
+ case Qg.value: return $e(e, Qe());
19078
19160
  default: return $e(e, Xe(t));
19079
19161
  }
19080
- }, n_ = (e, t, n) => {
19162
+ }, i_ = (e, t, n) => {
19081
19163
  let [r] = Object.entries(t || {});
19082
19164
  if (!r) return {
19083
19165
  dbRef: e,
19084
19166
  clientWhere: n
19085
19167
  };
19086
- let [i] = r, a = t_(e, i), o = n?.[i];
19168
+ let [i] = r, a = r_(e, i), o = n?.[i];
19087
19169
  if (o == null) return {
19088
19170
  dbRef: a,
19089
19171
  clientWhere: n
19090
19172
  };
19091
- let { condition: s, clientCondition: c } = e_(o);
19173
+ let { condition: s, clientCondition: c } = n_(o);
19092
19174
  switch (!0) {
19093
19175
  case s.eq !== void 0: return {
19094
19176
  dbRef: $e(a, Ke(s.eq)),
19095
- clientWhere: $g(n, i)
19177
+ clientWhere: t_(n, i)
19096
19178
  };
19097
19179
  case s.gte !== void 0 && s.lte !== void 0:
19098
19180
  a = $e(a, rt(s.gte), Ge(s.lte));
@@ -19120,11 +19202,11 @@ var Mg = () => {
19120
19202
  return {
19121
19203
  dbRef: a,
19122
19204
  clientWhere: c ? {
19123
- ...$g(n, i) || {},
19205
+ ...t_(n, i) || {},
19124
19206
  [i]: c
19125
- } : $g(n, i)
19207
+ } : t_(n, i)
19126
19208
  };
19127
- }, r_ = (e, t) => {
19209
+ }, a_ = (e, t) => {
19128
19210
  if (!t) return e;
19129
19211
  let n = t.split("."), r = e;
19130
19212
  for (let e of n) {
@@ -19132,10 +19214,10 @@ var Mg = () => {
19132
19214
  r = r[e];
19133
19215
  }
19134
19216
  return r;
19135
- }, i_ = (e, t) => e === t ? 0 : e == null ? -1 : t == null ? 1 : typeof e == "number" && typeof t == "number" ? e - t : typeof e == "boolean" && typeof t == "boolean" ? Number(e) - Number(t) : globalThis.String(e).localeCompare(globalThis.String(t), void 0, {
19217
+ }, o_ = (e, t) => e === t ? 0 : e == null ? -1 : t == null ? 1 : typeof e == "number" && typeof t == "number" ? e - t : typeof e == "boolean" && typeof t == "boolean" ? Number(e) - Number(t) : globalThis.String(e).localeCompare(globalThis.String(t), void 0, {
19136
19218
  numeric: !0,
19137
19219
  sensitivity: "base"
19138
- }), a_ = (e, t) => {
19220
+ }), s_ = (e, t) => {
19139
19221
  let n = typeof t == "object" && t && !Array.isArray(t) ? t : { eq: t };
19140
19222
  for (let [t, r] of Object.entries(n)) switch (t) {
19141
19223
  case "eq":
@@ -19162,23 +19244,23 @@ var Mg = () => {
19162
19244
  default: return !1;
19163
19245
  }
19164
19246
  return !0;
19165
- }, o_ = (e, t, n) => {
19247
+ }, c_ = (e, t, n) => {
19166
19248
  let [r, ...i] = Object.entries(n || {}), a = Object.entries(t || {}), o = Object.entries(e);
19167
- if (a.length && (o = o.filter(([, e]) => a.every(([t, n]) => a_(r_(e, t), n)))), r) {
19249
+ if (a.length && (o = o.filter(([, e]) => a.every(([t, n]) => s_(a_(e, t), n)))), r) {
19168
19250
  let e = [r, ...i];
19169
19251
  o.sort((t, n) => {
19170
19252
  for (let [r, i] of e) {
19171
- let e = i_(r_(t[1], r), r_(n[1], r));
19253
+ let e = o_(a_(t[1], r), a_(n[1], r));
19172
19254
  if (e) return i === "desc" ? -e : e;
19173
19255
  }
19174
19256
  return 0;
19175
19257
  });
19176
19258
  }
19177
19259
  return Object.fromEntries(o);
19178
- }, s_ = async (e) => {
19179
- let t = await so()?.currentUser?.getIdToken().catch(() => void 0), n = new URL(`${e}.json`, et(Zg()).toString());
19260
+ }, l_ = async (e) => {
19261
+ let t = await so()?.currentUser?.getIdToken().catch(() => void 0), n = new URL(`${e}.json`, et($g()).toString());
19180
19262
  return n.searchParams.set("shallow", "true"), t && n.searchParams.set("auth", t), n.toString();
19181
- }, c_ = class e {
19263
+ }, u_ = class e {
19182
19264
  static listenerRegistered = !1;
19183
19265
  constructor() {
19184
19266
  !e.listenerRegistered && typeof Xa == "function" && (e.listenerRegistered = !0, Xa((e) => {
@@ -19193,44 +19275,44 @@ var Mg = () => {
19193
19275
  }
19194
19276
  readShallow = async (e, t = !1) => {
19195
19277
  try {
19196
- let t = await s_(e), n = await fetch(t);
19278
+ let t = await l_(e), n = await fetch(t);
19197
19279
  if (!n.ok) throw Error(`${n.status} ${n.statusText}`);
19198
19280
  let r = await n.json();
19199
19281
  return r ? Object.keys(r) : [];
19200
19282
  } catch (n) {
19201
- return Qg(`reading SHALLOW data in Firebase for ${e}`, n, t), [];
19283
+ return e_(`reading SHALLOW data in Firebase for ${e}`, n, t), [];
19202
19284
  }
19203
19285
  };
19204
19286
  read = async (e, { where: t, order: n, toArray: r = !1, exception: i = !1 } = {}) => {
19205
- let { dbRef: a, clientWhere: o } = n_(et(Zg(), e), n, t);
19287
+ let { dbRef: a, clientWhere: o } = i_(et($g(), e), n, t);
19206
19288
  try {
19207
19289
  let t = await qe(a);
19208
19290
  if (t.exists()) {
19209
19291
  `${e}`;
19210
- let i = o_(t.val(), o, n);
19292
+ let i = c_(t.val(), o, n);
19211
19293
  return r ? Object.values(i) : i;
19212
19294
  }
19213
- i && Qg(`Data not found in Firebase for path ${e}`, null, i);
19295
+ i && e_(`Data not found in Firebase for path ${e}`, null, i);
19214
19296
  } catch (t) {
19215
- Qg(`reading data in Firebase for ${e}`, t, i);
19297
+ e_(`reading data in Firebase for ${e}`, t, i);
19216
19298
  }
19217
19299
  };
19218
19300
  update = async (e, t, n = !1) => {
19219
19301
  try {
19220
- await it(et(Zg(), e), t), `${e}`;
19302
+ await it(et($g(), e), t), `${e}`;
19221
19303
  } catch (t) {
19222
- Qg(`updating data in Firebase for ${e}`, t, n);
19304
+ e_(`updating data in Firebase for ${e}`, t, n);
19223
19305
  }
19224
19306
  };
19225
19307
  set = async (e, t, n = !1) => {
19226
19308
  try {
19227
- await nt(et(Zg(), e), t), `${e}`;
19309
+ await nt(et($g(), e), t), `${e}`;
19228
19310
  } catch (t) {
19229
- Qg(`updating data in Firebase for ${e}`, t, n);
19311
+ e_(`updating data in Firebase for ${e}`, t, n);
19230
19312
  }
19231
19313
  };
19232
19314
  setChunks = async (e, t, { chunkSize: n = 1e3, purge: r = !1, onProgress: i } = {}) => {
19233
- let a = Zg(), o = et(a, e);
19315
+ let a = $g(), o = et(a, e);
19234
19316
  try {
19235
19317
  r && (await tt(o), i?.(0, 0, `Purging existing data at ${e}`));
19236
19318
  let a = Object.entries(Gt(t)), s = Math.ceil(a.length / n);
@@ -19241,14 +19323,14 @@ var Mg = () => {
19241
19323
  i?.(r, s, `Saving chunk ${r}/${s}`);
19242
19324
  }
19243
19325
  } catch (t) {
19244
- Qg(`setting data in chunks in Firebase for ${e}`, t, !1);
19326
+ e_(`setting data in chunks in Firebase for ${e}`, t, !1);
19245
19327
  }
19246
19328
  };
19247
19329
  remove = async (e, t = !1) => {
19248
19330
  try {
19249
- await tt(et(Zg(), e)), `${e}`;
19331
+ await tt(et($g(), e)), `${e}`;
19250
19332
  } catch (n) {
19251
- Qg(`removing data from Firebase for ${e}`, n, t);
19333
+ e_(`removing data from Firebase for ${e}`, n, t);
19252
19334
  }
19253
19335
  };
19254
19336
  count = async (e) => (await this.readShallow(e)).length;
@@ -19256,14 +19338,14 @@ var Mg = () => {
19256
19338
  let o = so();
19257
19339
  if (!o || !e) return () => void 0;
19258
19340
  let s = () => {
19259
- let { dbRef: o, clientWhere: s } = n_(et(Zg(), e), r, n);
19341
+ let { dbRef: o, clientWhere: s } = i_(et($g(), e), r, n);
19260
19342
  return Ye(o, (e) => {
19261
19343
  let n = e.val();
19262
19344
  if (!n) {
19263
19345
  t([]);
19264
19346
  return;
19265
19347
  }
19266
- let o = a ? a(o_(n, s, r)) : o_(n, s, r), c = Object.entries(o);
19348
+ let o = a ? a(c_(n, s, r)) : c_(n, s, r), c = Object.entries(o);
19267
19349
  if (!i) {
19268
19350
  t(c.map(([e, t], n) => typeof t == "object" && t ? {
19269
19351
  _index: n,
@@ -19272,22 +19354,22 @@ var Mg = () => {
19272
19354
  } : {
19273
19355
  _index: n,
19274
19356
  [fo]: e,
19275
- [Xg.value]: t
19357
+ [Qg.value]: t
19276
19358
  }));
19277
19359
  return;
19278
19360
  }
19279
19361
  let l = Object.keys(i);
19280
19362
  t(c.map(([e, t], n) => {
19281
19363
  let r = typeof t == "object" && t ? {
19282
- [Xg.key]: e,
19364
+ [Qg.key]: e,
19283
19365
  ...t
19284
19366
  } : {
19285
- [Xg.key]: e,
19286
- [Xg.value]: t
19367
+ [Qg.key]: e,
19368
+ [Qg.value]: t
19287
19369
  }, a = {};
19288
19370
  for (let n of l) {
19289
19371
  let o = i[n];
19290
- a[n] = o.includes("{") ? ft.parse(r, o) : o === Xg.key ? e : o === Xg.value ? t : r[o];
19372
+ a[n] = o.includes("{") ? ft.parse(r, o) : o === Qg.key ? e : o === Qg.value ? t : r[o];
19291
19373
  }
19292
19374
  return {
19293
19375
  [fo]: e,
@@ -19304,10 +19386,10 @@ var Mg = () => {
19304
19386
  };
19305
19387
  };
19306
19388
  };
19307
- new c_();
19389
+ new u_();
19308
19390
  //#endregion
19309
19391
  //#region src/providers/auth/firebase/FirebaseAuthProvider.ts
19310
- var l_ = {
19392
+ var d_ = {
19311
19393
  github: "github.com",
19312
19394
  apple: "apple.com",
19313
19395
  microsoft: "microsoft.com",
@@ -19315,11 +19397,11 @@ var l_ = {
19315
19397
  twitter: "twitter.com",
19316
19398
  facebook: "facebook.com"
19317
19399
  };
19318
- function u_(e) {
19319
- let t = l_[e] ?? e;
19400
+ function f_(e) {
19401
+ let t = d_[e] ?? e;
19320
19402
  return new G(t);
19321
19403
  }
19322
- function d_(e) {
19404
+ function p_(e) {
19323
19405
  return e ? {
19324
19406
  uid: e.uid,
19325
19407
  email: e.email ?? void 0,
@@ -19328,7 +19410,7 @@ function d_(e) {
19328
19410
  isAnonymous: e.isAnonymous
19329
19411
  } : null;
19330
19412
  }
19331
- var f_ = class {
19413
+ var m_ = class {
19332
19414
  options;
19333
19415
  appName;
19334
19416
  initPromise;
@@ -19342,7 +19424,7 @@ var f_ = class {
19342
19424
  return this.getConfigurationState().configured;
19343
19425
  }
19344
19426
  getUser() {
19345
- return d_(so(this.appName)?.currentUser ?? null);
19427
+ return p_(so(this.appName)?.currentUser ?? null);
19346
19428
  }
19347
19429
  isAuthenticated() {
19348
19430
  return !!this.getUser();
@@ -19354,18 +19436,18 @@ var f_ = class {
19354
19436
  let n = e.method ?? "password";
19355
19437
  if (n === "anonymous") {
19356
19438
  let { user: e } = await ue(t);
19357
- return d_(e);
19439
+ return p_(e);
19358
19440
  }
19359
19441
  if (n === "oauth") {
19360
19442
  let { provider: n } = e;
19361
19443
  if (!n) throw Error("FirebaseAuthProvider.signIn: provider is required for oauth");
19362
- let { user: r } = await me(t, u_(n));
19363
- return d_(r);
19444
+ let { user: r } = await me(t, f_(n));
19445
+ return p_(r);
19364
19446
  }
19365
19447
  let { email: r, password: i } = e;
19366
19448
  if (!r || !i) throw Error("FirebaseAuthProvider.signIn: email and password are required");
19367
19449
  let { user: a } = await pe(t, r, i);
19368
- return d_(a);
19450
+ return p_(a);
19369
19451
  }
19370
19452
  async signOut() {
19371
19453
  await this.initPromise;
@@ -19376,7 +19458,7 @@ var f_ = class {
19376
19458
  onAuthChange(e) {
19377
19459
  if (!this.options.config) {
19378
19460
  let t = so(this.appName);
19379
- return t ? se(t, (t) => e(d_(t))) : (e(null), () => {});
19461
+ return t ? se(t, (t) => e(p_(t))) : (e(null), () => {});
19380
19462
  }
19381
19463
  let t = () => {}, n = !1;
19382
19464
  return this.initPromise.then(() => {
@@ -19386,7 +19468,7 @@ var f_ = class {
19386
19468
  e(null);
19387
19469
  return;
19388
19470
  }
19389
- t = se(r, (t) => e(d_(t)));
19471
+ t = se(r, (t) => e(p_(t)));
19390
19472
  }), () => {
19391
19473
  n = !0, t();
19392
19474
  };
@@ -19404,26 +19486,26 @@ var f_ = class {
19404
19486
  let { claims: n } = await t.currentUser.getIdTokenResult(e);
19405
19487
  return n;
19406
19488
  }
19407
- }, p_ = "https://oauth2.googleapis.com/token";
19408
- function m_(e) {
19489
+ }, h_ = "https://oauth2.googleapis.com/token";
19490
+ function g_(e) {
19409
19491
  let t = e.replace(/-----BEGIN PRIVATE KEY-----/, "").replace(/-----END PRIVATE KEY-----/, "").replace(/\s+/g, ""), n = atob(t), r = new Uint8Array(n.length);
19410
19492
  for (let e = 0; e < n.length; e++) r[e] = n.charCodeAt(e);
19411
19493
  return r.buffer;
19412
19494
  }
19413
- function h_(e) {
19495
+ function __(e) {
19414
19496
  return btoa(typeof e == "string" ? e : String.fromCharCode(...new Uint8Array(e))).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
19415
19497
  }
19416
- async function g_(e, t) {
19417
- let n = `${h_(JSON.stringify({
19498
+ async function v_(e, t) {
19499
+ let n = `${__(JSON.stringify({
19418
19500
  alg: "RS256",
19419
19501
  typ: "JWT"
19420
- }))}.${h_(JSON.stringify(e))}`, r = await crypto.subtle.importKey("pkcs8", m_(t), {
19502
+ }))}.${__(JSON.stringify(e))}`, r = await crypto.subtle.importKey("pkcs8", g_(t), {
19421
19503
  name: "RSASSA-PKCS1-v1_5",
19422
19504
  hash: "SHA-256"
19423
19505
  }, !1, ["sign"]);
19424
- return `${n}.${h_(await crypto.subtle.sign("RSASSA-PKCS1-v1_5", r, new TextEncoder().encode(n)))}`;
19506
+ return `${n}.${__(await crypto.subtle.sign("RSASSA-PKCS1-v1_5", r, new TextEncoder().encode(n)))}`;
19425
19507
  }
19426
- var __ = class {
19508
+ var y_ = class {
19427
19509
  config;
19428
19510
  cache = /* @__PURE__ */ new Map();
19429
19511
  constructor(e) {
@@ -19432,13 +19514,13 @@ var __ = class {
19432
19514
  async getToken(e = "https://www.googleapis.com/auth/cloud-platform") {
19433
19515
  let t = this.cache.get(e);
19434
19516
  if (t && t.expiresAt > Date.now() + 6e4) return t.token;
19435
- let n = Math.floor(Date.now() / 1e3), r = await g_({
19517
+ let n = Math.floor(Date.now() / 1e3), r = await v_({
19436
19518
  iss: this.config.client_email,
19437
19519
  scope: e,
19438
- aud: p_,
19520
+ aud: h_,
19439
19521
  iat: n,
19440
19522
  exp: n + 3600
19441
- }, this.config.private_key), i = await fetch(p_, {
19523
+ }, this.config.private_key), i = await fetch(h_, {
19442
19524
  method: "POST",
19443
19525
  headers: { "Content-Type": "application/x-www-form-urlencoded" },
19444
19526
  body: new URLSearchParams({
@@ -19456,7 +19538,7 @@ var __ = class {
19456
19538
  expiresAt: Date.now() + (a.expires_in ?? 3600) * 1e3
19457
19539
  }), a.access_token;
19458
19540
  }
19459
- }, v_ = "www.dropbox.com/oauth2", y_ = class {
19541
+ }, b_ = "www.dropbox.com/oauth2", x_ = class {
19460
19542
  config;
19461
19543
  constructor(e) {
19462
19544
  this.config = e;
@@ -19480,7 +19562,7 @@ var __ = class {
19480
19562
  async signIn(e = {}) {
19481
19563
  if (!this.isConfigured()) throw Error("DropboxAuthProvider: missing dropbox.clientId configuration.");
19482
19564
  return Oi({
19483
- authServer: v_,
19565
+ authServer: b_,
19484
19566
  clientID: this.config.clientId,
19485
19567
  scopes: e.scopes,
19486
19568
  refreshParamName: "token_access_type"
@@ -19501,14 +19583,14 @@ var __ = class {
19501
19583
  isAuthenticated() {
19502
19584
  return this.isConfigured() ? !!Ni(this.config.clientId)?.access_token : !1;
19503
19585
  }
19504
- }, b_ = (e) => ({
19586
+ }, S_ = (e) => ({
19505
19587
  uid: e.login,
19506
19588
  displayName: e.name || e.login,
19507
19589
  ...e.email ? { email: e.email } : {},
19508
19590
  ...e.avatarUrl ? { photoURL: e.avatarUrl } : {},
19509
19591
  provider: "github",
19510
19592
  login: e.login
19511
- }), x_ = class {
19593
+ }), C_ = class {
19512
19594
  config;
19513
19595
  user = null;
19514
19596
  listeners = /* @__PURE__ */ new Set();
@@ -19535,7 +19617,7 @@ var __ = class {
19535
19617
  return this.loading ??= fetch(`${this.base}/me`, {
19536
19618
  credentials: "include",
19537
19619
  headers: { Accept: "application/json" }
19538
- }).then(async (e) => e.ok ? b_(await e.json()) : null).catch(() => null).then((e) => (this.setUser(e), e)).finally(() => {
19620
+ }).then(async (e) => e.ok ? S_(await e.json()) : null).catch(() => null).then((e) => (this.setUser(e), e)).finally(() => {
19539
19621
  this.loading = null;
19540
19622
  }), this.loading;
19541
19623
  }
@@ -19559,7 +19641,7 @@ var __ = class {
19559
19641
  let t = (e?.uid ?? null) !== (this.user?.uid ?? null);
19560
19642
  this.user = e, t && this.listeners.forEach((t) => t(e));
19561
19643
  }
19562
- }, S_ = (e) => {
19644
+ }, w_ = (e) => {
19563
19645
  let t = eo("oAuth2");
19564
19646
  if (!t) return console.warn("GoogleAuth: Missing oAuth2.clientId in configuration"), Promise.reject("Google client ID not found");
19565
19647
  let n = e.join(" "), r = `googleAccessToken::${n}`, i = `googleExpiresAt::${n}`;
@@ -19576,8 +19658,8 @@ var __ = class {
19576
19658
  };
19577
19659
  //#endregion
19578
19660
  //#region src/providers/email/google/email.ts
19579
- async function C_({ to: e, bcc: t, subject: n, message: r }) {
19580
- let i = await S_(["https://www.googleapis.com/auth/gmail.send"]), a = [`To: ${e.join(", ")}`];
19661
+ async function T_({ to: e, bcc: t, subject: n, message: r }) {
19662
+ let i = await w_(["https://www.googleapis.com/auth/gmail.send"]), a = [`To: ${e.join(", ")}`];
19581
19663
  t && t.length && a.push(`Bcc: ${t.join(", ")}`);
19582
19664
  let o = [
19583
19665
  ...a,
@@ -19602,7 +19684,7 @@ async function C_({ to: e, bcc: t, subject: n, message: r }) {
19602
19684
  }
19603
19685
  //#endregion
19604
19686
  //#region src/providers/email/google/GmailEmailProvider.ts
19605
- var w_ = class {
19687
+ var E_ = class {
19606
19688
  getConfigurationState() {
19607
19689
  return xi("GmailEmailProvider", bi(eo("oAuth2"), ["clientId"], "google.oAuth2."));
19608
19690
  }
@@ -19611,7 +19693,7 @@ var w_ = class {
19611
19693
  }
19612
19694
  async send(e) {
19613
19695
  if (!this.isConfigured()) throw Error(this.getConfigurationState().reason || "GmailEmailProvider is not configured.");
19614
- await C_({
19696
+ await T_({
19615
19697
  to: Array.isArray(e.to) ? e.to : [e.to],
19616
19698
  bcc: e.bcc ? Array.isArray(e.bcc) ? e.bcc : [e.bcc] : void 0,
19617
19699
  subject: e.subject,
@@ -19621,7 +19703,7 @@ var w_ = class {
19621
19703
  };
19622
19704
  //#endregion
19623
19705
  //#region src/providers/auth/supabase/SupabaseAuthProvider.ts
19624
- function T_(e) {
19706
+ function D_(e) {
19625
19707
  return e ? {
19626
19708
  uid: e.id,
19627
19709
  email: e.email ?? void 0,
@@ -19630,7 +19712,7 @@ function T_(e) {
19630
19712
  raw: e
19631
19713
  } : null;
19632
19714
  }
19633
- var E_ = class {
19715
+ var O_ = class {
19634
19716
  config;
19635
19717
  get client() {
19636
19718
  return wo(this.config.url, this.config.anonKey);
@@ -19645,7 +19727,7 @@ var E_ = class {
19645
19727
  return this.getConfigurationState().configured;
19646
19728
  }
19647
19729
  getUser() {
19648
- return T_((this.client.auth?._session ?? null)?.user ?? null);
19730
+ return D_((this.client.auth?._session ?? null)?.user ?? null);
19649
19731
  }
19650
19732
  isAuthenticated() {
19651
19733
  return !!this.getUser();
@@ -19655,7 +19737,7 @@ var E_ = class {
19655
19737
  if (t === "anonymous") {
19656
19738
  let { data: e, error: t } = await this.client.auth.signInAnonymously();
19657
19739
  if (t) throw t;
19658
- return T_(e.user);
19740
+ return D_(e.user);
19659
19741
  }
19660
19742
  if (t === "magic_link") {
19661
19743
  let t = e.email;
@@ -19684,7 +19766,7 @@ var E_ = class {
19684
19766
  password: r
19685
19767
  });
19686
19768
  if (a) throw a;
19687
- return T_(i.user);
19769
+ return D_(i.user);
19688
19770
  }
19689
19771
  async signOut() {
19690
19772
  let { error: e } = await this.client.auth.signOut();
@@ -19692,10 +19774,10 @@ var E_ = class {
19692
19774
  }
19693
19775
  onAuthChange(e) {
19694
19776
  this.client.auth.getSession().then(({ data: t }) => {
19695
- e(T_(t.session?.user ?? null));
19777
+ e(D_(t.session?.user ?? null));
19696
19778
  });
19697
19779
  let { data: { subscription: t } } = this.client.auth.onAuthStateChange((t, n) => {
19698
- e(T_(n?.user ?? null));
19780
+ e(D_(n?.user ?? null));
19699
19781
  });
19700
19782
  return () => t.unsubscribe();
19701
19783
  }
@@ -19706,15 +19788,15 @@ var E_ = class {
19706
19788
  if (!n) throw Error("SupabaseAuthProvider: no active session");
19707
19789
  return n;
19708
19790
  }
19709
- }, D_ = "https://api.anthropic.com/v1/models", O_ = "https://api.anthropic.com/v1/messages";
19710
- function k_(e) {
19791
+ }, k_ = "https://api.anthropic.com/v1/models", A_ = "https://api.anthropic.com/v1/messages";
19792
+ function j_(e) {
19711
19793
  return {
19712
19794
  name: e.name,
19713
19795
  description: e.description,
19714
19796
  input_schema: e.inputSchema
19715
19797
  };
19716
19798
  }
19717
- function A_(e) {
19799
+ function M_(e) {
19718
19800
  if (e.role === "user") return {
19719
19801
  role: "user",
19720
19802
  content: e.content
@@ -19746,7 +19828,7 @@ function A_(e) {
19746
19828
  }))
19747
19829
  };
19748
19830
  }
19749
- function j_(e) {
19831
+ function N_(e) {
19750
19832
  let t = e?.content;
19751
19833
  if (!Array.isArray(t)) return null;
19752
19834
  let n = t.filter((e) => e?.type === "text").map((e) => String(e.text ?? "")), r = t.filter((e) => e?.type === "tool_use");
@@ -19765,7 +19847,7 @@ function j_(e) {
19765
19847
  text: i
19766
19848
  } : null;
19767
19849
  }
19768
- var M_ = {
19850
+ var P_ = {
19769
19851
  id: "anthropic",
19770
19852
  label: "Anthropic",
19771
19853
  description: "Claude models via the Anthropic API.",
@@ -19789,7 +19871,7 @@ var M_ = {
19789
19871
  supportsDocuments: !0
19790
19872
  },
19791
19873
  discoverModels: async (e) => {
19792
- let t = await nn(D_, { headers: {
19874
+ let t = await nn(k_, { headers: {
19793
19875
  "x-api-key": e,
19794
19876
  "anthropic-version": "2023-06-01"
19795
19877
  } }, Fu);
@@ -19817,7 +19899,7 @@ var M_ = {
19817
19899
  type: "text",
19818
19900
  text: t.prompt
19819
19901
  }] : t.prompt;
19820
- return j_(await nn(O_, {
19902
+ return N_(await nn(A_, {
19821
19903
  method: "POST",
19822
19904
  headers: {
19823
19905
  "x-api-key": e,
@@ -19828,19 +19910,19 @@ var M_ = {
19828
19910
  model: t.model,
19829
19911
  max_tokens: 4096,
19830
19912
  ...t.role ? { system: xu.parseRole(t.role, t) } : {},
19831
- messages: [...(t.history ?? []).map(A_), ...t.prompt ? [{
19913
+ messages: [...(t.history ?? []).map(M_), ...t.prompt ? [{
19832
19914
  role: "user",
19833
19915
  content: r
19834
19916
  }] : []],
19835
- ...t.tools?.length ? { tools: t.tools.map(k_) } : {},
19917
+ ...t.tools?.length ? { tools: t.tools.map(j_) } : {},
19836
19918
  ...typeof t.temperature == "number" ? { temperature: t.temperature } : {},
19837
19919
  ...Hu(t.model, t.reasoning)
19838
19920
  },
19839
19921
  signal: t.signal
19840
19922
  }, Fu));
19841
19923
  }
19842
- }, N_ = (e) => typeof e.id == "string" ? e.id : void 0, P_ = (e) => e.replace(/\/+$/, "");
19843
- function F_(e) {
19924
+ }, F_ = (e) => typeof e.id == "string" ? e.id : void 0, I_ = (e) => e.replace(/\/+$/, "");
19925
+ function L_(e) {
19844
19926
  return {
19845
19927
  type: "function",
19846
19928
  function: {
@@ -19850,7 +19932,7 @@ function F_(e) {
19850
19932
  }
19851
19933
  };
19852
19934
  }
19853
- function I_(e) {
19935
+ function R_(e) {
19854
19936
  if (typeof e != "string") return {};
19855
19937
  try {
19856
19938
  return JSON.parse(e);
@@ -19858,7 +19940,7 @@ function I_(e) {
19858
19940
  return {};
19859
19941
  }
19860
19942
  }
19861
- function L_(e) {
19943
+ function z_(e) {
19862
19944
  return e.role === "user" ? [{
19863
19945
  role: "user",
19864
19946
  content: e.content
@@ -19879,7 +19961,7 @@ function L_(e) {
19879
19961
  content: typeof e.output == "string" ? e.output : JSON.stringify(e.output)
19880
19962
  }));
19881
19963
  }
19882
- function R_(e) {
19964
+ function B_(e) {
19883
19965
  let t = e?.choices?.[0]?.message;
19884
19966
  if (!t) return null;
19885
19967
  let n = Array.isArray(t.tool_calls) ? t.tool_calls : [];
@@ -19892,7 +19974,7 @@ function R_(e) {
19892
19974
  return {
19893
19975
  id: String(e.id),
19894
19976
  name: String(t.name ?? ""),
19895
- input: I_(t.arguments)
19977
+ input: R_(t.arguments)
19896
19978
  };
19897
19979
  }),
19898
19980
  text: e || void 0
@@ -19904,8 +19986,8 @@ function R_(e) {
19904
19986
  text: r
19905
19987
  } : null;
19906
19988
  }
19907
- var z_ = ({ id: e, label: t, description: n, configKey: r, requiredConfigKeys: i, defaultModel: a, fallbackModels: o, baseUrl: s, modelsUrl: c, chatCompletionsUrl: l, dashboardUrl: u, credentialsHint: f, validateApiKey: p, mapModelEntry: m = N_, reasoningStyle: h }) => {
19908
- let g = P_(s), _ = c || `${g}/models`, v = l || `${g}/chat/completions`;
19989
+ var V_ = ({ id: e, label: t, description: n, configKey: r, requiredConfigKeys: i, defaultModel: a, fallbackModels: o, baseUrl: s, modelsUrl: c, chatCompletionsUrl: l, dashboardUrl: u, credentialsHint: f, validateApiKey: p, mapModelEntry: m = F_, reasoningStyle: h }) => {
19990
+ let g = I_(s), _ = c || `${g}/models`, v = l || `${g}/chat/completions`;
19909
19991
  return {
19910
19992
  id: e,
19911
19993
  label: t,
@@ -19982,23 +20064,23 @@ var z_ = ({ id: e, label: t, description: n, configKey: r, requiredConfigKeys: i
19982
20064
  role: "system",
19983
20065
  content: xu.parseRole(n.role, n)
19984
20066
  }] : [],
19985
- ...(n.history ?? []).flatMap(L_),
20067
+ ...(n.history ?? []).flatMap(z_),
19986
20068
  ...n.prompt ? [{
19987
20069
  role: "user",
19988
20070
  content: i
19989
20071
  }] : []
19990
20072
  ],
19991
- ...n.tools?.length ? { tools: n.tools.map(F_) } : {},
20073
+ ...n.tools?.length ? { tools: n.tools.map(L_) } : {},
19992
20074
  ...typeof n.temperature == "number" ? { temperature: n.temperature } : {},
19993
20075
  ...Wu(n.model, n.reasoning, h)
19994
20076
  },
19995
20077
  signal: n.signal
19996
20078
  }, Fu);
19997
20079
  if (!a) throw Ku(t);
19998
- return R_(a);
20080
+ return B_(a);
19999
20081
  }
20000
20082
  };
20001
- }, B_ = "https://api.cloudflare.com/client/v4", V_ = 100, H_ = 5, U_ = /-guard-/, W_ = "Cloudflare Workers AI", G_ = "Open-weight models (Llama, GPT-OSS, Qwen, Gemma, GLM…) with a free daily allowance.", K_ = "https://dash.cloudflare.com/?to=/:account/ai/workers-ai", q_ = "Cloudflare dashboard → AI → Workers AI → REST API: create a Workers AI API token and copy the Account ID.", J_ = [{
20083
+ }, H_ = "https://api.cloudflare.com/client/v4", U_ = 100, W_ = 5, G_ = /-guard-/, K_ = "Cloudflare Workers AI", q_ = "Open-weight models (Llama, GPT-OSS, Qwen, Gemma, GLM…) with a free daily allowance.", J_ = "https://dash.cloudflare.com/?to=/:account/ai/workers-ai", Y_ = "Cloudflare dashboard → AI → Workers AI → REST API: create a Workers AI API token and copy the Account ID.", X_ = [{
20002
20084
  key: "apiKey",
20003
20085
  label: "API Token",
20004
20086
  type: "password"
@@ -20007,7 +20089,7 @@ var z_ = ({ id: e, label: t, description: n, configKey: r, requiredConfigKeys: i
20007
20089
  label: "Account ID",
20008
20090
  type: "text",
20009
20091
  placeholder: "32-character account id"
20010
- }], Y_ = (e, t) => (e.properties ?? []).some((e) => e.property_id === t && String(e.value) === "true"), X_ = (e) => {
20092
+ }], Z_ = (e, t) => (e.properties ?? []).some((e) => e.property_id === t && String(e.value) === "true"), Q_ = (e) => {
20011
20093
  let t = (e.properties ?? []).find((e) => e.property_id === "price")?.value;
20012
20094
  if (!Array.isArray(t)) return;
20013
20095
  let n = (e) => {
@@ -20020,11 +20102,11 @@ var z_ = ({ id: e, label: t, description: n, configKey: r, requiredConfigKeys: i
20020
20102
  currency: "USD",
20021
20103
  source: "provider"
20022
20104
  };
20023
- }, Z_ = (e) => e?.map((e) => e.role === "assistant" && !e.content ? {
20105
+ }, $_ = (e) => e?.map((e) => e.role === "assistant" && !e.content ? {
20024
20106
  ...e,
20025
20107
  content: ""
20026
- } : e), Q_ = ({ accountId: e, defaultModel: t = "@cf/meta/llama-3.3-70b-instruct-fp8-fast", includePaidModels: n = !1 }) => {
20027
- let r = `${B_}/accounts/${encodeURIComponent(e.trim())}`, i = `${r}/ai/models/search`, a = (e, t, n) => {
20108
+ } : e), ev = ({ accountId: e, defaultModel: t = "@cf/meta/llama-3.3-70b-instruct-fp8-fast", includePaidModels: n = !1 }) => {
20109
+ let r = `${H_}/accounts/${encodeURIComponent(e.trim())}`, i = `${r}/ai/models/search`, a = (e, t, n) => {
20028
20110
  let r = new URLSearchParams({
20029
20111
  task: "Text Generation",
20030
20112
  hide_experimental: "true",
@@ -20032,10 +20114,10 @@ var z_ = ({ id: e, label: t, description: n, configKey: r, requiredConfigKeys: i
20032
20114
  per_page: String(n)
20033
20115
  });
20034
20116
  return nn(`${i}?${r}`, { headers: { Authorization: `Bearer ${e}` } }, Fu);
20035
- }, o = z_({
20117
+ }, o = V_({
20036
20118
  id: "cloudflare",
20037
- label: W_,
20038
- description: G_,
20119
+ label: K_,
20120
+ description: q_,
20039
20121
  configKey: "cloudflare",
20040
20122
  requiredConfigKeys: ["ai.cloudflare.apiToken", "ai.cloudflare.accountId"],
20041
20123
  defaultModel: t,
@@ -20046,8 +20128,8 @@ var z_ = ({ id: e, label: t, description: n, configKey: r, requiredConfigKeys: i
20046
20128
  "@cf/meta/llama-4-scout-17b-16e-instruct"
20047
20129
  ].filter((e, t, n) => n.indexOf(e) === t),
20048
20130
  baseUrl: `${r}/ai/v1`,
20049
- dashboardUrl: K_,
20050
- credentialsHint: q_,
20131
+ dashboardUrl: J_,
20132
+ credentialsHint: Y_,
20051
20133
  validateApiKey: async (e) => {
20052
20134
  try {
20053
20135
  let t = await a(e, 1, 1);
@@ -20068,33 +20150,33 @@ var z_ = ({ id: e, label: t, description: n, configKey: r, requiredConfigKeys: i
20068
20150
  });
20069
20151
  return {
20070
20152
  ...o,
20071
- credentialFields: J_,
20153
+ credentialFields: X_,
20072
20154
  discoverModels: async (e) => {
20073
20155
  let t = [];
20074
- for (let r = 1; r <= H_; r++) {
20075
- let i = await a(e, r, V_), o = Array.isArray(i?.result) ? i.result : [];
20076
- if (o.filter((e) => !U_.test(e.name ?? "")).filter((e) => n || !Y_(e, "require_workers_paid")).forEach((e) => {
20156
+ for (let r = 1; r <= W_; r++) {
20157
+ let i = await a(e, r, U_), o = Array.isArray(i?.result) ? i.result : [];
20158
+ if (o.filter((e) => !G_.test(e.name ?? "")).filter((e) => n || !Z_(e, "require_workers_paid")).forEach((e) => {
20077
20159
  e.name && t.push({
20078
20160
  model: e.name,
20079
- pricing: X_(e)
20161
+ pricing: Q_(e)
20080
20162
  });
20081
- }), o.length < V_) break;
20163
+ }), o.length < U_) break;
20082
20164
  }
20083
20165
  return t;
20084
20166
  },
20085
20167
  complete: (e, t) => o.complete(e, {
20086
20168
  ...t,
20087
- history: Z_(t.history)
20169
+ history: $_(t.history)
20088
20170
  })
20089
20171
  };
20090
- }, $_ = {
20172
+ }, tv = {
20091
20173
  id: "cloudflare",
20092
- label: W_,
20093
- description: G_,
20094
- credentialFields: J_,
20095
- credentialsUrl: K_,
20096
- credentialsHint: q_
20097
- }, ev = z_({
20174
+ label: K_,
20175
+ description: q_,
20176
+ credentialFields: X_,
20177
+ credentialsUrl: J_,
20178
+ credentialsHint: Y_
20179
+ }, nv = V_({
20098
20180
  id: "deepseek",
20099
20181
  label: "DeepSeek",
20100
20182
  description: "Cost-efficient reasoning and chat models.",
@@ -20104,15 +20186,15 @@ var z_ = ({ id: e, label: t, description: n, configKey: r, requiredConfigKeys: i
20104
20186
  baseUrl: "https://api.deepseek.com",
20105
20187
  dashboardUrl: "https://platform.deepseek.com/api_keys",
20106
20188
  credentialsHint: "DeepSeek platform → API Keys → Create new API key."
20107
- }), tv = "https://generativelanguage.googleapis.com/v1beta/models", nv = "https://generativelanguage.googleapis.com/v1beta/models";
20108
- function rv(e) {
20189
+ }), rv = "https://generativelanguage.googleapis.com/v1beta/models", iv = "https://generativelanguage.googleapis.com/v1beta/models";
20190
+ function av(e) {
20109
20191
  return [{ function_declarations: e.map((e) => ({
20110
20192
  name: e.name,
20111
20193
  description: e.description,
20112
20194
  parameters: e.inputSchema
20113
20195
  })) }];
20114
20196
  }
20115
- function iv(e) {
20197
+ function ov(e) {
20116
20198
  if (e.role === "user") return {
20117
20199
  role: "user",
20118
20200
  parts: [{ text: e.content }]
@@ -20137,7 +20219,7 @@ function iv(e) {
20137
20219
  } }))
20138
20220
  };
20139
20221
  }
20140
- function av(e) {
20222
+ function sv(e) {
20141
20223
  let t = e?.candidates?.[0]?.content?.parts;
20142
20224
  if (!Array.isArray(t)) return null;
20143
20225
  let n = t.filter((e) => typeof e?.text == "string").map((e) => e.text), r = t.filter((e) => e?.functionCall);
@@ -20156,7 +20238,7 @@ function av(e) {
20156
20238
  text: i
20157
20239
  } : null;
20158
20240
  }
20159
- var ov = {
20241
+ var cv = {
20160
20242
  id: "gemini",
20161
20243
  label: "Gemini",
20162
20244
  description: "Google's multimodal Gemini model family.",
@@ -20180,12 +20262,12 @@ var ov = {
20180
20262
  supportsDocuments: !0
20181
20263
  },
20182
20264
  discoverModels: async (e) => {
20183
- let t = await nn(`${tv}?key=${e}`, null, Fu);
20265
+ let t = await nn(`${rv}?key=${e}`, null, Fu);
20184
20266
  return Array.isArray(t?.models) ? t.models.map((e) => e.name?.replace(/^models\//, "")).filter(Boolean) : [];
20185
20267
  },
20186
20268
  validateApiKey: async (e) => {
20187
20269
  try {
20188
- let t = await nn(`${tv}?key=${e}`, null, Fu);
20270
+ let t = await nn(`${rv}?key=${e}`, null, Fu);
20189
20271
  return t === null ? {
20190
20272
  valid: !1,
20191
20273
  error: "Nessuna risposta dal server (CORS o rete)"
@@ -20206,22 +20288,22 @@ var ov = {
20206
20288
  mime_type: e.mimeType,
20207
20289
  data: e.base64
20208
20290
  } }), { text: t.prompt }];
20209
- return av(await nn(`${nv}/${t.model}:generateContent?key=${e}`, {
20291
+ return sv(await nn(`${iv}/${t.model}:generateContent?key=${e}`, {
20210
20292
  method: "POST",
20211
20293
  headers: t.logId ? { [d]: t.logId } : void 0,
20212
20294
  body: {
20213
- contents: [...(t.history ?? []).map(iv), ...t.prompt ? [{
20295
+ contents: [...(t.history ?? []).map(ov), ...t.prompt ? [{
20214
20296
  role: "user",
20215
20297
  parts: n
20216
20298
  }] : []],
20217
20299
  ...t.role ? { systemInstruction: { parts: [{ text: xu.parseRole(t.role, t) }] } } : {},
20218
- ...t.tools?.length ? { tools: rv(t.tools) } : {},
20300
+ ...t.tools?.length ? { tools: av(t.tools) } : {},
20219
20301
  generationConfig: typeof t.temperature == "number" ? { temperature: t.temperature } : void 0
20220
20302
  },
20221
20303
  signal: t.signal
20222
20304
  }, Fu));
20223
20305
  }
20224
- }, sv = z_({
20306
+ }, lv = V_({
20225
20307
  id: "mistral",
20226
20308
  label: "Mistral",
20227
20309
  description: "European-hosted open and commercial language models.",
@@ -20235,7 +20317,7 @@ var ov = {
20235
20317
  baseUrl: "https://api.mistral.ai/v1",
20236
20318
  dashboardUrl: "https://console.mistral.ai/api-keys",
20237
20319
  credentialsHint: "Mistral Console → API Keys → Create new key."
20238
- }), cv = /whisper|orpheus|tts|guard/i, lv = z_({
20320
+ }), uv = /whisper|orpheus|tts|guard/i, dv = V_({
20239
20321
  id: "groq",
20240
20322
  label: "Groq",
20241
20323
  description: "Very fast inference on open-weight models, with a free tier.",
@@ -20245,8 +20327,8 @@ var ov = {
20245
20327
  baseUrl: "https://api.groq.com/openai/v1",
20246
20328
  dashboardUrl: "https://console.groq.com/keys",
20247
20329
  credentialsHint: "Groq Console → API Keys → Create API Key.",
20248
- mapModelEntry: (e) => typeof e.id == "string" && e.active !== !1 && !cv.test(e.id) ? e.id : void 0
20249
- }), uv = z_({
20330
+ mapModelEntry: (e) => typeof e.id == "string" && e.active !== !1 && !uv.test(e.id) ? e.id : void 0
20331
+ }), fv = V_({
20250
20332
  id: "openai",
20251
20333
  label: "OpenAI",
20252
20334
  description: "GPT models via the OpenAI API.",
@@ -20264,8 +20346,8 @@ var ov = {
20264
20346
  baseUrl: "https://api.openai.com/v1",
20265
20347
  dashboardUrl: "https://platform.openai.com/api-keys",
20266
20348
  credentialsHint: "OpenAI dashboard → API keys → Create new secret key."
20267
- }), dv = "https://opencode.ai/zen/v1/models", fv = "https://opencode.ai/zen/v1/chat/completions", pv = "deepseek-v4.1-flash", mv = [
20268
- pv,
20349
+ }), pv = "https://opencode.ai/zen/v1/models", mv = "https://opencode.ai/zen/v1/chat/completions", hv = "deepseek-v4.1-flash", gv = [
20350
+ hv,
20269
20351
  "deepseek-v4-pro",
20270
20352
  "glm-5.3",
20271
20353
  "glm-5.3-flash",
@@ -20273,13 +20355,13 @@ var ov = {
20273
20355
  "kimi-k3",
20274
20356
  "minimax-m3",
20275
20357
  "qwen3.8-flash"
20276
- ], hv = /-free$/, gv = /* @__PURE__ */ new Set(["big-pickle"]), _v = (e) => hv.test(e) || gv.has(e), vv = {
20358
+ ], _v = /-free$/, vv = /* @__PURE__ */ new Set(["big-pickle"]), yv = (e) => _v.test(e) || vv.has(e), bv = {
20277
20359
  id: "opencode",
20278
20360
  label: "OpenCode",
20279
20361
  description: "OpenCode Zen — a curated set of coding-focused models.",
20280
20362
  configKey: "openCodeApiKey",
20281
- defaultModel: pv,
20282
- fallbackModels: mv,
20363
+ defaultModel: hv,
20364
+ fallbackModels: gv,
20283
20365
  dashboardUrl: "https://opencode.ai",
20284
20366
  credentialsHint: "OpenCode Zen dashboard → API Keys → Create Key.",
20285
20367
  credentialFields: [{
@@ -20293,12 +20375,12 @@ var ov = {
20293
20375
  supportsDocuments: !0
20294
20376
  },
20295
20377
  discoverModels: async (e) => {
20296
- let t = await nn(dv, { headers: { Authorization: `Bearer ${e}` } }, Fu);
20297
- return (Array.isArray(t?.data) ? t.data : Array.isArray(t?.models) ? t.models : Array.isArray(t) ? t : []).map((e) => e.id).filter((e) => typeof e == "string" && e.length > 0).filter((e) => !_v(e));
20378
+ let t = await nn(pv, { headers: { Authorization: `Bearer ${e}` } }, Fu);
20379
+ return (Array.isArray(t?.data) ? t.data : Array.isArray(t?.models) ? t.models : Array.isArray(t) ? t : []).map((e) => e.id).filter((e) => typeof e == "string" && e.length > 0).filter((e) => !yv(e));
20298
20380
  },
20299
- complete: (e, t) => yv(fv, "OpenCode", e, t)
20381
+ complete: (e, t) => xv(mv, "OpenCode", e, t)
20300
20382
  };
20301
- async function yv(e, t, n, r, i = {}) {
20383
+ async function xv(e, t, n, r, i = {}) {
20302
20384
  let a = r.attachments ?? [], o = a.length > 0 ? a.map((e) => e.mimeType.startsWith("image/") ? {
20303
20385
  type: "image_url",
20304
20386
  image_url: { url: `data:${e.mimeType};base64,${e.base64}` }
@@ -20325,25 +20407,25 @@ async function yv(e, t, n, r, i = {}) {
20325
20407
  role: "system",
20326
20408
  content: xu.parseRole(r.role, r)
20327
20409
  }] : [],
20328
- ...(r.history ?? []).flatMap(L_),
20410
+ ...(r.history ?? []).flatMap(z_),
20329
20411
  ...r.prompt ? [{
20330
20412
  role: "user",
20331
20413
  content: o
20332
20414
  }] : []
20333
20415
  ],
20334
- ...r.tools?.length ? { tools: r.tools.map(F_) } : {},
20416
+ ...r.tools?.length ? { tools: r.tools.map(L_) } : {},
20335
20417
  ...typeof r.temperature == "number" ? { temperature: r.temperature } : {},
20336
20418
  ...Wu(r.model, r.reasoning)
20337
20419
  },
20338
20420
  signal: r.signal
20339
20421
  }, Fu);
20340
20422
  if (!s) throw Ku(t);
20341
- return R_(s);
20423
+ return B_(s);
20342
20424
  }
20343
20425
  //#endregion
20344
20426
  //#region src/providers/ai/opencodeGo.ts
20345
- var bv = "https://opencode.ai/zen/go/v1/models", xv = "https://opencode.ai/zen/go/v1/chat/completions", Sv = "x-opencode-session", Cv = "kimi-k3", wv = [
20346
- Cv,
20427
+ var Sv = "https://opencode.ai/zen/go/v1/models", Cv = "https://opencode.ai/zen/go/v1/chat/completions", wv = "x-opencode-session", Tv = "kimi-k3", Ev = [
20428
+ Tv,
20347
20429
  "kimi-k3.1-pro",
20348
20430
  "glm-5.3",
20349
20431
  "glm-5.3-flash",
@@ -20354,13 +20436,13 @@ var bv = "https://opencode.ai/zen/go/v1/models", xv = "https://opencode.ai/zen/g
20354
20436
  "minimax-m3",
20355
20437
  "claude-haiku-5-5",
20356
20438
  "gemini-4-argon"
20357
- ], Tv = () => typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID() : `s-${Date.now()}-${Math.random().toString(36).slice(2)}`, Ev = {
20439
+ ], Dv = () => typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID() : `s-${Date.now()}-${Math.random().toString(36).slice(2)}`, Ov = {
20358
20440
  id: "opencode-go",
20359
20441
  label: "OpenCode Go",
20360
20442
  description: "OpenCode Go — a monthly subscription to open and frontier coding models, with an API key.",
20361
20443
  configKey: "openCodeGoApiKey",
20362
- defaultModel: Cv,
20363
- fallbackModels: wv,
20444
+ defaultModel: Tv,
20445
+ fallbackModels: Ev,
20364
20446
  dashboardUrl: "https://opencode.ai/go",
20365
20447
  credentialsHint: "OpenCode Console → subscribe to Go → API key.",
20366
20448
  credentialFields: [{
@@ -20374,11 +20456,11 @@ var bv = "https://opencode.ai/zen/go/v1/models", xv = "https://opencode.ai/zen/g
20374
20456
  supportsDocuments: !0
20375
20457
  },
20376
20458
  discoverModels: async (e) => {
20377
- let t = await nn(bv, { headers: { Authorization: `Bearer ${e}` } }, Fu);
20378
- return (Array.isArray(t?.data) ? t.data : []).map((e) => e.id).filter((e) => typeof e == "string" && e.length > 0).filter((e) => !_v(e));
20459
+ let t = await nn(Sv, { headers: { Authorization: `Bearer ${e}` } }, Fu);
20460
+ return (Array.isArray(t?.data) ? t.data : []).map((e) => e.id).filter((e) => typeof e == "string" && e.length > 0).filter((e) => !yv(e));
20379
20461
  },
20380
- complete: (e, t) => yv(xv, "OpenCode Go", e, t, { [Sv]: t.logId || Tv() })
20381
- }, Dv = (e) => {
20462
+ complete: (e, t) => xv(Cv, "OpenCode Go", e, t, { [wv]: t.logId || Dv() })
20463
+ }, kv = (e) => {
20382
20464
  if (!e || typeof e != "object") return;
20383
20465
  let { prompt: t, completion: n } = e, r = Number(t), i = Number(n);
20384
20466
  if (t === void 0 || n === void 0 || !Number.isFinite(r) || !Number.isFinite(i) || r < 0 || i < 0) return;
@@ -20389,7 +20471,7 @@ var bv = "https://opencode.ai/zen/go/v1/models", xv = "https://opencode.ai/zen/g
20389
20471
  currency: "USD",
20390
20472
  source: "provider"
20391
20473
  };
20392
- }, Ov = z_({
20474
+ }, Av = V_({
20393
20475
  id: "openrouter",
20394
20476
  label: "OpenRouter",
20395
20477
  description: "Unified access to many model providers through one API.",
@@ -20406,7 +20488,7 @@ var bv = "https://opencode.ai/zen/go/v1/models", xv = "https://opencode.ai/zen/g
20406
20488
  credentialsHint: "OpenRouter → Settings → API Keys → Create Key.",
20407
20489
  mapModelEntry: (e) => typeof e.id == "string" ? {
20408
20490
  model: e.id,
20409
- pricing: Dv(e.pricing)
20491
+ pricing: kv(e.pricing)
20410
20492
  } : void 0,
20411
20493
  validateApiKey: async (e) => {
20412
20494
  try {
@@ -20428,10 +20510,10 @@ var bv = "https://opencode.ai/zen/go/v1/models", xv = "https://opencode.ai/zen/g
20428
20510
  };
20429
20511
  }
20430
20512
  }
20431
- }), kv = {
20513
+ }), jv = {
20432
20514
  dbRealtime: {
20433
20515
  service: "data",
20434
- create: () => new c_()
20516
+ create: () => new u_()
20435
20517
  },
20436
20518
  firestoreDb: {
20437
20519
  service: "data",
@@ -20443,30 +20525,30 @@ var bv = "https://opencode.ai/zen/go/v1/models", xv = "https://opencode.ai/zen/g
20443
20525
  },
20444
20526
  firebaseAuth: {
20445
20527
  service: "auth",
20446
- create: () => new f_()
20528
+ create: () => new m_()
20447
20529
  }
20448
- }, Av = {
20530
+ }, Mv = {
20449
20531
  googleAuth: {
20450
20532
  service: "auth",
20451
- create: () => new Ug()
20533
+ create: () => new Gg()
20452
20534
  },
20453
20535
  gmail: {
20454
20536
  service: "email",
20455
- create: () => new w_()
20537
+ create: () => new E_()
20456
20538
  },
20457
20539
  googleServiceAccount: {
20458
20540
  service: "credentials",
20459
- create: (e) => new __(e.serviceAccount),
20541
+ create: (e) => new y_(e.serviceAccount),
20460
20542
  when: (e) => !!e.serviceAccount
20461
20543
  }
20462
- }, jv = { dropboxAuth: {
20544
+ }, Nv = { dropboxAuth: {
20463
20545
  service: "auth",
20464
- create: (e) => new y_(e)
20465
- } }, Mv = { githubAuth: {
20546
+ create: (e) => new x_(e)
20547
+ } }, Pv = { githubAuth: {
20466
20548
  service: "auth",
20467
- create: (e) => new x_(e),
20549
+ create: (e) => new C_(e),
20468
20550
  when: (e) => !!e?.sessionUrl?.trim()
20469
- } }, Nv = {
20551
+ } }, Fv = {
20470
20552
  supabaseDb: {
20471
20553
  service: "data",
20472
20554
  create: (e) => new Fo(e)
@@ -20477,35 +20559,35 @@ var bv = "https://opencode.ai/zen/go/v1/models", xv = "https://opencode.ai/zen/g
20477
20559
  },
20478
20560
  supabaseAuth: {
20479
20561
  service: "auth",
20480
- create: (e) => new E_(e)
20562
+ create: (e) => new O_(e)
20481
20563
  }
20482
- }, Pv = { mock: {
20564
+ }, Iv = { mock: {
20483
20565
  service: "data",
20484
20566
  create: (e) => new Ho(e?.data)
20485
- } }, Fv = (e, t) => ({
20567
+ } }, Lv = (e, t) => ({
20486
20568
  service: "ai",
20487
20569
  create: (n) => new Qu(e, n?.[t] || ""),
20488
20570
  when: (e) => !!e?.[t]
20489
- }), Iv = {
20490
- firebase: kv,
20491
- google: Av,
20492
- dropbox: jv,
20493
- github: Mv,
20494
- supabase: Nv,
20495
- mock: Pv,
20571
+ }), Rv = {
20572
+ firebase: jv,
20573
+ google: Mv,
20574
+ dropbox: Nv,
20575
+ github: Pv,
20576
+ supabase: Fv,
20577
+ mock: Iv,
20496
20578
  ai: {
20497
- openai: Fv(uv, "openaiApiKey"),
20498
- openrouter: Fv(Ov, "openRouterApiKey"),
20499
- opencode: Fv(vv, "openCodeApiKey"),
20500
- "opencode-go": Fv(Ev, "openCodeGoApiKey"),
20501
- deepseek: Fv(ev, "deepSeekApiKey"),
20502
- gemini: Fv(ov, "geminiApiKey"),
20503
- anthropic: Fv(M_, "anthropicApiKey"),
20504
- mistral: Fv(sv, "mistralApiKey"),
20505
- groq: Fv(lv, "groqApiKey"),
20579
+ openai: Lv(fv, "openaiApiKey"),
20580
+ openrouter: Lv(Av, "openRouterApiKey"),
20581
+ opencode: Lv(bv, "openCodeApiKey"),
20582
+ "opencode-go": Lv(Ov, "openCodeGoApiKey"),
20583
+ deepseek: Lv(nv, "deepSeekApiKey"),
20584
+ gemini: Lv(cv, "geminiApiKey"),
20585
+ anthropic: Lv(P_, "anthropicApiKey"),
20586
+ mistral: Lv(lv, "mistralApiKey"),
20587
+ groq: Lv(dv, "groqApiKey"),
20506
20588
  cloudflare: {
20507
20589
  service: "ai",
20508
- create: (e) => new Qu(Q_({
20590
+ create: (e) => new Qu(ev({
20509
20591
  accountId: e?.cloudflare?.accountId?.trim() || "",
20510
20592
  defaultModel: e?.cloudflare?.defaultModel?.trim() || void 0,
20511
20593
  includePaidModels: e?.cloudflare?.includePaidModels
@@ -20513,8 +20595,8 @@ var bv = "https://opencode.ai/zen/go/v1/models", xv = "https://opencode.ai/zen/g
20513
20595
  when: (e) => !!e?.cloudflare?.apiToken?.trim() && !!e?.cloudflare?.accountId?.trim()
20514
20596
  }
20515
20597
  }
20516
- }, Lv = () => /* @__PURE__ */ f.createElement("div", { className: "flex min-h-[calc(100vh-4rem)] items-center justify-center" }, /* @__PURE__ */ f.createElement("div", { className: "h-8 w-8 animate-spin rounded-full border-2 border-muted border-t-primary" }));
20517
- function Rv(e, t) {
20598
+ }, zv = () => /* @__PURE__ */ f.createElement("div", { className: "flex min-h-[calc(100vh-4rem)] items-center justify-center" }, /* @__PURE__ */ f.createElement("div", { className: "h-8 w-8 animate-spin rounded-full border-2 border-muted border-t-primary" }));
20599
+ function Bv(e, t) {
20518
20600
  if (!t) return;
20519
20601
  let n = t, r = typeof t == "object" && !Array.isArray(t) ? Object.entries(n) : [];
20520
20602
  if (r.length > 0 && r.every(([, e]) => typeof e == "object" && !!e)) {
@@ -20523,10 +20605,10 @@ function Rv(e, t) {
20523
20605
  }
20524
20606
  e.custom = t;
20525
20607
  }
20526
- function zv(e, t, n = "default") {
20608
+ function Vv(e, t, n = "default") {
20527
20609
  return t && e[t] ? t : Object.keys(e)[0] ?? n;
20528
20610
  }
20529
- function Bv(e = {}) {
20611
+ function Hv(e = {}) {
20530
20612
  let t = {
20531
20613
  data: {},
20532
20614
  storage: {},
@@ -20535,24 +20617,24 @@ function Bv(e = {}) {
20535
20617
  ai: {},
20536
20618
  credentials: {}
20537
20619
  }, n = (e) => t[e] ??= {};
20538
- for (let [t, r] of Object.entries(Iv)) {
20620
+ for (let [t, r] of Object.entries(Rv)) {
20539
20621
  let i = e[t];
20540
20622
  if (i !== void 0) for (let [e, t] of Object.entries(r)) (!t.when || t.when(i)) && (n(t.service)[e] = t.create(i));
20541
20623
  }
20542
- for (let [t, r] of Object.entries(e.custom ?? {})) Rv(n(t), r);
20543
- Object.keys(t.data).length === 0 && (t.data.mock = new Ho()), Object.keys(t.auth).length === 0 && (t.auth.googleAuth = new Ug());
20624
+ for (let [t, r] of Object.entries(e.custom ?? {})) Bv(n(t), r);
20625
+ Object.keys(t.data).length === 0 && (t.data.mock = new Ho()), Object.keys(t.auth).length === 0 && (t.auth.googleAuth = new Gg());
20544
20626
  let r = e.services ?? {}, i = {};
20545
20627
  for (let [e, n] of Object.entries(t)) i[e] = {
20546
20628
  registry: n,
20547
- defaultKey: zv(n, r[e])
20629
+ defaultKey: Vv(n, r[e])
20548
20630
  };
20549
20631
  return i;
20550
20632
  }
20551
- var Vv = {}, Hv = (e) => {
20552
- Vv = e;
20553
- }, Uv = (e) => Vv[e] || [];
20554
- function Wv({ contextProviders: e, providers: t = {}, appName: n = "LLM Native", scrapeConfig: r, iconProvider: i, googleMaps: a, themeProvider: o, i18n: s, children: c, errorReportUrl: l, debug: u, basename: d }) {
20555
- let [p, m] = E(() => Bv(t)), h = T(p);
20633
+ var Uv = {}, Wv = (e) => {
20634
+ Uv = e;
20635
+ }, Gv = (e) => Uv[e] || [];
20636
+ function Kv({ contextProviders: e, providers: t = {}, appName: n = "LLM Native", scrapeConfig: r, iconProvider: i, googleMaps: a, themeProvider: o, i18n: s, children: c, errorReportUrl: l, debug: u, basename: d }) {
20637
+ let [p, m] = E(() => Hv(t)), h = T(p);
20556
20638
  h.current = p;
20557
20639
  let g = T(void 0);
20558
20640
  g.current ||= (async (e, t, n) => {
@@ -20569,7 +20651,7 @@ function Wv({ contextProviders: e, providers: t = {}, appName: n = "LLM Native",
20569
20651
  })));
20570
20652
  });
20571
20653
  let _ = g.current, v = e ?? f.Fragment;
20572
- return /* @__PURE__ */ f.createElement(Vg, {
20654
+ return /* @__PURE__ */ f.createElement(Ug, {
20573
20655
  fullPage: !0,
20574
20656
  reportUrl: l,
20575
20657
  debug: u
@@ -20591,10 +20673,10 @@ function Wv({ contextProviders: e, providers: t = {}, appName: n = "LLM Native",
20591
20673
  } }, /* @__PURE__ */ f.createElement(Ha, {
20592
20674
  registries: p,
20593
20675
  setProvider: _
20594
- }, /* @__PURE__ */ f.createElement(gi, p.auth, /* @__PURE__ */ f.createElement(Jg, p.credentials, /* @__PURE__ */ f.createElement(zi, p.data, /* @__PURE__ */ f.createElement(Fl, p.storage, /* @__PURE__ */ f.createElement(Gg, p.email, /* @__PURE__ */ f.createElement(Eu, p.ai, /* @__PURE__ */ f.createElement(Lr, { config: i }, /* @__PURE__ */ f.createElement(im, { config: a }, /* @__PURE__ */ f.createElement(gh, { appName: n }, /* @__PURE__ */ f.createElement(Jn, { config: s }, /* @__PURE__ */ f.createElement(Fn, { config: o }, /* @__PURE__ */ f.createElement(v, null, c))))))))))))))));
20676
+ }, /* @__PURE__ */ f.createElement(gi, p.auth, /* @__PURE__ */ f.createElement(Xg, p.credentials, /* @__PURE__ */ f.createElement(zi, p.data, /* @__PURE__ */ f.createElement(Fl, p.storage, /* @__PURE__ */ f.createElement(qg, p.email, /* @__PURE__ */ f.createElement(Eu, p.ai, /* @__PURE__ */ f.createElement(Lr, { config: i }, /* @__PURE__ */ f.createElement(im, { config: a }, /* @__PURE__ */ f.createElement(gh, { appName: n }, /* @__PURE__ */ f.createElement(Jn, { config: s }, /* @__PURE__ */ f.createElement(Fn, { config: o }, /* @__PURE__ */ f.createElement(v, null, c))))))))))))))));
20595
20677
  }
20596
- function Gv({ importPage: e, LayoutDefault: t = void 0, menuConfig: n = {}, children: r, ...i }) {
20597
- Hv(n);
20678
+ function qv({ importPage: e, LayoutDefault: t = void 0, menuConfig: n = {}, children: r, ...i }) {
20679
+ Wv(n);
20598
20680
  let a = ({ children: e }) => /* @__PURE__ */ f.createElement(f.Fragment, null, e), o = ({ pageSource: e, message: t }) => /* @__PURE__ */ f.createElement(cs, { variant: "warning" }, "Missing Page: ", e, t && /* @__PURE__ */ f.createElement("code", { className: "ml-2" }, t));
20599
20681
  function s(n, r, s) {
20600
20682
  let c = `./pages${r.component ? "/" + r.component : r.path === "/" ? "/Home" : ft.toCamel(r.path.split("*")[0])}.js`, l = r.page || f.lazy(() => e(c).then((e) => typeof e.default == "function" ? { default: e.default } : (console.warn(`⚠️ Invalid default export in ${c}`), { default: () => /* @__PURE__ */ f.createElement(o, { pageSource: c }) })).catch((e) => (console.error(`❌ Failed to load ${c}:`, e), { default: () => /* @__PURE__ */ f.createElement(o, {
@@ -20604,32 +20686,32 @@ function Gv({ importPage: e, LayoutDefault: t = void 0, menuConfig: n = {}, chil
20604
20686
  return /* @__PURE__ */ f.createElement(A, {
20605
20687
  key: `${n}-${s}`,
20606
20688
  path: r.path,
20607
- element: /* @__PURE__ */ f.createElement(u, null, /* @__PURE__ */ f.createElement(Vg, {
20689
+ element: /* @__PURE__ */ f.createElement(u, null, /* @__PURE__ */ f.createElement(Ug, {
20608
20690
  key: r.path,
20609
20691
  reportUrl: i.errorReportUrl,
20610
20692
  debug: i.debug
20611
- }, /* @__PURE__ */ f.createElement(h, { fallback: /* @__PURE__ */ f.createElement(Lv, null) }, /* @__PURE__ */ f.createElement(l, null))))
20693
+ }, /* @__PURE__ */ f.createElement(h, { fallback: /* @__PURE__ */ f.createElement(zv, null) }, /* @__PURE__ */ f.createElement(l, null))))
20612
20694
  });
20613
20695
  }
20614
- let c = (e) => Object.keys(e).flatMap((t) => e[t].flatMap((e, n) => [e.path && s(t, e, n), e.children && c({ children: e.children })].filter(Boolean))), l = (e, t) => e.some((e) => e.path === t || !!e.children && l(e.children, t)), u = Object.values(Vv).some((e) => l(e, "/")) ? {} : { default: [{ path: "/" }] };
20615
- return /* @__PURE__ */ f.createElement(Wv, i, r, /* @__PURE__ */ f.createElement(j, null, /* @__PURE__ */ f.createElement(A, {
20696
+ let c = (e) => Object.keys(e).flatMap((t) => e[t].flatMap((e, n) => [e.path && s(t, e, n), e.children && c({ children: e.children })].filter(Boolean))), l = (e, t) => e.some((e) => e.path === t || !!e.children && l(e.children, t)), u = Object.values(Uv).some((e) => l(e, "/")) ? {} : { default: [{ path: "/" }] };
20697
+ return /* @__PURE__ */ f.createElement(Kv, i, r, /* @__PURE__ */ f.createElement(j, null, /* @__PURE__ */ f.createElement(A, {
20616
20698
  path: Ci,
20617
20699
  element: /* @__PURE__ */ f.createElement(Ai, null)
20618
20700
  }), /* @__PURE__ */ f.createElement(f.Fragment, null, c({
20619
20701
  ...u,
20620
- ...Vv,
20702
+ ...Uv,
20621
20703
  _auth: [{
20622
20704
  path: "/users",
20623
- page: jg,
20705
+ page: Ng,
20624
20706
  layout: t
20625
20707
  }]
20626
20708
  })), /* @__PURE__ */ f.createElement(A, {
20627
20709
  path: "*",
20628
- element: /* @__PURE__ */ f.createElement(Mg, null)
20710
+ element: /* @__PURE__ */ f.createElement(Pg, null)
20629
20711
  })));
20630
20712
  }
20631
- var Kv = (e) => {
20632
- let t = Uv(e), n = M(), r = (e) => e.map((e) => {
20713
+ var Jv = (e) => {
20714
+ let t = Gv(e), n = M(), r = (e) => e.map((e) => {
20633
20715
  let t = n.pathname === e.path, i = e.children ? r(e.children) : [], a = t || i.some((e) => e.active);
20634
20716
  return {
20635
20717
  ...e,
@@ -20638,7 +20720,7 @@ var Kv = (e) => {
20638
20720
  };
20639
20721
  });
20640
20722
  return w(() => r(t), [n.pathname]);
20641
- }, qv = {
20723
+ }, Yv = {
20642
20724
  common: {
20643
20725
  save: "Salva",
20644
20726
  cancel: "Annulla",
@@ -20976,7 +21058,16 @@ var Kv = (e) => {
20976
21058
  back: "Indietro",
20977
21059
  submit: "Invia",
20978
21060
  noAnswer: "Nessuna risposta",
20979
- answered: "Risposte date"
21061
+ answered: "Risposte date",
21062
+ activityCount: "{count} passi",
21063
+ activityFailed: "{count} non riusciti",
21064
+ activityCommands: "Comandi",
21065
+ activityHide: "Nascondi",
21066
+ activityLog: "Registro completo",
21067
+ activitySteps: "Vista per passi",
21068
+ activityFiles: "{count} file modificati",
21069
+ activityChanges: "Vedi le modifiche",
21070
+ activityEmpty: "Ancora niente"
20980
21071
  },
20981
21072
  charts: {
20982
21073
  noData: "Nessun dato",
@@ -20986,7 +21077,7 @@ var Kv = (e) => {
20986
21077
  dataTable: "Dati del grafico",
20987
21078
  sequence: "Sequenza"
20988
21079
  }
20989
- }, Jv = {
21080
+ }, Xv = {
20990
21081
  common: {
20991
21082
  save: "Speichern",
20992
21083
  cancel: "Abbrechen",
@@ -21324,7 +21415,16 @@ var Kv = (e) => {
21324
21415
  back: "Zurück",
21325
21416
  submit: "Senden",
21326
21417
  noAnswer: "Keine Antwort",
21327
- answered: "Beantwortet"
21418
+ answered: "Beantwortet",
21419
+ activityCount: "{count} Schritte",
21420
+ activityFailed: "{count} fehlgeschlagen",
21421
+ activityCommands: "Befehle",
21422
+ activityHide: "Ausblenden",
21423
+ activityLog: "Vollständiges Protokoll",
21424
+ activitySteps: "Schrittansicht",
21425
+ activityFiles: "{count} Dateien geändert",
21426
+ activityChanges: "Änderungen ansehen",
21427
+ activityEmpty: "Noch nichts"
21328
21428
  },
21329
21429
  charts: {
21330
21430
  noData: "Keine Daten",
@@ -21334,7 +21434,7 @@ var Kv = (e) => {
21334
21434
  dataTable: "Diagrammdaten",
21335
21435
  sequence: "Abfolge"
21336
21436
  }
21337
- }, Yv = {
21437
+ }, Zv = {
21338
21438
  common: {
21339
21439
  save: "Сохранить",
21340
21440
  cancel: "Отменить",
@@ -21672,7 +21772,16 @@ var Kv = (e) => {
21672
21772
  back: "Назад",
21673
21773
  submit: "Отправить",
21674
21774
  noAnswer: "Нет ответа",
21675
- answered: "Отвечено"
21775
+ answered: "Отвечено",
21776
+ activityCount: "Шагов: {count}",
21777
+ activityFailed: "Не удалось: {count}",
21778
+ activityCommands: "Команды",
21779
+ activityHide: "Скрыть",
21780
+ activityLog: "Полный журнал",
21781
+ activitySteps: "По шагам",
21782
+ activityFiles: "Изменено файлов: {count}",
21783
+ activityChanges: "Посмотреть изменения",
21784
+ activityEmpty: "Пока ничего"
21676
21785
  },
21677
21786
  charts: {
21678
21787
  noData: "Нет данных",
@@ -21682,7 +21791,7 @@ var Kv = (e) => {
21682
21791
  dataTable: "Данные диаграммы",
21683
21792
  sequence: "Последовательность"
21684
21793
  }
21685
- }, Xv = {
21794
+ }, Qv = {
21686
21795
  common: {
21687
21796
  save: "保存",
21688
21797
  cancel: "取消",
@@ -22020,7 +22129,16 @@ var Kv = (e) => {
22020
22129
  back: "返回",
22021
22130
  submit: "提交",
22022
22131
  noAnswer: "未回答",
22023
- answered: "已回答"
22132
+ answered: "已回答",
22133
+ activityCount: "{count} 步",
22134
+ activityFailed: "{count} 个失败",
22135
+ activityCommands: "命令",
22136
+ activityHide: "隐藏",
22137
+ activityLog: "完整日志",
22138
+ activitySteps: "按步骤查看",
22139
+ activityFiles: "已修改 {count} 个文件",
22140
+ activityChanges: "查看更改",
22141
+ activityEmpty: "暂无内容"
22024
22142
  },
22025
22143
  charts: {
22026
22144
  noData: "暂无数据",
@@ -22030,7 +22148,7 @@ var Kv = (e) => {
22030
22148
  dataTable: "图表数据",
22031
22149
  sequence: "顺序"
22032
22150
  }
22033
- }, Zv = {
22151
+ }, $v = {
22034
22152
  common: {
22035
22153
  save: "حفظ",
22036
22154
  cancel: "إلغاء",
@@ -22368,7 +22486,16 @@ var Kv = (e) => {
22368
22486
  back: "رجوع",
22369
22487
  submit: "إرسال",
22370
22488
  noAnswer: "لا توجد إجابة",
22371
- answered: "تمت الإجابة"
22489
+ answered: "تمت الإجابة",
22490
+ activityCount: "{count} خطوات",
22491
+ activityFailed: "{count} فشلت",
22492
+ activityCommands: "الأوامر",
22493
+ activityHide: "إخفاء",
22494
+ activityLog: "السجل الكامل",
22495
+ activitySteps: "عرض الخطوات",
22496
+ activityFiles: "{count} ملفات معدلة",
22497
+ activityChanges: "عرض التغييرات",
22498
+ activityEmpty: "لا شيء بعد"
22372
22499
  },
22373
22500
  charts: {
22374
22501
  noData: "لا توجد بيانات",
@@ -22378,22 +22505,22 @@ var Kv = (e) => {
22378
22505
  dataTable: "بيانات المخطط",
22379
22506
  sequence: "التسلسل"
22380
22507
  }
22381
- }, Qv = /* @__PURE__ */ ot({
22382
- ar: () => Zv,
22383
- de: () => Jv,
22508
+ }, ey = /* @__PURE__ */ ot({
22509
+ ar: () => $v,
22510
+ de: () => Xv,
22384
22511
  en: () => Rn,
22385
- it: () => qv,
22386
- ru: () => Yv,
22387
- zh: () => Xv
22388
- }), $v = (e) => Ga("api", e);
22512
+ it: () => Yv,
22513
+ ru: () => Zv,
22514
+ zh: () => Qv
22515
+ }), ty = (e) => Ga("api", e);
22389
22516
  //#endregion
22390
22517
  //#region src/providers/api/direct.ts
22391
- async function ey(e) {
22518
+ async function ny(e) {
22392
22519
  if (!e.ok) throw Error(`ApiProvider request failed: ${e.status} ${e.statusText}`);
22393
22520
  let t = await e.text();
22394
22521
  return t ? JSON.parse(t) : void 0;
22395
22522
  }
22396
- var ty = class {
22523
+ var ry = class {
22397
22524
  config;
22398
22525
  constructor(e) {
22399
22526
  this.config = e;
@@ -22408,7 +22535,7 @@ var ty = class {
22408
22535
  ...e.body,
22409
22536
  ...this.config.body
22410
22537
  };
22411
- return ey(await Fu(n.toString(), {
22538
+ return ny(await Fu(n.toString(), {
22412
22539
  method: t,
22413
22540
  headers: {
22414
22541
  "Content-Type": "application/json",
@@ -22417,7 +22544,7 @@ var ty = class {
22417
22544
  body: t === "GET" || t === "HEAD" ? void 0 : JSON.stringify(r)
22418
22545
  }));
22419
22546
  }
22420
- }, ny = class {
22547
+ }, iy = class {
22421
22548
  resolver;
22422
22549
  constructor(e) {
22423
22550
  this.resolver = e;
@@ -22425,7 +22552,7 @@ var ty = class {
22425
22552
  async fetch(e) {
22426
22553
  return this.resolver(e);
22427
22554
  }
22428
- }, ry = class {
22555
+ }, ay = class {
22429
22556
  config;
22430
22557
  constructor(e) {
22431
22558
  this.config = e;
@@ -22436,7 +22563,7 @@ var ty = class {
22436
22563
  request: e
22437
22564
  }, void 0, this.config.region);
22438
22565
  }
22439
- }, iy = class {
22566
+ }, oy = class {
22440
22567
  config;
22441
22568
  constructor(e) {
22442
22569
  this.config = e;
@@ -22449,7 +22576,7 @@ var ty = class {
22449
22576
  if (n) throw n;
22450
22577
  return t;
22451
22578
  }
22452
- }, ay = [
22579
+ }, sy = [
22453
22580
  {
22454
22581
  id: "resend",
22455
22582
  label: "Resend",
@@ -22560,7 +22687,7 @@ var ty = class {
22560
22687
  ],
22561
22688
  credentialsHint: "Ask your mail host or hosting provider for the SMTP host, port, and credentials."
22562
22689
  }
22563
- ], oy = [
22690
+ ], cy = [
22564
22691
  {
22565
22692
  id: "cloudflare_pages",
22566
22693
  label: "Cloudflare Pages",
@@ -22790,16 +22917,16 @@ var ty = class {
22790
22917
  description: "No vendor — packages the build as a downloadable archive for self-hosting anywhere else.",
22791
22918
  credentialFields: []
22792
22919
  }
22793
- ], sy = [
22794
- uv,
22920
+ ], ly = [
22921
+ fv,
22922
+ Av,
22923
+ bv,
22795
22924
  Ov,
22796
- vv,
22797
- Ev,
22798
- ev,
22799
- ov,
22800
- M_,
22801
- sv,
22802
- z_({
22925
+ nv,
22926
+ cv,
22927
+ P_,
22928
+ lv,
22929
+ V_({
22803
22930
  id: "glm",
22804
22931
  label: "ZhipuAI (GLM)",
22805
22932
  description: "Zhipu AI's GLM model family.",
@@ -22816,8 +22943,8 @@ var ty = class {
22816
22943
  dashboardUrl: "https://bigmodel.cn/usercenter/apikeys",
22817
22944
  credentialsHint: "Zhipu BigModel → User Center → API Keys → Create Key."
22818
22945
  }),
22819
- lv
22820
- ], cy = (e) => ({
22946
+ dv
22947
+ ], uy = (e) => ({
22821
22948
  id: e.id,
22822
22949
  label: e.label,
22823
22950
  description: e.description ?? "",
@@ -22828,7 +22955,7 @@ var ty = class {
22828
22955
  }],
22829
22956
  credentialsUrl: e.dashboardUrl,
22830
22957
  credentialsHint: e.credentialsHint
22831
- }), ly = [...sy.map(cy), $_], uy = {
22958
+ }), dy = [...ly.map(uy), tv], fy = {
22832
22959
  id: "openai-compatible",
22833
22960
  label: "OpenAI-compatible",
22834
22961
  description: "Any OpenAI-compatible endpoint (self-hosted or third-party).",
@@ -22842,15 +22969,15 @@ var ty = class {
22842
22969
  type: "text",
22843
22970
  placeholder: "https://api.example.com/v1"
22844
22971
  }]
22845
- }, dy = (e) => {
22972
+ }, py = (e) => {
22846
22973
  let t = [], n = e?.cloudflare?.accountId?.trim();
22847
- n && t.push(Q_({
22974
+ n && t.push(ev({
22848
22975
  accountId: n,
22849
22976
  defaultModel: e?.cloudflare?.defaultModel?.trim() || void 0,
22850
22977
  includePaidModels: e?.cloudflare?.includePaidModels
22851
22978
  }));
22852
22979
  let r = e?.openAICompatible?.baseUrl?.trim();
22853
- return r ? [...t, z_({
22980
+ return r ? [...t, V_({
22854
22981
  id: "openai-compatible",
22855
22982
  label: e?.openAICompatible?.label?.trim() || "OpenAI-compatible",
22856
22983
  description: "Any OpenAI-compatible endpoint (self-hosted or third-party).",
@@ -22862,10 +22989,10 @@ var ty = class {
22862
22989
  modelsUrl: e?.openAICompatible?.modelsUrl?.trim() || void 0,
22863
22990
  chatCompletionsUrl: e?.openAICompatible?.chatCompletionsUrl?.trim() || void 0
22864
22991
  })] : t;
22865
- }, fy = (e) => e ? [...sy, ...dy(e)].reduce((t, n) => {
22992
+ }, my = (e) => e ? [...ly, ...py(e)].reduce((t, n) => {
22866
22993
  let r = n.id === "openai-compatible" ? e.openAICompatible?.apiKey?.trim() || "" : n.id === "cloudflare" ? e.cloudflare?.apiToken?.trim() || "" : typeof n.configKey == "string" && typeof e[n.configKey] == "string" ? String(e[n.configKey] || "").trim() : "";
22867
22994
  return r && (t[n.id] = new Qu(n, r)), t;
22868
- }, {}) : {}, py = (e, { scope: t }) => fy(e.reduce((e, n) => {
22995
+ }, {}) : {}, hy = (e, { scope: t }) => my(e.reduce((e, n) => {
22869
22996
  let i = r(t, n.id);
22870
22997
  if (n.id === "openai-compatible") return n.baseUrl ? {
22871
22998
  ...e,
@@ -22883,37 +23010,37 @@ var ty = class {
22883
23010
  accountId: n.accountId
22884
23011
  }
22885
23012
  } : e;
22886
- let a = sy.find((e) => e.id === n.id)?.configKey;
23013
+ let a = ly.find((e) => e.id === n.id)?.configKey;
22887
23014
  return a ? {
22888
23015
  ...e,
22889
23016
  [a]: i
22890
23017
  } : e;
22891
- }, {})), my = void 0;
23018
+ }, {})), gy = void 0;
22892
23019
  typeof Xa == "function" && Xa((e) => {
22893
- my = e.google;
23020
+ gy = e.google;
22894
23021
  });
22895
- var hy = {
23022
+ var _y = {
22896
23023
  ita: "geoTargetConstants/2380",
22897
23024
  rome: "geoTargetConstants/1033236",
22898
23025
  mil: "geoTargetConstants/1033239",
22899
23026
  nap: "geoTargetConstants/1033245",
22900
23027
  tor: "geoTargetConstants/1033247"
22901
- }, gy = {
23028
+ }, vy = {
22902
23029
  it: "languageConstants/1000",
22903
23030
  en: "languageConstants/1001",
22904
23031
  fr: "languageConstants/1002",
22905
23032
  es: "languageConstants/1003",
22906
23033
  de: "languageConstants/1005"
22907
23034
  };
22908
- function _y(e) {
22909
- return hy[e.toLowerCase()] || "geoTargetConstants/2380";
23035
+ function yy(e) {
23036
+ return _y[e.toLowerCase()] || "geoTargetConstants/2380";
22910
23037
  }
22911
- function vy(e) {
22912
- return gy[e.toLowerCase()] || "languageConstants/1000";
23038
+ function by(e) {
23039
+ return vy[e.toLowerCase()] || "languageConstants/1000";
22913
23040
  }
22914
- async function yy({ keyword: e, googleAdsAccountId: t, geoCode: n = "ita", languageCode: r = "it" }) {
22915
- if (!my?.developerToken) return console.error("\n❌ Google Ads API: developerToken non configurato.\n\nPer ottenere un developerToken segui questi passaggi:\n\n1️⃣ Vai su https://ads.google.com/aw/apicenter\n2️⃣ Seleziona o crea un account Google Ads Manager (MCC) se non ne hai uno.\n3️⃣ Vai alla sezione \"Strumenti e impostazioni\" → \"Accesso API\" (o \"API Center\").\n4️⃣ Clicca su \"Richiedi accesso API\" se non l'hai ancora fatto.\n5️⃣ Copia il valore del tuo Developer Token (è un identificatore simile a: 'ABc123456789xyz').\n6️⃣ Inseriscilo nel tuo file di configurazione, nella sezione:\n config.google.developerToken\n\nℹ️ Attenzione: Inizialmente il token sarà in modalità di test. Per usarlo in produzione, dovrai richiedere l'approvazione da Google Ads.\n"), [];
22916
- let i = await S_(["https://www.googleapis.com/auth/adwords"]), a = _y(n), o = vy(r), s = `https://googleads.googleapis.com/v13/customers/${t}:generateKeywordIdeas`, c = {
23041
+ async function xy({ keyword: e, googleAdsAccountId: t, geoCode: n = "ita", languageCode: r = "it" }) {
23042
+ if (!gy?.developerToken) return console.error("\n❌ Google Ads API: developerToken non configurato.\n\nPer ottenere un developerToken segui questi passaggi:\n\n1️⃣ Vai su https://ads.google.com/aw/apicenter\n2️⃣ Seleziona o crea un account Google Ads Manager (MCC) se non ne hai uno.\n3️⃣ Vai alla sezione \"Strumenti e impostazioni\" → \"Accesso API\" (o \"API Center\").\n4️⃣ Clicca su \"Richiedi accesso API\" se non l'hai ancora fatto.\n5️⃣ Copia il valore del tuo Developer Token (è un identificatore simile a: 'ABc123456789xyz').\n6️⃣ Inseriscilo nel tuo file di configurazione, nella sezione:\n config.google.developerToken\n\nℹ️ Attenzione: Inizialmente il token sarà in modalità di test. Per usarlo in produzione, dovrai richiedere l'approvazione da Google Ads.\n"), [];
23043
+ let i = await w_(["https://www.googleapis.com/auth/adwords"]), a = yy(n), o = by(r), s = `https://googleads.googleapis.com/v13/customers/${t}:generateKeywordIdeas`, c = {
22917
23044
  keywordSeed: { keywords: [e] },
22918
23045
  geoTargetConstants: [a],
22919
23046
  language: o
@@ -22921,7 +23048,7 @@ async function yy({ keyword: e, googleAdsAccountId: t, geoCode: n = "ita", langu
22921
23048
  method: "POST",
22922
23049
  headers: {
22923
23050
  Authorization: `Bearer ${i}`,
22924
- "developer-token": my.developerToken,
23051
+ "developer-token": gy.developerToken,
22925
23052
  "Content-Type": "application/json"
22926
23053
  },
22927
23054
  body: JSON.stringify(c)
@@ -22939,7 +23066,7 @@ async function yy({ keyword: e, googleAdsAccountId: t, geoCode: n = "ita", langu
22939
23066
  }
22940
23067
  //#endregion
22941
23068
  //#region src/providers/seo/google/trend.ts
22942
- async function by(e, t = "IT", n = "today 12-m") {
23069
+ async function Sy(e, t = "IT", n = "today 12-m") {
22943
23070
  let r = `https://trends.google.com/trends/api/explore?hl=en-US&tz=0&req=${encodeURIComponent(JSON.stringify({
22944
23071
  comparisonItem: [{
22945
23072
  keyword: e,
@@ -22959,7 +23086,7 @@ async function by(e, t = "IT", n = "today 12-m") {
22959
23086
  }))
22960
23087
  };
22961
23088
  }
22962
- async function xy(e, t = "IT", n = "today 12-m") {
23089
+ async function Cy(e, t = "IT", n = "today 12-m") {
22963
23090
  let r = `https://trends.google.com/trends/api/explore?hl=en-US&tz=0&req=${encodeURIComponent(JSON.stringify({
22964
23091
  comparisonItem: [{
22965
23092
  keyword: e,
@@ -22985,13 +23112,13 @@ async function xy(e, t = "IT", n = "today 12-m") {
22985
23112
  }
22986
23113
  //#endregion
22987
23114
  //#region src/providers/storage/dropbox.tsx
22988
- var Sy = 5e3, Cy = "https://www.dropbox.com/home", wy = void 0;
23115
+ var wy = 5e3, Ty = "https://www.dropbox.com/home", Ey = void 0;
22989
23116
  typeof Xa == "function" && Xa((e) => {
22990
- wy = e.dropbox;
23117
+ Ey = e.dropbox;
22991
23118
  });
22992
- var Ty = async (e, t, n = {}) => {
22993
- if (!wy) return console.error("DropBox: Config not found"), null;
22994
- let r = await Fi(wy.clientId);
23119
+ var Dy = async (e, t, n = {}) => {
23120
+ if (!Ey) return console.error("DropBox: Config not found"), null;
23121
+ let r = await Fi(Ey.clientId);
22995
23122
  if (!r) throw Error("DropBox: Access token not found");
22996
23123
  return await fetch(e, {
22997
23124
  method: "POST",
@@ -23004,12 +23131,12 @@ var Ty = async (e, t, n = {}) => {
23004
23131
  }).catch((e) => (console.error("There was a problem with the fetch operation:", e), null)).finally(() => {
23005
23132
  console.log("DropBox: Fetch operation completed");
23006
23133
  });
23007
- }, Ey = async (e, t, n = {}) => {
23008
- if (!wy) {
23134
+ }, Oy = async (e, t, n = {}) => {
23135
+ if (!Ey) {
23009
23136
  console.error("DropBox: Config not found");
23010
23137
  return;
23011
23138
  }
23012
- let r = await Fi(wy.clientId);
23139
+ let r = await Fi(Ey.clientId);
23013
23140
  if (!r) {
23014
23141
  console.error("DropBox: Access token not found");
23015
23142
  return;
@@ -23034,47 +23161,47 @@ var Ty = async (e, t, n = {}) => {
23034
23161
  }).finally(() => {
23035
23162
  console.log("DropBox: Fetch operation completed", e, t);
23036
23163
  });
23037
- }, Dy = (e, t = !1) => {
23038
- let n = wy?.rootPath || "";
23039
- return (t ? Cy : "") + (e.startsWith(n) ? e : n + e);
23040
- }, Oy = async (e, t = "", n = !1) => {
23164
+ }, ky = (e, t = !1) => {
23165
+ let n = Ey?.rootPath || "";
23166
+ return (t ? Ty : "") + (e.startsWith(n) ? e : n + e);
23167
+ }, Ay = async (e, t = "", n = !1) => {
23041
23168
  let r = {};
23042
- return (await Hy.listFolders({
23169
+ return (await Wy.listFolders({
23043
23170
  path: `${e + t}`,
23044
23171
  recursive: !0
23045
23172
  })).forEach((e) => {
23046
23173
  e[".tag"] !== "folder" && (r[n ? vi.changeFilename(e.path_display, { ext: "" }) : e.path_display] = e.name);
23047
23174
  }), r;
23048
- }, ky = async (e, t) => {
23175
+ }, jy = async (e, t) => {
23049
23176
  if (!e.async_job_id) return Promise.reject(e);
23050
23177
  let n, r = !0;
23051
- for (; r;) await St(100), n = await Ey(`https://api.dropboxapi.com/2/${t}/check`, { async_job_id: e.async_job_id }), console.log("DropBox: Check folders response: ", n), n?.[".tag"] !== "in_progress" && (r = !1);
23178
+ for (; r;) await St(100), n = await Oy(`https://api.dropboxapi.com/2/${t}/check`, { async_job_id: e.async_job_id }), console.log("DropBox: Check folders response: ", n), n?.[".tag"] !== "in_progress" && (r = !1);
23052
23179
  return n?.[".tag"] === "complete" ? Promise.resolve(n.entries) : Promise.reject(n);
23053
- }, Ay = async (e, t = "") => {
23054
- let n = "files/create_folder_batch", r = await Ey(`https://api.dropboxapi.com/2/${n}`, {
23180
+ }, My = async (e, t = "") => {
23181
+ let n = "files/create_folder_batch", r = await Oy(`https://api.dropboxapi.com/2/${n}`, {
23055
23182
  autorename: !1,
23056
23183
  force_async: !0,
23057
- paths: e.map((e) => Dy(t + e))
23184
+ paths: e.map((e) => ky(t + e))
23058
23185
  });
23059
- return r ? ky(r, n) : void 0;
23060
- }, jy = async (e, t = "") => {
23061
- let n = "files/create_folder_batch", r = await Ey(`https://api.dropboxapi.com/2/${n}`, { entries: e.map((e) => ({ path: Dy(t + e) })) });
23062
- return r ? ky(r, n) : void 0;
23063
- }, My = async (e, t) => Ey("https://api.dropboxapi.com/2/files/tags/add", {
23186
+ return r ? jy(r, n) : void 0;
23187
+ }, Ny = async (e, t = "") => {
23188
+ let n = "files/create_folder_batch", r = await Oy(`https://api.dropboxapi.com/2/${n}`, { entries: e.map((e) => ({ path: ky(t + e) })) });
23189
+ return r ? jy(r, n) : void 0;
23190
+ }, Py = async (e, t) => Oy("https://api.dropboxapi.com/2/files/tags/add", {
23064
23191
  path: e,
23065
23192
  tag_text: t.toLowerCase().replaceAll(/[^a-z0-9]/g, "")
23066
- }), Ny = async (e, t = "") => {
23067
- for (let n in e) for (let r of e[n]) await My(Dy(t + n), r);
23068
- }, Py = async ({ path: e = "", recursive: t = !1 } = {}) => {
23069
- let n = [], r = async ({ path: e, cursor: t, recursive: n }) => e ? await Ey("https://api.dropboxapi.com/2/files/list_folder", {
23193
+ }), Fy = async (e, t = "") => {
23194
+ for (let n in e) for (let r of e[n]) await Py(ky(t + n), r);
23195
+ }, Iy = async ({ path: e = "", recursive: t = !1 } = {}) => {
23196
+ let n = [], r = async ({ path: e, cursor: t, recursive: n }) => e ? await Oy("https://api.dropboxapi.com/2/files/list_folder", {
23070
23197
  include_deleted: !1,
23071
23198
  include_has_explicit_shared_members: !1,
23072
23199
  include_media_info: !1,
23073
23200
  include_mounted_folders: !0,
23074
23201
  include_non_downloadable_files: !0,
23075
- path: Dy(e),
23202
+ path: ky(e),
23076
23203
  recursive: n
23077
- }) : await Ey("https://api.dropboxapi.com/2/files/list_folder/continue", { cursor: t }), i = {
23204
+ }) : await Oy("https://api.dropboxapi.com/2/files/list_folder/continue", { cursor: t }), i = {
23078
23205
  has_more: !0,
23079
23206
  cursor: "",
23080
23207
  entries: []
@@ -23087,44 +23214,44 @@ var Ty = async (e, t, n = {}) => {
23087
23214
  recursive: t
23088
23215
  }), i && n.push(...i.entries);
23089
23216
  return n;
23090
- }, Fy = async (e) => {
23091
- let t = async (e) => await Ey("https://api.dropboxapi.com/2/files/copy_batch_v2", {
23217
+ }, Ly = async (e) => {
23218
+ let t = async (e) => await Oy("https://api.dropboxapi.com/2/files/copy_batch_v2", {
23092
23219
  entries: e,
23093
23220
  autorename: !1
23094
- }), n = async (e) => await Ey("https://api.dropboxapi.com/2/files/copy_batch/check_v2", { async_job_id: e }), r = [], i = [];
23221
+ }), n = async (e) => await Oy("https://api.dropboxapi.com/2/files/copy_batch/check_v2", { async_job_id: e }), r = [], i = [];
23095
23222
  for (let a = 0; a < e.length; a += 900) {
23096
23223
  i = e.slice(a, a + 900).map((e) => ({
23097
- from_path: Dy(e.from),
23098
- to_path: Dy(e.to)
23224
+ from_path: ky(e.from),
23225
+ to_path: ky(e.to)
23099
23226
  }));
23100
23227
  let o = await t(i);
23101
23228
  if (!o) continue;
23102
23229
  if (o.error) throw Error(`Error starting copy: ${o.error}`);
23103
23230
  let s = o;
23104
- for (; s?.[".tag"] === "async_job_id" || s?.[".tag"] === "in_progress";) await St(Sy), s = await n(o.async_job_id ?? "");
23231
+ for (; s?.[".tag"] === "async_job_id" || s?.[".tag"] === "in_progress";) await St(wy), s = await n(o.async_job_id ?? "");
23105
23232
  if (s?.[".tag"] === "failed") throw Error(`Copy operation failed: ${s[".tag"]}`);
23106
23233
  s?.[".tag"] === "complete" && s.entries && r.push(...s.entries);
23107
23234
  }
23108
23235
  return r.filter((e) => e[".tag"] === "failure").map((e) => e.failure);
23109
- }, Iy = async (e) => {
23110
- let t = async (e) => await Ey("https://api.dropboxapi.com/2/files/move_v2", {
23236
+ }, Ry = async (e) => {
23237
+ let t = async (e) => await Oy("https://api.dropboxapi.com/2/files/move_v2", {
23111
23238
  ...e,
23112
23239
  autorename: !0
23113
23240
  });
23114
23241
  for (let n of e) await t({
23115
- from_path: Dy(n.from),
23116
- to_path: Dy(n.to)
23242
+ from_path: ky(n.from),
23243
+ to_path: ky(n.to)
23117
23244
  });
23118
- }, Ly = async ({ thumbnailsRequest: e = [], size: t = "w64h64", format: n = "jpeg", mode: r = "strict" }, i) => {
23245
+ }, zy = async ({ thumbnailsRequest: e = [], size: t = "w64h64", format: n = "jpeg", mode: r = "strict" }, i) => {
23119
23246
  let a = {}, o = [];
23120
23247
  for (let s = 0; s < e.length; s += 25) {
23121
23248
  let c = e.slice(s, s + 25), l = c.map((e) => ({
23122
- path: Dy(e.path),
23249
+ path: ky(e.path),
23123
23250
  format: n,
23124
23251
  size: t,
23125
23252
  mode: r
23126
23253
  }));
23127
- await St(100), o.push(Ey("https://content.dropboxapi.com/2/files/get_thumbnail_batch", { entries: l }).then((e) => {
23254
+ await St(100), o.push(Oy("https://content.dropboxapi.com/2/files/get_thumbnail_batch", { entries: l }).then((e) => {
23128
23255
  if (!e) return;
23129
23256
  let n = e.entries.reduce((e, n, r) => {
23130
23257
  let i = c[r].path, [a, o] = t.replace("w", "").split("h").map(Number), s = n;
@@ -23143,7 +23270,7 @@ var Ty = async (e, t, n = {}) => {
23143
23270
  }));
23144
23271
  }
23145
23272
  return Promise.all(o).then(() => a);
23146
- }, Ry = (e, t = "application/octet-stream", n = 512) => {
23273
+ }, By = (e, t = "application/octet-stream", n = 512) => {
23147
23274
  let r = atob(e), i = [];
23148
23275
  for (let e = 0; e < r.length; e += n) {
23149
23276
  let t = r.slice(e, e + n), a = Array(t.length);
@@ -23152,11 +23279,11 @@ var Ty = async (e, t, n = {}) => {
23152
23279
  i.push(o);
23153
23280
  }
23154
23281
  return new Blob(i, { type: t });
23155
- }, zy = async (e, t) => {
23282
+ }, Vy = async (e, t) => {
23156
23283
  try {
23157
23284
  let n = t.split(",")[1];
23158
- Ty("https://content.dropboxapi.com/2/files/upload", Ry(n, "application/octet-stream"), { "Dropbox-API-Arg": JSON.stringify({
23159
- path: Dy(e),
23285
+ Dy("https://content.dropboxapi.com/2/files/upload", By(n, "application/octet-stream"), { "Dropbox-API-Arg": JSON.stringify({
23286
+ path: ky(e),
23160
23287
  mode: "overwrite",
23161
23288
  autorename: !0,
23162
23289
  mute: !1
@@ -23166,12 +23293,12 @@ var Ty = async (e, t, n = {}) => {
23166
23293
  } catch (e) {
23167
23294
  console.error("Errore durante il caricamento su Dropbox:", e);
23168
23295
  }
23169
- }, By = (e = !1) => wy ? Mi(wy.clientId, e) : !1, Vy = (e = {}) => {
23170
- if (!wy) return /* @__PURE__ */ f.createElement("div", {
23296
+ }, Hy = (e = !1) => Ey ? Mi(Ey.clientId, e) : !1, Uy = (e = {}) => {
23297
+ if (!Ey) return /* @__PURE__ */ f.createElement("div", {
23171
23298
  title: "DropBox: configurazione mancante. Recupera il \"Client ID\" accedendo a https://www.dropbox.com/developers, vai su \"App Console\", seleziona un'app esistente o chiedi il Client ID a chi ha configurato il sistema.",
23172
23299
  className: "text-danger flex items-center gap-2"
23173
23300
  }, /* @__PURE__ */ f.createElement(Q, { name: "warning" }), /* @__PURE__ */ f.createElement("span", null, "Dropbox non configurato"));
23174
- let t = By(!0);
23301
+ let t = Hy(!0);
23175
23302
  return /* @__PURE__ */ f.createElement(Li, {
23176
23303
  provider: "dropboxAuth",
23177
23304
  intent: "connect",
@@ -23183,33 +23310,33 @@ var Ty = async (e, t, n = {}) => {
23183
23310
  title: t ? "DropBox Connected" : "DropBox Disconnected"
23184
23311
  }
23185
23312
  });
23186
- }, Hy = {
23313
+ }, Wy = {
23187
23314
  setRootPath: (e) => {
23188
- wy && (wy.rootPath = e);
23189
- },
23190
- resolvePath: Dy,
23191
- createFolders: Ay,
23192
- deleteBulk: jy,
23193
- addTags: Ny,
23194
- listFolders: Py,
23195
- getThumbnails: Ly,
23196
- search: Oy,
23197
- upload: zy,
23198
- copy: Fy,
23199
- move: Iy
23200
- }, Uy = "https://api.serpapi.com/search", Wy = "google", Gy = "google_images", Ky = "google_autocomplete", qy = "google_trends", Jy = "google_maps", Yy = "google_maps_photos", Xy = "google_maps_reviews", Zy = {
23315
+ Ey && (Ey.rootPath = e);
23316
+ },
23317
+ resolvePath: ky,
23318
+ createFolders: My,
23319
+ deleteBulk: Ny,
23320
+ addTags: Fy,
23321
+ listFolders: Iy,
23322
+ getThumbnails: zy,
23323
+ search: Ay,
23324
+ upload: Vy,
23325
+ copy: Ly,
23326
+ move: Ry
23327
+ }, Gy = "https://api.serpapi.com/search", Ky = "google", qy = "google_images", Jy = "google_autocomplete", Yy = "google_trends", Xy = "google_maps", Zy = "google_maps_photos", Qy = "google_maps_reviews", $y = {
23201
23328
  engine: null,
23202
23329
  device: null,
23203
23330
  no_cache: !1,
23204
23331
  async: !1,
23205
23332
  output: "json"
23206
- }, Qy = { q: null }, $y = {
23333
+ }, eb = { q: null }, tb = {
23207
23334
  tbs: null,
23208
23335
  safe: "active",
23209
23336
  nfpr: 0,
23210
23337
  filter: 1
23211
23338
  };
23212
- function eb(e) {
23339
+ function nb(e) {
23213
23340
  let t = du(), n = du(!0), r = fu(!0), i = {
23214
23341
  location: t,
23215
23342
  uule: null
@@ -23227,13 +23354,13 @@ function eb(e) {
23227
23354
  hl: r
23228
23355
  };
23229
23356
  return {
23230
- [Wy]: {
23231
- ...Zy,
23357
+ [Ky]: {
23358
+ ...$y,
23232
23359
  ...i,
23233
23360
  ...o,
23234
- ...$y,
23235
- ...Qy,
23236
- engine: Wy,
23361
+ ...tb,
23362
+ ...eb,
23363
+ engine: Ky,
23237
23364
  ludocid: null,
23238
23365
  lsig: null,
23239
23366
  kgmid: null,
@@ -23242,29 +23369,29 @@ function eb(e) {
23242
23369
  start: null,
23243
23370
  num: null
23244
23371
  },
23245
- [Gy]: {
23246
- ...Zy,
23372
+ [qy]: {
23373
+ ...$y,
23247
23374
  ...i,
23248
23375
  ...o,
23249
- ...$y,
23250
- ...Qy,
23251
- engine: Gy,
23376
+ ...tb,
23377
+ ...eb,
23378
+ engine: qy,
23252
23379
  chips: null,
23253
23380
  ijn: null
23254
23381
  },
23255
- [Ky]: {
23256
- ...Zy,
23382
+ [Jy]: {
23383
+ ...$y,
23257
23384
  ...o,
23258
- ...Qy,
23259
- engine: Ky,
23385
+ ...eb,
23386
+ engine: Jy,
23260
23387
  cp: null,
23261
23388
  client: null
23262
23389
  },
23263
- [qy]: {
23264
- ...Zy,
23390
+ [Yy]: {
23391
+ ...$y,
23265
23392
  ...a,
23266
- ...Qy,
23267
- engine: qy,
23393
+ ...eb,
23394
+ engine: Yy,
23268
23395
  data_type: null,
23269
23396
  tz: null,
23270
23397
  cat: null,
@@ -23272,73 +23399,73 @@ function eb(e) {
23272
23399
  date: null,
23273
23400
  csv: null
23274
23401
  },
23275
- [Jy]: {
23276
- ...Zy,
23402
+ [Xy]: {
23403
+ ...$y,
23277
23404
  ...i,
23278
23405
  ...o,
23279
- ...$y,
23280
- ...Qy,
23281
- engine: Jy
23406
+ ...tb,
23407
+ ...eb,
23408
+ engine: Xy
23282
23409
  },
23283
- [Yy]: {
23284
- ...Zy,
23410
+ [Zy]: {
23411
+ ...$y,
23285
23412
  ...s,
23286
- engine: Yy
23413
+ engine: Zy
23287
23414
  },
23288
- [Xy]: {
23289
- ...Zy,
23415
+ [Qy]: {
23416
+ ...$y,
23290
23417
  ...s,
23291
- engine: Xy
23418
+ engine: Qy
23292
23419
  }
23293
23420
  }[e] ?? {};
23294
23421
  }
23295
- var tb = void 0;
23422
+ var rb = void 0;
23296
23423
  typeof Xa == "function" && Xa((e) => {
23297
- tb = e.scrape;
23424
+ rb = e.scrape;
23298
23425
  });
23299
- function nb(e) {
23426
+ function ib(e) {
23300
23427
  let t = {};
23301
23428
  for (let n in e) e[n] !== null && (t[n] = e[n]);
23302
23429
  return t;
23303
23430
  }
23304
- var rb = 0;
23305
- function ib(e = !1) {
23306
- let t = tb?.serpApiKey?.split(",").map((e) => e.trim()).filter(Boolean) || [];
23307
- return t.length === 0 ? null : (e && rb++, rb < t.length ? t[rb] : null);
23431
+ var ab = 0;
23432
+ function ob(e = !1) {
23433
+ let t = rb?.serpApiKey?.split(",").map((e) => e.trim()).filter(Boolean) || [];
23434
+ return t.length === 0 ? null : (e && ab++, ab < t.length ? t[ab] : null);
23308
23435
  }
23309
- var ab = async (e, t) => {
23436
+ var sb = async (e, t) => {
23310
23437
  let n = (n) => {
23311
- let r = nb({
23312
- ...eb(t),
23438
+ let r = ib({
23439
+ ...nb(t),
23313
23440
  api_key: n,
23314
23441
  q: e
23315
23442
  });
23316
- return console.log(Uy, r), `${Uy}?${new URLSearchParams(r)}`;
23317
- }, r = ib();
23443
+ return console.log(Gy, r), `${Gy}?${new URLSearchParams(r)}`;
23444
+ }, r = ob();
23318
23445
  for (; r;) try {
23319
23446
  return await nn(n(r));
23320
23447
  } catch (e) {
23321
23448
  if (e?.error === "quota_exceeded") {
23322
- console.warn(`SerpApi: invalid api key: ${r}`, e), r = ib(!0);
23449
+ console.warn(`SerpApi: invalid api key: ${r}`, e), r = ob(!0);
23323
23450
  continue;
23324
23451
  }
23325
23452
  throw console.error(`SerpApi: ${r}`, e), e;
23326
23453
  }
23327
23454
  return null;
23328
- }, ob = async (e, t, n) => {
23455
+ }, cb = async (e, t, n) => {
23329
23456
  let r = `${to}/${bt(t)}/${bt(e)}`, i = await n.read(r);
23330
23457
  if (i) return i;
23331
- let a = await ab(e, t);
23458
+ let a = await sb(e, t);
23332
23459
  return a ? n.set(r, a) : console.warn(`SerpApi ${t}: No Result`), a ?? {};
23333
- }, sb = (e) => ({
23334
- googleSearch: async (t) => ob(t, Wy, e),
23335
- googleImages: async (t) => ob(t, Gy, e),
23336
- googleAutocomplete: async (t) => ob(t, Ky, e),
23337
- googleTrends: async (t) => ob(t, qy, e),
23338
- googleMaps: async (t) => ob(t, Jy, e),
23339
- googleMapsPhotos: async (t) => ob(t, Yy, e),
23340
- googleMapsReviews: async (t) => ob(t, Xy, e)
23341
- }), cb = {
23460
+ }, lb = (e) => ({
23461
+ googleSearch: async (t) => cb(t, Ky, e),
23462
+ googleImages: async (t) => cb(t, qy, e),
23463
+ googleAutocomplete: async (t) => cb(t, Jy, e),
23464
+ googleTrends: async (t) => cb(t, Yy, e),
23465
+ googleMaps: async (t) => cb(t, Xy, e),
23466
+ googleMapsPhotos: async (t) => cb(t, Zy, e),
23467
+ googleMapsReviews: async (t) => cb(t, Qy, e)
23468
+ }), ub = {
23342
23469
  "+": "+",
23343
23470
  "﹢": "+",
23344
23471
  "-": "-",
@@ -23413,7 +23540,7 @@ var ab = async (e, t) => {
23413
23540
  x: "x",
23414
23541
  y: "y",
23415
23542
  z: "z"
23416
- }, lb = {
23543
+ }, db = {
23417
23544
  email: {
23418
23545
  description: "Email: no spaces -> Lower/Trim",
23419
23546
  transformations: [{
@@ -23459,7 +23586,7 @@ var ab = async (e, t) => {
23459
23586
  transformations: [],
23460
23587
  mask: ["toSlug"]
23461
23588
  }
23462
- }, ub = [
23589
+ }, fb = [
23463
23590
  {
23464
23591
  pattern: "email*",
23465
23592
  use: "email"
@@ -23476,24 +23603,24 @@ var ab = async (e, t) => {
23476
23603
  pattern: "date*",
23477
23604
  use: "date"
23478
23605
  }
23479
- ], db = new RegExp(Object.keys(cb).join("|"), "g");
23480
- function fb(e) {
23481
- return e ? e.normalize("NFKC").replace(db, (e) => cb[e] ?? e) : "";
23606
+ ], pb = new RegExp(Object.keys(ub).join("|"), "g");
23607
+ function mb(e) {
23608
+ return e ? e.normalize("NFKC").replace(pb, (e) => ub[e] ?? e) : "";
23482
23609
  }
23483
- var pb = class {
23610
+ var hb = class {
23484
23611
  config;
23485
23612
  matches;
23486
23613
  constructor(e = {}, t = []) {
23487
23614
  this.config = {
23488
- ...lb,
23615
+ ...db,
23489
23616
  ...e
23490
- }, this.matches = [...ub, ...t];
23617
+ }, this.matches = [...fb, ...t];
23491
23618
  }
23492
23619
  apply(e, t, n = !1) {
23493
23620
  let r = this.config[e];
23494
23621
  if (!r) return n ? Jt(t) : t;
23495
23622
  let i = t;
23496
- i = fb(String(i ?? ""));
23623
+ i = mb(String(i ?? ""));
23497
23624
  let a = r.exclusions;
23498
23625
  if (Array.isArray(a) && a.length) {
23499
23626
  let e = String(i).toLowerCase();
@@ -23552,7 +23679,7 @@ var pb = class {
23552
23679
  };
23553
23680
  //#endregion
23554
23681
  //#region src/libs/csv.ts
23555
- function mb(e, t) {
23682
+ function gb(e, t) {
23556
23683
  let n = ze.parse(e, {
23557
23684
  header: !0,
23558
23685
  skipEmptyLines: !0,
@@ -23565,6 +23692,6 @@ function mb(e, t) {
23565
23692
  };
23566
23693
  }
23567
23694
  //#endregion
23568
- export { Eu as AIProvider, sy as AI_PROVIDER_DEFINITIONS, ly as AI_PROVIDER_DESCRIPTORS, l as AI_PROVIDER_HOSTS, ri as ActionButton, _m as AddressAutocomplete, cs as Alert, gc as AnimatedNumber, Gv as App, Wv as AppProvider, oc as AreaChart, ua as AsyncDropdown, Li as AuthButton, gi as AuthProvider, xl as Autocomplete, xn as BUILT_IN_THEMES, _n as BUILT_IN_THEME_IDS, ii as BackLink, pr as Badge, fr as BadgeOverlay, uc as BarList, _a as Brand, Ta as Breadcrumbs, $_ as CLOUDFLARE_PROVIDER_DESCRIPTOR, ad as CONTEXT_MENU_SEARCH_THRESHOLD, mc as CalendarHeatmap, Ki as Card, Ea as Carousel, Ys as ChartDataTable, qs as ChartLegend, $h as ChatMarkdown, fg as ChatQuestions, tg as ChatReasoning, Fd as Chatbot, nl as Checkbox, Sl as Checklist, ks as Code, Cf as CodeEditor, rf as CodeSyntaxError, lr as Col, qc as Color, Qs as ColumnChart, Jf as Component, Yf as ComponentBlock, sr as Container, Sd as ContextMenu, Kl as CropImage, Qm as DEFAULT_DOCUMENT_HEAD, Zm as DEFAULT_HEAD_APP_NAME, $m as DEFAULT_LANGUAGE_HEAD, sl as DEFAULT_ORDER, zi as DataProvider, Jc as Date, Xc as DateTime, ds as DescriptionList, ty as DirectApiProviderAdapter, tc as DivergingBarChart, Vy as DropBoxConnectButton, y_ as DropboxAuthProvider, la as Dropdown, da as DropdownButton, ma as DropdownDivider, pa as DropdownHeader, fa as DropdownItem, ha as DropdownMenu, ay as EMAIL_PROVIDER_DEFINITIONS, Gc as Email, Gg as EmailProvider, Bc as FieldError, $l as FileNameEditor, ry as FirebaseApiProviderAdapter, f_ as FirebaseAuthProvider, c_ as FirebaseDataProvider, Jo as FirebaseStorageProvider, So as FirestoreDataProvider, Cp as Form, cp as FormControllerContext, hg as Gallery, x_ as GitHubAuthProvider, w_ as GmailEmailProvider, ai as GoSite, Ug as GoogleAuthProvider, im as GoogleMapsProvider, __ as GoogleServiceAccountProvider, Ag as Grid, kg as GridArray, Og as GridCore, Fm as GridDB, gg as GridGalleryView, Jm as GridTableView, Oh as Head, gh as HeadProvider, fc as Heatmap, tl as Hidden, Jn as I18nProvider, Q as Icon, Lr as IconProvider, Ns as Identicon, ga as Image, yi as ImageAvatar, Rl as ImageEditor, Bl as ImageField, Hc as Input, il as Label, nm as LayoutBuilder, ac as LineChart, bm as ListCard, ol as ListGroup, Vi as Loader, ni as LoadingButton, vc as LocaleSwitcher, Er as LucideIconProvider, Ih as MarkdownReader, dc as MeasureBarList, sa as Menu, ny as MockApiProviderAdapter, Ho as MockDataProvider, ra as Modal, oa as ModalOk, aa as ModalYesNo, Qc as Month, cb as NORMALIZE_MAP, Oa as Notifications, Wc as Number, uy as OPENAI_COMPATIBLE_PROVIDER_DESCRIPTOR, ul as Order, oy as PUBLISH_PROVIDER_DEFINITIONS, jg as PageUsers, mg as Pagination, Kc as Password, wc as Percentage, kr as PhosphorIconProvider, qd as Prompt, Id as PromptMode, id as PromptUtils, as as ProviderSwitcher, $c as Range, oi as ReferSite, Pp as Repeat, Gf as RichText, cr as Row, t as SERVER_CREDENTIAL_PREFIX, pb as Sanitizer, cc as ScatterChart, Aa as Search, yl as Select, ec as SequenceColumnChart, Mm as SideNav, Sm as SortableList, sc as Sparkline, $s as StackedColumnChart, Fl as StorageProvider, Uc as String, iy as SupabaseApiProviderAdapter, E_ as SupabaseAuthProvider, Fo as SupabaseDataProvider, Yo as SupabaseStorageProvider, rl as Switch, Hp as Tab, pg as TabDynamic, Bp as TabItem, zp as TabLayouts, Gp as Table, al as TextArea, Ba as ThemeSwitcher, Yc as Time, Na as Toolbar, hs as Tree, vm as UploadCSV, su as UploadDocument, cu as UploadImage, el as Url, Zc as Week, Z as Wrapper, Nt as arrayUnique, Rt as arraysEqual, Lt as base64Encode, Ht as base64ToBlob, Ut as base64ToUrl, va as buildBreadcrumbSchema, u as buildModelIdentityIndex, vd as buildTextCommandContext, Vr as buttonBaseClass, Wr as buttonDangerClass, Yr as buttonDarkClass, qr as buttonInfoClass, Jr as buttonLightClass, ei as buttonLinkClass, Qr as buttonOutlineDangerClass, Xr as buttonOutlinePrimaryClass, Zr as buttonOutlineSecondaryClass, $r as buttonOutlineSuccessClass, Hr as buttonPrimaryClass, Ur as buttonSecondaryClass, Gr as buttonSuccessClass, Kr as buttonWarningClass, uo as callFirebaseFunction, o as canonicalModelName, Fs as chartFill, Ps as chartToken, Dt as checkConditions, Gt as cleanRecord, X as cn, Mu as configureProxy, ft as converter, gt as copyToClipboard, Ot as crc32, fy as createAIProviderRegistry, Q_ as createCloudflareProviderDefinition, vr as createMotionTransition, py as createServerCredentialAIRegistry, Bn as createTranslations, ht as decodeJWT, zn as defineLocaleMessages, xt as dirname, Hy as dropBox, wt as eventClosest, nn as fetchJson, tn as fetchRest, rn as fetchWithRetry, Mc as fieldAddonClass, kc as fieldControlBaseClass, Oc as fieldFeedbackClass, jc as fieldGroupClass, Dc as fieldLabelClass, Ac as fieldTextAreaBaseClass, Cu as formatAIModelRef, Ct as generateUniqueId, Zu as getAIModelCatalog, Fi as getAccessToken, hd as getAutoClosedSuffixLength, mf as getCodeValidationResult, ou as getFileUrl, fi as getGlobalVars, by as getGoogleTrendsData, xy as getGoogleTrendsRelated, yy as getKeywordIdeas, Si as getProviderConfigurationState, Wt as getRecordValue, Ip as getTabLayoutConfig, Rp as getTabPaneClassName, Lp as getTabTriggerClassName, S_ as googleGetAccessToken, Cd as groupModelOptions, md as hasAutoClosedSuffix, Ms as identiconPattern, Vn as interpolate, jt as intersectObjects, n as isAIProviderTarget, ur as isBadgeDescriptor, Pt as isEmpty, Su as isFreeAIModel, Td as isFreeModelOption, Bt as isInteractiveElement, Lu as isProxyEnabled, dl as labelText, cm as loadGoogleMaps, c as loadModelIdentityIndex, At as loadScripts, Qv as locales, gd as matchCommandTrigger, i as modelOffers, xm as moveItem, Rs as niceMax, dr as normalizeBadgeProps, bt as normalizeKey, vt as normalizePath, fb as normalizeVisualChars, wu as parseAIModelRef, mb as parseCsvText, vi as path, Fu as proxyFetch, qt as recordsEqual, Zo as registerProviderSessionFactory, mi as removeGlobalVars, Vt as render2Base64, Gh as repairStreamingMarkdown, Et as replacePlaceholders, Mt as replaceVariables, e as resolveModel, yr as resolveMotionEffect, nf as runPrompt, It as safeClone, zt as sanitizeKey, sb as scrape, C_ as sendEmail, r as serverCredential, pi as setGlobalVars, St as sleep, Jt as smartTypeCast, Tt as substrCount, zs as ticks, cy as toProviderDescriptor, gs as treeFromPaths, _t as trimPath, yt as trimSlash, kt as ucfirst, Du as useAIProvider, Ou as useAIProviderRegistry, Mi as useAccessToken, Us as useAnimatedValues, $v as useApiProvider, Th as useAssetsHead, _i as useAuthProvider, Bs as useChartFormat, Js as useChartTooltip, Ks as useChartWidth, Yg as useCredentialsProvider, Bi as useDataProvider, wh as useDocumentHead, By as useDropBoxConnect, Ec as useEditorHeight, Kg as useEmailProvider, Cr as useEnterMotion, eu as useFileUploadCore, up as useFormActions, yp as useFormContext, lp as useFormController, di as useGlobalVars, am as useGoogleMapsConfig, yh as useHead, xh as useHeadLinks, Y as useI18n, zr as useIconController, Rr as useIconProvider, Dl as useImage, Ch as useLanguageHead, Kv as useMenu, br as useMotionEffect, xr as useMotionState, Sh as usePaginationHead, Sr as usePressMotion, Ga as useProvider, rs as useProviderSession, Iu as useProxy, Eh as usePwaHead, Ws as useReveal, Dh as useSchemaOrgHead, Wa as useSetProvider, bh as useSocialHead, Il as useStorageProvider, J as useTheme, Ln as useThemeController, pf as validateCodeSyntax };
23695
+ export { Eu as AIProvider, ly as AI_PROVIDER_DEFINITIONS, dy as AI_PROVIDER_DESCRIPTORS, l as AI_PROVIDER_HOSTS, ri as ActionButton, _m as AddressAutocomplete, cs as Alert, gc as AnimatedNumber, qv as App, Kv as AppProvider, oc as AreaChart, ua as AsyncDropdown, Li as AuthButton, gi as AuthProvider, xl as Autocomplete, xn as BUILT_IN_THEMES, _n as BUILT_IN_THEME_IDS, ii as BackLink, pr as Badge, fr as BadgeOverlay, uc as BarList, _a as Brand, Ta as Breadcrumbs, tv as CLOUDFLARE_PROVIDER_DESCRIPTOR, ad as CONTEXT_MENU_SEARCH_THRESHOLD, mc as CalendarHeatmap, Ki as Card, Ea as Carousel, Ys as ChartDataTable, qs as ChartLegend, mg as ChatActivity, $h as ChatMarkdown, fg as ChatQuestions, tg as ChatReasoning, Fd as Chatbot, nl as Checkbox, Sl as Checklist, ks as Code, Cf as CodeEditor, rf as CodeSyntaxError, lr as Col, qc as Color, Qs as ColumnChart, Jf as Component, Yf as ComponentBlock, sr as Container, Sd as ContextMenu, Kl as CropImage, Qm as DEFAULT_DOCUMENT_HEAD, Zm as DEFAULT_HEAD_APP_NAME, $m as DEFAULT_LANGUAGE_HEAD, sl as DEFAULT_ORDER, zi as DataProvider, Jc as Date, Xc as DateTime, ds as DescriptionList, ry as DirectApiProviderAdapter, tc as DivergingBarChart, Uy as DropBoxConnectButton, x_ as DropboxAuthProvider, la as Dropdown, da as DropdownButton, ma as DropdownDivider, pa as DropdownHeader, fa as DropdownItem, ha as DropdownMenu, sy as EMAIL_PROVIDER_DEFINITIONS, Gc as Email, qg as EmailProvider, Bc as FieldError, $l as FileNameEditor, ay as FirebaseApiProviderAdapter, m_ as FirebaseAuthProvider, u_ as FirebaseDataProvider, Jo as FirebaseStorageProvider, So as FirestoreDataProvider, Cp as Form, cp as FormControllerContext, _g as Gallery, C_ as GitHubAuthProvider, E_ as GmailEmailProvider, ai as GoSite, Gg as GoogleAuthProvider, im as GoogleMapsProvider, y_ as GoogleServiceAccountProvider, Mg as Grid, jg as GridArray, Ag as GridCore, Fm as GridDB, vg as GridGalleryView, Jm as GridTableView, Oh as Head, gh as HeadProvider, fc as Heatmap, tl as Hidden, Jn as I18nProvider, Q as Icon, Lr as IconProvider, Ns as Identicon, ga as Image, yi as ImageAvatar, Rl as ImageEditor, Bl as ImageField, Hc as Input, il as Label, nm as LayoutBuilder, ac as LineChart, bm as ListCard, ol as ListGroup, Vi as Loader, ni as LoadingButton, vc as LocaleSwitcher, Er as LucideIconProvider, Ih as MarkdownReader, dc as MeasureBarList, sa as Menu, iy as MockApiProviderAdapter, Ho as MockDataProvider, ra as Modal, oa as ModalOk, aa as ModalYesNo, Qc as Month, ub as NORMALIZE_MAP, Oa as Notifications, Wc as Number, fy as OPENAI_COMPATIBLE_PROVIDER_DESCRIPTOR, ul as Order, cy as PUBLISH_PROVIDER_DEFINITIONS, Ng as PageUsers, gg as Pagination, Kc as Password, wc as Percentage, kr as PhosphorIconProvider, qd as Prompt, Id as PromptMode, id as PromptUtils, as as ProviderSwitcher, $c as Range, oi as ReferSite, Pp as Repeat, Gf as RichText, cr as Row, t as SERVER_CREDENTIAL_PREFIX, hb as Sanitizer, cc as ScatterChart, Aa as Search, yl as Select, ec as SequenceColumnChart, Mm as SideNav, Sm as SortableList, sc as Sparkline, $s as StackedColumnChart, Fl as StorageProvider, Uc as String, oy as SupabaseApiProviderAdapter, O_ as SupabaseAuthProvider, Fo as SupabaseDataProvider, Yo as SupabaseStorageProvider, rl as Switch, Hp as Tab, hg as TabDynamic, Bp as TabItem, zp as TabLayouts, Gp as Table, al as TextArea, Ba as ThemeSwitcher, Yc as Time, Na as Toolbar, hs as Tree, vm as UploadCSV, su as UploadDocument, cu as UploadImage, el as Url, Zc as Week, Z as Wrapper, Nt as arrayUnique, Rt as arraysEqual, Lt as base64Encode, Ht as base64ToBlob, Ut as base64ToUrl, va as buildBreadcrumbSchema, u as buildModelIdentityIndex, vd as buildTextCommandContext, Vr as buttonBaseClass, Wr as buttonDangerClass, Yr as buttonDarkClass, qr as buttonInfoClass, Jr as buttonLightClass, ei as buttonLinkClass, Qr as buttonOutlineDangerClass, Xr as buttonOutlinePrimaryClass, Zr as buttonOutlineSecondaryClass, $r as buttonOutlineSuccessClass, Hr as buttonPrimaryClass, Ur as buttonSecondaryClass, Gr as buttonSuccessClass, Kr as buttonWarningClass, uo as callFirebaseFunction, o as canonicalModelName, Fs as chartFill, Ps as chartToken, Dt as checkConditions, Gt as cleanRecord, X as cn, Mu as configureProxy, ft as converter, gt as copyToClipboard, Ot as crc32, my as createAIProviderRegistry, ev as createCloudflareProviderDefinition, vr as createMotionTransition, hy as createServerCredentialAIRegistry, Bn as createTranslations, ht as decodeJWT, zn as defineLocaleMessages, xt as dirname, Wy as dropBox, wt as eventClosest, nn as fetchJson, tn as fetchRest, rn as fetchWithRetry, Mc as fieldAddonClass, kc as fieldControlBaseClass, Oc as fieldFeedbackClass, jc as fieldGroupClass, Dc as fieldLabelClass, Ac as fieldTextAreaBaseClass, Cu as formatAIModelRef, Ct as generateUniqueId, Zu as getAIModelCatalog, Fi as getAccessToken, hd as getAutoClosedSuffixLength, mf as getCodeValidationResult, ou as getFileUrl, fi as getGlobalVars, Sy as getGoogleTrendsData, Cy as getGoogleTrendsRelated, xy as getKeywordIdeas, Si as getProviderConfigurationState, Wt as getRecordValue, Ip as getTabLayoutConfig, Rp as getTabPaneClassName, Lp as getTabTriggerClassName, w_ as googleGetAccessToken, Cd as groupModelOptions, md as hasAutoClosedSuffix, Ms as identiconPattern, Vn as interpolate, jt as intersectObjects, n as isAIProviderTarget, ur as isBadgeDescriptor, Pt as isEmpty, Su as isFreeAIModel, Td as isFreeModelOption, Bt as isInteractiveElement, Lu as isProxyEnabled, dl as labelText, cm as loadGoogleMaps, c as loadModelIdentityIndex, At as loadScripts, ey as locales, gd as matchCommandTrigger, i as modelOffers, xm as moveItem, Rs as niceMax, dr as normalizeBadgeProps, bt as normalizeKey, vt as normalizePath, mb as normalizeVisualChars, wu as parseAIModelRef, gb as parseCsvText, vi as path, Fu as proxyFetch, qt as recordsEqual, Zo as registerProviderSessionFactory, mi as removeGlobalVars, Vt as render2Base64, Gh as repairStreamingMarkdown, Et as replacePlaceholders, Mt as replaceVariables, e as resolveModel, yr as resolveMotionEffect, nf as runPrompt, It as safeClone, zt as sanitizeKey, lb as scrape, T_ as sendEmail, r as serverCredential, pi as setGlobalVars, St as sleep, Jt as smartTypeCast, Tt as substrCount, zs as ticks, uy as toProviderDescriptor, gs as treeFromPaths, _t as trimPath, yt as trimSlash, kt as ucfirst, Du as useAIProvider, Ou as useAIProviderRegistry, Mi as useAccessToken, Us as useAnimatedValues, ty as useApiProvider, Th as useAssetsHead, _i as useAuthProvider, Bs as useChartFormat, Js as useChartTooltip, Ks as useChartWidth, Zg as useCredentialsProvider, Bi as useDataProvider, wh as useDocumentHead, Hy as useDropBoxConnect, Ec as useEditorHeight, Jg as useEmailProvider, Cr as useEnterMotion, eu as useFileUploadCore, up as useFormActions, yp as useFormContext, lp as useFormController, di as useGlobalVars, am as useGoogleMapsConfig, yh as useHead, xh as useHeadLinks, Y as useI18n, zr as useIconController, Rr as useIconProvider, Dl as useImage, Ch as useLanguageHead, Jv as useMenu, br as useMotionEffect, xr as useMotionState, Sh as usePaginationHead, Sr as usePressMotion, Ga as useProvider, rs as useProviderSession, Iu as useProxy, Eh as usePwaHead, Ws as useReveal, Dh as useSchemaOrgHead, Wa as useSetProvider, bh as useSocialHead, Il as useStorageProvider, J as useTheme, Ln as useThemeController, pf as validateCodeSyntax };
23569
23696
 
23570
23697
  //# sourceMappingURL=index.mjs.map