@opentiny/next-remoter 0.3.1 → 0.3.2
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/components/TinyRobotChat.vue.d.ts +5 -3
- package/dist/composable/CustomAgentModelProvider.d.ts +2 -1
- package/dist/next-remoter-runtime.es.js +30618 -30416
- package/dist/next-remoter.cjs.js +31 -31
- package/dist/next-remoter.css +1 -1
- package/dist/next-remoter.es.js +681 -669
- package/dist/style.css +1 -1
- package/package.json +2 -2
package/dist/next-remoter.es.js
CHANGED
|
@@ -209,8 +209,8 @@ function J1(t) {
|
|
|
209
209
|
let f = "", g = !0, m, v = "", x = "";
|
|
210
210
|
function A(M) {
|
|
211
211
|
const P = g ? M.replace(/^\xEF\xBB\xBF/, "") : M, [j, Z] = Q1(`${f}${P}`);
|
|
212
|
-
for (const
|
|
213
|
-
_(
|
|
212
|
+
for (const U of j)
|
|
213
|
+
_(U);
|
|
214
214
|
f = Z, g = !1;
|
|
215
215
|
}
|
|
216
216
|
function _(M) {
|
|
@@ -224,8 +224,8 @@ function J1(t) {
|
|
|
224
224
|
}
|
|
225
225
|
const P = M.indexOf(":");
|
|
226
226
|
if (P !== -1) {
|
|
227
|
-
const j = M.slice(0, P), Z = M[P + 1] === " " ? 2 : 1,
|
|
228
|
-
D(j,
|
|
227
|
+
const j = M.slice(0, P), Z = M[P + 1] === " " ? 2 : 1, U = M.slice(P + Z);
|
|
228
|
+
D(j, U, M);
|
|
229
229
|
return;
|
|
230
230
|
}
|
|
231
231
|
D(M, "", M);
|
|
@@ -316,7 +316,7 @@ class Mc extends TransformStream {
|
|
|
316
316
|
});
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
|
-
function
|
|
319
|
+
function ee(t, r, o) {
|
|
320
320
|
function c(m, v) {
|
|
321
321
|
var x;
|
|
322
322
|
Object.defineProperty(m, "_zod", {
|
|
@@ -614,7 +614,7 @@ const Lc = (t, r) => {
|
|
|
614
614
|
value: () => t.message,
|
|
615
615
|
enumerable: !1
|
|
616
616
|
});
|
|
617
|
-
}, Fc =
|
|
617
|
+
}, Fc = ee("$ZodError", Lc), Uc = ee("$ZodError", Lc, { Parent: Error });
|
|
618
618
|
function f0(t, r = (o) => o.message) {
|
|
619
619
|
const o = {}, c = [];
|
|
620
620
|
for (const u of t.issues)
|
|
@@ -697,14 +697,14 @@ function F0(t) {
|
|
|
697
697
|
const U0 = (t) => {
|
|
698
698
|
const r = t ? `[\\s\\S]{${t?.minimum ?? 0},${t?.maximum ?? ""}}` : "[\\s\\S]*";
|
|
699
699
|
return new RegExp(`^${r}$`);
|
|
700
|
-
}, z0 = /^\d+$/, Z0 = /^-?\d+(?:\.\d+)?/i, $0 = /true|false/i, V0 = /null/i, H0 = /^[^A-Z]*$/, W0 = /^[^a-z]*$/, hn = /* @__PURE__ */
|
|
700
|
+
}, z0 = /^\d+$/, Z0 = /^-?\d+(?:\.\d+)?/i, $0 = /true|false/i, V0 = /null/i, H0 = /^[^A-Z]*$/, W0 = /^[^a-z]*$/, hn = /* @__PURE__ */ ee("$ZodCheck", (t, r) => {
|
|
701
701
|
var o;
|
|
702
702
|
t._zod ?? (t._zod = {}), t._zod.def = r, (o = t._zod).onattach ?? (o.onattach = []);
|
|
703
703
|
}), Wc = {
|
|
704
704
|
number: "number",
|
|
705
705
|
bigint: "bigint",
|
|
706
706
|
object: "date"
|
|
707
|
-
}, jc = /* @__PURE__ */
|
|
707
|
+
}, jc = /* @__PURE__ */ ee("$ZodCheckLessThan", (t, r) => {
|
|
708
708
|
hn.init(t, r);
|
|
709
709
|
const o = Wc[typeof r.value];
|
|
710
710
|
t._zod.onattach.push((c) => {
|
|
@@ -721,7 +721,7 @@ const U0 = (t) => {
|
|
|
721
721
|
continue: !r.abort
|
|
722
722
|
});
|
|
723
723
|
};
|
|
724
|
-
}), Gc = /* @__PURE__ */
|
|
724
|
+
}), Gc = /* @__PURE__ */ ee("$ZodCheckGreaterThan", (t, r) => {
|
|
725
725
|
hn.init(t, r);
|
|
726
726
|
const o = Wc[typeof r.value];
|
|
727
727
|
t._zod.onattach.push((c) => {
|
|
@@ -738,7 +738,7 @@ const U0 = (t) => {
|
|
|
738
738
|
continue: !r.abort
|
|
739
739
|
});
|
|
740
740
|
};
|
|
741
|
-
}), j0 = /* @__PURE__ */
|
|
741
|
+
}), j0 = /* @__PURE__ */ ee("$ZodCheckMultipleOf", (t, r) => {
|
|
742
742
|
hn.init(t, r), t._zod.onattach.push((o) => {
|
|
743
743
|
var c;
|
|
744
744
|
(c = o._zod.bag).multipleOf ?? (c.multipleOf = r.value);
|
|
@@ -754,7 +754,7 @@ const U0 = (t) => {
|
|
|
754
754
|
continue: !r.abort
|
|
755
755
|
});
|
|
756
756
|
};
|
|
757
|
-
}), G0 = /* @__PURE__ */
|
|
757
|
+
}), G0 = /* @__PURE__ */ ee("$ZodCheckNumberFormat", (t, r) => {
|
|
758
758
|
hn.init(t, r), r.format = r.format || "float64";
|
|
759
759
|
const o = r.format?.includes("int"), c = o ? "int" : "number", [u, f] = o0[r.format];
|
|
760
760
|
t._zod.onattach.push((g) => {
|
|
@@ -810,7 +810,7 @@ const U0 = (t) => {
|
|
|
810
810
|
inst: t
|
|
811
811
|
});
|
|
812
812
|
};
|
|
813
|
-
}), X0 = /* @__PURE__ */
|
|
813
|
+
}), X0 = /* @__PURE__ */ ee("$ZodCheckMaxLength", (t, r) => {
|
|
814
814
|
var o;
|
|
815
815
|
hn.init(t, r), (o = t._zod.def).when ?? (o.when = (c) => {
|
|
816
816
|
const u = c.value;
|
|
@@ -833,7 +833,7 @@ const U0 = (t) => {
|
|
|
833
833
|
continue: !r.abort
|
|
834
834
|
});
|
|
835
835
|
};
|
|
836
|
-
}), q0 = /* @__PURE__ */
|
|
836
|
+
}), q0 = /* @__PURE__ */ ee("$ZodCheckMinLength", (t, r) => {
|
|
837
837
|
var o;
|
|
838
838
|
hn.init(t, r), (o = t._zod.def).when ?? (o.when = (c) => {
|
|
839
839
|
const u = c.value;
|
|
@@ -856,7 +856,7 @@ const U0 = (t) => {
|
|
|
856
856
|
continue: !r.abort
|
|
857
857
|
});
|
|
858
858
|
};
|
|
859
|
-
}), Y0 = /* @__PURE__ */
|
|
859
|
+
}), Y0 = /* @__PURE__ */ ee("$ZodCheckLengthEquals", (t, r) => {
|
|
860
860
|
var o;
|
|
861
861
|
hn.init(t, r), (o = t._zod.def).when ?? (o.when = (c) => {
|
|
862
862
|
const u = c.value;
|
|
@@ -879,7 +879,7 @@ const U0 = (t) => {
|
|
|
879
879
|
continue: !r.abort
|
|
880
880
|
});
|
|
881
881
|
};
|
|
882
|
-
}), io = /* @__PURE__ */
|
|
882
|
+
}), io = /* @__PURE__ */ ee("$ZodCheckStringFormat", (t, r) => {
|
|
883
883
|
var o, c;
|
|
884
884
|
hn.init(t, r), t._zod.onattach.push((u) => {
|
|
885
885
|
const f = u._zod.bag;
|
|
@@ -896,7 +896,7 @@ const U0 = (t) => {
|
|
|
896
896
|
});
|
|
897
897
|
}) : (c = t._zod).check ?? (c.check = () => {
|
|
898
898
|
});
|
|
899
|
-
}), K0 = /* @__PURE__ */
|
|
899
|
+
}), K0 = /* @__PURE__ */ ee("$ZodCheckRegex", (t, r) => {
|
|
900
900
|
io.init(t, r), t._zod.check = (o) => {
|
|
901
901
|
r.pattern.lastIndex = 0, !r.pattern.test(o.value) && o.issues.push({
|
|
902
902
|
origin: "string",
|
|
@@ -908,11 +908,11 @@ const U0 = (t) => {
|
|
|
908
908
|
continue: !r.abort
|
|
909
909
|
});
|
|
910
910
|
};
|
|
911
|
-
}), J0 = /* @__PURE__ */
|
|
911
|
+
}), J0 = /* @__PURE__ */ ee("$ZodCheckLowerCase", (t, r) => {
|
|
912
912
|
r.pattern ?? (r.pattern = H0), io.init(t, r);
|
|
913
|
-
}), Q0 = /* @__PURE__ */
|
|
913
|
+
}), Q0 = /* @__PURE__ */ ee("$ZodCheckUpperCase", (t, r) => {
|
|
914
914
|
r.pattern ?? (r.pattern = W0), io.init(t, r);
|
|
915
|
-
}), ef = /* @__PURE__ */
|
|
915
|
+
}), ef = /* @__PURE__ */ ee("$ZodCheckIncludes", (t, r) => {
|
|
916
916
|
hn.init(t, r);
|
|
917
917
|
const o = wi(r.includes), c = new RegExp(typeof r.position == "number" ? `^.{${r.position}}${o}` : o);
|
|
918
918
|
r.pattern = c, t._zod.onattach.push((u) => {
|
|
@@ -929,7 +929,7 @@ const U0 = (t) => {
|
|
|
929
929
|
continue: !r.abort
|
|
930
930
|
});
|
|
931
931
|
};
|
|
932
|
-
}), tf = /* @__PURE__ */
|
|
932
|
+
}), tf = /* @__PURE__ */ ee("$ZodCheckStartsWith", (t, r) => {
|
|
933
933
|
hn.init(t, r);
|
|
934
934
|
const o = new RegExp(`^${wi(r.prefix)}.*`);
|
|
935
935
|
r.pattern ?? (r.pattern = o), t._zod.onattach.push((c) => {
|
|
@@ -946,7 +946,7 @@ const U0 = (t) => {
|
|
|
946
946
|
continue: !r.abort
|
|
947
947
|
});
|
|
948
948
|
};
|
|
949
|
-
}), nf = /* @__PURE__ */
|
|
949
|
+
}), nf = /* @__PURE__ */ ee("$ZodCheckEndsWith", (t, r) => {
|
|
950
950
|
hn.init(t, r);
|
|
951
951
|
const o = new RegExp(`.*${wi(r.suffix)}$`);
|
|
952
952
|
r.pattern ?? (r.pattern = o), t._zod.onattach.push((c) => {
|
|
@@ -963,7 +963,7 @@ const U0 = (t) => {
|
|
|
963
963
|
continue: !r.abort
|
|
964
964
|
});
|
|
965
965
|
};
|
|
966
|
-
}), rf = /* @__PURE__ */
|
|
966
|
+
}), rf = /* @__PURE__ */ ee("$ZodCheckOverwrite", (t, r) => {
|
|
967
967
|
hn.init(t, r), t._zod.check = (o) => {
|
|
968
968
|
o.value = r.tx(o.value);
|
|
969
969
|
};
|
|
@@ -995,7 +995,7 @@ const sf = {
|
|
|
995
995
|
major: 4,
|
|
996
996
|
minor: 0,
|
|
997
997
|
patch: 0
|
|
998
|
-
}, ft = /* @__PURE__ */
|
|
998
|
+
}, ft = /* @__PURE__ */ ee("$ZodType", (t, r) => {
|
|
999
999
|
var o;
|
|
1000
1000
|
t ?? (t = {}), t._zod.def = r, t._zod.bag = t._zod.bag || {}, t._zod.version = sf;
|
|
1001
1001
|
const c = [...t._zod.def.checks ?? []];
|
|
@@ -1053,7 +1053,7 @@ const sf = {
|
|
|
1053
1053
|
vendor: "zod",
|
|
1054
1054
|
version: 1
|
|
1055
1055
|
};
|
|
1056
|
-
}), _s = /* @__PURE__ */
|
|
1056
|
+
}), _s = /* @__PURE__ */ ee("$ZodString", (t, r) => {
|
|
1057
1057
|
ft.init(t, r), t._zod.pattern = [...t?._zod.bag?.patterns ?? []].pop() ?? U0(t._zod.bag), t._zod.parse = (o, c) => {
|
|
1058
1058
|
if (r.coerce)
|
|
1059
1059
|
try {
|
|
@@ -1067,11 +1067,11 @@ const sf = {
|
|
|
1067
1067
|
inst: t
|
|
1068
1068
|
}), o;
|
|
1069
1069
|
};
|
|
1070
|
-
}), Ct = /* @__PURE__ */
|
|
1070
|
+
}), Ct = /* @__PURE__ */ ee("$ZodStringFormat", (t, r) => {
|
|
1071
1071
|
io.init(t, r), _s.init(t, r);
|
|
1072
|
-
}), af = /* @__PURE__ */
|
|
1072
|
+
}), af = /* @__PURE__ */ ee("$ZodGUID", (t, r) => {
|
|
1073
1073
|
r.pattern ?? (r.pattern = E0), Ct.init(t, r);
|
|
1074
|
-
}), lf = /* @__PURE__ */
|
|
1074
|
+
}), lf = /* @__PURE__ */ ee("$ZodUUID", (t, r) => {
|
|
1075
1075
|
if (r.version) {
|
|
1076
1076
|
const c = {
|
|
1077
1077
|
v1: 1,
|
|
@@ -1089,9 +1089,9 @@ const sf = {
|
|
|
1089
1089
|
} else
|
|
1090
1090
|
r.pattern ?? (r.pattern = ra());
|
|
1091
1091
|
Ct.init(t, r);
|
|
1092
|
-
}), cf = /* @__PURE__ */
|
|
1092
|
+
}), cf = /* @__PURE__ */ ee("$ZodEmail", (t, r) => {
|
|
1093
1093
|
r.pattern ?? (r.pattern = I0), Ct.init(t, r);
|
|
1094
|
-
}), uf = /* @__PURE__ */
|
|
1094
|
+
}), uf = /* @__PURE__ */ ee("$ZodURL", (t, r) => {
|
|
1095
1095
|
Ct.init(t, r), t._zod.check = (o) => {
|
|
1096
1096
|
try {
|
|
1097
1097
|
const c = o.value, u = new URL(c), f = u.href;
|
|
@@ -1123,34 +1123,34 @@ const sf = {
|
|
|
1123
1123
|
});
|
|
1124
1124
|
}
|
|
1125
1125
|
};
|
|
1126
|
-
}), df = /* @__PURE__ */
|
|
1126
|
+
}), df = /* @__PURE__ */ ee("$ZodEmoji", (t, r) => {
|
|
1127
1127
|
r.pattern ?? (r.pattern = T0()), Ct.init(t, r);
|
|
1128
|
-
}), ff = /* @__PURE__ */
|
|
1128
|
+
}), ff = /* @__PURE__ */ ee("$ZodNanoID", (t, r) => {
|
|
1129
1129
|
r.pattern ?? (r.pattern = b0), Ct.init(t, r);
|
|
1130
|
-
}), hf = /* @__PURE__ */
|
|
1130
|
+
}), hf = /* @__PURE__ */ ee("$ZodCUID", (t, r) => {
|
|
1131
1131
|
r.pattern ?? (r.pattern = y0), Ct.init(t, r);
|
|
1132
|
-
}), pf = /* @__PURE__ */
|
|
1132
|
+
}), pf = /* @__PURE__ */ ee("$ZodCUID2", (t, r) => {
|
|
1133
1133
|
r.pattern ?? (r.pattern = w0), Ct.init(t, r);
|
|
1134
|
-
}), gf = /* @__PURE__ */
|
|
1134
|
+
}), gf = /* @__PURE__ */ ee("$ZodULID", (t, r) => {
|
|
1135
1135
|
r.pattern ?? (r.pattern = _0), Ct.init(t, r);
|
|
1136
|
-
}), mf = /* @__PURE__ */
|
|
1136
|
+
}), mf = /* @__PURE__ */ ee("$ZodXID", (t, r) => {
|
|
1137
1137
|
r.pattern ?? (r.pattern = v0), Ct.init(t, r);
|
|
1138
|
-
}), xf = /* @__PURE__ */
|
|
1138
|
+
}), xf = /* @__PURE__ */ ee("$ZodKSUID", (t, r) => {
|
|
1139
1139
|
r.pattern ?? (r.pattern = C0), Ct.init(t, r);
|
|
1140
|
-
}), yf = /* @__PURE__ */
|
|
1140
|
+
}), yf = /* @__PURE__ */ ee("$ZodISODateTime", (t, r) => {
|
|
1141
1141
|
r.pattern ?? (r.pattern = F0(r)), Ct.init(t, r);
|
|
1142
|
-
}), wf = /* @__PURE__ */
|
|
1142
|
+
}), wf = /* @__PURE__ */ ee("$ZodISODate", (t, r) => {
|
|
1143
1143
|
r.pattern ?? (r.pattern = B0), Ct.init(t, r);
|
|
1144
|
-
}), _f = /* @__PURE__ */
|
|
1144
|
+
}), _f = /* @__PURE__ */ ee("$ZodISOTime", (t, r) => {
|
|
1145
1145
|
r.pattern ?? (r.pattern = L0(r)), Ct.init(t, r);
|
|
1146
|
-
}), vf = /* @__PURE__ */
|
|
1146
|
+
}), vf = /* @__PURE__ */ ee("$ZodISODuration", (t, r) => {
|
|
1147
1147
|
r.pattern ?? (r.pattern = A0), Ct.init(t, r);
|
|
1148
|
-
}), Cf = /* @__PURE__ */
|
|
1148
|
+
}), Cf = /* @__PURE__ */ ee("$ZodIPv4", (t, r) => {
|
|
1149
1149
|
r.pattern ?? (r.pattern = N0), Ct.init(t, r), t._zod.onattach.push((o) => {
|
|
1150
1150
|
const c = o._zod.bag;
|
|
1151
1151
|
c.format = "ipv4";
|
|
1152
1152
|
});
|
|
1153
|
-
}), bf = /* @__PURE__ */
|
|
1153
|
+
}), bf = /* @__PURE__ */ ee("$ZodIPv6", (t, r) => {
|
|
1154
1154
|
r.pattern ?? (r.pattern = O0), Ct.init(t, r), t._zod.onattach.push((o) => {
|
|
1155
1155
|
const c = o._zod.bag;
|
|
1156
1156
|
c.format = "ipv6";
|
|
@@ -1167,9 +1167,9 @@ const sf = {
|
|
|
1167
1167
|
});
|
|
1168
1168
|
}
|
|
1169
1169
|
};
|
|
1170
|
-
}), Af = /* @__PURE__ */
|
|
1170
|
+
}), Af = /* @__PURE__ */ ee("$ZodCIDRv4", (t, r) => {
|
|
1171
1171
|
r.pattern ?? (r.pattern = k0), Ct.init(t, r);
|
|
1172
|
-
}), Ef = /* @__PURE__ */
|
|
1172
|
+
}), Ef = /* @__PURE__ */ ee("$ZodCIDRv6", (t, r) => {
|
|
1173
1173
|
r.pattern ?? (r.pattern = R0), Ct.init(t, r), t._zod.check = (o) => {
|
|
1174
1174
|
const [c, u] = o.value.split("/");
|
|
1175
1175
|
try {
|
|
@@ -1203,7 +1203,7 @@ function Xc(t) {
|
|
|
1203
1203
|
return !1;
|
|
1204
1204
|
}
|
|
1205
1205
|
}
|
|
1206
|
-
const If = /* @__PURE__ */
|
|
1206
|
+
const If = /* @__PURE__ */ ee("$ZodBase64", (t, r) => {
|
|
1207
1207
|
r.pattern ?? (r.pattern = M0), Ct.init(t, r), t._zod.onattach.push((o) => {
|
|
1208
1208
|
o._zod.bag.contentEncoding = "base64";
|
|
1209
1209
|
}), t._zod.check = (o) => {
|
|
@@ -1222,7 +1222,7 @@ function Sf(t) {
|
|
|
1222
1222
|
const r = t.replace(/[-_]/g, (c) => c === "-" ? "+" : "/"), o = r.padEnd(Math.ceil(r.length / 4) * 4, "=");
|
|
1223
1223
|
return Xc(o);
|
|
1224
1224
|
}
|
|
1225
|
-
const Tf = /* @__PURE__ */
|
|
1225
|
+
const Tf = /* @__PURE__ */ ee("$ZodBase64URL", (t, r) => {
|
|
1226
1226
|
r.pattern ?? (r.pattern = $c), Ct.init(t, r), t._zod.onattach.push((o) => {
|
|
1227
1227
|
o._zod.bag.contentEncoding = "base64url";
|
|
1228
1228
|
}), t._zod.check = (o) => {
|
|
@@ -1234,7 +1234,7 @@ const Tf = /* @__PURE__ */ Q("$ZodBase64URL", (t, r) => {
|
|
|
1234
1234
|
continue: !r.abort
|
|
1235
1235
|
});
|
|
1236
1236
|
};
|
|
1237
|
-
}), Nf = /* @__PURE__ */
|
|
1237
|
+
}), Nf = /* @__PURE__ */ ee("$ZodE164", (t, r) => {
|
|
1238
1238
|
r.pattern ?? (r.pattern = P0), Ct.init(t, r);
|
|
1239
1239
|
});
|
|
1240
1240
|
function Of(t, r = null) {
|
|
@@ -1251,7 +1251,7 @@ function Of(t, r = null) {
|
|
|
1251
1251
|
return !1;
|
|
1252
1252
|
}
|
|
1253
1253
|
}
|
|
1254
|
-
const kf = /* @__PURE__ */
|
|
1254
|
+
const kf = /* @__PURE__ */ ee("$ZodJWT", (t, r) => {
|
|
1255
1255
|
Ct.init(t, r), t._zod.check = (o) => {
|
|
1256
1256
|
Of(o.value, r.alg) || o.issues.push({
|
|
1257
1257
|
code: "invalid_format",
|
|
@@ -1261,7 +1261,7 @@ const kf = /* @__PURE__ */ Q("$ZodJWT", (t, r) => {
|
|
|
1261
1261
|
continue: !r.abort
|
|
1262
1262
|
});
|
|
1263
1263
|
};
|
|
1264
|
-
}), qc = /* @__PURE__ */
|
|
1264
|
+
}), qc = /* @__PURE__ */ ee("$ZodNumber", (t, r) => {
|
|
1265
1265
|
ft.init(t, r), t._zod.pattern = t._zod.bag.pattern ?? Z0, t._zod.parse = (o, c) => {
|
|
1266
1266
|
if (r.coerce)
|
|
1267
1267
|
try {
|
|
@@ -1280,9 +1280,9 @@ const kf = /* @__PURE__ */ Q("$ZodJWT", (t, r) => {
|
|
|
1280
1280
|
...f ? { received: f } : {}
|
|
1281
1281
|
}), o;
|
|
1282
1282
|
};
|
|
1283
|
-
}), Rf = /* @__PURE__ */
|
|
1283
|
+
}), Rf = /* @__PURE__ */ ee("$ZodNumber", (t, r) => {
|
|
1284
1284
|
G0.init(t, r), qc.init(t, r);
|
|
1285
|
-
}), Mf = /* @__PURE__ */
|
|
1285
|
+
}), Mf = /* @__PURE__ */ ee("$ZodBoolean", (t, r) => {
|
|
1286
1286
|
ft.init(t, r), t._zod.pattern = $0, t._zod.parse = (o, c) => {
|
|
1287
1287
|
if (r.coerce)
|
|
1288
1288
|
try {
|
|
@@ -1297,7 +1297,7 @@ const kf = /* @__PURE__ */ Q("$ZodJWT", (t, r) => {
|
|
|
1297
1297
|
inst: t
|
|
1298
1298
|
}), o;
|
|
1299
1299
|
};
|
|
1300
|
-
}), Df = /* @__PURE__ */
|
|
1300
|
+
}), Df = /* @__PURE__ */ ee("$ZodNull", (t, r) => {
|
|
1301
1301
|
ft.init(t, r), t._zod.pattern = V0, t._zod.values = /* @__PURE__ */ new Set([null]), t._zod.parse = (o, c) => {
|
|
1302
1302
|
const u = o.value;
|
|
1303
1303
|
return u === null || o.issues.push({
|
|
@@ -1307,11 +1307,11 @@ const kf = /* @__PURE__ */ Q("$ZodJWT", (t, r) => {
|
|
|
1307
1307
|
inst: t
|
|
1308
1308
|
}), o;
|
|
1309
1309
|
};
|
|
1310
|
-
}), Pf = /* @__PURE__ */
|
|
1310
|
+
}), Pf = /* @__PURE__ */ ee("$ZodAny", (t, r) => {
|
|
1311
1311
|
ft.init(t, r), t._zod.parse = (o) => o;
|
|
1312
|
-
}), Bf = /* @__PURE__ */
|
|
1312
|
+
}), Bf = /* @__PURE__ */ ee("$ZodUnknown", (t, r) => {
|
|
1313
1313
|
ft.init(t, r), t._zod.parse = (o) => o;
|
|
1314
|
-
}), Lf = /* @__PURE__ */
|
|
1314
|
+
}), Lf = /* @__PURE__ */ ee("$ZodNever", (t, r) => {
|
|
1315
1315
|
ft.init(t, r), t._zod.parse = (o, c) => (o.issues.push({
|
|
1316
1316
|
expected: "never",
|
|
1317
1317
|
code: "invalid_type",
|
|
@@ -1322,7 +1322,7 @@ const kf = /* @__PURE__ */ Q("$ZodJWT", (t, r) => {
|
|
|
1322
1322
|
function ia(t, r, o) {
|
|
1323
1323
|
t.issues.length && r.issues.push(...Cr(o, t.issues)), r.value[o] = t.value;
|
|
1324
1324
|
}
|
|
1325
|
-
const Ff = /* @__PURE__ */
|
|
1325
|
+
const Ff = /* @__PURE__ */ ee("$ZodArray", (t, r) => {
|
|
1326
1326
|
ft.init(t, r), t._zod.parse = (o, c) => {
|
|
1327
1327
|
const u = o.value;
|
|
1328
1328
|
if (!Array.isArray(u))
|
|
@@ -1350,7 +1350,7 @@ function Pi(t, r, o) {
|
|
|
1350
1350
|
function oa(t, r, o, c) {
|
|
1351
1351
|
t.issues.length ? c[o] === void 0 ? o in c ? r.value[o] = void 0 : r.value[o] = t.value : r.issues.push(...Cr(o, t.issues)) : t.value === void 0 ? o in c && (r.value[o] = void 0) : r.value[o] = t.value;
|
|
1352
1352
|
}
|
|
1353
|
-
const Uf = /* @__PURE__ */
|
|
1353
|
+
const Uf = /* @__PURE__ */ ee("$ZodObject", (t, r) => {
|
|
1354
1354
|
ft.init(t, r);
|
|
1355
1355
|
const o = gs(() => {
|
|
1356
1356
|
const _ = Object.keys(r.shape);
|
|
@@ -1380,8 +1380,8 @@ const Uf = /* @__PURE__ */ Q("$ZodObject", (t, r) => {
|
|
|
1380
1380
|
});
|
|
1381
1381
|
const c = (_) => {
|
|
1382
1382
|
const D = new of(["shape", "payload", "ctx"]), N = o.value, R = (Z) => {
|
|
1383
|
-
const
|
|
1384
|
-
return `shape[${
|
|
1383
|
+
const U = Jr(Z);
|
|
1384
|
+
return `shape[${U}]._zod.run({ value: input[${U}], issues: [] }, ctx)`;
|
|
1385
1385
|
};
|
|
1386
1386
|
D.write("const input = payload.value;");
|
|
1387
1387
|
const M = /* @__PURE__ */ Object.create(null);
|
|
@@ -1391,40 +1391,40 @@ const Uf = /* @__PURE__ */ Q("$ZodObject", (t, r) => {
|
|
|
1391
1391
|
D.write("const newResult = {}");
|
|
1392
1392
|
for (const Z of N.keys)
|
|
1393
1393
|
if (N.optionalKeys.has(Z)) {
|
|
1394
|
-
const
|
|
1395
|
-
D.write(`const ${
|
|
1396
|
-
const
|
|
1394
|
+
const U = M[Z];
|
|
1395
|
+
D.write(`const ${U} = ${R(Z)};`);
|
|
1396
|
+
const Q = Jr(Z);
|
|
1397
1397
|
D.write(`
|
|
1398
|
-
if (${
|
|
1399
|
-
if (input[${
|
|
1400
|
-
if (${
|
|
1401
|
-
newResult[${
|
|
1398
|
+
if (${U}.issues.length) {
|
|
1399
|
+
if (input[${Q}] === undefined) {
|
|
1400
|
+
if (${Q} in input) {
|
|
1401
|
+
newResult[${Q}] = undefined;
|
|
1402
1402
|
}
|
|
1403
1403
|
} else {
|
|
1404
1404
|
payload.issues = payload.issues.concat(
|
|
1405
|
-
${
|
|
1405
|
+
${U}.issues.map((iss) => ({
|
|
1406
1406
|
...iss,
|
|
1407
|
-
path: iss.path ? [${
|
|
1407
|
+
path: iss.path ? [${Q}, ...iss.path] : [${Q}],
|
|
1408
1408
|
}))
|
|
1409
1409
|
);
|
|
1410
1410
|
}
|
|
1411
|
-
} else if (${
|
|
1412
|
-
if (${
|
|
1411
|
+
} else if (${U}.value === undefined) {
|
|
1412
|
+
if (${Q} in input) newResult[${Q}] = undefined;
|
|
1413
1413
|
} else {
|
|
1414
|
-
newResult[${
|
|
1414
|
+
newResult[${Q}] = ${U}.value;
|
|
1415
1415
|
}
|
|
1416
1416
|
`);
|
|
1417
1417
|
} else {
|
|
1418
|
-
const
|
|
1419
|
-
D.write(`const ${
|
|
1420
|
-
if (${
|
|
1418
|
+
const U = M[Z];
|
|
1419
|
+
D.write(`const ${U} = ${R(Z)};`), D.write(`
|
|
1420
|
+
if (${U}.issues.length) payload.issues = payload.issues.concat(${U}.issues.map(iss => ({
|
|
1421
1421
|
...iss,
|
|
1422
1422
|
path: iss.path ? [${Jr(Z)}, ...iss.path] : [${Jr(Z)}]
|
|
1423
|
-
})));`), D.write(`newResult[${Jr(Z)}] = ${
|
|
1423
|
+
})));`), D.write(`newResult[${Jr(Z)}] = ${U}.value`);
|
|
1424
1424
|
}
|
|
1425
1425
|
D.write("payload.value = newResult;"), D.write("return payload;");
|
|
1426
1426
|
const j = D.compile();
|
|
1427
|
-
return (Z,
|
|
1427
|
+
return (Z, U) => j(_, Z, U);
|
|
1428
1428
|
};
|
|
1429
1429
|
let u;
|
|
1430
1430
|
const f = Gi, g = !Dc.jitless, v = g && n0.value, x = r.catchall;
|
|
@@ -1444,24 +1444,24 @@ const Uf = /* @__PURE__ */ Q("$ZodObject", (t, r) => {
|
|
|
1444
1444
|
u || (u = c(r.shape)), _ = u(_, D);
|
|
1445
1445
|
else {
|
|
1446
1446
|
_.value = {};
|
|
1447
|
-
const
|
|
1448
|
-
for (const
|
|
1449
|
-
const Y =
|
|
1450
|
-
z instanceof Promise ? R.push(z.then((
|
|
1447
|
+
const U = A.shape;
|
|
1448
|
+
for (const Q of A.keys) {
|
|
1449
|
+
const Y = U[Q], z = Y._zod.run({ value: N[Q], issues: [] }, D), F = Y._zod.optin === "optional" && Y._zod.optout === "optional";
|
|
1450
|
+
z instanceof Promise ? R.push(z.then((K) => F ? oa(K, _, Q, N) : Pi(K, _, Q))) : F ? oa(z, _, Q, N) : Pi(z, _, Q);
|
|
1451
1451
|
}
|
|
1452
1452
|
}
|
|
1453
1453
|
if (!x)
|
|
1454
1454
|
return R.length ? Promise.all(R).then(() => _) : _;
|
|
1455
1455
|
const M = [], P = A.keySet, j = x._zod, Z = j.def.type;
|
|
1456
|
-
for (const
|
|
1457
|
-
if (P.has(
|
|
1456
|
+
for (const U of Object.keys(N)) {
|
|
1457
|
+
if (P.has(U))
|
|
1458
1458
|
continue;
|
|
1459
1459
|
if (Z === "never") {
|
|
1460
|
-
M.push(
|
|
1460
|
+
M.push(U);
|
|
1461
1461
|
continue;
|
|
1462
1462
|
}
|
|
1463
|
-
const
|
|
1464
|
-
|
|
1463
|
+
const Q = j.run({ value: N[U], issues: [] }, D);
|
|
1464
|
+
Q instanceof Promise ? R.push(Q.then((Y) => Pi(Y, _, U))) : Pi(Q, _, U);
|
|
1465
1465
|
}
|
|
1466
1466
|
return M.length && _.issues.push({
|
|
1467
1467
|
code: "unrecognized_keys",
|
|
@@ -1482,7 +1482,7 @@ function sa(t, r, o, c) {
|
|
|
1482
1482
|
errors: t.map((u) => u.issues.map((f) => ur(f, c, cr())))
|
|
1483
1483
|
}), r;
|
|
1484
1484
|
}
|
|
1485
|
-
const Yc = /* @__PURE__ */
|
|
1485
|
+
const Yc = /* @__PURE__ */ ee("$ZodUnion", (t, r) => {
|
|
1486
1486
|
ft.init(t, r), ot(t._zod, "optin", () => r.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0), ot(t._zod, "optout", () => r.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0), ot(t._zod, "values", () => {
|
|
1487
1487
|
if (r.options.every((o) => o._zod.values))
|
|
1488
1488
|
return new Set(r.options.flatMap((o) => Array.from(o._zod.values)));
|
|
@@ -1509,7 +1509,7 @@ const Yc = /* @__PURE__ */ Q("$ZodUnion", (t, r) => {
|
|
|
1509
1509
|
}
|
|
1510
1510
|
return u ? Promise.all(f).then((g) => sa(g, o, t, c)) : sa(f, o, t, c);
|
|
1511
1511
|
};
|
|
1512
|
-
}), zf = /* @__PURE__ */
|
|
1512
|
+
}), zf = /* @__PURE__ */ ee("$ZodDiscriminatedUnion", (t, r) => {
|
|
1513
1513
|
Yc.init(t, r);
|
|
1514
1514
|
const o = t._zod.parse;
|
|
1515
1515
|
ot(t._zod, "propValues", () => {
|
|
@@ -1559,7 +1559,7 @@ const Yc = /* @__PURE__ */ Q("$ZodUnion", (t, r) => {
|
|
|
1559
1559
|
inst: t
|
|
1560
1560
|
}), u);
|
|
1561
1561
|
};
|
|
1562
|
-
}), Zf = /* @__PURE__ */
|
|
1562
|
+
}), Zf = /* @__PURE__ */ ee("$ZodIntersection", (t, r) => {
|
|
1563
1563
|
ft.init(t, r), t._zod.parse = (o, c) => {
|
|
1564
1564
|
const u = o.value, f = r.left._zod.run({ value: u, issues: [] }, c), g = r.right._zod.run({ value: u, issues: [] }, c);
|
|
1565
1565
|
return f instanceof Promise || g instanceof Promise ? Promise.all([f, g]).then(([v, x]) => aa(o, v, x)) : aa(o, f, g);
|
|
@@ -1608,7 +1608,7 @@ function aa(t, r, o) {
|
|
|
1608
1608
|
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`);
|
|
1609
1609
|
return t.value = c.data, t;
|
|
1610
1610
|
}
|
|
1611
|
-
const $f = /* @__PURE__ */
|
|
1611
|
+
const $f = /* @__PURE__ */ ee("$ZodRecord", (t, r) => {
|
|
1612
1612
|
ft.init(t, r), t._zod.parse = (o, c) => {
|
|
1613
1613
|
const u = o.value;
|
|
1614
1614
|
if (!Xi(u))
|
|
@@ -1665,7 +1665,7 @@ const $f = /* @__PURE__ */ Q("$ZodRecord", (t, r) => {
|
|
|
1665
1665
|
}
|
|
1666
1666
|
return f.length ? Promise.all(f).then(() => o) : o;
|
|
1667
1667
|
};
|
|
1668
|
-
}), Vf = /* @__PURE__ */
|
|
1668
|
+
}), Vf = /* @__PURE__ */ ee("$ZodEnum", (t, r) => {
|
|
1669
1669
|
ft.init(t, r);
|
|
1670
1670
|
const o = Pc(r.entries);
|
|
1671
1671
|
t._zod.values = new Set(o), t._zod.pattern = new RegExp(`^(${o.filter((c) => r0.has(typeof c)).map((c) => typeof c == "string" ? wi(c) : c.toString()).join("|")})$`), t._zod.parse = (c, u) => {
|
|
@@ -1677,7 +1677,7 @@ const $f = /* @__PURE__ */ Q("$ZodRecord", (t, r) => {
|
|
|
1677
1677
|
inst: t
|
|
1678
1678
|
}), c;
|
|
1679
1679
|
};
|
|
1680
|
-
}), Hf = /* @__PURE__ */
|
|
1680
|
+
}), Hf = /* @__PURE__ */ ee("$ZodLiteral", (t, r) => {
|
|
1681
1681
|
ft.init(t, r), t._zod.values = new Set(r.values), t._zod.pattern = new RegExp(`^(${r.values.map((o) => typeof o == "string" ? wi(o) : o ? o.toString() : String(o)).join("|")})$`), t._zod.parse = (o, c) => {
|
|
1682
1682
|
const u = o.value;
|
|
1683
1683
|
return t._zod.values.has(u) || o.issues.push({
|
|
@@ -1687,7 +1687,7 @@ const $f = /* @__PURE__ */ Q("$ZodRecord", (t, r) => {
|
|
|
1687
1687
|
inst: t
|
|
1688
1688
|
}), o;
|
|
1689
1689
|
};
|
|
1690
|
-
}), Wf = /* @__PURE__ */
|
|
1690
|
+
}), Wf = /* @__PURE__ */ ee("$ZodTransform", (t, r) => {
|
|
1691
1691
|
ft.init(t, r), t._zod.parse = (o, c) => {
|
|
1692
1692
|
const u = r.transform(o.value, o);
|
|
1693
1693
|
if (c.async)
|
|
@@ -1696,17 +1696,17 @@ const $f = /* @__PURE__ */ Q("$ZodRecord", (t, r) => {
|
|
|
1696
1696
|
throw new di();
|
|
1697
1697
|
return o.value = u, o;
|
|
1698
1698
|
};
|
|
1699
|
-
}), jf = /* @__PURE__ */
|
|
1699
|
+
}), jf = /* @__PURE__ */ ee("$ZodOptional", (t, r) => {
|
|
1700
1700
|
ft.init(t, r), t._zod.optin = "optional", t._zod.optout = "optional", ot(t._zod, "values", () => r.innerType._zod.values ? /* @__PURE__ */ new Set([...r.innerType._zod.values, void 0]) : void 0), ot(t._zod, "pattern", () => {
|
|
1701
1701
|
const o = r.innerType._zod.pattern;
|
|
1702
1702
|
return o ? new RegExp(`^(${xs(o.source)})?$`) : void 0;
|
|
1703
1703
|
}), t._zod.parse = (o, c) => r.innerType._zod.optin === "optional" ? r.innerType._zod.run(o, c) : o.value === void 0 ? o : r.innerType._zod.run(o, c);
|
|
1704
|
-
}), Gf = /* @__PURE__ */
|
|
1704
|
+
}), Gf = /* @__PURE__ */ ee("$ZodNullable", (t, r) => {
|
|
1705
1705
|
ft.init(t, r), ot(t._zod, "optin", () => r.innerType._zod.optin), ot(t._zod, "optout", () => r.innerType._zod.optout), ot(t._zod, "pattern", () => {
|
|
1706
1706
|
const o = r.innerType._zod.pattern;
|
|
1707
1707
|
return o ? new RegExp(`^(${xs(o.source)}|null)$`) : void 0;
|
|
1708
1708
|
}), ot(t._zod, "values", () => r.innerType._zod.values ? /* @__PURE__ */ new Set([...r.innerType._zod.values, null]) : void 0), t._zod.parse = (o, c) => o.value === null ? o : r.innerType._zod.run(o, c);
|
|
1709
|
-
}), Xf = /* @__PURE__ */
|
|
1709
|
+
}), Xf = /* @__PURE__ */ ee("$ZodDefault", (t, r) => {
|
|
1710
1710
|
ft.init(t, r), t._zod.optin = "optional", ot(t._zod, "values", () => r.innerType._zod.values), t._zod.parse = (o, c) => {
|
|
1711
1711
|
if (o.value === void 0)
|
|
1712
1712
|
return o.value = r.defaultValue, o;
|
|
@@ -1717,9 +1717,9 @@ const $f = /* @__PURE__ */ Q("$ZodRecord", (t, r) => {
|
|
|
1717
1717
|
function la(t, r) {
|
|
1718
1718
|
return t.value === void 0 && (t.value = r.defaultValue), t;
|
|
1719
1719
|
}
|
|
1720
|
-
const qf = /* @__PURE__ */
|
|
1720
|
+
const qf = /* @__PURE__ */ ee("$ZodPrefault", (t, r) => {
|
|
1721
1721
|
ft.init(t, r), t._zod.optin = "optional", ot(t._zod, "values", () => r.innerType._zod.values), t._zod.parse = (o, c) => (o.value === void 0 && (o.value = r.defaultValue), r.innerType._zod.run(o, c));
|
|
1722
|
-
}), Yf = /* @__PURE__ */
|
|
1722
|
+
}), Yf = /* @__PURE__ */ ee("$ZodNonOptional", (t, r) => {
|
|
1723
1723
|
ft.init(t, r), ot(t._zod, "values", () => {
|
|
1724
1724
|
const o = r.innerType._zod.values;
|
|
1725
1725
|
return o ? new Set([...o].filter((c) => c !== void 0)) : void 0;
|
|
@@ -1736,7 +1736,7 @@ function ca(t, r) {
|
|
|
1736
1736
|
inst: r
|
|
1737
1737
|
}), t;
|
|
1738
1738
|
}
|
|
1739
|
-
const Kf = /* @__PURE__ */
|
|
1739
|
+
const Kf = /* @__PURE__ */ ee("$ZodCatch", (t, r) => {
|
|
1740
1740
|
ft.init(t, r), t._zod.optin = "optional", ot(t._zod, "optout", () => r.innerType._zod.optout), ot(t._zod, "values", () => r.innerType._zod.values), t._zod.parse = (o, c) => {
|
|
1741
1741
|
const u = r.innerType._zod.run(o, c);
|
|
1742
1742
|
return u instanceof Promise ? u.then((f) => (o.value = f.value, f.issues.length && (o.value = r.catchValue({
|
|
@@ -1753,7 +1753,7 @@ const Kf = /* @__PURE__ */ Q("$ZodCatch", (t, r) => {
|
|
|
1753
1753
|
input: o.value
|
|
1754
1754
|
}), o.issues = []), o);
|
|
1755
1755
|
};
|
|
1756
|
-
}), Jf = /* @__PURE__ */
|
|
1756
|
+
}), Jf = /* @__PURE__ */ ee("$ZodPipe", (t, r) => {
|
|
1757
1757
|
ft.init(t, r), ot(t._zod, "values", () => r.in._zod.values), ot(t._zod, "optin", () => r.in._zod.optin), ot(t._zod, "optout", () => r.out._zod.optout), t._zod.parse = (o, c) => {
|
|
1758
1758
|
const u = r.in._zod.run(o, c);
|
|
1759
1759
|
return u instanceof Promise ? u.then((f) => ua(f, r, c)) : ua(u, r, c);
|
|
@@ -1762,7 +1762,7 @@ const Kf = /* @__PURE__ */ Q("$ZodCatch", (t, r) => {
|
|
|
1762
1762
|
function ua(t, r, o) {
|
|
1763
1763
|
return ai(t) ? t : r.out._zod.run({ value: t.value, issues: t.issues }, o);
|
|
1764
1764
|
}
|
|
1765
|
-
const Qf = /* @__PURE__ */
|
|
1765
|
+
const Qf = /* @__PURE__ */ ee("$ZodReadonly", (t, r) => {
|
|
1766
1766
|
ft.init(t, r), ot(t._zod, "propValues", () => r.innerType._zod.propValues), ot(t._zod, "values", () => r.innerType._zod.values), ot(t._zod, "optin", () => r.innerType._zod.optin), ot(t._zod, "optout", () => r.innerType._zod.optout), t._zod.parse = (o, c) => {
|
|
1767
1767
|
const u = r.innerType._zod.run(o, c);
|
|
1768
1768
|
return u instanceof Promise ? u.then(da) : da(u);
|
|
@@ -1771,9 +1771,9 @@ const Qf = /* @__PURE__ */ Q("$ZodReadonly", (t, r) => {
|
|
|
1771
1771
|
function da(t) {
|
|
1772
1772
|
return t.value = Object.freeze(t.value), t;
|
|
1773
1773
|
}
|
|
1774
|
-
const eh = /* @__PURE__ */
|
|
1774
|
+
const eh = /* @__PURE__ */ ee("$ZodLazy", (t, r) => {
|
|
1775
1775
|
ft.init(t, r), ot(t._zod, "innerType", () => r.getter()), ot(t._zod, "pattern", () => t._zod.innerType._zod.pattern), ot(t._zod, "propValues", () => t._zod.innerType._zod.propValues), ot(t._zod, "optin", () => t._zod.innerType._zod.optin), ot(t._zod, "optout", () => t._zod.innerType._zod.optout), t._zod.parse = (o, c) => t._zod.innerType._zod.run(o, c);
|
|
1776
|
-
}), th = /* @__PURE__ */
|
|
1776
|
+
}), th = /* @__PURE__ */ ee("$ZodCustom", (t, r) => {
|
|
1777
1777
|
hn.init(t, r), ft.init(t, r), t._zod.parse = (o, c) => o, t._zod.check = (o) => {
|
|
1778
1778
|
const c = o.value, u = r.fn(c);
|
|
1779
1779
|
if (u instanceof Promise)
|
|
@@ -2305,11 +2305,11 @@ class xa {
|
|
|
2305
2305
|
case "string": {
|
|
2306
2306
|
const R = N;
|
|
2307
2307
|
R.type = "string";
|
|
2308
|
-
const { minimum: M, maximum: P, format: j, patterns: Z, contentEncoding:
|
|
2309
|
-
if (typeof M == "number" && (R.minLength = M), typeof P == "number" && (R.maxLength = P), j && (R.format = f[j] ?? j, R.format === "" && delete R.format),
|
|
2310
|
-
const
|
|
2311
|
-
|
|
2312
|
-
...
|
|
2308
|
+
const { minimum: M, maximum: P, format: j, patterns: Z, contentEncoding: U } = r._zod.bag;
|
|
2309
|
+
if (typeof M == "number" && (R.minLength = M), typeof P == "number" && (R.maxLength = P), j && (R.format = f[j] ?? j, R.format === "" && delete R.format), U && (R.contentEncoding = U), Z && Z.size > 0) {
|
|
2310
|
+
const Q = [...Z];
|
|
2311
|
+
Q.length === 1 ? R.pattern = Q[0].source : Q.length > 1 && (m.schema.allOf = [
|
|
2312
|
+
...Q.map((Y) => ({
|
|
2313
2313
|
...this.target === "draft-7" ? { type: "string" } : {},
|
|
2314
2314
|
pattern: Y.source
|
|
2315
2315
|
}))
|
|
@@ -2318,8 +2318,8 @@ class xa {
|
|
|
2318
2318
|
break;
|
|
2319
2319
|
}
|
|
2320
2320
|
case "number": {
|
|
2321
|
-
const R = N, { minimum: M, maximum: P, format: j, multipleOf: Z, exclusiveMaximum:
|
|
2322
|
-
typeof j == "string" && j.includes("int") ? R.type = "integer" : R.type = "number", typeof
|
|
2321
|
+
const R = N, { minimum: M, maximum: P, format: j, multipleOf: Z, exclusiveMaximum: U, exclusiveMinimum: Q } = r._zod.bag;
|
|
2322
|
+
typeof j == "string" && j.includes("int") ? R.type = "integer" : R.type = "number", typeof Q == "number" && (R.exclusiveMinimum = Q), typeof M == "number" && (R.minimum = M, typeof Q == "number" && (Q >= M ? delete R.minimum : delete R.exclusiveMinimum)), typeof U == "number" && (R.exclusiveMaximum = U), typeof P == "number" && (R.maximum = P, typeof U == "number" && (U <= P ? delete R.maximum : delete R.exclusiveMaximum)), typeof Z == "number" && (R.multipleOf = Z);
|
|
2323
2323
|
break;
|
|
2324
2324
|
}
|
|
2325
2325
|
case "boolean": {
|
|
@@ -2379,8 +2379,8 @@ class xa {
|
|
|
2379
2379
|
path: [..._.path, "properties", Z]
|
|
2380
2380
|
});
|
|
2381
2381
|
const P = new Set(Object.keys(M)), j = new Set([...P].filter((Z) => {
|
|
2382
|
-
const
|
|
2383
|
-
return this.io === "input" ?
|
|
2382
|
+
const U = u.shape[Z]._zod;
|
|
2383
|
+
return this.io === "input" ? U.optin === void 0 : U.optout === void 0;
|
|
2384
2384
|
}));
|
|
2385
2385
|
j.size > 0 && (R.required = Array.from(j)), u.catchall?._zod.def.type === "never" ? R.additionalProperties = !1 : u.catchall ? u.catchall && (R.additionalProperties = this.process(u.catchall, {
|
|
2386
2386
|
..._,
|
|
@@ -2403,7 +2403,7 @@ class xa {
|
|
|
2403
2403
|
}), P = this.process(u.right, {
|
|
2404
2404
|
..._,
|
|
2405
2405
|
path: [..._.path, "allOf", 1]
|
|
2406
|
-
}), j = (
|
|
2406
|
+
}), j = (U) => "allOf" in U && Object.keys(U).length === 1, Z = [
|
|
2407
2407
|
...j(M) ? M.allOf : [M],
|
|
2408
2408
|
...j(P) ? P.allOf : [P]
|
|
2409
2409
|
];
|
|
@@ -2413,7 +2413,7 @@ class xa {
|
|
|
2413
2413
|
case "tuple": {
|
|
2414
2414
|
const R = N;
|
|
2415
2415
|
R.type = "array";
|
|
2416
|
-
const M = u.items.map((Z,
|
|
2416
|
+
const M = u.items.map((Z, U) => this.process(Z, { ..._, path: [..._.path, "prefixItems", U] }));
|
|
2417
2417
|
if (this.target === "draft-2020-12" ? R.prefixItems = M : R.items = M, u.rest) {
|
|
2418
2418
|
const Z = this.process(u.rest, {
|
|
2419
2419
|
..._,
|
|
@@ -2477,7 +2477,7 @@ class xa {
|
|
|
2477
2477
|
format: "binary",
|
|
2478
2478
|
contentEncoding: "binary"
|
|
2479
2479
|
}, { minimum: P, maximum: j, mime: Z } = r._zod.bag;
|
|
2480
|
-
P !== void 0 && (M.minLength = P), j !== void 0 && (M.maxLength = j), Z ? Z.length === 1 ? (M.contentMediaType = Z[0], Object.assign(R, M)) : R.anyOf = Z.map((
|
|
2480
|
+
P !== void 0 && (M.minLength = P), j !== void 0 && (M.maxLength = j), Z ? Z.length === 1 ? (M.contentMediaType = Z[0], Object.assign(R, M)) : R.anyOf = Z.map((U) => ({ ...M, contentMediaType: U })) : Object.assign(R, M);
|
|
2481
2481
|
break;
|
|
2482
2482
|
}
|
|
2483
2483
|
case "transform": {
|
|
@@ -2779,25 +2779,25 @@ function Zt(t, r) {
|
|
|
2779
2779
|
}
|
|
2780
2780
|
throw new Error(`Unknown schema type: ${u.type}`);
|
|
2781
2781
|
}
|
|
2782
|
-
const Yh = /* @__PURE__ */
|
|
2782
|
+
const Yh = /* @__PURE__ */ ee("ZodISODateTime", (t, r) => {
|
|
2783
2783
|
yf.init(t, r), Et.init(t, r);
|
|
2784
2784
|
});
|
|
2785
2785
|
function Kh(t) {
|
|
2786
2786
|
return Eh(Yh, t);
|
|
2787
2787
|
}
|
|
2788
|
-
const Jh = /* @__PURE__ */
|
|
2788
|
+
const Jh = /* @__PURE__ */ ee("ZodISODate", (t, r) => {
|
|
2789
2789
|
wf.init(t, r), Et.init(t, r);
|
|
2790
2790
|
});
|
|
2791
2791
|
function Qh(t) {
|
|
2792
2792
|
return Ih(Jh, t);
|
|
2793
2793
|
}
|
|
2794
|
-
const ep = /* @__PURE__ */
|
|
2794
|
+
const ep = /* @__PURE__ */ ee("ZodISOTime", (t, r) => {
|
|
2795
2795
|
_f.init(t, r), Et.init(t, r);
|
|
2796
2796
|
});
|
|
2797
2797
|
function tp(t) {
|
|
2798
2798
|
return Sh(ep, t);
|
|
2799
2799
|
}
|
|
2800
|
-
const np = /* @__PURE__ */
|
|
2800
|
+
const np = /* @__PURE__ */ ee("ZodISODuration", (t, r) => {
|
|
2801
2801
|
vf.init(t, r), Et.init(t, r);
|
|
2802
2802
|
});
|
|
2803
2803
|
function rp(t) {
|
|
@@ -2828,9 +2828,9 @@ const ip = (t, r) => {
|
|
|
2828
2828
|
// enumerable: false,
|
|
2829
2829
|
}
|
|
2830
2830
|
});
|
|
2831
|
-
}, oo =
|
|
2831
|
+
}, oo = ee("ZodError", ip, {
|
|
2832
2832
|
Parent: Error
|
|
2833
|
-
}), op = /* @__PURE__ */ p0(oo), sp = /* @__PURE__ */ g0(oo), ap = /* @__PURE__ */ zc(oo), eu = /* @__PURE__ */ Zc(oo), wt = /* @__PURE__ */
|
|
2833
|
+
}), op = /* @__PURE__ */ p0(oo), sp = /* @__PURE__ */ g0(oo), ap = /* @__PURE__ */ zc(oo), eu = /* @__PURE__ */ Zc(oo), wt = /* @__PURE__ */ ee("ZodType", (t, r) => (ft.init(t, r), t.def = r, Object.defineProperty(t, "_def", { value: r }), t.check = (...o) => t.clone(
|
|
2834
2834
|
{
|
|
2835
2835
|
...r,
|
|
2836
2836
|
checks: [
|
|
@@ -2852,57 +2852,57 @@ const ip = (t, r) => {
|
|
|
2852
2852
|
return ii.get(t);
|
|
2853
2853
|
const c = t.clone();
|
|
2854
2854
|
return ii.add(c, o[0]), c;
|
|
2855
|
-
}, t.isOptional = () => t.safeParse(void 0).success, t.isNullable = () => t.safeParse(null).success, t)), tu = /* @__PURE__ */
|
|
2855
|
+
}, t.isOptional = () => t.safeParse(void 0).success, t.isNullable = () => t.safeParse(null).success, t)), tu = /* @__PURE__ */ ee("_ZodString", (t, r) => {
|
|
2856
2856
|
_s.init(t, r), wt.init(t, r);
|
|
2857
2857
|
const o = t._zod.bag;
|
|
2858
2858
|
t.format = o.format ?? null, t.minLength = o.minimum ?? null, t.maxLength = o.maximum ?? null, t.regex = (...c) => t.check(Lh(...c)), t.includes = (...c) => t.check(zh(...c)), t.startsWith = (...c) => t.check(Zh(...c)), t.endsWith = (...c) => t.check($h(...c)), t.min = (...c) => t.check(qi(...c)), t.max = (...c) => t.check(Jc(...c)), t.length = (...c) => t.check(Qc(...c)), t.nonempty = (...c) => t.check(qi(1, ...c)), t.lowercase = (c) => t.check(Fh(c)), t.uppercase = (c) => t.check(Uh(c)), t.trim = () => t.check(Hh()), t.normalize = (...c) => t.check(Vh(...c)), t.toLowerCase = () => t.check(Wh()), t.toUpperCase = () => t.check(jh());
|
|
2859
|
-
}), lp = /* @__PURE__ */
|
|
2859
|
+
}), lp = /* @__PURE__ */ ee("ZodString", (t, r) => {
|
|
2860
2860
|
_s.init(t, r), tu.init(t, r), t.email = (o) => t.check(ih(cp, o)), t.url = (o) => t.check(ch(up, o)), t.jwt = (o) => t.check(Ah(Ep, o)), t.emoji = (o) => t.check(uh(dp, o)), t.guid = (o) => t.check(ha(ya, o)), t.uuid = (o) => t.check(oh(Bi, o)), t.uuidv4 = (o) => t.check(sh(Bi, o)), t.uuidv6 = (o) => t.check(ah(Bi, o)), t.uuidv7 = (o) => t.check(lh(Bi, o)), t.nanoid = (o) => t.check(dh(fp, o)), t.guid = (o) => t.check(ha(ya, o)), t.cuid = (o) => t.check(fh(hp, o)), t.cuid2 = (o) => t.check(hh(pp, o)), t.ulid = (o) => t.check(ph(gp, o)), t.base64 = (o) => t.check(vh(Cp, o)), t.base64url = (o) => t.check(Ch(bp, o)), t.xid = (o) => t.check(gh(mp, o)), t.ksuid = (o) => t.check(mh(xp, o)), t.ipv4 = (o) => t.check(xh(yp, o)), t.ipv6 = (o) => t.check(yh(wp, o)), t.cidrv4 = (o) => t.check(wh(_p, o)), t.cidrv6 = (o) => t.check(_h(vp, o)), t.e164 = (o) => t.check(bh(Ap, o)), t.datetime = (o) => t.check(Kh(o)), t.date = (o) => t.check(Qh(o)), t.time = (o) => t.check(tp(o)), t.duration = (o) => t.check(rp(o));
|
|
2861
2861
|
});
|
|
2862
2862
|
function w(t) {
|
|
2863
2863
|
return rh(lp, t);
|
|
2864
2864
|
}
|
|
2865
|
-
const Et = /* @__PURE__ */
|
|
2865
|
+
const Et = /* @__PURE__ */ ee("ZodStringFormat", (t, r) => {
|
|
2866
2866
|
Ct.init(t, r), tu.init(t, r);
|
|
2867
|
-
}), cp = /* @__PURE__ */
|
|
2867
|
+
}), cp = /* @__PURE__ */ ee("ZodEmail", (t, r) => {
|
|
2868
2868
|
cf.init(t, r), Et.init(t, r);
|
|
2869
|
-
}), ya = /* @__PURE__ */
|
|
2869
|
+
}), ya = /* @__PURE__ */ ee("ZodGUID", (t, r) => {
|
|
2870
2870
|
af.init(t, r), Et.init(t, r);
|
|
2871
|
-
}), Bi = /* @__PURE__ */
|
|
2871
|
+
}), Bi = /* @__PURE__ */ ee("ZodUUID", (t, r) => {
|
|
2872
2872
|
lf.init(t, r), Et.init(t, r);
|
|
2873
|
-
}), up = /* @__PURE__ */
|
|
2873
|
+
}), up = /* @__PURE__ */ ee("ZodURL", (t, r) => {
|
|
2874
2874
|
uf.init(t, r), Et.init(t, r);
|
|
2875
|
-
}), dp = /* @__PURE__ */
|
|
2875
|
+
}), dp = /* @__PURE__ */ ee("ZodEmoji", (t, r) => {
|
|
2876
2876
|
df.init(t, r), Et.init(t, r);
|
|
2877
|
-
}), fp = /* @__PURE__ */
|
|
2877
|
+
}), fp = /* @__PURE__ */ ee("ZodNanoID", (t, r) => {
|
|
2878
2878
|
ff.init(t, r), Et.init(t, r);
|
|
2879
|
-
}), hp = /* @__PURE__ */
|
|
2879
|
+
}), hp = /* @__PURE__ */ ee("ZodCUID", (t, r) => {
|
|
2880
2880
|
hf.init(t, r), Et.init(t, r);
|
|
2881
|
-
}), pp = /* @__PURE__ */
|
|
2881
|
+
}), pp = /* @__PURE__ */ ee("ZodCUID2", (t, r) => {
|
|
2882
2882
|
pf.init(t, r), Et.init(t, r);
|
|
2883
|
-
}), gp = /* @__PURE__ */
|
|
2883
|
+
}), gp = /* @__PURE__ */ ee("ZodULID", (t, r) => {
|
|
2884
2884
|
gf.init(t, r), Et.init(t, r);
|
|
2885
|
-
}), mp = /* @__PURE__ */
|
|
2885
|
+
}), mp = /* @__PURE__ */ ee("ZodXID", (t, r) => {
|
|
2886
2886
|
mf.init(t, r), Et.init(t, r);
|
|
2887
|
-
}), xp = /* @__PURE__ */
|
|
2887
|
+
}), xp = /* @__PURE__ */ ee("ZodKSUID", (t, r) => {
|
|
2888
2888
|
xf.init(t, r), Et.init(t, r);
|
|
2889
|
-
}), yp = /* @__PURE__ */
|
|
2889
|
+
}), yp = /* @__PURE__ */ ee("ZodIPv4", (t, r) => {
|
|
2890
2890
|
Cf.init(t, r), Et.init(t, r);
|
|
2891
|
-
}), wp = /* @__PURE__ */
|
|
2891
|
+
}), wp = /* @__PURE__ */ ee("ZodIPv6", (t, r) => {
|
|
2892
2892
|
bf.init(t, r), Et.init(t, r);
|
|
2893
|
-
}), _p = /* @__PURE__ */
|
|
2893
|
+
}), _p = /* @__PURE__ */ ee("ZodCIDRv4", (t, r) => {
|
|
2894
2894
|
Af.init(t, r), Et.init(t, r);
|
|
2895
|
-
}), vp = /* @__PURE__ */
|
|
2895
|
+
}), vp = /* @__PURE__ */ ee("ZodCIDRv6", (t, r) => {
|
|
2896
2896
|
Ef.init(t, r), Et.init(t, r);
|
|
2897
|
-
}), Cp = /* @__PURE__ */
|
|
2897
|
+
}), Cp = /* @__PURE__ */ ee("ZodBase64", (t, r) => {
|
|
2898
2898
|
If.init(t, r), Et.init(t, r);
|
|
2899
|
-
}), bp = /* @__PURE__ */
|
|
2899
|
+
}), bp = /* @__PURE__ */ ee("ZodBase64URL", (t, r) => {
|
|
2900
2900
|
Tf.init(t, r), Et.init(t, r);
|
|
2901
|
-
}), Ap = /* @__PURE__ */
|
|
2901
|
+
}), Ap = /* @__PURE__ */ ee("ZodE164", (t, r) => {
|
|
2902
2902
|
Nf.init(t, r), Et.init(t, r);
|
|
2903
|
-
}), Ep = /* @__PURE__ */
|
|
2903
|
+
}), Ep = /* @__PURE__ */ ee("ZodJWT", (t, r) => {
|
|
2904
2904
|
kf.init(t, r), Et.init(t, r);
|
|
2905
|
-
}), vs = /* @__PURE__ */
|
|
2905
|
+
}), vs = /* @__PURE__ */ ee("ZodNumber", (t, r) => {
|
|
2906
2906
|
qc.init(t, r), wt.init(t, r), t.gt = (c, u) => t.check(ga(c, u)), t.gte = (c, u) => t.check(Oo(c, u)), t.min = (c, u) => t.check(Oo(c, u)), t.lt = (c, u) => t.check(pa(c, u)), t.lte = (c, u) => t.check(No(c, u)), t.max = (c, u) => t.check(No(c, u)), t.int = (c) => t.check(wa(c)), t.safe = (c) => t.check(wa(c)), t.positive = (c) => t.check(ga(0, c)), t.nonnegative = (c) => t.check(Oo(0, c)), t.negative = (c) => t.check(pa(0, c)), t.nonpositive = (c) => t.check(No(0, c)), t.multipleOf = (c, u) => t.check(ma(c, u)), t.step = (c, u) => t.check(ma(c, u)), t.finite = () => t;
|
|
2907
2907
|
const o = t._zod.bag;
|
|
2908
2908
|
t.minValue = Math.max(o.minimum ?? Number.NEGATIVE_INFINITY, o.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, t.maxValue = Math.min(o.maximum ?? Number.POSITIVE_INFINITY, o.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, t.isInt = (o.format ?? "").includes("int") || Number.isSafeInteger(o.multipleOf ?? 0.5), t.isFinite = !0, t.format = o.format ?? null;
|
|
@@ -2910,49 +2910,49 @@ const Et = /* @__PURE__ */ Q("ZodStringFormat", (t, r) => {
|
|
|
2910
2910
|
function W(t) {
|
|
2911
2911
|
return Nh(vs, t);
|
|
2912
2912
|
}
|
|
2913
|
-
const Ip = /* @__PURE__ */
|
|
2913
|
+
const Ip = /* @__PURE__ */ ee("ZodNumberFormat", (t, r) => {
|
|
2914
2914
|
Rf.init(t, r), vs.init(t, r);
|
|
2915
2915
|
});
|
|
2916
2916
|
function wa(t) {
|
|
2917
2917
|
return kh(Ip, t);
|
|
2918
2918
|
}
|
|
2919
|
-
const Sp = /* @__PURE__ */
|
|
2919
|
+
const Sp = /* @__PURE__ */ ee("ZodBoolean", (t, r) => {
|
|
2920
2920
|
Mf.init(t, r), wt.init(t, r);
|
|
2921
2921
|
});
|
|
2922
2922
|
function Ft(t) {
|
|
2923
2923
|
return Rh(Sp, t);
|
|
2924
2924
|
}
|
|
2925
|
-
const Tp = /* @__PURE__ */
|
|
2925
|
+
const Tp = /* @__PURE__ */ ee("ZodNull", (t, r) => {
|
|
2926
2926
|
Df.init(t, r), wt.init(t, r);
|
|
2927
2927
|
});
|
|
2928
2928
|
function nu(t) {
|
|
2929
2929
|
return Mh(Tp, t);
|
|
2930
2930
|
}
|
|
2931
|
-
const Np = /* @__PURE__ */
|
|
2931
|
+
const Np = /* @__PURE__ */ ee("ZodAny", (t, r) => {
|
|
2932
2932
|
Pf.init(t, r), wt.init(t, r);
|
|
2933
2933
|
});
|
|
2934
2934
|
function Sr() {
|
|
2935
2935
|
return Dh(Np);
|
|
2936
2936
|
}
|
|
2937
|
-
const Op = /* @__PURE__ */
|
|
2937
|
+
const Op = /* @__PURE__ */ ee("ZodUnknown", (t, r) => {
|
|
2938
2938
|
Bf.init(t, r), wt.init(t, r);
|
|
2939
2939
|
});
|
|
2940
2940
|
function Mn() {
|
|
2941
2941
|
return Ph(Op);
|
|
2942
2942
|
}
|
|
2943
|
-
const kp = /* @__PURE__ */
|
|
2943
|
+
const kp = /* @__PURE__ */ ee("ZodNever", (t, r) => {
|
|
2944
2944
|
Lf.init(t, r), wt.init(t, r);
|
|
2945
2945
|
});
|
|
2946
2946
|
function Rp(t) {
|
|
2947
2947
|
return Bh(kp, t);
|
|
2948
2948
|
}
|
|
2949
|
-
const Mp = /* @__PURE__ */
|
|
2949
|
+
const Mp = /* @__PURE__ */ ee("ZodArray", (t, r) => {
|
|
2950
2950
|
Ff.init(t, r), wt.init(t, r), t.element = r.element, t.min = (o, c) => t.check(qi(o, c)), t.nonempty = (o) => t.check(qi(1, o)), t.max = (o, c) => t.check(Jc(o, c)), t.length = (o, c) => t.check(Qc(o, c)), t.unwrap = () => t.element;
|
|
2951
2951
|
});
|
|
2952
2952
|
function ce(t, r) {
|
|
2953
2953
|
return Gh(Mp, t, r);
|
|
2954
2954
|
}
|
|
2955
|
-
const Dp = /* @__PURE__ */
|
|
2955
|
+
const Dp = /* @__PURE__ */ ee("ZodObject", (t, r) => {
|
|
2956
2956
|
Uf.init(t, r), wt.init(t, r), ot(t, "shape", () => r.shape), t.keyof = () => Se(Object.keys(t._zod.def.shape)), t.catchall = (o) => t.clone({ ...t._zod.def, catchall: o }), t.passthrough = () => t.clone({ ...t._zod.def, catchall: Mn() }), t.loose = () => t.clone({ ...t._zod.def, catchall: Mn() }), t.strict = () => t.clone({ ...t._zod.def, catchall: Rp() }), t.strip = () => t.clone({ ...t._zod.def, catchall: void 0 }), t.extend = (o) => l0(t, o), t.merge = (o) => c0(t, o), t.pick = (o) => s0(t, o), t.omit = (o) => a0(t, o), t.partial = (...o) => u0(iu, t, o[0]), t.required = (...o) => d0(ou, t, o[0]);
|
|
2957
2957
|
});
|
|
2958
2958
|
function S(t, r) {
|
|
@@ -2965,7 +2965,7 @@ function S(t, r) {
|
|
|
2965
2965
|
};
|
|
2966
2966
|
return new Dp(o);
|
|
2967
2967
|
}
|
|
2968
|
-
const ru = /* @__PURE__ */
|
|
2968
|
+
const ru = /* @__PURE__ */ ee("ZodUnion", (t, r) => {
|
|
2969
2969
|
Yc.init(t, r), wt.init(t, r), t.options = r.options;
|
|
2970
2970
|
});
|
|
2971
2971
|
function nt(t, r) {
|
|
@@ -2975,7 +2975,7 @@ function nt(t, r) {
|
|
|
2975
2975
|
...Ee(r)
|
|
2976
2976
|
});
|
|
2977
2977
|
}
|
|
2978
|
-
const Pp = /* @__PURE__ */
|
|
2978
|
+
const Pp = /* @__PURE__ */ ee("ZodDiscriminatedUnion", (t, r) => {
|
|
2979
2979
|
ru.init(t, r), zf.init(t, r);
|
|
2980
2980
|
});
|
|
2981
2981
|
function gt(t, r, o) {
|
|
@@ -2986,7 +2986,7 @@ function gt(t, r, o) {
|
|
|
2986
2986
|
...Ee(o)
|
|
2987
2987
|
});
|
|
2988
2988
|
}
|
|
2989
|
-
const Bp = /* @__PURE__ */
|
|
2989
|
+
const Bp = /* @__PURE__ */ ee("ZodIntersection", (t, r) => {
|
|
2990
2990
|
Zf.init(t, r), wt.init(t, r);
|
|
2991
2991
|
});
|
|
2992
2992
|
function Lp(t, r) {
|
|
@@ -2996,7 +2996,7 @@ function Lp(t, r) {
|
|
|
2996
2996
|
right: r
|
|
2997
2997
|
});
|
|
2998
2998
|
}
|
|
2999
|
-
const Fp = /* @__PURE__ */
|
|
2999
|
+
const Fp = /* @__PURE__ */ ee("ZodRecord", (t, r) => {
|
|
3000
3000
|
$f.init(t, r), wt.init(t, r), t.keyType = r.keyType, t.valueType = r.valueType;
|
|
3001
3001
|
});
|
|
3002
3002
|
function yt(t, r, o) {
|
|
@@ -3007,7 +3007,7 @@ function yt(t, r, o) {
|
|
|
3007
3007
|
...Ee(o)
|
|
3008
3008
|
});
|
|
3009
3009
|
}
|
|
3010
|
-
const Go = /* @__PURE__ */
|
|
3010
|
+
const Go = /* @__PURE__ */ ee("ZodEnum", (t, r) => {
|
|
3011
3011
|
Vf.init(t, r), wt.init(t, r), t.enum = r.entries, t.options = Object.values(r.entries);
|
|
3012
3012
|
const o = new Set(Object.keys(r.entries));
|
|
3013
3013
|
t.extract = (c, u) => {
|
|
@@ -3046,7 +3046,7 @@ function Se(t, r) {
|
|
|
3046
3046
|
...Ee(r)
|
|
3047
3047
|
});
|
|
3048
3048
|
}
|
|
3049
|
-
const Up = /* @__PURE__ */
|
|
3049
|
+
const Up = /* @__PURE__ */ ee("ZodLiteral", (t, r) => {
|
|
3050
3050
|
Hf.init(t, r), wt.init(t, r), t.values = new Set(r.values), Object.defineProperty(t, "value", {
|
|
3051
3051
|
get() {
|
|
3052
3052
|
if (r.values.length > 1)
|
|
@@ -3062,7 +3062,7 @@ function G(t, r) {
|
|
|
3062
3062
|
...Ee(r)
|
|
3063
3063
|
});
|
|
3064
3064
|
}
|
|
3065
|
-
const zp = /* @__PURE__ */
|
|
3065
|
+
const zp = /* @__PURE__ */ ee("ZodTransform", (t, r) => {
|
|
3066
3066
|
Wf.init(t, r), wt.init(t, r), t._zod.parse = (o, c) => {
|
|
3067
3067
|
o.addIssue = (f) => {
|
|
3068
3068
|
if (typeof f == "string")
|
|
@@ -3082,7 +3082,7 @@ function Zp(t) {
|
|
|
3082
3082
|
transform: t
|
|
3083
3083
|
});
|
|
3084
3084
|
}
|
|
3085
|
-
const iu = /* @__PURE__ */
|
|
3085
|
+
const iu = /* @__PURE__ */ ee("ZodOptional", (t, r) => {
|
|
3086
3086
|
jf.init(t, r), wt.init(t, r), t.unwrap = () => t._zod.def.innerType;
|
|
3087
3087
|
});
|
|
3088
3088
|
function _a(t) {
|
|
@@ -3091,7 +3091,7 @@ function _a(t) {
|
|
|
3091
3091
|
innerType: t
|
|
3092
3092
|
});
|
|
3093
3093
|
}
|
|
3094
|
-
const $p = /* @__PURE__ */
|
|
3094
|
+
const $p = /* @__PURE__ */ ee("ZodNullable", (t, r) => {
|
|
3095
3095
|
Gf.init(t, r), wt.init(t, r), t.unwrap = () => t._zod.def.innerType;
|
|
3096
3096
|
});
|
|
3097
3097
|
function va(t) {
|
|
@@ -3100,7 +3100,7 @@ function va(t) {
|
|
|
3100
3100
|
innerType: t
|
|
3101
3101
|
});
|
|
3102
3102
|
}
|
|
3103
|
-
const Vp = /* @__PURE__ */
|
|
3103
|
+
const Vp = /* @__PURE__ */ ee("ZodDefault", (t, r) => {
|
|
3104
3104
|
Xf.init(t, r), wt.init(t, r), t.unwrap = () => t._zod.def.innerType, t.removeDefault = t.unwrap;
|
|
3105
3105
|
});
|
|
3106
3106
|
function Hp(t, r) {
|
|
@@ -3112,7 +3112,7 @@ function Hp(t, r) {
|
|
|
3112
3112
|
}
|
|
3113
3113
|
});
|
|
3114
3114
|
}
|
|
3115
|
-
const Wp = /* @__PURE__ */
|
|
3115
|
+
const Wp = /* @__PURE__ */ ee("ZodPrefault", (t, r) => {
|
|
3116
3116
|
qf.init(t, r), wt.init(t, r), t.unwrap = () => t._zod.def.innerType;
|
|
3117
3117
|
});
|
|
3118
3118
|
function jp(t, r) {
|
|
@@ -3124,7 +3124,7 @@ function jp(t, r) {
|
|
|
3124
3124
|
}
|
|
3125
3125
|
});
|
|
3126
3126
|
}
|
|
3127
|
-
const ou = /* @__PURE__ */
|
|
3127
|
+
const ou = /* @__PURE__ */ ee("ZodNonOptional", (t, r) => {
|
|
3128
3128
|
Yf.init(t, r), wt.init(t, r), t.unwrap = () => t._zod.def.innerType;
|
|
3129
3129
|
});
|
|
3130
3130
|
function Gp(t, r) {
|
|
@@ -3134,7 +3134,7 @@ function Gp(t, r) {
|
|
|
3134
3134
|
...Ee(r)
|
|
3135
3135
|
});
|
|
3136
3136
|
}
|
|
3137
|
-
const Xp = /* @__PURE__ */
|
|
3137
|
+
const Xp = /* @__PURE__ */ ee("ZodCatch", (t, r) => {
|
|
3138
3138
|
Kf.init(t, r), wt.init(t, r), t.unwrap = () => t._zod.def.innerType, t.removeCatch = t.unwrap;
|
|
3139
3139
|
});
|
|
3140
3140
|
function qp(t, r) {
|
|
@@ -3144,7 +3144,7 @@ function qp(t, r) {
|
|
|
3144
3144
|
catchValue: typeof r == "function" ? r : () => r
|
|
3145
3145
|
});
|
|
3146
3146
|
}
|
|
3147
|
-
const Yp = /* @__PURE__ */
|
|
3147
|
+
const Yp = /* @__PURE__ */ ee("ZodPipe", (t, r) => {
|
|
3148
3148
|
Jf.init(t, r), wt.init(t, r), t.in = r.in, t.out = r.out;
|
|
3149
3149
|
});
|
|
3150
3150
|
function Ca(t, r) {
|
|
@@ -3155,7 +3155,7 @@ function Ca(t, r) {
|
|
|
3155
3155
|
// ...util.normalizeParams(params),
|
|
3156
3156
|
});
|
|
3157
3157
|
}
|
|
3158
|
-
const Kp = /* @__PURE__ */
|
|
3158
|
+
const Kp = /* @__PURE__ */ ee("ZodReadonly", (t, r) => {
|
|
3159
3159
|
Qf.init(t, r), wt.init(t, r);
|
|
3160
3160
|
});
|
|
3161
3161
|
function Jp(t) {
|
|
@@ -3164,7 +3164,7 @@ function Jp(t) {
|
|
|
3164
3164
|
innerType: t
|
|
3165
3165
|
});
|
|
3166
3166
|
}
|
|
3167
|
-
const Qp = /* @__PURE__ */
|
|
3167
|
+
const Qp = /* @__PURE__ */ ee("ZodLazy", (t, r) => {
|
|
3168
3168
|
eh.init(t, r), wt.init(t, r), t.unwrap = () => t._zod.def.getter();
|
|
3169
3169
|
});
|
|
3170
3170
|
function Cs(t) {
|
|
@@ -3173,7 +3173,7 @@ function Cs(t) {
|
|
|
3173
3173
|
getter: t
|
|
3174
3174
|
});
|
|
3175
3175
|
}
|
|
3176
|
-
const eg = /* @__PURE__ */
|
|
3176
|
+
const eg = /* @__PURE__ */ ee("ZodCustom", (t, r) => {
|
|
3177
3177
|
th.init(t, r), wt.init(t, r);
|
|
3178
3178
|
});
|
|
3179
3179
|
function tg(t) {
|
|
@@ -3915,8 +3915,8 @@ var Pg = class {
|
|
|
3915
3915
|
details: "JSON response format schema is only supported with structuredOutputs"
|
|
3916
3916
|
});
|
|
3917
3917
|
const {
|
|
3918
|
-
tools:
|
|
3919
|
-
toolChoice:
|
|
3918
|
+
tools: U,
|
|
3919
|
+
toolChoice: Q,
|
|
3920
3920
|
toolWarnings: Y
|
|
3921
3921
|
} = Dg({
|
|
3922
3922
|
tools: D,
|
|
@@ -3956,18 +3956,18 @@ var Pg = class {
|
|
|
3956
3956
|
// messages:
|
|
3957
3957
|
messages: kg(t),
|
|
3958
3958
|
// tools:
|
|
3959
|
-
tools:
|
|
3960
|
-
tool_choice:
|
|
3959
|
+
tools: U,
|
|
3960
|
+
tool_choice: Q
|
|
3961
3961
|
},
|
|
3962
3962
|
warnings: [...j, ...Y]
|
|
3963
3963
|
};
|
|
3964
3964
|
}
|
|
3965
3965
|
async doGenerate(t) {
|
|
3966
3966
|
var r, o, c, u, f, g, m, v, x, A, _, D, N, R, M, P, j;
|
|
3967
|
-
const { args: Z, warnings:
|
|
3967
|
+
const { args: Z, warnings: U } = await this.getArgs({ ...t }), Q = JSON.stringify(Z), {
|
|
3968
3968
|
responseHeaders: Y,
|
|
3969
3969
|
value: z,
|
|
3970
|
-
rawValue:
|
|
3970
|
+
rawValue: F
|
|
3971
3971
|
} = await Sa({
|
|
3972
3972
|
url: this.config.url({
|
|
3973
3973
|
path: "/chat/completions",
|
|
@@ -3981,14 +3981,14 @@ var Pg = class {
|
|
|
3981
3981
|
),
|
|
3982
3982
|
abortSignal: t.abortSignal,
|
|
3983
3983
|
fetch: this.config.fetch
|
|
3984
|
-
}),
|
|
3984
|
+
}), K = z.choices[0], I = [], Te = K.message.content;
|
|
3985
3985
|
Te != null && Te.length > 0 && I.push({ type: "text", text: Te });
|
|
3986
|
-
const ye = (r =
|
|
3986
|
+
const ye = (r = K.message.reasoning_content) != null ? r : K.message.reasoning;
|
|
3987
3987
|
if (ye != null && ye.length > 0 && I.push({
|
|
3988
3988
|
type: "reasoning",
|
|
3989
3989
|
text: ye
|
|
3990
|
-
}),
|
|
3991
|
-
for (const Me of
|
|
3990
|
+
}), K.message.tool_calls != null)
|
|
3991
|
+
for (const Me of K.message.tool_calls)
|
|
3992
3992
|
I.push({
|
|
3993
3993
|
type: "tool-call",
|
|
3994
3994
|
toolCallId: (o = Me.id) != null ? o : Li(),
|
|
@@ -3998,12 +3998,12 @@ var Pg = class {
|
|
|
3998
3998
|
const ne = {
|
|
3999
3999
|
[this.providerOptionsName]: {},
|
|
4000
4000
|
...await ((u = (c = this.config.metadataExtractor) == null ? void 0 : c.extractMetadata) == null ? void 0 : u.call(c, {
|
|
4001
|
-
parsedBody:
|
|
4001
|
+
parsedBody: F
|
|
4002
4002
|
}))
|
|
4003
4003
|
}, me = (f = z.usage) == null ? void 0 : f.completion_tokens_details;
|
|
4004
4004
|
return me?.accepted_prediction_tokens != null && (ne[this.providerOptionsName].acceptedPredictionTokens = me?.accepted_prediction_tokens), me?.rejected_prediction_tokens != null && (ne[this.providerOptionsName].rejectedPredictionTokens = me?.rejected_prediction_tokens), {
|
|
4005
4005
|
content: I,
|
|
4006
|
-
finishReason: Na(
|
|
4006
|
+
finishReason: Na(K.finish_reason),
|
|
4007
4007
|
usage: {
|
|
4008
4008
|
inputTokens: (m = (g = z.usage) == null ? void 0 : g.prompt_tokens) != null ? m : void 0,
|
|
4009
4009
|
outputTokens: (x = (v = z.usage) == null ? void 0 : v.completion_tokens) != null ? x : void 0,
|
|
@@ -4012,13 +4012,13 @@ var Pg = class {
|
|
|
4012
4012
|
cachedInputTokens: (j = (P = (M = z.usage) == null ? void 0 : M.prompt_tokens_details) == null ? void 0 : P.cached_tokens) != null ? j : void 0
|
|
4013
4013
|
},
|
|
4014
4014
|
providerMetadata: ne,
|
|
4015
|
-
request: { body:
|
|
4015
|
+
request: { body: Q },
|
|
4016
4016
|
response: {
|
|
4017
4017
|
...Ta(z),
|
|
4018
4018
|
headers: Y,
|
|
4019
|
-
body:
|
|
4019
|
+
body: F
|
|
4020
4020
|
},
|
|
4021
|
-
warnings:
|
|
4021
|
+
warnings: U
|
|
4022
4022
|
};
|
|
4023
4023
|
}
|
|
4024
4024
|
async doStream(t) {
|
|
@@ -4067,7 +4067,7 @@ var Pg = class {
|
|
|
4067
4067
|
},
|
|
4068
4068
|
// TODO we lost type safety on Chunk, most likely due to the error schema. MUST FIX
|
|
4069
4069
|
transform(M, P) {
|
|
4070
|
-
var j, Z,
|
|
4070
|
+
var j, Z, U, Q, Y, z, F, K, I, Te, ye, ne, me;
|
|
4071
4071
|
if (t.includeRawChunks && P.enqueue({ type: "raw", rawValue: M.rawValue }), !M.success) {
|
|
4072
4072
|
x = "error", P.enqueue({ type: "error", error: M.error });
|
|
4073
4073
|
return;
|
|
@@ -4082,13 +4082,13 @@ var Pg = class {
|
|
|
4082
4082
|
...Ta(Me)
|
|
4083
4083
|
})), Me.usage != null) {
|
|
4084
4084
|
const {
|
|
4085
|
-
prompt_tokens:
|
|
4085
|
+
prompt_tokens: J,
|
|
4086
4086
|
completion_tokens: pe,
|
|
4087
4087
|
total_tokens: de,
|
|
4088
4088
|
prompt_tokens_details: re,
|
|
4089
4089
|
completion_tokens_details: he
|
|
4090
4090
|
} = Me.usage;
|
|
4091
|
-
A.promptTokens =
|
|
4091
|
+
A.promptTokens = J ?? void 0, A.completionTokens = pe ?? void 0, A.totalTokens = de ?? void 0, he?.reasoning_tokens != null && (A.completionTokensDetails.reasoningTokens = he?.reasoning_tokens), he?.accepted_prediction_tokens != null && (A.completionTokensDetails.acceptedPredictionTokens = he?.accepted_prediction_tokens), he?.rejected_prediction_tokens != null && (A.completionTokensDetails.rejectedPredictionTokens = he?.rejected_prediction_tokens), re?.cached_tokens != null && (A.promptTokensDetails.cachedTokens = re?.cached_tokens);
|
|
4092
4092
|
}
|
|
4093
4093
|
const $ = Me.choices[0];
|
|
4094
4094
|
if ($?.finish_reason != null && (x = Na(
|
|
@@ -4108,34 +4108,34 @@ var Pg = class {
|
|
|
4108
4108
|
id: "txt-0",
|
|
4109
4109
|
delta: ge.content
|
|
4110
4110
|
})), ge.tool_calls != null)
|
|
4111
|
-
for (const
|
|
4112
|
-
const pe =
|
|
4111
|
+
for (const J of ge.tool_calls) {
|
|
4112
|
+
const pe = J.index;
|
|
4113
4113
|
if (v[pe] == null) {
|
|
4114
|
-
if (
|
|
4114
|
+
if (J.id == null)
|
|
4115
4115
|
throw new ea({
|
|
4116
|
-
data:
|
|
4116
|
+
data: J,
|
|
4117
4117
|
message: "Expected 'id' to be a string."
|
|
4118
4118
|
});
|
|
4119
|
-
if (((Z =
|
|
4119
|
+
if (((Z = J.function) == null ? void 0 : Z.name) == null)
|
|
4120
4120
|
throw new ea({
|
|
4121
|
-
data:
|
|
4121
|
+
data: J,
|
|
4122
4122
|
message: "Expected 'function.name' to be a string."
|
|
4123
4123
|
});
|
|
4124
4124
|
P.enqueue({
|
|
4125
4125
|
type: "tool-input-start",
|
|
4126
|
-
id:
|
|
4127
|
-
toolName:
|
|
4126
|
+
id: J.id,
|
|
4127
|
+
toolName: J.function.name
|
|
4128
4128
|
}), v[pe] = {
|
|
4129
|
-
id:
|
|
4129
|
+
id: J.id,
|
|
4130
4130
|
type: "function",
|
|
4131
4131
|
function: {
|
|
4132
|
-
name:
|
|
4133
|
-
arguments: (
|
|
4132
|
+
name: J.function.name,
|
|
4133
|
+
arguments: (U = J.function.arguments) != null ? U : ""
|
|
4134
4134
|
},
|
|
4135
4135
|
hasFinished: !1
|
|
4136
4136
|
};
|
|
4137
4137
|
const re = v[pe];
|
|
4138
|
-
((
|
|
4138
|
+
((Q = re.function) == null ? void 0 : Q.name) != null && ((Y = re.function) == null ? void 0 : Y.arguments) != null && (re.function.arguments.length > 0 && P.enqueue({
|
|
4139
4139
|
type: "tool-input-delta",
|
|
4140
4140
|
id: re.id,
|
|
4141
4141
|
delta: re.function.arguments
|
|
@@ -4151,10 +4151,10 @@ var Pg = class {
|
|
|
4151
4151
|
continue;
|
|
4152
4152
|
}
|
|
4153
4153
|
const de = v[pe];
|
|
4154
|
-
de.hasFinished || (((
|
|
4154
|
+
de.hasFinished || (((F = J.function) == null ? void 0 : F.arguments) != null && (de.function.arguments += (I = (K = J.function) == null ? void 0 : K.arguments) != null ? I : ""), P.enqueue({
|
|
4155
4155
|
type: "tool-input-delta",
|
|
4156
4156
|
id: de.id,
|
|
4157
|
-
delta: (Te =
|
|
4157
|
+
delta: (Te = J.function.arguments) != null ? Te : ""
|
|
4158
4158
|
}), ((ye = de.function) == null ? void 0 : ye.name) != null && ((ne = de.function) == null ? void 0 : ne.arguments) != null && Ea(de.function.arguments) && (P.enqueue({
|
|
4159
4159
|
type: "tool-input-end",
|
|
4160
4160
|
id: de.id
|
|
@@ -4167,19 +4167,19 @@ var Pg = class {
|
|
|
4167
4167
|
}
|
|
4168
4168
|
},
|
|
4169
4169
|
flush(M) {
|
|
4170
|
-
var P, j, Z,
|
|
4170
|
+
var P, j, Z, U, Q, Y;
|
|
4171
4171
|
N && M.enqueue({ type: "reasoning-end", id: "reasoning-0" }), R && M.enqueue({ type: "text-end", id: "txt-0" });
|
|
4172
|
-
for (const
|
|
4173
|
-
(
|
|
4172
|
+
for (const F of v.filter(
|
|
4173
|
+
(K) => !K.hasFinished
|
|
4174
4174
|
))
|
|
4175
4175
|
M.enqueue({
|
|
4176
4176
|
type: "tool-input-end",
|
|
4177
|
-
id:
|
|
4177
|
+
id: F.id
|
|
4178
4178
|
}), M.enqueue({
|
|
4179
4179
|
type: "tool-call",
|
|
4180
|
-
toolCallId: (P =
|
|
4181
|
-
toolName:
|
|
4182
|
-
input:
|
|
4180
|
+
toolCallId: (P = F.id) != null ? P : Li(),
|
|
4181
|
+
toolName: F.function.name,
|
|
4182
|
+
input: F.function.arguments
|
|
4183
4183
|
});
|
|
4184
4184
|
const z = {
|
|
4185
4185
|
[D]: {},
|
|
@@ -4191,8 +4191,8 @@ var Pg = class {
|
|
|
4191
4191
|
usage: {
|
|
4192
4192
|
inputTokens: (j = A.promptTokens) != null ? j : void 0,
|
|
4193
4193
|
outputTokens: (Z = A.completionTokens) != null ? Z : void 0,
|
|
4194
|
-
totalTokens: (
|
|
4195
|
-
reasoningTokens: (
|
|
4194
|
+
totalTokens: (U = A.totalTokens) != null ? U : void 0,
|
|
4195
|
+
reasoningTokens: (Q = A.completionTokensDetails.reasoningTokens) != null ? Q : void 0,
|
|
4196
4196
|
cachedInputTokens: (Y = A.promptTokensDetails.cachedTokens) != null ? Y : void 0
|
|
4197
4197
|
},
|
|
4198
4198
|
providerMetadata: z
|
|
@@ -4941,7 +4941,7 @@ function zu(t, ...r) {
|
|
|
4941
4941
|
[c, ...r].filter(Boolean).join(" ")
|
|
4942
4942
|
), Object.fromEntries(o.entries());
|
|
4943
4943
|
}
|
|
4944
|
-
var wm = "4.0.
|
|
4944
|
+
var wm = "4.0.23";
|
|
4945
4945
|
function nl(t) {
|
|
4946
4946
|
return t != null;
|
|
4947
4947
|
}
|
|
@@ -4959,7 +4959,7 @@ function _m({
|
|
|
4959
4959
|
});
|
|
4960
4960
|
if (typeof process > "u")
|
|
4961
4961
|
throw new Fi({
|
|
4962
|
-
message: `${c} API key is missing. Pass it using the '${o}' parameter. Environment variables
|
|
4962
|
+
message: `${c} API key is missing. Pass it using the '${o}' parameter. Environment variables are not supported in this environment.`
|
|
4963
4963
|
});
|
|
4964
4964
|
if (t = process.env[r], t == null)
|
|
4965
4965
|
throw new Fi({
|
|
@@ -6990,28 +6990,28 @@ var N2 = class {
|
|
|
6990
6990
|
providerOptions: D
|
|
6991
6991
|
}) {
|
|
6992
6992
|
var N, R, M, P, j;
|
|
6993
|
-
const Z = [],
|
|
6993
|
+
const Z = [], U = (N = await Jn({
|
|
6994
6994
|
provider: "openai",
|
|
6995
6995
|
providerOptions: D,
|
|
6996
6996
|
schema: S2
|
|
6997
|
-
})) != null ? N : {},
|
|
6997
|
+
})) != null ? N : {}, Q = qu(this.modelId), Y = (R = U.forceReasoning) != null ? R : Q.isReasoningModel;
|
|
6998
6998
|
u != null && Z.push({ type: "unsupported", feature: "topK" });
|
|
6999
|
-
const { messages: z, warnings:
|
|
6999
|
+
const { messages: z, warnings: F } = A2(
|
|
7000
7000
|
{
|
|
7001
7001
|
prompt: t,
|
|
7002
|
-
systemMessageMode: (M =
|
|
7002
|
+
systemMessageMode: (M = U.systemMessageMode) != null ? M : Y ? "developer" : Q.systemMessageMode
|
|
7003
7003
|
}
|
|
7004
7004
|
);
|
|
7005
|
-
Z.push(...
|
|
7006
|
-
const
|
|
7005
|
+
Z.push(...F);
|
|
7006
|
+
const K = (P = U.strictJsonSchema) != null ? P : !0, I = {
|
|
7007
7007
|
// model id:
|
|
7008
7008
|
model: this.modelId,
|
|
7009
7009
|
// model specific settings:
|
|
7010
|
-
logit_bias:
|
|
7011
|
-
logprobs:
|
|
7012
|
-
top_logprobs: typeof
|
|
7013
|
-
user:
|
|
7014
|
-
parallel_tool_calls:
|
|
7010
|
+
logit_bias: U.logitBias,
|
|
7011
|
+
logprobs: U.logprobs === !0 || typeof U.logprobs == "number" ? !0 : void 0,
|
|
7012
|
+
top_logprobs: typeof U.logprobs == "number" ? U.logprobs : typeof U.logprobs == "boolean" && U.logprobs ? 0 : void 0,
|
|
7013
|
+
user: U.user,
|
|
7014
|
+
parallel_tool_calls: U.parallelToolCalls,
|
|
7015
7015
|
// standardized settings:
|
|
7016
7016
|
max_tokens: r,
|
|
7017
7017
|
temperature: o,
|
|
@@ -7022,29 +7022,29 @@ var N2 = class {
|
|
|
7022
7022
|
type: "json_schema",
|
|
7023
7023
|
json_schema: {
|
|
7024
7024
|
schema: v.schema,
|
|
7025
|
-
strict:
|
|
7025
|
+
strict: K,
|
|
7026
7026
|
name: (j = v.name) != null ? j : "response",
|
|
7027
7027
|
description: v.description
|
|
7028
7028
|
}
|
|
7029
7029
|
} : { type: "json_object" } : void 0,
|
|
7030
7030
|
stop: m,
|
|
7031
7031
|
seed: x,
|
|
7032
|
-
verbosity:
|
|
7032
|
+
verbosity: U.textVerbosity,
|
|
7033
7033
|
// openai specific settings:
|
|
7034
7034
|
// TODO AI SDK 6: remove, we auto-map maxOutputTokens now
|
|
7035
|
-
max_completion_tokens:
|
|
7036
|
-
store:
|
|
7037
|
-
metadata:
|
|
7038
|
-
prediction:
|
|
7039
|
-
reasoning_effort:
|
|
7040
|
-
service_tier:
|
|
7041
|
-
prompt_cache_key:
|
|
7042
|
-
prompt_cache_retention:
|
|
7043
|
-
safety_identifier:
|
|
7035
|
+
max_completion_tokens: U.maxCompletionTokens,
|
|
7036
|
+
store: U.store,
|
|
7037
|
+
metadata: U.metadata,
|
|
7038
|
+
prediction: U.prediction,
|
|
7039
|
+
reasoning_effort: U.reasoningEffort,
|
|
7040
|
+
service_tier: U.serviceTier,
|
|
7041
|
+
prompt_cache_key: U.promptCacheKey,
|
|
7042
|
+
prompt_cache_retention: U.promptCacheRetention,
|
|
7043
|
+
safety_identifier: U.safetyIdentifier,
|
|
7044
7044
|
// messages:
|
|
7045
7045
|
messages: z
|
|
7046
7046
|
};
|
|
7047
|
-
Y ? ((
|
|
7047
|
+
Y ? ((U.reasoningEffort !== "none" || !Q.supportsNonReasoningParameters) && (I.temperature != null && (I.temperature = void 0, Z.push({
|
|
7048
7048
|
type: "unsupported",
|
|
7049
7049
|
feature: "temperature",
|
|
7050
7050
|
details: "temperature is not supported for reasoning models"
|
|
@@ -7073,11 +7073,11 @@ var N2 = class {
|
|
|
7073
7073
|
type: "unsupported",
|
|
7074
7074
|
feature: "temperature",
|
|
7075
7075
|
details: "temperature is not supported for the search preview models and has been removed."
|
|
7076
|
-
})),
|
|
7076
|
+
})), U.serviceTier === "flex" && !Q.supportsFlexProcessing && (Z.push({
|
|
7077
7077
|
type: "unsupported",
|
|
7078
7078
|
feature: "serviceTier",
|
|
7079
7079
|
details: "flex processing is only available for o3, o4-mini, and gpt-5 models"
|
|
7080
|
-
}), I.service_tier = void 0),
|
|
7080
|
+
}), I.service_tier = void 0), U.serviceTier === "priority" && !Q.supportsPriorityProcessing && (Z.push({
|
|
7081
7081
|
type: "unsupported",
|
|
7082
7082
|
feature: "serviceTier",
|
|
7083
7083
|
details: "priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"
|
|
@@ -7188,7 +7188,7 @@ var N2 = class {
|
|
|
7188
7188
|
D.enqueue({ type: "stream-start", warnings: o });
|
|
7189
7189
|
},
|
|
7190
7190
|
transform(D, N) {
|
|
7191
|
-
var R, M, P, j, Z,
|
|
7191
|
+
var R, M, P, j, Z, U, Q, Y, z, F, K, I, Te, ye, ne, me, Me;
|
|
7192
7192
|
if (t.includeRawChunks && N.enqueue({ type: "raw", rawValue: D.rawValue }), !D.success) {
|
|
7193
7193
|
m = { unified: "error", raw: void 0 }, N.enqueue({ type: "error", error: D.error });
|
|
7194
7194
|
return;
|
|
@@ -7199,8 +7199,8 @@ var N2 = class {
|
|
|
7199
7199
|
return;
|
|
7200
7200
|
}
|
|
7201
7201
|
if (!x) {
|
|
7202
|
-
const
|
|
7203
|
-
Object.values(
|
|
7202
|
+
const J = Po($);
|
|
7203
|
+
Object.values(J).some(Boolean) && (x = !0, N.enqueue({
|
|
7204
7204
|
type: "response-metadata",
|
|
7205
7205
|
...Po($)
|
|
7206
7206
|
}));
|
|
@@ -7218,34 +7218,34 @@ var N2 = class {
|
|
|
7218
7218
|
id: "0",
|
|
7219
7219
|
delta: te.content
|
|
7220
7220
|
})), te.tool_calls != null)
|
|
7221
|
-
for (const
|
|
7222
|
-
const pe =
|
|
7221
|
+
for (const J of te.tool_calls) {
|
|
7222
|
+
const pe = J.index;
|
|
7223
7223
|
if (g[pe] == null) {
|
|
7224
|
-
if (
|
|
7224
|
+
if (J.type != null && J.type !== "function")
|
|
7225
7225
|
throw new Ro({
|
|
7226
|
-
data:
|
|
7226
|
+
data: J,
|
|
7227
7227
|
message: "Expected 'function' type."
|
|
7228
7228
|
});
|
|
7229
|
-
if (
|
|
7229
|
+
if (J.id == null)
|
|
7230
7230
|
throw new Ro({
|
|
7231
|
-
data:
|
|
7231
|
+
data: J,
|
|
7232
7232
|
message: "Expected 'id' to be a string."
|
|
7233
7233
|
});
|
|
7234
|
-
if (((
|
|
7234
|
+
if (((U = J.function) == null ? void 0 : U.name) == null)
|
|
7235
7235
|
throw new Ro({
|
|
7236
|
-
data:
|
|
7236
|
+
data: J,
|
|
7237
7237
|
message: "Expected 'function.name' to be a string."
|
|
7238
7238
|
});
|
|
7239
7239
|
N.enqueue({
|
|
7240
7240
|
type: "tool-input-start",
|
|
7241
|
-
id:
|
|
7242
|
-
toolName:
|
|
7241
|
+
id: J.id,
|
|
7242
|
+
toolName: J.function.name
|
|
7243
7243
|
}), g[pe] = {
|
|
7244
|
-
id:
|
|
7244
|
+
id: J.id,
|
|
7245
7245
|
type: "function",
|
|
7246
7246
|
function: {
|
|
7247
|
-
name:
|
|
7248
|
-
arguments: (
|
|
7247
|
+
name: J.function.name,
|
|
7248
|
+
arguments: (Q = J.function.arguments) != null ? Q : ""
|
|
7249
7249
|
},
|
|
7250
7250
|
hasFinished: !1
|
|
7251
7251
|
};
|
|
@@ -7259,17 +7259,17 @@ var N2 = class {
|
|
|
7259
7259
|
id: re.id
|
|
7260
7260
|
}), N.enqueue({
|
|
7261
7261
|
type: "tool-call",
|
|
7262
|
-
toolCallId: (
|
|
7262
|
+
toolCallId: (F = re.id) != null ? F : on(),
|
|
7263
7263
|
toolName: re.function.name,
|
|
7264
7264
|
input: re.function.arguments
|
|
7265
7265
|
}), re.hasFinished = !0));
|
|
7266
7266
|
continue;
|
|
7267
7267
|
}
|
|
7268
7268
|
const de = g[pe];
|
|
7269
|
-
de.hasFinished || (((
|
|
7269
|
+
de.hasFinished || (((K = J.function) == null ? void 0 : K.arguments) != null && (de.function.arguments += (Te = (I = J.function) == null ? void 0 : I.arguments) != null ? Te : ""), N.enqueue({
|
|
7270
7270
|
type: "tool-input-delta",
|
|
7271
7271
|
id: de.id,
|
|
7272
|
-
delta: (ye =
|
|
7272
|
+
delta: (ye = J.function.arguments) != null ? ye : ""
|
|
7273
7273
|
}), ((ne = de.function) == null ? void 0 : ne.name) != null && ((me = de.function) == null ? void 0 : me.arguments) != null && sl(de.function.arguments) && (N.enqueue({
|
|
7274
7274
|
type: "tool-input-end",
|
|
7275
7275
|
id: de.id
|
|
@@ -7281,13 +7281,13 @@ var N2 = class {
|
|
|
7281
7281
|
}), de.hasFinished = !0));
|
|
7282
7282
|
}
|
|
7283
7283
|
if (te.annotations != null)
|
|
7284
|
-
for (const
|
|
7284
|
+
for (const J of te.annotations)
|
|
7285
7285
|
N.enqueue({
|
|
7286
7286
|
type: "source",
|
|
7287
7287
|
sourceType: "url",
|
|
7288
7288
|
id: on(),
|
|
7289
|
-
url:
|
|
7290
|
-
title:
|
|
7289
|
+
url: J.url_citation.url,
|
|
7290
|
+
title: J.url_citation.title
|
|
7291
7291
|
});
|
|
7292
7292
|
},
|
|
7293
7293
|
flush(D) {
|
|
@@ -7843,7 +7843,7 @@ var z2 = class {
|
|
|
7843
7843
|
headers: v,
|
|
7844
7844
|
abortSignal: x
|
|
7845
7845
|
}) {
|
|
7846
|
-
var A, _, D, N, R, M, P, j, Z,
|
|
7846
|
+
var A, _, D, N, R, M, P, j, Z, U, Q;
|
|
7847
7847
|
const Y = [];
|
|
7848
7848
|
f != null && Y.push({
|
|
7849
7849
|
type: "unsupported",
|
|
@@ -7903,7 +7903,7 @@ var z2 = class {
|
|
|
7903
7903
|
providerMetadata: {
|
|
7904
7904
|
openai: {
|
|
7905
7905
|
images: I.data.map((ye, ne) => {
|
|
7906
|
-
var me, Me, $, ge, te,
|
|
7906
|
+
var me, Me, $, ge, te, J;
|
|
7907
7907
|
return {
|
|
7908
7908
|
...ye.revised_prompt ? { revisedPrompt: ye.revised_prompt } : {},
|
|
7909
7909
|
created: (me = I.created) != null ? me : void 0,
|
|
@@ -7912,7 +7912,7 @@ var z2 = class {
|
|
|
7912
7912
|
background: (ge = I.background) != null ? ge : void 0,
|
|
7913
7913
|
outputFormat: (te = I.output_format) != null ? te : void 0,
|
|
7914
7914
|
...pl(
|
|
7915
|
-
(
|
|
7915
|
+
(J = I.usage) == null ? void 0 : J.input_tokens_details,
|
|
7916
7916
|
ne,
|
|
7917
7917
|
I.data.length
|
|
7918
7918
|
)
|
|
@@ -7922,7 +7922,7 @@ var z2 = class {
|
|
|
7922
7922
|
}
|
|
7923
7923
|
};
|
|
7924
7924
|
}
|
|
7925
|
-
const { value:
|
|
7925
|
+
const { value: F, responseHeaders: K } = await Qn({
|
|
7926
7926
|
url: this.config.url({
|
|
7927
7927
|
path: "/images/generations",
|
|
7928
7928
|
modelId: this.modelId
|
|
@@ -7944,33 +7944,33 @@ var z2 = class {
|
|
|
7944
7944
|
fetch: this.config.fetch
|
|
7945
7945
|
});
|
|
7946
7946
|
return {
|
|
7947
|
-
images:
|
|
7947
|
+
images: F.data.map((I) => I.b64_json),
|
|
7948
7948
|
warnings: Y,
|
|
7949
|
-
usage:
|
|
7950
|
-
inputTokens: (Z =
|
|
7951
|
-
outputTokens: (
|
|
7952
|
-
totalTokens: (
|
|
7949
|
+
usage: F.usage != null ? {
|
|
7950
|
+
inputTokens: (Z = F.usage.input_tokens) != null ? Z : void 0,
|
|
7951
|
+
outputTokens: (U = F.usage.output_tokens) != null ? U : void 0,
|
|
7952
|
+
totalTokens: (Q = F.usage.total_tokens) != null ? Q : void 0
|
|
7953
7953
|
} : void 0,
|
|
7954
7954
|
response: {
|
|
7955
7955
|
timestamp: z,
|
|
7956
7956
|
modelId: this.modelId,
|
|
7957
|
-
headers:
|
|
7957
|
+
headers: K
|
|
7958
7958
|
},
|
|
7959
7959
|
providerMetadata: {
|
|
7960
7960
|
openai: {
|
|
7961
|
-
images:
|
|
7961
|
+
images: F.data.map((I, Te) => {
|
|
7962
7962
|
var ye, ne, me, Me, $, ge;
|
|
7963
7963
|
return {
|
|
7964
7964
|
...I.revised_prompt ? { revisedPrompt: I.revised_prompt } : {},
|
|
7965
|
-
created: (ye =
|
|
7966
|
-
size: (ne =
|
|
7967
|
-
quality: (me =
|
|
7968
|
-
background: (Me =
|
|
7969
|
-
outputFormat: ($ =
|
|
7965
|
+
created: (ye = F.created) != null ? ye : void 0,
|
|
7966
|
+
size: (ne = F.size) != null ? ne : void 0,
|
|
7967
|
+
quality: (me = F.quality) != null ? me : void 0,
|
|
7968
|
+
background: (Me = F.background) != null ? Me : void 0,
|
|
7969
|
+
outputFormat: ($ = F.output_format) != null ? $ : void 0,
|
|
7970
7970
|
...pl(
|
|
7971
|
-
(ge =
|
|
7971
|
+
(ge = F.usage) == null ? void 0 : ge.input_tokens_details,
|
|
7972
7972
|
Te,
|
|
7973
|
-
|
|
7973
|
+
F.data.length
|
|
7974
7974
|
)
|
|
7975
7975
|
};
|
|
7976
7976
|
})
|
|
@@ -8584,7 +8584,7 @@ async function Nx({
|
|
|
8584
8584
|
hasApplyPatchTool: x = !1,
|
|
8585
8585
|
customProviderToolNames: A
|
|
8586
8586
|
}) {
|
|
8587
|
-
var _, D, N, R, M, P, j, Z,
|
|
8587
|
+
var _, D, N, R, M, P, j, Z, U, Q, Y, z, F, K, I, Te, ye;
|
|
8588
8588
|
let ne = [];
|
|
8589
8589
|
const me = [], Me = /* @__PURE__ */ new Set();
|
|
8590
8590
|
for (const { role: $, content: ge } of t)
|
|
@@ -8618,7 +8618,7 @@ async function Nx({
|
|
|
8618
8618
|
case "user": {
|
|
8619
8619
|
ne.push({
|
|
8620
8620
|
role: "user",
|
|
8621
|
-
content: ge.map((te,
|
|
8621
|
+
content: ge.map((te, J) => {
|
|
8622
8622
|
var pe, de, re;
|
|
8623
8623
|
switch (te.type) {
|
|
8624
8624
|
case "text":
|
|
@@ -8641,7 +8641,7 @@ async function Nx({
|
|
|
8641
8641
|
} : {
|
|
8642
8642
|
type: "input_file",
|
|
8643
8643
|
...typeof te.data == "string" && ml(te.data, u) ? { file_id: te.data } : {
|
|
8644
|
-
filename: (re = te.filename) != null ? re : `part-${
|
|
8644
|
+
filename: (re = te.filename) != null ? re : `part-${J}.pdf`,
|
|
8645
8645
|
file_data: `data:application/pdf;base64,${zr(te.data)}`
|
|
8646
8646
|
}
|
|
8647
8647
|
};
|
|
@@ -8656,10 +8656,10 @@ async function Nx({
|
|
|
8656
8656
|
}
|
|
8657
8657
|
case "assistant": {
|
|
8658
8658
|
const te = {};
|
|
8659
|
-
for (const
|
|
8660
|
-
switch (
|
|
8659
|
+
for (const J of ge)
|
|
8660
|
+
switch (J.type) {
|
|
8661
8661
|
case "text": {
|
|
8662
|
-
const pe = (_ =
|
|
8662
|
+
const pe = (_ = J.providerOptions) == null ? void 0 : _[c], de = pe?.itemId, re = pe?.phase;
|
|
8663
8663
|
if (g && de != null)
|
|
8664
8664
|
break;
|
|
8665
8665
|
if (f && de != null) {
|
|
@@ -8668,34 +8668,34 @@ async function Nx({
|
|
|
8668
8668
|
}
|
|
8669
8669
|
ne.push({
|
|
8670
8670
|
role: "assistant",
|
|
8671
|
-
content: [{ type: "output_text", text:
|
|
8671
|
+
content: [{ type: "output_text", text: J.text }],
|
|
8672
8672
|
id: de,
|
|
8673
8673
|
...re != null && { phase: re }
|
|
8674
8674
|
});
|
|
8675
8675
|
break;
|
|
8676
8676
|
}
|
|
8677
8677
|
case "tool-call": {
|
|
8678
|
-
const pe = (P = (N = (D =
|
|
8678
|
+
const pe = (P = (N = (D = J.providerOptions) == null ? void 0 : D[c]) == null ? void 0 : N.itemId) != null ? P : (M = (R = J.providerMetadata) == null ? void 0 : R[c]) == null ? void 0 : M.itemId;
|
|
8679
8679
|
if (g && pe != null)
|
|
8680
8680
|
break;
|
|
8681
8681
|
const de = r.toProviderToolName(
|
|
8682
|
-
|
|
8682
|
+
J.toolName
|
|
8683
8683
|
);
|
|
8684
8684
|
if (de === "tool_search") {
|
|
8685
8685
|
if (f && pe != null) {
|
|
8686
8686
|
ne.push({ type: "item_reference", id: pe });
|
|
8687
8687
|
break;
|
|
8688
8688
|
}
|
|
8689
|
-
const re = typeof
|
|
8690
|
-
text:
|
|
8689
|
+
const re = typeof J.input == "string" ? await Wu({
|
|
8690
|
+
text: J.input,
|
|
8691
8691
|
schema: ns
|
|
8692
8692
|
}) : await Lt({
|
|
8693
|
-
value:
|
|
8693
|
+
value: J.input,
|
|
8694
8694
|
schema: ns
|
|
8695
8695
|
}), he = re.call_id != null ? "client" : "server";
|
|
8696
8696
|
ne.push({
|
|
8697
8697
|
type: "tool_search_call",
|
|
8698
|
-
id: pe ??
|
|
8698
|
+
id: pe ?? J.toolCallId,
|
|
8699
8699
|
execution: he,
|
|
8700
8700
|
call_id: (j = re.call_id) != null ? j : null,
|
|
8701
8701
|
status: "completed",
|
|
@@ -8703,7 +8703,7 @@ async function Nx({
|
|
|
8703
8703
|
});
|
|
8704
8704
|
break;
|
|
8705
8705
|
}
|
|
8706
|
-
if (
|
|
8706
|
+
if (J.providerExecuted) {
|
|
8707
8707
|
f && pe != null && ne.push({ type: "item_reference", id: pe });
|
|
8708
8708
|
break;
|
|
8709
8709
|
}
|
|
@@ -8713,12 +8713,12 @@ async function Nx({
|
|
|
8713
8713
|
}
|
|
8714
8714
|
if (m && de === "local_shell") {
|
|
8715
8715
|
const re = await Lt({
|
|
8716
|
-
value:
|
|
8716
|
+
value: J.input,
|
|
8717
8717
|
schema: ed
|
|
8718
8718
|
});
|
|
8719
8719
|
ne.push({
|
|
8720
8720
|
type: "local_shell_call",
|
|
8721
|
-
call_id:
|
|
8721
|
+
call_id: J.toolCallId,
|
|
8722
8722
|
id: pe,
|
|
8723
8723
|
action: {
|
|
8724
8724
|
type: "exec",
|
|
@@ -8733,12 +8733,12 @@ async function Nx({
|
|
|
8733
8733
|
}
|
|
8734
8734
|
if (v && de === "shell") {
|
|
8735
8735
|
const re = await Lt({
|
|
8736
|
-
value:
|
|
8736
|
+
value: J.input,
|
|
8737
8737
|
schema: nd
|
|
8738
8738
|
});
|
|
8739
8739
|
ne.push({
|
|
8740
8740
|
type: "shell_call",
|
|
8741
|
-
call_id:
|
|
8741
|
+
call_id: J.toolCallId,
|
|
8742
8742
|
id: pe,
|
|
8743
8743
|
status: "completed",
|
|
8744
8744
|
action: {
|
|
@@ -8751,7 +8751,7 @@ async function Nx({
|
|
|
8751
8751
|
}
|
|
8752
8752
|
if (x && de === "apply_patch") {
|
|
8753
8753
|
const re = await Lt({
|
|
8754
|
-
value:
|
|
8754
|
+
value: J.input,
|
|
8755
8755
|
schema: Yu
|
|
8756
8756
|
});
|
|
8757
8757
|
ne.push({
|
|
@@ -8766,36 +8766,36 @@ async function Nx({
|
|
|
8766
8766
|
if (A?.has(de)) {
|
|
8767
8767
|
ne.push({
|
|
8768
8768
|
type: "custom_tool_call",
|
|
8769
|
-
call_id:
|
|
8769
|
+
call_id: J.toolCallId,
|
|
8770
8770
|
name: de,
|
|
8771
|
-
input: typeof
|
|
8771
|
+
input: typeof J.input == "string" ? J.input : JSON.stringify(J.input),
|
|
8772
8772
|
id: pe
|
|
8773
8773
|
});
|
|
8774
8774
|
break;
|
|
8775
8775
|
}
|
|
8776
8776
|
ne.push({
|
|
8777
8777
|
type: "function_call",
|
|
8778
|
-
call_id:
|
|
8778
|
+
call_id: J.toolCallId,
|
|
8779
8779
|
name: de,
|
|
8780
|
-
arguments: JSON.stringify(
|
|
8780
|
+
arguments: JSON.stringify(J.input),
|
|
8781
8781
|
id: pe
|
|
8782
8782
|
});
|
|
8783
8783
|
break;
|
|
8784
8784
|
}
|
|
8785
8785
|
// assistant tool result parts are from provider-executed tools:
|
|
8786
8786
|
case "tool-result": {
|
|
8787
|
-
if (
|
|
8787
|
+
if (J.output.type === "execution-denied" || J.output.type === "json" && typeof J.output.value == "object" && J.output.value != null && "type" in J.output.value && J.output.value.type === "execution-denied" || g)
|
|
8788
8788
|
break;
|
|
8789
8789
|
const pe = r.toProviderToolName(
|
|
8790
|
-
|
|
8790
|
+
J.toolName
|
|
8791
8791
|
);
|
|
8792
8792
|
if (pe === "tool_search") {
|
|
8793
|
-
const de = (
|
|
8793
|
+
const de = (Q = (U = (Z = J.providerOptions) == null ? void 0 : Z[c]) == null ? void 0 : U.itemId) != null ? Q : J.toolCallId;
|
|
8794
8794
|
if (f)
|
|
8795
8795
|
ne.push({ type: "item_reference", id: de });
|
|
8796
|
-
else if (
|
|
8796
|
+
else if (J.output.type === "json") {
|
|
8797
8797
|
const re = await Lt({
|
|
8798
|
-
value:
|
|
8798
|
+
value: J.output.value,
|
|
8799
8799
|
schema: rs
|
|
8800
8800
|
});
|
|
8801
8801
|
ne.push({
|
|
@@ -8810,14 +8810,14 @@ async function Nx({
|
|
|
8810
8810
|
break;
|
|
8811
8811
|
}
|
|
8812
8812
|
if (v && pe === "shell") {
|
|
8813
|
-
if (
|
|
8813
|
+
if (J.output.type === "json") {
|
|
8814
8814
|
const de = await Lt({
|
|
8815
|
-
value:
|
|
8815
|
+
value: J.output.value,
|
|
8816
8816
|
schema: ts
|
|
8817
8817
|
});
|
|
8818
8818
|
ne.push({
|
|
8819
8819
|
type: "shell_call_output",
|
|
8820
|
-
call_id:
|
|
8820
|
+
call_id: J.toolCallId,
|
|
8821
8821
|
output: de.output.map((re) => ({
|
|
8822
8822
|
stdout: re.stdout,
|
|
8823
8823
|
stderr: re.stderr,
|
|
@@ -8831,19 +8831,19 @@ async function Nx({
|
|
|
8831
8831
|
break;
|
|
8832
8832
|
}
|
|
8833
8833
|
if (f) {
|
|
8834
|
-
const de = (
|
|
8834
|
+
const de = (F = (z = (Y = J.providerOptions) == null ? void 0 : Y[c]) == null ? void 0 : z.itemId) != null ? F : J.toolCallId;
|
|
8835
8835
|
ne.push({ type: "item_reference", id: de });
|
|
8836
8836
|
} else
|
|
8837
8837
|
me.push({
|
|
8838
8838
|
type: "other",
|
|
8839
|
-
message: `Results for OpenAI tool ${
|
|
8839
|
+
message: `Results for OpenAI tool ${J.toolName} are not sent to the API when store is false`
|
|
8840
8840
|
});
|
|
8841
8841
|
break;
|
|
8842
8842
|
}
|
|
8843
8843
|
case "reasoning": {
|
|
8844
8844
|
const pe = await Jn({
|
|
8845
8845
|
provider: c,
|
|
8846
|
-
providerOptions:
|
|
8846
|
+
providerOptions: J.providerOptions,
|
|
8847
8847
|
schema: Ox
|
|
8848
8848
|
}), de = pe?.itemId;
|
|
8849
8849
|
if (g && de != null)
|
|
@@ -8858,12 +8858,12 @@ async function Nx({
|
|
|
8858
8858
|
});
|
|
8859
8859
|
else {
|
|
8860
8860
|
const he = [];
|
|
8861
|
-
|
|
8861
|
+
J.text.length > 0 ? he.push({
|
|
8862
8862
|
type: "summary_text",
|
|
8863
|
-
text:
|
|
8863
|
+
text: J.text
|
|
8864
8864
|
}) : re !== void 0 && me.push({
|
|
8865
8865
|
type: "other",
|
|
8866
|
-
message: `Cannot append empty reasoning part to existing reasoning sequence. Skipping reasoning part: ${JSON.stringify(
|
|
8866
|
+
message: `Cannot append empty reasoning part to existing reasoning sequence. Skipping reasoning part: ${JSON.stringify(J)}.`
|
|
8867
8867
|
}), re === void 0 ? (te[de] = {
|
|
8868
8868
|
type: "reasoning",
|
|
8869
8869
|
id: de,
|
|
@@ -8875,9 +8875,9 @@ async function Nx({
|
|
|
8875
8875
|
const re = pe?.reasoningEncryptedContent;
|
|
8876
8876
|
if (re != null) {
|
|
8877
8877
|
const he = [];
|
|
8878
|
-
|
|
8878
|
+
J.text.length > 0 && he.push({
|
|
8879
8879
|
type: "summary_text",
|
|
8880
|
-
text:
|
|
8880
|
+
text: J.text
|
|
8881
8881
|
}), ne.push({
|
|
8882
8882
|
type: "reasoning",
|
|
8883
8883
|
encrypted_content: re,
|
|
@@ -8886,7 +8886,7 @@ async function Nx({
|
|
|
8886
8886
|
} else
|
|
8887
8887
|
me.push({
|
|
8888
8888
|
type: "other",
|
|
8889
|
-
message: `Non-OpenAI reasoning parts are not supported. Skipping reasoning part: ${JSON.stringify(
|
|
8889
|
+
message: `Non-OpenAI reasoning parts are not supported. Skipping reasoning part: ${JSON.stringify(J)}.`
|
|
8890
8890
|
});
|
|
8891
8891
|
}
|
|
8892
8892
|
break;
|
|
@@ -8910,15 +8910,15 @@ async function Nx({
|
|
|
8910
8910
|
});
|
|
8911
8911
|
continue;
|
|
8912
8912
|
}
|
|
8913
|
-
const
|
|
8914
|
-
if (
|
|
8913
|
+
const J = te.output;
|
|
8914
|
+
if (J.type === "execution-denied" && ((I = (K = J.providerOptions) == null ? void 0 : K.openai) == null ? void 0 : I.approvalId))
|
|
8915
8915
|
continue;
|
|
8916
8916
|
const pe = r.toProviderToolName(
|
|
8917
8917
|
te.toolName
|
|
8918
8918
|
);
|
|
8919
|
-
if (pe === "tool_search" &&
|
|
8919
|
+
if (pe === "tool_search" && J.type === "json") {
|
|
8920
8920
|
const re = await Lt({
|
|
8921
|
-
value:
|
|
8921
|
+
value: J.value,
|
|
8922
8922
|
schema: rs
|
|
8923
8923
|
});
|
|
8924
8924
|
ne.push({
|
|
@@ -8930,9 +8930,9 @@ async function Nx({
|
|
|
8930
8930
|
});
|
|
8931
8931
|
continue;
|
|
8932
8932
|
}
|
|
8933
|
-
if (m && pe === "local_shell" &&
|
|
8933
|
+
if (m && pe === "local_shell" && J.type === "json") {
|
|
8934
8934
|
const re = await Lt({
|
|
8935
|
-
value:
|
|
8935
|
+
value: J.value,
|
|
8936
8936
|
schema: td
|
|
8937
8937
|
});
|
|
8938
8938
|
ne.push({
|
|
@@ -8942,9 +8942,9 @@ async function Nx({
|
|
|
8942
8942
|
});
|
|
8943
8943
|
continue;
|
|
8944
8944
|
}
|
|
8945
|
-
if (v && pe === "shell" &&
|
|
8945
|
+
if (v && pe === "shell" && J.type === "json") {
|
|
8946
8946
|
const re = await Lt({
|
|
8947
|
-
value:
|
|
8947
|
+
value: J.value,
|
|
8948
8948
|
schema: ts
|
|
8949
8949
|
});
|
|
8950
8950
|
ne.push({
|
|
@@ -8961,9 +8961,9 @@ async function Nx({
|
|
|
8961
8961
|
});
|
|
8962
8962
|
continue;
|
|
8963
8963
|
}
|
|
8964
|
-
if (x && te.toolName === "apply_patch" &&
|
|
8964
|
+
if (x && te.toolName === "apply_patch" && J.type === "json") {
|
|
8965
8965
|
const re = await Lt({
|
|
8966
|
-
value:
|
|
8966
|
+
value: J.value,
|
|
8967
8967
|
schema: Ku
|
|
8968
8968
|
});
|
|
8969
8969
|
ne.push({
|
|
@@ -8976,20 +8976,20 @@ async function Nx({
|
|
|
8976
8976
|
}
|
|
8977
8977
|
if (A?.has(pe)) {
|
|
8978
8978
|
let re;
|
|
8979
|
-
switch (
|
|
8979
|
+
switch (J.type) {
|
|
8980
8980
|
case "text":
|
|
8981
8981
|
case "error-text":
|
|
8982
|
-
re =
|
|
8982
|
+
re = J.value;
|
|
8983
8983
|
break;
|
|
8984
8984
|
case "execution-denied":
|
|
8985
|
-
re = (Te =
|
|
8985
|
+
re = (Te = J.reason) != null ? Te : "Tool execution denied.";
|
|
8986
8986
|
break;
|
|
8987
8987
|
case "json":
|
|
8988
8988
|
case "error-json":
|
|
8989
|
-
re = JSON.stringify(
|
|
8989
|
+
re = JSON.stringify(J.value);
|
|
8990
8990
|
break;
|
|
8991
8991
|
case "content":
|
|
8992
|
-
re =
|
|
8992
|
+
re = J.value.map((he) => {
|
|
8993
8993
|
var It;
|
|
8994
8994
|
switch (he.type) {
|
|
8995
8995
|
case "text":
|
|
@@ -9035,20 +9035,20 @@ async function Nx({
|
|
|
9035
9035
|
continue;
|
|
9036
9036
|
}
|
|
9037
9037
|
let de;
|
|
9038
|
-
switch (
|
|
9038
|
+
switch (J.type) {
|
|
9039
9039
|
case "text":
|
|
9040
9040
|
case "error-text":
|
|
9041
|
-
de =
|
|
9041
|
+
de = J.value;
|
|
9042
9042
|
break;
|
|
9043
9043
|
case "execution-denied":
|
|
9044
|
-
de = (ye =
|
|
9044
|
+
de = (ye = J.reason) != null ? ye : "Tool execution denied.";
|
|
9045
9045
|
break;
|
|
9046
9046
|
case "json":
|
|
9047
9047
|
case "error-json":
|
|
9048
|
-
de = JSON.stringify(
|
|
9048
|
+
de = JSON.stringify(J.value);
|
|
9049
9049
|
break;
|
|
9050
9050
|
case "content":
|
|
9051
|
-
de =
|
|
9051
|
+
de = J.value.map((re) => {
|
|
9052
9052
|
var he;
|
|
9053
9053
|
switch (re.type) {
|
|
9054
9054
|
case "text":
|
|
@@ -10412,21 +10412,21 @@ var Bx = class {
|
|
|
10412
10412
|
toolChoice: _,
|
|
10413
10413
|
responseFormat: D
|
|
10414
10414
|
}) {
|
|
10415
|
-
var N, R, M, P, j, Z,
|
|
10416
|
-
const z = [],
|
|
10415
|
+
var N, R, M, P, j, Z, U, Q, Y;
|
|
10416
|
+
const z = [], F = qu(this.modelId);
|
|
10417
10417
|
u != null && z.push({ type: "unsupported", feature: "topK" }), m != null && z.push({ type: "unsupported", feature: "seed" }), f != null && z.push({ type: "unsupported", feature: "presencePenalty" }), g != null && z.push({ type: "unsupported", feature: "frequencyPenalty" }), o != null && z.push({ type: "unsupported", feature: "stopSequences" });
|
|
10418
|
-
const
|
|
10418
|
+
const K = this.config.provider.includes("azure") ? "azure" : "openai";
|
|
10419
10419
|
let I = await Jn({
|
|
10420
|
-
provider:
|
|
10420
|
+
provider: K,
|
|
10421
10421
|
providerOptions: x,
|
|
10422
10422
|
schema: xl
|
|
10423
10423
|
});
|
|
10424
|
-
I == null &&
|
|
10424
|
+
I == null && K !== "openai" && (I = await Jn({
|
|
10425
10425
|
provider: "openai",
|
|
10426
10426
|
providerOptions: x,
|
|
10427
10427
|
schema: xl
|
|
10428
10428
|
}));
|
|
10429
|
-
const Te = (N = I?.forceReasoning) != null ? N :
|
|
10429
|
+
const Te = (N = I?.forceReasoning) != null ? N : F.isReasoningModel;
|
|
10430
10430
|
I?.conversation && I?.previousResponseId && z.push({
|
|
10431
10431
|
type: "unsupported",
|
|
10432
10432
|
feature: "conversation",
|
|
@@ -10459,8 +10459,8 @@ var Bx = class {
|
|
|
10459
10459
|
}), { input: ge, warnings: te } = await Nx({
|
|
10460
10460
|
prompt: v,
|
|
10461
10461
|
toolNameMapping: ye,
|
|
10462
|
-
systemMessageMode: (R = I?.systemMessageMode) != null ? R : Te ? "developer" :
|
|
10463
|
-
providerOptionsName:
|
|
10462
|
+
systemMessageMode: (R = I?.systemMessageMode) != null ? R : Te ? "developer" : F.systemMessageMode,
|
|
10463
|
+
providerOptionsName: K,
|
|
10464
10464
|
fileIdPrefixes: this.config.fileIdPrefixes,
|
|
10465
10465
|
store: (M = I?.store) != null ? M : !0,
|
|
10466
10466
|
hasConversation: I?.conversation != null,
|
|
@@ -10470,7 +10470,7 @@ var Bx = class {
|
|
|
10470
10470
|
customProviderToolNames: ne.size > 0 ? ne : void 0
|
|
10471
10471
|
});
|
|
10472
10472
|
z.push(...te);
|
|
10473
|
-
const
|
|
10473
|
+
const J = (P = I?.strictJsonSchema) != null ? P : !0;
|
|
10474
10474
|
let pe = I?.include;
|
|
10475
10475
|
function de(ze) {
|
|
10476
10476
|
pe == null ? pe = [ze] : pe.includes(ze) || (pe = [...pe, ze]);
|
|
@@ -10497,7 +10497,7 @@ var Bx = class {
|
|
|
10497
10497
|
...D?.type === "json" && {
|
|
10498
10498
|
format: D.schema != null ? {
|
|
10499
10499
|
type: "json_schema",
|
|
10500
|
-
strict:
|
|
10500
|
+
strict: J,
|
|
10501
10501
|
name: (Z = D.name) != null ? Z : "response",
|
|
10502
10502
|
description: D.description,
|
|
10503
10503
|
schema: D.schema
|
|
@@ -10536,7 +10536,7 @@ var Bx = class {
|
|
|
10536
10536
|
}
|
|
10537
10537
|
}
|
|
10538
10538
|
};
|
|
10539
|
-
Te ? I?.reasoningEffort === "none" &&
|
|
10539
|
+
Te ? I?.reasoningEffort === "none" && F.supportsNonReasoningParameters || (Dt.temperature != null && (Dt.temperature = void 0, z.push({
|
|
10540
10540
|
type: "unsupported",
|
|
10541
10541
|
feature: "temperature",
|
|
10542
10542
|
details: "temperature is not supported for reasoning models"
|
|
@@ -10552,18 +10552,18 @@ var Bx = class {
|
|
|
10552
10552
|
type: "unsupported",
|
|
10553
10553
|
feature: "reasoningSummary",
|
|
10554
10554
|
details: "reasoningSummary is not supported for non-reasoning models"
|
|
10555
|
-
})), I?.serviceTier === "flex" && !
|
|
10555
|
+
})), I?.serviceTier === "flex" && !F.supportsFlexProcessing && (z.push({
|
|
10556
10556
|
type: "unsupported",
|
|
10557
10557
|
feature: "serviceTier",
|
|
10558
10558
|
details: "flex processing is only available for o3, o4-mini, and gpt-5 models"
|
|
10559
|
-
}), delete Dt.service_tier), I?.serviceTier === "priority" && !
|
|
10559
|
+
}), delete Dt.service_tier), I?.serviceTier === "priority" && !F.supportsPriorityProcessing && (z.push({
|
|
10560
10560
|
type: "unsupported",
|
|
10561
10561
|
feature: "serviceTier",
|
|
10562
10562
|
details: "priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"
|
|
10563
10563
|
}), delete Dt.service_tier);
|
|
10564
|
-
const Ce = (Y = (
|
|
10564
|
+
const Ce = (Y = (Q = (U = A?.find(
|
|
10565
10565
|
(ze) => ze.type === "provider" && ze.id === "openai.shell"
|
|
10566
|
-
)) == null ? void 0 :
|
|
10566
|
+
)) == null ? void 0 : U.args) == null ? void 0 : Q.environment) == null ? void 0 : Y.type, pn = Ce === "containerAuto" || Ce === "containerReference";
|
|
10567
10567
|
return {
|
|
10568
10568
|
webSearchToolName: It,
|
|
10569
10569
|
args: {
|
|
@@ -10574,19 +10574,19 @@ var Bx = class {
|
|
|
10574
10574
|
warnings: [...z, ...$],
|
|
10575
10575
|
store: Ae,
|
|
10576
10576
|
toolNameMapping: ye,
|
|
10577
|
-
providerOptionsName:
|
|
10577
|
+
providerOptionsName: K,
|
|
10578
10578
|
isShellProviderExecuted: pn
|
|
10579
10579
|
};
|
|
10580
10580
|
}
|
|
10581
10581
|
async doGenerate(t) {
|
|
10582
|
-
var r, o, c, u, f, g, m, v, x, A, _, D, N, R, M, P, j, Z,
|
|
10582
|
+
var r, o, c, u, f, g, m, v, x, A, _, D, N, R, M, P, j, Z, U, Q, Y, z, F, K, I, Te, ye, ne;
|
|
10583
10583
|
const {
|
|
10584
10584
|
args: me,
|
|
10585
10585
|
warnings: Me,
|
|
10586
10586
|
webSearchToolName: $,
|
|
10587
10587
|
toolNameMapping: ge,
|
|
10588
10588
|
providerOptionsName: te,
|
|
10589
|
-
isShellProviderExecuted:
|
|
10589
|
+
isShellProviderExecuted: J
|
|
10590
10590
|
} = await this.getArgs(t), pe = this.config.url({
|
|
10591
10591
|
path: "/responses",
|
|
10592
10592
|
modelId: this.modelId
|
|
@@ -10714,7 +10714,7 @@ var Bx = class {
|
|
|
10714
10714
|
commands: ue.action.commands
|
|
10715
10715
|
}
|
|
10716
10716
|
}),
|
|
10717
|
-
...
|
|
10717
|
+
...J && { providerExecuted: !0 },
|
|
10718
10718
|
providerMetadata: {
|
|
10719
10719
|
[te]: {
|
|
10720
10720
|
itemId: ue.id
|
|
@@ -10861,7 +10861,7 @@ var Bx = class {
|
|
|
10861
10861
|
break;
|
|
10862
10862
|
}
|
|
10863
10863
|
case "mcp_call": {
|
|
10864
|
-
const Oe = ue.approval_request_id != null && (
|
|
10864
|
+
const Oe = ue.approval_request_id != null && (U = de[ue.approval_request_id]) != null ? U : ue.id, bt = `mcp.${ue.name}`;
|
|
10865
10865
|
Ae.push({
|
|
10866
10866
|
type: "tool-call",
|
|
10867
10867
|
toolCallId: Oe,
|
|
@@ -10892,7 +10892,7 @@ var Bx = class {
|
|
|
10892
10892
|
case "mcp_list_tools":
|
|
10893
10893
|
break;
|
|
10894
10894
|
case "mcp_approval_request": {
|
|
10895
|
-
const Oe = (
|
|
10895
|
+
const Oe = (Q = ue.approval_request_id) != null ? Q : ue.id, bt = (F = (z = (Y = this.config).generateId) == null ? void 0 : z.call(Y)) != null ? F : on(), be = `mcp.${ue.name}`;
|
|
10896
10896
|
Ae.push({
|
|
10897
10897
|
type: "tool-call",
|
|
10898
10898
|
toolCallId: bt,
|
|
@@ -10938,7 +10938,7 @@ var Bx = class {
|
|
|
10938
10938
|
toolName: ge.toCustomToolName("file_search"),
|
|
10939
10939
|
result: {
|
|
10940
10940
|
queries: ue.queries,
|
|
10941
|
-
results: (I = (
|
|
10941
|
+
results: (I = (K = ue.results) == null ? void 0 : K.map((Oe) => ({
|
|
10942
10942
|
attributes: Oe.attributes,
|
|
10943
10943
|
fileId: Oe.file_id,
|
|
10944
10944
|
filename: Oe.filename,
|
|
@@ -11049,23 +11049,23 @@ var Bx = class {
|
|
|
11049
11049
|
const M = [];
|
|
11050
11050
|
let P = null;
|
|
11051
11051
|
const j = {}, Z = [];
|
|
11052
|
-
let
|
|
11052
|
+
let U, Q = !1;
|
|
11053
11053
|
const Y = {};
|
|
11054
11054
|
let z;
|
|
11055
|
-
const
|
|
11055
|
+
const F = [];
|
|
11056
11056
|
return {
|
|
11057
11057
|
stream: x.pipeThrough(
|
|
11058
11058
|
new TransformStream({
|
|
11059
|
-
start(
|
|
11060
|
-
|
|
11059
|
+
start(K) {
|
|
11060
|
+
K.enqueue({ type: "stream-start", warnings: o });
|
|
11061
11061
|
},
|
|
11062
|
-
transform(
|
|
11063
|
-
var Te, ye, ne, me, Me, $, ge, te,
|
|
11064
|
-
if (t.includeRawChunks && I.enqueue({ type: "raw", rawValue:
|
|
11065
|
-
N = { unified: "error", raw: void 0 }, I.enqueue({ type: "error", error:
|
|
11062
|
+
transform(K, I) {
|
|
11063
|
+
var Te, ye, ne, me, Me, $, ge, te, J, pe, de, re, he, It, Ae, Dt, Ce, pn, ze, Yt, ue, Oe, bt, be, en, Kt, Bn, St, Ye, Ve, Ln, ve, Gn, er, an, tr, $t, hr;
|
|
11064
|
+
if (t.includeRawChunks && I.enqueue({ type: "raw", rawValue: K.rawValue }), !K.success) {
|
|
11065
|
+
N = { unified: "error", raw: void 0 }, I.enqueue({ type: "error", error: K.error });
|
|
11066
11066
|
return;
|
|
11067
11067
|
}
|
|
11068
|
-
const k =
|
|
11068
|
+
const k = K.value;
|
|
11069
11069
|
if (wl(k)) {
|
|
11070
11070
|
if (k.item.type === "function_call")
|
|
11071
11071
|
j[k.output_index] = {
|
|
@@ -11205,7 +11205,7 @@ var Bx = class {
|
|
|
11205
11205
|
} else k.item.type === "shell_call" ? j[k.output_index] = {
|
|
11206
11206
|
toolName: u.toCustomToolName("shell"),
|
|
11207
11207
|
toolCallId: k.item.call_id
|
|
11208
|
-
} : k.item.type === "shell_call_output" || (k.item.type === "message" ? (Z.splice(0, Z.length),
|
|
11208
|
+
} : k.item.type === "shell_call_output" || (k.item.type === "message" ? (Z.splice(0, Z.length), U = (ye = k.item.phase) != null ? ye : void 0, I.enqueue({
|
|
11209
11209
|
type: "text-start",
|
|
11210
11210
|
id: k.item.id,
|
|
11211
11211
|
providerMetadata: {
|
|
@@ -11232,8 +11232,8 @@ var Bx = class {
|
|
|
11232
11232
|
}
|
|
11233
11233
|
} else if (Fx(k)) {
|
|
11234
11234
|
if (k.item.type === "message") {
|
|
11235
|
-
const ie = (me = k.item.phase) != null ? me :
|
|
11236
|
-
|
|
11235
|
+
const ie = (me = k.item.phase) != null ? me : U;
|
|
11236
|
+
U = void 0, I.enqueue({
|
|
11237
11237
|
type: "text-end",
|
|
11238
11238
|
id: k.item.id,
|
|
11239
11239
|
providerMetadata: {
|
|
@@ -11247,7 +11247,7 @@ var Bx = class {
|
|
|
11247
11247
|
}
|
|
11248
11248
|
});
|
|
11249
11249
|
} else if (k.item.type === "function_call")
|
|
11250
|
-
j[k.output_index] = void 0,
|
|
11250
|
+
j[k.output_index] = void 0, Q = !0, I.enqueue({
|
|
11251
11251
|
type: "tool-input-end",
|
|
11252
11252
|
id: k.item.call_id
|
|
11253
11253
|
}), I.enqueue({
|
|
@@ -11262,7 +11262,7 @@ var Bx = class {
|
|
|
11262
11262
|
}
|
|
11263
11263
|
});
|
|
11264
11264
|
else if (k.item.type === "custom_tool_call") {
|
|
11265
|
-
j[k.output_index] = void 0,
|
|
11265
|
+
j[k.output_index] = void 0, Q = !0;
|
|
11266
11266
|
const ie = u.toCustomToolName(
|
|
11267
11267
|
k.item.name
|
|
11268
11268
|
);
|
|
@@ -11346,7 +11346,7 @@ var Bx = class {
|
|
|
11346
11346
|
const ie = j[k.output_index], Ke = k.item.execution === "server";
|
|
11347
11347
|
if (ie != null) {
|
|
11348
11348
|
const ht = Ke ? ie.toolCallId : (ge = k.item.call_id) != null ? ge : k.item.id;
|
|
11349
|
-
Ke ?
|
|
11349
|
+
Ke ? F.push(ht) : I.enqueue({
|
|
11350
11350
|
type: "tool-input-start",
|
|
11351
11351
|
id: ht,
|
|
11352
11352
|
toolName: ie.toolName
|
|
@@ -11371,7 +11371,7 @@ var Bx = class {
|
|
|
11371
11371
|
}
|
|
11372
11372
|
j[k.output_index] = void 0;
|
|
11373
11373
|
} else if (k.item.type === "tool_search_output") {
|
|
11374
|
-
const ie = (
|
|
11374
|
+
const ie = (J = (te = k.item.call_id) != null ? te : F.shift()) != null ? J : k.item.id;
|
|
11375
11375
|
I.enqueue({
|
|
11376
11376
|
type: "tool-result",
|
|
11377
11377
|
toolCallId: ie,
|
|
@@ -11673,7 +11673,7 @@ var Bx = class {
|
|
|
11673
11673
|
N = {
|
|
11674
11674
|
unified: Bo({
|
|
11675
11675
|
finishReason: (Oe = k.response.incomplete_details) == null ? void 0 : Oe.reason,
|
|
11676
|
-
hasFunctionCall:
|
|
11676
|
+
hasFunctionCall: Q
|
|
11677
11677
|
}),
|
|
11678
11678
|
raw: (be = (bt = k.response.incomplete_details) == null ? void 0 : bt.reason) != null ? be : void 0
|
|
11679
11679
|
}, R = k.response.usage, typeof k.response.service_tier == "string" && (z = k.response.service_tier);
|
|
@@ -11682,7 +11682,7 @@ var Bx = class {
|
|
|
11682
11682
|
N = {
|
|
11683
11683
|
unified: ie ? Bo({
|
|
11684
11684
|
finishReason: ie,
|
|
11685
|
-
hasFunctionCall:
|
|
11685
|
+
hasFunctionCall: Q
|
|
11686
11686
|
}) : "error",
|
|
11687
11687
|
raw: ie ?? "error"
|
|
11688
11688
|
}, R = (Kt = k.response.usage) != null ? Kt : void 0;
|
|
@@ -11736,7 +11736,7 @@ var Bx = class {
|
|
|
11736
11736
|
}
|
|
11737
11737
|
})) : Yx(k) && I.enqueue({ type: "error", error: k });
|
|
11738
11738
|
},
|
|
11739
|
-
flush(
|
|
11739
|
+
flush(K) {
|
|
11740
11740
|
const I = {
|
|
11741
11741
|
[g]: {
|
|
11742
11742
|
responseId: P,
|
|
@@ -11744,7 +11744,7 @@ var Bx = class {
|
|
|
11744
11744
|
...z !== void 0 ? { serviceTier: z } : {}
|
|
11745
11745
|
}
|
|
11746
11746
|
};
|
|
11747
|
-
|
|
11747
|
+
K.enqueue({
|
|
11748
11748
|
type: "finish",
|
|
11749
11749
|
finishReason: N,
|
|
11750
11750
|
usage: gl(R),
|
|
@@ -12122,7 +12122,7 @@ var Kx = Le(
|
|
|
12122
12122
|
}
|
|
12123
12123
|
};
|
|
12124
12124
|
}
|
|
12125
|
-
}, ny = "3.0.
|
|
12125
|
+
}, ny = "3.0.52";
|
|
12126
12126
|
function id(t = {}) {
|
|
12127
12127
|
var r, o;
|
|
12128
12128
|
const c = (r = b2(
|
|
@@ -12401,7 +12401,7 @@ class sy {
|
|
|
12401
12401
|
/** 返回全量的提示词 */
|
|
12402
12402
|
getSystemPrompt() {
|
|
12403
12403
|
return `
|
|
12404
|
-
当前时间:${(/* @__PURE__ */ new Date()).
|
|
12404
|
+
当前时间:${(/* @__PURE__ */ new Date()).toLocaleDateString()}。
|
|
12405
12405
|
${this.staticPrompt}
|
|
12406
12406
|
${this.skillMetaPrompt}
|
|
12407
12407
|
${this.tempPrompt}
|
|
@@ -12452,21 +12452,22 @@ class ly extends w1 {
|
|
|
12452
12452
|
/** 生成式UI启用状态 */
|
|
12453
12453
|
isGenuiEnabled;
|
|
12454
12454
|
debugStream = !1;
|
|
12455
|
-
|
|
12455
|
+
emit;
|
|
12456
|
+
constructor(r, o, c, u) {
|
|
12456
12457
|
super(r);
|
|
12457
|
-
let
|
|
12458
|
-
c && "llm" in c ?
|
|
12458
|
+
let f;
|
|
12459
|
+
c && "llm" in c ? f = {
|
|
12459
12460
|
...Lo,
|
|
12460
12461
|
...c
|
|
12461
|
-
} :
|
|
12462
|
+
} : f = {
|
|
12462
12463
|
...Lo,
|
|
12463
12464
|
...Cl,
|
|
12464
12465
|
...c || {}
|
|
12465
|
-
}, this.llmConfig =
|
|
12466
|
-
const
|
|
12467
|
-
llmConfig:
|
|
12466
|
+
}, this.llmConfig = f;
|
|
12467
|
+
const m = {
|
|
12468
|
+
llmConfig: f.llm ? { llm: f.llm } : { ...f }
|
|
12468
12469
|
};
|
|
12469
|
-
this.agent = new Ql(
|
|
12470
|
+
this.agent = new Ql(m), this.promptManager = new sy(), this.promptManager.setStatic(o), this.emit = u;
|
|
12470
12471
|
}
|
|
12471
12472
|
/**
|
|
12472
12473
|
* 更新大语言模型配置
|
|
@@ -12645,7 +12646,7 @@ class ly extends w1 {
|
|
|
12645
12646
|
}
|
|
12646
12647
|
},
|
|
12647
12648
|
onFinish: async () => {
|
|
12648
|
-
await this.agent.closeAll(), this.promptManager.setTemp("");
|
|
12649
|
+
await this.agent.closeAll(), this.promptManager.setTemp(""), this.emit?.("chat-stream-finish");
|
|
12649
12650
|
}
|
|
12650
12651
|
}, f = {
|
|
12651
12652
|
role: "user",
|
|
@@ -12716,7 +12717,7 @@ class ly extends w1 {
|
|
|
12716
12717
|
}
|
|
12717
12718
|
}
|
|
12718
12719
|
const cy = ({ systemPrompt: t, llmConfig: r, emit: o }) => {
|
|
12719
|
-
const c = new ly({ provider: "custom" }, t, r), u = new _1({
|
|
12720
|
+
const c = new ly({ provider: "custom" }, t, r, o), u = new _1({
|
|
12720
12721
|
providerImplementation: c,
|
|
12721
12722
|
provider: "custom"
|
|
12722
12723
|
}), {
|
|
@@ -12734,19 +12735,19 @@ const cy = ({ systemPrompt: t, llmConfig: r, emit: o }) => {
|
|
|
12734
12735
|
events: {
|
|
12735
12736
|
onLoaded() {
|
|
12736
12737
|
},
|
|
12737
|
-
onReceiveData(Y, z,
|
|
12738
|
-
|
|
12738
|
+
onReceiveData(Y, z, F) {
|
|
12739
|
+
F(), z.value[z.value.length - 1].role === "assistant" && z.value.pop(), o("before-ai-render", Y), z.value.push(Y);
|
|
12739
12740
|
}
|
|
12740
12741
|
}
|
|
12741
|
-
}), { messageState: D, inputMessage: N, sendMessage: R, abortRequest: M, messages: P, addMessage: j, send: Z } = f,
|
|
12742
|
-
if (
|
|
12743
|
-
const { shouldBlock: I } = await
|
|
12742
|
+
}), { messageState: D, inputMessage: N, sendMessage: R, abortRequest: M, messages: P, addMessage: j, send: Z } = f, U = Xe(), Q = async (Y, z, F) => {
|
|
12743
|
+
if (F) {
|
|
12744
|
+
const { shouldBlock: I } = await F(Y);
|
|
12744
12745
|
if (I)
|
|
12745
12746
|
return !1;
|
|
12746
12747
|
}
|
|
12747
12748
|
N.value = Y;
|
|
12748
|
-
const
|
|
12749
|
-
if (
|
|
12749
|
+
const K = m();
|
|
12750
|
+
if (K && K.title === "新会话" && A(K.id, N.value.slice(0, 15)), z && z.length > 0) {
|
|
12750
12751
|
const I = [{ type: "text", text: N.value }, ...z], Te = [];
|
|
12751
12752
|
N.value && Te.push({
|
|
12752
12753
|
type: "text",
|
|
@@ -12786,7 +12787,7 @@ const cy = ({ systemPrompt: t, llmConfig: r, emit: o }) => {
|
|
|
12786
12787
|
return !0;
|
|
12787
12788
|
};
|
|
12788
12789
|
return Vr(() => {
|
|
12789
|
-
|
|
12790
|
+
U.value?.focus();
|
|
12790
12791
|
}), yi(() => {
|
|
12791
12792
|
c.agent.closeAll();
|
|
12792
12793
|
}), {
|
|
@@ -12804,8 +12805,8 @@ const cy = ({ systemPrompt: t, llmConfig: r, emit: o }) => {
|
|
|
12804
12805
|
inputMessage: N,
|
|
12805
12806
|
sendMessage: R,
|
|
12806
12807
|
abortRequest: M,
|
|
12807
|
-
senderRef:
|
|
12808
|
-
handleSendMessage:
|
|
12808
|
+
senderRef: U,
|
|
12809
|
+
handleSendMessage: Q,
|
|
12809
12810
|
// 基础会话方法(供 useConversationHistory 使用)
|
|
12810
12811
|
createConversation: g,
|
|
12811
12812
|
switchConversation: v,
|
|
@@ -13477,8 +13478,8 @@ var fw = sn({
|
|
|
13477
13478
|
zIndex: g.value
|
|
13478
13479
|
};
|
|
13479
13480
|
if (dr(t.duration)) {
|
|
13480
|
-
const
|
|
13481
|
-
z[
|
|
13481
|
+
const F = t.position === "center" ? "animationDuration" : "transitionDuration";
|
|
13482
|
+
z[F] = `${t.duration}s`;
|
|
13482
13483
|
}
|
|
13483
13484
|
return z;
|
|
13484
13485
|
}), A = () => {
|
|
@@ -13526,50 +13527,50 @@ var fw = sn({
|
|
|
13526
13527
|
P && clearTimeout(P), P = setTimeout(() => {
|
|
13527
13528
|
r("opened");
|
|
13528
13529
|
});
|
|
13529
|
-
}, Z = () => r("closed"),
|
|
13530
|
+
}, Z = () => r("closed"), U = (z) => r("keydown", z), Q = v(() => {
|
|
13530
13531
|
var z;
|
|
13531
13532
|
const {
|
|
13532
|
-
destroyOnClose:
|
|
13533
|
-
round:
|
|
13533
|
+
destroyOnClose: F,
|
|
13534
|
+
round: K,
|
|
13534
13535
|
position: I,
|
|
13535
13536
|
safeAreaInsetTop: Te,
|
|
13536
13537
|
safeAreaInsetBottom: ye,
|
|
13537
13538
|
show: ne
|
|
13538
13539
|
} = t;
|
|
13539
|
-
if (!(!ne &&
|
|
13540
|
+
if (!(!ne && F))
|
|
13540
13541
|
return us(Pe("div", $r({
|
|
13541
13542
|
ref: m,
|
|
13542
13543
|
style: x.value,
|
|
13543
13544
|
role: "dialog",
|
|
13544
13545
|
tabindex: 0,
|
|
13545
13546
|
class: [kl({
|
|
13546
|
-
round:
|
|
13547
|
+
round: K,
|
|
13547
13548
|
[I]: I
|
|
13548
13549
|
}), {
|
|
13549
13550
|
"van-safe-area-top": Te,
|
|
13550
13551
|
"van-safe-area-bottom": ye
|
|
13551
13552
|
}],
|
|
13552
|
-
onKeydown:
|
|
13553
|
+
onKeydown: U
|
|
13553
13554
|
}, o, Ol()), [(z = c.default) == null ? void 0 : z.call(c), M()]), [[ds, ne]]);
|
|
13554
13555
|
}), Y = () => {
|
|
13555
13556
|
const {
|
|
13556
13557
|
position: z,
|
|
13557
|
-
transition:
|
|
13558
|
-
transitionAppear:
|
|
13558
|
+
transition: F,
|
|
13559
|
+
transitionAppear: K
|
|
13559
13560
|
} = t, I = z === "center" ? "van-fade" : `van-popup-slide-${z}`;
|
|
13560
13561
|
return Pe(to, {
|
|
13561
|
-
name:
|
|
13562
|
-
appear:
|
|
13562
|
+
name: F || I,
|
|
13563
|
+
appear: K,
|
|
13563
13564
|
onAfterEnter: j,
|
|
13564
13565
|
onAfterLeave: Z
|
|
13565
13566
|
}, {
|
|
13566
|
-
default:
|
|
13567
|
+
default: Q
|
|
13567
13568
|
});
|
|
13568
13569
|
};
|
|
13569
13570
|
return Rt(() => t.show, (z) => {
|
|
13570
13571
|
z && !u && (A(), o.tabindex === 0 && xi(() => {
|
|
13571
|
-
var
|
|
13572
|
-
(
|
|
13572
|
+
var F;
|
|
13573
|
+
(F = m.value) == null || F.focus();
|
|
13573
13574
|
})), !z && u && (u = !1, r("close"));
|
|
13574
13575
|
}), dd({
|
|
13575
13576
|
popupRef: m
|
|
@@ -13854,12 +13855,12 @@ const Iw = (t) => (r) => et(jn({
|
|
|
13854
13855
|
et("添加工具失败:JSON 配置格式不正确或未找到有效的服务器配置");
|
|
13855
13856
|
return;
|
|
13856
13857
|
}
|
|
13857
|
-
let
|
|
13858
|
+
let U = 0, Q = 0;
|
|
13858
13859
|
for (const { name: Y, config: z } of Z) {
|
|
13859
|
-
const
|
|
13860
|
-
await c(
|
|
13860
|
+
const F = `mcp-server-${Y}`;
|
|
13861
|
+
await c(F, z, Y) ? U++ : Q++;
|
|
13861
13862
|
}
|
|
13862
|
-
await t.closeAll(),
|
|
13863
|
+
await t.closeAll(), Q === 0 ? et(`成功添加 ${U} 个工具`) : U > 0 ? et(`成功添加 ${U} 个工具,${Q} 个失败`) : et("添加工具失败:所有服务器都无法连接");
|
|
13863
13864
|
return;
|
|
13864
13865
|
}
|
|
13865
13866
|
if (typeof g == "string") {
|
|
@@ -13901,22 +13902,22 @@ const Iw = (t) => (r) => et(jn({
|
|
|
13901
13902
|
};
|
|
13902
13903
|
function Ow(t, r, o) {
|
|
13903
13904
|
const c = Xe([]), u = Xe([]), f = Xe(!1), g = (Y) => t.mcpServers[Y]?.type === "local", m = (Y, z) => {
|
|
13904
|
-
z ? t.ignoreToolnames = t.ignoreToolnames.filter((
|
|
13905
|
+
z ? t.ignoreToolnames = t.ignoreToolnames.filter((F) => F !== Y) : t.ignoreToolnames.includes(Y) || t.ignoreToolnames.push(Y);
|
|
13905
13906
|
}, v = (Y, z) => {
|
|
13906
13907
|
r.value || (r.value = {});
|
|
13907
|
-
const
|
|
13908
|
-
Y === null ? Object.keys(
|
|
13909
|
-
|
|
13910
|
-
}) :
|
|
13908
|
+
const F = { ...r.value };
|
|
13909
|
+
Y === null ? Object.keys(F).forEach((K) => {
|
|
13910
|
+
F[K] = z;
|
|
13911
|
+
}) : F[Y] = z, r.value = F;
|
|
13911
13912
|
}, x = (Y) => {
|
|
13912
|
-
const z = u.value.find((
|
|
13913
|
+
const z = u.value.find((F) => F.id === Y);
|
|
13913
13914
|
z && (z.addState = "idle");
|
|
13914
13915
|
}, A = (Y) => {
|
|
13915
13916
|
const z = t.mcpTools[Y];
|
|
13916
13917
|
if (!z) return [];
|
|
13917
|
-
const
|
|
13918
|
+
const F = g(Y), K = r.value || {};
|
|
13918
13919
|
return Object.keys(z).map((I) => {
|
|
13919
|
-
const Te = Object.prototype.hasOwnProperty.call(
|
|
13920
|
+
const Te = Object.prototype.hasOwnProperty.call(K, I), ye = F && Te ? K[I] : !0;
|
|
13920
13921
|
return m(I, ye), {
|
|
13921
13922
|
id: I,
|
|
13922
13923
|
name: I,
|
|
@@ -13926,13 +13927,13 @@ function Ow(t, r, o) {
|
|
|
13926
13927
|
});
|
|
13927
13928
|
}, _ = () => {
|
|
13928
13929
|
c.value.forEach((z) => {
|
|
13929
|
-
const
|
|
13930
|
-
const Te =
|
|
13930
|
+
const F = new Map(z.tools.map((I) => [I.id, I.enabled])), K = A(z.id).map((I) => {
|
|
13931
|
+
const Te = F.has(I.id) ? !!F.get(I.id) : I.enabled;
|
|
13931
13932
|
return m(I.id, Te), { ...I, enabled: Te };
|
|
13932
13933
|
});
|
|
13933
|
-
z.tools =
|
|
13934
|
+
z.tools = K;
|
|
13934
13935
|
});
|
|
13935
|
-
const Y = new Set(c.value.flatMap((z) => z.tools.map((
|
|
13936
|
+
const Y = new Set(c.value.flatMap((z) => z.tools.map((F) => F.id)));
|
|
13936
13937
|
t.ignoreToolnames = t.ignoreToolnames.filter((z) => Y.has(z));
|
|
13937
13938
|
}, D = async (Y) => {
|
|
13938
13939
|
const z = Y.pluginId;
|
|
@@ -13966,40 +13967,45 @@ function Ow(t, r, o) {
|
|
|
13966
13967
|
pluginVisible: f,
|
|
13967
13968
|
// 核心方法
|
|
13968
13969
|
loadMcpServerToPlugin: async (Y, z) => {
|
|
13969
|
-
let
|
|
13970
|
-
if (
|
|
13971
|
-
|
|
13972
|
-
|
|
13973
|
-
|
|
13974
|
-
|
|
13975
|
-
|
|
13976
|
-
|
|
13970
|
+
let F = z.name, K = z.description;
|
|
13971
|
+
if (!F || !K) {
|
|
13972
|
+
if ("type" in z && z.type === "local")
|
|
13973
|
+
F = F || "本地工具", K = K || "本地工具列表";
|
|
13974
|
+
else if ("type" in z && z.type === "builtin")
|
|
13975
|
+
F = F || "浏览器内置工具", K = K || "通过 navigator.modelContextTesting 暴露的浏览器原生 MCP 工具";
|
|
13976
|
+
else if ("url" in z)
|
|
13977
|
+
try {
|
|
13978
|
+
const I = new URL(z.url);
|
|
13979
|
+
F = F || I.origin, K = K || I.searchParams.get("sessionId") || ("sessionId" in z ? z.sessionId : "") || "";
|
|
13980
|
+
} catch (I) {
|
|
13981
|
+
console.error("[usePlugin] Failed to parse MCP server URL:", z.url, I), F = F || "未知插件", K = K || "";
|
|
13982
|
+
}
|
|
13977
13983
|
}
|
|
13978
13984
|
await D({
|
|
13979
13985
|
pluginId: Y,
|
|
13980
|
-
name:
|
|
13981
|
-
description:
|
|
13986
|
+
name: F || "",
|
|
13987
|
+
description: K || "",
|
|
13982
13988
|
mcpServer: z
|
|
13983
13989
|
});
|
|
13984
13990
|
},
|
|
13985
13991
|
togglePlugin: (Y, z) => {
|
|
13986
|
-
const
|
|
13987
|
-
Y.tools.forEach((
|
|
13988
|
-
|
|
13992
|
+
const F = g(Y.id);
|
|
13993
|
+
Y.tools.forEach((K) => {
|
|
13994
|
+
K.enabled = z, m(K.id, z), F && v(K.id, z);
|
|
13989
13995
|
});
|
|
13990
13996
|
},
|
|
13991
|
-
toggleTool: (Y, z,
|
|
13992
|
-
const
|
|
13997
|
+
toggleTool: (Y, z, F) => {
|
|
13998
|
+
const K = g(Y.id);
|
|
13993
13999
|
Y.tools.forEach((I) => {
|
|
13994
|
-
I.id === z && (I.enabled =
|
|
13995
|
-
}), m(z,
|
|
14000
|
+
I.id === z && (I.enabled = F);
|
|
14001
|
+
}), m(z, F), K && v(z, F);
|
|
13996
14002
|
},
|
|
13997
14003
|
deletePlugin: async (Y) => {
|
|
13998
|
-
const z = c.value.find((
|
|
14004
|
+
const z = c.value.find((K) => K.id === Y.id);
|
|
13999
14005
|
if (!z) return;
|
|
14000
|
-
c.value = c.value.filter((
|
|
14001
|
-
const
|
|
14002
|
-
await t.removeMcpServer(
|
|
14006
|
+
c.value = c.value.filter((K) => K.id !== z.id), x(z.id);
|
|
14007
|
+
const F = Y.id;
|
|
14008
|
+
await t.removeMcpServer(F);
|
|
14003
14009
|
},
|
|
14004
14010
|
addPluginCore: D,
|
|
14005
14011
|
// 添加插件的核心方法
|
|
@@ -14010,32 +14016,38 @@ function Ow(t, r, o) {
|
|
|
14010
14016
|
url: Y.url,
|
|
14011
14017
|
headers: Y.headers,
|
|
14012
14018
|
useAISdkClient: !0
|
|
14013
|
-
},
|
|
14019
|
+
}, F = await D({
|
|
14014
14020
|
pluginId: Y.id,
|
|
14015
14021
|
name: Y.name,
|
|
14016
14022
|
description: Y.description || "",
|
|
14017
14023
|
icon: Y.icon,
|
|
14018
14024
|
mcpServer: z
|
|
14019
14025
|
});
|
|
14020
|
-
Y.addState =
|
|
14026
|
+
Y.addState = F ? "added" : "idle";
|
|
14021
14027
|
},
|
|
14022
14028
|
// 从市场添加插件(明确的方法名)
|
|
14023
14029
|
addPluginFromScan: async (Y, z) => {
|
|
14024
|
-
const
|
|
14030
|
+
const F = {
|
|
14025
14031
|
type: "streamableHttp",
|
|
14026
14032
|
url: `${z}mcp?sessionId=${Y}`
|
|
14027
|
-
}
|
|
14033
|
+
};
|
|
14034
|
+
let K = "未知插件";
|
|
14035
|
+
try {
|
|
14036
|
+
K = new URL(`${z}mcp?sessionId=${Y}`).origin;
|
|
14037
|
+
} catch (I) {
|
|
14038
|
+
console.error("[usePlugin] Failed to parse scan URL:", I);
|
|
14039
|
+
}
|
|
14028
14040
|
return await D({
|
|
14029
14041
|
pluginId: `plugin-${Y}`,
|
|
14030
|
-
name:
|
|
14042
|
+
name: K,
|
|
14031
14043
|
description: Y,
|
|
14032
|
-
mcpServer:
|
|
14044
|
+
mcpServer: F
|
|
14033
14045
|
});
|
|
14034
14046
|
},
|
|
14035
14047
|
// 从扫码添加插件(新增)
|
|
14036
14048
|
handleClientDisconnected: async (Y) => {
|
|
14037
|
-
const z = Y,
|
|
14038
|
-
return await t.removeMcpServer(Y),
|
|
14049
|
+
const z = Y, F = c.value.find((K) => K.id === z);
|
|
14050
|
+
return await t.removeMcpServer(Y), F ? (c.value = c.value.filter((K) => K.id !== z), x(z), F) : null;
|
|
14039
14051
|
},
|
|
14040
14052
|
searchPlugin: (Y, z) => Y.trim() === "" || z.name.toLowerCase().includes(Y.toLowerCase()),
|
|
14041
14053
|
syncInstalledPluginTools: _
|
|
@@ -14080,9 +14092,9 @@ function kw(t) {
|
|
|
14080
14092
|
});
|
|
14081
14093
|
}
|
|
14082
14094
|
function Rw(t) {
|
|
14083
|
-
const { skillsRef: r, customAgentProvider: o } = t, c = dt(() => {
|
|
14095
|
+
const { skillsRef: r, customAgentProvider: o } = t, c = dt(async () => {
|
|
14084
14096
|
const m = r?.value;
|
|
14085
|
-
return m ? R1(m) : [];
|
|
14097
|
+
return m ? await R1(m) : [];
|
|
14086
14098
|
}), u = dt(() => {
|
|
14087
14099
|
const m = c.value;
|
|
14088
14100
|
return m.length > 0 ? M1(m) : "";
|
|
@@ -14205,7 +14217,7 @@ function Fw(t) {
|
|
|
14205
14217
|
}
|
|
14206
14218
|
const M = r.value[R];
|
|
14207
14219
|
if (r.value = r.value.slice(0, R), Array.isArray(M.content)) {
|
|
14208
|
-
const j = M.content.find((
|
|
14220
|
+
const j = M.content.find((U) => U.type === "text")?.text || "", Z = M.content.filter((U) => U.type !== "text");
|
|
14209
14221
|
c.value = j, await u(j, Z.length > 0 ? Z : void 0);
|
|
14210
14222
|
} else
|
|
14211
14223
|
c.value = M.content, await u(M.content);
|
|
@@ -14354,28 +14366,28 @@ function zw(t) {
|
|
|
14354
14366
|
let _ = null, D = !1;
|
|
14355
14367
|
const N = async (Z) => {
|
|
14356
14368
|
if (xd("添加工具中..."), Z) {
|
|
14357
|
-
const
|
|
14358
|
-
et(
|
|
14369
|
+
const U = await x(Z, o);
|
|
14370
|
+
et(U ? "添加工具完成" : "重复添加工具或添加失败");
|
|
14359
14371
|
} else
|
|
14360
14372
|
et("添加工具失败");
|
|
14361
14373
|
}, R = async (Z) => {
|
|
14362
14374
|
if (/^\/[A-Za-z0-9-]{6,}$/.test(Z)) {
|
|
14363
14375
|
try {
|
|
14364
|
-
const
|
|
14365
|
-
if (!
|
|
14366
|
-
throw new Error(`HTTP ${
|
|
14367
|
-
const Y = (await
|
|
14376
|
+
const U = await fetch(`${o}client?sessionId=${Z.slice(1)}`);
|
|
14377
|
+
if (!U.ok)
|
|
14378
|
+
throw new Error(`HTTP ${U.status}`);
|
|
14379
|
+
const Y = (await U.json())?.data?.sessionId;
|
|
14368
14380
|
Y ? await N(Y) : et("添加工具失败,请检查识别码是否正确"), A.value = "";
|
|
14369
|
-
} catch (
|
|
14370
|
-
console.error("识别码处理失败:",
|
|
14381
|
+
} catch (U) {
|
|
14382
|
+
console.error("识别码处理失败:", U), et("添加工具失败,请检查识别码是否正确"), A.value = "";
|
|
14371
14383
|
}
|
|
14372
14384
|
return !0;
|
|
14373
14385
|
}
|
|
14374
14386
|
return !1;
|
|
14375
14387
|
}, M = () => {
|
|
14376
|
-
const Z = (
|
|
14388
|
+
const Z = (U) => {
|
|
14377
14389
|
_ && (_.destroy(), _ = null), _ = P1({
|
|
14378
|
-
sessionId:
|
|
14390
|
+
sessionId: U || void 0,
|
|
14379
14391
|
qrCodeUrl: u,
|
|
14380
14392
|
remoteUrl: f,
|
|
14381
14393
|
menuItems: g?.value,
|
|
@@ -14385,10 +14397,10 @@ function zw(t) {
|
|
|
14385
14397
|
};
|
|
14386
14398
|
Rt(
|
|
14387
14399
|
r,
|
|
14388
|
-
(
|
|
14400
|
+
(U) => {
|
|
14389
14401
|
if (c !== "remoter") return;
|
|
14390
|
-
const
|
|
14391
|
-
_ ? !D &&
|
|
14402
|
+
const Q = !!U;
|
|
14403
|
+
_ ? !D && Q && (Z(U), D = !0) : (Z(U), D = Q);
|
|
14392
14404
|
},
|
|
14393
14405
|
{ immediate: !0 }
|
|
14394
14406
|
), g && Rt(
|
|
@@ -14399,8 +14411,8 @@ function zw(t) {
|
|
|
14399
14411
|
{ deep: !0 }
|
|
14400
14412
|
), Rt(
|
|
14401
14413
|
v,
|
|
14402
|
-
(
|
|
14403
|
-
_ && (
|
|
14414
|
+
(U) => {
|
|
14415
|
+
_ && (U ? _.hide() : _.show());
|
|
14404
14416
|
},
|
|
14405
14417
|
{ immediate: !0 }
|
|
14406
14418
|
);
|
|
@@ -14500,7 +14512,7 @@ function jw(t) {
|
|
|
14500
14512
|
if (g.value.length > 0 && r.value) {
|
|
14501
14513
|
const N = r.value.multimodal?.maxFileSize || 10, R = r.value.multimodal?.supportedMimeTypes || ["image/"];
|
|
14502
14514
|
g.value.filter((P) => {
|
|
14503
|
-
if (!P.rawFile || !R.some((
|
|
14515
|
+
if (!P.rawFile || !R.some((U) => P.rawFile.type.startsWith(U))) return !0;
|
|
14504
14516
|
const Z = N * 1024 * 1024;
|
|
14505
14517
|
return P.rawFile.size > Z;
|
|
14506
14518
|
}).length > 0 && (v(), et("切换模型后,之前选择的附件已清空"));
|
|
@@ -14993,7 +15005,7 @@ function Qw() {
|
|
|
14993
15005
|
return e - n;
|
|
14994
15006
|
}
|
|
14995
15007
|
}
|
|
14996
|
-
class
|
|
15008
|
+
class U {
|
|
14997
15009
|
static numberOfTrailingZeros(e) {
|
|
14998
15010
|
let n;
|
|
14999
15011
|
if (e === 0)
|
|
@@ -15031,11 +15043,11 @@ function Qw() {
|
|
|
15031
15043
|
return parseInt(e, n);
|
|
15032
15044
|
}
|
|
15033
15045
|
}
|
|
15034
|
-
|
|
15035
|
-
class
|
|
15046
|
+
U.MIN_VALUE_32_BITS = -2147483648, U.MAX_VALUE = Number.MAX_SAFE_INTEGER;
|
|
15047
|
+
class Q {
|
|
15036
15048
|
// For testing only
|
|
15037
15049
|
constructor(e, n) {
|
|
15038
|
-
e === void 0 ? (this.size = 0, this.bits = new Int32Array(1)) : (this.size = e, n == null ? this.bits =
|
|
15050
|
+
e === void 0 ? (this.size = 0, this.bits = new Int32Array(1)) : (this.size = e, n == null ? this.bits = Q.makeArray(e) : this.bits = n);
|
|
15039
15051
|
}
|
|
15040
15052
|
getSize() {
|
|
15041
15053
|
return this.size;
|
|
@@ -15045,7 +15057,7 @@ function Qw() {
|
|
|
15045
15057
|
}
|
|
15046
15058
|
ensureCapacity(e) {
|
|
15047
15059
|
if (e > this.bits.length * 32) {
|
|
15048
|
-
const n =
|
|
15060
|
+
const n = Q.makeArray(e);
|
|
15049
15061
|
M.arraycopy(this.bits, 0, n, 0, this.bits.length), this.bits = n;
|
|
15050
15062
|
}
|
|
15051
15063
|
}
|
|
@@ -15091,7 +15103,7 @@ function Qw() {
|
|
|
15091
15103
|
return n;
|
|
15092
15104
|
a = i[s];
|
|
15093
15105
|
}
|
|
15094
|
-
const d = s * 32 +
|
|
15106
|
+
const d = s * 32 + U.numberOfTrailingZeros(a);
|
|
15095
15107
|
return d > n ? n : d;
|
|
15096
15108
|
}
|
|
15097
15109
|
/**
|
|
@@ -15112,7 +15124,7 @@ function Qw() {
|
|
|
15112
15124
|
return n;
|
|
15113
15125
|
a = ~i[s];
|
|
15114
15126
|
}
|
|
15115
|
-
const d = s * 32 +
|
|
15127
|
+
const d = s * 32 + U.numberOfTrailingZeros(a);
|
|
15116
15128
|
return d > n ? n : d;
|
|
15117
15129
|
}
|
|
15118
15130
|
/**
|
|
@@ -15256,7 +15268,7 @@ function Qw() {
|
|
|
15256
15268
|
}
|
|
15257
15269
|
/*@Override*/
|
|
15258
15270
|
equals(e) {
|
|
15259
|
-
if (!(e instanceof
|
|
15271
|
+
if (!(e instanceof Q))
|
|
15260
15272
|
return !1;
|
|
15261
15273
|
const n = e;
|
|
15262
15274
|
return this.size === n.size && Z.equals(this.bits, n.bits);
|
|
@@ -15274,7 +15286,7 @@ function Qw() {
|
|
|
15274
15286
|
}
|
|
15275
15287
|
/*@Override*/
|
|
15276
15288
|
clone() {
|
|
15277
|
-
return new
|
|
15289
|
+
return new Q(this.size, this.bits.slice());
|
|
15278
15290
|
}
|
|
15279
15291
|
}
|
|
15280
15292
|
var Y;
|
|
@@ -15282,16 +15294,16 @@ function Qw() {
|
|
|
15282
15294
|
C[C.OTHER = 0] = "OTHER", C[C.PURE_BARCODE = 1] = "PURE_BARCODE", C[C.POSSIBLE_FORMATS = 2] = "POSSIBLE_FORMATS", C[C.TRY_HARDER = 3] = "TRY_HARDER", C[C.CHARACTER_SET = 4] = "CHARACTER_SET", C[C.ALLOWED_LENGTHS = 5] = "ALLOWED_LENGTHS", C[C.ASSUME_CODE_39_CHECK_DIGIT = 6] = "ASSUME_CODE_39_CHECK_DIGIT", C[C.ASSUME_GS1 = 7] = "ASSUME_GS1", C[C.RETURN_CODABAR_START_END = 8] = "RETURN_CODABAR_START_END", C[C.NEED_RESULT_POINT_CALLBACK = 9] = "NEED_RESULT_POINT_CALLBACK", C[C.ALLOWED_EAN_EXTENSIONS = 10] = "ALLOWED_EAN_EXTENSIONS";
|
|
15283
15295
|
})(Y || (Y = {}));
|
|
15284
15296
|
var z = Y;
|
|
15285
|
-
class
|
|
15297
|
+
class F extends x {
|
|
15286
15298
|
static getFormatInstance() {
|
|
15287
|
-
return new
|
|
15299
|
+
return new F();
|
|
15288
15300
|
}
|
|
15289
15301
|
}
|
|
15290
|
-
|
|
15291
|
-
var
|
|
15302
|
+
F.kind = "FormatException";
|
|
15303
|
+
var K;
|
|
15292
15304
|
(function(C) {
|
|
15293
15305
|
C[C.Cp437 = 0] = "Cp437", C[C.ISO8859_1 = 1] = "ISO8859_1", C[C.ISO8859_2 = 2] = "ISO8859_2", C[C.ISO8859_3 = 3] = "ISO8859_3", C[C.ISO8859_4 = 4] = "ISO8859_4", C[C.ISO8859_5 = 5] = "ISO8859_5", C[C.ISO8859_6 = 6] = "ISO8859_6", C[C.ISO8859_7 = 7] = "ISO8859_7", C[C.ISO8859_8 = 8] = "ISO8859_8", C[C.ISO8859_9 = 9] = "ISO8859_9", C[C.ISO8859_10 = 10] = "ISO8859_10", C[C.ISO8859_11 = 11] = "ISO8859_11", C[C.ISO8859_13 = 12] = "ISO8859_13", C[C.ISO8859_14 = 13] = "ISO8859_14", C[C.ISO8859_15 = 14] = "ISO8859_15", C[C.ISO8859_16 = 15] = "ISO8859_16", C[C.SJIS = 16] = "SJIS", C[C.Cp1250 = 17] = "Cp1250", C[C.Cp1251 = 18] = "Cp1251", C[C.Cp1252 = 19] = "Cp1252", C[C.Cp1256 = 20] = "Cp1256", C[C.UnicodeBigUnmarked = 21] = "UnicodeBigUnmarked", C[C.UTF8 = 22] = "UTF8", C[C.ASCII = 23] = "ASCII", C[C.Big5 = 24] = "Big5", C[C.GB18030 = 25] = "GB18030", C[C.EUC_KR = 26] = "EUC_KR";
|
|
15294
|
-
})(
|
|
15306
|
+
})(K || (K = {}));
|
|
15295
15307
|
class I {
|
|
15296
15308
|
constructor(e, n, i, ...s) {
|
|
15297
15309
|
this.valueIdentifier = e, this.name = i, typeof n == "number" ? this.values = Int32Array.from([n]) : this.values = n, this.otherEncodingNames = s, I.VALUE_IDENTIFIER_TO_ECI.set(e, this), I.NAME_TO_ECI.set(i, this);
|
|
@@ -15331,10 +15343,10 @@ function Qw() {
|
|
|
15331
15343
|
*/
|
|
15332
15344
|
static getCharacterSetECIByValue(e) {
|
|
15333
15345
|
if (e < 0 || e >= 900)
|
|
15334
|
-
throw new
|
|
15346
|
+
throw new F("incorect value");
|
|
15335
15347
|
const n = I.VALUES_TO_ECI.get(e);
|
|
15336
15348
|
if (n === void 0)
|
|
15337
|
-
throw new
|
|
15349
|
+
throw new F("incorect value");
|
|
15338
15350
|
return n;
|
|
15339
15351
|
}
|
|
15340
15352
|
/**
|
|
@@ -15345,7 +15357,7 @@ function Qw() {
|
|
|
15345
15357
|
static getCharacterSetECIByName(e) {
|
|
15346
15358
|
const n = I.NAME_TO_ECI.get(e);
|
|
15347
15359
|
if (n === void 0)
|
|
15348
|
-
throw new
|
|
15360
|
+
throw new F("incorect value");
|
|
15349
15361
|
return n;
|
|
15350
15362
|
}
|
|
15351
15363
|
equals(e) {
|
|
@@ -15355,7 +15367,7 @@ function Qw() {
|
|
|
15355
15367
|
return this.getName() === n.getName();
|
|
15356
15368
|
}
|
|
15357
15369
|
}
|
|
15358
|
-
I.VALUE_IDENTIFIER_TO_ECI = /* @__PURE__ */ new Map(), I.VALUES_TO_ECI = /* @__PURE__ */ new Map(), I.NAME_TO_ECI = /* @__PURE__ */ new Map(), I.Cp437 = new I(
|
|
15370
|
+
I.VALUE_IDENTIFIER_TO_ECI = /* @__PURE__ */ new Map(), I.VALUES_TO_ECI = /* @__PURE__ */ new Map(), I.NAME_TO_ECI = /* @__PURE__ */ new Map(), I.Cp437 = new I(K.Cp437, Int32Array.from([0, 2]), "Cp437"), I.ISO8859_1 = new I(K.ISO8859_1, Int32Array.from([1, 3]), "ISO-8859-1", "ISO88591", "ISO8859_1"), I.ISO8859_2 = new I(K.ISO8859_2, 4, "ISO-8859-2", "ISO88592", "ISO8859_2"), I.ISO8859_3 = new I(K.ISO8859_3, 5, "ISO-8859-3", "ISO88593", "ISO8859_3"), I.ISO8859_4 = new I(K.ISO8859_4, 6, "ISO-8859-4", "ISO88594", "ISO8859_4"), I.ISO8859_5 = new I(K.ISO8859_5, 7, "ISO-8859-5", "ISO88595", "ISO8859_5"), I.ISO8859_6 = new I(K.ISO8859_6, 8, "ISO-8859-6", "ISO88596", "ISO8859_6"), I.ISO8859_7 = new I(K.ISO8859_7, 9, "ISO-8859-7", "ISO88597", "ISO8859_7"), I.ISO8859_8 = new I(K.ISO8859_8, 10, "ISO-8859-8", "ISO88598", "ISO8859_8"), I.ISO8859_9 = new I(K.ISO8859_9, 11, "ISO-8859-9", "ISO88599", "ISO8859_9"), I.ISO8859_10 = new I(K.ISO8859_10, 12, "ISO-8859-10", "ISO885910", "ISO8859_10"), I.ISO8859_11 = new I(K.ISO8859_11, 13, "ISO-8859-11", "ISO885911", "ISO8859_11"), I.ISO8859_13 = new I(K.ISO8859_13, 15, "ISO-8859-13", "ISO885913", "ISO8859_13"), I.ISO8859_14 = new I(K.ISO8859_14, 16, "ISO-8859-14", "ISO885914", "ISO8859_14"), I.ISO8859_15 = new I(K.ISO8859_15, 17, "ISO-8859-15", "ISO885915", "ISO8859_15"), I.ISO8859_16 = new I(K.ISO8859_16, 18, "ISO-8859-16", "ISO885916", "ISO8859_16"), I.SJIS = new I(K.SJIS, 20, "SJIS", "Shift_JIS"), I.Cp1250 = new I(K.Cp1250, 21, "Cp1250", "windows-1250"), I.Cp1251 = new I(K.Cp1251, 22, "Cp1251", "windows-1251"), I.Cp1252 = new I(K.Cp1252, 23, "Cp1252", "windows-1252"), I.Cp1256 = new I(K.Cp1256, 24, "Cp1256", "windows-1256"), I.UnicodeBigUnmarked = new I(K.UnicodeBigUnmarked, 25, "UnicodeBigUnmarked", "UTF-16BE", "UnicodeBig"), I.UTF8 = new I(K.UTF8, 26, "UTF8", "UTF-8"), I.ASCII = new I(K.ASCII, Int32Array.from([27, 170]), "ASCII", "US-ASCII"), I.Big5 = new I(K.Big5, 28, "Big5"), I.GB18030 = new I(K.GB18030, 29, "GB18030", "GB2312", "EUC_CN", "GBK"), I.EUC_KR = new I(K.EUC_KR, 30, "EUC_KR", "EUC-KR");
|
|
15359
15371
|
class Te extends x {
|
|
15360
15372
|
}
|
|
15361
15373
|
Te.kind = "UnsupportedOperationException";
|
|
@@ -15700,7 +15712,7 @@ function Qw() {
|
|
|
15700
15712
|
xor(e) {
|
|
15701
15713
|
if (this.width !== e.getWidth() || this.height !== e.getHeight() || this.rowSize !== e.getRowSize())
|
|
15702
15714
|
throw new _("input matrix dimensions do not match");
|
|
15703
|
-
const n = new
|
|
15715
|
+
const n = new Q(Math.floor(this.width / 32) + 1), i = this.rowSize, s = this.bits;
|
|
15704
15716
|
for (let a = 0, l = this.height; a < l; a++) {
|
|
15705
15717
|
const d = a * i, h = e.getRow(a, n).getBitArray();
|
|
15706
15718
|
for (let p = 0; p < i; p++)
|
|
@@ -15747,7 +15759,7 @@ function Qw() {
|
|
|
15747
15759
|
* your own row
|
|
15748
15760
|
*/
|
|
15749
15761
|
getRow(e, n) {
|
|
15750
|
-
n == null || n.getSize() < this.width ? n = new
|
|
15762
|
+
n == null || n.getSize() < this.width ? n = new Q(this.width) : n.clear();
|
|
15751
15763
|
const i = this.rowSize, s = this.bits, a = e * i;
|
|
15752
15764
|
for (let l = 0; l < i; l++)
|
|
15753
15765
|
n.setBulk(l * 32, s[a + l]);
|
|
@@ -15765,7 +15777,7 @@ function Qw() {
|
|
|
15765
15777
|
*/
|
|
15766
15778
|
rotate180() {
|
|
15767
15779
|
const e = this.getWidth(), n = this.getHeight();
|
|
15768
|
-
let i = new
|
|
15780
|
+
let i = new Q(e), s = new Q(e);
|
|
15769
15781
|
for (let a = 0, l = Math.floor((n + 1) / 2); a < l; a++)
|
|
15770
15782
|
i = this.getRow(a, i), s = this.getRow(n - 1 - a, s), i.reverse(), s.reverse(), this.setRow(a, s), this.setRow(n - 1 - a, i);
|
|
15771
15783
|
}
|
|
@@ -15917,7 +15929,7 @@ function Qw() {
|
|
|
15917
15929
|
/*@Override*/
|
|
15918
15930
|
getBlackRow(e, n) {
|
|
15919
15931
|
const i = this.getLuminanceSource(), s = i.getWidth();
|
|
15920
|
-
n == null || n.getSize() < s ? n = new
|
|
15932
|
+
n == null || n.getSize() < s ? n = new Q(s) : n.clear(), this.initArrays(s);
|
|
15921
15933
|
const a = i.getRow(e, this.luminances), l = this.buckets;
|
|
15922
15934
|
for (let h = 0; h < s; h++)
|
|
15923
15935
|
l[(a[h] & 255) >> ge.LUMINANCE_SHIFT]++;
|
|
@@ -16093,7 +16105,7 @@ function Qw() {
|
|
|
16093
16105
|
}
|
|
16094
16106
|
}
|
|
16095
16107
|
te.BLOCK_SIZE_POWER = 3, te.BLOCK_SIZE = 1 << te.BLOCK_SIZE_POWER, te.BLOCK_SIZE_MASK = te.BLOCK_SIZE - 1, te.MINIMUM_DIMENSION = te.BLOCK_SIZE * 5, te.MIN_DYNAMIC_RANGE = 24;
|
|
16096
|
-
class
|
|
16108
|
+
class J {
|
|
16097
16109
|
constructor(e, n) {
|
|
16098
16110
|
this.width = e, this.height = n;
|
|
16099
16111
|
}
|
|
@@ -16169,7 +16181,7 @@ function Qw() {
|
|
|
16169
16181
|
return n.toString();
|
|
16170
16182
|
}
|
|
16171
16183
|
}
|
|
16172
|
-
class pe extends
|
|
16184
|
+
class pe extends J {
|
|
16173
16185
|
constructor(e) {
|
|
16174
16186
|
super(e.getWidth(), e.getHeight()), this.delegate = e;
|
|
16175
16187
|
}
|
|
@@ -16217,7 +16229,7 @@ function Qw() {
|
|
|
16217
16229
|
return new pe(this.delegate.rotateCounterClockwise45());
|
|
16218
16230
|
}
|
|
16219
16231
|
}
|
|
16220
|
-
class de extends
|
|
16232
|
+
class de extends J {
|
|
16221
16233
|
constructor(e) {
|
|
16222
16234
|
super(e.width, e.height), this.canvas = e, this.tempCanvasElement = null, this.buffer = de.makeBufferFromCanvasImageData(e);
|
|
16223
16235
|
}
|
|
@@ -16791,7 +16803,7 @@ function Qw() {
|
|
|
16791
16803
|
const d = this.decode(e);
|
|
16792
16804
|
a(d);
|
|
16793
16805
|
} catch (d) {
|
|
16794
|
-
const h = n && d instanceof $, y = (d instanceof N || d instanceof
|
|
16806
|
+
const h = n && d instanceof $, y = (d instanceof N || d instanceof F) && i;
|
|
16795
16807
|
if (h || y)
|
|
16796
16808
|
return setTimeout(s, this._timeBetweenDecodingAttempts, a, l);
|
|
16797
16809
|
l(d);
|
|
@@ -16814,7 +16826,7 @@ function Qw() {
|
|
|
16814
16826
|
n(s, null), setTimeout(i, this.timeBetweenScansMillis);
|
|
16815
16827
|
} catch (s) {
|
|
16816
16828
|
n(null, s);
|
|
16817
|
-
const a = s instanceof N || s instanceof
|
|
16829
|
+
const a = s instanceof N || s instanceof F, l = s instanceof $;
|
|
16818
16830
|
(a || l) && setTimeout(i, this._timeBetweenDecodingAttempts);
|
|
16819
16831
|
}
|
|
16820
16832
|
};
|
|
@@ -17392,7 +17404,7 @@ function Qw() {
|
|
|
17392
17404
|
}
|
|
17393
17405
|
/*@Override*/
|
|
17394
17406
|
toString() {
|
|
17395
|
-
return "GF(0x" +
|
|
17407
|
+
return "GF(0x" + U.toHexString(this.primitive) + "," + this.size + ")";
|
|
17396
17408
|
}
|
|
17397
17409
|
equals(e) {
|
|
17398
17410
|
return e === this;
|
|
@@ -17595,20 +17607,20 @@ function Qw() {
|
|
|
17595
17607
|
this.ddata.getNbLayers() <= 2 ? (i = 6, n = be.AZTEC_DATA_6) : this.ddata.getNbLayers() <= 8 ? (i = 8, n = be.AZTEC_DATA_8) : this.ddata.getNbLayers() <= 22 ? (i = 10, n = be.AZTEC_DATA_10) : (i = 12, n = be.AZTEC_DATA_12);
|
|
17596
17608
|
let s = this.ddata.getNbDatablocks(), a = e.length / i;
|
|
17597
17609
|
if (a < s)
|
|
17598
|
-
throw new
|
|
17610
|
+
throw new F();
|
|
17599
17611
|
let l = e.length % i, d = new Int32Array(a);
|
|
17600
17612
|
for (let E = 0; E < a; E++, l += i)
|
|
17601
17613
|
d[E] = Ye.readCode(e, l, i);
|
|
17602
17614
|
try {
|
|
17603
17615
|
new Bn(n).decode(d, a - s);
|
|
17604
17616
|
} catch (E) {
|
|
17605
|
-
throw new
|
|
17617
|
+
throw new F(E);
|
|
17606
17618
|
}
|
|
17607
17619
|
let h = (1 << i) - 1, p = 0;
|
|
17608
17620
|
for (let E = 0; E < s; E++) {
|
|
17609
17621
|
let O = d[E];
|
|
17610
17622
|
if (O === 0 || O === h)
|
|
17611
|
-
throw new
|
|
17623
|
+
throw new F();
|
|
17612
17624
|
(O === 1 || O === h - 1) && p++;
|
|
17613
17625
|
}
|
|
17614
17626
|
let y = new Array(s * i - p), b = 0;
|
|
@@ -17633,9 +17645,9 @@ function Qw() {
|
|
|
17633
17645
|
for (let d = 0; d < a.length; d++)
|
|
17634
17646
|
a[d] = d;
|
|
17635
17647
|
else {
|
|
17636
|
-
let d = s + 1 + 2 *
|
|
17648
|
+
let d = s + 1 + 2 * U.truncDivision(U.truncDivision(s, 2) - 1, 15), h = s / 2, p = U.truncDivision(d, 2);
|
|
17637
17649
|
for (let y = 0; y < h; y++) {
|
|
17638
|
-
let b = y +
|
|
17650
|
+
let b = y + U.truncDivision(y, 15);
|
|
17639
17651
|
a[h - y - 1] = p - b - 1, a[h + y] = p + b + 1;
|
|
17640
17652
|
}
|
|
17641
17653
|
}
|
|
@@ -18331,7 +18343,7 @@ function Qw() {
|
|
|
18331
18343
|
i = (i << 3) + d;
|
|
18332
18344
|
}), i = ((i & 1) << 11) + (i >> 1);
|
|
18333
18345
|
for (let s = 0; s < 4; s++)
|
|
18334
|
-
if (
|
|
18346
|
+
if (U.bitCount(i ^ this.EXPECTED_CORNER_BITS[s]) <= 2)
|
|
18335
18347
|
return s;
|
|
18336
18348
|
throw new $();
|
|
18337
18349
|
}
|
|
@@ -18529,7 +18541,7 @@ function Qw() {
|
|
|
18529
18541
|
return Ve.distance(e.getX(), e.getY(), n.getX(), n.getY());
|
|
18530
18542
|
}
|
|
18531
18543
|
getDimension() {
|
|
18532
|
-
return this.compact ? 4 * this.nbLayers + 11 : this.nbLayers <= 4 ? 4 * this.nbLayers + 15 : 4 * this.nbLayers + 2 * (
|
|
18544
|
+
return this.compact ? 4 * this.nbLayers + 11 : this.nbLayers <= 4 ? 4 * this.nbLayers + 15 : 4 * this.nbLayers + 2 * (U.truncDivision(this.nbLayers - 4, 8) + 1) + 15;
|
|
18533
18545
|
}
|
|
18534
18546
|
}
|
|
18535
18547
|
class ht {
|
|
@@ -18630,7 +18642,7 @@ function Qw() {
|
|
|
18630
18642
|
*/
|
|
18631
18643
|
doDecode(e, n) {
|
|
18632
18644
|
const i = e.getWidth(), s = e.getHeight();
|
|
18633
|
-
let a = new
|
|
18645
|
+
let a = new Q(i);
|
|
18634
18646
|
const l = n && n.get(z.TRY_HARDER) === !0, d = Math.max(1, s >> (l ? 8 : 5));
|
|
18635
18647
|
let h;
|
|
18636
18648
|
l ? h = s : h = 15;
|
|
@@ -18786,7 +18798,7 @@ function Qw() {
|
|
|
18786
18798
|
p = fe.CODE_CODE_C;
|
|
18787
18799
|
break;
|
|
18788
18800
|
default:
|
|
18789
|
-
throw new
|
|
18801
|
+
throw new F();
|
|
18790
18802
|
}
|
|
18791
18803
|
let y = !1, b = !1, E = "", O = a[0], B = a[1];
|
|
18792
18804
|
const L = Int32Array.from([0, 0, 0, 0, 0, 0]);
|
|
@@ -18797,7 +18809,7 @@ function Qw() {
|
|
|
18797
18809
|
case fe.CODE_START_A:
|
|
18798
18810
|
case fe.CODE_START_B:
|
|
18799
18811
|
case fe.CODE_START_C:
|
|
18800
|
-
throw new
|
|
18812
|
+
throw new F();
|
|
18801
18813
|
}
|
|
18802
18814
|
switch (p) {
|
|
18803
18815
|
case fe.CODE_CODE_A:
|
|
@@ -19132,13 +19144,13 @@ function Qw() {
|
|
|
19132
19144
|
if (l >= "A" && l <= "Z")
|
|
19133
19145
|
d = String.fromCharCode(l.charCodeAt(0) + 32);
|
|
19134
19146
|
else
|
|
19135
|
-
throw new
|
|
19147
|
+
throw new F();
|
|
19136
19148
|
break;
|
|
19137
19149
|
case "$":
|
|
19138
19150
|
if (l >= "A" && l <= "Z")
|
|
19139
19151
|
d = String.fromCharCode(l.charCodeAt(0) - 64);
|
|
19140
19152
|
else
|
|
19141
|
-
throw new
|
|
19153
|
+
throw new F();
|
|
19142
19154
|
break;
|
|
19143
19155
|
case "%":
|
|
19144
19156
|
if (l >= "A" && l <= "E")
|
|
@@ -19158,7 +19170,7 @@ function Qw() {
|
|
|
19158
19170
|
else if (l === "X" || l === "Y" || l === "Z")
|
|
19159
19171
|
d = "";
|
|
19160
19172
|
else
|
|
19161
|
-
throw new
|
|
19173
|
+
throw new F();
|
|
19162
19174
|
break;
|
|
19163
19175
|
case "/":
|
|
19164
19176
|
if (l >= "A" && l <= "O")
|
|
@@ -19166,7 +19178,7 @@ function Qw() {
|
|
|
19166
19178
|
else if (l === "Z")
|
|
19167
19179
|
d = ":";
|
|
19168
19180
|
else
|
|
19169
|
-
throw new
|
|
19181
|
+
throw new F();
|
|
19170
19182
|
break;
|
|
19171
19183
|
}
|
|
19172
19184
|
i += d, s++;
|
|
@@ -19247,7 +19259,7 @@ function Qw() {
|
|
|
19247
19259
|
B > b && (b = B);
|
|
19248
19260
|
}
|
|
19249
19261
|
if (!y && p > b && (y = !0), !y)
|
|
19250
|
-
throw new
|
|
19262
|
+
throw new F();
|
|
19251
19263
|
const E = [new ve(s[1], e), new ve(a[0], e)];
|
|
19252
19264
|
return new Ae(
|
|
19253
19265
|
d,
|
|
@@ -19454,14 +19466,14 @@ function Qw() {
|
|
|
19454
19466
|
for (let s = n - 1; s >= 0; s -= 2) {
|
|
19455
19467
|
let a = e.charAt(s).charCodeAt(0) - 48;
|
|
19456
19468
|
if (a < 0 || a > 9)
|
|
19457
|
-
throw new
|
|
19469
|
+
throw new F();
|
|
19458
19470
|
i += a;
|
|
19459
19471
|
}
|
|
19460
19472
|
i *= 3;
|
|
19461
19473
|
for (let s = n - 2; s >= 0; s -= 2) {
|
|
19462
19474
|
let a = e.charAt(s).charCodeAt(0) - 48;
|
|
19463
19475
|
if (a < 0 || a > 9)
|
|
19464
|
-
throw new
|
|
19476
|
+
throw new F();
|
|
19465
19477
|
i += a;
|
|
19466
19478
|
}
|
|
19467
19479
|
return (1e3 - i) % 10;
|
|
@@ -19695,7 +19707,7 @@ function Qw() {
|
|
|
19695
19707
|
throw new $();
|
|
19696
19708
|
let E = h.toString();
|
|
19697
19709
|
if (E.length < 8)
|
|
19698
|
-
throw new
|
|
19710
|
+
throw new F();
|
|
19699
19711
|
if (!We.checkChecksum(E))
|
|
19700
19712
|
throw new N();
|
|
19701
19713
|
let O = (s[1] + s[0]) / 2, B = (p[1] + p[0]) / 2, L = this.getBarcodeFormat(), V = [new ve(O, e), new ve(B, e)], q = new Ae(E, null, 0, V, L, (/* @__PURE__ */ new Date()).getTime()), ae = 0;
|
|
@@ -19741,14 +19753,14 @@ function Qw() {
|
|
|
19741
19753
|
for (let s = n - 1; s >= 0; s -= 2) {
|
|
19742
19754
|
let a = e.charAt(s).charCodeAt(0) - 48;
|
|
19743
19755
|
if (a < 0 || a > 9)
|
|
19744
|
-
throw new
|
|
19756
|
+
throw new F();
|
|
19745
19757
|
i += a;
|
|
19746
19758
|
}
|
|
19747
19759
|
i *= 3;
|
|
19748
19760
|
for (let s = n - 2; s >= 0; s -= 2) {
|
|
19749
19761
|
let a = e.charAt(s).charCodeAt(0) - 48;
|
|
19750
19762
|
if (a < 0 || a > 9)
|
|
19751
|
-
throw new
|
|
19763
|
+
throw new F();
|
|
19752
19764
|
i += a;
|
|
19753
19765
|
}
|
|
19754
19766
|
return (1e3 - i) % 10;
|
|
@@ -20131,7 +20143,7 @@ function Qw() {
|
|
|
20131
20143
|
static buildBitArray(e) {
|
|
20132
20144
|
let n = e.length * 2 - 1;
|
|
20133
20145
|
e[e.length - 1].getRightChar() == null && (n -= 1);
|
|
20134
|
-
let i = 12 * n, s = new
|
|
20146
|
+
let i = 12 * n, s = new Q(i), a = 0, d = e[0].getRightChar().getValue();
|
|
20135
20147
|
for (let h = 11; h >= 0; --h)
|
|
20136
20148
|
(d & 1 << h) != 0 && s.set(a), a++;
|
|
20137
20149
|
for (let h = 1; h < e.length; ++h) {
|
|
@@ -20195,7 +20207,7 @@ function Qw() {
|
|
|
20195
20207
|
class vn extends uo {
|
|
20196
20208
|
constructor(e, n, i) {
|
|
20197
20209
|
if (super(e), n < 0 || n > 10 || i < 0 || i > 10)
|
|
20198
|
-
throw new
|
|
20210
|
+
throw new F();
|
|
20199
20211
|
this.firstDigit = n, this.secondDigit = i;
|
|
20200
20212
|
}
|
|
20201
20213
|
getFirstDigit() {
|
|
@@ -20577,7 +20589,7 @@ function Qw() {
|
|
|
20577
20589
|
a = " ";
|
|
20578
20590
|
break;
|
|
20579
20591
|
default:
|
|
20580
|
-
throw new
|
|
20592
|
+
throw new F();
|
|
20581
20593
|
}
|
|
20582
20594
|
return new ln(e + 8, a);
|
|
20583
20595
|
}
|
|
@@ -21613,11 +21625,11 @@ function Qw() {
|
|
|
21613
21625
|
*/
|
|
21614
21626
|
static getVersionForDimensions(e, n) {
|
|
21615
21627
|
if ((e & 1) !== 0 || (n & 1) !== 0)
|
|
21616
|
-
throw new
|
|
21628
|
+
throw new F();
|
|
21617
21629
|
for (let i of Ge.VERSIONS)
|
|
21618
21630
|
if (i.symbolSizeRows === e && i.symbolSizeColumns === n)
|
|
21619
21631
|
return i;
|
|
21620
|
-
throw new
|
|
21632
|
+
throw new F();
|
|
21621
21633
|
}
|
|
21622
21634
|
// @Override
|
|
21623
21635
|
toString() {
|
|
@@ -21670,7 +21682,7 @@ function Qw() {
|
|
|
21670
21682
|
constructor(e) {
|
|
21671
21683
|
const n = e.getHeight();
|
|
21672
21684
|
if (n < 8 || n > 144 || (n & 1) !== 0)
|
|
21673
|
-
throw new
|
|
21685
|
+
throw new F();
|
|
21674
21686
|
this.version = po.readVersion(e), this.mappingBitMatrix = this.extractDataRegion(e), this.readMappingMatrix = new Me(this.mappingBitMatrix.getWidth(), this.mappingBitMatrix.getHeight());
|
|
21675
21687
|
}
|
|
21676
21688
|
getVersion() {
|
|
@@ -21725,7 +21737,7 @@ function Qw() {
|
|
|
21725
21737
|
}
|
|
21726
21738
|
while (i < a || s < l);
|
|
21727
21739
|
if (n !== this.version.getTotalCodewords())
|
|
21728
|
-
throw new
|
|
21740
|
+
throw new F();
|
|
21729
21741
|
return e;
|
|
21730
21742
|
}
|
|
21731
21743
|
/**
|
|
@@ -21971,7 +21983,7 @@ function Qw() {
|
|
|
21971
21983
|
this.decodeBase256Segment(n, i, a);
|
|
21972
21984
|
break;
|
|
21973
21985
|
default:
|
|
21974
|
-
throw new
|
|
21986
|
+
throw new F();
|
|
21975
21987
|
}
|
|
21976
21988
|
l = Ut.ASCII_ENCODE;
|
|
21977
21989
|
}
|
|
@@ -21986,7 +21998,7 @@ function Qw() {
|
|
|
21986
21998
|
do {
|
|
21987
21999
|
let a = e.readBits(8);
|
|
21988
22000
|
if (a === 0)
|
|
21989
|
-
throw new
|
|
22001
|
+
throw new F();
|
|
21990
22002
|
if (a <= 128)
|
|
21991
22003
|
return s && (a += 128), n.append(String.fromCharCode(a - 1)), Ut.ASCII_ENCODE;
|
|
21992
22004
|
if (a === 129)
|
|
@@ -22026,7 +22038,7 @@ function Qw() {
|
|
|
22026
22038
|
break;
|
|
22027
22039
|
default:
|
|
22028
22040
|
if (a !== 254 || e.available() !== 0)
|
|
22029
|
-
throw new
|
|
22041
|
+
throw new F();
|
|
22030
22042
|
break;
|
|
22031
22043
|
}
|
|
22032
22044
|
} while (e.available() > 0);
|
|
@@ -22056,7 +22068,7 @@ function Qw() {
|
|
|
22056
22068
|
const p = this.C40_BASIC_SET_CHARS[h];
|
|
22057
22069
|
i ? (n.append(String.fromCharCode(p.charCodeAt(0) + 128)), i = !1) : n.append(p);
|
|
22058
22070
|
} else
|
|
22059
|
-
throw new
|
|
22071
|
+
throw new F();
|
|
22060
22072
|
break;
|
|
22061
22073
|
case 1:
|
|
22062
22074
|
i ? (n.append(String.fromCharCode(h + 128)), i = !1) : n.append(String.fromCharCode(h)), a = 0;
|
|
@@ -22074,7 +22086,7 @@ function Qw() {
|
|
|
22074
22086
|
i = !0;
|
|
22075
22087
|
break;
|
|
22076
22088
|
default:
|
|
22077
|
-
throw new
|
|
22089
|
+
throw new F();
|
|
22078
22090
|
}
|
|
22079
22091
|
a = 0;
|
|
22080
22092
|
break;
|
|
@@ -22082,7 +22094,7 @@ function Qw() {
|
|
|
22082
22094
|
i ? (n.append(String.fromCharCode(h + 224)), i = !1) : n.append(String.fromCharCode(h + 96)), a = 0;
|
|
22083
22095
|
break;
|
|
22084
22096
|
default:
|
|
22085
|
-
throw new
|
|
22097
|
+
throw new F();
|
|
22086
22098
|
}
|
|
22087
22099
|
}
|
|
22088
22100
|
} while (e.available() > 0);
|
|
@@ -22109,7 +22121,7 @@ function Qw() {
|
|
|
22109
22121
|
const p = this.TEXT_BASIC_SET_CHARS[h];
|
|
22110
22122
|
i ? (n.append(String.fromCharCode(p.charCodeAt(0) + 128)), i = !1) : n.append(p);
|
|
22111
22123
|
} else
|
|
22112
|
-
throw new
|
|
22124
|
+
throw new F();
|
|
22113
22125
|
break;
|
|
22114
22126
|
case 1:
|
|
22115
22127
|
i ? (n.append(String.fromCharCode(h + 128)), i = !1) : n.append(String.fromCharCode(h)), a = 0;
|
|
@@ -22127,7 +22139,7 @@ function Qw() {
|
|
|
22127
22139
|
i = !0;
|
|
22128
22140
|
break;
|
|
22129
22141
|
default:
|
|
22130
|
-
throw new
|
|
22142
|
+
throw new F();
|
|
22131
22143
|
}
|
|
22132
22144
|
a = 0;
|
|
22133
22145
|
break;
|
|
@@ -22136,10 +22148,10 @@ function Qw() {
|
|
|
22136
22148
|
const p = this.TEXT_SHIFT3_SET_CHARS[h];
|
|
22137
22149
|
i ? (n.append(String.fromCharCode(p.charCodeAt(0) + 128)), i = !1) : n.append(p), a = 0;
|
|
22138
22150
|
} else
|
|
22139
|
-
throw new
|
|
22151
|
+
throw new F();
|
|
22140
22152
|
break;
|
|
22141
22153
|
default:
|
|
22142
|
-
throw new
|
|
22154
|
+
throw new F();
|
|
22143
22155
|
}
|
|
22144
22156
|
}
|
|
22145
22157
|
} while (e.available() > 0);
|
|
@@ -22177,7 +22189,7 @@ function Qw() {
|
|
|
22177
22189
|
else if (l < 40)
|
|
22178
22190
|
n.append(String.fromCharCode(l + 51));
|
|
22179
22191
|
else
|
|
22180
|
-
throw new
|
|
22192
|
+
throw new F();
|
|
22181
22193
|
break;
|
|
22182
22194
|
}
|
|
22183
22195
|
}
|
|
@@ -22213,11 +22225,11 @@ function Qw() {
|
|
|
22213
22225
|
const a = this.unrandomize255State(e.readBits(8), s++);
|
|
22214
22226
|
let l;
|
|
22215
22227
|
if (a === 0 ? l = e.available() / 8 | 0 : a < 250 ? l = a : l = 250 * (a - 249) + this.unrandomize255State(e.readBits(8), s++), l < 0)
|
|
22216
|
-
throw new
|
|
22228
|
+
throw new F();
|
|
22217
22229
|
const d = new Uint8Array(l);
|
|
22218
22230
|
for (let h = 0; h < l; h++) {
|
|
22219
22231
|
if (e.available() < 8)
|
|
22220
|
-
throw new
|
|
22232
|
+
throw new F();
|
|
22221
22233
|
d[h] = this.unrandomize255State(e.readBits(8), s++);
|
|
22222
22234
|
}
|
|
22223
22235
|
i.push(d);
|
|
@@ -22662,7 +22674,7 @@ function Qw() {
|
|
|
22662
22674
|
e & 7;
|
|
22663
22675
|
}
|
|
22664
22676
|
static numBitsDiffering(e, n) {
|
|
22665
|
-
return
|
|
22677
|
+
return U.bitCount(e ^ n);
|
|
22666
22678
|
}
|
|
22667
22679
|
/**
|
|
22668
22680
|
* @param maskedFormatInfo1 format info indicator, with mask still applied
|
|
@@ -22803,11 +22815,11 @@ function Qw() {
|
|
|
22803
22815
|
*/
|
|
22804
22816
|
static getProvisionalVersionForDimension(e) {
|
|
22805
22817
|
if (e % 4 !== 1)
|
|
22806
|
-
throw new
|
|
22818
|
+
throw new F();
|
|
22807
22819
|
try {
|
|
22808
22820
|
return this.getVersionForNumber((e - 17) / 4);
|
|
22809
22821
|
} catch {
|
|
22810
|
-
throw new
|
|
22822
|
+
throw new F();
|
|
22811
22823
|
}
|
|
22812
22824
|
}
|
|
22813
22825
|
static getVersionForNumber(e) {
|
|
@@ -22990,7 +23002,7 @@ function Qw() {
|
|
|
22990
23002
|
constructor(e) {
|
|
22991
23003
|
const n = e.getHeight();
|
|
22992
23004
|
if (n < 21 || (n & 3) !== 1)
|
|
22993
|
-
throw new
|
|
23005
|
+
throw new F();
|
|
22994
23006
|
this.bitMatrix = e;
|
|
22995
23007
|
}
|
|
22996
23008
|
/**
|
|
@@ -23018,7 +23030,7 @@ function Qw() {
|
|
|
23018
23030
|
i = this.copyBit(a, 8, i);
|
|
23019
23031
|
if (this.parsedFormatInfo = Qt.decodeFormatInformation(e, i), this.parsedFormatInfo !== null)
|
|
23020
23032
|
return this.parsedFormatInfo;
|
|
23021
|
-
throw new
|
|
23033
|
+
throw new F();
|
|
23022
23034
|
}
|
|
23023
23035
|
/**
|
|
23024
23036
|
* <p>Reads version information from one of its two locations within the QR Code.</p>
|
|
@@ -23047,7 +23059,7 @@ function Qw() {
|
|
|
23047
23059
|
i = this.copyBit(l, d, i);
|
|
23048
23060
|
if (a = Ie.decodeVersionInformation(i), a !== null && a.getDimensionForVersion() === e)
|
|
23049
23061
|
return this.parsedVersion = a, a;
|
|
23050
|
-
throw new
|
|
23062
|
+
throw new F();
|
|
23051
23063
|
}
|
|
23052
23064
|
copyBit(e, n, i) {
|
|
23053
23065
|
return (this.isMirror ? this.bitMatrix.get(n, e) : this.bitMatrix.get(e, n)) ? i << 1 | 1 : i << 1;
|
|
@@ -23078,7 +23090,7 @@ function Qw() {
|
|
|
23078
23090
|
l = !l;
|
|
23079
23091
|
}
|
|
23080
23092
|
if (h !== n.getTotalCodewords())
|
|
23081
|
-
throw new
|
|
23093
|
+
throw new F();
|
|
23082
23094
|
return d;
|
|
23083
23095
|
}
|
|
23084
23096
|
/**
|
|
@@ -23236,13 +23248,13 @@ function Qw() {
|
|
|
23236
23248
|
break;
|
|
23237
23249
|
case Ne.STRUCTURED_APPEND:
|
|
23238
23250
|
if (a.available() < 16)
|
|
23239
|
-
throw new
|
|
23251
|
+
throw new F();
|
|
23240
23252
|
h = a.readBits(8), p = a.readBits(8);
|
|
23241
23253
|
break;
|
|
23242
23254
|
case Ne.ECI:
|
|
23243
23255
|
const O = At.parseECIValue(a);
|
|
23244
23256
|
if (y = I.getCharacterSetECIByValue(O), y === null)
|
|
23245
|
-
throw new
|
|
23257
|
+
throw new F();
|
|
23246
23258
|
break;
|
|
23247
23259
|
case Ne.HANZI:
|
|
23248
23260
|
const B = a.readBits(4), L = a.readBits(E.getCharacterCountBits(n));
|
|
@@ -23264,13 +23276,13 @@ function Qw() {
|
|
|
23264
23276
|
At.decodeKanjiSegment(a, l, V);
|
|
23265
23277
|
break;
|
|
23266
23278
|
default:
|
|
23267
|
-
throw new
|
|
23279
|
+
throw new F();
|
|
23268
23280
|
}
|
|
23269
23281
|
break;
|
|
23270
23282
|
}
|
|
23271
23283
|
} while (E !== Ne.TERMINATOR);
|
|
23272
23284
|
} catch {
|
|
23273
|
-
throw new
|
|
23285
|
+
throw new F();
|
|
23274
23286
|
}
|
|
23275
23287
|
return new Yt(e, l.toString(), d.length === 0 ? null : d, i === null ? null : i.toString(), h, p);
|
|
23276
23288
|
}
|
|
@@ -23279,7 +23291,7 @@ function Qw() {
|
|
|
23279
23291
|
*/
|
|
23280
23292
|
static decodeHanziSegment(e, n, i) {
|
|
23281
23293
|
if (i * 13 > e.available())
|
|
23282
|
-
throw new
|
|
23294
|
+
throw new F();
|
|
23283
23295
|
const s = new Uint8Array(2 * i);
|
|
23284
23296
|
let a = 0;
|
|
23285
23297
|
for (; i > 0; ) {
|
|
@@ -23292,12 +23304,12 @@ function Qw() {
|
|
|
23292
23304
|
try {
|
|
23293
23305
|
n.append(ye.decode(s, ne.GB2312));
|
|
23294
23306
|
} catch (l) {
|
|
23295
|
-
throw new
|
|
23307
|
+
throw new F(l);
|
|
23296
23308
|
}
|
|
23297
23309
|
}
|
|
23298
23310
|
static decodeKanjiSegment(e, n, i) {
|
|
23299
23311
|
if (i * 13 > e.available())
|
|
23300
|
-
throw new
|
|
23312
|
+
throw new F();
|
|
23301
23313
|
const s = new Uint8Array(2 * i);
|
|
23302
23314
|
let a = 0;
|
|
23303
23315
|
for (; i > 0; ) {
|
|
@@ -23310,12 +23322,12 @@ function Qw() {
|
|
|
23310
23322
|
try {
|
|
23311
23323
|
n.append(ye.decode(s, ne.SHIFT_JIS));
|
|
23312
23324
|
} catch (l) {
|
|
23313
|
-
throw new
|
|
23325
|
+
throw new F(l);
|
|
23314
23326
|
}
|
|
23315
23327
|
}
|
|
23316
23328
|
static decodeByteSegment(e, n, i, s, a, l) {
|
|
23317
23329
|
if (8 * i > e.available())
|
|
23318
|
-
throw new
|
|
23330
|
+
throw new F();
|
|
23319
23331
|
const d = new Uint8Array(i);
|
|
23320
23332
|
for (let p = 0; p < i; p++)
|
|
23321
23333
|
d[p] = /*(byte) */
|
|
@@ -23325,26 +23337,26 @@ function Qw() {
|
|
|
23325
23337
|
try {
|
|
23326
23338
|
n.append(ye.decode(d, h));
|
|
23327
23339
|
} catch (p) {
|
|
23328
|
-
throw new
|
|
23340
|
+
throw new F(p);
|
|
23329
23341
|
}
|
|
23330
23342
|
a.push(d);
|
|
23331
23343
|
}
|
|
23332
23344
|
static toAlphaNumericChar(e) {
|
|
23333
23345
|
if (e >= At.ALPHANUMERIC_CHARS.length)
|
|
23334
|
-
throw new
|
|
23346
|
+
throw new F();
|
|
23335
23347
|
return At.ALPHANUMERIC_CHARS[e];
|
|
23336
23348
|
}
|
|
23337
23349
|
static decodeAlphanumericSegment(e, n, i, s) {
|
|
23338
23350
|
const a = n.length();
|
|
23339
23351
|
for (; i > 1; ) {
|
|
23340
23352
|
if (e.available() < 11)
|
|
23341
|
-
throw new
|
|
23353
|
+
throw new F();
|
|
23342
23354
|
const l = e.readBits(11);
|
|
23343
23355
|
n.append(At.toAlphaNumericChar(Math.floor(l / 45))), n.append(At.toAlphaNumericChar(l % 45)), i -= 2;
|
|
23344
23356
|
}
|
|
23345
23357
|
if (i === 1) {
|
|
23346
23358
|
if (e.available() < 6)
|
|
23347
|
-
throw new
|
|
23359
|
+
throw new F();
|
|
23348
23360
|
n.append(At.toAlphaNumericChar(e.readBits(6)));
|
|
23349
23361
|
}
|
|
23350
23362
|
if (s)
|
|
@@ -23354,25 +23366,25 @@ function Qw() {
|
|
|
23354
23366
|
static decodeNumericSegment(e, n, i) {
|
|
23355
23367
|
for (; i >= 3; ) {
|
|
23356
23368
|
if (e.available() < 10)
|
|
23357
|
-
throw new
|
|
23369
|
+
throw new F();
|
|
23358
23370
|
const s = e.readBits(10);
|
|
23359
23371
|
if (s >= 1e3)
|
|
23360
|
-
throw new
|
|
23372
|
+
throw new F();
|
|
23361
23373
|
n.append(At.toAlphaNumericChar(Math.floor(s / 100))), n.append(At.toAlphaNumericChar(Math.floor(s / 10) % 10)), n.append(At.toAlphaNumericChar(s % 10)), i -= 3;
|
|
23362
23374
|
}
|
|
23363
23375
|
if (i === 2) {
|
|
23364
23376
|
if (e.available() < 7)
|
|
23365
|
-
throw new
|
|
23377
|
+
throw new F();
|
|
23366
23378
|
const s = e.readBits(7);
|
|
23367
23379
|
if (s >= 100)
|
|
23368
|
-
throw new
|
|
23380
|
+
throw new F();
|
|
23369
23381
|
n.append(At.toAlphaNumericChar(Math.floor(s / 10))), n.append(At.toAlphaNumericChar(s % 10));
|
|
23370
23382
|
} else if (i === 1) {
|
|
23371
23383
|
if (e.available() < 4)
|
|
23372
|
-
throw new
|
|
23384
|
+
throw new F();
|
|
23373
23385
|
const s = e.readBits(4);
|
|
23374
23386
|
if (s >= 10)
|
|
23375
|
-
throw new
|
|
23387
|
+
throw new F();
|
|
23376
23388
|
n.append(At.toAlphaNumericChar(s));
|
|
23377
23389
|
}
|
|
23378
23390
|
}
|
|
@@ -23388,7 +23400,7 @@ function Qw() {
|
|
|
23388
23400
|
const i = e.readBits(16);
|
|
23389
23401
|
return (n & 31) << 16 & 4294967295 | i;
|
|
23390
23402
|
}
|
|
23391
|
-
throw new
|
|
23403
|
+
throw new F();
|
|
23392
23404
|
}
|
|
23393
23405
|
}
|
|
23394
23406
|
At.ALPHANUMERIC_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:", At.GB2312_SUBSET = 1;
|
|
@@ -31399,7 +31411,7 @@ function Qw() {
|
|
|
31399
31411
|
if (i - e < 0 && (i = e), i < 0) {
|
|
31400
31412
|
if (e < 0)
|
|
31401
31413
|
throw new Fd();
|
|
31402
|
-
i =
|
|
31414
|
+
i = U.MAX_VALUE;
|
|
31403
31415
|
}
|
|
31404
31416
|
this.buf = Z.copyOfUint8Array(this.buf, i);
|
|
31405
31417
|
}
|
|
@@ -31630,7 +31642,7 @@ function Qw() {
|
|
|
31630
31642
|
break;
|
|
31631
31643
|
case X.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:
|
|
31632
31644
|
case X.MACRO_PDF417_TERMINATOR:
|
|
31633
|
-
throw new
|
|
31645
|
+
throw new F();
|
|
31634
31646
|
default:
|
|
31635
31647
|
a--, a = X.textCompaction(e, a, i);
|
|
31636
31648
|
break;
|
|
@@ -31638,10 +31650,10 @@ function Qw() {
|
|
|
31638
31650
|
if (a < e.length)
|
|
31639
31651
|
l = e[a++];
|
|
31640
31652
|
else
|
|
31641
|
-
throw
|
|
31653
|
+
throw F.getFormatInstance();
|
|
31642
31654
|
}
|
|
31643
31655
|
if (i.length() === 0)
|
|
31644
|
-
throw
|
|
31656
|
+
throw F.getFormatInstance();
|
|
31645
31657
|
let h = new Yt(null, i.toString(), null, n);
|
|
31646
31658
|
return h.setOther(d), h;
|
|
31647
31659
|
}
|
|
@@ -31660,11 +31672,11 @@ function Qw() {
|
|
|
31660
31672
|
// @SuppressWarnings("deprecation")
|
|
31661
31673
|
static decodeMacroBlock(e, n, i) {
|
|
31662
31674
|
if (n + X.NUMBER_OF_SEQUENCE_CODEWORDS > e[0])
|
|
31663
|
-
throw
|
|
31675
|
+
throw F.getFormatInstance();
|
|
31664
31676
|
let s = new Int32Array(X.NUMBER_OF_SEQUENCE_CODEWORDS);
|
|
31665
31677
|
for (let d = 0; d < X.NUMBER_OF_SEQUENCE_CODEWORDS; d++, n++)
|
|
31666
31678
|
s[d] = e[n];
|
|
31667
|
-
i.setSegmentIndex(
|
|
31679
|
+
i.setSegmentIndex(U.parseInt(X.decodeBase900toBase10(s, X.NUMBER_OF_SEQUENCE_CODEWORDS)));
|
|
31668
31680
|
let a = new me();
|
|
31669
31681
|
n = X.textCompaction(e, n, a), i.setFileId(a.toString());
|
|
31670
31682
|
let l = -1;
|
|
@@ -31686,7 +31698,7 @@ function Qw() {
|
|
|
31686
31698
|
break;
|
|
31687
31699
|
case X.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:
|
|
31688
31700
|
let y = new me();
|
|
31689
|
-
n = X.numericCompaction(e, n + 1, y), i.setSegmentCount(
|
|
31701
|
+
n = X.numericCompaction(e, n + 1, y), i.setSegmentCount(U.parseInt(y.toString()));
|
|
31690
31702
|
break;
|
|
31691
31703
|
case X.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:
|
|
31692
31704
|
let b = new me();
|
|
@@ -31694,21 +31706,21 @@ function Qw() {
|
|
|
31694
31706
|
break;
|
|
31695
31707
|
case X.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:
|
|
31696
31708
|
let E = new me();
|
|
31697
|
-
n = X.numericCompaction(e, n + 1, E), i.setChecksum(
|
|
31709
|
+
n = X.numericCompaction(e, n + 1, E), i.setChecksum(U.parseInt(E.toString()));
|
|
31698
31710
|
break;
|
|
31699
31711
|
case X.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:
|
|
31700
31712
|
let O = new me();
|
|
31701
31713
|
n = X.numericCompaction(e, n + 1, O), i.setFileSize($s.parseLong(O.toString()));
|
|
31702
31714
|
break;
|
|
31703
31715
|
default:
|
|
31704
|
-
throw
|
|
31716
|
+
throw F.getFormatInstance();
|
|
31705
31717
|
}
|
|
31706
31718
|
break;
|
|
31707
31719
|
case X.MACRO_PDF417_TERMINATOR:
|
|
31708
31720
|
n++, i.setLastSegment(!0);
|
|
31709
31721
|
break;
|
|
31710
31722
|
default:
|
|
31711
|
-
throw
|
|
31723
|
+
throw F.getFormatInstance();
|
|
31712
31724
|
}
|
|
31713
31725
|
if (l !== -1) {
|
|
31714
31726
|
let d = n - l;
|
|
@@ -32081,7 +32093,7 @@ function Qw() {
|
|
|
32081
32093
|
i += X.EXP900[n - a - 1] * sr(e[a]);
|
|
32082
32094
|
let s = i.toString();
|
|
32083
32095
|
if (s.charAt(0) !== "1")
|
|
32084
|
-
throw new
|
|
32096
|
+
throw new F();
|
|
32085
32097
|
return s.substring(1);
|
|
32086
32098
|
}
|
|
32087
32099
|
}
|
|
@@ -32394,7 +32406,7 @@ function Qw() {
|
|
|
32394
32406
|
*/
|
|
32395
32407
|
static decodeCodewords(e, n, i) {
|
|
32396
32408
|
if (e.length === 0)
|
|
32397
|
-
throw
|
|
32409
|
+
throw F.getFormatInstance();
|
|
32398
32410
|
let s = 1 << n + 1, a = $e.correctErrors(e, i, s);
|
|
32399
32411
|
$e.verifyCodewordCount(e, s);
|
|
32400
32412
|
let l = X.decode(e, "" + n);
|
|
@@ -32420,15 +32432,15 @@ function Qw() {
|
|
|
32420
32432
|
*/
|
|
32421
32433
|
static verifyCodewordCount(e, n) {
|
|
32422
32434
|
if (e.length < 4)
|
|
32423
|
-
throw
|
|
32435
|
+
throw F.getFormatInstance();
|
|
32424
32436
|
let i = e[0];
|
|
32425
32437
|
if (i > e.length)
|
|
32426
|
-
throw
|
|
32438
|
+
throw F.getFormatInstance();
|
|
32427
32439
|
if (i === 0)
|
|
32428
32440
|
if (n < e.length)
|
|
32429
32441
|
e[0] = e.length - n;
|
|
32430
32442
|
else
|
|
32431
|
-
throw
|
|
32443
|
+
throw F.getFormatInstance();
|
|
32432
32444
|
}
|
|
32433
32445
|
static getBitCountForCodeword(e) {
|
|
32434
32446
|
let n = new Int32Array(8), i = 0, s = n.length - 1;
|
|
@@ -32487,7 +32499,7 @@ function Qw() {
|
|
|
32487
32499
|
try {
|
|
32488
32500
|
return Xt.decode(e, n, !0);
|
|
32489
32501
|
} catch (i) {
|
|
32490
|
-
throw i instanceof
|
|
32502
|
+
throw i instanceof F || i instanceof N ? $.getNotFoundInstance() : i;
|
|
32491
32503
|
}
|
|
32492
32504
|
}
|
|
32493
32505
|
/**
|
|
@@ -32514,7 +32526,7 @@ function Qw() {
|
|
|
32514
32526
|
return e == null || n == null ? 0 : Math.trunc(Math.abs(e.getX() - n.getX()));
|
|
32515
32527
|
}
|
|
32516
32528
|
static getMinWidth(e, n) {
|
|
32517
|
-
return e == null || n == null ?
|
|
32529
|
+
return e == null || n == null ? U.MAX_VALUE : Math.trunc(Math.abs(e.getX() - n.getX()));
|
|
32518
32530
|
}
|
|
32519
32531
|
static getMaxCodewordWidth(e) {
|
|
32520
32532
|
return Math.floor(Math.max(Math.max(Xt.getMaxWidth(e[0], e[4]), Xt.getMaxWidth(e[6], e[2]) * De.MODULES_IN_CODEWORD / De.MODULES_IN_STOP_PATTERN), Math.max(Xt.getMaxWidth(e[1], e[5]), Xt.getMaxWidth(e[7], e[3]) * De.MODULES_IN_CODEWORD / De.MODULES_IN_STOP_PATTERN)));
|
|
@@ -33000,7 +33012,7 @@ function Qw() {
|
|
|
33000
33012
|
}
|
|
33001
33013
|
// Embed type information. On success, modify the matrix.
|
|
33002
33014
|
static embedTypeInfo(e, n, i) {
|
|
33003
|
-
const s = new
|
|
33015
|
+
const s = new Q();
|
|
33004
33016
|
Re.makeTypeInfoBits(e, n, s);
|
|
33005
33017
|
for (let a = 0, l = s.getSize(); a < l; ++a) {
|
|
33006
33018
|
const d = s.get(s.getSize() - 1 - a), h = Re.TYPE_INFO_COORDINATES[a], p = h[0], y = h[1];
|
|
@@ -33018,7 +33030,7 @@ function Qw() {
|
|
|
33018
33030
|
static maybeEmbedVersionInfo(e, n) {
|
|
33019
33031
|
if (e.getVersionNumber() < 7)
|
|
33020
33032
|
return;
|
|
33021
|
-
const i = new
|
|
33033
|
+
const i = new Q();
|
|
33022
33034
|
Re.makeVersionInfoBits(e, i);
|
|
33023
33035
|
let s = 17;
|
|
33024
33036
|
for (let a = 0; a < 6; ++a)
|
|
@@ -33054,7 +33066,7 @@ function Qw() {
|
|
|
33054
33066
|
// - findMSBSet(1) => 1
|
|
33055
33067
|
// - findMSBSet(255) => 8
|
|
33056
33068
|
static findMSBSet(e) {
|
|
33057
|
-
return 32 -
|
|
33069
|
+
return 32 - U.numberOfLeadingZeros(e);
|
|
33058
33070
|
}
|
|
33059
33071
|
// Calculate BCH (Bose-Chaudhuri-Hocquenghem) code for "value" using polynomial "poly". The BCH
|
|
33060
33072
|
// code is used for encoding type information and version information.
|
|
@@ -33099,7 +33111,7 @@ function Qw() {
|
|
|
33099
33111
|
i.appendBits(s, 5);
|
|
33100
33112
|
const a = Re.calculateBCHCode(s, Re.TYPE_INFO_POLY);
|
|
33101
33113
|
i.appendBits(a, 10);
|
|
33102
|
-
const l = new
|
|
33114
|
+
const l = new Q();
|
|
33103
33115
|
if (l.appendBits(Re.TYPE_INFO_MASK_PATTERN, 15), i.xor(l), i.getSize() !== 15)
|
|
33104
33116
|
throw new ct("should not happen but we got: " + i.getSize());
|
|
33105
33117
|
}
|
|
@@ -33285,13 +33297,13 @@ function Qw() {
|
|
|
33285
33297
|
let s = mt.DEFAULT_BYTE_MODE_ENCODING;
|
|
33286
33298
|
const a = i !== null && i.get(zt.CHARACTER_SET) !== void 0;
|
|
33287
33299
|
a && (s = i.get(zt.CHARACTER_SET).toString());
|
|
33288
|
-
const l = this.chooseMode(e, s), d = new
|
|
33300
|
+
const l = this.chooseMode(e, s), d = new Q();
|
|
33289
33301
|
if (l === Ne.BYTE && (a || mt.DEFAULT_BYTE_MODE_ENCODING !== s)) {
|
|
33290
33302
|
const le = I.getCharacterSetECIByName(s);
|
|
33291
33303
|
le !== void 0 && this.appendECI(le, d);
|
|
33292
33304
|
}
|
|
33293
33305
|
this.appendModeInfo(l, d);
|
|
33294
|
-
const h = new
|
|
33306
|
+
const h = new Q();
|
|
33295
33307
|
this.appendBytes(e, l, h, s);
|
|
33296
33308
|
let p;
|
|
33297
33309
|
if (i !== null && i.get(zt.QR_VERSION) !== void 0) {
|
|
@@ -33302,7 +33314,7 @@ function Qw() {
|
|
|
33302
33314
|
throw new ct("Data too big for requested version");
|
|
33303
33315
|
} else
|
|
33304
33316
|
p = this.recommendVersion(n, l, d, h);
|
|
33305
|
-
const y = new
|
|
33317
|
+
const y = new Q();
|
|
33306
33318
|
y.appendBitArray(d);
|
|
33307
33319
|
const b = l === Ne.BYTE ? h.getSizeInBytes() : e.length;
|
|
33308
33320
|
this.appendLengthInfo(b, p, l, y), y.appendBitArray(h);
|
|
@@ -33451,7 +33463,7 @@ function Qw() {
|
|
|
33451
33463
|
}
|
|
33452
33464
|
if (i !== a)
|
|
33453
33465
|
throw new ct("Data bytes does not match offset");
|
|
33454
|
-
const p = new
|
|
33466
|
+
const p = new Q();
|
|
33455
33467
|
for (let y = 0; y < l; ++y)
|
|
33456
33468
|
for (const b of h) {
|
|
33457
33469
|
const E = b.getDataBytes();
|
|
@@ -33843,7 +33855,7 @@ function Qw() {
|
|
|
33843
33855
|
return l.encode(e, n, i, s, a);
|
|
33844
33856
|
}
|
|
33845
33857
|
}
|
|
33846
|
-
class Zn extends
|
|
33858
|
+
class Zn extends J {
|
|
33847
33859
|
constructor(e, n, i, s, a, l, d, h) {
|
|
33848
33860
|
if (super(l, d), this.yuvData = e, this.dataWidth = n, this.dataHeight = i, this.left = s, this.top = a, s + l > n || a + d > i)
|
|
33849
33861
|
throw new _("Crop rectangle does not fit within image data.");
|
|
@@ -33921,7 +33933,7 @@ function Qw() {
|
|
|
33921
33933
|
}
|
|
33922
33934
|
}
|
|
33923
33935
|
Zn.THUMBNAIL_SCALE_FACTOR = 2;
|
|
33924
|
-
class bo extends
|
|
33936
|
+
class bo extends J {
|
|
33925
33937
|
constructor(e, n, i, s, a, l, d) {
|
|
33926
33938
|
if (super(n, i), this.dataWidth = s, this.dataHeight = a, this.left = l, this.top = d, e.BYTES_PER_ELEMENT === 4) {
|
|
33927
33939
|
const h = n * i, p = new Uint8ClampedArray(h);
|
|
@@ -34070,7 +34082,7 @@ function Qw() {
|
|
|
34070
34082
|
*/
|
|
34071
34083
|
toString() {
|
|
34072
34084
|
let e = this.value & (1 << this.bitCount) - 1;
|
|
34073
|
-
return e |= 1 << this.bitCount, "<" +
|
|
34085
|
+
return e |= 1 << this.bitCount, "<" + U.toBinaryString(e | 1 << this.bitCount).substring(1) + ">";
|
|
34074
34086
|
}
|
|
34075
34087
|
}
|
|
34076
34088
|
class Eo extends Br {
|
|
@@ -34215,7 +34227,7 @@ function Qw() {
|
|
|
34215
34227
|
let n = [];
|
|
34216
34228
|
for (let s = this.endBinaryShift(e.length).token; s !== null; s = s.getPrevious())
|
|
34217
34229
|
n.unshift(s);
|
|
34218
|
-
let i = new
|
|
34230
|
+
let i = new Q();
|
|
34219
34231
|
for (const s of n)
|
|
34220
34232
|
s.appendTo(i, e);
|
|
34221
34233
|
return i;
|
|
@@ -34437,7 +34449,7 @@ function Qw() {
|
|
|
34437
34449
|
* @return Aztec symbol matrix with metadata
|
|
34438
34450
|
*/
|
|
34439
34451
|
static encode(e, n, i) {
|
|
34440
|
-
let s = new Kr(e).encode(), a =
|
|
34452
|
+
let s = new Kr(e).encode(), a = U.truncDivision(s.getSize() * n, 100) + 11, l = s.getSize() + a, d, h, p, y, b;
|
|
34441
34453
|
if (i !== qe.DEFAULT_AZTEC_LAYERS) {
|
|
34442
34454
|
if (d = i < 0, h = Math.abs(i), h > (d ? qe.MAX_NB_BITS_COMPACT : qe.MAX_NB_BITS))
|
|
34443
34455
|
throw new _(ne.format("Illegal value %s for layers", i));
|
|
@@ -34466,10 +34478,10 @@ function Qw() {
|
|
|
34466
34478
|
for (let se = 0; se < V.length; se++)
|
|
34467
34479
|
V[se] = se;
|
|
34468
34480
|
} else {
|
|
34469
|
-
q = L + 1 + 2 *
|
|
34470
|
-
let se =
|
|
34481
|
+
q = L + 1 + 2 * U.truncDivision(U.truncDivision(L, 2) - 1, 15);
|
|
34482
|
+
let se = U.truncDivision(L, 2), je = U.truncDivision(q, 2);
|
|
34471
34483
|
for (let Ue = 0; Ue < se; Ue++) {
|
|
34472
|
-
let dn = Ue +
|
|
34484
|
+
let dn = Ue + U.truncDivision(Ue, 15);
|
|
34473
34485
|
V[se - Ue - 1] = je - dn - 1, V[se + Ue] = je + dn + 1;
|
|
34474
34486
|
}
|
|
34475
34487
|
}
|
|
@@ -34484,12 +34496,12 @@ function Qw() {
|
|
|
34484
34496
|
je += Ue * 8;
|
|
34485
34497
|
}
|
|
34486
34498
|
if (qe.drawModeMessage(ae, d, q, B), d)
|
|
34487
|
-
qe.drawBullsEye(ae,
|
|
34499
|
+
qe.drawBullsEye(ae, U.truncDivision(q, 2), 5);
|
|
34488
34500
|
else {
|
|
34489
|
-
qe.drawBullsEye(ae,
|
|
34490
|
-
for (let se = 0, je = 0; se <
|
|
34491
|
-
for (let Ue =
|
|
34492
|
-
ae.set(
|
|
34501
|
+
qe.drawBullsEye(ae, U.truncDivision(q, 2), 7);
|
|
34502
|
+
for (let se = 0, je = 0; se < U.truncDivision(L, 2) - 1; se += 15, je += 16)
|
|
34503
|
+
for (let Ue = U.truncDivision(q, 2) & 1; Ue < q; Ue += 2)
|
|
34504
|
+
ae.set(U.truncDivision(q, 2) - je, Ue), ae.set(U.truncDivision(q, 2) + je, Ue), ae.set(Ue, U.truncDivision(q, 2) - je), ae.set(Ue, U.truncDivision(q, 2) + je);
|
|
34493
34505
|
}
|
|
34494
34506
|
let le = new Gs();
|
|
34495
34507
|
return le.setCompact(d), le.setSize(q), le.setLayers(h), le.setCodeWords(O), le.setMatrix(ae), le;
|
|
@@ -34501,11 +34513,11 @@ function Qw() {
|
|
|
34501
34513
|
e.set(n - i, n - i), e.set(n - i + 1, n - i), e.set(n - i, n - i + 1), e.set(n + i, n - i), e.set(n + i, n - i + 1), e.set(n + i, n + i - 1);
|
|
34502
34514
|
}
|
|
34503
34515
|
static generateModeMessage(e, n, i) {
|
|
34504
|
-
let s = new
|
|
34516
|
+
let s = new Q();
|
|
34505
34517
|
return e ? (s.appendBits(n - 1, 2), s.appendBits(i - 1, 6), s = qe.generateCheckWords(s, 28, 4)) : (s.appendBits(n - 1, 5), s.appendBits(i - 1, 11), s = qe.generateCheckWords(s, 40, 4)), s;
|
|
34506
34518
|
}
|
|
34507
34519
|
static drawModeMessage(e, n, i, s) {
|
|
34508
|
-
let a =
|
|
34520
|
+
let a = U.truncDivision(i, 2);
|
|
34509
34521
|
if (n)
|
|
34510
34522
|
for (let l = 0; l < 7; l++) {
|
|
34511
34523
|
let d = a - 3 + l;
|
|
@@ -34513,14 +34525,14 @@ function Qw() {
|
|
|
34513
34525
|
}
|
|
34514
34526
|
else
|
|
34515
34527
|
for (let l = 0; l < 10; l++) {
|
|
34516
|
-
let d = a - 5 + l +
|
|
34528
|
+
let d = a - 5 + l + U.truncDivision(l, 5);
|
|
34517
34529
|
s.get(l) && e.set(d, a - 7), s.get(l + 10) && e.set(a + 7, d), s.get(29 - l) && e.set(d, a + 7), s.get(39 - l) && e.set(a - 7, d);
|
|
34518
34530
|
}
|
|
34519
34531
|
}
|
|
34520
34532
|
static generateCheckWords(e, n, i) {
|
|
34521
|
-
let s = e.getSize() / i, a = new Co(qe.getGF(i)), l =
|
|
34533
|
+
let s = e.getSize() / i, a = new Co(qe.getGF(i)), l = U.truncDivision(n, i), d = qe.bitsToWords(e, i, l);
|
|
34522
34534
|
a.encode(d, l - s);
|
|
34523
|
-
let h = n % i, p = new
|
|
34535
|
+
let h = n % i, p = new Q();
|
|
34524
34536
|
p.appendBits(0, h);
|
|
34525
34537
|
for (const y of Array.from(d))
|
|
34526
34538
|
p.appendBits(y, i);
|
|
@@ -34553,7 +34565,7 @@ function Qw() {
|
|
|
34553
34565
|
}
|
|
34554
34566
|
}
|
|
34555
34567
|
static stuffBits(e, n) {
|
|
34556
|
-
let i = new
|
|
34568
|
+
let i = new Q(), s = e.getSize(), a = (1 << n) - 2;
|
|
34557
34569
|
for (let l = 0; l < s; l += n) {
|
|
34558
34570
|
let d = 0;
|
|
34559
34571
|
for (let h = 0; h < n; h++)
|
|
@@ -34609,7 +34621,7 @@ function Qw() {
|
|
|
34609
34621
|
// @Override
|
|
34610
34622
|
encodeWithHints(e, n, i, s, a) {
|
|
34611
34623
|
let l = Ao.ISO_8859_1, d = qe.DEFAULT_EC_PERCENT, h = qe.DEFAULT_AZTEC_LAYERS;
|
|
34612
|
-
return a != null && (a.has(zt.CHARACTER_SET) && (l = js.forName(a.get(zt.CHARACTER_SET).toString())), a.has(zt.ERROR_CORRECTION) && (d =
|
|
34624
|
+
return a != null && (a.has(zt.CHARACTER_SET) && (l = js.forName(a.get(zt.CHARACTER_SET).toString())), a.has(zt.ERROR_CORRECTION) && (d = U.parseInt(a.get(zt.ERROR_CORRECTION).toString())), a.has(zt.AZTEC_LAYERS) && (h = U.parseInt(a.get(zt.AZTEC_LAYERS).toString()))), ki.encodeLayers(e, n, i, s, l, d, h);
|
|
34613
34625
|
}
|
|
34614
34626
|
static encodeLayers(e, n, i, s, a, l, d) {
|
|
34615
34627
|
if (n !== Ce.AZTEC)
|
|
@@ -34628,7 +34640,7 @@ function Qw() {
|
|
|
34628
34640
|
return E;
|
|
34629
34641
|
}
|
|
34630
34642
|
}
|
|
34631
|
-
o.AbstractExpandedDecoder = fo, o.ArgumentException = A, o.ArithmeticException = bt, o.AztecCode = Gs, o.AztecCodeReader = ht, o.AztecCodeWriter = ki, o.AztecDecoder = Ye, o.AztecDetector = Ke, o.AztecDetectorResult = er, o.AztecEncoder = qe, o.AztecHighLevelEncoder = Kr, o.AztecPoint = ie, o.BarcodeFormat = Ce, o.Binarizer = R, o.BinaryBitmap = D, o.BitArray =
|
|
34643
|
+
o.AbstractExpandedDecoder = fo, o.ArgumentException = A, o.ArithmeticException = bt, o.AztecCode = Gs, o.AztecCodeReader = ht, o.AztecCodeWriter = ki, o.AztecDecoder = Ye, o.AztecDetector = Ke, o.AztecDetectorResult = er, o.AztecEncoder = qe, o.AztecHighLevelEncoder = Kr, o.AztecPoint = ie, o.BarcodeFormat = Ce, o.Binarizer = R, o.BinaryBitmap = D, o.BitArray = Q, o.BitMatrix = Me, o.BitSource = mo, o.BrowserAztecCodeReader = Nr, o.BrowserBarcodeReader = Td, o.BrowserCodeReader = It, o.BrowserDatamatrixCodeReader = Od, o.BrowserMultiFormatReader = Zd, o.BrowserPDF417Reader = $d, o.BrowserQRCodeReader = Vd, o.BrowserQRCodeSvgWriter = yr, o.CharacterSetECI = I, o.ChecksumException = N, o.Code128Reader = fe, o.Code39Reader = Pt, o.DataMatrixDecodedBitStreamParser = rr, o.DataMatrixReader = ir, o.DecodeHintType = z, o.DecoderResult = Yt, o.DefaultGridSampler = hr, o.DetectorResult = Gn, o.EAN13Reader = Xn, o.EncodeHintType = zt, o.Exception = x, o.FormatException = F, o.GenericGF = be, o.GenericGFPoly = Oe, o.GlobalHistogramBinarizer = ge, o.GridSampler = tr, o.GridSamplerInstance = k, o.HTMLCanvasElementLuminanceSource = de, o.HybridBinarizer = te, o.ITFReader = st, o.IllegalArgumentException = _, o.IllegalStateException = Kt, o.InvertedLuminanceSource = pe, o.LuminanceSource = J, o.MathUtils = Ve, o.MultiFormatOneDReader = Mr, o.MultiFormatReader = Ws, o.MultiFormatWriter = Wd, o.NotFoundException = $, o.OneDReader = Tt, o.PDF417DecodedBitStreamParser = X, o.PDF417DecoderErrorCorrection = Us, o.PDF417Reader = Xt, o.PDF417ResultMetadata = Zs, o.PerspectiveTransform = $t, o.PlanarYUVLuminanceSource = Zn, o.QRCodeByteMatrix = Ni, o.QRCodeDataMask = Cn, o.QRCodeDecodedBitStreamParser = At, o.QRCodeDecoderErrorCorrectionLevel = pt, o.QRCodeDecoderFormatInformation = Qt, o.QRCodeEncoder = mt, o.QRCodeEncoderQRCode = xr, o.QRCodeMaskUtil = Ot, o.QRCodeMatrixUtil = Re, o.QRCodeMode = Ne, o.QRCodeReader = or, o.QRCodeVersion = Ie, o.QRCodeWriter = Pr, o.RGBLuminanceSource = bo, o.RSS14Reader = Nt, o.RSSExpandedReader = oe, o.ReaderException = Ti, o.ReedSolomonDecoder = Bn, o.ReedSolomonEncoder = Co, o.ReedSolomonException = en, o.Result = Ae, o.ResultMetadataType = ze, o.ResultPoint = ve, o.StringUtils = ne, o.UnsupportedOperationException = Te, o.VideoInputDevice = re, o.WhiteRectangleDetector = an, o.WriterException = ct, o.ZXingArrays = Z, o.ZXingCharset = js, o.ZXingInteger = U, o.ZXingStandardCharsets = Ao, o.ZXingStringBuilder = me, o.ZXingStringEncoding = ye, o.ZXingSystem = M, o.createAbstractExpandedDecoder = Ls, Object.defineProperty(o, "__esModule", { value: !0 });
|
|
34632
34644
|
}));
|
|
34633
34645
|
})(oi, oi.exports)), oi.exports;
|
|
34634
34646
|
}
|
|
@@ -35672,19 +35684,19 @@ var g3 = (function() {
|
|
|
35672
35684
|
var P = {};
|
|
35673
35685
|
(!x || m.aspectRatio) && (P.aspectRatio = m.aspectRatio);
|
|
35674
35686
|
var j = {
|
|
35675
|
-
onRenderSurfaceReady: function(Z,
|
|
35676
|
-
_.setupUi(Z,
|
|
35687
|
+
onRenderSurfaceReady: function(Z, U) {
|
|
35688
|
+
_.setupUi(Z, U, m), _.isScanning = !0, _.foreverScan(m, c, g);
|
|
35677
35689
|
}
|
|
35678
35690
|
};
|
|
35679
35691
|
d3.failIfNotSupported().then(function(Z) {
|
|
35680
|
-
Z.create(M).then(function(
|
|
35681
|
-
return
|
|
35682
|
-
_.renderedCamera =
|
|
35683
|
-
}).catch(function(
|
|
35684
|
-
D.cancel(), R(
|
|
35692
|
+
Z.create(M).then(function(U) {
|
|
35693
|
+
return U.render(f.element, P, j).then(function(Q) {
|
|
35694
|
+
_.renderedCamera = Q, D.execute(), N(null);
|
|
35695
|
+
}).catch(function(Q) {
|
|
35696
|
+
D.cancel(), R(Q);
|
|
35685
35697
|
});
|
|
35686
|
-
}).catch(function(
|
|
35687
|
-
D.cancel(), R(Zr.errorGettingUserMedia(
|
|
35698
|
+
}).catch(function(U) {
|
|
35699
|
+
D.cancel(), R(Zr.errorGettingUserMedia(U));
|
|
35688
35700
|
});
|
|
35689
35701
|
}).catch(function(Z) {
|
|
35690
35702
|
D.cancel(), R(Zr.cameraStreamingNotSupported());
|
|
@@ -35749,14 +35761,14 @@ var g3 = (function() {
|
|
|
35749
35761
|
throw "Unable to get 2d context from canvas";
|
|
35750
35762
|
R.canvas.width = A, R.canvas.height = _, R.drawImage(g, 0, 0, m, v, D.x, D.y, D.width, D.height);
|
|
35751
35763
|
}
|
|
35752
|
-
var M = mn.FILE_SCAN_HIDDEN_CANVAS_PADDING, P = Math.max(g.width, D.width), j = Math.max(g.height, D.height), Z = P + 2 * M,
|
|
35753
|
-
x.appendChild(
|
|
35754
|
-
var Y =
|
|
35764
|
+
var M = mn.FILE_SCAN_HIDDEN_CANVAS_PADDING, P = Math.max(g.width, D.width), j = Math.max(g.height, D.height), Z = P + 2 * M, U = j + 2 * M, Q = c.createCanvasElement(Z, U);
|
|
35765
|
+
x.appendChild(Q);
|
|
35766
|
+
var Y = Q.getContext("2d");
|
|
35755
35767
|
if (!Y)
|
|
35756
35768
|
throw "Unable to get 2d context from canvas";
|
|
35757
|
-
Y.canvas.width = Z, Y.canvas.height =
|
|
35769
|
+
Y.canvas.width = Z, Y.canvas.height = U, Y.drawImage(g, 0, 0, m, v, M, M, P, j);
|
|
35758
35770
|
try {
|
|
35759
|
-
c.qrcode.decodeRobustlyAsync(
|
|
35771
|
+
c.qrcode.decodeRobustlyAsync(Q).then(function(z) {
|
|
35760
35772
|
u(Pl.createFromQrcodeResult(z));
|
|
35761
35773
|
}).catch(f);
|
|
35762
35774
|
} catch (z) {
|
|
@@ -36213,8 +36225,8 @@ function N3(t, r, o = {}) {
|
|
|
36213
36225
|
return j && j.$.subTree.shapeFlag === 16;
|
|
36214
36226
|
}
|
|
36215
36227
|
function _(P, j) {
|
|
36216
|
-
const Z = Ar(P),
|
|
36217
|
-
return
|
|
36228
|
+
const Z = Ar(P), U = Z.$.subTree && Z.$.subTree.children;
|
|
36229
|
+
return U == null || !Array.isArray(U) ? !1 : U.some((Q) => Q.el === j.target || j.composedPath().includes(Q.el));
|
|
36218
36230
|
}
|
|
36219
36231
|
const D = (P) => {
|
|
36220
36232
|
const j = si(t);
|
|
@@ -36818,7 +36830,7 @@ const W3 = { render: H3 }, j3 = /* @__PURE__ */ sn({
|
|
|
36818
36830
|
},
|
|
36819
36831
|
enabledToolsModifiers: {}
|
|
36820
36832
|
}),
|
|
36821
|
-
emits: /* @__PURE__ */ Vo(["before-ai-render"], ["update:fullscreen", "update:show", "update:selectedModelId", "update:genUiAble", "update:enabledTools"]),
|
|
36833
|
+
emits: /* @__PURE__ */ Vo(["before-ai-render", "chat-stream-finish"], ["update:fullscreen", "update:show", "update:selectedModelId", "update:genUiAble", "update:enabledTools"]),
|
|
36822
36834
|
setup(t, { expose: r, emit: o }) {
|
|
36823
36835
|
const c = t, u = o, f = vr(t, "fullscreen"), g = vr(t, "show"), m = vr(t, "selectedModelId"), v = vr(t, "genUiAble"), x = vr(t, "enabledTools"), A = c.llmConfigs ? Ri(c, "llmConfigs") : void 0, { selectedModel: _ } = Cd(A, m), D = dt(() => {
|
|
36824
36836
|
const He = A?.value?.length ? _.value : c.llmConfig;
|
|
@@ -36834,12 +36846,12 @@ const W3 = { render: H3 }, j3 = /* @__PURE__ */ sn({
|
|
|
36834
36846
|
selectedModel: _,
|
|
36835
36847
|
selectedModelId: m
|
|
36836
36848
|
}), {
|
|
36837
|
-
agent:
|
|
36838
|
-
customAgentProvider:
|
|
36849
|
+
agent: U,
|
|
36850
|
+
customAgentProvider: Q,
|
|
36839
36851
|
conversationState: Y,
|
|
36840
36852
|
messages: z,
|
|
36841
|
-
messageState:
|
|
36842
|
-
inputMessage:
|
|
36853
|
+
messageState: F,
|
|
36854
|
+
inputMessage: K,
|
|
36843
36855
|
abortRequest: I,
|
|
36844
36856
|
senderRef: Te,
|
|
36845
36857
|
sendMessage: ye,
|
|
@@ -36851,7 +36863,7 @@ const W3 = { render: H3 }, j3 = /* @__PURE__ */ sn({
|
|
|
36851
36863
|
createConversation: $,
|
|
36852
36864
|
switchConversation: ge,
|
|
36853
36865
|
deleteConversation: te,
|
|
36854
|
-
getCurrentConversation:
|
|
36866
|
+
getCurrentConversation: J
|
|
36855
36867
|
} = cy({
|
|
36856
36868
|
systemPrompt: c.systemPrompt || "",
|
|
36857
36869
|
llmConfig: c.llmConfig,
|
|
@@ -36860,30 +36872,30 @@ const W3 = { render: H3 }, j3 = /* @__PURE__ */ sn({
|
|
|
36860
36872
|
Rt(
|
|
36861
36873
|
() => c.systemPrompt,
|
|
36862
36874
|
(He) => {
|
|
36863
|
-
|
|
36875
|
+
Q.promptManager.setStatic(He);
|
|
36864
36876
|
}
|
|
36865
|
-
),
|
|
36877
|
+
), Q.isGenuiEnabled = v, Q.debugStream = c.debugStream;
|
|
36866
36878
|
const pe = Ri(c, "skills"), { processSkillMentions: de } = Rw({
|
|
36867
36879
|
skillsRef: pe,
|
|
36868
|
-
customAgentProvider:
|
|
36880
|
+
customAgentProvider: Q
|
|
36869
36881
|
}), re = async (He, ke) => ne(He, ke, de), { welcomeIcon: he, roles: It } = Fw({
|
|
36870
36882
|
props: c,
|
|
36871
36883
|
messages: z,
|
|
36872
|
-
messageState:
|
|
36873
|
-
inputMessage:
|
|
36884
|
+
messageState: F,
|
|
36885
|
+
inputMessage: K,
|
|
36874
36886
|
handleSendMessage: re
|
|
36875
36887
|
}), { showHistory: Ae, handleCreateConversation: Dt, handleHistorySelect: Ce, handleHistoryUpdateTitle: pn, handleHistoryDelete: ze } = Uw({
|
|
36876
36888
|
createConversation: $,
|
|
36877
36889
|
switchConversation: ge,
|
|
36878
36890
|
deleteConversation: te,
|
|
36879
|
-
getCurrentConversation:
|
|
36891
|
+
getCurrentConversation: J,
|
|
36880
36892
|
abortRequest: I,
|
|
36881
36893
|
conversationState: Y,
|
|
36882
|
-
customAgentProvider:
|
|
36894
|
+
customAgentProvider: Q
|
|
36883
36895
|
}), Yt = () => {
|
|
36884
36896
|
if (_.value) {
|
|
36885
36897
|
const He = _.value;
|
|
36886
|
-
|
|
36898
|
+
Q.updateLLMConfig({
|
|
36887
36899
|
model: He.model || "",
|
|
36888
36900
|
baseURL: He.baseURL || "",
|
|
36889
36901
|
genuiUrl: He.genuiUrl || "",
|
|
@@ -36897,7 +36909,7 @@ const W3 = { render: H3 }, j3 = /* @__PURE__ */ sn({
|
|
|
36897
36909
|
headers: He.headers
|
|
36898
36910
|
});
|
|
36899
36911
|
} else
|
|
36900
|
-
|
|
36912
|
+
Q.updateLLMConfig(Q.llmConfig);
|
|
36901
36913
|
};
|
|
36902
36914
|
c.llmConfigs && Rt(_, Yt, { immediate: !0 }), Rt(v, Yt, { immediate: !0 });
|
|
36903
36915
|
const ue = {
|
|
@@ -36916,7 +36928,7 @@ const W3 = { render: H3 }, j3 = /* @__PURE__ */ sn({
|
|
|
36916
36928
|
}
|
|
36917
36929
|
}
|
|
36918
36930
|
},
|
|
36919
|
-
generating: Wi.includes(
|
|
36931
|
+
generating: Wi.includes(F.status),
|
|
36920
36932
|
customComponents: c.genUiComponents,
|
|
36921
36933
|
requiredCompleteFieldSelectors: ["[componentName=TinyUser] > props > modelValue"]
|
|
36922
36934
|
}),
|
|
@@ -36942,10 +36954,10 @@ const W3 = { render: H3 }, j3 = /* @__PURE__ */ sn({
|
|
|
36942
36954
|
// 处理客户端断开连接
|
|
36943
36955
|
searchPlugin: er,
|
|
36944
36956
|
syncInstalledPluginTools: an
|
|
36945
|
-
} = Ow(
|
|
36957
|
+
} = Ow(U, x, Wl);
|
|
36946
36958
|
kw({
|
|
36947
36959
|
onToolCatalogChanged: async () => {
|
|
36948
|
-
await
|
|
36960
|
+
await U.refreshTools(), an();
|
|
36949
36961
|
}
|
|
36950
36962
|
}), be.value = [...Q3, ...c.customMarketMcpServers];
|
|
36951
36963
|
const tr = Xe([
|
|
@@ -36968,9 +36980,9 @@ const W3 = { render: H3 }, j3 = /* @__PURE__ */ sn({
|
|
|
36968
36980
|
AILogoUrl: c.AILogoUrl,
|
|
36969
36981
|
show: g,
|
|
36970
36982
|
addPluginFromScan: ve,
|
|
36971
|
-
inputMessage:
|
|
36983
|
+
inputMessage: K
|
|
36972
36984
|
}), Tt = async (He) => {
|
|
36973
|
-
if (await ht(
|
|
36985
|
+
if (await ht(K.value) || !P())
|
|
36974
36986
|
return;
|
|
36975
36987
|
const Je = await j();
|
|
36976
36988
|
try {
|
|
@@ -36979,14 +36991,14 @@ const W3 = { render: H3 }, j3 = /* @__PURE__ */ sn({
|
|
|
36979
36991
|
console.error("发送消息失败:", We);
|
|
36980
36992
|
}
|
|
36981
36993
|
}, fe = dt(
|
|
36982
|
-
() => Wi.includes(
|
|
36983
|
-
), Pt = dt(() => Wi.includes(
|
|
36984
|
-
|
|
36994
|
+
() => Wi.includes(F.status) ? ie[c.locale].thinking : ie[c.locale].placeholder
|
|
36995
|
+
), Pt = dt(() => Wi.includes(F.status)), st = (He) => {
|
|
36996
|
+
K.value = He.inputMessage;
|
|
36985
36997
|
};
|
|
36986
36998
|
Nr(), Vr(async () => {
|
|
36987
36999
|
setTimeout(() => {
|
|
36988
37000
|
Dt();
|
|
36989
|
-
}, 100),
|
|
37001
|
+
}, 100), U.onError = (ke) => {
|
|
36990
37002
|
ke && et(r_(ke));
|
|
36991
37003
|
};
|
|
36992
37004
|
const He = be.value.filter((ke) => ke.addState === "added" && ke.enabled);
|
|
@@ -36996,20 +37008,20 @@ const W3 = { render: H3 }, j3 = /* @__PURE__ */ sn({
|
|
|
36996
37008
|
for (const [ke, Je] of Object.entries(c.mcpServers))
|
|
36997
37009
|
await Kt(ke, Je);
|
|
36998
37010
|
});
|
|
36999
|
-
const { handleCustomAdd: _t } = Nw(
|
|
37011
|
+
const { handleCustomAdd: _t } = Nw(U, bt, Wl);
|
|
37000
37012
|
return r({
|
|
37001
37013
|
/** 大模型代理 */
|
|
37002
|
-
agent:
|
|
37014
|
+
agent: U,
|
|
37003
37015
|
/** 欢迎图标 */
|
|
37004
37016
|
welcomeIcon: he,
|
|
37005
37017
|
/** 对话消息 */
|
|
37006
37018
|
messages: z,
|
|
37007
37019
|
/** 对话消息状态 */
|
|
37008
|
-
messageState:
|
|
37020
|
+
messageState: F,
|
|
37009
37021
|
/** 对话卡片的角色配置 */
|
|
37010
37022
|
roles: It,
|
|
37011
37023
|
/** 输入框的文本 */
|
|
37012
|
-
inputMessage:
|
|
37024
|
+
inputMessage: K,
|
|
37013
37025
|
/** 输入框组件的实例 */
|
|
37014
37026
|
senderRef: Te,
|
|
37015
37027
|
/** 取消发送 */
|
|
@@ -37119,10 +37131,10 @@ const W3 = { render: H3 }, j3 = /* @__PURE__ */ sn({
|
|
|
37119
37131
|
ref_key: "senderRef",
|
|
37120
37132
|
ref: Te,
|
|
37121
37133
|
mode: "multiple",
|
|
37122
|
-
modelValue: xe(
|
|
37123
|
-
"onUpdate:modelValue": ke[9] || (ke[9] = (Je) => Hi(
|
|
37134
|
+
modelValue: xe(K),
|
|
37135
|
+
"onUpdate:modelValue": ke[9] || (ke[9] = (Je) => Hi(K) ? K.value = Je : null),
|
|
37124
37136
|
placeholder: fe.value,
|
|
37125
|
-
clearable: !!xe(
|
|
37137
|
+
clearable: !!xe(K),
|
|
37126
37138
|
loading: Pt.value,
|
|
37127
37139
|
showWordLimit: !0,
|
|
37128
37140
|
maxLength: 2e4,
|
|
@@ -37218,7 +37230,7 @@ const W3 = { render: H3 }, j3 = /* @__PURE__ */ sn({
|
|
|
37218
37230
|
items: xe(z),
|
|
37219
37231
|
roles: xe(It),
|
|
37220
37232
|
"auto-scroll": "",
|
|
37221
|
-
loading: xe(
|
|
37233
|
+
loading: xe(F).status === xe(C1).PROCESSING,
|
|
37222
37234
|
"loading-role": "assistant"
|
|
37223
37235
|
}, null, 8, ["items", "roles", "loading"]))
|
|
37224
37236
|
]),
|
|
@@ -37228,7 +37240,7 @@ const W3 = { render: H3 }, j3 = /* @__PURE__ */ sn({
|
|
|
37228
37240
|
_: 3
|
|
37229
37241
|
}, 8, ["show", "fullscreen", "style"]));
|
|
37230
37242
|
}
|
|
37231
|
-
}), Gl = /* @__PURE__ */ fr(u_, [["__scopeId", "data-v-
|
|
37243
|
+
}), Gl = /* @__PURE__ */ fr(u_, [["__scopeId", "data-v-3a0abc20"]]);
|
|
37232
37244
|
function O_(t) {
|
|
37233
37245
|
const r = t.sessionId ? Xl(t.sessionId, t.agentRoot) : [], o = new Ql({
|
|
37234
37246
|
llmConfig: t.llmConfig,
|