@llmnative/react 1.43.0 → 1.44.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.css +1 -1
- package/dist/index.js +14 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +756 -651
- package/dist/index.mjs.map +1 -1
- package/dist/types/src/I18n.d.ts +4 -0
- package/dist/types/src/components/blocks/SortableList.d.ts +37 -0
- package/dist/types/src/components/index.d.ts +2 -0
- package/llms-full.txt +22 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2808,6 +2808,10 @@ var Pn = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10
|
|
|
2808
2808
|
reorderRow: "Reorder row {key}"
|
|
2809
2809
|
},
|
|
2810
2810
|
gallery: { selectItem: "Select item {key}" },
|
|
2811
|
+
sortableList: {
|
|
2812
|
+
handle: "Move item {position} of {total}: drag it, or use the up and down arrows",
|
|
2813
|
+
moved: "Moved to position {position} of {total}"
|
|
2814
|
+
},
|
|
2811
2815
|
crop: {
|
|
2812
2816
|
enableCrop: "Click {scale} to enable this crop",
|
|
2813
2817
|
variants: "Variants",
|
|
@@ -4284,7 +4288,7 @@ var Hi = "rounded-lg border border-border bg-card text-card-foreground shadow-sm
|
|
|
4284
4288
|
}))
|
|
4285
4289
|
}, e);
|
|
4286
4290
|
}, 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 }) => {
|
|
4287
|
-
let g =
|
|
4291
|
+
let g = Vv(e), _ = J("menu"), v = ({ item: e, index: r }) => {
|
|
4288
4292
|
let [i, a] = E(e.active);
|
|
4289
4293
|
b(() => {
|
|
4290
4294
|
a(e.active);
|
|
@@ -15168,7 +15172,7 @@ function Bp({ columns: e = void 0, records: t = void 0, footer: n = void 0, onRo
|
|
|
15168
15172
|
width: "1%",
|
|
15169
15173
|
whiteSpace: "nowrap"
|
|
15170
15174
|
}
|
|
15171
|
-
}))), Pe = /* @__PURE__ */ f.createElement(
|
|
15175
|
+
}))), Pe = /* @__PURE__ */ f.createElement(lg, {
|
|
15172
15176
|
records: xe,
|
|
15173
15177
|
appendTo: ee,
|
|
15174
15178
|
wrapperClassName: "px-3 pt-4 pb-2",
|
|
@@ -16016,9 +16020,90 @@ function hm({ title: e = void 0, description: t = void 0, meta: n = void 0, badg
|
|
|
16016
16020
|
}, z), /* @__PURE__ */ f.createElement(Z, { className: X(N.ListCard.wrapperClassName, y) }, _, V, v);
|
|
16017
16021
|
}
|
|
16018
16022
|
//#endregion
|
|
16023
|
+
//#region src/components/blocks/SortableList.tsx
|
|
16024
|
+
function gm(e, t, n) {
|
|
16025
|
+
let r = [...e], [i] = r.splice(t, 1);
|
|
16026
|
+
return r.splice(Math.max(0, Math.min(n, r.length)), 0, i), r;
|
|
16027
|
+
}
|
|
16028
|
+
function _m({ items: e, getKey: t, renderItem: n, onReorder: r = void 0, label: i = void 0, numbered: a = !1, disabled: o = !1, emptyState: s = void 0, className: c = void 0, itemClassName: l = void 0, cardClassName: u = void 0 }) {
|
|
16029
|
+
let d = Y("sortableList"), [p, m] = E(null), [h, g] = E(null), [_, v] = E(""), y = !o && !!r && e.length > 1;
|
|
16030
|
+
if (!e.length) return s ? /* @__PURE__ */ f.createElement(f.Fragment, null, s) : null;
|
|
16031
|
+
let b = (t, n) => {
|
|
16032
|
+
!r || t === n || n < 0 || n >= e.length || (r(gm(e, t, n), {
|
|
16033
|
+
fromIndex: t,
|
|
16034
|
+
toIndex: n,
|
|
16035
|
+
item: e[t]
|
|
16036
|
+
}), v(Vn(d.moved, {
|
|
16037
|
+
position: n + 1,
|
|
16038
|
+
total: e.length
|
|
16039
|
+
})));
|
|
16040
|
+
}, x = (e) => {
|
|
16041
|
+
if (p === null || !h) return;
|
|
16042
|
+
let t = h.after ? e + 1 : e;
|
|
16043
|
+
b(p, t > p ? t - 1 : t), m(null), g(null);
|
|
16044
|
+
};
|
|
16045
|
+
return /* @__PURE__ */ f.createElement("div", { className: c }, /* @__PURE__ */ f.createElement("ul", {
|
|
16046
|
+
className: "flex flex-col gap-2",
|
|
16047
|
+
"aria-label": i
|
|
16048
|
+
}, e.map((r, i) => {
|
|
16049
|
+
let o = n(r, i), s = h?.index === i && p !== null && p !== i;
|
|
16050
|
+
return /* @__PURE__ */ f.createElement("li", {
|
|
16051
|
+
key: t(r),
|
|
16052
|
+
className: X("relative flex items-stretch gap-2", p === i && "opacity-50", l),
|
|
16053
|
+
onDragOver: (e) => {
|
|
16054
|
+
if (!y || p === null) return;
|
|
16055
|
+
e.preventDefault();
|
|
16056
|
+
let t = e.currentTarget.getBoundingClientRect();
|
|
16057
|
+
g({
|
|
16058
|
+
index: i,
|
|
16059
|
+
after: e.clientY > t.top + t.height / 2
|
|
16060
|
+
});
|
|
16061
|
+
},
|
|
16062
|
+
onDragLeave: () => g((e) => e?.index === i ? null : e),
|
|
16063
|
+
onDrop: (e) => {
|
|
16064
|
+
y && (e.preventDefault(), x(i));
|
|
16065
|
+
}
|
|
16066
|
+
}, s && /* @__PURE__ */ f.createElement("span", {
|
|
16067
|
+
"aria-hidden": "true",
|
|
16068
|
+
className: X("pointer-events-none absolute inset-x-0 h-0.5 rounded-full bg-primary", h.after ? "-bottom-1.5" : "-top-1.5")
|
|
16069
|
+
}), y && /* @__PURE__ */ f.createElement("button", {
|
|
16070
|
+
type: "button",
|
|
16071
|
+
draggable: !0,
|
|
16072
|
+
"aria-label": Vn(d.handle, {
|
|
16073
|
+
position: i + 1,
|
|
16074
|
+
total: e.length
|
|
16075
|
+
}),
|
|
16076
|
+
className: "flex w-6 shrink-0 cursor-grab items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring active:cursor-grabbing",
|
|
16077
|
+
onDragStart: (e) => {
|
|
16078
|
+
m(i), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/plain", t(r));
|
|
16079
|
+
},
|
|
16080
|
+
onDragEnd: () => {
|
|
16081
|
+
m(null), g(null);
|
|
16082
|
+
},
|
|
16083
|
+
onKeyDown: (e) => {
|
|
16084
|
+
e.key === "ArrowUp" ? (e.preventDefault(), b(i, i - 1)) : e.key === "ArrowDown" && (e.preventDefault(), b(i, i + 1));
|
|
16085
|
+
}
|
|
16086
|
+
}, /* @__PURE__ */ f.createElement(Q, {
|
|
16087
|
+
name: "grip-vertical",
|
|
16088
|
+
size: 16
|
|
16089
|
+
})), a && /* @__PURE__ */ f.createElement("span", {
|
|
16090
|
+
className: "flex w-6 shrink-0 items-center justify-center text-sm font-medium tabular-nums text-muted-foreground",
|
|
16091
|
+
"aria-hidden": "true"
|
|
16092
|
+
}, i + 1), /* @__PURE__ */ f.createElement(hm, {
|
|
16093
|
+
compact: !0,
|
|
16094
|
+
wrapperClassName: "min-w-0 flex-1",
|
|
16095
|
+
className: u,
|
|
16096
|
+
...o
|
|
16097
|
+
}));
|
|
16098
|
+
})), /* @__PURE__ */ f.createElement("span", {
|
|
16099
|
+
className: "sr-only",
|
|
16100
|
+
"aria-live": "polite"
|
|
16101
|
+
}, _));
|
|
16102
|
+
}
|
|
16103
|
+
//#endregion
|
|
16019
16104
|
//#region src/components/blocks/SideNav.tsx
|
|
16020
|
-
var
|
|
16021
|
-
function
|
|
16105
|
+
var vm = 208, ym = 52;
|
|
16106
|
+
function bm(e) {
|
|
16022
16107
|
return e.map((e) => ({
|
|
16023
16108
|
path: e.path,
|
|
16024
16109
|
title: e.title,
|
|
@@ -16026,13 +16111,13 @@ function vm(e) {
|
|
|
16026
16111
|
group: e.group,
|
|
16027
16112
|
end: e.end,
|
|
16028
16113
|
badge: e.badge,
|
|
16029
|
-
children: e.children ?
|
|
16114
|
+
children: e.children ? bm(e.children) : void 0
|
|
16030
16115
|
}));
|
|
16031
16116
|
}
|
|
16032
|
-
function
|
|
16117
|
+
function xm(e, t, n) {
|
|
16033
16118
|
return n ? e === t : e === t || t !== "/" && e.startsWith(t + "/");
|
|
16034
16119
|
}
|
|
16035
|
-
function
|
|
16120
|
+
function Sm(e) {
|
|
16036
16121
|
let t = /* @__PURE__ */ new Map();
|
|
16037
16122
|
for (let n of e) {
|
|
16038
16123
|
let e = n.group ?? "General";
|
|
@@ -16043,28 +16128,28 @@ function bm(e) {
|
|
|
16043
16128
|
items: t
|
|
16044
16129
|
}));
|
|
16045
16130
|
}
|
|
16046
|
-
function
|
|
16131
|
+
function Cm({ value: e }) {
|
|
16047
16132
|
let t = J("sideNav");
|
|
16048
16133
|
return /* @__PURE__ */ f.createElement("span", { className: X("ml-auto shrink-0 text-[10px] font-semibold leading-none px-1.5 py-[3px] rounded-full bg-primary/15 text-primary", t.SideNav.itemBadgeClassName) }, e);
|
|
16049
16134
|
}
|
|
16050
|
-
function
|
|
16135
|
+
function wm({ children: e, open: t }) {
|
|
16051
16136
|
let { pathname: n } = M(), r = J("sideNav");
|
|
16052
16137
|
return /* @__PURE__ */ f.createElement("div", { style: {
|
|
16053
16138
|
maxHeight: t ? `${e.length * 34 + 8}px` : "0px",
|
|
16054
16139
|
overflow: "hidden",
|
|
16055
16140
|
transition: "max-height 200ms ease"
|
|
16056
16141
|
} }, /* @__PURE__ */ f.createElement("div", { className: "py-0.5 space-y-0.5" }, e.map((e) => {
|
|
16057
|
-
let t =
|
|
16142
|
+
let t = xm(n, e.path, e.end);
|
|
16058
16143
|
return /* @__PURE__ */ f.createElement(k, {
|
|
16059
16144
|
key: e.path,
|
|
16060
16145
|
to: e.path,
|
|
16061
16146
|
"aria-current": t ? "page" : void 0,
|
|
16062
16147
|
className: X("flex items-center rounded-md pl-9 pr-3 py-[6px] text-sm transition-colors", r.SideNav.subItemClassName, t ? r.SideNav.subItemActiveClassName : r.SideNav.subItemInactiveClassName)
|
|
16063
|
-
}, /* @__PURE__ */ f.createElement("span", { className: "flex-1 truncate" }, e.title), e.badge !== void 0 && /* @__PURE__ */ f.createElement(
|
|
16148
|
+
}, /* @__PURE__ */ f.createElement("span", { className: "flex-1 truncate" }, e.title), e.badge !== void 0 && /* @__PURE__ */ f.createElement(Cm, { value: e.badge }));
|
|
16064
16149
|
})));
|
|
16065
16150
|
}
|
|
16066
|
-
function
|
|
16067
|
-
let { pathname: a } = M(), o = J("sideNav"), s = Y("sideNav"), c = (e.children?.length ?? 0) > 0, l =
|
|
16151
|
+
function Tm({ item: e, expanded: t, open: n, showIcons: r, onToggle: i }) {
|
|
16152
|
+
let { pathname: a } = M(), o = J("sideNav"), s = Y("sideNav"), c = (e.children?.length ?? 0) > 0, l = xm(a, e.path, e.end), u = c && e.children.some((e) => xm(a, e.path, e.end)), d = l ? o.SideNav.itemActiveClassName : u ? o.SideNav.itemChildActiveClassName : o.SideNav.itemInactiveClassName, p = r ? /* @__PURE__ */ f.createElement("span", { className: X("relative shrink-0 flex items-center justify-center w-[18px] h-[18px]", o.SideNav.itemIconClassName) }, e.icon ? /* @__PURE__ */ f.createElement(Q, {
|
|
16068
16153
|
name: e.icon,
|
|
16069
16154
|
size: 17
|
|
16070
16155
|
}) : /* @__PURE__ */ f.createElement("span", { className: "w-1.5 h-1.5 rounded-full bg-current opacity-30" }), !t && e.badge !== void 0 && /* @__PURE__ */ f.createElement("span", { className: X("absolute -top-0.5 -right-1 w-[7px] h-[7px] rounded-full bg-primary ring-1 ring-background", o.SideNav.itemCollapsedBadgeClassName) })) : null, m = {
|
|
@@ -16082,7 +16167,7 @@ function Cm({ item: e, expanded: t, open: n, showIcons: r, onToggle: i }) {
|
|
|
16082
16167
|
}, p, /* @__PURE__ */ f.createElement("span", {
|
|
16083
16168
|
style: m,
|
|
16084
16169
|
className: o.SideNav.itemTextClassName
|
|
16085
|
-
}, e.title), t && e.badge !== void 0 && /* @__PURE__ */ f.createElement(
|
|
16170
|
+
}, e.title), t && e.badge !== void 0 && /* @__PURE__ */ f.createElement(Cm, { value: e.badge })), t && /* @__PURE__ */ f.createElement("button", {
|
|
16086
16171
|
onClick: () => i(e.path),
|
|
16087
16172
|
className: X("shrink-0 flex items-center justify-center w-6 h-6 rounded transition-colors text-muted-foreground/50 hover:text-foreground hover:bg-accent", o.SideNav.itemToggleClassName),
|
|
16088
16173
|
title: n ? s.collapseGroup : s.expandGroup,
|
|
@@ -16093,7 +16178,7 @@ function Cm({ item: e, expanded: t, open: n, showIcons: r, onToggle: i }) {
|
|
|
16093
16178
|
} }, /* @__PURE__ */ f.createElement(Q, {
|
|
16094
16179
|
name: "chevron-down",
|
|
16095
16180
|
size: 13
|
|
16096
|
-
})))), t && /* @__PURE__ */ f.createElement(
|
|
16181
|
+
})))), t && /* @__PURE__ */ f.createElement(wm, {
|
|
16097
16182
|
children: e.children,
|
|
16098
16183
|
open: n
|
|
16099
16184
|
})) : /* @__PURE__ */ f.createElement(k, {
|
|
@@ -16104,14 +16189,14 @@ function Cm({ item: e, expanded: t, open: n, showIcons: r, onToggle: i }) {
|
|
|
16104
16189
|
}, p, /* @__PURE__ */ f.createElement("span", {
|
|
16105
16190
|
style: m,
|
|
16106
16191
|
className: o.SideNav.itemTextClassName
|
|
16107
|
-
}, e.title), t && e.badge !== void 0 && /* @__PURE__ */ f.createElement(
|
|
16192
|
+
}, e.title), t && e.badge !== void 0 && /* @__PURE__ */ f.createElement(Cm, { value: e.badge }));
|
|
16108
16193
|
}
|
|
16109
|
-
function
|
|
16194
|
+
function Em({ group: e, expanded: t, openItems: n, showIcons: r, onToggle: i }) {
|
|
16110
16195
|
let a = e.key === "General", o = J("sideNav");
|
|
16111
16196
|
return /* @__PURE__ */ f.createElement("div", { className: "mb-1" }, !a && /* @__PURE__ */ f.createElement("div", {
|
|
16112
16197
|
style: { height: t ? void 0 : "1px" },
|
|
16113
16198
|
className: t ? "px-2 pb-0.5 pt-3 first:pt-1" : X("mx-2 my-2 bg-border/40", o.SideNav.groupDividerClassName)
|
|
16114
|
-
}, t && /* @__PURE__ */ f.createElement("span", { className: X("text-[10.5px] font-semibold uppercase tracking-widest text-muted-foreground/50 select-none", o.SideNav.groupLabelClassName) }, e.key)), /* @__PURE__ */ f.createElement("div", { className: "space-y-0.5" }, e.items.map((e) => /* @__PURE__ */ f.createElement(
|
|
16199
|
+
}, t && /* @__PURE__ */ f.createElement("span", { className: X("text-[10.5px] font-semibold uppercase tracking-widest text-muted-foreground/50 select-none", o.SideNav.groupLabelClassName) }, e.key)), /* @__PURE__ */ f.createElement("div", { className: "space-y-0.5" }, e.items.map((e) => /* @__PURE__ */ f.createElement(Tm, {
|
|
16115
16200
|
key: e.path,
|
|
16116
16201
|
item: e,
|
|
16117
16202
|
expanded: t,
|
|
@@ -16120,8 +16205,8 @@ function wm({ group: e, expanded: t, openItems: n, showIcons: r, onToggle: i })
|
|
|
16120
16205
|
onToggle: i
|
|
16121
16206
|
}))));
|
|
16122
16207
|
}
|
|
16123
|
-
function
|
|
16124
|
-
let { pathname: d } = M(), p = J("sideNav"), m = Y("sideNav"), h =
|
|
16208
|
+
function Dm({ 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 }) {
|
|
16209
|
+
let { pathname: d } = M(), p = J("sideNav"), m = Y("sideNav"), h = Vv(e ?? ""), g = t ?? (e ? bm(h) : []), _ = i !== void 0, [y, x] = E(r), S = i === void 0 ? y : i, C = v((e) => {
|
|
16125
16210
|
let t = typeof e == "function" ? e(S) : e;
|
|
16126
16211
|
_ ? a?.(t) : x(t);
|
|
16127
16212
|
}, [
|
|
@@ -16133,7 +16218,7 @@ function Tm({ menuKey: e, items: t, bottomItems: n = [], defaultCollapsed: r = !
|
|
|
16133
16218
|
k((e) => {
|
|
16134
16219
|
let t = new Set(e);
|
|
16135
16220
|
return [...g, ...n].forEach((e) => {
|
|
16136
|
-
e.children?.some((e) =>
|
|
16221
|
+
e.children?.some((e) => xm(d, e.path, e.end)) && t.add(e.path);
|
|
16137
16222
|
}), t;
|
|
16138
16223
|
});
|
|
16139
16224
|
}, [d]);
|
|
@@ -16148,7 +16233,7 @@ function Tm({ menuKey: e, items: t, bottomItems: n = [], defaultCollapsed: r = !
|
|
|
16148
16233
|
S && (A.current = setTimeout(() => D(!1), 80));
|
|
16149
16234
|
};
|
|
16150
16235
|
if (g.length === 0 && n.length === 0) return null;
|
|
16151
|
-
let I =
|
|
16236
|
+
let I = Sm(g), L = Sm(n), R = (e, t) => e.map((e) => /* @__PURE__ */ f.createElement(Em, {
|
|
16152
16237
|
key: e.key,
|
|
16153
16238
|
group: e,
|
|
16154
16239
|
expanded: t,
|
|
@@ -16159,7 +16244,7 @@ function Tm({ menuKey: e, items: t, bottomItems: n = [], defaultCollapsed: r = !
|
|
|
16159
16244
|
return u ? /* @__PURE__ */ f.createElement("nav", { className: X("px-1.5 py-2", p.SideNav.navClassName) }, R(I, !0), L.length > 0 && /* @__PURE__ */ f.createElement("div", { className: X("mt-2 border-t pt-2", p.SideNav.bottomNavClassName) }, R(L, !0))) : /* @__PURE__ */ f.createElement("div", {
|
|
16160
16245
|
className: X("min-h-0", p.SideNav.wrapperClassName),
|
|
16161
16246
|
style: {
|
|
16162
|
-
width: S ?
|
|
16247
|
+
width: S ? ym : vm,
|
|
16163
16248
|
height: "100%",
|
|
16164
16249
|
transition: "width 220ms cubic-bezier(0.4,0,0.2,1)",
|
|
16165
16250
|
flexShrink: 0,
|
|
@@ -16167,7 +16252,7 @@ function Tm({ menuKey: e, items: t, bottomItems: n = [], defaultCollapsed: r = !
|
|
|
16167
16252
|
}
|
|
16168
16253
|
}, /* @__PURE__ */ f.createElement("aside", {
|
|
16169
16254
|
style: {
|
|
16170
|
-
width: j ?
|
|
16255
|
+
width: j ? vm : ym,
|
|
16171
16256
|
transition: "width 220ms cubic-bezier(0.4,0,0.2,1)",
|
|
16172
16257
|
position: S ? "absolute" : "sticky",
|
|
16173
16258
|
top: 0,
|
|
@@ -16209,7 +16294,7 @@ function Tm({ menuKey: e, items: t, bottomItems: n = [], defaultCollapsed: r = !
|
|
|
16209
16294
|
}
|
|
16210
16295
|
//#endregion
|
|
16211
16296
|
//#region src/components/widgets/grid-core/useGridDBRecords.ts
|
|
16212
|
-
function
|
|
16297
|
+
function Om({ path: e, where: t, order: n, fieldMap: r }) {
|
|
16213
16298
|
let i = Bi(), [a, o] = E([]), s = w(() => {
|
|
16214
16299
|
if (t || n || r) return {
|
|
16215
16300
|
where: t,
|
|
@@ -16229,13 +16314,13 @@ function Em({ path: e, where: t, order: n, fieldMap: r }) {
|
|
|
16229
16314
|
}
|
|
16230
16315
|
//#endregion
|
|
16231
16316
|
//#region src/components/widgets/grid-core/resolveGridPathFromUrl.ts
|
|
16232
|
-
function
|
|
16317
|
+
function km(e) {
|
|
16233
16318
|
if (e) return e;
|
|
16234
16319
|
}
|
|
16235
16320
|
//#endregion
|
|
16236
16321
|
//#region src/components/widgets/grid-core/GridDB.tsx
|
|
16237
|
-
function
|
|
16238
|
-
let s = M(), c = t ?
|
|
16322
|
+
function Am({ path: e, fromUrl: t, where: n, order: r, fieldMap: i, recordId: a = fo, ...o }) {
|
|
16323
|
+
let s = M(), c = t ? km(s.pathname) : e, l = Om({
|
|
16239
16324
|
path: c,
|
|
16240
16325
|
where: n,
|
|
16241
16326
|
order: r,
|
|
@@ -16250,7 +16335,7 @@ function Om({ path: e, fromUrl: t, where: n, order: r, fieldMap: i, recordId: a
|
|
|
16250
16335
|
dir: n
|
|
16251
16336
|
};
|
|
16252
16337
|
}, [r]), d = o.sortable === void 0 || o.sortable === !0 ? u ?? o.sortable : o.sortable;
|
|
16253
|
-
return /* @__PURE__ */ f.createElement(
|
|
16338
|
+
return /* @__PURE__ */ f.createElement(Cg, {
|
|
16254
16339
|
...o,
|
|
16255
16340
|
records: l,
|
|
16256
16341
|
recordId: a,
|
|
@@ -16260,22 +16345,22 @@ function Om({ path: e, fromUrl: t, where: n, order: r, fieldMap: i, recordId: a
|
|
|
16260
16345
|
}
|
|
16261
16346
|
//#endregion
|
|
16262
16347
|
//#region src/components/widgets/grid-core/utils.ts
|
|
16263
|
-
var
|
|
16348
|
+
var jm = (e) => e.replace(/[^a-zA-Z0-9_-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, ""), Mm = (e) => (t) => {
|
|
16264
16349
|
if (typeof e == "function") return String(e(t));
|
|
16265
16350
|
let n = t[e];
|
|
16266
16351
|
return n == null || n === "" ? "" : String(n);
|
|
16267
|
-
},
|
|
16352
|
+
}, Nm = (e, t) => {
|
|
16268
16353
|
if (e == null || e === "text") return t;
|
|
16269
16354
|
if (e === "boolean") return t ? "Yes" : "No";
|
|
16270
16355
|
if (e === "json") return t == null ? "" : JSON.stringify(t, null, 2);
|
|
16271
16356
|
if (e === "badge" || e === "image" || e === "email") return t;
|
|
16272
16357
|
let n = ft[e === "datetime" ? "dateTime" : e];
|
|
16273
16358
|
return n ? n(t) : t;
|
|
16274
|
-
},
|
|
16359
|
+
}, Pm = (e, t) => typeof e.render == "function" ? e.render(t) : Nm(e.render, t.value), Fm = (e) => ({
|
|
16275
16360
|
key: e,
|
|
16276
16361
|
label: ft.toCamel(e, " "),
|
|
16277
16362
|
sortable: !0
|
|
16278
|
-
}),
|
|
16363
|
+
}), Im = (e, t) => {
|
|
16279
16364
|
let n = [], r = (e) => {
|
|
16280
16365
|
f.Children.forEach(e, (e) => {
|
|
16281
16366
|
if (!f.isValidElement(e)) return;
|
|
@@ -16284,25 +16369,25 @@ var km = (e) => e.replace(/[^a-zA-Z0-9_-]/g, "-").replace(/-+/g, "-").replace(/^
|
|
|
16284
16369
|
});
|
|
16285
16370
|
};
|
|
16286
16371
|
return r(Array.isArray(e) ? e : [e]), n;
|
|
16287
|
-
},
|
|
16372
|
+
}, Lm = (e, t, n) => {
|
|
16288
16373
|
if (e?.length) return e;
|
|
16289
16374
|
if (f.isValidElement(n)) {
|
|
16290
|
-
let e =
|
|
16375
|
+
let e = Im(n, (e) => Fm(e.name));
|
|
16291
16376
|
if (e.length > 0) return e;
|
|
16292
16377
|
}
|
|
16293
16378
|
let r = t[0];
|
|
16294
|
-
return r ? Object.entries(r).reduce((e, [t, n]) => (t.startsWith("_") || (f.isValidElement(n) || typeof n != "object" || Array.isArray(n)) && e.push(
|
|
16295
|
-
},
|
|
16379
|
+
return r ? Object.entries(r).reduce((e, [t, n]) => (t.startsWith("_") || (f.isValidElement(n) || typeof n != "object" || Array.isArray(n)) && e.push(Fm(t)), e), []) : [];
|
|
16380
|
+
}, Rm = (e, t) => Array.isArray(e) ? e.reduce((e, t) => (e[t] = t === "delete" ? { kind: "delete" } : { kind: "modal" }, e), {}) : e ? Object.entries(e).reduce((e, [t, n]) => (n && (e[t] = n), e), {}) : t ? {
|
|
16296
16381
|
add: { kind: "modal" },
|
|
16297
16382
|
edit: { kind: "modal" },
|
|
16298
16383
|
delete: { kind: "delete" }
|
|
16299
|
-
} : {},
|
|
16384
|
+
} : {}, zm = (e, t) => e?.visible ? typeof e.visible == "function" ? e.visible(t) : e.visible : !0, Bm = (e, t) => e?.disabled ? typeof e.disabled == "function" ? e.disabled(t) : e.disabled : !1, Vm = (e, t, n) => t?.label ? t.label : e === "add" ? n?.add ?? "Add" : e === "edit" ? n?.edit ?? "Edit" : e === "delete" ? n?.delete ?? "Delete" : ft.toCamel(e, " "), Hm = (e) => {
|
|
16300
16385
|
if (e && typeof e != "boolean") return e;
|
|
16301
16386
|
};
|
|
16302
16387
|
//#endregion
|
|
16303
16388
|
//#region src/components/widgets/grid-core/GridTableView.tsx
|
|
16304
|
-
function
|
|
16305
|
-
let E = w(() =>
|
|
16389
|
+
function Um({ records: e, recordId: t, columns: n, runAction: r, sortable: i, pagination: a, selection: o = !1, selectedKeys: s, onSelectionChange: c, onRowClick: l, reorderable: u = !1, onReorder: d, activeKey: p, groupBy: m, wrapperClassName: h, className: g, heightClassName: _, scrollClassName: y, headerClassName: x, before: S, after: C }) {
|
|
16390
|
+
let E = w(() => Mm(t), [t]), D = T(/* @__PURE__ */ new Map()), O = w(() => e.reduce((e, t) => (e.set(E(t), t), e), /* @__PURE__ */ new Map()), [E, e]), k = w(() => n.reduce((e, t) => (e.set(String(t.key), t), e), /* @__PURE__ */ new Map()), [n]);
|
|
16306
16391
|
b(() => {
|
|
16307
16392
|
let t = new Set(e.map((e) => E(e)));
|
|
16308
16393
|
for (let e of D.current.keys()) t.has(e) || D.current.delete(e);
|
|
@@ -16312,7 +16397,7 @@ function Vm({ records: e, recordId: t, columns: n, runAction: r, sortable: i, pa
|
|
|
16312
16397
|
if (!o) return Wt(i, t);
|
|
16313
16398
|
let s = Wt(i, t), c = D.current.get(a) ?? /* @__PURE__ */ new Map(), l = c.get(t), u = typeof o.render == "function";
|
|
16314
16399
|
if (l && l.recordRef === i && l.valueRef === s && l.renderRef === o.render && (!u || l.rowIndex === n)) return l.output;
|
|
16315
|
-
let d =
|
|
16400
|
+
let d = Pm(o, {
|
|
16316
16401
|
record: i,
|
|
16317
16402
|
value: s,
|
|
16318
16403
|
key: t,
|
|
@@ -16389,20 +16474,20 @@ function Vm({ records: e, recordId: t, columns: n, runAction: r, sortable: i, pa
|
|
|
16389
16474
|
}
|
|
16390
16475
|
//#endregion
|
|
16391
16476
|
//#region src/Head.tsx
|
|
16392
|
-
var
|
|
16477
|
+
var Wm = g(null), Gm = 0, Km = "LLM Native", qm = {
|
|
16393
16478
|
charset: "UTF-8",
|
|
16394
16479
|
viewport: "width=device-width, initial-scale=1.0"
|
|
16395
|
-
},
|
|
16396
|
-
function
|
|
16480
|
+
}, Jm = { lang: "en" };
|
|
16481
|
+
function Ym(e, t) {
|
|
16397
16482
|
return t.includes(":") ? t : `${e}:${t}`;
|
|
16398
16483
|
}
|
|
16399
|
-
function
|
|
16484
|
+
function Xm(e) {
|
|
16400
16485
|
return Array.isArray(e) ? e.join(", ") : e;
|
|
16401
16486
|
}
|
|
16402
|
-
function
|
|
16403
|
-
return e === "siteName" ? "og:site_name" :
|
|
16487
|
+
function Zm(e) {
|
|
16488
|
+
return e === "siteName" ? "og:site_name" : Ym("og", e);
|
|
16404
16489
|
}
|
|
16405
|
-
function
|
|
16490
|
+
function Qm(e) {
|
|
16406
16491
|
return [
|
|
16407
16492
|
...e.canonical ? [{
|
|
16408
16493
|
rel: "canonical",
|
|
@@ -16420,7 +16505,7 @@ function Xm(e) {
|
|
|
16420
16505
|
...e.links ?? []
|
|
16421
16506
|
];
|
|
16422
16507
|
}
|
|
16423
|
-
function
|
|
16508
|
+
function $m(e) {
|
|
16424
16509
|
return [...e.prev ? [{
|
|
16425
16510
|
rel: "prev",
|
|
16426
16511
|
href: e.prev
|
|
@@ -16429,7 +16514,7 @@ function Zm(e) {
|
|
|
16429
16514
|
href: e.next
|
|
16430
16515
|
}] : []];
|
|
16431
16516
|
}
|
|
16432
|
-
function
|
|
16517
|
+
function eh(e) {
|
|
16433
16518
|
return (e.alternates ?? []).map((e) => ({
|
|
16434
16519
|
rel: "alternate",
|
|
16435
16520
|
href: e.href,
|
|
@@ -16439,28 +16524,28 @@ function Qm(e) {
|
|
|
16439
16524
|
title: e.title
|
|
16440
16525
|
}));
|
|
16441
16526
|
}
|
|
16442
|
-
function
|
|
16527
|
+
function th(e, t, n) {
|
|
16443
16528
|
return {
|
|
16444
16529
|
name: {
|
|
16445
16530
|
description: e.description,
|
|
16446
16531
|
...e.meta ?? {},
|
|
16447
16532
|
robots: n.robots ?? e.meta?.robots,
|
|
16448
16533
|
googlebot: n.googlebot,
|
|
16449
|
-
keywords:
|
|
16534
|
+
keywords: Xm(n.keywords),
|
|
16450
16535
|
author: n.author,
|
|
16451
16536
|
publisher: n.publisher,
|
|
16452
16537
|
referrer: n.referrer,
|
|
16453
16538
|
...n.meta ?? {},
|
|
16454
|
-
...Object.fromEntries(Object.entries(t.twitter ?? {}).map(([e, t]) => [
|
|
16539
|
+
...Object.fromEntries(Object.entries(t.twitter ?? {}).map(([e, t]) => [Ym("twitter", e), t]))
|
|
16455
16540
|
},
|
|
16456
|
-
property: Object.fromEntries(Object.entries(t.openGraph ?? {}).map(([e, t]) => [
|
|
16541
|
+
property: Object.fromEntries(Object.entries(t.openGraph ?? {}).map(([e, t]) => [Zm(e), t]))
|
|
16457
16542
|
};
|
|
16458
16543
|
}
|
|
16459
|
-
function
|
|
16544
|
+
function nh(e, t, n, r) {
|
|
16460
16545
|
return [
|
|
16461
|
-
...
|
|
16462
|
-
|
|
16463
|
-
...
|
|
16546
|
+
...Qm(t),
|
|
16547
|
+
...$m(r),
|
|
16548
|
+
...eh(n),
|
|
16464
16549
|
...e.canonical && !t.canonical ? [{
|
|
16465
16550
|
rel: "canonical",
|
|
16466
16551
|
href: e.canonical
|
|
@@ -16468,7 +16553,7 @@ function eh(e, t, n, r) {
|
|
|
16468
16553
|
...e.links ?? []
|
|
16469
16554
|
];
|
|
16470
16555
|
}
|
|
16471
|
-
function
|
|
16556
|
+
function rh(e) {
|
|
16472
16557
|
return [...(e.fonts ?? []).flatMap((e) => [
|
|
16473
16558
|
...(e.dnsPrefetch ?? []).map((e) => ({
|
|
16474
16559
|
rel: "dns-prefetch",
|
|
@@ -16495,7 +16580,7 @@ function th(e) {
|
|
|
16495
16580
|
}
|
|
16496
16581
|
])];
|
|
16497
16582
|
}
|
|
16498
|
-
function
|
|
16583
|
+
function ih(e) {
|
|
16499
16584
|
return [
|
|
16500
16585
|
...e.manifest ? [{
|
|
16501
16586
|
rel: "manifest",
|
|
@@ -16512,7 +16597,7 @@ function nh(e) {
|
|
|
16512
16597
|
...e.icons ?? []
|
|
16513
16598
|
];
|
|
16514
16599
|
}
|
|
16515
|
-
function
|
|
16600
|
+
function ah(e) {
|
|
16516
16601
|
return {
|
|
16517
16602
|
"theme-color": e.themeColor,
|
|
16518
16603
|
"msapplication-TileColor": e.backgroundColor,
|
|
@@ -16524,27 +16609,27 @@ function rh(e) {
|
|
|
16524
16609
|
"apple-mobile-web-app-status-bar-style": e.appleMobileWebAppStatusBarStyle
|
|
16525
16610
|
};
|
|
16526
16611
|
}
|
|
16527
|
-
function
|
|
16612
|
+
function oh(e) {
|
|
16528
16613
|
return Array.isArray(e.jsonLd) ? e.jsonLd : e.jsonLd ? [e.jsonLd] : [];
|
|
16529
16614
|
}
|
|
16530
|
-
function
|
|
16615
|
+
function sh(e) {
|
|
16531
16616
|
return Object.fromEntries(Object.entries(e).filter(([, e]) => !!e));
|
|
16532
16617
|
}
|
|
16533
|
-
function
|
|
16618
|
+
function ch(e) {
|
|
16534
16619
|
let { inline: t, ...n } = e;
|
|
16535
16620
|
return Object.fromEntries(Object.entries(n).filter(([, e]) => e !== void 0 && e !== !1));
|
|
16536
16621
|
}
|
|
16537
|
-
function
|
|
16622
|
+
function lh(e) {
|
|
16538
16623
|
let { inline: t, ...n } = e;
|
|
16539
16624
|
return Object.fromEntries(Object.entries(n).filter(([, e]) => e !== void 0 && e !== !1));
|
|
16540
16625
|
}
|
|
16541
|
-
function
|
|
16626
|
+
function uh({ appName: e, metadata: t, social: n, links: r, pagination: i, language: a, document: o, assets: s, pwa: c, schemaOrg: l }) {
|
|
16542
16627
|
if (globalThis.document === void 0) return null;
|
|
16543
|
-
let u =
|
|
16544
|
-
...
|
|
16545
|
-
...
|
|
16546
|
-
...
|
|
16547
|
-
], m =
|
|
16628
|
+
let u = th(t, n, o), d = ah(c), p = [
|
|
16629
|
+
...nh(r, o, a, i),
|
|
16630
|
+
...rh(s),
|
|
16631
|
+
...ih(c)
|
|
16632
|
+
], m = oh(l);
|
|
16548
16633
|
return H(/* @__PURE__ */ f.createElement(f.Fragment, null, o.charset ? /* @__PURE__ */ f.createElement("meta", {
|
|
16549
16634
|
charSet: o.charset,
|
|
16550
16635
|
"data-rfs-head": "document"
|
|
@@ -16578,12 +16663,12 @@ function ch({ appName: e, metadata: t, social: n, links: r, pagination: i, langu
|
|
|
16578
16663
|
"data-rfs-head": "pwa"
|
|
16579
16664
|
}) : null), p.map((e, t) => /* @__PURE__ */ f.createElement("link", {
|
|
16580
16665
|
key: `${e.rel}:${e.href ?? t}`,
|
|
16581
|
-
...
|
|
16666
|
+
...sh(e),
|
|
16582
16667
|
"data-rfs-head": "link"
|
|
16583
16668
|
})), (s.styles ?? []).map((e, t) => /* @__PURE__ */ f.createElement(f.Fragment, { key: `style:${e.href ?? t}` }, e.href ? /* @__PURE__ */ f.createElement("link", {
|
|
16584
16669
|
rel: "stylesheet",
|
|
16585
16670
|
href: e.href,
|
|
16586
|
-
...
|
|
16671
|
+
...lh(e),
|
|
16587
16672
|
"data-rfs-head": "asset-style"
|
|
16588
16673
|
}) : null, e.inline ? /* @__PURE__ */ f.createElement("style", {
|
|
16589
16674
|
id: e.id,
|
|
@@ -16592,7 +16677,7 @@ function ch({ appName: e, metadata: t, social: n, links: r, pagination: i, langu
|
|
|
16592
16677
|
title: e.title,
|
|
16593
16678
|
"data-rfs-head": "asset-style"
|
|
16594
16679
|
}, e.inline) : null)), (s.scripts ?? []).map((e, t) => /* @__PURE__ */ f.createElement(f.Fragment, { key: `script:${e.src ?? t}` }, e.src ? /* @__PURE__ */ f.createElement("script", {
|
|
16595
|
-
...
|
|
16680
|
+
...ch(e),
|
|
16596
16681
|
"data-rfs-head": "asset-script"
|
|
16597
16682
|
}) : null, e.inline ? /* @__PURE__ */ f.createElement("script", {
|
|
16598
16683
|
type: e.type,
|
|
@@ -16605,15 +16690,15 @@ function ch({ appName: e, metadata: t, social: n, links: r, pagination: i, langu
|
|
|
16605
16690
|
"data-rfs-head": "schema-org"
|
|
16606
16691
|
}, JSON.stringify(e)))), globalThis.document.head);
|
|
16607
16692
|
}
|
|
16608
|
-
function
|
|
16609
|
-
let n = e || "LLM Native", r = f.useRef(globalThis.document === void 0 ? "" : globalThis.document.documentElement.lang), i = f.useRef(globalThis.document === void 0 ? "" : globalThis.document.documentElement.dir), [a, o] = E({}), [s, c] = E([]), [l, u] = E({}), [d, p] = E({}), [m, h] = E({}), [g, _] = E(
|
|
16693
|
+
function dh({ appName: e = Km, children: t }) {
|
|
16694
|
+
let n = e || "LLM Native", r = f.useRef(globalThis.document === void 0 ? "" : globalThis.document.documentElement.lang), i = f.useRef(globalThis.document === void 0 ? "" : globalThis.document.documentElement.dir), [a, o] = E({}), [s, c] = E([]), [l, u] = E({}), [d, p] = E({}), [m, h] = E({}), [g, _] = E(Jm), [y, x] = E(qm), [S, C] = E({}), [T, D] = E({}), [O, k] = E({}), A = v(() => o({}), []), j = v((e, t) => {
|
|
16610
16695
|
c((n) => [...n.filter((t) => t.id !== e), {
|
|
16611
16696
|
id: e,
|
|
16612
16697
|
metadata: t
|
|
16613
16698
|
}]);
|
|
16614
16699
|
}, []), M = v((e) => {
|
|
16615
16700
|
c((t) => t.filter((t) => t.id !== e));
|
|
16616
|
-
}, []), N = v(() => u({}), []), P = v(() => p({}), []), F = v(() => h({}), []), I = v(() => _(
|
|
16701
|
+
}, []), N = v(() => u({}), []), P = v(() => p({}), []), F = v(() => h({}), []), I = v(() => _(Jm), []), L = v(() => x(qm), []), R = v(() => C({}), []), z = v(() => D({}), []), B = v(() => k({}), []);
|
|
16617
16702
|
b(() => {
|
|
16618
16703
|
globalThis.document !== void 0 && (globalThis.document.documentElement.lang = g.lang ?? r.current, globalThis.document.documentElement.dir = g.dir ?? i.current);
|
|
16619
16704
|
}, [g.lang, g.dir]);
|
|
@@ -16673,7 +16758,7 @@ function lh({ appName: e = Wm, children: t }) {
|
|
|
16673
16758
|
z,
|
|
16674
16759
|
B
|
|
16675
16760
|
]);
|
|
16676
|
-
return /* @__PURE__ */ f.createElement(
|
|
16761
|
+
return /* @__PURE__ */ f.createElement(Wm.Provider, { value: H }, t, /* @__PURE__ */ f.createElement(uh, {
|
|
16677
16762
|
appName: n,
|
|
16678
16763
|
metadata: V,
|
|
16679
16764
|
social: l,
|
|
@@ -16686,16 +16771,16 @@ function lh({ appName: e = Wm, children: t }) {
|
|
|
16686
16771
|
schemaOrg: O
|
|
16687
16772
|
}));
|
|
16688
16773
|
}
|
|
16689
|
-
function
|
|
16690
|
-
return y(
|
|
16774
|
+
function fh() {
|
|
16775
|
+
return y(Wm);
|
|
16691
16776
|
}
|
|
16692
|
-
function
|
|
16777
|
+
function ph(e) {
|
|
16693
16778
|
return JSON.stringify(e ?? {});
|
|
16694
16779
|
}
|
|
16695
|
-
function
|
|
16696
|
-
let t =
|
|
16697
|
-
n.current ||= (
|
|
16698
|
-
let r =
|
|
16780
|
+
function mh(e) {
|
|
16781
|
+
let t = fh(), n = f.useRef(null);
|
|
16782
|
+
n.current ||= (Gm += 1, `metadata-${Gm}`);
|
|
16783
|
+
let r = ph(e);
|
|
16699
16784
|
return b(() => {
|
|
16700
16785
|
if (!t || !e) return;
|
|
16701
16786
|
let r = n.current;
|
|
@@ -16706,40 +16791,40 @@ function fh(e) {
|
|
|
16706
16791
|
r
|
|
16707
16792
|
]), t;
|
|
16708
16793
|
}
|
|
16709
|
-
function
|
|
16710
|
-
let t =
|
|
16794
|
+
function hh(e) {
|
|
16795
|
+
let t = fh(), n = ph(e);
|
|
16711
16796
|
return b(() => {
|
|
16712
16797
|
if (!t || !e) return;
|
|
16713
16798
|
let n = t.social;
|
|
16714
16799
|
return t.setSocialHead(e), () => t.setSocialHead(n);
|
|
16715
16800
|
}, [t?.setSocialHead, n]), t;
|
|
16716
16801
|
}
|
|
16717
|
-
function
|
|
16718
|
-
let t =
|
|
16802
|
+
function gh(e) {
|
|
16803
|
+
let t = fh(), n = ph(e);
|
|
16719
16804
|
return b(() => {
|
|
16720
16805
|
if (!t || !e) return;
|
|
16721
16806
|
let n = t.links;
|
|
16722
16807
|
return t.setHeadLinks(e), () => t.setHeadLinks(n);
|
|
16723
16808
|
}, [t?.setHeadLinks, n]), t;
|
|
16724
16809
|
}
|
|
16725
|
-
function
|
|
16726
|
-
let t =
|
|
16810
|
+
function _h(e) {
|
|
16811
|
+
let t = fh(), n = ph(e);
|
|
16727
16812
|
return b(() => {
|
|
16728
16813
|
if (!t || !e) return;
|
|
16729
16814
|
let n = t.pagination;
|
|
16730
16815
|
return t.setPaginationHead(e), () => t.setPaginationHead(n);
|
|
16731
16816
|
}, [t?.setPaginationHead, n]), t;
|
|
16732
16817
|
}
|
|
16733
|
-
function
|
|
16734
|
-
let t =
|
|
16818
|
+
function vh(e) {
|
|
16819
|
+
let t = fh(), n = ph(e);
|
|
16735
16820
|
return b(() => {
|
|
16736
16821
|
if (!t || !e) return;
|
|
16737
16822
|
let n = t.language;
|
|
16738
16823
|
return t.setLanguageHead(e), () => t.setLanguageHead(n);
|
|
16739
16824
|
}, [t?.setLanguageHead, n]), t;
|
|
16740
16825
|
}
|
|
16741
|
-
function
|
|
16742
|
-
let t =
|
|
16826
|
+
function yh(e) {
|
|
16827
|
+
let t = fh(), n = ph(e);
|
|
16743
16828
|
return b(() => {
|
|
16744
16829
|
if (!t || !e) return;
|
|
16745
16830
|
let n = t.document;
|
|
@@ -16749,39 +16834,39 @@ function _h(e) {
|
|
|
16749
16834
|
}), () => t.setDocumentHead(n);
|
|
16750
16835
|
}, [t?.setDocumentHead, n]), t;
|
|
16751
16836
|
}
|
|
16752
|
-
function
|
|
16753
|
-
let t =
|
|
16837
|
+
function bh(e) {
|
|
16838
|
+
let t = fh(), n = ph(e);
|
|
16754
16839
|
return b(() => {
|
|
16755
16840
|
if (!t || !e) return;
|
|
16756
16841
|
let n = t.assets;
|
|
16757
16842
|
return t.setAssetsHead(e), () => t.setAssetsHead(n);
|
|
16758
16843
|
}, [t?.setAssetsHead, n]), t;
|
|
16759
16844
|
}
|
|
16760
|
-
function
|
|
16761
|
-
let t =
|
|
16845
|
+
function xh(e) {
|
|
16846
|
+
let t = fh(), n = ph(e);
|
|
16762
16847
|
return b(() => {
|
|
16763
16848
|
if (!t || !e) return;
|
|
16764
16849
|
let n = t.pwa;
|
|
16765
16850
|
return t.setPwaHead(e), () => t.setPwaHead(n);
|
|
16766
16851
|
}, [t?.setPwaHead, n]), t;
|
|
16767
16852
|
}
|
|
16768
|
-
function
|
|
16769
|
-
let t =
|
|
16853
|
+
function Sh(e) {
|
|
16854
|
+
let t = fh(), n = ph(e);
|
|
16770
16855
|
return b(() => {
|
|
16771
16856
|
if (!t || !e) return;
|
|
16772
16857
|
let n = t.schemaOrg;
|
|
16773
16858
|
return t.setSchemaOrg(e), () => t.setSchemaOrg(n);
|
|
16774
16859
|
}, [t?.setSchemaOrg, n]), t;
|
|
16775
16860
|
}
|
|
16776
|
-
function
|
|
16777
|
-
return
|
|
16861
|
+
function Ch(e) {
|
|
16862
|
+
return mh(e), null;
|
|
16778
16863
|
}
|
|
16779
16864
|
//#endregion
|
|
16780
16865
|
//#region src/components/widgets/MarkdownReader.tsx
|
|
16781
|
-
var
|
|
16866
|
+
var wh = (e) => /^(https?:)?\/\//.test(e) || e.startsWith("mailto:") || e.startsWith("tel:"), Th = (e) => !!e && !wh(e) && !e.startsWith("#"), Eh = (e) => e.startsWith("#"), Dh = (e) => typeof e == "string" || typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(Dh).join("") : f.isValidElement(e) ? Dh(e.props.children) : "", Oh = (e) => {
|
|
16782
16867
|
if (f.isValidElement(e)) return /language-([\w-]+)/.exec(e.props.className || "")?.[1];
|
|
16783
16868
|
};
|
|
16784
|
-
function
|
|
16869
|
+
function kh({ code: e, language: t }) {
|
|
16785
16870
|
let [n, r] = f.useState(!1), i = Y("code");
|
|
16786
16871
|
return /* @__PURE__ */ f.createElement("div", { className: "relative my-4 overflow-hidden rounded-md border bg-muted/50" }, /* @__PURE__ */ f.createElement("div", { className: "flex h-9 items-center justify-between border-b px-3" }, /* @__PURE__ */ f.createElement("span", { className: "text-xs font-medium text-muted-foreground" }, t || i.codeLanguageDefault), /* @__PURE__ */ f.createElement("button", {
|
|
16787
16872
|
type: "button",
|
|
@@ -16791,7 +16876,7 @@ function Dh({ code: e, language: t }) {
|
|
|
16791
16876
|
}
|
|
16792
16877
|
}, n ? i.copied : i.copy)), /* @__PURE__ */ f.createElement("pre", { className: "m-0 overflow-x-auto p-4 text-xs leading-relaxed" }, /* @__PURE__ */ f.createElement("code", { className: t ? `language-${t}` : void 0 }, e)));
|
|
16793
16878
|
}
|
|
16794
|
-
var
|
|
16879
|
+
var Ah = (e) => ({
|
|
16795
16880
|
h1: ({ className: e, ...t }) => /* @__PURE__ */ f.createElement("h1", {
|
|
16796
16881
|
className: X("mt-8 scroll-m-20 text-3xl font-bold tracking-normal first:mt-0 [&>a]:no-underline [&>a:hover]:opacity-80", e),
|
|
16797
16882
|
...t
|
|
@@ -16845,18 +16930,18 @@ var Oh = (e) => ({
|
|
|
16845
16930
|
...t
|
|
16846
16931
|
}),
|
|
16847
16932
|
a: ({ className: t, href: n = "", onClick: r, ...i }) => /* @__PURE__ */ f.createElement("a", {
|
|
16848
|
-
className: X(
|
|
16933
|
+
className: X(Eh(n) ? "text-primary no-underline transition-opacity hover:opacity-80" : "font-medium text-primary no-underline transition-opacity hover:opacity-80", t),
|
|
16849
16934
|
href: n,
|
|
16850
|
-
target:
|
|
16851
|
-
rel:
|
|
16935
|
+
target: wh(n) ? "_blank" : void 0,
|
|
16936
|
+
rel: wh(n) ? "noreferrer" : void 0,
|
|
16852
16937
|
onClick: (t) => {
|
|
16853
|
-
r?.(t), !t.defaultPrevented && e &&
|
|
16938
|
+
r?.(t), !t.defaultPrevented && e && Th(n) && (t.preventDefault(), e(n, t));
|
|
16854
16939
|
},
|
|
16855
16940
|
...i
|
|
16856
16941
|
}),
|
|
16857
|
-
pre: ({ children: e }) => /* @__PURE__ */ f.createElement(
|
|
16858
|
-
code:
|
|
16859
|
-
language:
|
|
16942
|
+
pre: ({ children: e }) => /* @__PURE__ */ f.createElement(kh, {
|
|
16943
|
+
code: Dh(e).replace(/\n$/, ""),
|
|
16944
|
+
language: Oh(e)
|
|
16860
16945
|
}),
|
|
16861
16946
|
code: ({ className: e, children: t, ...n }) => typeof e == "string" && e.startsWith("language-") ? /* @__PURE__ */ f.createElement("code", {
|
|
16862
16947
|
className: e,
|
|
@@ -16871,13 +16956,13 @@ var Oh = (e) => ({
|
|
|
16871
16956
|
...t
|
|
16872
16957
|
})
|
|
16873
16958
|
});
|
|
16874
|
-
function
|
|
16959
|
+
function jh({ content: e, components: t, className: n, wrapperClassName: r, metadata: i, onInternalLinkClick: a }) {
|
|
16875
16960
|
let o = f.useMemo(() => e.match(/^#[ \t]+(.+)/m)?.[1]?.trim(), [e]);
|
|
16876
|
-
|
|
16961
|
+
mh(i || o ? {
|
|
16877
16962
|
...i ?? {},
|
|
16878
16963
|
title: i?.title ?? o
|
|
16879
16964
|
} : void 0);
|
|
16880
|
-
let s = f.useMemo(() =>
|
|
16965
|
+
let s = f.useMemo(() => Ah(a), [a]);
|
|
16881
16966
|
return /* @__PURE__ */ f.createElement("div", { className: X("rf-markdown-reader max-w-none text-sm text-foreground", r, n) }, /* @__PURE__ */ f.createElement(Be, {
|
|
16882
16967
|
remarkPlugins: [Ve],
|
|
16883
16968
|
rehypePlugins: [
|
|
@@ -16893,28 +16978,28 @@ function kh({ content: e, components: t, className: n, wrapperClassName: r, meta
|
|
|
16893
16978
|
}
|
|
16894
16979
|
//#endregion
|
|
16895
16980
|
//#region src/libs/streamingMarkdown.ts
|
|
16896
|
-
var
|
|
16897
|
-
function
|
|
16981
|
+
var Mh = /^ {0,3}(`{3,}|~{3,})(.*)$/, Nh = /^ {0,3}(`{1,2}|~{1,2})$/, Ph = /^\s*[-=]{1,2}\s*$/, Fh = /^\s*\|?[\s:|-]*$/, Ih = /^\s*:?-+:?\s*$/;
|
|
16982
|
+
function Lh(e) {
|
|
16898
16983
|
let t = e.trim();
|
|
16899
16984
|
return t.startsWith("|") && (t = t.slice(1)), t.endsWith("|") && !t.endsWith("\\|") && (t = t.slice(0, -1)), t.split(/(?<!\\)\|/);
|
|
16900
16985
|
}
|
|
16901
|
-
function
|
|
16986
|
+
function Rh(e) {
|
|
16902
16987
|
let t = e[0];
|
|
16903
16988
|
if (!t.trimStart().startsWith("|")) return null;
|
|
16904
|
-
let n =
|
|
16989
|
+
let n = Lh(t).filter((e, t, n) => e.trim() !== "" || t < n.length - 1);
|
|
16905
16990
|
if (n.length === 0) return [];
|
|
16906
16991
|
let r = `| ${n.map(() => "---").join(" | ")} |`, i = t.trimEnd().endsWith("|") ? t : `${t.trimEnd()} |`;
|
|
16907
16992
|
if (e.length === 1) return [i, r];
|
|
16908
16993
|
let a = e[1];
|
|
16909
|
-
if (!
|
|
16910
|
-
let o =
|
|
16911
|
-
return o.length === n.length && o.every((e) =>
|
|
16994
|
+
if (!Fh.test(a)) return null;
|
|
16995
|
+
let o = Lh(a);
|
|
16996
|
+
return o.length === n.length && o.every((e) => Ih.test(e)) ? e : [
|
|
16912
16997
|
i,
|
|
16913
16998
|
r,
|
|
16914
16999
|
...e.slice(2)
|
|
16915
17000
|
];
|
|
16916
17001
|
}
|
|
16917
|
-
function
|
|
17002
|
+
function zh(e) {
|
|
16918
17003
|
let t = e, n = t.lastIndexOf("](");
|
|
16919
17004
|
n >= 0 && !t.slice(n).includes(")") && (t += ")");
|
|
16920
17005
|
let r = [], i = null, a = /^\s*[*+-]\s/.exec(t), o = a ? a[0].length : 0;
|
|
@@ -16978,18 +17063,18 @@ function Lh(e) {
|
|
|
16978
17063
|
}
|
|
16979
17064
|
return t;
|
|
16980
17065
|
}
|
|
16981
|
-
function
|
|
17066
|
+
function Bh(e) {
|
|
16982
17067
|
if (!e) return e;
|
|
16983
17068
|
let t = e.split("\n"), n = null, r = 0;
|
|
16984
17069
|
if (t.forEach((e, t) => {
|
|
16985
|
-
let i =
|
|
17070
|
+
let i = Mh.exec(e);
|
|
16986
17071
|
n ? i && i[1][0] === n.char && i[1].length >= n.len && i[2].trim() === "" && (n = null, r = t + 1) : i && !(i[1][0] === "`" && i[2].includes("`")) && (n = {
|
|
16987
17072
|
char: i[1][0],
|
|
16988
17073
|
len: i[1].length
|
|
16989
17074
|
});
|
|
16990
17075
|
}), n) {
|
|
16991
17076
|
let e = n;
|
|
16992
|
-
return `${(
|
|
17077
|
+
return `${(Nh.test(t[t.length - 1]) && t.length > 1 ? t.slice(0, -1) : t).join("\n")}\n${e.char.repeat(e.len)}`;
|
|
16993
17078
|
}
|
|
16994
17079
|
let i = r;
|
|
16995
17080
|
for (let e = t.length - 1; e >= r; e--) if (t[e].trim() === "") {
|
|
@@ -16998,19 +17083,19 @@ function Rh(e) {
|
|
|
16998
17083
|
}
|
|
16999
17084
|
let a = t.slice(0, i), o = t.slice(i);
|
|
17000
17085
|
if (o.length === 0) return e;
|
|
17001
|
-
if (
|
|
17086
|
+
if (Nh.test(o[o.length - 1]) && (o = o.slice(0, -1)), o.length >= 2 && Ph.test(o[o.length - 1]) && (o = o.slice(0, -1)), o.length === 0) return a.join("\n").replace(/\n+$/, "");
|
|
17002
17087
|
let s = o.length - 1;
|
|
17003
|
-
o[s] =
|
|
17004
|
-
let c =
|
|
17088
|
+
o[s] = zh(o[s]);
|
|
17089
|
+
let c = Rh(o);
|
|
17005
17090
|
return c && (o = c), [...a, ...o].join("\n");
|
|
17006
17091
|
}
|
|
17007
17092
|
//#endregion
|
|
17008
17093
|
//#region src/components/widgets/chat/ChatMarkdown.tsx
|
|
17009
|
-
var
|
|
17094
|
+
var Vh = (e) => /^(https?:)?\/\//.test(e) || e.startsWith("mailto:") || e.startsWith("tel:"), Hh = (e) => typeof e == "string" || typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(Hh).join("") : f.isValidElement(e) ? Hh(e.props.children) : "", Uh = (e) => {
|
|
17010
17095
|
let t = Array.isArray(e) ? e[0] : e;
|
|
17011
17096
|
if (f.isValidElement(t)) return /language-([\w#+-]+)/.exec(t.props.className || "")?.[1];
|
|
17012
17097
|
};
|
|
17013
|
-
function
|
|
17098
|
+
function Wh({ code: e, language: t, highlight: n, classNames: r }) {
|
|
17014
17099
|
let i = Y("code"), [a, o] = f.useState(!1), [s, c] = f.useState(null), l = n ? bs(t) : void 0;
|
|
17015
17100
|
return f.useEffect(() => {
|
|
17016
17101
|
if (!l) {
|
|
@@ -17047,7 +17132,7 @@ function Hh({ code: e, language: t, highlight: n, classNames: r }) {
|
|
|
17047
17132
|
dangerouslySetInnerHTML: { __html: s }
|
|
17048
17133
|
})));
|
|
17049
17134
|
}
|
|
17050
|
-
function
|
|
17135
|
+
function Gh(e, t, n) {
|
|
17051
17136
|
let r = (t) => function({ className: n, node: r, ...i }) {
|
|
17052
17137
|
let a = t === "h1" ? "text-lg" : t === "h2" ? "text-base" : "text-sm";
|
|
17053
17138
|
return f.createElement(t, {
|
|
@@ -17105,7 +17190,7 @@ function Uh(e, t, n) {
|
|
|
17105
17190
|
...r
|
|
17106
17191
|
}),
|
|
17107
17192
|
a: ({ className: t, href: r = "", onClick: i, node: a, ...o }) => {
|
|
17108
|
-
let s =
|
|
17193
|
+
let s = Vh(r);
|
|
17109
17194
|
return /* @__PURE__ */ f.createElement("a", {
|
|
17110
17195
|
className: X("font-medium text-primary underline-offset-2 hover:underline", e?.link, t),
|
|
17111
17196
|
href: r,
|
|
@@ -17117,9 +17202,9 @@ function Uh(e, t, n) {
|
|
|
17117
17202
|
...o
|
|
17118
17203
|
});
|
|
17119
17204
|
},
|
|
17120
|
-
pre: ({ children: n }) => /* @__PURE__ */ f.createElement(
|
|
17121
|
-
code:
|
|
17122
|
-
language:
|
|
17205
|
+
pre: ({ children: n }) => /* @__PURE__ */ f.createElement(Wh, {
|
|
17206
|
+
code: Hh(n).replace(/\n$/, ""),
|
|
17207
|
+
language: Uh(n),
|
|
17123
17208
|
highlight: t,
|
|
17124
17209
|
classNames: e
|
|
17125
17210
|
}),
|
|
@@ -17134,9 +17219,9 @@ function Uh(e, t, n) {
|
|
|
17134
17219
|
})
|
|
17135
17220
|
};
|
|
17136
17221
|
}
|
|
17137
|
-
var
|
|
17138
|
-
function
|
|
17139
|
-
let c = f.useMemo(() => t ?
|
|
17222
|
+
var Kh = [Ve], qh = [We];
|
|
17223
|
+
function Jh({ content: e, streaming: t = !1, tone: n = "default", highlight: r = !0, onLinkClick: i, components: a, className: o, classNames: s }) {
|
|
17224
|
+
let c = f.useMemo(() => t ? Bh(e ?? "") : e ?? "", [e, t]), l = f.useMemo(() => Gh(s, r, i), [
|
|
17140
17225
|
s,
|
|
17141
17226
|
r,
|
|
17142
17227
|
i
|
|
@@ -17148,25 +17233,25 @@ function Kh({ content: e, streaming: t = !1, tone: n = "default", highlight: r =
|
|
|
17148
17233
|
className: X("rf-chat-markdown min-w-0 max-w-full break-words text-sm leading-relaxed", n === "muted" ? "text-muted-foreground" : "text-foreground", s?.root, o),
|
|
17149
17234
|
"aria-busy": t || void 0
|
|
17150
17235
|
}, /* @__PURE__ */ f.createElement(Be, {
|
|
17151
|
-
remarkPlugins:
|
|
17152
|
-
rehypePlugins:
|
|
17236
|
+
remarkPlugins: Kh,
|
|
17237
|
+
rehypePlugins: qh,
|
|
17153
17238
|
components: u
|
|
17154
17239
|
}, c));
|
|
17155
17240
|
}
|
|
17156
17241
|
//#endregion
|
|
17157
17242
|
//#region src/components/widgets/chat/ChatReasoning.tsx
|
|
17158
|
-
function
|
|
17243
|
+
function Yh(e, t) {
|
|
17159
17244
|
let n = Math.max(1, Math.round(e));
|
|
17160
17245
|
return n < 60 ? Vn(t.durationSeconds, { seconds: n }) : Vn(t.durationMinutes, {
|
|
17161
17246
|
minutes: Math.floor(n / 60),
|
|
17162
17247
|
seconds: n % 60
|
|
17163
17248
|
});
|
|
17164
17249
|
}
|
|
17165
|
-
function
|
|
17250
|
+
function Xh({ content: e, streaming: t = !1, duration: n, defaultOpen: r = !1, open: i, onOpenChange: a, label: o, icon: s = "brain", className: c, classNames: l }) {
|
|
17166
17251
|
let u = Y("chat"), d = f.useId(), [p, m] = f.useState(null), h = i ?? p ?? (t || r), g = () => {
|
|
17167
17252
|
let e = !h;
|
|
17168
17253
|
i === void 0 && m(e), a?.(e);
|
|
17169
|
-
}, _ = o ?? (t ? u.reasoningStreaming : n == null ? u.reasoning : Vn(u.reasoningFor, { duration:
|
|
17254
|
+
}, _ = o ?? (t ? u.reasoningStreaming : n == null ? u.reasoning : Vn(u.reasoningFor, { duration: Yh(n, u) }));
|
|
17170
17255
|
return /* @__PURE__ */ f.createElement("div", { className: X("rf-chat-reasoning my-2 min-w-0", c, l?.root) }, /* @__PURE__ */ f.createElement("button", {
|
|
17171
17256
|
type: "button",
|
|
17172
17257
|
onClick: g,
|
|
@@ -17187,7 +17272,7 @@ function Jh({ content: e, streaming: t = !1, duration: n, defaultOpen: r = !1, o
|
|
|
17187
17272
|
"aria-label": typeof _ == "string" ? _ : u.reasoning,
|
|
17188
17273
|
hidden: !h,
|
|
17189
17274
|
className: X("mt-1 border-s-2 border-border ps-3", l?.content)
|
|
17190
|
-
}, h && /* @__PURE__ */ f.createElement(
|
|
17275
|
+
}, h && /* @__PURE__ */ f.createElement(Jh, {
|
|
17191
17276
|
content: e,
|
|
17192
17277
|
streaming: t,
|
|
17193
17278
|
tone: "muted",
|
|
@@ -17196,10 +17281,10 @@ function Jh({ content: e, streaming: t = !1, duration: n, defaultOpen: r = !1, o
|
|
|
17196
17281
|
}
|
|
17197
17282
|
//#endregion
|
|
17198
17283
|
//#region src/components/widgets/chat/ChatQuestions.tsx
|
|
17199
|
-
var
|
|
17200
|
-
function
|
|
17201
|
-
let a = e.options ?? [], o = a.map((e) =>
|
|
17202
|
-
let r = s ? o[n][3].trim() : t.label, i =
|
|
17284
|
+
var Zh = /^\s*(?:(\d{1,2})|([A-Za-z]))[.)]\s+(.+)$/s, Qh = /\s*[([]\s*(?:recommended|consigliat[ao]|empfohlen)\s*[)\]]\s*$/i;
|
|
17285
|
+
function $h(e, t, n, r, i) {
|
|
17286
|
+
let a = e.options ?? [], o = a.map((e) => Zh.exec(e.label)), s = a.length > 0 && o.every(Boolean), c = s && o[0]?.[2] ? "alpha" : "numeric", l = a.map((t, n) => {
|
|
17287
|
+
let r = s ? o[n][3].trim() : t.label, i = Qh.exec(r);
|
|
17203
17288
|
i && (r = r.slice(0, i.index).trim());
|
|
17204
17289
|
let a = typeof e.recommended == "number" ? e.recommended === n : typeof e.recommended == "string" ? e.recommended === r || e.recommended === t.label : !!i;
|
|
17205
17290
|
return {
|
|
@@ -17217,31 +17302,31 @@ function Zh(e, t, n, r, i) {
|
|
|
17217
17302
|
other: l.length === 0 || (e.custom ?? r)
|
|
17218
17303
|
};
|
|
17219
17304
|
}
|
|
17220
|
-
var
|
|
17221
|
-
function
|
|
17305
|
+
var eg = (e, t) => t === "alpha" ? String.fromCharCode(65 + e) : String(e + 1);
|
|
17306
|
+
function tg(e, t) {
|
|
17222
17307
|
return /^[1-9]$/.test(e) ? Number(e) - 1 : t === "alpha" && /^[a-z]$/i.test(e) ? e.toUpperCase().charCodeAt(0) - 65 : -1;
|
|
17223
17308
|
}
|
|
17224
|
-
function
|
|
17309
|
+
function ng(e, t) {
|
|
17225
17310
|
return {
|
|
17226
17311
|
...e.id === void 0 ? {} : { id: e.id },
|
|
17227
17312
|
...e.header === void 0 ? {} : { header: e.header },
|
|
17228
17313
|
values: t
|
|
17229
17314
|
};
|
|
17230
17315
|
}
|
|
17231
|
-
var
|
|
17232
|
-
function
|
|
17316
|
+
var rg = "flex w-full items-start gap-2.5 rounded-md border px-2.5 py-2 text-start transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-60", ig = 58, ag = 160, og = "inline-flex h-8 items-center justify-center gap-1 rounded-md px-3 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50";
|
|
17317
|
+
function sg({ questions: e, onSubmit: t, numbering: n, allowOther: r = !0, answers: i, disabled: a = !1, autoFocus: o = !1, submitLabel: s, className: c, classNames: l }) {
|
|
17233
17318
|
let u = Y("chat"), d = f.useId(), p = f.useRef(null), m = f.useRef([]), h = f.useRef(o ? "panel" : null), g = f.useRef(!0);
|
|
17234
17319
|
f.useEffect(() => () => {
|
|
17235
17320
|
g.current = !1;
|
|
17236
17321
|
}, []);
|
|
17237
|
-
let _ = f.useMemo(() => (e ?? []).map((e, t) =>
|
|
17322
|
+
let _ = f.useMemo(() => (e ?? []).map((e, t) => $h(e, t, n, r, u)), [
|
|
17238
17323
|
e,
|
|
17239
17324
|
n,
|
|
17240
17325
|
r,
|
|
17241
17326
|
u
|
|
17242
17327
|
]), v = _.length, y = v > 1, [b, x] = f.useState(0), [S, C] = f.useState([]), [w, T] = f.useState([]), [E, D] = f.useState([]), [O, k] = f.useState(!1), [A, j] = f.useState(null), [M, N] = f.useState(!1), P = f.useRef(null), F = Ec({
|
|
17243
|
-
minHeight:
|
|
17244
|
-
maxHeight:
|
|
17328
|
+
minHeight: ig,
|
|
17329
|
+
maxHeight: ag
|
|
17245
17330
|
}), I = (e) => {
|
|
17246
17331
|
let t = _[e];
|
|
17247
17332
|
if (!t) return [];
|
|
@@ -17304,7 +17389,7 @@ function ag({ questions: e, onSubmit: t, numbering: n, allowOther: r = !0, answe
|
|
|
17304
17389
|
}
|
|
17305
17390
|
}, te = async () => {
|
|
17306
17391
|
if (!R || z) return;
|
|
17307
|
-
let e = _.map((e, t) =>
|
|
17392
|
+
let e = _.map((e, t) => ng(e.source, I(t)));
|
|
17308
17393
|
k(!0);
|
|
17309
17394
|
try {
|
|
17310
17395
|
await t?.(e), g.current && j(e);
|
|
@@ -17348,7 +17433,7 @@ function ag({ questions: e, onSubmit: t, numbering: n, allowOther: r = !0, answe
|
|
|
17348
17433
|
}
|
|
17349
17434
|
let r = _[b];
|
|
17350
17435
|
if (r) {
|
|
17351
|
-
let t =
|
|
17436
|
+
let t = tg(e.key, r.numbering), n = r.options.length + (r.other && r.options.length > 0 ? 1 : 0);
|
|
17352
17437
|
if (t >= 0 && t < n) {
|
|
17353
17438
|
e.preventDefault(), ee(b, t);
|
|
17354
17439
|
return;
|
|
@@ -17432,11 +17517,11 @@ function ag({ questions: e, onSubmit: t, numbering: n, allowOther: r = !0, answe
|
|
|
17432
17517
|
"data-rf-option": "",
|
|
17433
17518
|
disabled: a,
|
|
17434
17519
|
onClick: () => ee(b, t),
|
|
17435
|
-
className: X(
|
|
17520
|
+
className: X(rg, n ? "border-primary bg-primary/10" : e.recommended ? "border-primary/40 hover:bg-accent" : "border-border hover:bg-accent", l?.option, n && l?.optionSelected)
|
|
17436
17521
|
}, /* @__PURE__ */ f.createElement("span", {
|
|
17437
17522
|
"aria-hidden": "true",
|
|
17438
17523
|
className: X("flex size-5 shrink-0 items-center justify-center rounded text-[11px] font-semibold", n ? "bg-primary text-primary-foreground" : "bg-muted text-muted-foreground")
|
|
17439
|
-
},
|
|
17524
|
+
}, eg(t, G.numbering)), /* @__PURE__ */ f.createElement("span", { className: "min-w-0 flex-1" }, /* @__PURE__ */ f.createElement("span", { className: "block text-sm" }, e.label), e.description && /* @__PURE__ */ f.createElement("span", { className: "block text-xs text-muted-foreground" }, e.description)), e.recommended && /* @__PURE__ */ f.createElement("span", { className: "shrink-0 rounded-full bg-primary/10 px-2 py-0.5 text-[10px] font-medium text-primary" }, u.recommended));
|
|
17440
17525
|
}), G.other && G.options.length > 0 && /* @__PURE__ */ f.createElement("button", {
|
|
17441
17526
|
type: "button",
|
|
17442
17527
|
role: oe,
|
|
@@ -17444,11 +17529,11 @@ function ag({ questions: e, onSubmit: t, numbering: n, allowOther: r = !0, answe
|
|
|
17444
17529
|
"data-rf-option": "",
|
|
17445
17530
|
disabled: a,
|
|
17446
17531
|
onClick: () => ee(b, G.options.length),
|
|
17447
|
-
className: X(
|
|
17532
|
+
className: X(rg, w[b] ? "border-primary bg-primary/10" : "border-border hover:bg-accent", l?.option, w[b] && l?.optionSelected)
|
|
17448
17533
|
}, /* @__PURE__ */ f.createElement("span", {
|
|
17449
17534
|
"aria-hidden": "true",
|
|
17450
17535
|
className: X("flex size-5 shrink-0 items-center justify-center rounded text-[11px] font-semibold", w[b] ? "bg-primary text-primary-foreground" : "bg-muted text-muted-foreground")
|
|
17451
|
-
},
|
|
17536
|
+
}, eg(G.options.length, G.numbering)), /* @__PURE__ */ f.createElement("span", { className: "min-w-0 flex-1 text-sm" }, u.other)), V && /* @__PURE__ */ f.createElement("textarea", {
|
|
17452
17537
|
ref: P,
|
|
17453
17538
|
rows: 2,
|
|
17454
17539
|
value: B,
|
|
@@ -17471,24 +17556,24 @@ function ag({ questions: e, onSubmit: t, numbering: n, allowOther: r = !0, answe
|
|
|
17471
17556
|
className: "w-full rounded-md px-2 py-1.5 text-start transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
17472
17557
|
}, /* @__PURE__ */ f.createElement("span", { className: "block text-xs text-muted-foreground" }, e.title), /* @__PURE__ */ f.createElement("span", { className: X("block text-sm", n.length === 0 && "italic text-destructive") }, n.length ? n.join(", ") : u.noAnswer)));
|
|
17473
17558
|
})))), /* @__PURE__ */ f.createElement("div", { className: X("flex flex-wrap items-center justify-between gap-2 border-t border-border px-3 py-2", l?.footer) }, /* @__PURE__ */ f.createElement("span", { className: "text-[11px] text-muted-foreground" }, G && V && (M || se < 0) ? u.textKeyboardHint : G && se >= 0 ? Vn(u.keyboardHint, {
|
|
17474
|
-
first:
|
|
17475
|
-
last:
|
|
17559
|
+
first: eg(0, G.numbering),
|
|
17560
|
+
last: eg(se, G.numbering)
|
|
17476
17561
|
}) : null), /* @__PURE__ */ f.createElement("div", { className: "ms-auto flex items-center gap-2" }, y && b > 0 && /* @__PURE__ */ f.createElement("button", {
|
|
17477
17562
|
type: "button",
|
|
17478
17563
|
onClick: () => H(b - 1),
|
|
17479
17564
|
disabled: z,
|
|
17480
|
-
className: X(
|
|
17565
|
+
className: X(og, "border border-border hover:bg-accent")
|
|
17481
17566
|
}, u.back), y && b < v ? /* @__PURE__ */ f.createElement("button", {
|
|
17482
17567
|
type: "button",
|
|
17483
17568
|
onClick: () => H(b + 1),
|
|
17484
17569
|
disabled: z || !L(b),
|
|
17485
|
-
className: X(
|
|
17570
|
+
className: X(og, "border border-border hover:bg-accent")
|
|
17486
17571
|
}, u.next) : /* @__PURE__ */ f.createElement("button", {
|
|
17487
17572
|
type: "button",
|
|
17488
17573
|
"data-rf-submit": "",
|
|
17489
17574
|
onClick: () => void te(),
|
|
17490
17575
|
disabled: z || !R,
|
|
17491
|
-
className: X(
|
|
17576
|
+
className: X(og, "bg-primary text-primary-foreground hover:bg-primary/90")
|
|
17492
17577
|
}, O && /* @__PURE__ */ f.createElement(Q, {
|
|
17493
17578
|
name: "loader-2",
|
|
17494
17579
|
size: 12,
|
|
@@ -17497,7 +17582,7 @@ function ag({ questions: e, onSubmit: t, numbering: n, allowOther: r = !0, answe
|
|
|
17497
17582
|
}
|
|
17498
17583
|
//#endregion
|
|
17499
17584
|
//#region src/components/widgets/TabDynamic.tsx
|
|
17500
|
-
var
|
|
17585
|
+
var cg = ({ 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" }) => {
|
|
17501
17586
|
let { value: p, handleChange: m } = mp({
|
|
17502
17587
|
name: t,
|
|
17503
17588
|
onChange: n
|
|
@@ -17554,7 +17639,7 @@ var og = ({ children: e, name: t, onChange: n = void 0, onAdd: r = void 0, onRem
|
|
|
17554
17639
|
}))),
|
|
17555
17640
|
content: /* @__PURE__ */ f.createElement("div", { className: Np() }, C)
|
|
17556
17641
|
}));
|
|
17557
|
-
},
|
|
17642
|
+
}, lg = ({ 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 }) => {
|
|
17558
17643
|
let h = J("pagination"), g = Y("common"), [_, v] = E(r || 1), [y, x] = E(e.length);
|
|
17559
17644
|
e.length !== y && (x(e.length), v(1));
|
|
17560
17645
|
let S = n || e.length, C = Math.ceil(e.length / S), T = (_ - 1) * S, D = T + S, O = w(() => e.slice(T, D), [
|
|
@@ -17620,7 +17705,7 @@ var og = ({ children: e, name: t, onChange: n = void 0, onAdd: r = void 0, onRem
|
|
|
17620
17705
|
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")
|
|
17621
17706
|
}, /* @__PURE__ */ f.createElement("span", null, "»"))))), s);
|
|
17622
17707
|
return /* @__PURE__ */ f.createElement(f.Fragment, null, t(O, T), a ? H(F, a) : a === void 0 && F);
|
|
17623
|
-
},
|
|
17708
|
+
}, ug = ({ 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 }) => {
|
|
17624
17709
|
let O = J("gallery"), k = Y("gallery"), A = Y("common"), j = D || O.Gallery.selectedClassName, [M, N] = E(null), P = v((e) => {
|
|
17625
17710
|
e && N(e);
|
|
17626
17711
|
}, []), F = l ?? O.Gallery.gap, I = u ?? O.Gallery.rowCols, L = {
|
|
@@ -17829,7 +17914,7 @@ var og = ({ children: e, name: t, onChange: n = void 0, onAdd: r = void 0, onRem
|
|
|
17829
17914
|
d,
|
|
17830
17915
|
U
|
|
17831
17916
|
]);
|
|
17832
|
-
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(
|
|
17917
|
+
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(lg, {
|
|
17833
17918
|
records: he,
|
|
17834
17919
|
appendTo: M,
|
|
17835
17920
|
wrapperClassName: "px-3 pt-4 pb-2",
|
|
@@ -17850,12 +17935,12 @@ var og = ({ children: e, name: t, onChange: n = void 0, onAdd: r = void 0, onRem
|
|
|
17850
17935
|
};
|
|
17851
17936
|
//#endregion
|
|
17852
17937
|
//#region src/components/widgets/grid-core/GridGalleryView.tsx
|
|
17853
|
-
function
|
|
17854
|
-
let g = w(() =>
|
|
17938
|
+
function dg({ 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 }) {
|
|
17939
|
+
let g = w(() => Mm(t), [t]), _ = w(() => e.reduce((e, t) => (e.set(g(t), t), e), /* @__PURE__ */ new Map()), [g, e]), v = w(() => e.map((e) => ({
|
|
17855
17940
|
...e,
|
|
17856
17941
|
[fo]: g(e)
|
|
17857
17942
|
})), [e, g]);
|
|
17858
|
-
return /* @__PURE__ */ f.createElement(
|
|
17943
|
+
return /* @__PURE__ */ f.createElement(ug, {
|
|
17859
17944
|
records: v,
|
|
17860
17945
|
overlays: m,
|
|
17861
17946
|
renderItem: h ? (e, t, n) => h(e, t, n) : void 0,
|
|
@@ -17891,8 +17976,8 @@ function lg({ records: e, recordId: t, sortable: n, pagination: r, selection: i
|
|
|
17891
17976
|
}
|
|
17892
17977
|
//#endregion
|
|
17893
17978
|
//#region src/components/widgets/grid-core/useGridActions.tsx
|
|
17894
|
-
function
|
|
17895
|
-
let d = M(), p = N(), m = x(), h = ip(), g = w(() =>
|
|
17979
|
+
function fg({ actions: e, form: t, editDeepLink: n, preparedRecords: r, recordId: i, sourcePath: a, db: o, onSave: s, onDelete: c, onComplete: l, audit: u = !1 }) {
|
|
17980
|
+
let d = M(), p = N(), m = x(), h = ip(), g = w(() => Mm(i), [i]), _ = w(() => Rm(e, !!t), [e, t]), [y, S] = E(null), C = w(() => `${jm(a || "grid-records")}-${jm(m)}`, [m, a]), T = v(() => {
|
|
17896
17981
|
S(null), n && d.hash.startsWith(`#${C}:`) && p({
|
|
17897
17982
|
pathname: d.pathname,
|
|
17898
17983
|
search: d.search,
|
|
@@ -17923,7 +18008,7 @@ function ug({ actions: e, form: t, editDeepLink: n, preparedRecords: r, recordId
|
|
|
17923
18008
|
a
|
|
17924
18009
|
]), O = v(async () => h.save(), [h]), k = v(async (e, t) => {
|
|
17925
18010
|
let r = _[e];
|
|
17926
|
-
if (!r || !
|
|
18011
|
+
if (!r || !zm(r, t) || Bm(r, t)) return;
|
|
17927
18012
|
let i = {
|
|
17928
18013
|
actionKey: e,
|
|
17929
18014
|
record: t,
|
|
@@ -18085,8 +18170,8 @@ function ug({ actions: e, form: t, editDeepLink: n, preparedRecords: r, recordId
|
|
|
18085
18170
|
}
|
|
18086
18171
|
//#endregion
|
|
18087
18172
|
//#region src/components/widgets/grid-core/useGridColumns.ts
|
|
18088
|
-
function
|
|
18089
|
-
return w(() =>
|
|
18173
|
+
function pg({ columns: e, records: t, form: n }) {
|
|
18174
|
+
return w(() => Lm(e, t, n), [
|
|
18090
18175
|
e,
|
|
18091
18176
|
n,
|
|
18092
18177
|
t
|
|
@@ -18094,7 +18179,7 @@ function dg({ columns: e, records: t, form: n }) {
|
|
|
18094
18179
|
}
|
|
18095
18180
|
//#endregion
|
|
18096
18181
|
//#region src/components/widgets/grid-core/useGridPreparedRecords.ts
|
|
18097
|
-
function
|
|
18182
|
+
function mg({ records: e, onLoad: t }) {
|
|
18098
18183
|
let [n, r] = E(e), [i, a] = E(!1);
|
|
18099
18184
|
return b(() => {
|
|
18100
18185
|
if (!t) {
|
|
@@ -18117,7 +18202,7 @@ function fg({ records: e, onLoad: t }) {
|
|
|
18117
18202
|
}
|
|
18118
18203
|
//#endregion
|
|
18119
18204
|
//#region src/components/widgets/grid-core/useGridSelection.ts
|
|
18120
|
-
function
|
|
18205
|
+
function hg({ selection: e }) {
|
|
18121
18206
|
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") ?? "";
|
|
18122
18207
|
b(() => {
|
|
18123
18208
|
o(r ?? []), c([]);
|
|
@@ -18150,7 +18235,7 @@ function pg({ selection: e }) {
|
|
|
18150
18235
|
}
|
|
18151
18236
|
//#endregion
|
|
18152
18237
|
//#region src/components/widgets/grid-core/GridCore.tsx
|
|
18153
|
-
var
|
|
18238
|
+
var gg = (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 || Vm(e, t, i) : Vm(e, t, i), _g = (e) => {
|
|
18154
18239
|
switch (e.kind) {
|
|
18155
18240
|
case "select": return "";
|
|
18156
18241
|
case "multiselect": return [];
|
|
@@ -18164,7 +18249,7 @@ var mg = (e, t, n, r, i) => t?.kind === "delete" ? typeof t.title == "function"
|
|
|
18164
18249
|
};
|
|
18165
18250
|
default: return e.defaultValue ?? !1;
|
|
18166
18251
|
}
|
|
18167
|
-
},
|
|
18252
|
+
}, vg = (e, t) => {
|
|
18168
18253
|
switch (e.kind) {
|
|
18169
18254
|
case "select": return typeof t == "string" && t !== "";
|
|
18170
18255
|
case "multiselect": return Array.isArray(t) && t.length > 0;
|
|
@@ -18178,7 +18263,7 @@ var mg = (e, t, n, r, i) => t?.kind === "delete" ? typeof t.title == "function"
|
|
|
18178
18263
|
}
|
|
18179
18264
|
default: return !!t != !!(e.defaultValue ?? !1);
|
|
18180
18265
|
}
|
|
18181
|
-
},
|
|
18266
|
+
}, yg = (e, t, n) => {
|
|
18182
18267
|
switch (e.kind) {
|
|
18183
18268
|
case "select": return e.predicate(t, n);
|
|
18184
18269
|
case "multiselect": return e.predicate(t, n);
|
|
@@ -18186,7 +18271,7 @@ var mg = (e, t, n, r, i) => t?.kind === "delete" ? typeof t.title == "function"
|
|
|
18186
18271
|
case "numberRange": return e.predicate(t, n);
|
|
18187
18272
|
default: return e.predicate(t, n);
|
|
18188
18273
|
}
|
|
18189
|
-
},
|
|
18274
|
+
}, bg = (e, t, n) => {
|
|
18190
18275
|
switch (e.kind) {
|
|
18191
18276
|
case "select": {
|
|
18192
18277
|
let n = e.options.find((e) => e.value === t);
|
|
@@ -18210,10 +18295,10 @@ var mg = (e, t, n, r, i) => t?.kind === "delete" ? typeof t.title == "function"
|
|
|
18210
18295
|
}
|
|
18211
18296
|
default: return e.label;
|
|
18212
18297
|
}
|
|
18213
|
-
},
|
|
18214
|
-
function
|
|
18298
|
+
}, xg = "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";
|
|
18299
|
+
function Sg({ filter: e, value: t, onChange: n, dict: r }) {
|
|
18215
18300
|
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", {
|
|
18216
|
-
className:
|
|
18301
|
+
className: xg,
|
|
18217
18302
|
value: t,
|
|
18218
18303
|
onChange: (e) => n(e.target.value)
|
|
18219
18304
|
}, /* @__PURE__ */ f.createElement("option", { value: "" }, r.filtersSelectPlaceholder), e.options.map((e) => /* @__PURE__ */ f.createElement("option", {
|
|
@@ -18235,7 +18320,7 @@ function bg({ filter: e, value: t, onChange: n, dict: r }) {
|
|
|
18235
18320
|
let i = t;
|
|
18236
18321
|
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", {
|
|
18237
18322
|
type: "date",
|
|
18238
|
-
className:
|
|
18323
|
+
className: xg,
|
|
18239
18324
|
value: i.from,
|
|
18240
18325
|
onChange: (e) => n({
|
|
18241
18326
|
...i,
|
|
@@ -18243,7 +18328,7 @@ function bg({ filter: e, value: t, onChange: n, dict: r }) {
|
|
|
18243
18328
|
})
|
|
18244
18329
|
})), /* @__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", {
|
|
18245
18330
|
type: "date",
|
|
18246
|
-
className:
|
|
18331
|
+
className: xg,
|
|
18247
18332
|
value: i.to,
|
|
18248
18333
|
onChange: (e) => n({
|
|
18249
18334
|
...i,
|
|
@@ -18255,7 +18340,7 @@ function bg({ filter: e, value: t, onChange: n, dict: r }) {
|
|
|
18255
18340
|
let i = t;
|
|
18256
18341
|
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", {
|
|
18257
18342
|
type: "number",
|
|
18258
|
-
className:
|
|
18343
|
+
className: xg,
|
|
18259
18344
|
value: i.min ?? "",
|
|
18260
18345
|
onChange: (e) => n({
|
|
18261
18346
|
...i,
|
|
@@ -18263,7 +18348,7 @@ function bg({ filter: e, value: t, onChange: n, dict: r }) {
|
|
|
18263
18348
|
})
|
|
18264
18349
|
})), /* @__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", {
|
|
18265
18350
|
type: "number",
|
|
18266
|
-
className:
|
|
18351
|
+
className: xg,
|
|
18267
18352
|
value: i.max ?? "",
|
|
18268
18353
|
onChange: (e) => n({
|
|
18269
18354
|
...i,
|
|
@@ -18282,15 +18367,15 @@ function bg({ filter: e, value: t, onChange: n, dict: r }) {
|
|
|
18282
18367
|
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")
|
|
18283
18368
|
}, /* @__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));
|
|
18284
18369
|
}
|
|
18285
|
-
function
|
|
18286
|
-
let R = J("grid"), z = Y("grid"), B = Y("common"), V = w(() => ({ add: z.buttonAdd }), [z.buttonAdd]), H = Bi(), { preparedRecords: U, loading: ee } =
|
|
18370
|
+
function Cg({ 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 }) {
|
|
18371
|
+
let R = J("grid"), z = Y("grid"), B = Y("common"), V = w(() => ({ add: z.buttonAdd }), [z.buttonAdd]), H = Bi(), { preparedRecords: U, loading: ee } = mg({
|
|
18287
18372
|
records: e,
|
|
18288
18373
|
onLoad: L
|
|
18289
|
-
}), te =
|
|
18374
|
+
}), te = pg({
|
|
18290
18375
|
columns: r,
|
|
18291
18376
|
records: U,
|
|
18292
18377
|
form: a
|
|
18293
|
-
}), [ne, re] = E(() => Object.fromEntries((M ?? []).map((e) => [e.key,
|
|
18378
|
+
}), [ne, re] = E(() => Object.fromEntries((M ?? []).map((e) => [e.key, _g(e)]))), [W, G] = E(!1), ie = v((e, t) => {
|
|
18294
18379
|
re((n) => ({
|
|
18295
18380
|
...n,
|
|
18296
18381
|
[e]: t
|
|
@@ -18298,9 +18383,9 @@ function xg({ records: e, recordId: t, sourcePath: n, columns: r, actions: i, fo
|
|
|
18298
18383
|
}, []), ae = v((e) => {
|
|
18299
18384
|
re((t) => ({
|
|
18300
18385
|
...t,
|
|
18301
|
-
[e.key]:
|
|
18386
|
+
[e.key]: _g(e)
|
|
18302
18387
|
}));
|
|
18303
|
-
}, []), oe = (M ?? []).filter((e) =>
|
|
18388
|
+
}, []), oe = (M ?? []).filter((e) => vg(e, ne[e.key] ?? _g(e))), se = w(() => !M || M.length === 0 ? U : U.filter((e) => M.every((t) => yg(t, e, ne[t.key] ?? _g(t)))), [
|
|
18304
18389
|
U,
|
|
18305
18390
|
M,
|
|
18306
18391
|
ne
|
|
@@ -18315,7 +18400,7 @@ function xg({ records: e, recordId: t, sourcePath: n, columns: r, actions: i, fo
|
|
|
18315
18400
|
key: e.key,
|
|
18316
18401
|
variant: "info",
|
|
18317
18402
|
className: "inline-flex items-center gap-1"
|
|
18318
|
-
},
|
|
18403
|
+
}, bg(e, ne[e.key] ?? _g(e), z), /* @__PURE__ */ f.createElement(ri, {
|
|
18319
18404
|
icon: "x",
|
|
18320
18405
|
variant: "link",
|
|
18321
18406
|
ariaLabel: `${z.filtersClearAll} ${e.label}`,
|
|
@@ -18330,12 +18415,12 @@ function xg({ records: e, recordId: t, sourcePath: n, columns: r, actions: i, fo
|
|
|
18330
18415
|
label: z.filtersClearAll,
|
|
18331
18416
|
variant: "link",
|
|
18332
18417
|
disabled: oe.length === 0,
|
|
18333
|
-
onClick: () => re(Object.fromEntries(M.map((e) => [e.key,
|
|
18418
|
+
onClick: () => re(Object.fromEntries(M.map((e) => [e.key, _g(e)])))
|
|
18334
18419
|
})
|
|
18335
|
-
}, /* @__PURE__ */ f.createElement("div", { className: "flex flex-col gap-5" }, M.map((e) => /* @__PURE__ */ f.createElement(
|
|
18420
|
+
}, /* @__PURE__ */ f.createElement("div", { className: "flex flex-col gap-5" }, M.map((e) => /* @__PURE__ */ f.createElement(Sg, {
|
|
18336
18421
|
key: e.key,
|
|
18337
18422
|
filter: e,
|
|
18338
|
-
value: ne[e.key] ??
|
|
18423
|
+
value: ne[e.key] ?? _g(e),
|
|
18339
18424
|
onChange: (t) => ie(e.key, t),
|
|
18340
18425
|
dict: z
|
|
18341
18426
|
})))) : null, fe = j === !0 ? {} : j || void 0, [pe, me] = E(""), K = w(() => {
|
|
@@ -18394,7 +18479,7 @@ function xg({ records: e, recordId: t, sourcePath: n, columns: r, actions: i, fo
|
|
|
18394
18479
|
ve.overlays,
|
|
18395
18480
|
ve.renderItem,
|
|
18396
18481
|
ke
|
|
18397
|
-
]), { mode: je, activeSelectionKeys: Me, selectionState: Ne, handleSelectionChange: Pe } =
|
|
18482
|
+
]), { mode: je, activeSelectionKeys: Me, selectionState: Ne, handleSelectionChange: Pe } = hg({ selection: T }), { normalizedActions: Fe, activeAction: Ie, activeActionConfig: q, activeActionBody: Le, activeKey: Re, runAction: ze, close: Be, getActionContext: Ve, getModalActionContext: He, getRecordKey: Ue, formController: We } = fg({
|
|
18398
18483
|
actions: i,
|
|
18399
18484
|
form: a,
|
|
18400
18485
|
editDeepLink: o,
|
|
@@ -18424,18 +18509,18 @@ function xg({ records: e, recordId: t, sourcePath: n, columns: r, actions: i, fo
|
|
|
18424
18509
|
ze
|
|
18425
18510
|
]), Je = D || Ke ? qe : void 0, Ye = v((e, t, n) => {
|
|
18426
18511
|
let r = Fe[e];
|
|
18427
|
-
return !r || !
|
|
18512
|
+
return !r || !zm(r, t) ? null : /* @__PURE__ */ f.createElement(ri, {
|
|
18428
18513
|
className: n || (e === "add" ? "btn-primary" : void 0),
|
|
18429
18514
|
icon: r.icon,
|
|
18430
|
-
label:
|
|
18431
|
-
disabled:
|
|
18515
|
+
label: Vm(e, r, V),
|
|
18516
|
+
disabled: Bm(r, t),
|
|
18432
18517
|
onClick: () => ze(e, t)
|
|
18433
18518
|
});
|
|
18434
18519
|
}, [
|
|
18435
18520
|
Fe,
|
|
18436
18521
|
ze,
|
|
18437
18522
|
V
|
|
18438
|
-
]), Xe = w(() => Object.entries(Fe).filter(([e, t]) => e !== "edit" && e !== "delete" &&
|
|
18523
|
+
]), Xe = w(() => Object.entries(Fe).filter(([e, t]) => e !== "edit" && e !== "delete" && zm(t, void 0)).map(([e]) => e), [Fe]), Ze = w(() => ({
|
|
18439
18524
|
title: _,
|
|
18440
18525
|
records: U,
|
|
18441
18526
|
selection: Ne,
|
|
@@ -18528,7 +18613,7 @@ function xg({ records: e, recordId: t, sourcePath: n, columns: r, actions: i, fo
|
|
|
18528
18613
|
if (q.footer === !1) return !1;
|
|
18529
18614
|
if (q.footer !== void 0 && it) return typeof q.footer == "function" ? q.footer(it) : q.footer;
|
|
18530
18615
|
}
|
|
18531
|
-
}, [q, it]), st =
|
|
18616
|
+
}, [q, it]), st = Hm(S);
|
|
18532
18617
|
return /* @__PURE__ */ f.createElement(f.Fragment, null, /* @__PURE__ */ f.createElement(Ki, {
|
|
18533
18618
|
wrapperClassName: p,
|
|
18534
18619
|
header: nt,
|
|
@@ -18538,7 +18623,7 @@ function xg({ records: e, recordId: t, sourcePath: n, columns: r, actions: i, fo
|
|
|
18538
18623
|
bodyClassName: X(R.Grid.Card.bodyClassName, h),
|
|
18539
18624
|
footerClassName: R.Grid.Card.footerClassName,
|
|
18540
18625
|
loading: g || ee
|
|
18541
|
-
}, ye === "gallery" ? /* @__PURE__ */ f.createElement(
|
|
18626
|
+
}, ye === "gallery" ? /* @__PURE__ */ f.createElement(dg, {
|
|
18542
18627
|
records: K,
|
|
18543
18628
|
recordId: t,
|
|
18544
18629
|
sortable: st || S,
|
|
@@ -18554,7 +18639,7 @@ function xg({ records: e, recordId: t, sourcePath: n, columns: r, actions: i, fo
|
|
|
18554
18639
|
columns: ve.columns,
|
|
18555
18640
|
overlays: Ae,
|
|
18556
18641
|
renderItem: ve.renderItem
|
|
18557
|
-
}) : /* @__PURE__ */ f.createElement(
|
|
18642
|
+
}) : /* @__PURE__ */ f.createElement(Um, {
|
|
18558
18643
|
records: K,
|
|
18559
18644
|
recordId: t,
|
|
18560
18645
|
columns: we,
|
|
@@ -18580,7 +18665,7 @@ function xg({ records: e, recordId: t, sourcePath: n, columns: r, actions: i, fo
|
|
|
18580
18665
|
size: (q.kind === "modal" || q.kind === "delete") && q.size || R.Grid.Modal.size,
|
|
18581
18666
|
position: (q.kind === "modal" || q.kind === "delete") && q.position || R.Grid.Modal.position,
|
|
18582
18667
|
header: at,
|
|
18583
|
-
title:
|
|
18668
|
+
title: gg(Ie.actionKey, q, q.kind === "modal" || q.kind === "delete" ? He(Ie.actionKey, Ie.record) : Ve(Ie.actionKey, Ie.record), z.deleteConfirm, V),
|
|
18584
18669
|
onClose: Be,
|
|
18585
18670
|
onSave: q.kind === "modal" && q.footer === void 0 && (Ie.actionKey === "add" || Ie.actionKey === "edit") ? (e) => We.save(e) : void 0,
|
|
18586
18671
|
onDelete: q.kind === "delete" ? async () => {
|
|
@@ -18608,18 +18693,18 @@ function xg({ records: e, recordId: t, sourcePath: n, columns: r, actions: i, fo
|
|
|
18608
18693
|
}
|
|
18609
18694
|
//#endregion
|
|
18610
18695
|
//#region src/components/widgets/grid-core/GridArray.tsx
|
|
18611
|
-
function
|
|
18612
|
-
return /* @__PURE__ */ f.createElement(
|
|
18696
|
+
function wg(e) {
|
|
18697
|
+
return /* @__PURE__ */ f.createElement(Cg, e);
|
|
18613
18698
|
}
|
|
18614
18699
|
//#endregion
|
|
18615
18700
|
//#region src/components/widgets/Grid.tsx
|
|
18616
|
-
function
|
|
18617
|
-
return "records" in e ? /* @__PURE__ */ f.createElement(
|
|
18701
|
+
function Tg(e) {
|
|
18702
|
+
return "records" in e ? /* @__PURE__ */ f.createElement(wg, e) : /* @__PURE__ */ f.createElement(Am, e);
|
|
18618
18703
|
}
|
|
18619
18704
|
//#endregion
|
|
18620
18705
|
//#region src/pages/Users.tsx
|
|
18621
|
-
function
|
|
18622
|
-
return /* @__PURE__ */ f.createElement(
|
|
18706
|
+
function Eg() {
|
|
18707
|
+
return /* @__PURE__ */ f.createElement(Tg, {
|
|
18623
18708
|
path: "/users",
|
|
18624
18709
|
recordId: (e) => `${e.email ?? ""}`.replace("@", "-"),
|
|
18625
18710
|
form: /* @__PURE__ */ f.createElement(f.Fragment, null, /* @__PURE__ */ f.createElement(Uc, {
|
|
@@ -18646,10 +18731,10 @@ function wg() {
|
|
|
18646
18731
|
}
|
|
18647
18732
|
//#endregion
|
|
18648
18733
|
//#region src/pages/NotFound.tsx
|
|
18649
|
-
var
|
|
18734
|
+
var Dg = () => {
|
|
18650
18735
|
let e = Y("common");
|
|
18651
18736
|
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));
|
|
18652
|
-
},
|
|
18737
|
+
}, Og = ({ size: e = 28 }) => /* @__PURE__ */ f.createElement("svg", {
|
|
18653
18738
|
xmlns: "http://www.w3.org/2000/svg",
|
|
18654
18739
|
width: e,
|
|
18655
18740
|
height: e,
|
|
@@ -18669,7 +18754,7 @@ var Tg = () => {
|
|
|
18669
18754
|
x2: "12.01",
|
|
18670
18755
|
y1: "17",
|
|
18671
18756
|
y2: "17"
|
|
18672
|
-
})),
|
|
18757
|
+
})), kg = ({ open: e }) => /* @__PURE__ */ f.createElement("svg", {
|
|
18673
18758
|
xmlns: "http://www.w3.org/2000/svg",
|
|
18674
18759
|
width: "13",
|
|
18675
18760
|
height: "13",
|
|
@@ -18684,7 +18769,7 @@ var Tg = () => {
|
|
|
18684
18769
|
transform: e ? "rotate(180deg)" : "none",
|
|
18685
18770
|
flexShrink: 0
|
|
18686
18771
|
}
|
|
18687
|
-
}, /* @__PURE__ */ f.createElement("polyline", { points: "6 9 12 15 18 9" })),
|
|
18772
|
+
}, /* @__PURE__ */ f.createElement("polyline", { points: "6 9 12 15 18 9" })), Ag = () => /* @__PURE__ */ f.createElement("svg", {
|
|
18688
18773
|
xmlns: "http://www.w3.org/2000/svg",
|
|
18689
18774
|
width: "13",
|
|
18690
18775
|
height: "13",
|
|
@@ -18701,7 +18786,7 @@ var Tg = () => {
|
|
|
18701
18786
|
y: "8",
|
|
18702
18787
|
rx: "2",
|
|
18703
18788
|
ry: "2"
|
|
18704
|
-
}), /* @__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" })),
|
|
18789
|
+
}), /* @__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" })), jg = () => /* @__PURE__ */ f.createElement("svg", {
|
|
18705
18790
|
xmlns: "http://www.w3.org/2000/svg",
|
|
18706
18791
|
width: "13",
|
|
18707
18792
|
height: "13",
|
|
@@ -18711,7 +18796,7 @@ var Tg = () => {
|
|
|
18711
18796
|
strokeWidth: "2",
|
|
18712
18797
|
strokeLinecap: "round",
|
|
18713
18798
|
strokeLinejoin: "round"
|
|
18714
|
-
}, /* @__PURE__ */ f.createElement("path", { d: "m22 2-7 20-4-9-9-4Z" }), /* @__PURE__ */ f.createElement("path", { d: "M22 2 11 13" })),
|
|
18799
|
+
}, /* @__PURE__ */ f.createElement("path", { d: "m22 2-7 20-4-9-9-4Z" }), /* @__PURE__ */ f.createElement("path", { d: "M22 2 11 13" })), Mg = () => /* @__PURE__ */ f.createElement("svg", {
|
|
18715
18800
|
xmlns: "http://www.w3.org/2000/svg",
|
|
18716
18801
|
width: "14",
|
|
18717
18802
|
height: "14",
|
|
@@ -18721,7 +18806,7 @@ var Tg = () => {
|
|
|
18721
18806
|
strokeWidth: "2",
|
|
18722
18807
|
strokeLinecap: "round",
|
|
18723
18808
|
strokeLinejoin: "round"
|
|
18724
|
-
}, /* @__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" })),
|
|
18809
|
+
}, /* @__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" })), Ng = (e, t) => ({
|
|
18725
18810
|
error: {
|
|
18726
18811
|
message: e.message,
|
|
18727
18812
|
stack: e.stack ?? ""
|
|
@@ -18732,8 +18817,8 @@ var Tg = () => {
|
|
|
18732
18817
|
userAgent: typeof navigator < "u" ? navigator.userAgent : "",
|
|
18733
18818
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
18734
18819
|
}
|
|
18735
|
-
}),
|
|
18736
|
-
let n =
|
|
18820
|
+
}), Pg = (e, t) => {
|
|
18821
|
+
let n = Ng(e, t);
|
|
18737
18822
|
return [
|
|
18738
18823
|
`Error: ${n.error.message}`,
|
|
18739
18824
|
"",
|
|
@@ -18748,7 +18833,7 @@ var Tg = () => {
|
|
|
18748
18833
|
`Timestamp: ${n.context.timestamp}`,
|
|
18749
18834
|
`Agent: ${n.context.userAgent}`
|
|
18750
18835
|
].join("\n");
|
|
18751
|
-
},
|
|
18836
|
+
}, Fg = ({ children: e }) => /* @__PURE__ */ f.createElement(f.Fragment, null, e(Yn().errorBoundary)), Ig = class extends f.Component {
|
|
18752
18837
|
constructor(e) {
|
|
18753
18838
|
super(e), this.state = {
|
|
18754
18839
|
error: null,
|
|
@@ -18770,7 +18855,7 @@ var Tg = () => {
|
|
|
18770
18855
|
};
|
|
18771
18856
|
copy = () => {
|
|
18772
18857
|
let { error: e, errorInfo: t } = this.state;
|
|
18773
|
-
e && navigator.clipboard?.writeText(
|
|
18858
|
+
e && navigator.clipboard?.writeText(Pg(e, t)).then(() => {
|
|
18774
18859
|
this.setState({ copied: !0 }), setTimeout(() => this.setState({ copied: !1 }), 2e3);
|
|
18775
18860
|
});
|
|
18776
18861
|
};
|
|
@@ -18779,7 +18864,7 @@ var Tg = () => {
|
|
|
18779
18864
|
e && n && (this.setState({ reportState: "sending" }), fetch(n, {
|
|
18780
18865
|
method: "POST",
|
|
18781
18866
|
headers: { "Content-Type": "application/json" },
|
|
18782
|
-
body: JSON.stringify(
|
|
18867
|
+
body: JSON.stringify(Ng(e, t))
|
|
18783
18868
|
}).then((e) => this.setState({ reportState: e.ok ? "sent" : "failed" })).catch(() => this.setState({ reportState: "failed" })));
|
|
18784
18869
|
};
|
|
18785
18870
|
render() {
|
|
@@ -18789,16 +18874,16 @@ var Tg = () => {
|
|
|
18789
18874
|
if (typeof o == "function") return o(e, this.reset);
|
|
18790
18875
|
if (o != null) return o;
|
|
18791
18876
|
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";
|
|
18792
|
-
return /* @__PURE__ */ f.createElement(
|
|
18877
|
+
return /* @__PURE__ */ f.createElement(Fg, 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(Og, { 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", {
|
|
18793
18878
|
onClick: () => this.setState((e) => ({ detailsOpen: !e.detailsOpen })),
|
|
18794
18879
|
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"
|
|
18795
|
-
}, /* @__PURE__ */ f.createElement(
|
|
18880
|
+
}, /* @__PURE__ */ f.createElement(kg, { 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", {
|
|
18796
18881
|
onClick: () => this.setState((e) => ({ debugOpen: !e.debugOpen })),
|
|
18797
18882
|
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"
|
|
18798
|
-
}, /* @__PURE__ */ f.createElement(
|
|
18883
|
+
}, /* @__PURE__ */ f.createElement(Mg, null), /* @__PURE__ */ f.createElement(kg, { 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", {
|
|
18799
18884
|
onClick: this.copy,
|
|
18800
18885
|
className: "flex items-center gap-1.5 rounded border px-2.5 py-1 text-[11px] font-medium transition-colors hover:bg-accent"
|
|
18801
|
-
}, /* @__PURE__ */ f.createElement(
|
|
18886
|
+
}, /* @__PURE__ */ f.createElement(Ag, null), i ? t.copied : t.copyDebug))), /* @__PURE__ */ f.createElement("div", { className: "flex flex-wrap items-center gap-2" }, /* @__PURE__ */ f.createElement("button", {
|
|
18802
18887
|
onClick: this.reset,
|
|
18803
18888
|
className: "rounded-md border bg-background px-4 py-1.5 text-sm font-medium shadow-sm transition-colors hover:bg-accent"
|
|
18804
18889
|
}, t.tryAgain), /* @__PURE__ */ f.createElement("a", {
|
|
@@ -18808,15 +18893,15 @@ var Tg = () => {
|
|
|
18808
18893
|
onClick: this.sendReport,
|
|
18809
18894
|
disabled: a === "sending" || a === "sent",
|
|
18810
18895
|
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"
|
|
18811
|
-
}, /* @__PURE__ */ f.createElement(
|
|
18896
|
+
}, /* @__PURE__ */ f.createElement(jg, null), a === "idle" && t.sendReport, a === "sending" && t.sending, a === "sent" && t.reportSent, a === "failed" && t.reportFailed)))));
|
|
18812
18897
|
}
|
|
18813
|
-
},
|
|
18898
|
+
}, Lg = async () => {
|
|
18814
18899
|
window.google?.accounts?.id || (At([{
|
|
18815
18900
|
src: "https://accounts.google.com/gsi/client",
|
|
18816
18901
|
async: !0,
|
|
18817
18902
|
clean: !0
|
|
18818
18903
|
}]), await new Promise((e) => setTimeout(e, 0)));
|
|
18819
|
-
},
|
|
18904
|
+
}, Rg = class {
|
|
18820
18905
|
getConfigurationState() {
|
|
18821
18906
|
return xi("GoogleAuthProvider", bi(eo("oAuth2"), ["clientId"], "google.oAuth2."));
|
|
18822
18907
|
}
|
|
@@ -18839,7 +18924,7 @@ var Tg = () => {
|
|
|
18839
18924
|
async signIn(e = {}) {
|
|
18840
18925
|
let t = eo("oAuth2");
|
|
18841
18926
|
if (!this.isConfigured() || !t?.clientId) throw Error("GoogleAuthProvider: missing google.oAuth2.clientId configuration.");
|
|
18842
|
-
return await
|
|
18927
|
+
return await Lg(), new Promise((n, r) => {
|
|
18843
18928
|
if (!window.google?.accounts?.id) {
|
|
18844
18929
|
r(/* @__PURE__ */ Error("GoogleAuthProvider: Google Identity Services script is not available."));
|
|
18845
18930
|
return;
|
|
@@ -18920,41 +19005,41 @@ var Tg = () => {
|
|
|
18920
19005
|
isAuthenticated() {
|
|
18921
19006
|
return !!this.getUser();
|
|
18922
19007
|
}
|
|
18923
|
-
},
|
|
19008
|
+
}, zg = g(null), Bg = ({ registry: e, defaultKey: t, children: n }) => {
|
|
18924
19009
|
let r = w(() => ({
|
|
18925
19010
|
registry: e,
|
|
18926
19011
|
defaultKey: t
|
|
18927
19012
|
}), [e, t]);
|
|
18928
|
-
return /* @__PURE__ */ f.createElement(
|
|
18929
|
-
},
|
|
18930
|
-
let t = y(
|
|
19013
|
+
return /* @__PURE__ */ f.createElement(zg.Provider, { value: r }, n);
|
|
19014
|
+
}, Vg = (e) => {
|
|
19015
|
+
let t = y(zg);
|
|
18931
19016
|
if (!t) return null;
|
|
18932
19017
|
let n = e ?? t.defaultKey;
|
|
18933
19018
|
return t.registry[n] ?? null;
|
|
18934
|
-
},
|
|
19019
|
+
}, Hg = g(null), Ug = ({ registry: e, defaultKey: t, children: n }) => {
|
|
18935
19020
|
let r = w(() => ({
|
|
18936
19021
|
registry: e,
|
|
18937
19022
|
defaultKey: t
|
|
18938
19023
|
}), [e, t]);
|
|
18939
|
-
return /* @__PURE__ */ f.createElement(
|
|
18940
|
-
},
|
|
18941
|
-
let t = y(
|
|
19024
|
+
return /* @__PURE__ */ f.createElement(Hg.Provider, { value: r }, n);
|
|
19025
|
+
}, Wg = (e) => {
|
|
19026
|
+
let t = y(Hg);
|
|
18942
19027
|
if (!t) throw Error("useCredentialsProvider must be used inside <App providers={...} />.");
|
|
18943
19028
|
let n = e ?? t.defaultKey, r = t.registry[n];
|
|
18944
19029
|
if (!r) throw Error(`CredentialsProvider '${n}' is not registered. Available: ${Object.keys(t.registry).join(", ")}`);
|
|
18945
19030
|
return r;
|
|
18946
|
-
},
|
|
19031
|
+
}, Gg = {
|
|
18947
19032
|
key: "@key",
|
|
18948
19033
|
value: "@value"
|
|
18949
|
-
},
|
|
19034
|
+
}, Kg = () => Je(), qg = (e, t, n) => {
|
|
18950
19035
|
let r = `Error during ${e}: ${String(t)}`;
|
|
18951
19036
|
if (n) throw Error(r);
|
|
18952
19037
|
console.error(r);
|
|
18953
|
-
},
|
|
19038
|
+
}, Jg = (e, t) => {
|
|
18954
19039
|
if (!e || !(t in e)) return e;
|
|
18955
19040
|
let { [t]: n, ...r } = e;
|
|
18956
19041
|
return Object.keys(r).length ? r : void 0;
|
|
18957
|
-
},
|
|
19042
|
+
}, Yg = (e) => {
|
|
18958
19043
|
let t = typeof e == "object" && e && !Array.isArray(e) ? e : Array.isArray(e) ? { in: e } : { eq: e }, n;
|
|
18959
19044
|
return t.gt !== void 0 && (n = {
|
|
18960
19045
|
...n,
|
|
@@ -18972,28 +19057,28 @@ var Tg = () => {
|
|
|
18972
19057
|
condition: t,
|
|
18973
19058
|
clientCondition: n
|
|
18974
19059
|
};
|
|
18975
|
-
},
|
|
19060
|
+
}, Xg = (e, t) => {
|
|
18976
19061
|
switch (t) {
|
|
18977
|
-
case
|
|
18978
|
-
case
|
|
19062
|
+
case Gg.key: return $e(e, Ze());
|
|
19063
|
+
case Gg.value: return $e(e, Qe());
|
|
18979
19064
|
default: return $e(e, Xe(t));
|
|
18980
19065
|
}
|
|
18981
|
-
},
|
|
19066
|
+
}, Zg = (e, t, n) => {
|
|
18982
19067
|
let [r] = Object.entries(t || {});
|
|
18983
19068
|
if (!r) return {
|
|
18984
19069
|
dbRef: e,
|
|
18985
19070
|
clientWhere: n
|
|
18986
19071
|
};
|
|
18987
|
-
let [i] = r, a =
|
|
19072
|
+
let [i] = r, a = Xg(e, i), o = n?.[i];
|
|
18988
19073
|
if (o == null) return {
|
|
18989
19074
|
dbRef: a,
|
|
18990
19075
|
clientWhere: n
|
|
18991
19076
|
};
|
|
18992
|
-
let { condition: s, clientCondition: c } =
|
|
19077
|
+
let { condition: s, clientCondition: c } = Yg(o);
|
|
18993
19078
|
switch (!0) {
|
|
18994
19079
|
case s.eq !== void 0: return {
|
|
18995
19080
|
dbRef: $e(a, Ke(s.eq)),
|
|
18996
|
-
clientWhere:
|
|
19081
|
+
clientWhere: Jg(n, i)
|
|
18997
19082
|
};
|
|
18998
19083
|
case s.gte !== void 0 && s.lte !== void 0:
|
|
18999
19084
|
a = $e(a, rt(s.gte), Ge(s.lte));
|
|
@@ -19021,11 +19106,11 @@ var Tg = () => {
|
|
|
19021
19106
|
return {
|
|
19022
19107
|
dbRef: a,
|
|
19023
19108
|
clientWhere: c ? {
|
|
19024
|
-
...
|
|
19109
|
+
...Jg(n, i) || {},
|
|
19025
19110
|
[i]: c
|
|
19026
|
-
} :
|
|
19111
|
+
} : Jg(n, i)
|
|
19027
19112
|
};
|
|
19028
|
-
},
|
|
19113
|
+
}, Qg = (e, t) => {
|
|
19029
19114
|
if (!t) return e;
|
|
19030
19115
|
let n = t.split("."), r = e;
|
|
19031
19116
|
for (let e of n) {
|
|
@@ -19033,10 +19118,10 @@ var Tg = () => {
|
|
|
19033
19118
|
r = r[e];
|
|
19034
19119
|
}
|
|
19035
19120
|
return r;
|
|
19036
|
-
},
|
|
19121
|
+
}, $g = (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, {
|
|
19037
19122
|
numeric: !0,
|
|
19038
19123
|
sensitivity: "base"
|
|
19039
|
-
}),
|
|
19124
|
+
}), e_ = (e, t) => {
|
|
19040
19125
|
let n = typeof t == "object" && t && !Array.isArray(t) ? t : { eq: t };
|
|
19041
19126
|
for (let [t, r] of Object.entries(n)) switch (t) {
|
|
19042
19127
|
case "eq":
|
|
@@ -19063,23 +19148,23 @@ var Tg = () => {
|
|
|
19063
19148
|
default: return !1;
|
|
19064
19149
|
}
|
|
19065
19150
|
return !0;
|
|
19066
|
-
},
|
|
19151
|
+
}, t_ = (e, t, n) => {
|
|
19067
19152
|
let [r, ...i] = Object.entries(n || {}), a = Object.entries(t || {}), o = Object.entries(e);
|
|
19068
|
-
if (a.length && (o = o.filter(([, e]) => a.every(([t, n]) => Qg(
|
|
19153
|
+
if (a.length && (o = o.filter(([, e]) => a.every(([t, n]) => e_(Qg(e, t), n)))), r) {
|
|
19069
19154
|
let e = [r, ...i];
|
|
19070
19155
|
o.sort((t, n) => {
|
|
19071
19156
|
for (let [r, i] of e) {
|
|
19072
|
-
let e =
|
|
19157
|
+
let e = $g(Qg(t[1], r), Qg(n[1], r));
|
|
19073
19158
|
if (e) return i === "desc" ? -e : e;
|
|
19074
19159
|
}
|
|
19075
19160
|
return 0;
|
|
19076
19161
|
});
|
|
19077
19162
|
}
|
|
19078
19163
|
return Object.fromEntries(o);
|
|
19079
|
-
},
|
|
19080
|
-
let t = await so()?.currentUser?.getIdToken().catch(() => void 0), n = new URL(`${e}.json`, et(
|
|
19164
|
+
}, n_ = async (e) => {
|
|
19165
|
+
let t = await so()?.currentUser?.getIdToken().catch(() => void 0), n = new URL(`${e}.json`, et(Kg()).toString());
|
|
19081
19166
|
return n.searchParams.set("shallow", "true"), t && n.searchParams.set("auth", t), n.toString();
|
|
19082
|
-
},
|
|
19167
|
+
}, r_ = class e {
|
|
19083
19168
|
static listenerRegistered = !1;
|
|
19084
19169
|
constructor() {
|
|
19085
19170
|
!e.listenerRegistered && typeof Xa == "function" && (e.listenerRegistered = !0, Xa((e) => {
|
|
@@ -19094,44 +19179,44 @@ var Tg = () => {
|
|
|
19094
19179
|
}
|
|
19095
19180
|
readShallow = async (e, t = !1) => {
|
|
19096
19181
|
try {
|
|
19097
|
-
let t = await
|
|
19182
|
+
let t = await n_(e), n = await fetch(t);
|
|
19098
19183
|
if (!n.ok) throw Error(`${n.status} ${n.statusText}`);
|
|
19099
19184
|
let r = await n.json();
|
|
19100
19185
|
return r ? Object.keys(r) : [];
|
|
19101
19186
|
} catch (n) {
|
|
19102
|
-
return
|
|
19187
|
+
return qg(`reading SHALLOW data in Firebase for ${e}`, n, t), [];
|
|
19103
19188
|
}
|
|
19104
19189
|
};
|
|
19105
19190
|
read = async (e, { where: t, order: n, toArray: r = !1, exception: i = !1 } = {}) => {
|
|
19106
|
-
let { dbRef: a, clientWhere: o } =
|
|
19191
|
+
let { dbRef: a, clientWhere: o } = Zg(et(Kg(), e), n, t);
|
|
19107
19192
|
try {
|
|
19108
19193
|
let t = await qe(a);
|
|
19109
19194
|
if (t.exists()) {
|
|
19110
19195
|
`${e}`;
|
|
19111
|
-
let i =
|
|
19196
|
+
let i = t_(t.val(), o, n);
|
|
19112
19197
|
return r ? Object.values(i) : i;
|
|
19113
19198
|
}
|
|
19114
|
-
i &&
|
|
19199
|
+
i && qg(`Data not found in Firebase for path ${e}`, null, i);
|
|
19115
19200
|
} catch (t) {
|
|
19116
|
-
|
|
19201
|
+
qg(`reading data in Firebase for ${e}`, t, i);
|
|
19117
19202
|
}
|
|
19118
19203
|
};
|
|
19119
19204
|
update = async (e, t, n = !1) => {
|
|
19120
19205
|
try {
|
|
19121
|
-
await it(et(
|
|
19206
|
+
await it(et(Kg(), e), t), `${e}`;
|
|
19122
19207
|
} catch (t) {
|
|
19123
|
-
|
|
19208
|
+
qg(`updating data in Firebase for ${e}`, t, n);
|
|
19124
19209
|
}
|
|
19125
19210
|
};
|
|
19126
19211
|
set = async (e, t, n = !1) => {
|
|
19127
19212
|
try {
|
|
19128
|
-
await nt(et(
|
|
19213
|
+
await nt(et(Kg(), e), t), `${e}`;
|
|
19129
19214
|
} catch (t) {
|
|
19130
|
-
|
|
19215
|
+
qg(`updating data in Firebase for ${e}`, t, n);
|
|
19131
19216
|
}
|
|
19132
19217
|
};
|
|
19133
19218
|
setChunks = async (e, t, { chunkSize: n = 1e3, purge: r = !1, onProgress: i } = {}) => {
|
|
19134
|
-
let a =
|
|
19219
|
+
let a = Kg(), o = et(a, e);
|
|
19135
19220
|
try {
|
|
19136
19221
|
r && (await tt(o), i?.(0, 0, `Purging existing data at ${e}`));
|
|
19137
19222
|
let a = Object.entries(Gt(t)), s = Math.ceil(a.length / n);
|
|
@@ -19142,14 +19227,14 @@ var Tg = () => {
|
|
|
19142
19227
|
i?.(r, s, `Saving chunk ${r}/${s}`);
|
|
19143
19228
|
}
|
|
19144
19229
|
} catch (t) {
|
|
19145
|
-
|
|
19230
|
+
qg(`setting data in chunks in Firebase for ${e}`, t, !1);
|
|
19146
19231
|
}
|
|
19147
19232
|
};
|
|
19148
19233
|
remove = async (e, t = !1) => {
|
|
19149
19234
|
try {
|
|
19150
|
-
await tt(et(
|
|
19235
|
+
await tt(et(Kg(), e)), `${e}`;
|
|
19151
19236
|
} catch (n) {
|
|
19152
|
-
|
|
19237
|
+
qg(`removing data from Firebase for ${e}`, n, t);
|
|
19153
19238
|
}
|
|
19154
19239
|
};
|
|
19155
19240
|
count = async (e) => (await this.readShallow(e)).length;
|
|
@@ -19157,14 +19242,14 @@ var Tg = () => {
|
|
|
19157
19242
|
let o = so();
|
|
19158
19243
|
if (!o || !e) return () => void 0;
|
|
19159
19244
|
let s = () => {
|
|
19160
|
-
let { dbRef: o, clientWhere: s } =
|
|
19245
|
+
let { dbRef: o, clientWhere: s } = Zg(et(Kg(), e), r, n);
|
|
19161
19246
|
return Ye(o, (e) => {
|
|
19162
19247
|
let n = e.val();
|
|
19163
19248
|
if (!n) {
|
|
19164
19249
|
t([]);
|
|
19165
19250
|
return;
|
|
19166
19251
|
}
|
|
19167
|
-
let o = a ? a(
|
|
19252
|
+
let o = a ? a(t_(n, s, r)) : t_(n, s, r), c = Object.entries(o);
|
|
19168
19253
|
if (!i) {
|
|
19169
19254
|
t(c.map(([e, t], n) => typeof t == "object" && t ? {
|
|
19170
19255
|
_index: n,
|
|
@@ -19173,22 +19258,22 @@ var Tg = () => {
|
|
|
19173
19258
|
} : {
|
|
19174
19259
|
_index: n,
|
|
19175
19260
|
[fo]: e,
|
|
19176
|
-
[
|
|
19261
|
+
[Gg.value]: t
|
|
19177
19262
|
}));
|
|
19178
19263
|
return;
|
|
19179
19264
|
}
|
|
19180
19265
|
let l = Object.keys(i);
|
|
19181
19266
|
t(c.map(([e, t], n) => {
|
|
19182
19267
|
let r = typeof t == "object" && t ? {
|
|
19183
|
-
[
|
|
19268
|
+
[Gg.key]: e,
|
|
19184
19269
|
...t
|
|
19185
19270
|
} : {
|
|
19186
|
-
[
|
|
19187
|
-
[
|
|
19271
|
+
[Gg.key]: e,
|
|
19272
|
+
[Gg.value]: t
|
|
19188
19273
|
}, a = {};
|
|
19189
19274
|
for (let n of l) {
|
|
19190
19275
|
let o = i[n];
|
|
19191
|
-
a[n] = o.includes("{") ? ft.parse(r, o) : o ===
|
|
19276
|
+
a[n] = o.includes("{") ? ft.parse(r, o) : o === Gg.key ? e : o === Gg.value ? t : r[o];
|
|
19192
19277
|
}
|
|
19193
19278
|
return {
|
|
19194
19279
|
[fo]: e,
|
|
@@ -19205,10 +19290,10 @@ var Tg = () => {
|
|
|
19205
19290
|
};
|
|
19206
19291
|
};
|
|
19207
19292
|
};
|
|
19208
|
-
new
|
|
19293
|
+
new r_();
|
|
19209
19294
|
//#endregion
|
|
19210
19295
|
//#region src/providers/auth/firebase/FirebaseAuthProvider.ts
|
|
19211
|
-
var
|
|
19296
|
+
var i_ = {
|
|
19212
19297
|
github: "github.com",
|
|
19213
19298
|
apple: "apple.com",
|
|
19214
19299
|
microsoft: "microsoft.com",
|
|
@@ -19216,11 +19301,11 @@ var n_ = {
|
|
|
19216
19301
|
twitter: "twitter.com",
|
|
19217
19302
|
facebook: "facebook.com"
|
|
19218
19303
|
};
|
|
19219
|
-
function
|
|
19220
|
-
let t =
|
|
19304
|
+
function a_(e) {
|
|
19305
|
+
let t = i_[e] ?? e;
|
|
19221
19306
|
return new G(t);
|
|
19222
19307
|
}
|
|
19223
|
-
function
|
|
19308
|
+
function o_(e) {
|
|
19224
19309
|
return e ? {
|
|
19225
19310
|
uid: e.uid,
|
|
19226
19311
|
email: e.email ?? void 0,
|
|
@@ -19229,7 +19314,7 @@ function i_(e) {
|
|
|
19229
19314
|
isAnonymous: e.isAnonymous
|
|
19230
19315
|
} : null;
|
|
19231
19316
|
}
|
|
19232
|
-
var
|
|
19317
|
+
var s_ = class {
|
|
19233
19318
|
options;
|
|
19234
19319
|
appName;
|
|
19235
19320
|
initPromise;
|
|
@@ -19243,7 +19328,7 @@ var a_ = class {
|
|
|
19243
19328
|
return this.getConfigurationState().configured;
|
|
19244
19329
|
}
|
|
19245
19330
|
getUser() {
|
|
19246
|
-
return
|
|
19331
|
+
return o_(so(this.appName)?.currentUser ?? null);
|
|
19247
19332
|
}
|
|
19248
19333
|
isAuthenticated() {
|
|
19249
19334
|
return !!this.getUser();
|
|
@@ -19255,18 +19340,18 @@ var a_ = class {
|
|
|
19255
19340
|
let n = e.method ?? "password";
|
|
19256
19341
|
if (n === "anonymous") {
|
|
19257
19342
|
let { user: e } = await ue(t);
|
|
19258
|
-
return
|
|
19343
|
+
return o_(e);
|
|
19259
19344
|
}
|
|
19260
19345
|
if (n === "oauth") {
|
|
19261
19346
|
let { provider: n } = e;
|
|
19262
19347
|
if (!n) throw Error("FirebaseAuthProvider.signIn: provider is required for oauth");
|
|
19263
|
-
let { user: r } = await me(t,
|
|
19264
|
-
return
|
|
19348
|
+
let { user: r } = await me(t, a_(n));
|
|
19349
|
+
return o_(r);
|
|
19265
19350
|
}
|
|
19266
19351
|
let { email: r, password: i } = e;
|
|
19267
19352
|
if (!r || !i) throw Error("FirebaseAuthProvider.signIn: email and password are required");
|
|
19268
19353
|
let { user: a } = await pe(t, r, i);
|
|
19269
|
-
return
|
|
19354
|
+
return o_(a);
|
|
19270
19355
|
}
|
|
19271
19356
|
async signOut() {
|
|
19272
19357
|
await this.initPromise;
|
|
@@ -19277,7 +19362,7 @@ var a_ = class {
|
|
|
19277
19362
|
onAuthChange(e) {
|
|
19278
19363
|
if (!this.options.config) {
|
|
19279
19364
|
let t = so(this.appName);
|
|
19280
|
-
return t ? se(t, (t) => e(
|
|
19365
|
+
return t ? se(t, (t) => e(o_(t))) : (e(null), () => {});
|
|
19281
19366
|
}
|
|
19282
19367
|
let t = () => {}, n = !1;
|
|
19283
19368
|
return this.initPromise.then(() => {
|
|
@@ -19287,7 +19372,7 @@ var a_ = class {
|
|
|
19287
19372
|
e(null);
|
|
19288
19373
|
return;
|
|
19289
19374
|
}
|
|
19290
|
-
t = se(r, (t) => e(
|
|
19375
|
+
t = se(r, (t) => e(o_(t)));
|
|
19291
19376
|
}), () => {
|
|
19292
19377
|
n = !0, t();
|
|
19293
19378
|
};
|
|
@@ -19305,26 +19390,26 @@ var a_ = class {
|
|
|
19305
19390
|
let { claims: n } = await t.currentUser.getIdTokenResult(e);
|
|
19306
19391
|
return n;
|
|
19307
19392
|
}
|
|
19308
|
-
},
|
|
19309
|
-
function
|
|
19393
|
+
}, c_ = "https://oauth2.googleapis.com/token";
|
|
19394
|
+
function l_(e) {
|
|
19310
19395
|
let t = e.replace(/-----BEGIN PRIVATE KEY-----/, "").replace(/-----END PRIVATE KEY-----/, "").replace(/\s+/g, ""), n = atob(t), r = new Uint8Array(n.length);
|
|
19311
19396
|
for (let e = 0; e < n.length; e++) r[e] = n.charCodeAt(e);
|
|
19312
19397
|
return r.buffer;
|
|
19313
19398
|
}
|
|
19314
|
-
function
|
|
19399
|
+
function u_(e) {
|
|
19315
19400
|
return btoa(typeof e == "string" ? e : String.fromCharCode(...new Uint8Array(e))).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
19316
19401
|
}
|
|
19317
|
-
async function
|
|
19318
|
-
let n = `${
|
|
19402
|
+
async function d_(e, t) {
|
|
19403
|
+
let n = `${u_(JSON.stringify({
|
|
19319
19404
|
alg: "RS256",
|
|
19320
19405
|
typ: "JWT"
|
|
19321
|
-
}))}.${
|
|
19406
|
+
}))}.${u_(JSON.stringify(e))}`, r = await crypto.subtle.importKey("pkcs8", l_(t), {
|
|
19322
19407
|
name: "RSASSA-PKCS1-v1_5",
|
|
19323
19408
|
hash: "SHA-256"
|
|
19324
19409
|
}, !1, ["sign"]);
|
|
19325
|
-
return `${n}.${
|
|
19410
|
+
return `${n}.${u_(await crypto.subtle.sign("RSASSA-PKCS1-v1_5", r, new TextEncoder().encode(n)))}`;
|
|
19326
19411
|
}
|
|
19327
|
-
var
|
|
19412
|
+
var f_ = class {
|
|
19328
19413
|
config;
|
|
19329
19414
|
cache = /* @__PURE__ */ new Map();
|
|
19330
19415
|
constructor(e) {
|
|
@@ -19333,13 +19418,13 @@ var u_ = class {
|
|
|
19333
19418
|
async getToken(e = "https://www.googleapis.com/auth/cloud-platform") {
|
|
19334
19419
|
let t = this.cache.get(e);
|
|
19335
19420
|
if (t && t.expiresAt > Date.now() + 6e4) return t.token;
|
|
19336
|
-
let n = Math.floor(Date.now() / 1e3), r = await
|
|
19421
|
+
let n = Math.floor(Date.now() / 1e3), r = await d_({
|
|
19337
19422
|
iss: this.config.client_email,
|
|
19338
19423
|
scope: e,
|
|
19339
|
-
aud:
|
|
19424
|
+
aud: c_,
|
|
19340
19425
|
iat: n,
|
|
19341
19426
|
exp: n + 3600
|
|
19342
|
-
}, this.config.private_key), i = await fetch(
|
|
19427
|
+
}, this.config.private_key), i = await fetch(c_, {
|
|
19343
19428
|
method: "POST",
|
|
19344
19429
|
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
19345
19430
|
body: new URLSearchParams({
|
|
@@ -19357,7 +19442,7 @@ var u_ = class {
|
|
|
19357
19442
|
expiresAt: Date.now() + (a.expires_in ?? 3600) * 1e3
|
|
19358
19443
|
}), a.access_token;
|
|
19359
19444
|
}
|
|
19360
|
-
},
|
|
19445
|
+
}, p_ = "www.dropbox.com/oauth2", m_ = class {
|
|
19361
19446
|
config;
|
|
19362
19447
|
constructor(e) {
|
|
19363
19448
|
this.config = e;
|
|
@@ -19381,7 +19466,7 @@ var u_ = class {
|
|
|
19381
19466
|
async signIn(e = {}) {
|
|
19382
19467
|
if (!this.isConfigured()) throw Error("DropboxAuthProvider: missing dropbox.clientId configuration.");
|
|
19383
19468
|
return Oi({
|
|
19384
|
-
authServer:
|
|
19469
|
+
authServer: p_,
|
|
19385
19470
|
clientID: this.config.clientId,
|
|
19386
19471
|
scopes: e.scopes,
|
|
19387
19472
|
refreshParamName: "token_access_type"
|
|
@@ -19402,14 +19487,14 @@ var u_ = class {
|
|
|
19402
19487
|
isAuthenticated() {
|
|
19403
19488
|
return this.isConfigured() ? !!Ni(this.config.clientId)?.access_token : !1;
|
|
19404
19489
|
}
|
|
19405
|
-
},
|
|
19490
|
+
}, h_ = (e) => ({
|
|
19406
19491
|
uid: e.login,
|
|
19407
19492
|
displayName: e.name || e.login,
|
|
19408
19493
|
...e.email ? { email: e.email } : {},
|
|
19409
19494
|
...e.avatarUrl ? { photoURL: e.avatarUrl } : {},
|
|
19410
19495
|
provider: "github",
|
|
19411
19496
|
login: e.login
|
|
19412
|
-
}),
|
|
19497
|
+
}), g_ = class {
|
|
19413
19498
|
config;
|
|
19414
19499
|
user = null;
|
|
19415
19500
|
listeners = /* @__PURE__ */ new Set();
|
|
@@ -19436,7 +19521,7 @@ var u_ = class {
|
|
|
19436
19521
|
return this.loading ??= fetch(`${this.base}/me`, {
|
|
19437
19522
|
credentials: "include",
|
|
19438
19523
|
headers: { Accept: "application/json" }
|
|
19439
|
-
}).then(async (e) => e.ok ?
|
|
19524
|
+
}).then(async (e) => e.ok ? h_(await e.json()) : null).catch(() => null).then((e) => (this.setUser(e), e)).finally(() => {
|
|
19440
19525
|
this.loading = null;
|
|
19441
19526
|
}), this.loading;
|
|
19442
19527
|
}
|
|
@@ -19460,7 +19545,7 @@ var u_ = class {
|
|
|
19460
19545
|
let t = (e?.uid ?? null) !== (this.user?.uid ?? null);
|
|
19461
19546
|
this.user = e, t && this.listeners.forEach((t) => t(e));
|
|
19462
19547
|
}
|
|
19463
|
-
},
|
|
19548
|
+
}, __ = (e) => {
|
|
19464
19549
|
let t = eo("oAuth2");
|
|
19465
19550
|
if (!t) return console.warn("GoogleAuth: Missing oAuth2.clientId in configuration"), Promise.reject("Google client ID not found");
|
|
19466
19551
|
let n = e.join(" "), r = `googleAccessToken::${n}`, i = `googleExpiresAt::${n}`;
|
|
@@ -19477,8 +19562,8 @@ var u_ = class {
|
|
|
19477
19562
|
};
|
|
19478
19563
|
//#endregion
|
|
19479
19564
|
//#region src/providers/email/google/email.ts
|
|
19480
|
-
async function
|
|
19481
|
-
let i = await
|
|
19565
|
+
async function v_({ to: e, bcc: t, subject: n, message: r }) {
|
|
19566
|
+
let i = await __(["https://www.googleapis.com/auth/gmail.send"]), a = [`To: ${e.join(", ")}`];
|
|
19482
19567
|
t && t.length && a.push(`Bcc: ${t.join(", ")}`);
|
|
19483
19568
|
let o = [
|
|
19484
19569
|
...a,
|
|
@@ -19503,7 +19588,7 @@ async function g_({ to: e, bcc: t, subject: n, message: r }) {
|
|
|
19503
19588
|
}
|
|
19504
19589
|
//#endregion
|
|
19505
19590
|
//#region src/providers/email/google/GmailEmailProvider.ts
|
|
19506
|
-
var
|
|
19591
|
+
var y_ = class {
|
|
19507
19592
|
getConfigurationState() {
|
|
19508
19593
|
return xi("GmailEmailProvider", bi(eo("oAuth2"), ["clientId"], "google.oAuth2."));
|
|
19509
19594
|
}
|
|
@@ -19512,7 +19597,7 @@ var __ = class {
|
|
|
19512
19597
|
}
|
|
19513
19598
|
async send(e) {
|
|
19514
19599
|
if (!this.isConfigured()) throw Error(this.getConfigurationState().reason || "GmailEmailProvider is not configured.");
|
|
19515
|
-
await
|
|
19600
|
+
await v_({
|
|
19516
19601
|
to: Array.isArray(e.to) ? e.to : [e.to],
|
|
19517
19602
|
bcc: e.bcc ? Array.isArray(e.bcc) ? e.bcc : [e.bcc] : void 0,
|
|
19518
19603
|
subject: e.subject,
|
|
@@ -19522,7 +19607,7 @@ var __ = class {
|
|
|
19522
19607
|
};
|
|
19523
19608
|
//#endregion
|
|
19524
19609
|
//#region src/providers/auth/supabase/SupabaseAuthProvider.ts
|
|
19525
|
-
function
|
|
19610
|
+
function b_(e) {
|
|
19526
19611
|
return e ? {
|
|
19527
19612
|
uid: e.id,
|
|
19528
19613
|
email: e.email ?? void 0,
|
|
@@ -19531,7 +19616,7 @@ function v_(e) {
|
|
|
19531
19616
|
raw: e
|
|
19532
19617
|
} : null;
|
|
19533
19618
|
}
|
|
19534
|
-
var
|
|
19619
|
+
var x_ = class {
|
|
19535
19620
|
config;
|
|
19536
19621
|
get client() {
|
|
19537
19622
|
return wo(this.config.url, this.config.anonKey);
|
|
@@ -19546,7 +19631,7 @@ var y_ = class {
|
|
|
19546
19631
|
return this.getConfigurationState().configured;
|
|
19547
19632
|
}
|
|
19548
19633
|
getUser() {
|
|
19549
|
-
return
|
|
19634
|
+
return b_((this.client.auth?._session ?? null)?.user ?? null);
|
|
19550
19635
|
}
|
|
19551
19636
|
isAuthenticated() {
|
|
19552
19637
|
return !!this.getUser();
|
|
@@ -19556,7 +19641,7 @@ var y_ = class {
|
|
|
19556
19641
|
if (t === "anonymous") {
|
|
19557
19642
|
let { data: e, error: t } = await this.client.auth.signInAnonymously();
|
|
19558
19643
|
if (t) throw t;
|
|
19559
|
-
return
|
|
19644
|
+
return b_(e.user);
|
|
19560
19645
|
}
|
|
19561
19646
|
if (t === "magic_link") {
|
|
19562
19647
|
let t = e.email;
|
|
@@ -19585,7 +19670,7 @@ var y_ = class {
|
|
|
19585
19670
|
password: r
|
|
19586
19671
|
});
|
|
19587
19672
|
if (a) throw a;
|
|
19588
|
-
return
|
|
19673
|
+
return b_(i.user);
|
|
19589
19674
|
}
|
|
19590
19675
|
async signOut() {
|
|
19591
19676
|
let { error: e } = await this.client.auth.signOut();
|
|
@@ -19593,10 +19678,10 @@ var y_ = class {
|
|
|
19593
19678
|
}
|
|
19594
19679
|
onAuthChange(e) {
|
|
19595
19680
|
this.client.auth.getSession().then(({ data: t }) => {
|
|
19596
|
-
e(
|
|
19681
|
+
e(b_(t.session?.user ?? null));
|
|
19597
19682
|
});
|
|
19598
19683
|
let { data: { subscription: t } } = this.client.auth.onAuthStateChange((t, n) => {
|
|
19599
|
-
e(
|
|
19684
|
+
e(b_(n?.user ?? null));
|
|
19600
19685
|
});
|
|
19601
19686
|
return () => t.unsubscribe();
|
|
19602
19687
|
}
|
|
@@ -19607,15 +19692,15 @@ var y_ = class {
|
|
|
19607
19692
|
if (!n) throw Error("SupabaseAuthProvider: no active session");
|
|
19608
19693
|
return n;
|
|
19609
19694
|
}
|
|
19610
|
-
},
|
|
19611
|
-
function
|
|
19695
|
+
}, S_ = "https://api.anthropic.com/v1/models", C_ = "https://api.anthropic.com/v1/messages";
|
|
19696
|
+
function w_(e) {
|
|
19612
19697
|
return {
|
|
19613
19698
|
name: e.name,
|
|
19614
19699
|
description: e.description,
|
|
19615
19700
|
input_schema: e.inputSchema
|
|
19616
19701
|
};
|
|
19617
19702
|
}
|
|
19618
|
-
function
|
|
19703
|
+
function T_(e) {
|
|
19619
19704
|
if (e.role === "user") return {
|
|
19620
19705
|
role: "user",
|
|
19621
19706
|
content: e.content
|
|
@@ -19647,7 +19732,7 @@ function C_(e) {
|
|
|
19647
19732
|
}))
|
|
19648
19733
|
};
|
|
19649
19734
|
}
|
|
19650
|
-
function
|
|
19735
|
+
function E_(e) {
|
|
19651
19736
|
let t = e?.content;
|
|
19652
19737
|
if (!Array.isArray(t)) return null;
|
|
19653
19738
|
let n = t.filter((e) => e?.type === "text").map((e) => String(e.text ?? "")), r = t.filter((e) => e?.type === "tool_use");
|
|
@@ -19666,7 +19751,7 @@ function w_(e) {
|
|
|
19666
19751
|
text: i
|
|
19667
19752
|
} : null;
|
|
19668
19753
|
}
|
|
19669
|
-
var
|
|
19754
|
+
var D_ = {
|
|
19670
19755
|
id: "anthropic",
|
|
19671
19756
|
label: "Anthropic",
|
|
19672
19757
|
description: "Claude models via the Anthropic API.",
|
|
@@ -19690,7 +19775,7 @@ var T_ = {
|
|
|
19690
19775
|
supportsDocuments: !0
|
|
19691
19776
|
},
|
|
19692
19777
|
discoverModels: async (e) => {
|
|
19693
|
-
let t = await nn(
|
|
19778
|
+
let t = await nn(S_, { headers: {
|
|
19694
19779
|
"x-api-key": e,
|
|
19695
19780
|
"anthropic-version": "2023-06-01"
|
|
19696
19781
|
} }, Fu);
|
|
@@ -19718,7 +19803,7 @@ var T_ = {
|
|
|
19718
19803
|
type: "text",
|
|
19719
19804
|
text: t.prompt
|
|
19720
19805
|
}] : t.prompt;
|
|
19721
|
-
return
|
|
19806
|
+
return E_(await nn(C_, {
|
|
19722
19807
|
method: "POST",
|
|
19723
19808
|
headers: {
|
|
19724
19809
|
"x-api-key": e,
|
|
@@ -19729,18 +19814,18 @@ var T_ = {
|
|
|
19729
19814
|
model: t.model,
|
|
19730
19815
|
max_tokens: 4096,
|
|
19731
19816
|
...t.role ? { system: xu.parseRole(t.role, t) } : {},
|
|
19732
|
-
messages: [...(t.history ?? []).map(
|
|
19817
|
+
messages: [...(t.history ?? []).map(T_), ...t.prompt ? [{
|
|
19733
19818
|
role: "user",
|
|
19734
19819
|
content: r
|
|
19735
19820
|
}] : []],
|
|
19736
|
-
...t.tools?.length ? { tools: t.tools.map(
|
|
19821
|
+
...t.tools?.length ? { tools: t.tools.map(w_) } : {},
|
|
19737
19822
|
...typeof t.temperature == "number" ? { temperature: t.temperature } : {}
|
|
19738
19823
|
},
|
|
19739
19824
|
signal: t.signal
|
|
19740
19825
|
}, Fu));
|
|
19741
19826
|
}
|
|
19742
|
-
},
|
|
19743
|
-
function
|
|
19827
|
+
}, O_ = (e) => typeof e.id == "string" ? e.id : void 0, k_ = (e) => e.replace(/\/+$/, "");
|
|
19828
|
+
function A_(e) {
|
|
19744
19829
|
return {
|
|
19745
19830
|
type: "function",
|
|
19746
19831
|
function: {
|
|
@@ -19750,7 +19835,7 @@ function O_(e) {
|
|
|
19750
19835
|
}
|
|
19751
19836
|
};
|
|
19752
19837
|
}
|
|
19753
|
-
function
|
|
19838
|
+
function j_(e) {
|
|
19754
19839
|
if (typeof e != "string") return {};
|
|
19755
19840
|
try {
|
|
19756
19841
|
return JSON.parse(e);
|
|
@@ -19758,7 +19843,7 @@ function k_(e) {
|
|
|
19758
19843
|
return {};
|
|
19759
19844
|
}
|
|
19760
19845
|
}
|
|
19761
|
-
function
|
|
19846
|
+
function M_(e) {
|
|
19762
19847
|
return e.role === "user" ? [{
|
|
19763
19848
|
role: "user",
|
|
19764
19849
|
content: e.content
|
|
@@ -19779,7 +19864,7 @@ function A_(e) {
|
|
|
19779
19864
|
content: typeof e.output == "string" ? e.output : JSON.stringify(e.output)
|
|
19780
19865
|
}));
|
|
19781
19866
|
}
|
|
19782
|
-
function
|
|
19867
|
+
function N_(e) {
|
|
19783
19868
|
let t = e?.choices?.[0]?.message;
|
|
19784
19869
|
if (!t) return null;
|
|
19785
19870
|
let n = Array.isArray(t.tool_calls) ? t.tool_calls : [];
|
|
@@ -19792,7 +19877,7 @@ function j_(e) {
|
|
|
19792
19877
|
return {
|
|
19793
19878
|
id: String(e.id),
|
|
19794
19879
|
name: String(t.name ?? ""),
|
|
19795
|
-
input:
|
|
19880
|
+
input: j_(t.arguments)
|
|
19796
19881
|
};
|
|
19797
19882
|
}),
|
|
19798
19883
|
text: e || void 0
|
|
@@ -19804,8 +19889,8 @@ function j_(e) {
|
|
|
19804
19889
|
text: r
|
|
19805
19890
|
} : null;
|
|
19806
19891
|
}
|
|
19807
|
-
var
|
|
19808
|
-
let h =
|
|
19892
|
+
var P_ = ({ 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 = O_ }) => {
|
|
19893
|
+
let h = k_(s), g = c || `${h}/models`, _ = l || `${h}/chat/completions`;
|
|
19809
19894
|
return {
|
|
19810
19895
|
id: e,
|
|
19811
19896
|
label: t,
|
|
@@ -19882,22 +19967,22 @@ var M_ = ({ id: e, label: t, description: n, configKey: r, requiredConfigKeys: i
|
|
|
19882
19967
|
role: "system",
|
|
19883
19968
|
content: xu.parseRole(n.role, n)
|
|
19884
19969
|
}] : [],
|
|
19885
|
-
...(n.history ?? []).flatMap(
|
|
19970
|
+
...(n.history ?? []).flatMap(M_),
|
|
19886
19971
|
...n.prompt ? [{
|
|
19887
19972
|
role: "user",
|
|
19888
19973
|
content: i
|
|
19889
19974
|
}] : []
|
|
19890
19975
|
],
|
|
19891
|
-
...n.tools?.length ? { tools: n.tools.map(
|
|
19976
|
+
...n.tools?.length ? { tools: n.tools.map(A_) } : {},
|
|
19892
19977
|
...typeof n.temperature == "number" ? { temperature: n.temperature } : {}
|
|
19893
19978
|
},
|
|
19894
19979
|
signal: n.signal
|
|
19895
19980
|
}, Fu);
|
|
19896
19981
|
if (!a) throw Vu(t);
|
|
19897
|
-
return
|
|
19982
|
+
return N_(a);
|
|
19898
19983
|
}
|
|
19899
19984
|
};
|
|
19900
|
-
},
|
|
19985
|
+
}, F_ = "https://api.cloudflare.com/client/v4", I_ = 100, L_ = 5, R_ = /-guard-/, z_ = "Cloudflare Workers AI", B_ = "Open-weight models (Llama, GPT-OSS, Qwen, Gemma, GLM…) with a free daily allowance.", V_ = "https://dash.cloudflare.com/?to=/:account/ai/workers-ai", H_ = "Cloudflare dashboard → AI → Workers AI → REST API: create a Workers AI API token and copy the Account ID.", U_ = [{
|
|
19901
19986
|
key: "apiKey",
|
|
19902
19987
|
label: "API Token",
|
|
19903
19988
|
type: "password"
|
|
@@ -19906,7 +19991,7 @@ var M_ = ({ id: e, label: t, description: n, configKey: r, requiredConfigKeys: i
|
|
|
19906
19991
|
label: "Account ID",
|
|
19907
19992
|
type: "text",
|
|
19908
19993
|
placeholder: "32-character account id"
|
|
19909
|
-
}],
|
|
19994
|
+
}], W_ = (e, t) => (e.properties ?? []).some((e) => e.property_id === t && String(e.value) === "true"), G_ = (e) => {
|
|
19910
19995
|
let t = (e.properties ?? []).find((e) => e.property_id === "price")?.value;
|
|
19911
19996
|
if (!Array.isArray(t)) return;
|
|
19912
19997
|
let n = (e) => {
|
|
@@ -19919,11 +20004,11 @@ var M_ = ({ id: e, label: t, description: n, configKey: r, requiredConfigKeys: i
|
|
|
19919
20004
|
currency: "USD",
|
|
19920
20005
|
source: "provider"
|
|
19921
20006
|
};
|
|
19922
|
-
},
|
|
20007
|
+
}, K_ = (e) => e?.map((e) => e.role === "assistant" && !e.content ? {
|
|
19923
20008
|
...e,
|
|
19924
20009
|
content: ""
|
|
19925
|
-
} : e),
|
|
19926
|
-
let r = `${
|
|
20010
|
+
} : e), q_ = ({ accountId: e, defaultModel: t = "@cf/meta/llama-3.3-70b-instruct-fp8-fast", includePaidModels: n = !1 }) => {
|
|
20011
|
+
let r = `${F_}/accounts/${encodeURIComponent(e.trim())}`, i = `${r}/ai/models/search`, a = (e, t, n) => {
|
|
19927
20012
|
let r = new URLSearchParams({
|
|
19928
20013
|
task: "Text Generation",
|
|
19929
20014
|
hide_experimental: "true",
|
|
@@ -19931,10 +20016,10 @@ var M_ = ({ id: e, label: t, description: n, configKey: r, requiredConfigKeys: i
|
|
|
19931
20016
|
per_page: String(n)
|
|
19932
20017
|
});
|
|
19933
20018
|
return nn(`${i}?${r}`, { headers: { Authorization: `Bearer ${e}` } }, Fu);
|
|
19934
|
-
}, o =
|
|
20019
|
+
}, o = P_({
|
|
19935
20020
|
id: "cloudflare",
|
|
19936
|
-
label:
|
|
19937
|
-
description:
|
|
20021
|
+
label: z_,
|
|
20022
|
+
description: B_,
|
|
19938
20023
|
configKey: "cloudflare",
|
|
19939
20024
|
requiredConfigKeys: ["ai.cloudflare.apiToken", "ai.cloudflare.accountId"],
|
|
19940
20025
|
defaultModel: t,
|
|
@@ -19945,8 +20030,8 @@ var M_ = ({ id: e, label: t, description: n, configKey: r, requiredConfigKeys: i
|
|
|
19945
20030
|
"@cf/meta/llama-4-scout-17b-16e-instruct"
|
|
19946
20031
|
].filter((e, t, n) => n.indexOf(e) === t),
|
|
19947
20032
|
baseUrl: `${r}/ai/v1`,
|
|
19948
|
-
dashboardUrl:
|
|
19949
|
-
credentialsHint:
|
|
20033
|
+
dashboardUrl: V_,
|
|
20034
|
+
credentialsHint: H_,
|
|
19950
20035
|
validateApiKey: async (e) => {
|
|
19951
20036
|
try {
|
|
19952
20037
|
let t = await a(e, 1, 1);
|
|
@@ -19967,33 +20052,33 @@ var M_ = ({ id: e, label: t, description: n, configKey: r, requiredConfigKeys: i
|
|
|
19967
20052
|
});
|
|
19968
20053
|
return {
|
|
19969
20054
|
...o,
|
|
19970
|
-
credentialFields:
|
|
20055
|
+
credentialFields: U_,
|
|
19971
20056
|
discoverModels: async (e) => {
|
|
19972
20057
|
let t = [];
|
|
19973
|
-
for (let r = 1; r <=
|
|
19974
|
-
let i = await a(e, r,
|
|
19975
|
-
if (o.filter((e) => !
|
|
20058
|
+
for (let r = 1; r <= L_; r++) {
|
|
20059
|
+
let i = await a(e, r, I_), o = Array.isArray(i?.result) ? i.result : [];
|
|
20060
|
+
if (o.filter((e) => !R_.test(e.name ?? "")).filter((e) => n || !W_(e, "require_workers_paid")).forEach((e) => {
|
|
19976
20061
|
e.name && t.push({
|
|
19977
20062
|
model: e.name,
|
|
19978
|
-
pricing:
|
|
20063
|
+
pricing: G_(e)
|
|
19979
20064
|
});
|
|
19980
|
-
}), o.length <
|
|
20065
|
+
}), o.length < I_) break;
|
|
19981
20066
|
}
|
|
19982
20067
|
return t;
|
|
19983
20068
|
},
|
|
19984
20069
|
complete: (e, t) => o.complete(e, {
|
|
19985
20070
|
...t,
|
|
19986
|
-
history:
|
|
20071
|
+
history: K_(t.history)
|
|
19987
20072
|
})
|
|
19988
20073
|
};
|
|
19989
|
-
},
|
|
20074
|
+
}, J_ = {
|
|
19990
20075
|
id: "cloudflare",
|
|
19991
|
-
label:
|
|
19992
|
-
description:
|
|
19993
|
-
credentialFields:
|
|
19994
|
-
credentialsUrl:
|
|
19995
|
-
credentialsHint:
|
|
19996
|
-
},
|
|
20076
|
+
label: z_,
|
|
20077
|
+
description: B_,
|
|
20078
|
+
credentialFields: U_,
|
|
20079
|
+
credentialsUrl: V_,
|
|
20080
|
+
credentialsHint: H_
|
|
20081
|
+
}, Y_ = P_({
|
|
19997
20082
|
id: "deepseek",
|
|
19998
20083
|
label: "DeepSeek",
|
|
19999
20084
|
description: "Cost-efficient reasoning and chat models.",
|
|
@@ -20003,15 +20088,15 @@ var M_ = ({ id: e, label: t, description: n, configKey: r, requiredConfigKeys: i
|
|
|
20003
20088
|
baseUrl: "https://api.deepseek.com",
|
|
20004
20089
|
dashboardUrl: "https://platform.deepseek.com/api_keys",
|
|
20005
20090
|
credentialsHint: "DeepSeek platform → API Keys → Create new API key."
|
|
20006
|
-
}),
|
|
20007
|
-
function
|
|
20091
|
+
}), X_ = "https://generativelanguage.googleapis.com/v1beta/models", Z_ = "https://generativelanguage.googleapis.com/v1beta/models";
|
|
20092
|
+
function Q_(e) {
|
|
20008
20093
|
return [{ function_declarations: e.map((e) => ({
|
|
20009
20094
|
name: e.name,
|
|
20010
20095
|
description: e.description,
|
|
20011
20096
|
parameters: e.inputSchema
|
|
20012
20097
|
})) }];
|
|
20013
20098
|
}
|
|
20014
|
-
function
|
|
20099
|
+
function $_(e) {
|
|
20015
20100
|
if (e.role === "user") return {
|
|
20016
20101
|
role: "user",
|
|
20017
20102
|
parts: [{ text: e.content }]
|
|
@@ -20036,7 +20121,7 @@ function Z_(e) {
|
|
|
20036
20121
|
} }))
|
|
20037
20122
|
};
|
|
20038
20123
|
}
|
|
20039
|
-
function
|
|
20124
|
+
function ev(e) {
|
|
20040
20125
|
let t = e?.candidates?.[0]?.content?.parts;
|
|
20041
20126
|
if (!Array.isArray(t)) return null;
|
|
20042
20127
|
let n = t.filter((e) => typeof e?.text == "string").map((e) => e.text), r = t.filter((e) => e?.functionCall);
|
|
@@ -20055,7 +20140,7 @@ function Q_(e) {
|
|
|
20055
20140
|
text: i
|
|
20056
20141
|
} : null;
|
|
20057
20142
|
}
|
|
20058
|
-
var
|
|
20143
|
+
var tv = {
|
|
20059
20144
|
id: "gemini",
|
|
20060
20145
|
label: "Gemini",
|
|
20061
20146
|
description: "Google's multimodal Gemini model family.",
|
|
@@ -20079,12 +20164,12 @@ var $_ = {
|
|
|
20079
20164
|
supportsDocuments: !0
|
|
20080
20165
|
},
|
|
20081
20166
|
discoverModels: async (e) => {
|
|
20082
|
-
let t = await nn(`${
|
|
20167
|
+
let t = await nn(`${X_}?key=${e}`, null, Fu);
|
|
20083
20168
|
return Array.isArray(t?.models) ? t.models.map((e) => e.name?.replace(/^models\//, "")).filter(Boolean) : [];
|
|
20084
20169
|
},
|
|
20085
20170
|
validateApiKey: async (e) => {
|
|
20086
20171
|
try {
|
|
20087
|
-
let t = await nn(`${
|
|
20172
|
+
let t = await nn(`${X_}?key=${e}`, null, Fu);
|
|
20088
20173
|
return t === null ? {
|
|
20089
20174
|
valid: !1,
|
|
20090
20175
|
error: "Nessuna risposta dal server (CORS o rete)"
|
|
@@ -20105,22 +20190,22 @@ var $_ = {
|
|
|
20105
20190
|
mime_type: e.mimeType,
|
|
20106
20191
|
data: e.base64
|
|
20107
20192
|
} }), { text: t.prompt }];
|
|
20108
|
-
return
|
|
20193
|
+
return ev(await nn(`${Z_}/${t.model}:generateContent?key=${e}`, {
|
|
20109
20194
|
method: "POST",
|
|
20110
20195
|
headers: t.logId ? { [d]: t.logId } : void 0,
|
|
20111
20196
|
body: {
|
|
20112
|
-
contents: [...(t.history ?? []).map(
|
|
20197
|
+
contents: [...(t.history ?? []).map($_), ...t.prompt ? [{
|
|
20113
20198
|
role: "user",
|
|
20114
20199
|
parts: n
|
|
20115
20200
|
}] : []],
|
|
20116
20201
|
...t.role ? { systemInstruction: { parts: [{ text: xu.parseRole(t.role, t) }] } } : {},
|
|
20117
|
-
...t.tools?.length ? { tools:
|
|
20202
|
+
...t.tools?.length ? { tools: Q_(t.tools) } : {},
|
|
20118
20203
|
generationConfig: typeof t.temperature == "number" ? { temperature: t.temperature } : void 0
|
|
20119
20204
|
},
|
|
20120
20205
|
signal: t.signal
|
|
20121
20206
|
}, Fu));
|
|
20122
20207
|
}
|
|
20123
|
-
},
|
|
20208
|
+
}, nv = P_({
|
|
20124
20209
|
id: "mistral",
|
|
20125
20210
|
label: "Mistral",
|
|
20126
20211
|
description: "European-hosted open and commercial language models.",
|
|
@@ -20134,7 +20219,7 @@ var $_ = {
|
|
|
20134
20219
|
baseUrl: "https://api.mistral.ai/v1",
|
|
20135
20220
|
dashboardUrl: "https://console.mistral.ai/api-keys",
|
|
20136
20221
|
credentialsHint: "Mistral Console → API Keys → Create new key."
|
|
20137
|
-
}),
|
|
20222
|
+
}), rv = /whisper|orpheus|tts|guard/i, iv = P_({
|
|
20138
20223
|
id: "groq",
|
|
20139
20224
|
label: "Groq",
|
|
20140
20225
|
description: "Very fast inference on open-weight models, with a free tier.",
|
|
@@ -20144,8 +20229,8 @@ var $_ = {
|
|
|
20144
20229
|
baseUrl: "https://api.groq.com/openai/v1",
|
|
20145
20230
|
dashboardUrl: "https://console.groq.com/keys",
|
|
20146
20231
|
credentialsHint: "Groq Console → API Keys → Create API Key.",
|
|
20147
|
-
mapModelEntry: (e) => typeof e.id == "string" && e.active !== !1 && !
|
|
20148
|
-
}),
|
|
20232
|
+
mapModelEntry: (e) => typeof e.id == "string" && e.active !== !1 && !rv.test(e.id) ? e.id : void 0
|
|
20233
|
+
}), av = P_({
|
|
20149
20234
|
id: "openai",
|
|
20150
20235
|
label: "OpenAI",
|
|
20151
20236
|
description: "GPT models via the OpenAI API.",
|
|
@@ -20163,8 +20248,8 @@ var $_ = {
|
|
|
20163
20248
|
baseUrl: "https://api.openai.com/v1",
|
|
20164
20249
|
dashboardUrl: "https://platform.openai.com/api-keys",
|
|
20165
20250
|
credentialsHint: "OpenAI dashboard → API keys → Create new secret key."
|
|
20166
|
-
}),
|
|
20167
|
-
|
|
20251
|
+
}), ov = "https://opencode.ai/zen/v1/models", sv = "https://opencode.ai/zen/v1/chat/completions", cv = "deepseek-v4.1-flash", lv = [
|
|
20252
|
+
cv,
|
|
20168
20253
|
"deepseek-v4-pro",
|
|
20169
20254
|
"glm-5.3",
|
|
20170
20255
|
"glm-5.3-flash",
|
|
@@ -20172,13 +20257,13 @@ var $_ = {
|
|
|
20172
20257
|
"kimi-k3",
|
|
20173
20258
|
"minimax-m3",
|
|
20174
20259
|
"qwen3.8-flash"
|
|
20175
|
-
],
|
|
20260
|
+
], uv = /-free$/, dv = /* @__PURE__ */ new Set(["big-pickle"]), fv = (e) => uv.test(e) || dv.has(e), pv = {
|
|
20176
20261
|
id: "opencode",
|
|
20177
20262
|
label: "OpenCode",
|
|
20178
20263
|
description: "OpenCode Zen — a curated set of coding-focused models.",
|
|
20179
20264
|
configKey: "openCodeApiKey",
|
|
20180
|
-
defaultModel:
|
|
20181
|
-
fallbackModels:
|
|
20265
|
+
defaultModel: cv,
|
|
20266
|
+
fallbackModels: lv,
|
|
20182
20267
|
dashboardUrl: "https://opencode.ai",
|
|
20183
20268
|
credentialsHint: "OpenCode Zen dashboard → API Keys → Create Key.",
|
|
20184
20269
|
credentialFields: [{
|
|
@@ -20192,12 +20277,12 @@ var $_ = {
|
|
|
20192
20277
|
supportsDocuments: !0
|
|
20193
20278
|
},
|
|
20194
20279
|
discoverModels: async (e) => {
|
|
20195
|
-
let t = await nn(
|
|
20196
|
-
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) => !
|
|
20280
|
+
let t = await nn(ov, { headers: { Authorization: `Bearer ${e}` } }, Fu);
|
|
20281
|
+
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) => !fv(e));
|
|
20197
20282
|
},
|
|
20198
|
-
complete: (e, t) =>
|
|
20283
|
+
complete: (e, t) => mv(sv, "OpenCode", e, t)
|
|
20199
20284
|
};
|
|
20200
|
-
async function
|
|
20285
|
+
async function mv(e, t, n, r, i = {}) {
|
|
20201
20286
|
let a = r.attachments ?? [], o = a.length > 0 ? a.map((e) => e.mimeType.startsWith("image/") ? {
|
|
20202
20287
|
type: "image_url",
|
|
20203
20288
|
image_url: { url: `data:${e.mimeType};base64,${e.base64}` }
|
|
@@ -20224,24 +20309,24 @@ async function fv(e, t, n, r, i = {}) {
|
|
|
20224
20309
|
role: "system",
|
|
20225
20310
|
content: xu.parseRole(r.role, r)
|
|
20226
20311
|
}] : [],
|
|
20227
|
-
...(r.history ?? []).flatMap(
|
|
20312
|
+
...(r.history ?? []).flatMap(M_),
|
|
20228
20313
|
...r.prompt ? [{
|
|
20229
20314
|
role: "user",
|
|
20230
20315
|
content: o
|
|
20231
20316
|
}] : []
|
|
20232
20317
|
],
|
|
20233
|
-
...r.tools?.length ? { tools: r.tools.map(
|
|
20318
|
+
...r.tools?.length ? { tools: r.tools.map(A_) } : {},
|
|
20234
20319
|
...typeof r.temperature == "number" ? { temperature: r.temperature } : {}
|
|
20235
20320
|
},
|
|
20236
20321
|
signal: r.signal
|
|
20237
20322
|
}, Fu);
|
|
20238
20323
|
if (!s) throw Vu(t);
|
|
20239
|
-
return
|
|
20324
|
+
return N_(s);
|
|
20240
20325
|
}
|
|
20241
20326
|
//#endregion
|
|
20242
20327
|
//#region src/providers/ai/opencodeGo.ts
|
|
20243
|
-
var
|
|
20244
|
-
|
|
20328
|
+
var hv = "https://opencode.ai/zen/go/v1/models", gv = "https://opencode.ai/zen/go/v1/chat/completions", _v = "x-opencode-session", vv = "kimi-k3", yv = [
|
|
20329
|
+
vv,
|
|
20245
20330
|
"kimi-k3.1-pro",
|
|
20246
20331
|
"glm-5.3",
|
|
20247
20332
|
"glm-5.3-flash",
|
|
@@ -20252,13 +20337,13 @@ var pv = "https://opencode.ai/zen/go/v1/models", mv = "https://opencode.ai/zen/g
|
|
|
20252
20337
|
"minimax-m3",
|
|
20253
20338
|
"claude-haiku-5-5",
|
|
20254
20339
|
"gemini-4-argon"
|
|
20255
|
-
],
|
|
20340
|
+
], bv = () => typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID() : `s-${Date.now()}-${Math.random().toString(36).slice(2)}`, xv = {
|
|
20256
20341
|
id: "opencode-go",
|
|
20257
20342
|
label: "OpenCode Go",
|
|
20258
20343
|
description: "OpenCode Go — a monthly subscription to open and frontier coding models, with an API key.",
|
|
20259
20344
|
configKey: "openCodeGoApiKey",
|
|
20260
|
-
defaultModel:
|
|
20261
|
-
fallbackModels:
|
|
20345
|
+
defaultModel: vv,
|
|
20346
|
+
fallbackModels: yv,
|
|
20262
20347
|
dashboardUrl: "https://opencode.ai/go",
|
|
20263
20348
|
credentialsHint: "OpenCode Console → subscribe to Go → API key.",
|
|
20264
20349
|
credentialFields: [{
|
|
@@ -20272,11 +20357,11 @@ var pv = "https://opencode.ai/zen/go/v1/models", mv = "https://opencode.ai/zen/g
|
|
|
20272
20357
|
supportsDocuments: !0
|
|
20273
20358
|
},
|
|
20274
20359
|
discoverModels: async (e) => {
|
|
20275
|
-
let t = await nn(
|
|
20276
|
-
return (Array.isArray(t?.data) ? t.data : []).map((e) => e.id).filter((e) => typeof e == "string" && e.length > 0).filter((e) => !
|
|
20360
|
+
let t = await nn(hv, { headers: { Authorization: `Bearer ${e}` } }, Fu);
|
|
20361
|
+
return (Array.isArray(t?.data) ? t.data : []).map((e) => e.id).filter((e) => typeof e == "string" && e.length > 0).filter((e) => !fv(e));
|
|
20277
20362
|
},
|
|
20278
|
-
complete: (e, t) =>
|
|
20279
|
-
},
|
|
20363
|
+
complete: (e, t) => mv(gv, "OpenCode Go", e, t, { [_v]: t.logId || bv() })
|
|
20364
|
+
}, Sv = (e) => {
|
|
20280
20365
|
if (!e || typeof e != "object") return;
|
|
20281
20366
|
let { prompt: t, completion: n } = e, r = Number(t), i = Number(n);
|
|
20282
20367
|
if (t === void 0 || n === void 0 || !Number.isFinite(r) || !Number.isFinite(i) || r < 0 || i < 0) return;
|
|
@@ -20287,7 +20372,7 @@ var pv = "https://opencode.ai/zen/go/v1/models", mv = "https://opencode.ai/zen/g
|
|
|
20287
20372
|
currency: "USD",
|
|
20288
20373
|
source: "provider"
|
|
20289
20374
|
};
|
|
20290
|
-
},
|
|
20375
|
+
}, Cv = P_({
|
|
20291
20376
|
id: "openrouter",
|
|
20292
20377
|
label: "OpenRouter",
|
|
20293
20378
|
description: "Unified access to many model providers through one API.",
|
|
@@ -20303,7 +20388,7 @@ var pv = "https://opencode.ai/zen/go/v1/models", mv = "https://opencode.ai/zen/g
|
|
|
20303
20388
|
credentialsHint: "OpenRouter → Settings → API Keys → Create Key.",
|
|
20304
20389
|
mapModelEntry: (e) => typeof e.id == "string" ? {
|
|
20305
20390
|
model: e.id,
|
|
20306
|
-
pricing:
|
|
20391
|
+
pricing: Sv(e.pricing)
|
|
20307
20392
|
} : void 0,
|
|
20308
20393
|
validateApiKey: async (e) => {
|
|
20309
20394
|
try {
|
|
@@ -20325,10 +20410,10 @@ var pv = "https://opencode.ai/zen/go/v1/models", mv = "https://opencode.ai/zen/g
|
|
|
20325
20410
|
};
|
|
20326
20411
|
}
|
|
20327
20412
|
}
|
|
20328
|
-
}),
|
|
20413
|
+
}), wv = {
|
|
20329
20414
|
dbRealtime: {
|
|
20330
20415
|
service: "data",
|
|
20331
|
-
create: () => new
|
|
20416
|
+
create: () => new r_()
|
|
20332
20417
|
},
|
|
20333
20418
|
firestoreDb: {
|
|
20334
20419
|
service: "data",
|
|
@@ -20340,30 +20425,30 @@ var pv = "https://opencode.ai/zen/go/v1/models", mv = "https://opencode.ai/zen/g
|
|
|
20340
20425
|
},
|
|
20341
20426
|
firebaseAuth: {
|
|
20342
20427
|
service: "auth",
|
|
20343
|
-
create: () => new
|
|
20428
|
+
create: () => new s_()
|
|
20344
20429
|
}
|
|
20345
|
-
},
|
|
20430
|
+
}, Tv = {
|
|
20346
20431
|
googleAuth: {
|
|
20347
20432
|
service: "auth",
|
|
20348
|
-
create: () => new
|
|
20433
|
+
create: () => new Rg()
|
|
20349
20434
|
},
|
|
20350
20435
|
gmail: {
|
|
20351
20436
|
service: "email",
|
|
20352
|
-
create: () => new
|
|
20437
|
+
create: () => new y_()
|
|
20353
20438
|
},
|
|
20354
20439
|
googleServiceAccount: {
|
|
20355
20440
|
service: "credentials",
|
|
20356
|
-
create: (e) => new
|
|
20441
|
+
create: (e) => new f_(e.serviceAccount),
|
|
20357
20442
|
when: (e) => !!e.serviceAccount
|
|
20358
20443
|
}
|
|
20359
|
-
},
|
|
20444
|
+
}, Ev = { dropboxAuth: {
|
|
20360
20445
|
service: "auth",
|
|
20361
|
-
create: (e) => new
|
|
20362
|
-
} },
|
|
20446
|
+
create: (e) => new m_(e)
|
|
20447
|
+
} }, Dv = { githubAuth: {
|
|
20363
20448
|
service: "auth",
|
|
20364
|
-
create: (e) => new
|
|
20449
|
+
create: (e) => new g_(e),
|
|
20365
20450
|
when: (e) => !!e?.sessionUrl?.trim()
|
|
20366
|
-
} },
|
|
20451
|
+
} }, Ov = {
|
|
20367
20452
|
supabaseDb: {
|
|
20368
20453
|
service: "data",
|
|
20369
20454
|
create: (e) => new Fo(e)
|
|
@@ -20374,35 +20459,35 @@ var pv = "https://opencode.ai/zen/go/v1/models", mv = "https://opencode.ai/zen/g
|
|
|
20374
20459
|
},
|
|
20375
20460
|
supabaseAuth: {
|
|
20376
20461
|
service: "auth",
|
|
20377
|
-
create: (e) => new
|
|
20462
|
+
create: (e) => new x_(e)
|
|
20378
20463
|
}
|
|
20379
|
-
},
|
|
20464
|
+
}, kv = { mock: {
|
|
20380
20465
|
service: "data",
|
|
20381
20466
|
create: (e) => new Ho(e?.data)
|
|
20382
|
-
} },
|
|
20467
|
+
} }, Av = (e, t) => ({
|
|
20383
20468
|
service: "ai",
|
|
20384
20469
|
create: (n) => new qu(e, n?.[t] || ""),
|
|
20385
20470
|
when: (e) => !!e?.[t]
|
|
20386
|
-
}),
|
|
20387
|
-
firebase:
|
|
20388
|
-
google:
|
|
20389
|
-
dropbox:
|
|
20390
|
-
github:
|
|
20391
|
-
supabase:
|
|
20392
|
-
mock:
|
|
20471
|
+
}), jv = {
|
|
20472
|
+
firebase: wv,
|
|
20473
|
+
google: Tv,
|
|
20474
|
+
dropbox: Ev,
|
|
20475
|
+
github: Dv,
|
|
20476
|
+
supabase: Ov,
|
|
20477
|
+
mock: kv,
|
|
20393
20478
|
ai: {
|
|
20394
|
-
openai:
|
|
20395
|
-
openrouter:
|
|
20396
|
-
opencode:
|
|
20397
|
-
"opencode-go":
|
|
20398
|
-
deepseek:
|
|
20399
|
-
gemini:
|
|
20400
|
-
anthropic:
|
|
20401
|
-
mistral:
|
|
20402
|
-
groq:
|
|
20479
|
+
openai: Av(av, "openaiApiKey"),
|
|
20480
|
+
openrouter: Av(Cv, "openRouterApiKey"),
|
|
20481
|
+
opencode: Av(pv, "openCodeApiKey"),
|
|
20482
|
+
"opencode-go": Av(xv, "openCodeGoApiKey"),
|
|
20483
|
+
deepseek: Av(Y_, "deepSeekApiKey"),
|
|
20484
|
+
gemini: Av(tv, "geminiApiKey"),
|
|
20485
|
+
anthropic: Av(D_, "anthropicApiKey"),
|
|
20486
|
+
mistral: Av(nv, "mistralApiKey"),
|
|
20487
|
+
groq: Av(iv, "groqApiKey"),
|
|
20403
20488
|
cloudflare: {
|
|
20404
20489
|
service: "ai",
|
|
20405
|
-
create: (e) => new qu(
|
|
20490
|
+
create: (e) => new qu(q_({
|
|
20406
20491
|
accountId: e?.cloudflare?.accountId?.trim() || "",
|
|
20407
20492
|
defaultModel: e?.cloudflare?.defaultModel?.trim() || void 0,
|
|
20408
20493
|
includePaidModels: e?.cloudflare?.includePaidModels
|
|
@@ -20410,8 +20495,8 @@ var pv = "https://opencode.ai/zen/go/v1/models", mv = "https://opencode.ai/zen/g
|
|
|
20410
20495
|
when: (e) => !!e?.cloudflare?.apiToken?.trim() && !!e?.cloudflare?.accountId?.trim()
|
|
20411
20496
|
}
|
|
20412
20497
|
}
|
|
20413
|
-
},
|
|
20414
|
-
function
|
|
20498
|
+
}, Mv = () => /* @__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" }));
|
|
20499
|
+
function Nv(e, t) {
|
|
20415
20500
|
if (!t) return;
|
|
20416
20501
|
let n = t, r = typeof t == "object" && !Array.isArray(t) ? Object.entries(n) : [];
|
|
20417
20502
|
if (r.length > 0 && r.every(([, e]) => typeof e == "object" && !!e)) {
|
|
@@ -20420,10 +20505,10 @@ function jv(e, t) {
|
|
|
20420
20505
|
}
|
|
20421
20506
|
e.custom = t;
|
|
20422
20507
|
}
|
|
20423
|
-
function
|
|
20508
|
+
function Pv(e, t, n = "default") {
|
|
20424
20509
|
return t && e[t] ? t : Object.keys(e)[0] ?? n;
|
|
20425
20510
|
}
|
|
20426
|
-
function
|
|
20511
|
+
function Fv(e = {}) {
|
|
20427
20512
|
let t = {
|
|
20428
20513
|
data: {},
|
|
20429
20514
|
storage: {},
|
|
@@ -20432,24 +20517,24 @@ function Nv(e = {}) {
|
|
|
20432
20517
|
ai: {},
|
|
20433
20518
|
credentials: {}
|
|
20434
20519
|
}, n = (e) => t[e] ??= {};
|
|
20435
|
-
for (let [t, r] of Object.entries(
|
|
20520
|
+
for (let [t, r] of Object.entries(jv)) {
|
|
20436
20521
|
let i = e[t];
|
|
20437
20522
|
if (i !== void 0) for (let [e, t] of Object.entries(r)) (!t.when || t.when(i)) && (n(t.service)[e] = t.create(i));
|
|
20438
20523
|
}
|
|
20439
|
-
for (let [t, r] of Object.entries(e.custom ?? {}))
|
|
20440
|
-
Object.keys(t.data).length === 0 && (t.data.mock = new Ho()), Object.keys(t.auth).length === 0 && (t.auth.googleAuth = new
|
|
20524
|
+
for (let [t, r] of Object.entries(e.custom ?? {})) Nv(n(t), r);
|
|
20525
|
+
Object.keys(t.data).length === 0 && (t.data.mock = new Ho()), Object.keys(t.auth).length === 0 && (t.auth.googleAuth = new Rg());
|
|
20441
20526
|
let r = e.services ?? {}, i = {};
|
|
20442
20527
|
for (let [e, n] of Object.entries(t)) i[e] = {
|
|
20443
20528
|
registry: n,
|
|
20444
|
-
defaultKey:
|
|
20529
|
+
defaultKey: Pv(n, r[e])
|
|
20445
20530
|
};
|
|
20446
20531
|
return i;
|
|
20447
20532
|
}
|
|
20448
|
-
var
|
|
20449
|
-
|
|
20450
|
-
},
|
|
20451
|
-
function
|
|
20452
|
-
let [p, m] = E(() =>
|
|
20533
|
+
var Iv = {}, Lv = (e) => {
|
|
20534
|
+
Iv = e;
|
|
20535
|
+
}, Rv = (e) => Iv[e] || [];
|
|
20536
|
+
function zv({ 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 }) {
|
|
20537
|
+
let [p, m] = E(() => Fv(t)), h = T(p);
|
|
20453
20538
|
h.current = p;
|
|
20454
20539
|
let g = T(void 0);
|
|
20455
20540
|
g.current ||= (async (e, t, n) => {
|
|
@@ -20466,7 +20551,7 @@ function Lv({ contextProviders: e, providers: t = {}, appName: n = "LLM Native",
|
|
|
20466
20551
|
})));
|
|
20467
20552
|
});
|
|
20468
20553
|
let _ = g.current, v = e ?? f.Fragment;
|
|
20469
|
-
return /* @__PURE__ */ f.createElement(
|
|
20554
|
+
return /* @__PURE__ */ f.createElement(Ig, {
|
|
20470
20555
|
fullPage: !0,
|
|
20471
20556
|
reportUrl: l,
|
|
20472
20557
|
debug: u
|
|
@@ -20488,10 +20573,10 @@ function Lv({ contextProviders: e, providers: t = {}, appName: n = "LLM Native",
|
|
|
20488
20573
|
} }, /* @__PURE__ */ f.createElement(Ha, {
|
|
20489
20574
|
registries: p,
|
|
20490
20575
|
setProvider: _
|
|
20491
|
-
}, /* @__PURE__ */ f.createElement(gi, p.auth, /* @__PURE__ */ f.createElement(
|
|
20576
|
+
}, /* @__PURE__ */ f.createElement(gi, p.auth, /* @__PURE__ */ f.createElement(Ug, p.credentials, /* @__PURE__ */ f.createElement(zi, p.data, /* @__PURE__ */ f.createElement(Fl, p.storage, /* @__PURE__ */ f.createElement(Bg, p.email, /* @__PURE__ */ f.createElement(Eu, p.ai, /* @__PURE__ */ f.createElement(Lr, { config: i }, /* @__PURE__ */ f.createElement($p, { config: a }, /* @__PURE__ */ f.createElement(dh, { appName: n }, /* @__PURE__ */ f.createElement(Jn, { config: s }, /* @__PURE__ */ f.createElement(Fn, { config: o }, /* @__PURE__ */ f.createElement(v, null, c))))))))))))))));
|
|
20492
20577
|
}
|
|
20493
|
-
function
|
|
20494
|
-
|
|
20578
|
+
function Bv({ importPage: e, LayoutDefault: t = void 0, menuConfig: n = {}, children: r, ...i }) {
|
|
20579
|
+
Lv(n);
|
|
20495
20580
|
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));
|
|
20496
20581
|
function s(n, r, s) {
|
|
20497
20582
|
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, {
|
|
@@ -20501,32 +20586,32 @@ function Rv({ importPage: e, LayoutDefault: t = void 0, menuConfig: n = {}, chil
|
|
|
20501
20586
|
return /* @__PURE__ */ f.createElement(A, {
|
|
20502
20587
|
key: `${n}-${s}`,
|
|
20503
20588
|
path: r.path,
|
|
20504
|
-
element: /* @__PURE__ */ f.createElement(u, null, /* @__PURE__ */ f.createElement(
|
|
20589
|
+
element: /* @__PURE__ */ f.createElement(u, null, /* @__PURE__ */ f.createElement(Ig, {
|
|
20505
20590
|
key: r.path,
|
|
20506
20591
|
reportUrl: i.errorReportUrl,
|
|
20507
20592
|
debug: i.debug
|
|
20508
|
-
}, /* @__PURE__ */ f.createElement(h, { fallback: /* @__PURE__ */ f.createElement(
|
|
20593
|
+
}, /* @__PURE__ */ f.createElement(h, { fallback: /* @__PURE__ */ f.createElement(Mv, null) }, /* @__PURE__ */ f.createElement(l, null))))
|
|
20509
20594
|
});
|
|
20510
20595
|
}
|
|
20511
|
-
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(
|
|
20512
|
-
return /* @__PURE__ */ f.createElement(
|
|
20596
|
+
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(Iv).some((e) => l(e, "/")) ? {} : { default: [{ path: "/" }] };
|
|
20597
|
+
return /* @__PURE__ */ f.createElement(zv, i, r, /* @__PURE__ */ f.createElement(j, null, /* @__PURE__ */ f.createElement(A, {
|
|
20513
20598
|
path: Ci,
|
|
20514
20599
|
element: /* @__PURE__ */ f.createElement(Ai, null)
|
|
20515
20600
|
}), /* @__PURE__ */ f.createElement(f.Fragment, null, c({
|
|
20516
20601
|
...u,
|
|
20517
|
-
...
|
|
20602
|
+
...Iv,
|
|
20518
20603
|
_auth: [{
|
|
20519
20604
|
path: "/users",
|
|
20520
|
-
page:
|
|
20605
|
+
page: Eg,
|
|
20521
20606
|
layout: t
|
|
20522
20607
|
}]
|
|
20523
20608
|
})), /* @__PURE__ */ f.createElement(A, {
|
|
20524
20609
|
path: "*",
|
|
20525
|
-
element: /* @__PURE__ */ f.createElement(
|
|
20610
|
+
element: /* @__PURE__ */ f.createElement(Dg, null)
|
|
20526
20611
|
})));
|
|
20527
20612
|
}
|
|
20528
|
-
var
|
|
20529
|
-
let t =
|
|
20613
|
+
var Vv = (e) => {
|
|
20614
|
+
let t = Rv(e), n = M(), r = (e) => e.map((e) => {
|
|
20530
20615
|
let t = n.pathname === e.path, i = e.children ? r(e.children) : [], a = t || i.some((e) => e.active);
|
|
20531
20616
|
return {
|
|
20532
20617
|
...e,
|
|
@@ -20535,7 +20620,7 @@ var zv = (e) => {
|
|
|
20535
20620
|
};
|
|
20536
20621
|
});
|
|
20537
20622
|
return w(() => r(t), [n.pathname]);
|
|
20538
|
-
},
|
|
20623
|
+
}, Hv = {
|
|
20539
20624
|
common: {
|
|
20540
20625
|
save: "Salva",
|
|
20541
20626
|
cancel: "Annulla",
|
|
@@ -20639,6 +20724,10 @@ var zv = (e) => {
|
|
|
20639
20724
|
reorderRow: "Riordina riga {key}"
|
|
20640
20725
|
},
|
|
20641
20726
|
gallery: { selectItem: "Seleziona elemento {key}" },
|
|
20727
|
+
sortableList: {
|
|
20728
|
+
handle: "Sposta l'elemento {position} di {total}: trascinalo, o usa le frecce su e giù",
|
|
20729
|
+
moved: "Spostato in posizione {position} di {total}"
|
|
20730
|
+
},
|
|
20642
20731
|
crop: {
|
|
20643
20732
|
enableCrop: "Abilita ritaglio a scala {scale}",
|
|
20644
20733
|
variants: "Varianti",
|
|
@@ -20879,7 +20968,7 @@ var zv = (e) => {
|
|
|
20879
20968
|
dataTable: "Dati del grafico",
|
|
20880
20969
|
sequence: "Sequenza"
|
|
20881
20970
|
}
|
|
20882
|
-
},
|
|
20971
|
+
}, Uv = {
|
|
20883
20972
|
common: {
|
|
20884
20973
|
save: "Speichern",
|
|
20885
20974
|
cancel: "Abbrechen",
|
|
@@ -20983,6 +21072,10 @@ var zv = (e) => {
|
|
|
20983
21072
|
reorderRow: "Zeile {key} neu anordnen"
|
|
20984
21073
|
},
|
|
20985
21074
|
gallery: { selectItem: "Element {key} auswählen" },
|
|
21075
|
+
sortableList: {
|
|
21076
|
+
handle: "Element {position} von {total} verschieben: ziehen oder Pfeiltasten nach oben und unten",
|
|
21077
|
+
moved: "Auf Position {position} von {total} verschoben"
|
|
21078
|
+
},
|
|
20986
21079
|
crop: {
|
|
20987
21080
|
enableCrop: "Zuschnitt mit Skalierung {scale} aktivieren",
|
|
20988
21081
|
variants: "Varianten",
|
|
@@ -21223,7 +21316,7 @@ var zv = (e) => {
|
|
|
21223
21316
|
dataTable: "Diagrammdaten",
|
|
21224
21317
|
sequence: "Abfolge"
|
|
21225
21318
|
}
|
|
21226
|
-
},
|
|
21319
|
+
}, Wv = {
|
|
21227
21320
|
common: {
|
|
21228
21321
|
save: "Сохранить",
|
|
21229
21322
|
cancel: "Отменить",
|
|
@@ -21327,6 +21420,10 @@ var zv = (e) => {
|
|
|
21327
21420
|
reorderRow: "Переместить строку {key}"
|
|
21328
21421
|
},
|
|
21329
21422
|
gallery: { selectItem: "Выбрать элемент {key}" },
|
|
21423
|
+
sortableList: {
|
|
21424
|
+
handle: "Переместить элемент {position} из {total}: перетащите его или используйте стрелки вверх и вниз",
|
|
21425
|
+
moved: "Перемещено на позицию {position} из {total}"
|
|
21426
|
+
},
|
|
21330
21427
|
crop: {
|
|
21331
21428
|
enableCrop: "Включить обрезку в масштабе {scale}",
|
|
21332
21429
|
variants: "Варианты",
|
|
@@ -21567,7 +21664,7 @@ var zv = (e) => {
|
|
|
21567
21664
|
dataTable: "Данные диаграммы",
|
|
21568
21665
|
sequence: "Последовательность"
|
|
21569
21666
|
}
|
|
21570
|
-
},
|
|
21667
|
+
}, Gv = {
|
|
21571
21668
|
common: {
|
|
21572
21669
|
save: "保存",
|
|
21573
21670
|
cancel: "取消",
|
|
@@ -21671,6 +21768,10 @@ var zv = (e) => {
|
|
|
21671
21768
|
reorderRow: "重排行{key}"
|
|
21672
21769
|
},
|
|
21673
21770
|
gallery: { selectItem: "选择项目{key}" },
|
|
21771
|
+
sortableList: {
|
|
21772
|
+
handle: "移动第 {position} 项(共 {total} 项):拖动它,或使用上下方向键",
|
|
21773
|
+
moved: "已移到第 {position} 位(共 {total} 位)"
|
|
21774
|
+
},
|
|
21674
21775
|
crop: {
|
|
21675
21776
|
enableCrop: "启用{scale}比例裁剪",
|
|
21676
21777
|
variants: "变体",
|
|
@@ -21911,7 +22012,7 @@ var zv = (e) => {
|
|
|
21911
22012
|
dataTable: "图表数据",
|
|
21912
22013
|
sequence: "顺序"
|
|
21913
22014
|
}
|
|
21914
|
-
},
|
|
22015
|
+
}, Kv = {
|
|
21915
22016
|
common: {
|
|
21916
22017
|
save: "حفظ",
|
|
21917
22018
|
cancel: "إلغاء",
|
|
@@ -22015,6 +22116,10 @@ var zv = (e) => {
|
|
|
22015
22116
|
reorderRow: "إعادة ترتيب الصف {key}"
|
|
22016
22117
|
},
|
|
22017
22118
|
gallery: { selectItem: "تحديد العنصر {key}" },
|
|
22119
|
+
sortableList: {
|
|
22120
|
+
handle: "نقل العنصر {position} من {total}: اسحبه أو استخدم السهمين لأعلى ولأسفل",
|
|
22121
|
+
moved: "نُقل إلى الموضع {position} من {total}"
|
|
22122
|
+
},
|
|
22018
22123
|
crop: {
|
|
22019
22124
|
enableCrop: "تفعيل الاقتصاص بمقياس {scale}",
|
|
22020
22125
|
variants: "المتغيرات",
|
|
@@ -22255,22 +22360,22 @@ var zv = (e) => {
|
|
|
22255
22360
|
dataTable: "بيانات المخطط",
|
|
22256
22361
|
sequence: "التسلسل"
|
|
22257
22362
|
}
|
|
22258
|
-
},
|
|
22259
|
-
ar: () =>
|
|
22260
|
-
de: () =>
|
|
22363
|
+
}, qv = /* @__PURE__ */ ot({
|
|
22364
|
+
ar: () => Kv,
|
|
22365
|
+
de: () => Uv,
|
|
22261
22366
|
en: () => Rn,
|
|
22262
|
-
it: () =>
|
|
22263
|
-
ru: () =>
|
|
22264
|
-
zh: () =>
|
|
22265
|
-
}),
|
|
22367
|
+
it: () => Hv,
|
|
22368
|
+
ru: () => Wv,
|
|
22369
|
+
zh: () => Gv
|
|
22370
|
+
}), Jv = (e) => Ga("api", e);
|
|
22266
22371
|
//#endregion
|
|
22267
22372
|
//#region src/providers/api/direct.ts
|
|
22268
|
-
async function
|
|
22373
|
+
async function Yv(e) {
|
|
22269
22374
|
if (!e.ok) throw Error(`ApiProvider request failed: ${e.status} ${e.statusText}`);
|
|
22270
22375
|
let t = await e.text();
|
|
22271
22376
|
return t ? JSON.parse(t) : void 0;
|
|
22272
22377
|
}
|
|
22273
|
-
var
|
|
22378
|
+
var Xv = class {
|
|
22274
22379
|
config;
|
|
22275
22380
|
constructor(e) {
|
|
22276
22381
|
this.config = e;
|
|
@@ -22285,7 +22390,7 @@ var Jv = class {
|
|
|
22285
22390
|
...e.body,
|
|
22286
22391
|
...this.config.body
|
|
22287
22392
|
};
|
|
22288
|
-
return
|
|
22393
|
+
return Yv(await Fu(n.toString(), {
|
|
22289
22394
|
method: t,
|
|
22290
22395
|
headers: {
|
|
22291
22396
|
"Content-Type": "application/json",
|
|
@@ -22294,7 +22399,7 @@ var Jv = class {
|
|
|
22294
22399
|
body: t === "GET" || t === "HEAD" ? void 0 : JSON.stringify(r)
|
|
22295
22400
|
}));
|
|
22296
22401
|
}
|
|
22297
|
-
},
|
|
22402
|
+
}, Zv = class {
|
|
22298
22403
|
resolver;
|
|
22299
22404
|
constructor(e) {
|
|
22300
22405
|
this.resolver = e;
|
|
@@ -22302,7 +22407,7 @@ var Jv = class {
|
|
|
22302
22407
|
async fetch(e) {
|
|
22303
22408
|
return this.resolver(e);
|
|
22304
22409
|
}
|
|
22305
|
-
},
|
|
22410
|
+
}, Qv = class {
|
|
22306
22411
|
config;
|
|
22307
22412
|
constructor(e) {
|
|
22308
22413
|
this.config = e;
|
|
@@ -22313,7 +22418,7 @@ var Jv = class {
|
|
|
22313
22418
|
request: e
|
|
22314
22419
|
}, void 0, this.config.region);
|
|
22315
22420
|
}
|
|
22316
|
-
},
|
|
22421
|
+
}, $v = class {
|
|
22317
22422
|
config;
|
|
22318
22423
|
constructor(e) {
|
|
22319
22424
|
this.config = e;
|
|
@@ -22326,7 +22431,7 @@ var Jv = class {
|
|
|
22326
22431
|
if (n) throw n;
|
|
22327
22432
|
return t;
|
|
22328
22433
|
}
|
|
22329
|
-
},
|
|
22434
|
+
}, ey = [
|
|
22330
22435
|
{
|
|
22331
22436
|
id: "resend",
|
|
22332
22437
|
label: "Resend",
|
|
@@ -22437,7 +22542,7 @@ var Jv = class {
|
|
|
22437
22542
|
],
|
|
22438
22543
|
credentialsHint: "Ask your mail host or hosting provider for the SMTP host, port, and credentials."
|
|
22439
22544
|
}
|
|
22440
|
-
],
|
|
22545
|
+
], ty = [
|
|
22441
22546
|
{
|
|
22442
22547
|
id: "cloudflare_pages",
|
|
22443
22548
|
label: "Cloudflare Pages",
|
|
@@ -22667,16 +22772,16 @@ var Jv = class {
|
|
|
22667
22772
|
description: "No vendor — packages the build as a downloadable archive for self-hosting anywhere else.",
|
|
22668
22773
|
credentialFields: []
|
|
22669
22774
|
}
|
|
22670
|
-
],
|
|
22671
|
-
|
|
22775
|
+
], ny = [
|
|
22776
|
+
av,
|
|
22777
|
+
Cv,
|
|
22778
|
+
pv,
|
|
22672
22779
|
xv,
|
|
22673
|
-
|
|
22674
|
-
|
|
22675
|
-
|
|
22676
|
-
|
|
22677
|
-
|
|
22678
|
-
ev,
|
|
22679
|
-
M_({
|
|
22780
|
+
Y_,
|
|
22781
|
+
tv,
|
|
22782
|
+
D_,
|
|
22783
|
+
nv,
|
|
22784
|
+
P_({
|
|
22680
22785
|
id: "glm",
|
|
22681
22786
|
label: "ZhipuAI (GLM)",
|
|
22682
22787
|
description: "Zhipu AI's GLM model family.",
|
|
@@ -22693,8 +22798,8 @@ var Jv = class {
|
|
|
22693
22798
|
dashboardUrl: "https://bigmodel.cn/usercenter/apikeys",
|
|
22694
22799
|
credentialsHint: "Zhipu BigModel → User Center → API Keys → Create Key."
|
|
22695
22800
|
}),
|
|
22696
|
-
|
|
22697
|
-
],
|
|
22801
|
+
iv
|
|
22802
|
+
], ry = (e) => ({
|
|
22698
22803
|
id: e.id,
|
|
22699
22804
|
label: e.label,
|
|
22700
22805
|
description: e.description ?? "",
|
|
@@ -22705,7 +22810,7 @@ var Jv = class {
|
|
|
22705
22810
|
}],
|
|
22706
22811
|
credentialsUrl: e.dashboardUrl,
|
|
22707
22812
|
credentialsHint: e.credentialsHint
|
|
22708
|
-
}),
|
|
22813
|
+
}), iy = [...ny.map(ry), J_], ay = {
|
|
22709
22814
|
id: "openai-compatible",
|
|
22710
22815
|
label: "OpenAI-compatible",
|
|
22711
22816
|
description: "Any OpenAI-compatible endpoint (self-hosted or third-party).",
|
|
@@ -22719,15 +22824,15 @@ var Jv = class {
|
|
|
22719
22824
|
type: "text",
|
|
22720
22825
|
placeholder: "https://api.example.com/v1"
|
|
22721
22826
|
}]
|
|
22722
|
-
},
|
|
22827
|
+
}, oy = (e) => {
|
|
22723
22828
|
let t = [], n = e?.cloudflare?.accountId?.trim();
|
|
22724
|
-
n && t.push(
|
|
22829
|
+
n && t.push(q_({
|
|
22725
22830
|
accountId: n,
|
|
22726
22831
|
defaultModel: e?.cloudflare?.defaultModel?.trim() || void 0,
|
|
22727
22832
|
includePaidModels: e?.cloudflare?.includePaidModels
|
|
22728
22833
|
}));
|
|
22729
22834
|
let r = e?.openAICompatible?.baseUrl?.trim();
|
|
22730
|
-
return r ? [...t,
|
|
22835
|
+
return r ? [...t, P_({
|
|
22731
22836
|
id: "openai-compatible",
|
|
22732
22837
|
label: e?.openAICompatible?.label?.trim() || "OpenAI-compatible",
|
|
22733
22838
|
description: "Any OpenAI-compatible endpoint (self-hosted or third-party).",
|
|
@@ -22739,10 +22844,10 @@ var Jv = class {
|
|
|
22739
22844
|
modelsUrl: e?.openAICompatible?.modelsUrl?.trim() || void 0,
|
|
22740
22845
|
chatCompletionsUrl: e?.openAICompatible?.chatCompletionsUrl?.trim() || void 0
|
|
22741
22846
|
})] : t;
|
|
22742
|
-
},
|
|
22847
|
+
}, sy = (e) => e ? [...ny, ...oy(e)].reduce((t, n) => {
|
|
22743
22848
|
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() : "";
|
|
22744
22849
|
return r && (t[n.id] = new qu(n, r)), t;
|
|
22745
|
-
}, {}) : {},
|
|
22850
|
+
}, {}) : {}, cy = (e, { scope: t }) => sy(e.reduce((e, n) => {
|
|
22746
22851
|
let i = r(t, n.id);
|
|
22747
22852
|
if (n.id === "openai-compatible") return n.baseUrl ? {
|
|
22748
22853
|
...e,
|
|
@@ -22760,37 +22865,37 @@ var Jv = class {
|
|
|
22760
22865
|
accountId: n.accountId
|
|
22761
22866
|
}
|
|
22762
22867
|
} : e;
|
|
22763
|
-
let a =
|
|
22868
|
+
let a = ny.find((e) => e.id === n.id)?.configKey;
|
|
22764
22869
|
return a ? {
|
|
22765
22870
|
...e,
|
|
22766
22871
|
[a]: i
|
|
22767
22872
|
} : e;
|
|
22768
|
-
}, {})),
|
|
22873
|
+
}, {})), ly = void 0;
|
|
22769
22874
|
typeof Xa == "function" && Xa((e) => {
|
|
22770
|
-
|
|
22875
|
+
ly = e.google;
|
|
22771
22876
|
});
|
|
22772
|
-
var
|
|
22877
|
+
var uy = {
|
|
22773
22878
|
ita: "geoTargetConstants/2380",
|
|
22774
22879
|
rome: "geoTargetConstants/1033236",
|
|
22775
22880
|
mil: "geoTargetConstants/1033239",
|
|
22776
22881
|
nap: "geoTargetConstants/1033245",
|
|
22777
22882
|
tor: "geoTargetConstants/1033247"
|
|
22778
|
-
},
|
|
22883
|
+
}, dy = {
|
|
22779
22884
|
it: "languageConstants/1000",
|
|
22780
22885
|
en: "languageConstants/1001",
|
|
22781
22886
|
fr: "languageConstants/1002",
|
|
22782
22887
|
es: "languageConstants/1003",
|
|
22783
22888
|
de: "languageConstants/1005"
|
|
22784
22889
|
};
|
|
22785
|
-
function
|
|
22786
|
-
return
|
|
22890
|
+
function fy(e) {
|
|
22891
|
+
return uy[e.toLowerCase()] || "geoTargetConstants/2380";
|
|
22787
22892
|
}
|
|
22788
|
-
function
|
|
22789
|
-
return
|
|
22893
|
+
function py(e) {
|
|
22894
|
+
return dy[e.toLowerCase()] || "languageConstants/1000";
|
|
22790
22895
|
}
|
|
22791
|
-
async function
|
|
22792
|
-
if (!
|
|
22793
|
-
let i = await
|
|
22896
|
+
async function my({ keyword: e, googleAdsAccountId: t, geoCode: n = "ita", languageCode: r = "it" }) {
|
|
22897
|
+
if (!ly?.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"), [];
|
|
22898
|
+
let i = await __(["https://www.googleapis.com/auth/adwords"]), a = fy(n), o = py(r), s = `https://googleads.googleapis.com/v13/customers/${t}:generateKeywordIdeas`, c = {
|
|
22794
22899
|
keywordSeed: { keywords: [e] },
|
|
22795
22900
|
geoTargetConstants: [a],
|
|
22796
22901
|
language: o
|
|
@@ -22798,7 +22903,7 @@ async function fy({ keyword: e, googleAdsAccountId: t, geoCode: n = "ita", langu
|
|
|
22798
22903
|
method: "POST",
|
|
22799
22904
|
headers: {
|
|
22800
22905
|
Authorization: `Bearer ${i}`,
|
|
22801
|
-
"developer-token":
|
|
22906
|
+
"developer-token": ly.developerToken,
|
|
22802
22907
|
"Content-Type": "application/json"
|
|
22803
22908
|
},
|
|
22804
22909
|
body: JSON.stringify(c)
|
|
@@ -22816,7 +22921,7 @@ async function fy({ keyword: e, googleAdsAccountId: t, geoCode: n = "ita", langu
|
|
|
22816
22921
|
}
|
|
22817
22922
|
//#endregion
|
|
22818
22923
|
//#region src/providers/seo/google/trend.ts
|
|
22819
|
-
async function
|
|
22924
|
+
async function hy(e, t = "IT", n = "today 12-m") {
|
|
22820
22925
|
let r = `https://trends.google.com/trends/api/explore?hl=en-US&tz=0&req=${encodeURIComponent(JSON.stringify({
|
|
22821
22926
|
comparisonItem: [{
|
|
22822
22927
|
keyword: e,
|
|
@@ -22836,7 +22941,7 @@ async function py(e, t = "IT", n = "today 12-m") {
|
|
|
22836
22941
|
}))
|
|
22837
22942
|
};
|
|
22838
22943
|
}
|
|
22839
|
-
async function
|
|
22944
|
+
async function gy(e, t = "IT", n = "today 12-m") {
|
|
22840
22945
|
let r = `https://trends.google.com/trends/api/explore?hl=en-US&tz=0&req=${encodeURIComponent(JSON.stringify({
|
|
22841
22946
|
comparisonItem: [{
|
|
22842
22947
|
keyword: e,
|
|
@@ -22862,13 +22967,13 @@ async function my(e, t = "IT", n = "today 12-m") {
|
|
|
22862
22967
|
}
|
|
22863
22968
|
//#endregion
|
|
22864
22969
|
//#region src/providers/storage/dropbox.tsx
|
|
22865
|
-
var
|
|
22970
|
+
var _y = 5e3, vy = "https://www.dropbox.com/home", yy = void 0;
|
|
22866
22971
|
typeof Xa == "function" && Xa((e) => {
|
|
22867
|
-
|
|
22972
|
+
yy = e.dropbox;
|
|
22868
22973
|
});
|
|
22869
|
-
var
|
|
22870
|
-
if (!
|
|
22871
|
-
let r = await Fi(
|
|
22974
|
+
var by = async (e, t, n = {}) => {
|
|
22975
|
+
if (!yy) return console.error("DropBox: Config not found"), null;
|
|
22976
|
+
let r = await Fi(yy.clientId);
|
|
22872
22977
|
if (!r) throw Error("DropBox: Access token not found");
|
|
22873
22978
|
return await fetch(e, {
|
|
22874
22979
|
method: "POST",
|
|
@@ -22881,12 +22986,12 @@ var vy = async (e, t, n = {}) => {
|
|
|
22881
22986
|
}).catch((e) => (console.error("There was a problem with the fetch operation:", e), null)).finally(() => {
|
|
22882
22987
|
console.log("DropBox: Fetch operation completed");
|
|
22883
22988
|
});
|
|
22884
|
-
},
|
|
22885
|
-
if (!
|
|
22989
|
+
}, xy = async (e, t, n = {}) => {
|
|
22990
|
+
if (!yy) {
|
|
22886
22991
|
console.error("DropBox: Config not found");
|
|
22887
22992
|
return;
|
|
22888
22993
|
}
|
|
22889
|
-
let r = await Fi(
|
|
22994
|
+
let r = await Fi(yy.clientId);
|
|
22890
22995
|
if (!r) {
|
|
22891
22996
|
console.error("DropBox: Access token not found");
|
|
22892
22997
|
return;
|
|
@@ -22911,47 +23016,47 @@ var vy = async (e, t, n = {}) => {
|
|
|
22911
23016
|
}).finally(() => {
|
|
22912
23017
|
console.log("DropBox: Fetch operation completed", e, t);
|
|
22913
23018
|
});
|
|
22914
|
-
},
|
|
22915
|
-
let n =
|
|
22916
|
-
return (t ?
|
|
22917
|
-
},
|
|
23019
|
+
}, Sy = (e, t = !1) => {
|
|
23020
|
+
let n = yy?.rootPath || "";
|
|
23021
|
+
return (t ? vy : "") + (e.startsWith(n) ? e : n + e);
|
|
23022
|
+
}, Cy = async (e, t = "", n = !1) => {
|
|
22918
23023
|
let r = {};
|
|
22919
|
-
return (await
|
|
23024
|
+
return (await Ly.listFolders({
|
|
22920
23025
|
path: `${e + t}`,
|
|
22921
23026
|
recursive: !0
|
|
22922
23027
|
})).forEach((e) => {
|
|
22923
23028
|
e[".tag"] !== "folder" && (r[n ? vi.changeFilename(e.path_display, { ext: "" }) : e.path_display] = e.name);
|
|
22924
23029
|
}), r;
|
|
22925
|
-
},
|
|
23030
|
+
}, wy = async (e, t) => {
|
|
22926
23031
|
if (!e.async_job_id) return Promise.reject(e);
|
|
22927
23032
|
let n, r = !0;
|
|
22928
|
-
for (; r;) await St(100), n = await
|
|
23033
|
+
for (; r;) await St(100), n = await xy(`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);
|
|
22929
23034
|
return n?.[".tag"] === "complete" ? Promise.resolve(n.entries) : Promise.reject(n);
|
|
22930
|
-
},
|
|
22931
|
-
let n = "files/create_folder_batch", r = await
|
|
23035
|
+
}, Ty = async (e, t = "") => {
|
|
23036
|
+
let n = "files/create_folder_batch", r = await xy(`https://api.dropboxapi.com/2/${n}`, {
|
|
22932
23037
|
autorename: !1,
|
|
22933
23038
|
force_async: !0,
|
|
22934
|
-
paths: e.map((e) =>
|
|
23039
|
+
paths: e.map((e) => Sy(t + e))
|
|
22935
23040
|
});
|
|
22936
|
-
return r ?
|
|
22937
|
-
},
|
|
22938
|
-
let n = "files/create_folder_batch", r = await
|
|
22939
|
-
return r ?
|
|
22940
|
-
},
|
|
23041
|
+
return r ? wy(r, n) : void 0;
|
|
23042
|
+
}, Ey = async (e, t = "") => {
|
|
23043
|
+
let n = "files/create_folder_batch", r = await xy(`https://api.dropboxapi.com/2/${n}`, { entries: e.map((e) => ({ path: Sy(t + e) })) });
|
|
23044
|
+
return r ? wy(r, n) : void 0;
|
|
23045
|
+
}, Dy = async (e, t) => xy("https://api.dropboxapi.com/2/files/tags/add", {
|
|
22941
23046
|
path: e,
|
|
22942
23047
|
tag_text: t.toLowerCase().replaceAll(/[^a-z0-9]/g, "")
|
|
22943
|
-
}),
|
|
22944
|
-
for (let n in e) for (let r of e[n]) await
|
|
22945
|
-
},
|
|
22946
|
-
let n = [], r = async ({ path: e, cursor: t, recursive: n }) => e ? await
|
|
23048
|
+
}), Oy = async (e, t = "") => {
|
|
23049
|
+
for (let n in e) for (let r of e[n]) await Dy(Sy(t + n), r);
|
|
23050
|
+
}, ky = async ({ path: e = "", recursive: t = !1 } = {}) => {
|
|
23051
|
+
let n = [], r = async ({ path: e, cursor: t, recursive: n }) => e ? await xy("https://api.dropboxapi.com/2/files/list_folder", {
|
|
22947
23052
|
include_deleted: !1,
|
|
22948
23053
|
include_has_explicit_shared_members: !1,
|
|
22949
23054
|
include_media_info: !1,
|
|
22950
23055
|
include_mounted_folders: !0,
|
|
22951
23056
|
include_non_downloadable_files: !0,
|
|
22952
|
-
path:
|
|
23057
|
+
path: Sy(e),
|
|
22953
23058
|
recursive: n
|
|
22954
|
-
}) : await
|
|
23059
|
+
}) : await xy("https://api.dropboxapi.com/2/files/list_folder/continue", { cursor: t }), i = {
|
|
22955
23060
|
has_more: !0,
|
|
22956
23061
|
cursor: "",
|
|
22957
23062
|
entries: []
|
|
@@ -22964,44 +23069,44 @@ var vy = async (e, t, n = {}) => {
|
|
|
22964
23069
|
recursive: t
|
|
22965
23070
|
}), i && n.push(...i.entries);
|
|
22966
23071
|
return n;
|
|
22967
|
-
},
|
|
22968
|
-
let t = async (e) => await
|
|
23072
|
+
}, Ay = async (e) => {
|
|
23073
|
+
let t = async (e) => await xy("https://api.dropboxapi.com/2/files/copy_batch_v2", {
|
|
22969
23074
|
entries: e,
|
|
22970
23075
|
autorename: !1
|
|
22971
|
-
}), n = async (e) => await
|
|
23076
|
+
}), n = async (e) => await xy("https://api.dropboxapi.com/2/files/copy_batch/check_v2", { async_job_id: e }), r = [], i = [];
|
|
22972
23077
|
for (let a = 0; a < e.length; a += 900) {
|
|
22973
23078
|
i = e.slice(a, a + 900).map((e) => ({
|
|
22974
|
-
from_path:
|
|
22975
|
-
to_path:
|
|
23079
|
+
from_path: Sy(e.from),
|
|
23080
|
+
to_path: Sy(e.to)
|
|
22976
23081
|
}));
|
|
22977
23082
|
let o = await t(i);
|
|
22978
23083
|
if (!o) continue;
|
|
22979
23084
|
if (o.error) throw Error(`Error starting copy: ${o.error}`);
|
|
22980
23085
|
let s = o;
|
|
22981
|
-
for (; s?.[".tag"] === "async_job_id" || s?.[".tag"] === "in_progress";) await St(
|
|
23086
|
+
for (; s?.[".tag"] === "async_job_id" || s?.[".tag"] === "in_progress";) await St(_y), s = await n(o.async_job_id ?? "");
|
|
22982
23087
|
if (s?.[".tag"] === "failed") throw Error(`Copy operation failed: ${s[".tag"]}`);
|
|
22983
23088
|
s?.[".tag"] === "complete" && s.entries && r.push(...s.entries);
|
|
22984
23089
|
}
|
|
22985
23090
|
return r.filter((e) => e[".tag"] === "failure").map((e) => e.failure);
|
|
22986
|
-
},
|
|
22987
|
-
let t = async (e) => await
|
|
23091
|
+
}, jy = async (e) => {
|
|
23092
|
+
let t = async (e) => await xy("https://api.dropboxapi.com/2/files/move_v2", {
|
|
22988
23093
|
...e,
|
|
22989
23094
|
autorename: !0
|
|
22990
23095
|
});
|
|
22991
23096
|
for (let n of e) await t({
|
|
22992
|
-
from_path:
|
|
22993
|
-
to_path:
|
|
23097
|
+
from_path: Sy(n.from),
|
|
23098
|
+
to_path: Sy(n.to)
|
|
22994
23099
|
});
|
|
22995
|
-
},
|
|
23100
|
+
}, My = async ({ thumbnailsRequest: e = [], size: t = "w64h64", format: n = "jpeg", mode: r = "strict" }, i) => {
|
|
22996
23101
|
let a = {}, o = [];
|
|
22997
23102
|
for (let s = 0; s < e.length; s += 25) {
|
|
22998
23103
|
let c = e.slice(s, s + 25), l = c.map((e) => ({
|
|
22999
|
-
path:
|
|
23104
|
+
path: Sy(e.path),
|
|
23000
23105
|
format: n,
|
|
23001
23106
|
size: t,
|
|
23002
23107
|
mode: r
|
|
23003
23108
|
}));
|
|
23004
|
-
await St(100), o.push(
|
|
23109
|
+
await St(100), o.push(xy("https://content.dropboxapi.com/2/files/get_thumbnail_batch", { entries: l }).then((e) => {
|
|
23005
23110
|
if (!e) return;
|
|
23006
23111
|
let n = e.entries.reduce((e, n, r) => {
|
|
23007
23112
|
let i = c[r].path, [a, o] = t.replace("w", "").split("h").map(Number), s = n;
|
|
@@ -23020,7 +23125,7 @@ var vy = async (e, t, n = {}) => {
|
|
|
23020
23125
|
}));
|
|
23021
23126
|
}
|
|
23022
23127
|
return Promise.all(o).then(() => a);
|
|
23023
|
-
},
|
|
23128
|
+
}, Ny = (e, t = "application/octet-stream", n = 512) => {
|
|
23024
23129
|
let r = atob(e), i = [];
|
|
23025
23130
|
for (let e = 0; e < r.length; e += n) {
|
|
23026
23131
|
let t = r.slice(e, e + n), a = Array(t.length);
|
|
@@ -23029,11 +23134,11 @@ var vy = async (e, t, n = {}) => {
|
|
|
23029
23134
|
i.push(o);
|
|
23030
23135
|
}
|
|
23031
23136
|
return new Blob(i, { type: t });
|
|
23032
|
-
},
|
|
23137
|
+
}, Py = async (e, t) => {
|
|
23033
23138
|
try {
|
|
23034
23139
|
let n = t.split(",")[1];
|
|
23035
|
-
|
|
23036
|
-
path:
|
|
23140
|
+
by("https://content.dropboxapi.com/2/files/upload", Ny(n, "application/octet-stream"), { "Dropbox-API-Arg": JSON.stringify({
|
|
23141
|
+
path: Sy(e),
|
|
23037
23142
|
mode: "overwrite",
|
|
23038
23143
|
autorename: !0,
|
|
23039
23144
|
mute: !1
|
|
@@ -23043,12 +23148,12 @@ var vy = async (e, t, n = {}) => {
|
|
|
23043
23148
|
} catch (e) {
|
|
23044
23149
|
console.error("Errore durante il caricamento su Dropbox:", e);
|
|
23045
23150
|
}
|
|
23046
|
-
},
|
|
23047
|
-
if (!
|
|
23151
|
+
}, Fy = (e = !1) => yy ? Mi(yy.clientId, e) : !1, Iy = (e = {}) => {
|
|
23152
|
+
if (!yy) return /* @__PURE__ */ f.createElement("div", {
|
|
23048
23153
|
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.",
|
|
23049
23154
|
className: "text-danger flex items-center gap-2"
|
|
23050
23155
|
}, /* @__PURE__ */ f.createElement(Q, { name: "warning" }), /* @__PURE__ */ f.createElement("span", null, "Dropbox non configurato"));
|
|
23051
|
-
let t =
|
|
23156
|
+
let t = Fy(!0);
|
|
23052
23157
|
return /* @__PURE__ */ f.createElement(Li, {
|
|
23053
23158
|
provider: "dropboxAuth",
|
|
23054
23159
|
intent: "connect",
|
|
@@ -23060,33 +23165,33 @@ var vy = async (e, t, n = {}) => {
|
|
|
23060
23165
|
title: t ? "DropBox Connected" : "DropBox Disconnected"
|
|
23061
23166
|
}
|
|
23062
23167
|
});
|
|
23063
|
-
},
|
|
23168
|
+
}, Ly = {
|
|
23064
23169
|
setRootPath: (e) => {
|
|
23065
|
-
|
|
23066
|
-
},
|
|
23067
|
-
resolvePath:
|
|
23068
|
-
createFolders:
|
|
23069
|
-
deleteBulk:
|
|
23070
|
-
addTags:
|
|
23071
|
-
listFolders:
|
|
23072
|
-
getThumbnails:
|
|
23073
|
-
search:
|
|
23074
|
-
upload:
|
|
23075
|
-
copy:
|
|
23076
|
-
move:
|
|
23077
|
-
},
|
|
23170
|
+
yy && (yy.rootPath = e);
|
|
23171
|
+
},
|
|
23172
|
+
resolvePath: Sy,
|
|
23173
|
+
createFolders: Ty,
|
|
23174
|
+
deleteBulk: Ey,
|
|
23175
|
+
addTags: Oy,
|
|
23176
|
+
listFolders: ky,
|
|
23177
|
+
getThumbnails: My,
|
|
23178
|
+
search: Cy,
|
|
23179
|
+
upload: Py,
|
|
23180
|
+
copy: Ay,
|
|
23181
|
+
move: jy
|
|
23182
|
+
}, Ry = "https://api.serpapi.com/search", zy = "google", By = "google_images", Vy = "google_autocomplete", Hy = "google_trends", Uy = "google_maps", Wy = "google_maps_photos", Gy = "google_maps_reviews", Ky = {
|
|
23078
23183
|
engine: null,
|
|
23079
23184
|
device: null,
|
|
23080
23185
|
no_cache: !1,
|
|
23081
23186
|
async: !1,
|
|
23082
23187
|
output: "json"
|
|
23083
|
-
},
|
|
23188
|
+
}, qy = { q: null }, Jy = {
|
|
23084
23189
|
tbs: null,
|
|
23085
23190
|
safe: "active",
|
|
23086
23191
|
nfpr: 0,
|
|
23087
23192
|
filter: 1
|
|
23088
23193
|
};
|
|
23089
|
-
function
|
|
23194
|
+
function Yy(e) {
|
|
23090
23195
|
let t = du(), n = du(!0), r = fu(!0), i = {
|
|
23091
23196
|
location: t,
|
|
23092
23197
|
uule: null
|
|
@@ -23104,13 +23209,13 @@ function qy(e) {
|
|
|
23104
23209
|
hl: r
|
|
23105
23210
|
};
|
|
23106
23211
|
return {
|
|
23107
|
-
[
|
|
23108
|
-
...
|
|
23212
|
+
[zy]: {
|
|
23213
|
+
...Ky,
|
|
23109
23214
|
...i,
|
|
23110
23215
|
...o,
|
|
23111
|
-
...
|
|
23112
|
-
...
|
|
23113
|
-
engine:
|
|
23216
|
+
...Jy,
|
|
23217
|
+
...qy,
|
|
23218
|
+
engine: zy,
|
|
23114
23219
|
ludocid: null,
|
|
23115
23220
|
lsig: null,
|
|
23116
23221
|
kgmid: null,
|
|
@@ -23119,29 +23224,29 @@ function qy(e) {
|
|
|
23119
23224
|
start: null,
|
|
23120
23225
|
num: null
|
|
23121
23226
|
},
|
|
23122
|
-
[
|
|
23123
|
-
...
|
|
23227
|
+
[By]: {
|
|
23228
|
+
...Ky,
|
|
23124
23229
|
...i,
|
|
23125
23230
|
...o,
|
|
23126
|
-
...
|
|
23127
|
-
...
|
|
23128
|
-
engine:
|
|
23231
|
+
...Jy,
|
|
23232
|
+
...qy,
|
|
23233
|
+
engine: By,
|
|
23129
23234
|
chips: null,
|
|
23130
23235
|
ijn: null
|
|
23131
23236
|
},
|
|
23132
|
-
[
|
|
23133
|
-
...
|
|
23237
|
+
[Vy]: {
|
|
23238
|
+
...Ky,
|
|
23134
23239
|
...o,
|
|
23135
|
-
...
|
|
23136
|
-
engine:
|
|
23240
|
+
...qy,
|
|
23241
|
+
engine: Vy,
|
|
23137
23242
|
cp: null,
|
|
23138
23243
|
client: null
|
|
23139
23244
|
},
|
|
23140
|
-
[
|
|
23141
|
-
...
|
|
23245
|
+
[Hy]: {
|
|
23246
|
+
...Ky,
|
|
23142
23247
|
...a,
|
|
23143
|
-
...
|
|
23144
|
-
engine:
|
|
23248
|
+
...qy,
|
|
23249
|
+
engine: Hy,
|
|
23145
23250
|
data_type: null,
|
|
23146
23251
|
tz: null,
|
|
23147
23252
|
cat: null,
|
|
@@ -23149,73 +23254,73 @@ function qy(e) {
|
|
|
23149
23254
|
date: null,
|
|
23150
23255
|
csv: null
|
|
23151
23256
|
},
|
|
23152
|
-
[
|
|
23153
|
-
...
|
|
23257
|
+
[Uy]: {
|
|
23258
|
+
...Ky,
|
|
23154
23259
|
...i,
|
|
23155
23260
|
...o,
|
|
23156
|
-
...
|
|
23157
|
-
...
|
|
23158
|
-
engine:
|
|
23261
|
+
...Jy,
|
|
23262
|
+
...qy,
|
|
23263
|
+
engine: Uy
|
|
23159
23264
|
},
|
|
23160
|
-
[
|
|
23161
|
-
...
|
|
23265
|
+
[Wy]: {
|
|
23266
|
+
...Ky,
|
|
23162
23267
|
...s,
|
|
23163
|
-
engine:
|
|
23268
|
+
engine: Wy
|
|
23164
23269
|
},
|
|
23165
|
-
[
|
|
23166
|
-
...
|
|
23270
|
+
[Gy]: {
|
|
23271
|
+
...Ky,
|
|
23167
23272
|
...s,
|
|
23168
|
-
engine:
|
|
23273
|
+
engine: Gy
|
|
23169
23274
|
}
|
|
23170
23275
|
}[e] ?? {};
|
|
23171
23276
|
}
|
|
23172
|
-
var
|
|
23277
|
+
var Xy = void 0;
|
|
23173
23278
|
typeof Xa == "function" && Xa((e) => {
|
|
23174
|
-
|
|
23279
|
+
Xy = e.scrape;
|
|
23175
23280
|
});
|
|
23176
|
-
function
|
|
23281
|
+
function Zy(e) {
|
|
23177
23282
|
let t = {};
|
|
23178
23283
|
for (let n in e) e[n] !== null && (t[n] = e[n]);
|
|
23179
23284
|
return t;
|
|
23180
23285
|
}
|
|
23181
|
-
var
|
|
23182
|
-
function
|
|
23183
|
-
let t =
|
|
23184
|
-
return t.length === 0 ? null : (e &&
|
|
23286
|
+
var Qy = 0;
|
|
23287
|
+
function $y(e = !1) {
|
|
23288
|
+
let t = Xy?.serpApiKey?.split(",").map((e) => e.trim()).filter(Boolean) || [];
|
|
23289
|
+
return t.length === 0 ? null : (e && Qy++, Qy < t.length ? t[Qy] : null);
|
|
23185
23290
|
}
|
|
23186
|
-
var
|
|
23291
|
+
var eb = async (e, t) => {
|
|
23187
23292
|
let n = (n) => {
|
|
23188
|
-
let r =
|
|
23189
|
-
...
|
|
23293
|
+
let r = Zy({
|
|
23294
|
+
...Yy(t),
|
|
23190
23295
|
api_key: n,
|
|
23191
23296
|
q: e
|
|
23192
23297
|
});
|
|
23193
|
-
return console.log(
|
|
23194
|
-
}, r =
|
|
23298
|
+
return console.log(Ry, r), `${Ry}?${new URLSearchParams(r)}`;
|
|
23299
|
+
}, r = $y();
|
|
23195
23300
|
for (; r;) try {
|
|
23196
23301
|
return await nn(n(r));
|
|
23197
23302
|
} catch (e) {
|
|
23198
23303
|
if (e?.error === "quota_exceeded") {
|
|
23199
|
-
console.warn(`SerpApi: invalid api key: ${r}`, e), r =
|
|
23304
|
+
console.warn(`SerpApi: invalid api key: ${r}`, e), r = $y(!0);
|
|
23200
23305
|
continue;
|
|
23201
23306
|
}
|
|
23202
23307
|
throw console.error(`SerpApi: ${r}`, e), e;
|
|
23203
23308
|
}
|
|
23204
23309
|
return null;
|
|
23205
|
-
},
|
|
23310
|
+
}, tb = async (e, t, n) => {
|
|
23206
23311
|
let r = `${to}/${bt(t)}/${bt(e)}`, i = await n.read(r);
|
|
23207
23312
|
if (i) return i;
|
|
23208
|
-
let a = await
|
|
23313
|
+
let a = await eb(e, t);
|
|
23209
23314
|
return a ? n.set(r, a) : console.warn(`SerpApi ${t}: No Result`), a ?? {};
|
|
23210
|
-
},
|
|
23211
|
-
googleSearch: async (t) =>
|
|
23212
|
-
googleImages: async (t) =>
|
|
23213
|
-
googleAutocomplete: async (t) =>
|
|
23214
|
-
googleTrends: async (t) =>
|
|
23215
|
-
googleMaps: async (t) =>
|
|
23216
|
-
googleMapsPhotos: async (t) =>
|
|
23217
|
-
googleMapsReviews: async (t) =>
|
|
23218
|
-
}),
|
|
23315
|
+
}, nb = (e) => ({
|
|
23316
|
+
googleSearch: async (t) => tb(t, zy, e),
|
|
23317
|
+
googleImages: async (t) => tb(t, By, e),
|
|
23318
|
+
googleAutocomplete: async (t) => tb(t, Vy, e),
|
|
23319
|
+
googleTrends: async (t) => tb(t, Hy, e),
|
|
23320
|
+
googleMaps: async (t) => tb(t, Uy, e),
|
|
23321
|
+
googleMapsPhotos: async (t) => tb(t, Wy, e),
|
|
23322
|
+
googleMapsReviews: async (t) => tb(t, Gy, e)
|
|
23323
|
+
}), rb = {
|
|
23219
23324
|
"+": "+",
|
|
23220
23325
|
"﹢": "+",
|
|
23221
23326
|
"-": "-",
|
|
@@ -23290,7 +23395,7 @@ var Qy = async (e, t) => {
|
|
|
23290
23395
|
x: "x",
|
|
23291
23396
|
y: "y",
|
|
23292
23397
|
z: "z"
|
|
23293
|
-
},
|
|
23398
|
+
}, ib = {
|
|
23294
23399
|
email: {
|
|
23295
23400
|
description: "Email: no spaces -> Lower/Trim",
|
|
23296
23401
|
transformations: [{
|
|
@@ -23336,7 +23441,7 @@ var Qy = async (e, t) => {
|
|
|
23336
23441
|
transformations: [],
|
|
23337
23442
|
mask: ["toSlug"]
|
|
23338
23443
|
}
|
|
23339
|
-
},
|
|
23444
|
+
}, ab = [
|
|
23340
23445
|
{
|
|
23341
23446
|
pattern: "email*",
|
|
23342
23447
|
use: "email"
|
|
@@ -23353,24 +23458,24 @@ var Qy = async (e, t) => {
|
|
|
23353
23458
|
pattern: "date*",
|
|
23354
23459
|
use: "date"
|
|
23355
23460
|
}
|
|
23356
|
-
],
|
|
23357
|
-
function
|
|
23358
|
-
return e ? e.normalize("NFKC").replace(
|
|
23461
|
+
], ob = new RegExp(Object.keys(rb).join("|"), "g");
|
|
23462
|
+
function sb(e) {
|
|
23463
|
+
return e ? e.normalize("NFKC").replace(ob, (e) => rb[e] ?? e) : "";
|
|
23359
23464
|
}
|
|
23360
|
-
var
|
|
23465
|
+
var cb = class {
|
|
23361
23466
|
config;
|
|
23362
23467
|
matches;
|
|
23363
23468
|
constructor(e = {}, t = []) {
|
|
23364
23469
|
this.config = {
|
|
23365
|
-
...
|
|
23470
|
+
...ib,
|
|
23366
23471
|
...e
|
|
23367
|
-
}, this.matches = [...
|
|
23472
|
+
}, this.matches = [...ab, ...t];
|
|
23368
23473
|
}
|
|
23369
23474
|
apply(e, t, n = !1) {
|
|
23370
23475
|
let r = this.config[e];
|
|
23371
23476
|
if (!r) return n ? Jt(t) : t;
|
|
23372
23477
|
let i = t;
|
|
23373
|
-
i =
|
|
23478
|
+
i = sb(String(i ?? ""));
|
|
23374
23479
|
let a = r.exclusions;
|
|
23375
23480
|
if (Array.isArray(a) && a.length) {
|
|
23376
23481
|
let e = String(i).toLowerCase();
|
|
@@ -23429,7 +23534,7 @@ var ob = class {
|
|
|
23429
23534
|
};
|
|
23430
23535
|
//#endregion
|
|
23431
23536
|
//#region src/libs/csv.ts
|
|
23432
|
-
function
|
|
23537
|
+
function lb(e, t) {
|
|
23433
23538
|
let n = ze.parse(e, {
|
|
23434
23539
|
header: !0,
|
|
23435
23540
|
skipEmptyLines: !0,
|
|
@@ -23442,6 +23547,6 @@ function sb(e, t) {
|
|
|
23442
23547
|
};
|
|
23443
23548
|
}
|
|
23444
23549
|
//#endregion
|
|
23445
|
-
export { Eu as AIProvider,
|
|
23550
|
+
export { Eu as AIProvider, ny as AI_PROVIDER_DEFINITIONS, iy as AI_PROVIDER_DESCRIPTORS, l as AI_PROVIDER_HOSTS, ri as ActionButton, fm as AddressAutocomplete, cs as Alert, gc as AnimatedNumber, Bv as App, zv 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, J_ as CLOUDFLARE_PROVIDER_DESCRIPTOR, ed as CONTEXT_MENU_SEARCH_THRESHOLD, mc as CalendarHeatmap, Ki as Card, Ea as Carousel, Ys as ChartDataTable, qs as ChartLegend, Jh as ChatMarkdown, sg as ChatQuestions, Xh as ChatReasoning, Ad as Chatbot, nl as Checkbox, Sl as Checklist, ks as Code, vf as CodeEditor, Qd as CodeSyntaxError, lr as Col, qc as Color, Qs as ColumnChart, Uf as Component, Wf as ComponentBlock, sr as Container, _d as ContextMenu, Kl as CropImage, qm as DEFAULT_DOCUMENT_HEAD, Km as DEFAULT_HEAD_APP_NAME, Jm as DEFAULT_LANGUAGE_HEAD, sl as DEFAULT_ORDER, zi as DataProvider, Jc as Date, Xc as DateTime, ds as DescriptionList, Xv as DirectApiProviderAdapter, tc as DivergingBarChart, Iy as DropBoxConnectButton, m_ as DropboxAuthProvider, la as Dropdown, da as DropdownButton, ma as DropdownDivider, pa as DropdownHeader, fa as DropdownItem, ha as DropdownMenu, ey as EMAIL_PROVIDER_DEFINITIONS, Gc as Email, Bg as EmailProvider, Bc as FieldError, $l as FileNameEditor, Qv as FirebaseApiProviderAdapter, s_ as FirebaseAuthProvider, r_ as FirebaseDataProvider, Jo as FirebaseStorageProvider, So as FirestoreDataProvider, vp as Form, rp as FormControllerContext, ug as Gallery, g_ as GitHubAuthProvider, y_ as GmailEmailProvider, ai as GoSite, Rg as GoogleAuthProvider, $p as GoogleMapsProvider, f_ as GoogleServiceAccountProvider, Tg as Grid, wg as GridArray, Cg as GridCore, Am as GridDB, dg as GridGalleryView, Um as GridTableView, Ch as Head, dh 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, Zp as LayoutBuilder, ac as LineChart, hm as ListCard, ol as ListGroup, Vi as Loader, ni as LoadingButton, vc as LocaleSwitcher, Er as LucideIconProvider, jh as MarkdownReader, dc as MeasureBarList, sa as Menu, Zv as MockApiProviderAdapter, Ho as MockDataProvider, ra as Modal, oa as ModalOk, aa as ModalYesNo, Qc as Month, rb as NORMALIZE_MAP, Oa as Notifications, Wc as Number, ay as OPENAI_COMPATIBLE_PROVIDER_DESCRIPTOR, ul as Order, ty as PUBLISH_PROVIDER_DEFINITIONS, Eg as PageUsers, lg as Pagination, Kc as Password, wc as Percentage, kr as PhosphorIconProvider, Hd as Prompt, jd as PromptMode, $u as PromptUtils, as as ProviderSwitcher, $c as Range, oi as ReferSite, kp as Repeat, Bf as RichText, cr as Row, t as SERVER_CREDENTIAL_PREFIX, cb as Sanitizer, cc as ScatterChart, Aa as Search, yl as Select, ec as SequenceColumnChart, Dm as SideNav, _m as SortableList, sc as Sparkline, $s as StackedColumnChart, Fl as StorageProvider, Uc as String, $v as SupabaseApiProviderAdapter, x_ as SupabaseAuthProvider, Fo as SupabaseDataProvider, Yo as SupabaseStorageProvider, rl as Switch, Lp as Tab, cg as TabDynamic, Fp as TabItem, Pp as TabLayouts, Bp as Table, al as TextArea, Ba as ThemeSwitcher, Yc as Time, Na as Toolbar, hs as Tree, pm 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, pd 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, sy as createAIProviderRegistry, q_ as createCloudflareProviderDefinition, vr as createMotionTransition, cy as createServerCredentialAIRegistry, Bn as createTranslations, ht as decodeJWT, zn as defineLocaleMessages, xt as dirname, Ly 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, Ku as getAIModelCatalog, Fi as getAccessToken, ud as getAutoClosedSuffixLength, lf as getCodeValidationResult, ou as getFileUrl, fi as getGlobalVars, hy as getGoogleTrendsData, gy as getGoogleTrendsRelated, my as getKeywordIdeas, Si as getProviderConfigurationState, Wt as getRecordValue, jp as getTabLayoutConfig, Np as getTabPaneClassName, Mp as getTabTriggerClassName, __ as googleGetAccessToken, vd as groupModelOptions, ld as hasAutoClosedSuffix, Ms as identiconPattern, Vn as interpolate, jt as intersectObjects, n as isAIProviderTarget, ur as isBadgeDescriptor, Pt as isEmpty, Su as isFreeAIModel, bd as isFreeModelOption, Bt as isInteractiveElement, Lu as isProxyEnabled, dl as labelText, rm as loadGoogleMaps, c as loadModelIdentityIndex, At as loadScripts, qv as locales, dd as matchCommandTrigger, i as modelOffers, gm as moveItem, Rs as niceMax, dr as normalizeBadgeProps, bt as normalizeKey, vt as normalizePath, sb as normalizeVisualChars, wu as parseAIModelRef, lb as parseCsvText, vi as path, Fu as proxyFetch, qt as recordsEqual, Zo as registerProviderSessionFactory, mi as removeGlobalVars, Vt as render2Base64, Bh as repairStreamingMarkdown, Et as replacePlaceholders, Mt as replaceVariables, e as resolveModel, yr as resolveMotionEffect, Zd as runPrompt, It as safeClone, zt as sanitizeKey, nb as scrape, v_ as sendEmail, r as serverCredential, pi as setGlobalVars, St as sleep, Jt as smartTypeCast, Tt as substrCount, zs as ticks, ry 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, Jv as useApiProvider, bh as useAssetsHead, _i as useAuthProvider, Bs as useChartFormat, Js as useChartTooltip, Ks as useChartWidth, Wg as useCredentialsProvider, Bi as useDataProvider, yh as useDocumentHead, Fy as useDropBoxConnect, Ec as useEditorHeight, Vg as useEmailProvider, Cr as useEnterMotion, eu as useFileUploadCore, ap as useFormActions, mp as useFormContext, ip as useFormController, di as useGlobalVars, em as useGoogleMapsConfig, mh as useHead, gh as useHeadLinks, Y as useI18n, zr as useIconController, Rr as useIconProvider, Dl as useImage, vh as useLanguageHead, Vv as useMenu, br as useMotionEffect, xr as useMotionState, _h as usePaginationHead, Sr as usePressMotion, Ga as useProvider, rs as useProviderSession, Iu as useProxy, xh as usePwaHead, Ws as useReveal, Sh as useSchemaOrgHead, Wa as useSetProvider, hh as useSocialHead, Il as useStorageProvider, J as useTheme, Ln as useThemeController, cf as validateCodeSyntax };
|
|
23446
23551
|
|
|
23447
23552
|
//# sourceMappingURL=index.mjs.map
|