@epam/ai-dial-chat-hooks 1.1.0-dev.365 → 1.1.0-dev.372
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/catalog/usePublishFolders/usePublishFolders.d.ts +3 -1
- package/catalog/usePublishFolders/usePublishFolders.d.ts.map +1 -1
- package/conversation/useConversationStream/generation-resume.d.ts.map +1 -1
- package/files/useDialFileListing/useDialFileListing.d.ts.map +1 -1
- package/index.js +471 -470
- package/package.json +14 -14
package/index.js
CHANGED
|
@@ -13015,24 +13015,24 @@ var Ws = "SKILL.md", Gs = 1048576, Ks = 16777216, qs = 100, Js = new Set([".dial
|
|
|
13015
13015
|
i,
|
|
13016
13016
|
o
|
|
13017
13017
|
]);
|
|
13018
|
-
}, sl = "Production", cl = 50, ll = (e
|
|
13018
|
+
}, sl = "Production", cl = 50, ll = (e, t, n) => {
|
|
13019
13019
|
let r = e.get(t);
|
|
13020
13020
|
return r == null ? [] : r.filter((e) => e.nodeType === ke.Folder).map((r) => {
|
|
13021
13021
|
let i = H(r.name), a = [...n, i], o = `${t}${r.name}/`;
|
|
13022
13022
|
return {
|
|
13023
13023
|
path: a,
|
|
13024
13024
|
name: i,
|
|
13025
|
-
children: e.has(o) ?
|
|
13025
|
+
children: e.has(o) ? ll(e, o, a) : void 0
|
|
13026
13026
|
};
|
|
13027
13027
|
});
|
|
13028
|
-
},
|
|
13029
|
-
let [r, i] = L(() => /* @__PURE__ */ new Map()), [a, o] = L(() => /* @__PURE__ */ new Set()), [s, c] = L(() => /* @__PURE__ */ new Set()), l = F(() => {
|
|
13028
|
+
}, ul = ({ listPublicFiles: e, rememberedFolderKeys: t, onRememberedFolderKeysChange: n }) => {
|
|
13029
|
+
let [r, i] = L(() => /* @__PURE__ */ new Map()), [a, o] = L(() => /* @__PURE__ */ new Set()), [s, c] = L(() => /* @__PURE__ */ new Set()), [l, u] = L([]), d = F(() => {
|
|
13030
13030
|
let e = /* @__PURE__ */ new Set();
|
|
13031
13031
|
return a.forEach((t) => {
|
|
13032
13032
|
let n = t ? `${t}/` : "";
|
|
13033
13033
|
r.has(n) && e.add(t);
|
|
13034
13034
|
}), e;
|
|
13035
|
-
}, [a, r]),
|
|
13035
|
+
}, [a, r]), f = N(async (t) => {
|
|
13036
13036
|
c((e) => new Set(e).add(t));
|
|
13037
13037
|
try {
|
|
13038
13038
|
let { items: n } = await e({ path: t || void 0 });
|
|
@@ -13045,61 +13045,53 @@ var Ws = "SKILL.md", Gs = 1048576, Ks = 16777216, qs = 100, Js = new Set([".dial
|
|
|
13045
13045
|
}
|
|
13046
13046
|
}, [e]);
|
|
13047
13047
|
P(() => {
|
|
13048
|
-
|
|
13048
|
+
f("");
|
|
13049
13049
|
}, []);
|
|
13050
|
-
let
|
|
13050
|
+
let p = N((e) => {
|
|
13051
13051
|
o(e), e.forEach((e) => {
|
|
13052
13052
|
let t = `${e}/`;
|
|
13053
|
-
!r.has(t) && !s.has(t) &&
|
|
13053
|
+
!r.has(t) && !s.has(t) && f(t);
|
|
13054
13054
|
});
|
|
13055
13055
|
}, [
|
|
13056
13056
|
r,
|
|
13057
13057
|
s,
|
|
13058
|
-
|
|
13059
|
-
]),
|
|
13060
|
-
let n =
|
|
13061
|
-
|
|
13062
|
-
|
|
13063
|
-
name: t,
|
|
13064
|
-
path: o,
|
|
13065
|
-
folderId: `${a}/${o}`,
|
|
13066
|
-
nodeType: ke.Folder,
|
|
13067
|
-
bucket: a,
|
|
13068
|
-
parentPath: n || void 0
|
|
13069
|
-
};
|
|
13070
|
-
return i((e) => {
|
|
13071
|
-
let t = new Map(e);
|
|
13072
|
-
return t.set(n, [...t.get(n) ?? [], s]), t;
|
|
13073
|
-
}), Promise.resolve();
|
|
13074
|
-
}, [r]), p = N((e) => {
|
|
13058
|
+
f
|
|
13059
|
+
]), m = N((e, t) => {
|
|
13060
|
+
let n = Ge([...e, t]);
|
|
13061
|
+
return u((e) => e.includes(n) ? e : [...e, n]), Promise.resolve();
|
|
13062
|
+
}, []), h = N((e) => {
|
|
13075
13063
|
let r = Ge(e), i = Array.isArray(t) ? t : [];
|
|
13076
13064
|
!r || i.includes(r) || n?.([r, ...i].slice(0, cl));
|
|
13077
|
-
}, [t, n]),
|
|
13065
|
+
}, [t, n]), g = N((e) => !e.includes(sl), []);
|
|
13078
13066
|
return {
|
|
13079
13067
|
folderItems: F(() => {
|
|
13080
13068
|
let e = Array.isArray(t) ? t.filter((e) => typeof e == "string") : [];
|
|
13081
|
-
return We(
|
|
13082
|
-
}, [
|
|
13069
|
+
return We(ll(r, "", []), [...e.map(Ue), ...l.map(Ue)]);
|
|
13070
|
+
}, [
|
|
13071
|
+
r,
|
|
13072
|
+
t,
|
|
13073
|
+
l
|
|
13074
|
+
]),
|
|
13083
13075
|
expandedPaths: a,
|
|
13084
|
-
loadedPaths:
|
|
13076
|
+
loadedPaths: d,
|
|
13085
13077
|
loadingPaths: s,
|
|
13086
|
-
onExpandedPathsChange:
|
|
13087
|
-
onCreatePublishFolder:
|
|
13088
|
-
rememberPublishFolder:
|
|
13089
|
-
hasPublishWriteAccess:
|
|
13078
|
+
onExpandedPathsChange: p,
|
|
13079
|
+
onCreatePublishFolder: m,
|
|
13080
|
+
rememberPublishFolder: h,
|
|
13081
|
+
hasPublishWriteAccess: g
|
|
13090
13082
|
};
|
|
13091
13083
|
};
|
|
13092
13084
|
//#endregion
|
|
13093
13085
|
//#region ../../node_modules/dompurify/dist/purify.es.mjs
|
|
13094
|
-
function
|
|
13086
|
+
function dl(e, t) {
|
|
13095
13087
|
(t == null || t > e.length) && (t = e.length);
|
|
13096
13088
|
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
13097
13089
|
return r;
|
|
13098
13090
|
}
|
|
13099
|
-
function
|
|
13091
|
+
function fl(e) {
|
|
13100
13092
|
if (Array.isArray(e)) return e;
|
|
13101
13093
|
}
|
|
13102
|
-
function
|
|
13094
|
+
function pl(e, t) {
|
|
13103
13095
|
var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
13104
13096
|
if (n != null) {
|
|
13105
13097
|
var r, i, a, o, s = [], c = !0, l = !1;
|
|
@@ -13117,113 +13109,113 @@ function ml(e, t) {
|
|
|
13117
13109
|
return s;
|
|
13118
13110
|
}
|
|
13119
13111
|
}
|
|
13120
|
-
function
|
|
13112
|
+
function ml() {
|
|
13121
13113
|
throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
13122
13114
|
}
|
|
13123
|
-
function
|
|
13124
|
-
return
|
|
13115
|
+
function hl(e, t) {
|
|
13116
|
+
return fl(e) || pl(e, t) || gl(e, t) || ml();
|
|
13125
13117
|
}
|
|
13126
|
-
function
|
|
13118
|
+
function gl(e, t) {
|
|
13127
13119
|
if (e) {
|
|
13128
|
-
if (typeof e == "string") return
|
|
13120
|
+
if (typeof e == "string") return dl(e, t);
|
|
13129
13121
|
var n = {}.toString.call(e).slice(8, -1);
|
|
13130
|
-
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ?
|
|
13122
|
+
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? dl(e, t) : void 0;
|
|
13131
13123
|
}
|
|
13132
13124
|
}
|
|
13133
|
-
var
|
|
13134
|
-
|
|
13125
|
+
var _l = Object.entries, vl = Object.setPrototypeOf, yl = Object.isFrozen, bl = Object.getPrototypeOf, xl = Object.getOwnPropertyDescriptor, Sl = Object.freeze, Cl = Object.seal, wl = Object.create, Tl = typeof Reflect < "u" && Reflect, El = Tl.apply, Dl = Tl.construct;
|
|
13126
|
+
Sl ||= function(e) {
|
|
13135
13127
|
return e;
|
|
13136
|
-
},
|
|
13128
|
+
}, Cl ||= function(e) {
|
|
13137
13129
|
return e;
|
|
13138
|
-
},
|
|
13130
|
+
}, El ||= function(e, t) {
|
|
13139
13131
|
var n = [...arguments].slice(2);
|
|
13140
13132
|
return e.apply(t, n);
|
|
13141
|
-
},
|
|
13133
|
+
}, Dl ||= function(e) {
|
|
13142
13134
|
return new e(...[...arguments].slice(1));
|
|
13143
13135
|
};
|
|
13144
|
-
var
|
|
13136
|
+
var Ol = X(Array.prototype.forEach), kl = X(Array.prototype.lastIndexOf), Al = X(Array.prototype.pop), jl = X(Array.prototype.push), Ml = X(Array.prototype.splice), Nl = Array.isArray, Pl = X(String.prototype.toLowerCase), Fl = X(String.prototype.toString), Il = X(String.prototype.match), Ll = X(String.prototype.replace), Rl = X(String.prototype.indexOf), zl = X(String.prototype.trim), Bl = X(Number.prototype.toString), Vl = X(Boolean.prototype.toString), Hl = typeof BigInt > "u" ? null : X(BigInt.prototype.toString), Ul = typeof Symbol > "u" ? null : X(Symbol.prototype.toString), J = X(Object.prototype.hasOwnProperty), Wl = X(Object.prototype.toString), Y = X(RegExp.prototype.test), Gl = Kl(TypeError);
|
|
13145
13137
|
function X(e) {
|
|
13146
13138
|
return function(t) {
|
|
13147
13139
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
13148
13140
|
var n = [...arguments].slice(1);
|
|
13149
|
-
return
|
|
13141
|
+
return El(e, t, n);
|
|
13150
13142
|
};
|
|
13151
13143
|
}
|
|
13152
|
-
function
|
|
13144
|
+
function Kl(e) {
|
|
13153
13145
|
return function() {
|
|
13154
|
-
return
|
|
13146
|
+
return Dl(e, [...arguments]);
|
|
13155
13147
|
};
|
|
13156
13148
|
}
|
|
13157
13149
|
function Z(e, t) {
|
|
13158
|
-
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
13159
|
-
if (
|
|
13150
|
+
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Pl;
|
|
13151
|
+
if (vl && vl(e, null), !Nl(t)) return e;
|
|
13160
13152
|
let r = t.length;
|
|
13161
13153
|
for (; r--;) {
|
|
13162
13154
|
let i = t[r];
|
|
13163
13155
|
if (typeof i == "string") {
|
|
13164
13156
|
let e = n(i);
|
|
13165
|
-
e !== i && (
|
|
13157
|
+
e !== i && (yl(t) || (t[r] = e), i = e);
|
|
13166
13158
|
}
|
|
13167
13159
|
e[i] = !0;
|
|
13168
13160
|
}
|
|
13169
13161
|
return e;
|
|
13170
13162
|
}
|
|
13171
|
-
function
|
|
13163
|
+
function ql(e) {
|
|
13172
13164
|
for (let t = 0; t < e.length; t++) J(e, t) || (e[t] = null);
|
|
13173
13165
|
return e;
|
|
13174
13166
|
}
|
|
13175
|
-
function
|
|
13176
|
-
let t =
|
|
13177
|
-
for (let r of
|
|
13178
|
-
var n =
|
|
13167
|
+
function Jl(e) {
|
|
13168
|
+
let t = wl(null);
|
|
13169
|
+
for (let r of _l(e)) {
|
|
13170
|
+
var n = hl(r, 2);
|
|
13179
13171
|
let i = n[0], a = n[1];
|
|
13180
|
-
J(e, i) && (
|
|
13172
|
+
J(e, i) && (Nl(a) ? t[i] = ql(a) : a && typeof a == "object" && a.constructor === Object ? t[i] = Jl(a) : t[i] = a);
|
|
13181
13173
|
}
|
|
13182
13174
|
return t;
|
|
13183
13175
|
}
|
|
13184
|
-
function
|
|
13176
|
+
function Yl(e) {
|
|
13185
13177
|
switch (typeof e) {
|
|
13186
13178
|
case "string": return e;
|
|
13187
|
-
case "number": return
|
|
13188
|
-
case "boolean": return
|
|
13189
|
-
case "bigint": return
|
|
13190
|
-
case "symbol": return
|
|
13191
|
-
case "undefined": return
|
|
13179
|
+
case "number": return Bl(e);
|
|
13180
|
+
case "boolean": return Vl(e);
|
|
13181
|
+
case "bigint": return Hl ? Hl(e) : "0";
|
|
13182
|
+
case "symbol": return Ul ? Ul(e) : "Symbol()";
|
|
13183
|
+
case "undefined": return Wl(e);
|
|
13192
13184
|
case "function":
|
|
13193
13185
|
case "object": {
|
|
13194
|
-
if (e === null) return
|
|
13195
|
-
let t = e, n =
|
|
13186
|
+
if (e === null) return Wl(e);
|
|
13187
|
+
let t = e, n = Xl(t, "toString");
|
|
13196
13188
|
if (typeof n == "function") {
|
|
13197
13189
|
let e = n(t);
|
|
13198
|
-
return typeof e == "string" ? e :
|
|
13190
|
+
return typeof e == "string" ? e : Wl(e);
|
|
13199
13191
|
}
|
|
13200
|
-
return
|
|
13192
|
+
return Wl(e);
|
|
13201
13193
|
}
|
|
13202
|
-
default: return
|
|
13194
|
+
default: return Wl(e);
|
|
13203
13195
|
}
|
|
13204
13196
|
}
|
|
13205
|
-
function
|
|
13197
|
+
function Xl(e, t) {
|
|
13206
13198
|
for (; e !== null;) {
|
|
13207
|
-
let n =
|
|
13199
|
+
let n = xl(e, t);
|
|
13208
13200
|
if (n) {
|
|
13209
13201
|
if (n.get) return X(n.get);
|
|
13210
13202
|
if (typeof n.value == "function") return X(n.value);
|
|
13211
13203
|
}
|
|
13212
|
-
e =
|
|
13204
|
+
e = bl(e);
|
|
13213
13205
|
}
|
|
13214
13206
|
function n() {
|
|
13215
13207
|
return null;
|
|
13216
13208
|
}
|
|
13217
13209
|
return n;
|
|
13218
13210
|
}
|
|
13219
|
-
function
|
|
13211
|
+
function Zl(e) {
|
|
13220
13212
|
try {
|
|
13221
13213
|
return Y(e, ""), !0;
|
|
13222
13214
|
} catch {
|
|
13223
13215
|
return !1;
|
|
13224
13216
|
}
|
|
13225
13217
|
}
|
|
13226
|
-
var
|
|
13218
|
+
var Ql = Sl(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")), $l = Sl(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), eu = Sl([
|
|
13227
13219
|
"feBlend",
|
|
13228
13220
|
"feColorMatrix",
|
|
13229
13221
|
"feComponentTransfer",
|
|
@@ -13249,7 +13241,7 @@ var $l = Cl(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.b
|
|
|
13249
13241
|
"feSpotLight",
|
|
13250
13242
|
"feTile",
|
|
13251
13243
|
"feTurbulence"
|
|
13252
|
-
]),
|
|
13244
|
+
]), tu = Sl([
|
|
13253
13245
|
"animate",
|
|
13254
13246
|
"color-profile",
|
|
13255
13247
|
"cursor",
|
|
@@ -13272,7 +13264,7 @@ var $l = Cl(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.b
|
|
|
13272
13264
|
"solidcolor",
|
|
13273
13265
|
"unknown",
|
|
13274
13266
|
"use"
|
|
13275
|
-
]),
|
|
13267
|
+
]), nu = Sl(/* @__PURE__ */ "math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")), ru = Sl([
|
|
13276
13268
|
"maction",
|
|
13277
13269
|
"maligngroup",
|
|
13278
13270
|
"malignmark",
|
|
@@ -13288,13 +13280,13 @@ var $l = Cl(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.b
|
|
|
13288
13280
|
"annotation-xml",
|
|
13289
13281
|
"mprescripts",
|
|
13290
13282
|
"none"
|
|
13291
|
-
]),
|
|
13283
|
+
]), iu = Sl(["#text"]), au = Sl(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), ou = Sl(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), su = Sl(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), cu = Sl([
|
|
13292
13284
|
"xlink:href",
|
|
13293
13285
|
"xml:id",
|
|
13294
13286
|
"xlink:title",
|
|
13295
13287
|
"xml:space",
|
|
13296
13288
|
"xmlns:xlink"
|
|
13297
|
-
]),
|
|
13289
|
+
]), lu = Cl(/{{[\w\W]*|^[\w\W]*}}/g), uu = Cl(/<%[\w\W]*|^[\w\W]*%>/g), du = Cl(/\${[\w\W]*/g), fu = Cl(/^data-[\-\w.\u00B7-\uFFFF]+$/), pu = Cl(/^aria-[\-\w]+$/), mu = Cl(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), hu = Cl(/^(?:\w+script|data):/i), gu = Cl(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), _u = Cl(/^html$/i), vu = Cl(/^[a-z][.\w]*(-[.\w]+)+$/i), yu = Cl(/<[/\w!]/g), bu = Cl(/<[/\w]/g), xu = Cl(/<\/no(script|embed|frames)/i), Su = Cl(/\/>/i), Cu = {
|
|
13298
13290
|
element: 1,
|
|
13299
13291
|
attribute: 2,
|
|
13300
13292
|
text: 3,
|
|
@@ -13307,9 +13299,9 @@ var $l = Cl(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.b
|
|
|
13307
13299
|
documentType: 10,
|
|
13308
13300
|
documentFragment: 11,
|
|
13309
13301
|
notation: 12
|
|
13310
|
-
},
|
|
13302
|
+
}, wu = function() {
|
|
13311
13303
|
return typeof window > "u" ? null : window;
|
|
13312
|
-
},
|
|
13304
|
+
}, Tu = function(e, t) {
|
|
13313
13305
|
if (typeof e != "object" || typeof e.createPolicy != "function") return null;
|
|
13314
13306
|
let n = null, r = "data-tt-policy-suffix";
|
|
13315
13307
|
t && t.hasAttribute(r) && (n = t.getAttribute(r));
|
|
@@ -13326,7 +13318,7 @@ var $l = Cl(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.b
|
|
|
13326
13318
|
} catch {
|
|
13327
13319
|
return console.warn("TrustedTypes policy " + i + " could not be created."), null;
|
|
13328
13320
|
}
|
|
13329
|
-
},
|
|
13321
|
+
}, Eu = function() {
|
|
13330
13322
|
return {
|
|
13331
13323
|
afterSanitizeAttributes: [],
|
|
13332
13324
|
afterSanitizeElements: [],
|
|
@@ -13338,23 +13330,23 @@ var $l = Cl(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.b
|
|
|
13338
13330
|
uponSanitizeElement: [],
|
|
13339
13331
|
uponSanitizeShadowNode: []
|
|
13340
13332
|
};
|
|
13341
|
-
},
|
|
13342
|
-
return J(e, t) &&
|
|
13333
|
+
}, Du = function(e, t, n, r) {
|
|
13334
|
+
return J(e, t) && Nl(e[t]) ? Z(r.base ? Jl(r.base) : {}, e[t], r.transform) : n;
|
|
13343
13335
|
};
|
|
13344
|
-
function
|
|
13345
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
13346
|
-
if (t.version = "3.4.13", t.removed = [], !e || !e.document || e.document.nodeType !==
|
|
13336
|
+
function Ou() {
|
|
13337
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : wu(), t = (e) => Ou(e);
|
|
13338
|
+
if (t.version = "3.4.13", t.removed = [], !e || !e.document || e.document.nodeType !== Cu.document || !e.Element) return t.isSupported = !1, t;
|
|
13347
13339
|
let n = e.document, r = n, i = r.currentScript;
|
|
13348
13340
|
e.DocumentFragment;
|
|
13349
13341
|
let a = e.HTMLTemplateElement, o = e.Node, s = e.Element, c = e.NodeFilter;
|
|
13350
13342
|
e.NamedNodeMap === void 0 && (e.NamedNodeMap || e.MozNamedAttrMap), e.HTMLFormElement;
|
|
13351
|
-
let l = e.DOMParser, u = e.trustedTypes, d = s.prototype, f =
|
|
13343
|
+
let l = e.DOMParser, u = e.trustedTypes, d = s.prototype, f = Xl(d, "cloneNode"), p = Xl(d, "remove"), m = Xl(d, "nextSibling"), h = Xl(d, "childNodes"), g = Xl(d, "parentNode"), _ = Xl(d, "shadowRoot"), v = Xl(d, "attributes"), y = o && o.prototype ? Xl(o.prototype, "nodeType") : null, b = o && o.prototype ? Xl(o.prototype, "nodeName") : null, x = o && o.prototype ? Xl(o.prototype, "ownerDocument") : null;
|
|
13352
13344
|
if (typeof a == "function") {
|
|
13353
13345
|
let e = n.createElement("template");
|
|
13354
13346
|
e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
|
|
13355
13347
|
}
|
|
13356
13348
|
let S, C = "", w, T = !1, E = 0, D = function() {
|
|
13357
|
-
if (E > 0) throw
|
|
13349
|
+
if (E > 0) throw Gl("A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the \"DOMPurify and Trusted Types\" section of the README.");
|
|
13358
13350
|
}, O = function(e) {
|
|
13359
13351
|
D(), E++;
|
|
13360
13352
|
try {
|
|
@@ -13370,21 +13362,21 @@ function ku() {
|
|
|
13370
13362
|
E--;
|
|
13371
13363
|
}
|
|
13372
13364
|
}, te = function() {
|
|
13373
|
-
return T ||= (w =
|
|
13374
|
-
}, ne = n, re = ne.implementation, ie = ne.createNodeIterator, k = ne.createDocumentFragment, ae = ne.getElementsByTagName, oe = r.importNode, A =
|
|
13375
|
-
t.isSupported = typeof
|
|
13376
|
-
let se =
|
|
13365
|
+
return T ||= (w = Tu(u, i), !0), w;
|
|
13366
|
+
}, ne = n, re = ne.implementation, ie = ne.createNodeIterator, k = ne.createDocumentFragment, ae = ne.getElementsByTagName, oe = r.importNode, A = Eu();
|
|
13367
|
+
t.isSupported = typeof _l == "function" && typeof g == "function" && re && re.createHTMLDocument !== void 0;
|
|
13368
|
+
let se = lu, ce = uu, le = du, ue = fu, de = pu, fe = hu, pe = gu, me = vu, he = mu, j = null, ge = Z({}, [
|
|
13369
|
+
...Ql,
|
|
13377
13370
|
...$l,
|
|
13378
13371
|
...eu,
|
|
13379
|
-
...
|
|
13380
|
-
...
|
|
13381
|
-
...au
|
|
13372
|
+
...nu,
|
|
13373
|
+
...iu
|
|
13382
13374
|
]), M = null, _e = Z({}, [
|
|
13375
|
+
...au,
|
|
13383
13376
|
...ou,
|
|
13384
13377
|
...su,
|
|
13385
|
-
...cu
|
|
13386
|
-
|
|
13387
|
-
]), N = Object.seal(Tl(null, {
|
|
13378
|
+
...cu
|
|
13379
|
+
]), N = Object.seal(wl(null, {
|
|
13388
13380
|
tagNameCheck: {
|
|
13389
13381
|
writable: !0,
|
|
13390
13382
|
configurable: !1,
|
|
@@ -13403,7 +13395,7 @@ function ku() {
|
|
|
13403
13395
|
enumerable: !0,
|
|
13404
13396
|
value: !1
|
|
13405
13397
|
}
|
|
13406
|
-
})), P = null, ve = null, F = Object.seal(
|
|
13398
|
+
})), P = null, ve = null, F = Object.seal(wl(null, {
|
|
13407
13399
|
tagCheck: {
|
|
13408
13400
|
writable: !0,
|
|
13409
13401
|
configurable: !1,
|
|
@@ -13442,13 +13434,13 @@ function ku() {
|
|
|
13442
13434
|
Ue,
|
|
13443
13435
|
We,
|
|
13444
13436
|
Ge
|
|
13445
|
-
],
|
|
13437
|
+
], Fl), R = Sl([
|
|
13446
13438
|
"mi",
|
|
13447
13439
|
"mo",
|
|
13448
13440
|
"mn",
|
|
13449
13441
|
"ms",
|
|
13450
13442
|
"mtext"
|
|
13451
|
-
]), Xe = Z({}, R), z =
|
|
13443
|
+
]), Xe = Z({}, R), z = Sl(["annotation-xml"]), B = Z({}, z), Ze = Z({}, [
|
|
13452
13444
|
"title",
|
|
13453
13445
|
"style",
|
|
13454
13446
|
"font",
|
|
@@ -13459,21 +13451,21 @@ function ku() {
|
|
|
13459
13451
|
}, rt = function() {
|
|
13460
13452
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
13461
13453
|
if (et && et === e) return;
|
|
13462
|
-
(!e || typeof e != "object") && (e = {}), e =
|
|
13454
|
+
(!e || typeof e != "object") && (e = {}), e = Jl(e), Qe = $e.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, V = Qe === "application/xhtml+xml" ? Fl : Pl, j = Du(e, "ALLOWED_TAGS", ge, { transform: V }), M = Du(e, "ALLOWED_ATTR", _e, { transform: V }), Je = Du(e, "ALLOWED_NAMESPACES", Ye, { transform: Fl }), Ve = Du(e, "ADD_URI_SAFE_ATTR", He, {
|
|
13463
13455
|
transform: V,
|
|
13464
13456
|
base: He
|
|
13465
|
-
}), ze =
|
|
13457
|
+
}), ze = Du(e, "ADD_DATA_URI_TAGS", Be, {
|
|
13466
13458
|
transform: V,
|
|
13467
13459
|
base: Be
|
|
13468
|
-
}), Le =
|
|
13469
|
-
let t = J(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ?
|
|
13470
|
-
if (N =
|
|
13460
|
+
}), Le = Du(e, "FORBID_CONTENTS", Re, { transform: V }), P = Du(e, "FORBID_TAGS", Jl({}), { transform: V }), ve = Du(e, "FORBID_ATTR", Jl({}), { transform: V }), Ie = J(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? Jl(e.USE_PROFILES) : e.USE_PROFILES : !1, I = e.ALLOW_ARIA_ATTR !== !1, L = e.ALLOW_DATA_ATTR !== !1, ye = e.ALLOW_UNKNOWN_PROTOCOLS || !1, be = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, xe = e.SAFE_FOR_TEMPLATES || !1, Se = e.SAFE_FOR_XML !== !1, Ce = e.WHOLE_DOCUMENT || !1, Oe = e.RETURN_DOM || !1, ke = e.RETURN_DOM_FRAGMENT || !1, Ae = e.RETURN_TRUSTED_TYPE || !1, De = e.FORCE_BODY || !1, je = e.SANITIZE_DOM !== !1, Me = e.SANITIZE_NAMED_PROPS || !1, Pe = e.KEEP_CONTENT !== !1, Fe = e.IN_PLACE || !1, he = Zl(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : mu, Ke = typeof e.NAMESPACE == "string" ? e.NAMESPACE : Ge, Xe = J(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? Jl(e.MATHML_TEXT_INTEGRATION_POINTS) : Z({}, R), B = J(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? Jl(e.HTML_INTEGRATION_POINTS) : Z({}, z);
|
|
13461
|
+
let t = J(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? Jl(e.CUSTOM_ELEMENT_HANDLING) : wl(null);
|
|
13462
|
+
if (N = wl(null), J(t, "tagNameCheck") && nt(t.tagNameCheck) && (N.tagNameCheck = t.tagNameCheck), J(t, "attributeNameCheck") && nt(t.attributeNameCheck) && (N.attributeNameCheck = t.attributeNameCheck), J(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (N.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), Cl(N), xe && (L = !1), ke && (Oe = !0), Ie && (j = Z({}, iu), M = wl(null), Ie.html === !0 && (Z(j, Ql), Z(M, au)), Ie.svg === !0 && (Z(j, $l), Z(M, ou), Z(M, cu)), Ie.svgFilters === !0 && (Z(j, eu), Z(M, ou), Z(M, cu)), Ie.mathMl === !0 && (Z(j, nu), Z(M, su), Z(M, cu))), F.tagCheck = null, F.attributeCheck = null, J(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? F.tagCheck = e.ADD_TAGS : Nl(e.ADD_TAGS) && (j === ge && (j = Jl(j)), Z(j, e.ADD_TAGS, V))), J(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? F.attributeCheck = e.ADD_ATTR : Nl(e.ADD_ATTR) && (M === _e && (M = Jl(M)), Z(M, e.ADD_ATTR, V))), J(e, "ADD_URI_SAFE_ATTR") && Nl(e.ADD_URI_SAFE_ATTR) && Z(Ve, e.ADD_URI_SAFE_ATTR, V), J(e, "FORBID_CONTENTS") && Nl(e.FORBID_CONTENTS) && (Le === Re && (Le = Jl(Le)), Z(Le, e.FORBID_CONTENTS, V)), J(e, "ADD_FORBID_CONTENTS") && Nl(e.ADD_FORBID_CONTENTS) && (Le === Re && (Le = Jl(Le)), Z(Le, e.ADD_FORBID_CONTENTS, V)), Pe && (j["#text"] = !0), Ce && Z(j, [
|
|
13471
13463
|
"html",
|
|
13472
13464
|
"head",
|
|
13473
13465
|
"body"
|
|
13474
13466
|
]), j.table && (Z(j, ["tbody"]), delete P.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
13475
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw
|
|
13476
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw
|
|
13467
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw Gl("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
|
|
13468
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Gl("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
|
|
13477
13469
|
let t = S;
|
|
13478
13470
|
S = e.TRUSTED_TYPES_POLICY;
|
|
13479
13471
|
try {
|
|
@@ -13482,12 +13474,12 @@ function ku() {
|
|
|
13482
13474
|
throw S = t, e;
|
|
13483
13475
|
}
|
|
13484
13476
|
} else e.TRUSTED_TYPES_POLICY === null ? (S = void 0, C = "") : (S === void 0 && (S = te()), S && typeof C == "string" && (C = O("")));
|
|
13485
|
-
|
|
13477
|
+
Sl && Sl(e), et = e;
|
|
13486
13478
|
}, it = Z({}, [
|
|
13479
|
+
...$l,
|
|
13487
13480
|
...eu,
|
|
13488
|
-
...tu
|
|
13489
|
-
|
|
13490
|
-
]), at = Z({}, [...ru, ...iu]), ot = function(e, t, n) {
|
|
13481
|
+
...tu
|
|
13482
|
+
]), at = Z({}, [...nu, ...ru]), ot = function(e, t, n) {
|
|
13491
13483
|
return t.namespaceURI === Ge ? e === "svg" : t.namespaceURI === Ue ? e === "svg" && (n === "annotation-xml" || Xe[n]) : !!it[e];
|
|
13492
13484
|
}, st = function(e, t, n) {
|
|
13493
13485
|
return t.namespaceURI === Ge ? e === "math" : t.namespaceURI === We ? e === "math" && B[n] : !!at[e];
|
|
@@ -13499,23 +13491,23 @@ function ku() {
|
|
|
13499
13491
|
namespaceURI: Ke,
|
|
13500
13492
|
tagName: "template"
|
|
13501
13493
|
});
|
|
13502
|
-
let n =
|
|
13494
|
+
let n = Pl(e.tagName), r = Pl(t.tagName);
|
|
13503
13495
|
return Je[e.namespaceURI] ? e.namespaceURI === We ? ot(n, t, r) : e.namespaceURI === Ue ? st(n, t, r) : e.namespaceURI === Ge ? ct(n, t, r) : !!(Qe === "application/xhtml+xml" && Je[e.namespaceURI]) : !1;
|
|
13504
13496
|
}, ut = function(e) {
|
|
13505
|
-
|
|
13497
|
+
jl(t.removed, { element: e });
|
|
13506
13498
|
try {
|
|
13507
13499
|
g(e).removeChild(e);
|
|
13508
13500
|
} catch {
|
|
13509
|
-
if (p(e), !g(e)) throw
|
|
13501
|
+
if (p(e), !g(e)) throw Gl("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
13510
13502
|
}
|
|
13511
13503
|
}, dt = function(e) {
|
|
13512
13504
|
mt(e);
|
|
13513
13505
|
let t = h(e);
|
|
13514
13506
|
if (t) {
|
|
13515
13507
|
let e = [];
|
|
13516
|
-
|
|
13517
|
-
|
|
13518
|
-
}),
|
|
13508
|
+
Ol(t, (t) => {
|
|
13509
|
+
jl(e, t);
|
|
13510
|
+
}), Ol(e, (e) => {
|
|
13519
13511
|
try {
|
|
13520
13512
|
p(e);
|
|
13521
13513
|
} catch {}
|
|
@@ -13530,12 +13522,12 @@ function ku() {
|
|
|
13530
13522
|
}
|
|
13531
13523
|
}, ft = function(e, n) {
|
|
13532
13524
|
try {
|
|
13533
|
-
|
|
13525
|
+
jl(t.removed, {
|
|
13534
13526
|
attribute: n.getAttributeNode(e),
|
|
13535
13527
|
from: n
|
|
13536
13528
|
});
|
|
13537
13529
|
} catch {
|
|
13538
|
-
|
|
13530
|
+
jl(t.removed, {
|
|
13539
13531
|
attribute: null,
|
|
13540
13532
|
from: n
|
|
13541
13533
|
});
|
|
@@ -13558,7 +13550,7 @@ function ku() {
|
|
|
13558
13550
|
let t = [e];
|
|
13559
13551
|
for (; t.length > 0;) {
|
|
13560
13552
|
let e = t.pop();
|
|
13561
|
-
(y ? y(e) : e.nodeType) ===
|
|
13553
|
+
(y ? y(e) : e.nodeType) === Cu.element && pt(e);
|
|
13562
13554
|
let n = h(e);
|
|
13563
13555
|
if (n) for (let e = n.length - 1; e >= 0; --e) t.push(n[e]);
|
|
13564
13556
|
}
|
|
@@ -13567,13 +13559,13 @@ function ku() {
|
|
|
13567
13559
|
let t = [e];
|
|
13568
13560
|
for (; t.length > 0;) {
|
|
13569
13561
|
let e = t.pop(), n = y ? y(e) : e.nodeType;
|
|
13570
|
-
if (n ===
|
|
13562
|
+
if (n === Cu.processingInstruction || n === Cu.comment && Y(bu, e.data)) {
|
|
13571
13563
|
try {
|
|
13572
13564
|
p(e);
|
|
13573
13565
|
} catch {}
|
|
13574
13566
|
continue;
|
|
13575
13567
|
}
|
|
13576
|
-
if (n ===
|
|
13568
|
+
if (n === Cu.element) {
|
|
13577
13569
|
let t = e, n = V(b ? b(e) : e.nodeName);
|
|
13578
13570
|
try {
|
|
13579
13571
|
t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") && n !== "label" && n !== "output" && t.removeAttribute("for");
|
|
@@ -13586,7 +13578,7 @@ function ku() {
|
|
|
13586
13578
|
let t = null, r = null;
|
|
13587
13579
|
if (De) e = "<remove></remove>" + e;
|
|
13588
13580
|
else {
|
|
13589
|
-
let t =
|
|
13581
|
+
let t = Il(e, /^[\r\n\t ]+/);
|
|
13590
13582
|
r = t && t[0];
|
|
13591
13583
|
}
|
|
13592
13584
|
Qe === "application/xhtml+xml" && Ke === Ge && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
|
|
@@ -13606,13 +13598,13 @@ function ku() {
|
|
|
13606
13598
|
let t = x ? x(e) : e.ownerDocument;
|
|
13607
13599
|
return ie.call(t || e, e, c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION, null);
|
|
13608
13600
|
}, vt = function(e) {
|
|
13609
|
-
return e =
|
|
13601
|
+
return e = Ll(e, se, " "), e = Ll(e, ce, " "), e = Ll(e, le, " "), e;
|
|
13610
13602
|
}, yt = function(e) {
|
|
13611
13603
|
e.normalize();
|
|
13612
13604
|
let t = x ? x(e) : e.ownerDocument, n = ie.call(t || e, e, c.SHOW_TEXT | c.SHOW_COMMENT | c.SHOW_CDATA_SECTION | c.SHOW_PROCESSING_INSTRUCTION, null), r = n.nextNode();
|
|
13613
13605
|
for (; r;) r.data = vt(r.data), r = n.nextNode();
|
|
13614
13606
|
let i = e.querySelectorAll?.call(e, "template");
|
|
13615
|
-
i &&
|
|
13607
|
+
i && Ol(i, (e) => {
|
|
13616
13608
|
xt(e.content) && yt(e.content);
|
|
13617
13609
|
});
|
|
13618
13610
|
}, bt = function(e) {
|
|
@@ -13621,7 +13613,7 @@ function ku() {
|
|
|
13621
13613
|
}, xt = function(e) {
|
|
13622
13614
|
if (!y || typeof e != "object" || !e) return !1;
|
|
13623
13615
|
try {
|
|
13624
|
-
return y(e) ===
|
|
13616
|
+
return y(e) === Cu.documentFragment;
|
|
13625
13617
|
} catch {
|
|
13626
13618
|
return !1;
|
|
13627
13619
|
}
|
|
@@ -13634,12 +13626,12 @@ function ku() {
|
|
|
13634
13626
|
}
|
|
13635
13627
|
};
|
|
13636
13628
|
function Ct(e, n, r) {
|
|
13637
|
-
e.length !== 0 &&
|
|
13629
|
+
e.length !== 0 && Ol(e, (e) => {
|
|
13638
13630
|
e.call(t, n, r, et);
|
|
13639
13631
|
});
|
|
13640
13632
|
}
|
|
13641
13633
|
let wt = function(e, t) {
|
|
13642
|
-
return !!(Se && e.hasChildNodes() && !St(e.firstElementChild) && Y(
|
|
13634
|
+
return !!(Se && e.hasChildNodes() && !St(e.firstElementChild) && Y(yu, e.textContent) && Y(yu, e.innerHTML) || Se && e.namespaceURI === Ge && t === "style" && St(e.firstElementChild) || e.nodeType === Cu.processingInstruction || Se && e.nodeType === Cu.comment && Y(bu, e.data));
|
|
13643
13635
|
}, Tt = function(e, t, n) {
|
|
13644
13636
|
if (!P[t] && kt(t) && (N.tagNameCheck instanceof RegExp && Y(N.tagNameCheck, t) || N.tagNameCheck instanceof Function && N.tagNameCheck(t))) return !1;
|
|
13645
13637
|
if (Pe && !Le[t]) {
|
|
@@ -13654,7 +13646,7 @@ function ku() {
|
|
|
13654
13646
|
}
|
|
13655
13647
|
return ut(e), !0;
|
|
13656
13648
|
}, H = function(e, t, n, r) {
|
|
13657
|
-
return e.length === 0 ? t : t === n || t === r ?
|
|
13649
|
+
return e.length === 0 ? t : t === n || t === r ? Jl(t) : t;
|
|
13658
13650
|
}, Et = function(e, n) {
|
|
13659
13651
|
if (Ct(A.beforeSanitizeElements, e, null), e !== n && g(e) === null) return Fe && mt(e), !0;
|
|
13660
13652
|
if (bt(e)) return ut(e), !0;
|
|
@@ -13668,10 +13660,10 @@ function ku() {
|
|
|
13668
13660
|
let t = Tt(e, r, n);
|
|
13669
13661
|
return t === !1 && Ct(A.afterSanitizeElements, e, null), t;
|
|
13670
13662
|
}
|
|
13671
|
-
if ((y ? y(e) : e.nodeType) ===
|
|
13672
|
-
if (xe && e.nodeType ===
|
|
13663
|
+
if ((y ? y(e) : e.nodeType) === Cu.element && !lt(e) || (r === "noscript" || r === "noembed" || r === "noframes") && Y(xu, e.innerHTML)) return ut(e), !0;
|
|
13664
|
+
if (xe && e.nodeType === Cu.text) {
|
|
13673
13665
|
let n = vt(e.textContent);
|
|
13674
|
-
e.textContent !== n && (
|
|
13666
|
+
e.textContent !== n && (jl(t.removed, { element: e.cloneNode() }), e.textContent = n);
|
|
13675
13667
|
}
|
|
13676
13668
|
return Ct(A.afterSanitizeElements, e, null), !1;
|
|
13677
13669
|
}, Dt = function(e, t, r) {
|
|
@@ -13680,7 +13672,7 @@ function ku() {
|
|
|
13680
13672
|
if (!(L && Y(ue, t)) && !(I && Y(de, t))) {
|
|
13681
13673
|
if (!i) {
|
|
13682
13674
|
if (!(kt(e) && (N.tagNameCheck instanceof RegExp && Y(N.tagNameCheck, e) || N.tagNameCheck instanceof Function && N.tagNameCheck(e)) && (N.attributeNameCheck instanceof RegExp && Y(N.attributeNameCheck, t) || N.attributeNameCheck instanceof Function && N.attributeNameCheck(t, e)) || t === "is" && N.allowCustomizedBuiltInElements && (N.tagNameCheck instanceof RegExp && Y(N.tagNameCheck, r) || N.tagNameCheck instanceof Function && N.tagNameCheck(r)))) return !1;
|
|
13683
|
-
} else if (!Ve[t] && !Y(he,
|
|
13675
|
+
} else if (!Ve[t] && !Y(he, Ll(r, pe, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && Rl(r, "data:") === 0 && ze[e]) && !(ye && !Y(fe, Ll(r, pe, ""))) && r) return !1;
|
|
13684
13676
|
}
|
|
13685
13677
|
return !0;
|
|
13686
13678
|
}, Ot = Z({}, [
|
|
@@ -13693,7 +13685,7 @@ function ku() {
|
|
|
13693
13685
|
"font-face-uri",
|
|
13694
13686
|
"missing-glyph"
|
|
13695
13687
|
]), kt = function(e) {
|
|
13696
|
-
return !Ot[
|
|
13688
|
+
return !Ot[Pl(e)] && Y(me, e);
|
|
13697
13689
|
}, At = function(e, t, n, r) {
|
|
13698
13690
|
if (S && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
|
|
13699
13691
|
case "TrustedHTML": return O(r);
|
|
@@ -13702,7 +13694,7 @@ function ku() {
|
|
|
13702
13694
|
return r;
|
|
13703
13695
|
}, jt = function(e, n, r, i) {
|
|
13704
13696
|
try {
|
|
13705
|
-
r ? e.setAttributeNS(r, n, i) : e.setAttribute(n, i), bt(e) ? ut(e) :
|
|
13697
|
+
r ? e.setAttributeNS(r, n, i) : e.setAttribute(n, i), bt(e) ? ut(e) : Al(t.removed);
|
|
13706
13698
|
} catch {
|
|
13707
13699
|
ft(n, e);
|
|
13708
13700
|
}
|
|
@@ -13719,12 +13711,12 @@ function ku() {
|
|
|
13719
13711
|
forceKeepAttr: void 0
|
|
13720
13712
|
}, r = t.length, i = V(e.nodeName);
|
|
13721
13713
|
for (; r--;) {
|
|
13722
|
-
let a = t[r], o = a.name, s = a.namespaceURI, c = a.value, l = V(o), u = c, d = o === "value" ? u :
|
|
13723
|
-
if (n.attrName = l, n.attrValue = d, n.keepAttr = !0, n.forceKeepAttr = void 0, Ct(A.uponSanitizeAttribute, e, n), d = n.attrValue, Me && (l === "id" || l === "name") &&
|
|
13714
|
+
let a = t[r], o = a.name, s = a.namespaceURI, c = a.value, l = V(o), u = c, d = o === "value" ? u : zl(u);
|
|
13715
|
+
if (n.attrName = l, n.attrValue = d, n.keepAttr = !0, n.forceKeepAttr = void 0, Ct(A.uponSanitizeAttribute, e, n), d = n.attrValue, Me && (l === "id" || l === "name") && Rl(d, Ne) !== 0 && (ft(o, e), d = Ne + d), Se && Y(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, d)) {
|
|
13724
13716
|
ft(o, e);
|
|
13725
13717
|
continue;
|
|
13726
13718
|
}
|
|
13727
|
-
if (l === "attributename" &&
|
|
13719
|
+
if (l === "attributename" && Il(d, "href")) {
|
|
13728
13720
|
ft(o, e);
|
|
13729
13721
|
continue;
|
|
13730
13722
|
}
|
|
@@ -13733,7 +13725,7 @@ function ku() {
|
|
|
13733
13725
|
ft(o, e);
|
|
13734
13726
|
continue;
|
|
13735
13727
|
}
|
|
13736
|
-
if (!be && Y(
|
|
13728
|
+
if (!be && Y(Su, d)) {
|
|
13737
13729
|
ft(o, e);
|
|
13738
13730
|
continue;
|
|
13739
13731
|
}
|
|
@@ -13747,7 +13739,7 @@ function ku() {
|
|
|
13747
13739
|
Ct(A.afterSanitizeAttributes, e, null);
|
|
13748
13740
|
}, Nt = function(e) {
|
|
13749
13741
|
let t = null, n = _t(e);
|
|
13750
|
-
for (Ct(A.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (Ct(A.uponSanitizeShadowNode, t, null), Et(t, e), Mt(t), xt(t.content) && Nt(t.content), (y ? y(t) : t.nodeType) ===
|
|
13742
|
+
for (Ct(A.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (Ct(A.uponSanitizeShadowNode, t, null), Et(t, e), Mt(t), xt(t.content) && Nt(t.content), (y ? y(t) : t.nodeType) === Cu.element) {
|
|
13751
13743
|
let e = _(t);
|
|
13752
13744
|
xt(e) && (Pt(e), Nt(e));
|
|
13753
13745
|
}
|
|
@@ -13763,7 +13755,7 @@ function ku() {
|
|
|
13763
13755
|
Nt(e.shadow);
|
|
13764
13756
|
continue;
|
|
13765
13757
|
}
|
|
13766
|
-
let n = e.node, r = (y ? y(n) : n.nodeType) ===
|
|
13758
|
+
let n = e.node, r = (y ? y(n) : n.nodeType) === Cu.element, i = h(n);
|
|
13767
13759
|
if (i) for (let e = i.length - 1; e >= 0; --e) t.push({
|
|
13768
13760
|
node: i[e],
|
|
13769
13761
|
shadow: null
|
|
@@ -13792,24 +13784,24 @@ function ku() {
|
|
|
13792
13784
|
};
|
|
13793
13785
|
return t.sanitize = function(e) {
|
|
13794
13786
|
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, a = null, o = null, s = null;
|
|
13795
|
-
if (qe = !e, qe && (e = "<!-->"), typeof e != "string" && !St(e) && (e =
|
|
13787
|
+
if (qe = !e, qe && (e = "<!-->"), typeof e != "string" && !St(e) && (e = Yl(e), typeof e != "string")) throw Gl("dirty is not a string, aborting");
|
|
13796
13788
|
if (!t.isSupported) return e;
|
|
13797
|
-
we ? (j = Te, M = Ee) : rt(n), (A.uponSanitizeElement.length > 0 || A.uponSanitizeAttribute.length > 0) && (j =
|
|
13789
|
+
we ? (j = Te, M = Ee) : rt(n), (A.uponSanitizeElement.length > 0 || A.uponSanitizeAttribute.length > 0) && (j = Jl(j)), A.uponSanitizeAttribute.length > 0 && (M = Jl(M)), t.removed = [];
|
|
13798
13790
|
let c = Fe && typeof e != "string" && St(e);
|
|
13799
13791
|
if (c) {
|
|
13800
13792
|
ht(e);
|
|
13801
13793
|
let t = b ? b(e) : e.nodeName;
|
|
13802
13794
|
if (typeof t == "string") {
|
|
13803
13795
|
let n = V(t);
|
|
13804
|
-
if (!j[n] || P[n]) throw dt(e),
|
|
13796
|
+
if (!j[n] || P[n]) throw dt(e), Gl("root node is forbidden and cannot be sanitized in-place");
|
|
13805
13797
|
}
|
|
13806
|
-
if (bt(e)) throw dt(e),
|
|
13798
|
+
if (bt(e)) throw dt(e), Gl("root node is clobbered and cannot be sanitized in-place");
|
|
13807
13799
|
try {
|
|
13808
13800
|
Pt(e);
|
|
13809
13801
|
} catch (t) {
|
|
13810
13802
|
throw dt(e), t;
|
|
13811
13803
|
}
|
|
13812
|
-
} else if (St(e)) i = gt("<!---->"), a = i.ownerDocument.importNode(e, !0), a.nodeType ===
|
|
13804
|
+
} else if (St(e)) i = gt("<!---->"), a = i.ownerDocument.importNode(e, !0), a.nodeType === Cu.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? i = a : i.appendChild(a), Pt(a);
|
|
13813
13805
|
else {
|
|
13814
13806
|
if (!Oe && !xe && !Ce && e.indexOf("<") === -1) return S && Ae ? O(e) : e;
|
|
13815
13807
|
if (i = gt(e), !i) return Oe ? null : Ae ? C : "";
|
|
@@ -13820,11 +13812,11 @@ function ku() {
|
|
|
13820
13812
|
let e = _t(l);
|
|
13821
13813
|
for (; o = e.nextNode();) Et(o, l), Mt(o), xt(o.content) && Nt(o.content);
|
|
13822
13814
|
} catch (n) {
|
|
13823
|
-
throw c && (dt(e),
|
|
13815
|
+
throw c && (dt(e), Ol(t.removed, (e) => {
|
|
13824
13816
|
e.element && mt(e.element);
|
|
13825
13817
|
})), n;
|
|
13826
13818
|
}
|
|
13827
|
-
if (c) return
|
|
13819
|
+
if (c) return Ol(t.removed, (e) => {
|
|
13828
13820
|
e.element && mt(e.element);
|
|
13829
13821
|
}), xe && yt(e), e;
|
|
13830
13822
|
if (Oe) {
|
|
@@ -13833,7 +13825,7 @@ function ku() {
|
|
|
13833
13825
|
return (M.shadowroot || M.shadowrootmode) && (s = oe.call(r, s, !0)), s;
|
|
13834
13826
|
}
|
|
13835
13827
|
let u = Ce ? i.outerHTML : i.innerHTML;
|
|
13836
|
-
return Ce && j["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && Y(
|
|
13828
|
+
return Ce && j["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && Y(_u, i.ownerDocument.doctype.name) && (u = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + u), xe && (u = vt(u)), S && Ae ? O(u) : u;
|
|
13837
13829
|
}, t.setConfig = function() {
|
|
13838
13830
|
rt(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), we = !0, Te = j, Ee = M;
|
|
13839
13831
|
}, t.clearConfig = function() {
|
|
@@ -13841,22 +13833,22 @@ function ku() {
|
|
|
13841
13833
|
}, t.isValidAttribute = function(e, t, n) {
|
|
13842
13834
|
return et || rt({}), Dt(V(e), V(t), n);
|
|
13843
13835
|
}, t.addHook = function(e, t) {
|
|
13844
|
-
typeof t == "function" && J(A, e) &&
|
|
13836
|
+
typeof t == "function" && J(A, e) && jl(A[e], t);
|
|
13845
13837
|
}, t.removeHook = function(e, t) {
|
|
13846
13838
|
if (J(A, e)) {
|
|
13847
13839
|
if (t !== void 0) {
|
|
13848
|
-
let n =
|
|
13849
|
-
return n === -1 ? void 0 :
|
|
13840
|
+
let n = kl(A[e], t);
|
|
13841
|
+
return n === -1 ? void 0 : Ml(A[e], n, 1)[0];
|
|
13850
13842
|
}
|
|
13851
|
-
return
|
|
13843
|
+
return Al(A[e]);
|
|
13852
13844
|
}
|
|
13853
13845
|
}, t.removeHooks = function(e) {
|
|
13854
13846
|
J(A, e) && (A[e] = []);
|
|
13855
13847
|
}, t.removeAllHooks = function() {
|
|
13856
|
-
A =
|
|
13848
|
+
A = Eu();
|
|
13857
13849
|
}, t;
|
|
13858
13850
|
}
|
|
13859
|
-
var
|
|
13851
|
+
var ku = Ou(), Au = {
|
|
13860
13852
|
ALLOWED_TAGS: [
|
|
13861
13853
|
"a",
|
|
13862
13854
|
"b",
|
|
@@ -13870,7 +13862,7 @@ var Au = ku(), ju = {
|
|
|
13870
13862
|
"target",
|
|
13871
13863
|
"rel"
|
|
13872
13864
|
]
|
|
13873
|
-
},
|
|
13865
|
+
}, ju = {
|
|
13874
13866
|
ALLOWED_TAGS: [
|
|
13875
13867
|
"a",
|
|
13876
13868
|
"b",
|
|
@@ -13887,13 +13879,13 @@ var Au = ku(), ju = {
|
|
|
13887
13879
|
"rel"
|
|
13888
13880
|
]
|
|
13889
13881
|
};
|
|
13890
|
-
|
|
13882
|
+
ku.addHook("afterSanitizeAttributes", (e) => {
|
|
13891
13883
|
e.tagName === "A" && e.getAttribute("target") === "_blank" && e.setAttribute("rel", "noopener noreferrer");
|
|
13892
13884
|
});
|
|
13893
|
-
var
|
|
13885
|
+
var Mu = (e) => ku.sanitize(e, Au), Nu = (e) => ku.sanitize(e, ju), Pu = (e) => typeof e == "string" && e.length > 0, Fu = ({ title: e, description: t }) => Pu(e) || Pu(t), Iu = (e) => Fu(e) || Pu(e.html), Lu = (e) => Fu(e) ? JSON.stringify({
|
|
13894
13886
|
title: e.title ?? "",
|
|
13895
13887
|
description: e.description ?? ""
|
|
13896
|
-
}) : e.html ?? "",
|
|
13888
|
+
}) : e.html ?? "", Ru = { "Content-Type": "application/json" }, zu = (e, t, n) => {
|
|
13897
13889
|
let r = e.trim();
|
|
13898
13890
|
if (!r || r.startsWith(":") || !r.startsWith("data: ")) return;
|
|
13899
13891
|
let i = r.slice(6);
|
|
@@ -13905,7 +13897,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
13905
13897
|
}
|
|
13906
13898
|
t(e);
|
|
13907
13899
|
} catch {}
|
|
13908
|
-
},
|
|
13900
|
+
}, Bu = (e) => {
|
|
13909
13901
|
let { completionsBasePath: t } = e, n = (...t) => (e.fetchImpl ?? fetch)(...t);
|
|
13910
13902
|
return {
|
|
13911
13903
|
streamCompletion: (r, i, a, o, s, c, l, u, d) => {
|
|
@@ -13919,7 +13911,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
13919
13911
|
credentials: "include",
|
|
13920
13912
|
signal: h,
|
|
13921
13913
|
headers: {
|
|
13922
|
-
...
|
|
13914
|
+
...Ru,
|
|
13923
13915
|
...e.getCsrfToken() == null ? {} : { "X-CSRF-Token": e.getCsrfToken() },
|
|
13924
13916
|
...f ? { "X-Timezone": f } : {}
|
|
13925
13917
|
},
|
|
@@ -13955,13 +13947,13 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
13955
13947
|
for (;;) {
|
|
13956
13948
|
let { done: e, value: t } = await _.read();
|
|
13957
13949
|
if (e) {
|
|
13958
|
-
y.trim() &&
|
|
13950
|
+
y.trim() && zu(y, f, x);
|
|
13959
13951
|
break;
|
|
13960
13952
|
}
|
|
13961
13953
|
y += v.decode(t, { stream: !0 });
|
|
13962
13954
|
let n = y.split("\n");
|
|
13963
13955
|
y = n.pop() ?? "";
|
|
13964
|
-
for (let e of n)
|
|
13956
|
+
for (let e of n) zu(e, f, x);
|
|
13965
13957
|
}
|
|
13966
13958
|
b || p();
|
|
13967
13959
|
} catch (e) {
|
|
@@ -13977,7 +13969,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
13977
13969
|
method: "POST",
|
|
13978
13970
|
credentials: "include",
|
|
13979
13971
|
headers: {
|
|
13980
|
-
...
|
|
13972
|
+
...Ru,
|
|
13981
13973
|
...e.getCsrfToken() == null ? {} : { "X-CSRF-Token": e.getCsrfToken() }
|
|
13982
13974
|
},
|
|
13983
13975
|
body: JSON.stringify(r)
|
|
@@ -13985,7 +13977,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
13985
13977
|
if (a && e.setCsrfToken(a), !i.ok) throw Error(`stopCompletion failed: ${i.status}`);
|
|
13986
13978
|
}
|
|
13987
13979
|
};
|
|
13988
|
-
},
|
|
13980
|
+
}, Vu = (e) => e.messages.filter((e) => e.role !== C.Status).length < 2 ? !1 : e.llmNamingDone !== !0, Hu = {
|
|
13989
13981
|
ALLOWED_TAGS: [
|
|
13990
13982
|
"a",
|
|
13991
13983
|
"span",
|
|
@@ -14000,23 +13992,23 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14000
13992
|
"target",
|
|
14001
13993
|
"rel"
|
|
14002
13994
|
]
|
|
14003
|
-
},
|
|
13995
|
+
}, Uu = (e) => ku.sanitize(e, Hu), Wu = (e) => {
|
|
14004
13996
|
let t = e.trim();
|
|
14005
13997
|
return /^v/i.test(t) ? t : `v${t}`;
|
|
14006
|
-
},
|
|
14007
|
-
let [n, r] = e.split(
|
|
14008
|
-
return t &&
|
|
14009
|
-
},
|
|
13998
|
+
}, Gu = "__", Ku = /[-+]/, qu = /^\d+$/, Ju = ".scheduler", Yu = "applications", Xu = (e) => e ? e.split(Ku)[0].split(".").every((e) => qu.test(e)) : !1, Zu = (e, t) => {
|
|
13999
|
+
let [n, r] = e.split(Gu);
|
|
14000
|
+
return t && Xu(r) ? [n, r].join(Gu) : n;
|
|
14001
|
+
}, Qu = (e) => {
|
|
14010
14002
|
let t = e.split("/");
|
|
14011
14003
|
if (t.length < 3) return;
|
|
14012
|
-
let n = t.slice(2), r = n[0] ===
|
|
14004
|
+
let n = t.slice(2), r = n[0] === Ju ? n.slice(2) : n, i = r.findIndex((e) => e.includes(Gu));
|
|
14013
14005
|
if (i === -1) return;
|
|
14014
|
-
let a = r[i], o = r.slice(0, i).filter(Boolean), s =
|
|
14006
|
+
let a = r[i], o = r.slice(0, i).filter(Boolean), s = Zu(a, o[0] === Yu), c = [...o, s].filter(Boolean);
|
|
14015
14007
|
return c.length > 0 ? c.join("/") : void 0;
|
|
14016
|
-
},
|
|
14008
|
+
}, $u = (e, t, n) => {
|
|
14017
14009
|
let r = n != null && n.length > 0;
|
|
14018
14010
|
return e >= 5 && e <= 11 ? r ? t.morningWithName : t.morningNoName : e >= 12 && e <= 16 ? r ? t.afternoonWithName : t.afternoonNoName : e >= 17 && e <= 20 ? r ? t.eveningWithName : t.eveningNoName : r ? t.nightWithName : t.nightNoName;
|
|
14019
|
-
},
|
|
14011
|
+
}, ed = (e, t) => {
|
|
14020
14012
|
let n = {
|
|
14021
14013
|
event_type: E.ModelChanged,
|
|
14022
14014
|
previous_deployment_id: e,
|
|
@@ -14030,31 +14022,31 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14030
14022
|
deploymentId: t,
|
|
14031
14023
|
custom_content: n
|
|
14032
14024
|
};
|
|
14033
|
-
},
|
|
14025
|
+
}, td = (e, t, n, r) => r && t === n - 1 && e.role === C.Assistant, nd = (e) => {
|
|
14034
14026
|
for (let t = e.length - 1; t >= 0; t--) {
|
|
14035
14027
|
let n = e[t];
|
|
14036
14028
|
if (ce(n) && n.custom_content?.event_type === E.ModelChanged) return n.custom_content.new_deployment_id;
|
|
14037
14029
|
}
|
|
14038
14030
|
return null;
|
|
14039
|
-
},
|
|
14031
|
+
}, rd = (e) => e.role === C.Assistant && (e.custom_content?.stages?.length ?? 0) > 0, id = (e) => {
|
|
14040
14032
|
for (let t = e.length - 1; t >= 0; t--) if (e[t].role === C.User) return e[t].custom_content?.configuration_value;
|
|
14041
|
-
},
|
|
14033
|
+
}, ad = (e) => (e ?? "").toLowerCase().replace(/[^a-z]/g, "") === "plaintext" ? T.PlainText : T.Markdown, od = (e) => e.map((e, t) => ({
|
|
14042
14034
|
id: t.toString(),
|
|
14043
14035
|
role: e.role,
|
|
14044
14036
|
content: e.content
|
|
14045
|
-
})),
|
|
14037
|
+
})), sd = (e) => typeof e == "object" && !!e && !Array.isArray(e), cd = (e) => {
|
|
14046
14038
|
if (typeof e == "string") return e.trim() || void 0;
|
|
14047
|
-
},
|
|
14048
|
-
if (!
|
|
14039
|
+
}, ld = (e) => {
|
|
14040
|
+
if (!sd(e) || !Array.isArray(e.starters)) return {
|
|
14049
14041
|
starters: [],
|
|
14050
14042
|
introText: void 0,
|
|
14051
14043
|
isChatMessageInputDisabled: !1
|
|
14052
14044
|
};
|
|
14053
14045
|
let t = e.autoSubmit !== !1;
|
|
14054
14046
|
return {
|
|
14055
|
-
starters: e.starters.filter(
|
|
14056
|
-
title:
|
|
14057
|
-
text:
|
|
14047
|
+
starters: e.starters.filter(sd).map((e) => ({
|
|
14048
|
+
title: cd(e.title),
|
|
14049
|
+
text: cd(e.text)
|
|
14058
14050
|
})).filter((e) => e.title != null && e.text != null).map((e, n) => ({
|
|
14059
14051
|
const: n,
|
|
14060
14052
|
title: e.title,
|
|
@@ -14064,10 +14056,10 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14064
14056
|
confirmationMessage: null
|
|
14065
14057
|
}
|
|
14066
14058
|
})),
|
|
14067
|
-
introText:
|
|
14059
|
+
introText: cd(e.introText),
|
|
14068
14060
|
isChatMessageInputDisabled: e.chatMessageInputDisabled === !0
|
|
14069
14061
|
};
|
|
14070
|
-
},
|
|
14062
|
+
}, ud = (e) => e["dial:widgetOptions"].populateText || e.title, dd = (e) => {
|
|
14071
14063
|
let t = e?.properties;
|
|
14072
14064
|
if (!t) return {
|
|
14073
14065
|
starters: [],
|
|
@@ -14090,50 +14082,50 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14090
14082
|
propertyKey: n,
|
|
14091
14083
|
description: a
|
|
14092
14084
|
};
|
|
14093
|
-
},
|
|
14085
|
+
}, fd = (e) => `${window.location.origin}${e}`, pd = (e) => e === "localhost" || e === "[::1]" || /^127(?:\.\d{1,3}){3}$/.test(e), md = (e) => e.protocol === "https:" ? !0 : e.protocol === "http:" && pd(e.hostname), hd = (e, t, n) => {
|
|
14094
14086
|
if (!e.authorizationEndpoint?.trim() || !e.clientId?.trim()) return null;
|
|
14095
14087
|
try {
|
|
14096
14088
|
let r = new URL(e.authorizationEndpoint.trim());
|
|
14097
|
-
return
|
|
14089
|
+
return md(r) ? (r.searchParams.set("response_type", "code"), r.searchParams.set("client_id", e.clientId.trim()), r.searchParams.set("redirect_uri", t), e.codeChallenge && r.searchParams.set("code_challenge", e.codeChallenge), e.codeChallengeMethod && r.searchParams.set("code_challenge_method", e.codeChallengeMethod), r.searchParams.set("state", n), e.scopes && e.scopes.length > 0 && r.searchParams.set("scope", e.scopes.join(" ")), r.toString()) : null;
|
|
14098
14090
|
} catch {
|
|
14099
14091
|
return null;
|
|
14100
14092
|
}
|
|
14101
|
-
},
|
|
14093
|
+
}, gd = /* @__PURE__ */ function(e) {
|
|
14102
14094
|
return e.None = "NONE", e.ApiKey = "API_KEY", e.OAuth = "OAUTH", e;
|
|
14103
|
-
}({}),
|
|
14095
|
+
}({}), _d = /* @__PURE__ */ function(e) {
|
|
14104
14096
|
return e.SignedIn = "SIGNED_IN", e.SignedOut = "SIGNED_OUT", e.Failed = "FAILED", e;
|
|
14105
|
-
}({}),
|
|
14097
|
+
}({}), vd = /* @__PURE__ */ function(e) {
|
|
14106
14098
|
return e.Global = "GLOBAL", e.User = "USER", e.App = "APP", e;
|
|
14107
|
-
}({}),
|
|
14099
|
+
}({}), yd = /* @__PURE__ */ function(e) {
|
|
14108
14100
|
return e.WithLogin = "with-login", e.WithoutLogin = "without-login", e.WithConfig = "with-config", e;
|
|
14109
|
-
}({}),
|
|
14101
|
+
}({}), bd = /* @__PURE__ */ function(e) {
|
|
14110
14102
|
return e.Toolset = "toolset", e.ExternalService = "external-service", e.OfflineCredentials = "offline-credentials", e;
|
|
14111
|
-
}({}),
|
|
14103
|
+
}({}), xd = /* @__PURE__ */ function(e) {
|
|
14112
14104
|
return e.Started = "started", e.Blocked = "blocked", e.InvalidConfig = "invalid-config", e;
|
|
14113
14105
|
}({}), Q = /* @__PURE__ */ function(e) {
|
|
14114
14106
|
return e.Success = "success", e.Failure = "failure", e.Cancelled = "cancelled", e;
|
|
14115
|
-
}({}),
|
|
14107
|
+
}({}), Sd = /* @__PURE__ */ function(e) {
|
|
14116
14108
|
return e.MissingCode = "missing-code", e.MissingRedirectState = "missing-redirect-state", e.StateMismatch = "state-mismatch", e.LoginRequestFailed = "login-request-failed", e;
|
|
14117
|
-
}({}),
|
|
14109
|
+
}({}), Cd = /* @__PURE__ */ function(e) {
|
|
14118
14110
|
return e.ResultAcknowledged = "result-acknowledged", e;
|
|
14119
|
-
}({}),
|
|
14111
|
+
}({}), wd = /* @__PURE__ */ function(e) {
|
|
14120
14112
|
return e.Result = "toolsetOAuthResult", e.FailureReason = "toolsetOAuthFailureReason", e;
|
|
14121
|
-
}({}),
|
|
14113
|
+
}({}), Td = "toolset-redirect-state", Ed = "toolset-oauth-", Dd = (e) => `${Ed}${e}`, Od = 300 * 1e3, kd = 500, Ad = (e) => {
|
|
14122
14114
|
switch (e) {
|
|
14123
|
-
case
|
|
14124
|
-
case
|
|
14125
|
-
case
|
|
14126
|
-
case
|
|
14127
|
-
default: return
|
|
14115
|
+
case Sd.MissingCode:
|
|
14116
|
+
case Sd.MissingRedirectState:
|
|
14117
|
+
case Sd.StateMismatch:
|
|
14118
|
+
case Sd.LoginRequestFailed: return e;
|
|
14119
|
+
default: return Sd.LoginRequestFailed;
|
|
14128
14120
|
}
|
|
14129
|
-
},
|
|
14121
|
+
}, jd = (e) => typeof e == "object" && !!e && "type" in e && (e.type === Q.Success || e.type === Q.Failure), Md = (e, t, { toolsetId: n, credentialsLevel: r, callbackPath: i, timeoutMs: a = Od, pollIntervalMs: o = kd }) => new Promise((s) => {
|
|
14130
14122
|
let c, l = !1, u = () => {
|
|
14131
14123
|
let e = c;
|
|
14132
14124
|
c = void 0, e != null && setTimeout(() => e.close(), 0);
|
|
14133
14125
|
}, d = (e) => {
|
|
14134
14126
|
l || (l = !0, clearInterval(h), clearTimeout(g), window.removeEventListener("focus", m), u(), s(e));
|
|
14135
14127
|
}, f = (t) => {
|
|
14136
|
-
c?.postMessage({ type:
|
|
14128
|
+
c?.postMessage({ type: Cd.ResultAcknowledged });
|
|
14137
14129
|
try {
|
|
14138
14130
|
e.close();
|
|
14139
14131
|
} catch {}
|
|
@@ -14142,7 +14134,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14142
14134
|
try {
|
|
14143
14135
|
let t = new URL(e.location.href);
|
|
14144
14136
|
if (t.origin !== window.location.origin || t.pathname !== i) return null;
|
|
14145
|
-
let a = t.searchParams.get(
|
|
14137
|
+
let a = t.searchParams.get(wd.Result);
|
|
14146
14138
|
if (a === Q.Success) return {
|
|
14147
14139
|
type: Q.Success,
|
|
14148
14140
|
toolsetId: n,
|
|
@@ -14150,7 +14142,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14150
14142
|
};
|
|
14151
14143
|
if (a === Q.Failure) return {
|
|
14152
14144
|
type: Q.Failure,
|
|
14153
|
-
reason:
|
|
14145
|
+
reason: Ad(t.searchParams.get(wd.FailureReason))
|
|
14154
14146
|
};
|
|
14155
14147
|
} catch {}
|
|
14156
14148
|
return null;
|
|
@@ -14163,8 +14155,8 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14163
14155
|
e.closed && d({ type: Q.Cancelled });
|
|
14164
14156
|
};
|
|
14165
14157
|
try {
|
|
14166
|
-
c = new BroadcastChannel(
|
|
14167
|
-
|
|
14158
|
+
c = new BroadcastChannel(Dd(t)), c.onmessage = (e) => {
|
|
14159
|
+
jd(e.data) && f(e.data);
|
|
14168
14160
|
};
|
|
14169
14161
|
} catch {}
|
|
14170
14162
|
window.addEventListener("focus", m);
|
|
@@ -14178,7 +14170,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14178
14170
|
e.close(), d({ type: Q.Cancelled });
|
|
14179
14171
|
}, a), _ = p();
|
|
14180
14172
|
_ != null && f(_);
|
|
14181
|
-
}),
|
|
14173
|
+
}), Nd = (e, t, n, r, i, a, o = bd.Toolset, s) => {
|
|
14182
14174
|
let c = {
|
|
14183
14175
|
toolsetId: r,
|
|
14184
14176
|
credentialsLevel: i,
|
|
@@ -14187,48 +14179,48 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14187
14179
|
resourceKind: o,
|
|
14188
14180
|
offlineUsageConsent: s
|
|
14189
14181
|
};
|
|
14190
|
-
return e.sessionStorage.setItem(
|
|
14191
|
-
type:
|
|
14182
|
+
return e.sessionStorage.setItem(Td, JSON.stringify(c)), e.opener = null, e.location.href = t, {
|
|
14183
|
+
type: xd.Started,
|
|
14192
14184
|
popup: e,
|
|
14193
14185
|
flowId: n
|
|
14194
14186
|
};
|
|
14195
|
-
},
|
|
14196
|
-
let s =
|
|
14197
|
-
return l ?
|
|
14198
|
-
},
|
|
14199
|
-
let a =
|
|
14200
|
-
if (!s) return { type:
|
|
14201
|
-
let c =
|
|
14202
|
-
return c ?
|
|
14203
|
-
},
|
|
14204
|
-
let e = sessionStorage.getItem(
|
|
14187
|
+
}, Pd = () => window.open("", "_blank"), Fd = (e, t, n, r, i = vd.User, a = bd.Toolset, o) => {
|
|
14188
|
+
let s = fd(r), c = k(), l = hd(t, s, c);
|
|
14189
|
+
return l ? Nd(e, l, c, n, i, s, a, o) : (e.close(), { type: xd.InvalidConfig });
|
|
14190
|
+
}, Id = (e, t, n, r = vd.User, i) => {
|
|
14191
|
+
let a = fd(n), o = k(), s = hd(e, a, o);
|
|
14192
|
+
if (!s) return { type: xd.InvalidConfig };
|
|
14193
|
+
let c = Pd();
|
|
14194
|
+
return c ? Nd(c, s, o, t, r, a, bd.Toolset, i) : { type: xd.Blocked };
|
|
14195
|
+
}, Ld = 500, Rd = (e) => typeof e == "object" && !!e && "type" in e && e.type === Cd.ResultAcknowledged, zd = () => {
|
|
14196
|
+
let e = sessionStorage.getItem(Td);
|
|
14205
14197
|
if (!e) return null;
|
|
14206
14198
|
try {
|
|
14207
14199
|
return JSON.parse(e);
|
|
14208
14200
|
} catch {
|
|
14209
14201
|
return null;
|
|
14210
14202
|
}
|
|
14211
|
-
},
|
|
14203
|
+
}, Bd = (e) => {
|
|
14212
14204
|
try {
|
|
14213
14205
|
window.history.replaceState({}, document.title, `${e.pathname}${e.search}`);
|
|
14214
14206
|
} catch {}
|
|
14215
|
-
},
|
|
14207
|
+
}, Vd = (e, t) => {
|
|
14216
14208
|
let n = new URL(window.location.pathname, window.location.origin);
|
|
14217
|
-
if (n.searchParams.set(
|
|
14209
|
+
if (n.searchParams.set(wd.Result, t.type), t.type === Q.Failure && n.searchParams.set(wd.FailureReason, t.reason), Bd(n), !e) {
|
|
14218
14210
|
window.close();
|
|
14219
14211
|
return;
|
|
14220
14212
|
}
|
|
14221
14213
|
try {
|
|
14222
|
-
let n = new BroadcastChannel(
|
|
14214
|
+
let n = new BroadcastChannel(Dd(e));
|
|
14223
14215
|
n.postMessage(t);
|
|
14224
14216
|
let r = setInterval(() => {
|
|
14225
14217
|
n.postMessage(t);
|
|
14226
|
-
},
|
|
14218
|
+
}, Ld);
|
|
14227
14219
|
n.onmessage = (e) => {
|
|
14228
|
-
|
|
14220
|
+
Rd(e.data) && (clearInterval(r), n.close(), window.close());
|
|
14229
14221
|
};
|
|
14230
14222
|
} catch {}
|
|
14231
|
-
},
|
|
14223
|
+
}, Hd = ({ searchParams: e, callbackPath: t, exchange: n }) => {
|
|
14232
14224
|
let [r, i] = L(!0), [a, o] = L(null), s = I(!1), c = I(n);
|
|
14233
14225
|
c.current = n;
|
|
14234
14226
|
let l = I(t);
|
|
@@ -14236,27 +14228,27 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14236
14228
|
if (s.current) return;
|
|
14237
14229
|
s.current = !0;
|
|
14238
14230
|
let t = (e, t) => {
|
|
14239
|
-
|
|
14231
|
+
Vd(e, t), i(!1), o(t.type === Q.Failure ? t.reason : null);
|
|
14240
14232
|
};
|
|
14241
14233
|
(async () => {
|
|
14242
|
-
let n = e.get("code"), r = e.get("state"), i =
|
|
14243
|
-
sessionStorage.removeItem(
|
|
14234
|
+
let n = e.get("code"), r = e.get("state"), i = zd();
|
|
14235
|
+
sessionStorage.removeItem(Td);
|
|
14244
14236
|
let a = i?.state ?? r ?? void 0;
|
|
14245
|
-
if (
|
|
14237
|
+
if (Bd(new URL(window.location.pathname, window.location.origin)), !n || !i?.toolsetId) {
|
|
14246
14238
|
t(a, {
|
|
14247
14239
|
type: Q.Failure,
|
|
14248
|
-
reason: i?.toolsetId ?
|
|
14240
|
+
reason: i?.toolsetId ? Sd.MissingCode : Sd.MissingRedirectState
|
|
14249
14241
|
});
|
|
14250
14242
|
return;
|
|
14251
14243
|
}
|
|
14252
14244
|
if (i.state != null && i.state !== r) {
|
|
14253
14245
|
t(a, {
|
|
14254
14246
|
type: Q.Failure,
|
|
14255
|
-
reason:
|
|
14247
|
+
reason: Sd.StateMismatch
|
|
14256
14248
|
});
|
|
14257
14249
|
return;
|
|
14258
14250
|
}
|
|
14259
|
-
let o = i.credentialsLevel ??
|
|
14251
|
+
let o = i.credentialsLevel ?? vd.User, s = i.redirectUri ?? `${window.location.origin}${l.current}`;
|
|
14260
14252
|
try {
|
|
14261
14253
|
let e = await c.current({
|
|
14262
14254
|
code: n,
|
|
@@ -14279,7 +14271,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14279
14271
|
} catch {
|
|
14280
14272
|
t(a, {
|
|
14281
14273
|
type: Q.Failure,
|
|
14282
|
-
reason:
|
|
14274
|
+
reason: Sd.LoginRequestFailed
|
|
14283
14275
|
});
|
|
14284
14276
|
}
|
|
14285
14277
|
})();
|
|
@@ -14287,18 +14279,18 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14287
14279
|
isInProgress: r,
|
|
14288
14280
|
failureReason: a
|
|
14289
14281
|
};
|
|
14290
|
-
},
|
|
14291
|
-
|
|
14292
|
-
},
|
|
14282
|
+
}, Ud = "toolset-login-success", Wd = new EventTarget(), Gd = (e) => {
|
|
14283
|
+
Wd.dispatchEvent(new CustomEvent(Ud, { detail: e }));
|
|
14284
|
+
}, Kd = (e) => {
|
|
14293
14285
|
let t = (t) => {
|
|
14294
14286
|
e(t.detail);
|
|
14295
14287
|
};
|
|
14296
|
-
return
|
|
14297
|
-
|
|
14288
|
+
return Wd.addEventListener(Ud, t), () => {
|
|
14289
|
+
Wd.removeEventListener(Ud, t);
|
|
14298
14290
|
};
|
|
14299
|
-
},
|
|
14291
|
+
}, qd = /* @__PURE__ */ function(e) {
|
|
14300
14292
|
return e.Success = "success", e.Failure = "failure", e.PopupBlocked = "popup-blocked", e.Cancelled = "cancelled", e;
|
|
14301
|
-
}({}),
|
|
14293
|
+
}({}), Jd = ({ callbackPath: e, loginToolset: t, logoutToolset: n, getToolset: r }) => {
|
|
14302
14294
|
let i = N(async (e, t, r) => {
|
|
14303
14295
|
try {
|
|
14304
14296
|
await n(e, {
|
|
@@ -14315,24 +14307,24 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14315
14307
|
codeChallenge: o?.codeChallenge,
|
|
14316
14308
|
codeChallengeMethod: o?.codeChallengeMethod
|
|
14317
14309
|
}, u = s ? await (async () => {
|
|
14318
|
-
let t =
|
|
14319
|
-
return t ? (await i(n, a,
|
|
14320
|
-
})() :
|
|
14321
|
-
if (u.type ===
|
|
14322
|
-
if (u.type !==
|
|
14323
|
-
let d = await
|
|
14310
|
+
let t = Pd();
|
|
14311
|
+
return t ? (await i(n, a, gd.OAuth), Fd(t, l, n, e, a, bd.Toolset, c)) : { type: xd.Blocked };
|
|
14312
|
+
})() : Id(l, n, e, a, c);
|
|
14313
|
+
if (u.type === xd.Blocked) return { type: "popup-blocked" };
|
|
14314
|
+
if (u.type !== xd.Started) return { type: "failure" };
|
|
14315
|
+
let d = await Md(u.popup, u.flowId, {
|
|
14324
14316
|
toolsetId: n,
|
|
14325
14317
|
credentialsLevel: a,
|
|
14326
14318
|
callbackPath: e
|
|
14327
14319
|
});
|
|
14328
|
-
if (d.type === Q.Success) return
|
|
14320
|
+
if (d.type === Q.Success) return Gd({
|
|
14329
14321
|
toolsetId: n,
|
|
14330
14322
|
credentialsLevel: a
|
|
14331
14323
|
}), { type: "success" };
|
|
14332
14324
|
if (d.type === Q.Failure) return { type: "failure" };
|
|
14333
14325
|
try {
|
|
14334
14326
|
let e = await r(n);
|
|
14335
|
-
if ((a ===
|
|
14327
|
+
if ((a === vd.User ? e.authSettings?.userLevelAuthStatus : e.authSettings?.globalAuthStatus) === _d.SignedIn) return Gd({
|
|
14336
14328
|
toolsetId: n,
|
|
14337
14329
|
credentialsLevel: a
|
|
14338
14330
|
}), { type: "success" };
|
|
@@ -14351,7 +14343,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14351
14343
|
authenticationType: a,
|
|
14352
14344
|
apiKey: o?.trim(),
|
|
14353
14345
|
offlineUsageConsent: l
|
|
14354
|
-
}),
|
|
14346
|
+
}), Gd({
|
|
14355
14347
|
toolsetId: n,
|
|
14356
14348
|
credentialsLevel: r
|
|
14357
14349
|
}), { type: "success" };
|
|
@@ -14359,8 +14351,8 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14359
14351
|
return { type: "failure" };
|
|
14360
14352
|
}
|
|
14361
14353
|
}, [t, i]);
|
|
14362
|
-
return { login: N((e) => e.authenticationType ===
|
|
14363
|
-
},
|
|
14354
|
+
return { login: N((e) => e.authenticationType === gd.OAuth ? a(e) : o(e), [a, o]) };
|
|
14355
|
+
}, Yd = (e) => {
|
|
14364
14356
|
let t = e.split("/").filter(Boolean);
|
|
14365
14357
|
return t.map((e, n) => {
|
|
14366
14358
|
let r = t.slice(0, n).join("/");
|
|
@@ -14370,7 +14362,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14370
14362
|
...r ? { folderId: r } : void 0
|
|
14371
14363
|
};
|
|
14372
14364
|
});
|
|
14373
|
-
},
|
|
14365
|
+
}, Xd = (e) => ({
|
|
14374
14366
|
version: 5,
|
|
14375
14367
|
prompts: [{
|
|
14376
14368
|
id: e.id,
|
|
@@ -14379,19 +14371,19 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14379
14371
|
content: e.content,
|
|
14380
14372
|
...e.folderId ? { folderId: e.folderId } : void 0
|
|
14381
14373
|
}],
|
|
14382
|
-
folders:
|
|
14383
|
-
}),
|
|
14384
|
-
let r = e.replace(
|
|
14374
|
+
folders: Yd(e.folderId)
|
|
14375
|
+
}), Zd = (e) => new Blob([JSON.stringify(e, null, 2)], { type: "application/json" }), Qd = /[^a-zA-Z0-9._-]+/g, $d = (e, t, n = /* @__PURE__ */ new Date()) => {
|
|
14376
|
+
let r = e.replace(Qd, "_");
|
|
14385
14377
|
return `${Zt(n)}_${t}_prompt_${r}.json`;
|
|
14386
|
-
},
|
|
14378
|
+
}, ef = /* @__PURE__ */ function(e) {
|
|
14387
14379
|
return e.Required = "required", e.TooLong = "tooLong", e.InvalidName = "invalidName", e.Conflict = "conflict", e;
|
|
14388
|
-
}({}),
|
|
14380
|
+
}({}), tf = /^(?!\.{1,2}$)[a-zA-Z0-9 _.-]+$/, nf = 256, rf = 2e3, af = 5e4, of = 10, sf = (e) => {
|
|
14389
14381
|
let t = e.trim();
|
|
14390
|
-
return t.length === 0 ? "required" : t.length > 256 ? "tooLong" :
|
|
14391
|
-
},
|
|
14382
|
+
return t.length === 0 ? "required" : t.length > 256 ? "tooLong" : tf.test(t) ? null : "invalidName";
|
|
14383
|
+
}, cf = (e) => e.length > 2e3 ? "tooLong" : null, lf = (e) => e.trim().length === 0 ? "required" : e.length > 5e4 ? "tooLong" : null, uf = (e, t) => {
|
|
14392
14384
|
let n = t - e.length;
|
|
14393
14385
|
return n <= 10 ? n : null;
|
|
14394
|
-
},
|
|
14386
|
+
}, df = (e, t) => e ? `${e}/${t}` : t, ff = ({ listPrompts: e }) => {
|
|
14395
14387
|
let [t, n] = L([]), [r, i] = L([]), [a, o] = L([]), [s, c] = L([]), [l, u] = L([]), [d, f] = L(!0), [p, m] = L(null), h = N(async () => {
|
|
14396
14388
|
try {
|
|
14397
14389
|
let t = await e();
|
|
@@ -14428,14 +14420,14 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14428
14420
|
p,
|
|
14429
14421
|
h
|
|
14430
14422
|
]);
|
|
14431
|
-
},
|
|
14423
|
+
}, pf = /* @__PURE__ */ function(e) {
|
|
14432
14424
|
return e.UnsupportedCronShape = "unsupportedCronShape", e.UnsupportedTriggerType = "unsupportedTriggerType", e.MissingRequiredFields = "missingRequiredFields", e;
|
|
14433
|
-
}({}),
|
|
14425
|
+
}({}), mf = (e) => (e + 1) % 7, hf = (e) => (e + 6) % 7, gf = new Set([
|
|
14434
14426
|
"hour",
|
|
14435
14427
|
"minute",
|
|
14436
14428
|
"day_of_week",
|
|
14437
14429
|
"day"
|
|
14438
|
-
]),
|
|
14430
|
+
]), _f = "09:00", vf = (e) => {
|
|
14439
14431
|
if (e.repeat === Ke.Hourly) {
|
|
14440
14432
|
let t = /* @__PURE__ */ new Date();
|
|
14441
14433
|
return t.setHours(0, Number(e.minute), 0, 0), {
|
|
@@ -14447,22 +14439,22 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14447
14439
|
a.setHours(r, i, 0, 0);
|
|
14448
14440
|
let o = e.repeat === Ke.Weekly && !!e.dayOfWeek, s = e.repeat === Ke.Monthly && !!e.dayOfMonth;
|
|
14449
14441
|
if (o) {
|
|
14450
|
-
let t = (
|
|
14442
|
+
let t = (mf(Number(e.dayOfWeek)) - a.getDay() + 7) % 7;
|
|
14451
14443
|
a.setDate(a.getDate() + t);
|
|
14452
14444
|
} else s && a.setDate(Number(e.dayOfMonth));
|
|
14453
14445
|
let c = {
|
|
14454
14446
|
hour: String(a.getUTCHours()),
|
|
14455
14447
|
minute: String(a.getUTCMinutes())
|
|
14456
14448
|
};
|
|
14457
|
-
return o && (c.day_of_week = String(
|
|
14458
|
-
},
|
|
14449
|
+
return o && (c.day_of_week = String(hf(a.getUTCDay()))), s && (c.day = String(a.getUTCDate())), c;
|
|
14450
|
+
}, yf = (e, t) => {
|
|
14459
14451
|
let [n, r, i] = e.split("-").map(Number), a = new Date(n, r - 1, i);
|
|
14460
14452
|
return t === "start" ? a.setHours(0, 0, 0, 0) : a.setHours(23, 59, 59, 999), a.toISOString();
|
|
14461
|
-
},
|
|
14453
|
+
}, bf = (e) => {
|
|
14462
14454
|
let t = e.repeat === Ke.OneTime ? { date: new Date(e.runAt ?? "").toISOString() } : { cron: {
|
|
14463
|
-
fields:
|
|
14464
|
-
...e.startDate ? { startDate:
|
|
14465
|
-
...e.endDate ? { endDate:
|
|
14455
|
+
fields: vf(e),
|
|
14456
|
+
...e.startDate ? { startDate: yf(e.startDate, "start") } : {},
|
|
14457
|
+
...e.endDate ? { endDate: yf(e.endDate, "end") } : {}
|
|
14466
14458
|
} }, n = e.description?.trim();
|
|
14467
14459
|
return {
|
|
14468
14460
|
displayName: e.displayName.trim(),
|
|
@@ -14471,14 +14463,14 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14471
14463
|
prompt: e.prompt.trim(),
|
|
14472
14464
|
...n ? { description: n } : {}
|
|
14473
14465
|
};
|
|
14474
|
-
},
|
|
14466
|
+
}, xf = (e) => bf(e), Sf = (e) => {
|
|
14475
14467
|
let t = new Date(e);
|
|
14476
14468
|
return `${t.getFullYear()}-${lr(t.getMonth() + 1)}-${lr(t.getDate())}T${lr(t.getHours())}:${lr(t.getMinutes())}`;
|
|
14477
|
-
},
|
|
14469
|
+
}, Cf = (e) => {
|
|
14478
14470
|
let t = new Date(e);
|
|
14479
14471
|
return `${t.getFullYear()}-${lr(t.getMonth() + 1)}-${lr(t.getDate())}`;
|
|
14480
|
-
},
|
|
14481
|
-
let t = new Set(Object.entries(e).filter(([, e]) => e != null).map(([e]) => e)), n = [...t].filter((e) => !
|
|
14472
|
+
}, wf = (e) => {
|
|
14473
|
+
let t = new Set(Object.entries(e).filter(([, e]) => e != null).map(([e]) => e)), n = [...t].filter((e) => !gf.has(e)), r = t.has("day_of_week"), i = t.has("day");
|
|
14482
14474
|
if (n.length > 0 || r && i || !t.has("hour") || !t.has("minute")) return { ok: !1 };
|
|
14483
14475
|
if (e.hour === "*" && /^\d+$/.test(String(e.minute)) && !r && !i) {
|
|
14484
14476
|
let t = /* @__PURE__ */ new Date();
|
|
@@ -14494,7 +14486,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14494
14486
|
if (s.setUTCHours(a, o, 0, 0), r) {
|
|
14495
14487
|
let t = Number(e.day_of_week);
|
|
14496
14488
|
if (Number.isNaN(t)) return { ok: !1 };
|
|
14497
|
-
let n = (
|
|
14489
|
+
let n = (mf(t) - s.getUTCDay() + 7) % 7;
|
|
14498
14490
|
s.setUTCDate(s.getUTCDate() + n);
|
|
14499
14491
|
} else if (i) {
|
|
14500
14492
|
let t = Number(e.day);
|
|
@@ -14505,18 +14497,18 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14505
14497
|
ok: !0,
|
|
14506
14498
|
isHourly: !1,
|
|
14507
14499
|
time: `${lr(s.getHours())}:${lr(s.getMinutes())}`,
|
|
14508
|
-
...r ? { dayOfWeek: String(
|
|
14500
|
+
...r ? { dayOfWeek: String(hf(s.getDay())) } : {},
|
|
14509
14501
|
...i ? { dayOfMonth: String(s.getDate()) } : {}
|
|
14510
14502
|
};
|
|
14511
|
-
},
|
|
14503
|
+
}, Tf = (e) => {
|
|
14512
14504
|
if (!e.model || !e.prompt) return {
|
|
14513
14505
|
ok: !1,
|
|
14514
|
-
reason:
|
|
14506
|
+
reason: pf.MissingRequiredFields
|
|
14515
14507
|
};
|
|
14516
14508
|
let { date: t, cron: n } = e.trigger, r = !!t;
|
|
14517
14509
|
if (r === !!n) return {
|
|
14518
14510
|
ok: !1,
|
|
14519
|
-
reason:
|
|
14511
|
+
reason: pf.UnsupportedTriggerType
|
|
14520
14512
|
};
|
|
14521
14513
|
let i = {
|
|
14522
14514
|
displayName: e.displayName,
|
|
@@ -14529,28 +14521,28 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14529
14521
|
values: {
|
|
14530
14522
|
...i,
|
|
14531
14523
|
repeat: Ke.OneTime,
|
|
14532
|
-
runAt:
|
|
14533
|
-
time:
|
|
14524
|
+
runAt: Sf(t),
|
|
14525
|
+
time: _f
|
|
14534
14526
|
}
|
|
14535
14527
|
};
|
|
14536
14528
|
if (!n) return {
|
|
14537
14529
|
ok: !1,
|
|
14538
|
-
reason:
|
|
14530
|
+
reason: pf.UnsupportedTriggerType
|
|
14539
14531
|
};
|
|
14540
|
-
let a =
|
|
14532
|
+
let a = wf(n.fields);
|
|
14541
14533
|
if (!a.ok) return {
|
|
14542
14534
|
ok: !1,
|
|
14543
|
-
reason:
|
|
14535
|
+
reason: pf.UnsupportedCronShape
|
|
14544
14536
|
};
|
|
14545
14537
|
if (a.isHourly) return {
|
|
14546
14538
|
ok: !0,
|
|
14547
14539
|
values: {
|
|
14548
14540
|
...i,
|
|
14549
14541
|
repeat: Ke.Hourly,
|
|
14550
|
-
time:
|
|
14542
|
+
time: _f,
|
|
14551
14543
|
minute: a.minute,
|
|
14552
|
-
...n.startDate ? { startDate:
|
|
14553
|
-
...n.endDate ? { endDate:
|
|
14544
|
+
...n.startDate ? { startDate: Cf(n.startDate) } : {},
|
|
14545
|
+
...n.endDate ? { endDate: Cf(n.endDate) } : {}
|
|
14554
14546
|
}
|
|
14555
14547
|
};
|
|
14556
14548
|
let o = Ke.Daily;
|
|
@@ -14562,11 +14554,11 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14562
14554
|
time: a.time,
|
|
14563
14555
|
...a.dayOfWeek ? { dayOfWeek: a.dayOfWeek } : {},
|
|
14564
14556
|
...a.dayOfMonth ? { dayOfMonth: a.dayOfMonth } : {},
|
|
14565
|
-
...n.startDate ? { startDate:
|
|
14566
|
-
...n.endDate ? { endDate:
|
|
14557
|
+
...n.startDate ? { startDate: Cf(n.startDate) } : {},
|
|
14558
|
+
...n.endDate ? { endDate: Cf(n.endDate) } : {}
|
|
14567
14559
|
}
|
|
14568
14560
|
};
|
|
14569
|
-
},
|
|
14561
|
+
}, Ef = async (e, t) => {
|
|
14570
14562
|
let { existingPaths: n, existingTotalBytes: r, manifestByteLength: i, messages: a } = t, o = [], s = [], c = new Set(n), l = /* @__PURE__ */ new Map();
|
|
14571
14563
|
for (let { path: t } of e) t !== "SKILL.md" && l.set(t, (l.get(t) ?? 0) + 1);
|
|
14572
14564
|
let u = 0, d = /* @__PURE__ */ new Set(), f, p = i, m = 0;
|
|
@@ -14607,7 +14599,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14607
14599
|
batchErrors: s,
|
|
14608
14600
|
manifestCandidate: f
|
|
14609
14601
|
};
|
|
14610
|
-
},
|
|
14602
|
+
}, Df = (e, t) => {
|
|
14611
14603
|
let n = t.mimeType || se(e.path) || "", r = new File([new Uint8Array(t.bytes)], e.name, n ? { type: n } : void 0);
|
|
14612
14604
|
return {
|
|
14613
14605
|
id: e.path,
|
|
@@ -14617,14 +14609,14 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14617
14609
|
status: w.Idle,
|
|
14618
14610
|
file: r
|
|
14619
14611
|
};
|
|
14620
|
-
},
|
|
14612
|
+
}, Of = /* @__PURE__ */ function(e) {
|
|
14621
14613
|
return e.Loading = "loading", e.Loaded = "loaded", e.Error = "error", e.Forbidden = "forbidden", e.NotFound = "not-found", e;
|
|
14622
|
-
}({}),
|
|
14614
|
+
}({}), kf = class extends Error {}, Af = (e, t) => {
|
|
14623
14615
|
let n = e.parentPath ? Dt(e.parentPath) : "", r = `${t.replace(/\/+$/g, "")}/files`;
|
|
14624
14616
|
return n === r ? e.name : n.startsWith(`${r}/`) ? `${n.slice(r.length + 1)}/${e.name}` : n === "files" ? e.name : n.startsWith("files/") ? `${n.slice(6)}/${e.name}` : null;
|
|
14625
|
-
},
|
|
14617
|
+
}, jf = async (e, t, n) => {
|
|
14626
14618
|
let r = await e.downloadSkill(t, n), i = r.headers.get("etag");
|
|
14627
|
-
if (!i) throw new
|
|
14619
|
+
if (!i) throw new kf("Skill ETag is missing");
|
|
14628
14620
|
try {
|
|
14629
14621
|
let e = await r.arrayBuffer(), { manifestText: t, files: n } = ic(new Uint8Array(e));
|
|
14630
14622
|
return {
|
|
@@ -14633,19 +14625,19 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14633
14625
|
files: n
|
|
14634
14626
|
};
|
|
14635
14627
|
} catch {
|
|
14636
|
-
throw new
|
|
14628
|
+
throw new kf("Skill ZIP is invalid");
|
|
14637
14629
|
}
|
|
14638
|
-
},
|
|
14630
|
+
}, Mf = async (e, t, n) => {
|
|
14639
14631
|
let [r, i] = await Promise.all([e.downloadSkillFile(t, n, Ws), e.listSkillFiles({
|
|
14640
14632
|
bucket: t,
|
|
14641
14633
|
path: n,
|
|
14642
14634
|
filePath: "",
|
|
14643
14635
|
recursive: !0
|
|
14644
|
-
})]), a = i.items.find((e) => e.nodeType === "item" &&
|
|
14636
|
+
})]), a = i.items.find((e) => e.nodeType === "item" && Af(e, n) === "SKILL.md"), o = r.headers.get("etag") ?? a?.etag;
|
|
14645
14637
|
if (!o) throw Error("Skill ETag is missing");
|
|
14646
14638
|
let s = i.items.filter((e) => e.nodeType === "item").map((e) => ({
|
|
14647
14639
|
item: e,
|
|
14648
|
-
path:
|
|
14640
|
+
path: Af(e, n)
|
|
14649
14641
|
})).filter((e) => e.path != null && e.path !== "SKILL.md"), c = await Promise.all(s.map(async ({ path: r }) => {
|
|
14650
14642
|
let i = await e.downloadSkillFile(t, n, r);
|
|
14651
14643
|
return [r, new Uint8Array(await i.arrayBuffer())];
|
|
@@ -14655,7 +14647,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14655
14647
|
manifestText: await r.text(),
|
|
14656
14648
|
files: new Map(c)
|
|
14657
14649
|
};
|
|
14658
|
-
},
|
|
14650
|
+
}, Nf = ({ isEditMode: e, bucket: t, skillPath: n, client: r }) => {
|
|
14659
14651
|
let [i, a] = L(e ? "loading" : "loaded"), [o, s] = L(0), [c, l] = L(), u = I(void 0), d = I({}), f = I(void 0), [p, m] = L([]), h = I(/* @__PURE__ */ new Map());
|
|
14660
14652
|
return P(() => {
|
|
14661
14653
|
if (!e || !t) return;
|
|
@@ -14668,11 +14660,11 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14668
14660
|
if (await Promise.resolve(), !i) try {
|
|
14669
14661
|
let e;
|
|
14670
14662
|
try {
|
|
14671
|
-
e = await
|
|
14663
|
+
e = await jf(r, t, n);
|
|
14672
14664
|
} catch (i) {
|
|
14673
14665
|
let a = _t(i);
|
|
14674
|
-
if (!(i instanceof
|
|
14675
|
-
e = await
|
|
14666
|
+
if (!(i instanceof kf) && a !== 400) throw i;
|
|
14667
|
+
e = await Mf(r, t, n);
|
|
14676
14668
|
}
|
|
14677
14669
|
let { frontmatter: o, instructions: s } = rc(e.manifestText);
|
|
14678
14670
|
if (i) return;
|
|
@@ -14711,10 +14703,10 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14711
14703
|
loadedPathRef: f,
|
|
14712
14704
|
retryLoad: () => s((e) => e + 1)
|
|
14713
14705
|
};
|
|
14714
|
-
},
|
|
14706
|
+
}, Pf = (e, t) => JSON.stringify({
|
|
14715
14707
|
values: e,
|
|
14716
14708
|
files: [...t].sort((e, t) => e.path.localeCompare(t.path))
|
|
14717
|
-
}),
|
|
14709
|
+
}), Ff = ({ bucket: e, isEditMode: t, files: n, filesContentRef: r, frontmatterRef: i, loadedPathRef: a, etagRef: o, returnUrl: s, refetchSkills: c, client: l, messages: u, onNavigate: d, onNotify: f }) => {
|
|
14718
14710
|
let [p, m] = L({}), [h, g] = L(), [_, v] = L(), [y, b] = L("idle"), x = I(null), S = N(async (e) => {
|
|
14719
14711
|
switch (_t(e)) {
|
|
14720
14712
|
case 409:
|
|
@@ -14749,7 +14741,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14749
14741
|
m({ name: u.nameInvalid });
|
|
14750
14742
|
return;
|
|
14751
14743
|
}
|
|
14752
|
-
let o =
|
|
14744
|
+
let o = Pf(t, n), p = x.current, h = p != null && p.fingerprint === o, g = a, _, v, y;
|
|
14753
14745
|
h ? {skillManifest: _, filePaths: v, files: y} = p : (_ = sc(i.current, a, t.description, t.instructions), {filePaths: v, files: y} = cc(n, r.current)), b("submitting"), x.current = {
|
|
14754
14746
|
fingerprint: o,
|
|
14755
14747
|
bucket: e,
|
|
@@ -14838,7 +14830,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14838
14830
|
C
|
|
14839
14831
|
])
|
|
14840
14832
|
};
|
|
14841
|
-
},
|
|
14833
|
+
}, If = ({ files: e, setFiles: t, filesContentRef: n, frontmatterRef: r, loadedValues: i, setLoadedValues: a, isEditMode: o, isDirty: s, setSelectedPath: c, messages: l }) => {
|
|
14842
14834
|
let [u, d] = L(!1), f = I(null), p = N(() => {
|
|
14843
14835
|
let t = e.filter((e) => e.kind === Le.File).map((e) => e.path), a = 0;
|
|
14844
14836
|
for (let e of t) a += n.current.get(e)?.bytes.length ?? 0;
|
|
@@ -14868,14 +14860,14 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14868
14860
|
return {
|
|
14869
14861
|
fileActions: F(() => ({
|
|
14870
14862
|
validateBatch: async (e) => {
|
|
14871
|
-
let { results: t, batchErrors: n } = await
|
|
14863
|
+
let { results: t, batchErrors: n } = await Ef(e, p());
|
|
14872
14864
|
return {
|
|
14873
14865
|
results: t,
|
|
14874
14866
|
batchErrors: n
|
|
14875
14867
|
};
|
|
14876
14868
|
},
|
|
14877
14869
|
commitBatch: async (e) => {
|
|
14878
|
-
let { results: c, batchErrors: u, manifestCandidate: d } = await
|
|
14870
|
+
let { results: c, batchErrors: u, manifestCandidate: d } = await Ef(e, p());
|
|
14879
14871
|
if (c.some((e) => e.error !== void 0) || u.length > 0) return { error: u[0]?.message ?? l.saveError };
|
|
14880
14872
|
if (d) {
|
|
14881
14873
|
if (o && d.name !== (i?.name ?? "")) return { error: l.manifestNameMismatch };
|
|
@@ -14928,9 +14920,9 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14928
14920
|
pendingManifestImport: u,
|
|
14929
14921
|
resolveManifestImport: h
|
|
14930
14922
|
};
|
|
14931
|
-
},
|
|
14923
|
+
}, Lf = /* @__PURE__ */ function(e) {
|
|
14932
14924
|
return e.Forbidden = "forbidden", e.Generic = "generic", e;
|
|
14933
|
-
}({}),
|
|
14925
|
+
}({}), Rf = ({ fileId: e, onLoadFile: t }) => {
|
|
14934
14926
|
let [n, r] = L(!1), [i, a] = L(null), [o, s] = L(null);
|
|
14935
14927
|
return P(() => {
|
|
14936
14928
|
let n = !1;
|
|
@@ -14952,7 +14944,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14952
14944
|
content: i,
|
|
14953
14945
|
error: o
|
|
14954
14946
|
};
|
|
14955
|
-
},
|
|
14947
|
+
}, zf = ({ listSkills: e, enabled: t, ready: n }) => {
|
|
14956
14948
|
let [r, i] = L([]), [a, o] = L([]), [s, c] = L([]), [l, u] = L(!0), [d, f] = L(null), p = N(async () => {
|
|
14957
14949
|
try {
|
|
14958
14950
|
let t = await e();
|
|
@@ -14999,9 +14991,9 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
14999
14991
|
p,
|
|
15000
14992
|
m
|
|
15001
14993
|
]);
|
|
15002
|
-
},
|
|
14994
|
+
}, Bf = /* @__PURE__ */ function(e) {
|
|
15003
14995
|
return e.Idle = "idle", e.Loading = "loading", e.Resolved = "resolved", e.Unknown = "unknown", e;
|
|
15004
|
-
}({}),
|
|
14996
|
+
}({}), Vf = { status: "idle" }, Hf = (e) => {
|
|
15005
14997
|
let [t, n] = L({}), r = I(/* @__PURE__ */ new Set());
|
|
15006
14998
|
return {
|
|
15007
14999
|
requestRecipientsCount: N((t) => {
|
|
@@ -15026,21 +15018,21 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
15026
15018
|
}
|
|
15027
15019
|
})());
|
|
15028
15020
|
}, [e]),
|
|
15029
|
-
getRecipientsCount: N((e) => t[e] ??
|
|
15021
|
+
getRecipientsCount: N((e) => t[e] ?? Vf, [t]),
|
|
15030
15022
|
invalidateRecipientsCount: N((e) => {
|
|
15031
15023
|
r.current.delete(e), n(({ [e]: t, ...n }) => n);
|
|
15032
15024
|
}, [])
|
|
15033
15025
|
};
|
|
15034
|
-
},
|
|
15026
|
+
}, Uf = (e, t, n) => {
|
|
15035
15027
|
let r = !!(e.isReadonly || e.sharedWithMe || e.publishedWithMe), i = !r && t != null ? [...new Set(t.map((e) => e.folderPath.join("/")))] : [];
|
|
15036
15028
|
return {
|
|
15037
15029
|
isReadonly: r,
|
|
15038
15030
|
publishedFolders: i,
|
|
15039
|
-
isRevokeVisible: n.status ===
|
|
15031
|
+
isRevokeVisible: n.status === Bf.Unknown || n.status === Bf.Resolved && (n.count ?? 0) > 0,
|
|
15040
15032
|
isPublishApplicable: i.length === 0,
|
|
15041
15033
|
isUnpublishApplicable: i.length > 0
|
|
15042
15034
|
};
|
|
15043
|
-
},
|
|
15035
|
+
}, Wf = ({ activeConversationId: e, items: t, refreshConversations: n, markConversationViewed: r, conversationIdsMatch: i, toPanelConversationId: a }) => {
|
|
15044
15036
|
let o = F(() => e ? a(e) : void 0, [e, a]);
|
|
15045
15037
|
return P(() => {
|
|
15046
15038
|
o && (t.some((e) => i(e.id, o)) || n());
|
|
@@ -15054,7 +15046,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
15054
15046
|
r,
|
|
15055
15047
|
i
|
|
15056
15048
|
]), o;
|
|
15057
|
-
},
|
|
15049
|
+
}, Gf = () => {
|
|
15058
15050
|
let [e, t] = L(null), [n, r] = L(!1), [i, a] = L(null), o = I(null), s = I(!1), c = I(0), l = N((e) => {
|
|
15059
15051
|
c.current += 1, o.current = e, s.current = !1, t(e), r(!1), a(null);
|
|
15060
15052
|
}, []), u = N(() => {
|
|
@@ -15081,14 +15073,14 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
15081
15073
|
close: u,
|
|
15082
15074
|
confirm: d
|
|
15083
15075
|
};
|
|
15084
|
-
},
|
|
15076
|
+
}, Kf = ({ items: e, toPanelConversationId: t }) => F(() => {
|
|
15085
15077
|
let n = new Map(e.map((e) => [t(e.id), e.id])), r = new Map(e.map((e) => [t(e.id), e]));
|
|
15086
15078
|
return {
|
|
15087
15079
|
toContextId: (e) => n.get(e),
|
|
15088
15080
|
getRawItem: (e) => r.get(e)
|
|
15089
15081
|
};
|
|
15090
|
-
}, [e, t]),
|
|
15091
|
-
let c = r(e.id), l =
|
|
15082
|
+
}, [e, t]), qf = (e) => e.sharedWithMe ? b.Shared : e.publishedWithMe ? b.Organization : b.MyChats, Jf = ({ items: e, deployments: t, isDeploymentsLoading: n, toPanelConversationId: r, resolveIconUrl: i, resolveIconTooltip: a, resolveHref: o, resolveTaskBadge: s }) => F(() => e.map((e) => {
|
|
15083
|
+
let c = r(e.id), l = Qu(e.id), u = l ? Pn(t, l) : void 0, d = l ? Et(l.split("/").pop() ?? l) : "", f = s?.(e);
|
|
15092
15084
|
return {
|
|
15093
15085
|
id: c,
|
|
15094
15086
|
title: e.title,
|
|
@@ -15096,7 +15088,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
15096
15088
|
iconUrl: i(u),
|
|
15097
15089
|
iconTooltip: a(u, d),
|
|
15098
15090
|
isIconLoading: n,
|
|
15099
|
-
source:
|
|
15091
|
+
source: qf(e),
|
|
15100
15092
|
href: o(c),
|
|
15101
15093
|
...f == null ? {} : {
|
|
15102
15094
|
showTaskBadge: !0,
|
|
@@ -15113,7 +15105,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
15113
15105
|
a,
|
|
15114
15106
|
o,
|
|
15115
15107
|
s
|
|
15116
|
-
]),
|
|
15108
|
+
]), Yf = ({ accept: e, onFileSelected: t }) => {
|
|
15117
15109
|
let n = I(null);
|
|
15118
15110
|
return ve(() => {
|
|
15119
15111
|
let t = n.current;
|
|
@@ -15128,14 +15120,14 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
15128
15120
|
e.target.value = "", n && t(n);
|
|
15129
15121
|
}, [t])
|
|
15130
15122
|
};
|
|
15131
|
-
},
|
|
15123
|
+
}, Xf = 700, Zf = (e) => (e.split(/[\\/]/).filter(Boolean).pop() ?? "file").replace(/\.\.+/g, ".").replace(/^\.+/, "") || "file", Qf = (e, t = /* @__PURE__ */ new Date()) => `uploads/${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, "0")}/${encodeURIComponent(Zf(e))}`, $f = ({ filesApi: e, bucket: t, onNetworkError: n, debounceMs: r = Xf }) => {
|
|
15132
15124
|
let i = I([]), a = I(null);
|
|
15133
15125
|
return { handleUploadAttachment: N(async (o) => {
|
|
15134
15126
|
if (!t) throw Error("User bucket is not available");
|
|
15135
15127
|
try {
|
|
15136
15128
|
return (await e.uploadFile({
|
|
15137
15129
|
bucket: t,
|
|
15138
|
-
path:
|
|
15130
|
+
path: Qf(o.name),
|
|
15139
15131
|
file: o.file
|
|
15140
15132
|
})).url;
|
|
15141
15133
|
} catch (e) {
|
|
@@ -15155,7 +15147,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
15155
15147
|
e,
|
|
15156
15148
|
n
|
|
15157
15149
|
]) };
|
|
15158
|
-
},
|
|
15150
|
+
}, ep = async (e, t, n) => {
|
|
15159
15151
|
let r = [], i = 0, a = async () => {
|
|
15160
15152
|
let t = i;
|
|
15161
15153
|
if (i += 1, !(t >= e.length)) {
|
|
@@ -15169,11 +15161,11 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
15169
15161
|
}
|
|
15170
15162
|
};
|
|
15171
15163
|
return await Promise.all(Array.from({ length: Math.min(t, e.length) }, a)), r;
|
|
15172
|
-
},
|
|
15164
|
+
}, tp = /* @__PURE__ */ function(e) {
|
|
15173
15165
|
return e.Prepare = "prepare", e.Transfer = "transfer", e.Finalize = "finalize", e;
|
|
15174
|
-
}({}),
|
|
15166
|
+
}({}), np = /* @__PURE__ */ function(e) {
|
|
15175
15167
|
return e.ExportSingle = "exportSingle", e.ExportSingleWithAttachments = "exportSingleWithAttachments", e.ExportAll = "exportAll", e.Import = "import", e;
|
|
15176
|
-
}({}),
|
|
15168
|
+
}({}), rp = {
|
|
15177
15169
|
exportSingle: {
|
|
15178
15170
|
prepare: 20,
|
|
15179
15171
|
transfer: 0,
|
|
@@ -15194,17 +15186,17 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
15194
15186
|
transfer: 70,
|
|
15195
15187
|
finalize: 20
|
|
15196
15188
|
}
|
|
15197
|
-
},
|
|
15189
|
+
}, ip = [
|
|
15198
15190
|
"prepare",
|
|
15199
15191
|
"transfer",
|
|
15200
15192
|
"finalize"
|
|
15201
|
-
],
|
|
15202
|
-
let i =
|
|
15193
|
+
], ap = (e, t) => ip.slice(0, ip.indexOf(t)).reduce((t, n) => t + e[n], 0), op = ({ kind: e, phase: t, completed: n = 0, total: r = 0 }) => {
|
|
15194
|
+
let i = rp[e], a = r > 0 ? Math.min(n / r, 1) : 1, o = ap(i, t) + i[t] * a;
|
|
15203
15195
|
return Math.round(Math.min(Math.max(o, 0), 100));
|
|
15204
|
-
},
|
|
15205
|
-
percent:
|
|
15196
|
+
}, sp = (e, t) => ({
|
|
15197
|
+
percent: op(e),
|
|
15206
15198
|
units: t
|
|
15207
|
-
}),
|
|
15199
|
+
}), cp = () => {
|
|
15208
15200
|
let [e, t] = L([]), n = I(/* @__PURE__ */ new Map()), r = I(/* @__PURE__ */ new Map()), i = N((e, n) => {
|
|
15209
15201
|
t((t) => t.map((t) => t.id === e ? {
|
|
15210
15202
|
...t,
|
|
@@ -15282,24 +15274,24 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
15282
15274
|
dismissAll: m,
|
|
15283
15275
|
startJob: h
|
|
15284
15276
|
};
|
|
15285
|
-
},
|
|
15286
|
-
let n = [], r = { "conversation.json":
|
|
15277
|
+
}, lp = Be("", !0).constructor, up = (e) => e instanceof lp ? e : new lp(e), dp = (e) => e.length > 0 && e.split("/").every((e) => e !== "" && e !== "." && e !== ".."), fp = (e, t) => {
|
|
15278
|
+
let n = [], r = { "conversation.json": up(Be(JSON.stringify(e, null, 2))) };
|
|
15287
15279
|
for (let e of t) {
|
|
15288
|
-
if (!
|
|
15280
|
+
if (!dp(e.path)) {
|
|
15289
15281
|
n.push(e.path);
|
|
15290
15282
|
continue;
|
|
15291
15283
|
}
|
|
15292
|
-
r[`res/${e.path}`] =
|
|
15284
|
+
r[`res/${e.path}`] = up(e.data);
|
|
15293
15285
|
}
|
|
15294
15286
|
let i = He(r);
|
|
15295
15287
|
return {
|
|
15296
15288
|
blob: new Blob([new Uint8Array(i)], { type: "application/zip" }),
|
|
15297
15289
|
skippedPaths: n
|
|
15298
15290
|
};
|
|
15299
|
-
},
|
|
15291
|
+
}, pp = 5, mp = 512 * 1024 * 1024, hp = 429, gp = 5, _p = 2e3, vp = (e) => e instanceof Me && e.response.status === hp, yp = (e, t) => {
|
|
15300
15292
|
let n = Number(e.response.headers.get("Retry-After"));
|
|
15301
|
-
return Number.isFinite(n) && n > 0 ? n * 1e3 :
|
|
15302
|
-
},
|
|
15293
|
+
return Number.isFinite(n) && n > 0 ? n * 1e3 : _p * t;
|
|
15294
|
+
}, bp = (e, t) => new Promise((n) => {
|
|
15303
15295
|
if (t.aborted) {
|
|
15304
15296
|
n();
|
|
15305
15297
|
return;
|
|
@@ -15308,20 +15300,20 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
15308
15300
|
t.addEventListener("abort", () => {
|
|
15309
15301
|
clearTimeout(r), n();
|
|
15310
15302
|
}, { once: !0 });
|
|
15311
|
-
}),
|
|
15303
|
+
}), xp = async (e, t, n) => {
|
|
15312
15304
|
for (let r = 1;; r += 1) try {
|
|
15313
15305
|
return await e.getConversation({ path: t }, { signal: n });
|
|
15314
15306
|
} catch (e) {
|
|
15315
|
-
if (n.aborted || !
|
|
15316
|
-
await
|
|
15307
|
+
if (n.aborted || !vp(e) || r >= gp) throw e;
|
|
15308
|
+
await bp(yp(e, r), n);
|
|
15317
15309
|
}
|
|
15318
|
-
},
|
|
15319
|
-
let l =
|
|
15310
|
+
}, Sp = (e) => !e.sharedWithMe && !e.publishedWithMe, Cp = (e) => e instanceof RangeError, wp = (e) => e === $t.WithoutAttachments ? np.ExportSingle : np.ExportSingleWithAttachments, Tp = ({ conversationsApi: e, filesApi: t, normalizeConversationPath: n, classifyTransferError: r = () => ({}), resolveErrorTraceId: i = async () => void 0, maxArchiveBytes: a = mp, onSuccess: o, onWarning: s, onError: c }) => {
|
|
15311
|
+
let l = cp(), u = N(async (e, n, i) => {
|
|
15320
15312
|
let a = !1, o = !1, s = 0, c = () => {
|
|
15321
15313
|
s += 1, i(s, e.length);
|
|
15322
15314
|
};
|
|
15323
15315
|
return {
|
|
15324
|
-
entries: await
|
|
15316
|
+
entries: await ep(e, pp, async (e) => {
|
|
15325
15317
|
if (n.aborted || o) return;
|
|
15326
15318
|
let i = un(e.fileId);
|
|
15327
15319
|
if (!i) {
|
|
@@ -15351,9 +15343,9 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
15351
15343
|
isUnauthorized: !n.aborted && o
|
|
15352
15344
|
};
|
|
15353
15345
|
}, [r, t]), f = N(async (t, f, p, g, _, v) => {
|
|
15354
|
-
let y =
|
|
15346
|
+
let y = wp(g), b;
|
|
15355
15347
|
try {
|
|
15356
|
-
b = await
|
|
15348
|
+
b = await xp(e, n(f), v);
|
|
15357
15349
|
} catch (e) {
|
|
15358
15350
|
if (v.aborted) return;
|
|
15359
15351
|
if (r(e).isUnauthorized) c?.({
|
|
@@ -15373,9 +15365,9 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
15373
15365
|
return;
|
|
15374
15366
|
}
|
|
15375
15367
|
if (!v.aborted) {
|
|
15376
|
-
l.setJobProgress(t,
|
|
15368
|
+
l.setJobProgress(t, sp({
|
|
15377
15369
|
kind: y,
|
|
15378
|
-
phase:
|
|
15370
|
+
phase: tp.Prepare
|
|
15379
15371
|
}));
|
|
15380
15372
|
try {
|
|
15381
15373
|
if (g === $t.WithoutAttachments) {
|
|
@@ -15386,9 +15378,9 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
15386
15378
|
return;
|
|
15387
15379
|
}
|
|
15388
15380
|
let e = cn(b), { entries: n, anySkipped: r, isUnauthorized: i } = await u(e, v, (e, n) => {
|
|
15389
|
-
l.setJobProgress(t,
|
|
15381
|
+
l.setJobProgress(t, sp({
|
|
15390
15382
|
kind: y,
|
|
15391
|
-
phase:
|
|
15383
|
+
phase: tp.Transfer,
|
|
15392
15384
|
completed: e,
|
|
15393
15385
|
total: n
|
|
15394
15386
|
}, {
|
|
@@ -15405,9 +15397,9 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
15405
15397
|
}), l.failJob(t, d.Unauthorized);
|
|
15406
15398
|
return;
|
|
15407
15399
|
}
|
|
15408
|
-
l.setJobProgress(t,
|
|
15400
|
+
l.setJobProgress(t, sp({
|
|
15409
15401
|
kind: y,
|
|
15410
|
-
phase:
|
|
15402
|
+
phase: tp.Transfer,
|
|
15411
15403
|
completed: e.length,
|
|
15412
15404
|
total: e.length
|
|
15413
15405
|
}));
|
|
@@ -15420,7 +15412,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
15420
15412
|
}), l.failJob(t, d.FileTooLarge), console.error(`Refused to build an export archive of ${f} bytes: over the ${a}-byte limit`);
|
|
15421
15413
|
return;
|
|
15422
15414
|
}
|
|
15423
|
-
let { blob: x, skippedPaths: S } =
|
|
15415
|
+
let { blob: x, skippedPaths: S } = fp(nn([b], []), n), C = r || S.length > 0;
|
|
15424
15416
|
C && s?.({
|
|
15425
15417
|
jobId: t,
|
|
15426
15418
|
code: h.AttachmentSkipped
|
|
@@ -15430,7 +15422,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
15430
15422
|
}), C ? l.warnJob(t, h.AttachmentSkipped) : l.succeedJob(t);
|
|
15431
15423
|
} catch (e) {
|
|
15432
15424
|
if (v.aborted) return;
|
|
15433
|
-
let n =
|
|
15425
|
+
let n = Cp(e) ? d.FileTooLarge : d.Unknown, r = await i(e);
|
|
15434
15426
|
c?.({
|
|
15435
15427
|
jobId: t,
|
|
15436
15428
|
code: n,
|
|
@@ -15457,7 +15449,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
15457
15449
|
}, r);
|
|
15458
15450
|
return l.startJob(i, (a) => f(i, e, t, n, r, a));
|
|
15459
15451
|
}, [l, f]), _ = N(async (t, a, s) => {
|
|
15460
|
-
let u =
|
|
15452
|
+
let u = np.ExportAll, f = [], p;
|
|
15461
15453
|
do {
|
|
15462
15454
|
if (s.aborted) return;
|
|
15463
15455
|
let n;
|
|
@@ -15480,20 +15472,20 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
15480
15472
|
console.error("Failed to list conversations for export", e);
|
|
15481
15473
|
return;
|
|
15482
15474
|
}
|
|
15483
|
-
f.push(...n.items.filter(
|
|
15475
|
+
f.push(...n.items.filter(Sp).map((e) => ({
|
|
15484
15476
|
id: e.id,
|
|
15485
15477
|
title: e.title
|
|
15486
15478
|
}))), p = n.nextToken;
|
|
15487
15479
|
} while (p);
|
|
15488
|
-
l.setJobProgress(t,
|
|
15480
|
+
l.setJobProgress(t, sp({
|
|
15489
15481
|
kind: u,
|
|
15490
|
-
phase:
|
|
15482
|
+
phase: tp.Prepare
|
|
15491
15483
|
}));
|
|
15492
15484
|
let h = [];
|
|
15493
15485
|
for (let a of f) {
|
|
15494
15486
|
if (s.aborted) return;
|
|
15495
15487
|
try {
|
|
15496
|
-
let t = await
|
|
15488
|
+
let t = await xp(e, n(a.id), s);
|
|
15497
15489
|
h.push(t);
|
|
15498
15490
|
} catch (e) {
|
|
15499
15491
|
if (s.aborted) return;
|
|
@@ -15523,9 +15515,9 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
15523
15515
|
}), l.failJob(t, d.Unknown), console.error("Aborted export-all: failed to fetch conversation", e);
|
|
15524
15516
|
return;
|
|
15525
15517
|
} finally {
|
|
15526
|
-
l.setJobProgress(t,
|
|
15518
|
+
l.setJobProgress(t, sp({
|
|
15527
15519
|
kind: u,
|
|
15528
|
-
phase:
|
|
15520
|
+
phase: tp.Transfer,
|
|
15529
15521
|
completed: h.length,
|
|
15530
15522
|
total: f.length
|
|
15531
15523
|
}, {
|
|
@@ -15538,7 +15530,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
15538
15530
|
if (!s.aborted) try {
|
|
15539
15531
|
de(rn(nn(h, [])), a), o?.({ jobId: t }), l.succeedJob(t);
|
|
15540
15532
|
} catch (e) {
|
|
15541
|
-
let n =
|
|
15533
|
+
let n = Cp(e) ? d.FileTooLarge : d.Unknown, r = await i(e);
|
|
15542
15534
|
c?.({
|
|
15543
15535
|
jobId: t,
|
|
15544
15536
|
code: n,
|
|
@@ -15566,16 +15558,16 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
15566
15558
|
retryJob: l.retryJob,
|
|
15567
15559
|
dismissAll: l.dismissAll
|
|
15568
15560
|
};
|
|
15569
|
-
},
|
|
15561
|
+
}, Ep = (e) => {
|
|
15570
15562
|
if (!e.url) throw Error(`Attachment "${e.name}" has not been uploaded`);
|
|
15571
15563
|
return {
|
|
15572
15564
|
type: e.contentType,
|
|
15573
15565
|
title: e.name,
|
|
15574
15566
|
url: e.url
|
|
15575
15567
|
};
|
|
15576
|
-
},
|
|
15577
|
-
if (e.length) return e.map(
|
|
15578
|
-
},
|
|
15568
|
+
}, Dp = (e) => {
|
|
15569
|
+
if (e.length) return e.map(Ep);
|
|
15570
|
+
}, Op = (e, t, n) => {
|
|
15579
15571
|
let r = new Date(Date.now()).toISOString();
|
|
15580
15572
|
return {
|
|
15581
15573
|
userMessage: {
|
|
@@ -15591,30 +15583,30 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
15591
15583
|
...n ? { deploymentId: n } : {}
|
|
15592
15584
|
}
|
|
15593
15585
|
};
|
|
15594
|
-
},
|
|
15586
|
+
}, kp = (e) => e != null && Object.keys(e).length > 0, Ap = (e, t, n, r) => {
|
|
15595
15587
|
if (t !== e.content || r.length > 0) return !0;
|
|
15596
15588
|
let i = e.custom_content?.attachments?.length ?? 0;
|
|
15597
15589
|
return n.length !== i;
|
|
15598
|
-
},
|
|
15590
|
+
}, jp = (e, t) => {
|
|
15599
15591
|
let { populateText: n } = e["dial:widgetOptions"];
|
|
15600
|
-
return n == null && t ? t :
|
|
15601
|
-
},
|
|
15592
|
+
return n == null && t ? t : ud(e);
|
|
15593
|
+
}, Mp = (e, t) => {
|
|
15602
15594
|
let { populateText: n, submit: r } = e["dial:widgetOptions"];
|
|
15603
|
-
return r && n == null ? "" : t ??
|
|
15604
|
-
},
|
|
15595
|
+
return r && n == null ? "" : t ?? ud(e);
|
|
15596
|
+
}, Np = (e) => {
|
|
15605
15597
|
let t = e.indexOf("/");
|
|
15606
15598
|
return H(t === -1 ? e : e.substring(t + 1));
|
|
15607
|
-
},
|
|
15608
|
-
let [m, h] = L(null), [g, _] = L(/* @__PURE__ */ new Set()), [v, y] = L(null), { handleUploadAttachment: b } =
|
|
15599
|
+
}, Pp = ({ conversation: e, conversationId: t, bucket: n, isStreaming: r, startStream: i, state: { setConversation: a, conversationRef: o }, filesApi: s, conversationsApi: c, rateApi: l, resolveModelId: u, onConversationDeleted: d, showNetworkError: f, toolConfigurationValue: p }) => {
|
|
15600
|
+
let [m, h] = L(null), [g, _] = L(/* @__PURE__ */ new Set()), [v, y] = L(null), { handleUploadAttachment: b } = $f({
|
|
15609
15601
|
filesApi: s,
|
|
15610
15602
|
bucket: n,
|
|
15611
15603
|
onNetworkError: f
|
|
15612
15604
|
}), x = N(async (n, r) => {
|
|
15613
15605
|
if (!t || !e) return;
|
|
15614
|
-
let s =
|
|
15606
|
+
let s = Dp(r), c = kp(p), l = s?.length || c ? {
|
|
15615
15607
|
...s?.length ? { attachments: s } : {},
|
|
15616
15608
|
...c ? { configuration_value: p } : {}
|
|
15617
|
-
} : void 0, d = u(), { userMessage: f, assistantMessage: m } =
|
|
15609
|
+
} : void 0, d = u(), { userMessage: f, assistantMessage: m } = Op(n, l, d);
|
|
15618
15610
|
a((e) => {
|
|
15619
15611
|
if (!e) return e;
|
|
15620
15612
|
let t = {
|
|
@@ -15669,7 +15661,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
15669
15661
|
}, [r]), T = N(() => {
|
|
15670
15662
|
if (!t || m == null) return;
|
|
15671
15663
|
h(null);
|
|
15672
|
-
let e =
|
|
15664
|
+
let e = Np(t);
|
|
15673
15665
|
a((t) => {
|
|
15674
15666
|
if (!t) return t;
|
|
15675
15667
|
let n = m;
|
|
@@ -15704,7 +15696,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
15704
15696
|
} : e)
|
|
15705
15697
|
};
|
|
15706
15698
|
a(() => (o.current = d, d));
|
|
15707
|
-
let f =
|
|
15699
|
+
let f = Np(t), p = () => {
|
|
15708
15700
|
a((e) => e && {
|
|
15709
15701
|
...e,
|
|
15710
15702
|
messages: e.messages.map((e, t) => t === n ? {
|
|
@@ -15744,10 +15736,10 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
15744
15736
|
a
|
|
15745
15737
|
]), D = N((n, r, s) => {
|
|
15746
15738
|
if (!t || !e) return;
|
|
15747
|
-
let c = s ?? n.title, l =
|
|
15739
|
+
let c = s ?? n.title, l = Mp(n, s), d = r ? { [r]: n.const } : void 0, f = kp(p), m = d || f ? {
|
|
15748
15740
|
...d ? { form_value: d } : {},
|
|
15749
15741
|
...f ? { configuration_value: p } : {}
|
|
15750
|
-
} : void 0, h = u(), { userMessage: g, assistantMessage: _ } =
|
|
15742
|
+
} : void 0, h = u(), { userMessage: g, assistantMessage: _ } = Op(c, m, h);
|
|
15751
15743
|
a((e) => {
|
|
15752
15744
|
if (!e) return e;
|
|
15753
15745
|
let t = {
|
|
@@ -15807,14 +15799,14 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
15807
15799
|
let d = n;
|
|
15808
15800
|
if (d === -1 || e.messages[d].role !== C.User) return;
|
|
15809
15801
|
let f = e.messages[d];
|
|
15810
|
-
if (!
|
|
15802
|
+
if (!Ap(f, s, c, l)) {
|
|
15811
15803
|
_((e) => {
|
|
15812
15804
|
let t = new Set(e);
|
|
15813
15805
|
return t.delete(d), t;
|
|
15814
15806
|
});
|
|
15815
15807
|
return;
|
|
15816
15808
|
}
|
|
15817
|
-
let p =
|
|
15809
|
+
let p = Dp(l), m = new Set(c.map((e) => e.id)), h = [...(f.custom_content?.attachments ?? []).filter((e) => {
|
|
15818
15810
|
let t = e.url ?? e.data ?? e.title;
|
|
15819
15811
|
return m.has(t);
|
|
15820
15812
|
}), ...p ?? []], { attachments: g, ...v } = f.custom_content ?? {}, y = h.length > 0 ? {
|
|
@@ -15854,18 +15846,18 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
15854
15846
|
pendingStarterContext: v,
|
|
15855
15847
|
setPendingStarterContext: y
|
|
15856
15848
|
};
|
|
15857
|
-
},
|
|
15849
|
+
}, Fp = (e) => {
|
|
15858
15850
|
let t = e.lastIndexOf("."), n = t > 0;
|
|
15859
15851
|
return {
|
|
15860
15852
|
base: n ? e.slice(0, t) : e,
|
|
15861
15853
|
extension: n ? e.slice(t) : ""
|
|
15862
15854
|
};
|
|
15863
|
-
},
|
|
15855
|
+
}, Ip = (e) => (e.split(/[\\/]/).filter(Boolean).pop() ?? "file").replace(/\.\.+/g, ".").replace(/^\.+/, "") || "file", Lp = (e, t, n) => n === 0 ? `${e}${t}` : `${e} (${n})${t}`, Rp = (e) => {
|
|
15864
15856
|
let t = e?.date ?? /* @__PURE__ */ new Date(), n = new Set(e?.existingNames);
|
|
15865
15857
|
return {
|
|
15866
15858
|
allocate: (e) => {
|
|
15867
|
-
let { base: r, extension: i } = Ip(
|
|
15868
|
-
for (; n.has(o);) a += 1, o =
|
|
15859
|
+
let { base: r, extension: i } = Fp(Ip(e)), a = 0, o = Lp(r, i, a);
|
|
15860
|
+
for (; n.has(o);) a += 1, o = Lp(r, i, a);
|
|
15869
15861
|
return n.add(o), {
|
|
15870
15862
|
path: `uploads/${Qt(t)}/${encodeURIComponent(o)}`,
|
|
15871
15863
|
fileName: o,
|
|
@@ -15876,34 +15868,34 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
15876
15868
|
n.add(e);
|
|
15877
15869
|
}
|
|
15878
15870
|
};
|
|
15879
|
-
},
|
|
15871
|
+
}, zp = "conversation.json", Bp = /^conversations\/.*\.json$/, Vp = "res/", Hp = (e) => e.find((e) => e === zp) ?? e.find((e) => Bp.test(e)) ?? e.find((e) => !e.includes("/") && e.toLowerCase().endsWith(".json")), Up = (e) => new Promise((t, n) => {
|
|
15880
15872
|
let r = new FileReader();
|
|
15881
15873
|
r.onload = () => t(new Uint8Array(r.result)), r.onerror = () => n(r.error), r.readAsArrayBuffer(e);
|
|
15882
|
-
}),
|
|
15883
|
-
let t = await
|
|
15874
|
+
}), Wp = async (e) => {
|
|
15875
|
+
let t = await Up(e), n;
|
|
15884
15876
|
try {
|
|
15885
15877
|
n = Ve(t);
|
|
15886
15878
|
} catch {
|
|
15887
15879
|
throw new dn("Import file is not a valid archive");
|
|
15888
15880
|
}
|
|
15889
|
-
let r = Object.keys(n), i =
|
|
15881
|
+
let r = Object.keys(n), i = Hp(r);
|
|
15890
15882
|
if (!i) throw new dn("Archive does not contain a readable conversation-JSON entry");
|
|
15891
15883
|
let a = mn(ze(n[i])), o = /* @__PURE__ */ new Map();
|
|
15892
15884
|
for (let e of r) {
|
|
15893
|
-
if (e.endsWith("/") || !e.startsWith(
|
|
15885
|
+
if (e.endsWith("/") || !e.startsWith(Vp)) continue;
|
|
15894
15886
|
let t = e.slice(4);
|
|
15895
|
-
!t || !
|
|
15887
|
+
!t || !dp(t) || o.set(t, n[e]);
|
|
15896
15888
|
}
|
|
15897
15889
|
return {
|
|
15898
15890
|
envelope: a,
|
|
15899
15891
|
attachments: o
|
|
15900
15892
|
};
|
|
15901
|
-
},
|
|
15893
|
+
}, Gp = 5, Kp = 5, qp = (e) => /\.(dial|zip)$/i.test(e.name), Jp = (e) => new Promise((t, n) => {
|
|
15902
15894
|
let r = new FileReader();
|
|
15903
15895
|
r.onload = () => t(r.result), r.onerror = () => n(r.error), r.readAsText(e);
|
|
15904
|
-
}),
|
|
15905
|
-
if (
|
|
15906
|
-
let { envelope: t, attachments: n } = await
|
|
15896
|
+
}), Yp = async (e) => {
|
|
15897
|
+
if (qp(e)) {
|
|
15898
|
+
let { envelope: t, attachments: n } = await Wp(e);
|
|
15907
15899
|
return {
|
|
15908
15900
|
history: t.history,
|
|
15909
15901
|
attachments: n,
|
|
@@ -15911,15 +15903,15 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
15911
15903
|
};
|
|
15912
15904
|
}
|
|
15913
15905
|
return {
|
|
15914
|
-
history: mn(await
|
|
15906
|
+
history: mn(await Jp(e)).history,
|
|
15915
15907
|
attachments: /* @__PURE__ */ new Map(),
|
|
15916
15908
|
isArchive: !1
|
|
15917
15909
|
};
|
|
15918
|
-
},
|
|
15919
|
-
let { plan: c, skippedNames: l } = wn(e, t, r), u = !1, d = await
|
|
15910
|
+
}, Xp = async (e, t, n, r, i, a, o, s) => {
|
|
15911
|
+
let { plan: c, skippedNames: l } = wn(e, t, r), u = !1, d = await ep(c, Gp, async (e) => {
|
|
15920
15912
|
if (s.aborted || u) return;
|
|
15921
15913
|
let t = e.allocated;
|
|
15922
|
-
for (let c = 0; c <=
|
|
15914
|
+
for (let c = 0; c <= Kp; c += 1) try {
|
|
15923
15915
|
let r = new File([new Uint8Array(e.bytes)], t.fileName), a = await i.uploadFile({
|
|
15924
15916
|
bucket: n,
|
|
15925
15917
|
path: t.path,
|
|
@@ -15938,7 +15930,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
15938
15930
|
u = !0;
|
|
15939
15931
|
return;
|
|
15940
15932
|
}
|
|
15941
|
-
if (!(typeof n == "object" && n && "response" in n && n.response?.status === 409) || c ===
|
|
15933
|
+
if (!(typeof n == "object" && n && "response" in n && n.response?.status === 409) || c === Kp) return o(), {
|
|
15942
15934
|
kind: "skipped",
|
|
15943
15935
|
name: e.originalFileName
|
|
15944
15936
|
};
|
|
@@ -15958,8 +15950,8 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
15958
15950
|
skippedNames: s.aborted || u ? [] : p,
|
|
15959
15951
|
isUnauthorized: !s.aborted && u
|
|
15960
15952
|
};
|
|
15961
|
-
},
|
|
15962
|
-
let l =
|
|
15953
|
+
}, Zp = ({ conversationsApi: e, filesApi: t, bucket: n, onImported: r, classifyTransferError: i = () => ({}), resolveErrorTraceId: a = async () => void 0, onSuccess: o, onWarning: s, onError: c }) => {
|
|
15954
|
+
let l = cp(), u = N(async (u, f, p) => {
|
|
15963
15955
|
if (!n) {
|
|
15964
15956
|
c?.({
|
|
15965
15957
|
jobId: u,
|
|
@@ -15967,10 +15959,10 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
15967
15959
|
}), l.failJob(u, d.MissingBucket);
|
|
15968
15960
|
return;
|
|
15969
15961
|
}
|
|
15970
|
-
let g =
|
|
15971
|
-
v += 1, l.setJobProgress(u,
|
|
15962
|
+
let g = np.Import, _ = f.attachments.size, v = 0, y = () => {
|
|
15963
|
+
v += 1, l.setJobProgress(u, sp({
|
|
15972
15964
|
kind: g,
|
|
15973
|
-
phase:
|
|
15965
|
+
phase: tp.Transfer,
|
|
15974
15966
|
completed: v,
|
|
15975
15967
|
total: _
|
|
15976
15968
|
}, {
|
|
@@ -15979,9 +15971,9 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
15979
15971
|
kind: m.Attachment
|
|
15980
15972
|
}));
|
|
15981
15973
|
}, b = (e) => {
|
|
15982
|
-
l.setJobProgress(u,
|
|
15974
|
+
l.setJobProgress(u, sp({
|
|
15983
15975
|
kind: g,
|
|
15984
|
-
phase:
|
|
15976
|
+
phase: tp.Finalize,
|
|
15985
15977
|
completed: e,
|
|
15986
15978
|
total: f.history.length
|
|
15987
15979
|
}, {
|
|
@@ -16008,17 +16000,17 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
16008
16000
|
}
|
|
16009
16001
|
console.error("Failed to list the upload folder for attachment name disambiguation", e);
|
|
16010
16002
|
}
|
|
16011
|
-
O =
|
|
16003
|
+
O = Rp({
|
|
16012
16004
|
date: E,
|
|
16013
16005
|
existingNames: r
|
|
16014
16006
|
});
|
|
16015
16007
|
}
|
|
16016
|
-
l.setJobProgress(u,
|
|
16008
|
+
l.setJobProgress(u, sp({
|
|
16017
16009
|
kind: g,
|
|
16018
|
-
phase:
|
|
16019
|
-
})), _ === 0 && l.setJobProgress(u,
|
|
16010
|
+
phase: tp.Prepare
|
|
16011
|
+
})), _ === 0 && l.setJobProgress(u, sp({
|
|
16020
16012
|
kind: g,
|
|
16021
|
-
phase:
|
|
16013
|
+
phase: tp.Transfer
|
|
16022
16014
|
}));
|
|
16023
16015
|
for (let r of f.history) {
|
|
16024
16016
|
if (p.aborted) return;
|
|
@@ -16026,7 +16018,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
16026
16018
|
try {
|
|
16027
16019
|
let i = /* @__PURE__ */ new Map();
|
|
16028
16020
|
if (f.isArchive && O) {
|
|
16029
|
-
let e = await
|
|
16021
|
+
let e = await Xp(r, f.attachments, n, O, t, D, y, p);
|
|
16030
16022
|
if (p.aborted) return;
|
|
16031
16023
|
if (e.isUnauthorized) {
|
|
16032
16024
|
w = !0;
|
|
@@ -16095,7 +16087,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
16095
16087
|
]), f = N(async (e) => {
|
|
16096
16088
|
let t;
|
|
16097
16089
|
try {
|
|
16098
|
-
t = await
|
|
16090
|
+
t = await Yp(e);
|
|
16099
16091
|
} catch (e) {
|
|
16100
16092
|
c?.({
|
|
16101
16093
|
jobId: k(),
|
|
@@ -16122,7 +16114,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
16122
16114
|
retryJob: l.retryJob,
|
|
16123
16115
|
dismissAll: l.dismissAll
|
|
16124
16116
|
};
|
|
16125
|
-
},
|
|
16117
|
+
}, Qp = 80, $p = 1, em = ({ messages: e, isAssistantTyping: t, conversationId: n }) => {
|
|
16126
16118
|
let [r, i] = L(!1), a = I(null), o = I(null), s = I(null), c = I(!1), l = I(!1), u = I(null), d = I(/* @__PURE__ */ new Map()), f = N((e, t) => {
|
|
16127
16119
|
t ? d.current.set(e, t) : d.current.delete(e);
|
|
16128
16120
|
}, []), p = I(null), m = N((e) => {
|
|
@@ -16169,7 +16161,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
16169
16161
|
return e == null || t == null ? null : Math.max(e, t);
|
|
16170
16162
|
}, [C]), T = N(() => {
|
|
16171
16163
|
let e = a.current, t = w();
|
|
16172
|
-
!e || t == null || e.scrollTop > t +
|
|
16164
|
+
!e || t == null || e.scrollTop > t + $p && (e.scrollTop = t);
|
|
16173
16165
|
}, [w]), E = N((e) => {
|
|
16174
16166
|
let t = s.current, n = C();
|
|
16175
16167
|
if (!t || n == null) return;
|
|
@@ -16184,7 +16176,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
16184
16176
|
S
|
|
16185
16177
|
]), O = N(() => {
|
|
16186
16178
|
let e = y();
|
|
16187
|
-
e != null && i(e >=
|
|
16179
|
+
e != null && i(e >= Qp);
|
|
16188
16180
|
}, [y]), ee = I(e.length), te = I(null);
|
|
16189
16181
|
ve(() => {
|
|
16190
16182
|
let r = e.length !== ee.current, i = n !== te.current, a = () => {
|
|
@@ -16239,9 +16231,12 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
16239
16231
|
}, [v]),
|
|
16240
16232
|
armAnchor: m
|
|
16241
16233
|
};
|
|
16234
|
+
}, tm = (e) => {
|
|
16235
|
+
let t = e.custom_content;
|
|
16236
|
+
return !!e.content || e.responseId != null || !!t?.attachments?.length || !!t?.stages?.length || !!t?.annotations?.length || !!t?.form_schema || t?.state != null;
|
|
16242
16237
|
}, nm = (e) => {
|
|
16243
16238
|
let t = e.messages[e.messages.length - 1];
|
|
16244
|
-
return !!t && t.role === C.Assistant && !t
|
|
16239
|
+
return !!t && t.role === C.Assistant && !tm(t) && t.streamErrorMessage == null && !t.wasStoppedByUser;
|
|
16245
16240
|
}, rm = (e, t) => {
|
|
16246
16241
|
let n = [...e];
|
|
16247
16242
|
for (let e of t) {
|
|
@@ -16327,7 +16322,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
16327
16322
|
P(() => {
|
|
16328
16323
|
v.current = e;
|
|
16329
16324
|
}, [e]);
|
|
16330
|
-
let y = N((e) =>
|
|
16325
|
+
let y = N((e) => Np(v.current ?? "") === e, []), b = N((e) => {
|
|
16331
16326
|
u((t) => {
|
|
16332
16327
|
if (t.has(e)) return t;
|
|
16333
16328
|
let n = new Set(t);
|
|
@@ -16340,7 +16335,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
16340
16335
|
return n.delete(e), n;
|
|
16341
16336
|
});
|
|
16342
16337
|
}, []), S = N((e, c, l, u, d, h, v = Ne.Append) => {
|
|
16343
|
-
let S = h ?? k(), C =
|
|
16338
|
+
let S = h ?? k(), C = Np(e);
|
|
16344
16339
|
p.current = S, m.current = C, f(C);
|
|
16345
16340
|
let w;
|
|
16346
16341
|
v === Ne.Regenerate ? w = l : v === Ne.Edit && (w = l - 1);
|
|
@@ -16416,12 +16411,12 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
16416
16411
|
s,
|
|
16417
16412
|
r
|
|
16418
16413
|
]), C = N((e, t) => {
|
|
16419
|
-
let n =
|
|
16414
|
+
let n = Np(e), r = g.current.get(n);
|
|
16420
16415
|
return r ? um(t, r) : t;
|
|
16421
16416
|
}, []), w = N(() => {
|
|
16422
16417
|
let t = p.current;
|
|
16423
16418
|
if (!t || !e) return;
|
|
16424
|
-
let n =
|
|
16419
|
+
let n = Np(e);
|
|
16425
16420
|
m.current === n && (_.current.add(t), s?.notifyStopGenerating?.(), r.stopCompletion({
|
|
16426
16421
|
generationId: t,
|
|
16427
16422
|
path: n
|
|
@@ -16436,7 +16431,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
16436
16431
|
r
|
|
16437
16432
|
]), T = N((e, i) => {
|
|
16438
16433
|
if (!nm(i)) return;
|
|
16439
|
-
let a =
|
|
16434
|
+
let a = Np(e);
|
|
16440
16435
|
if (h.current.has(a)) return;
|
|
16441
16436
|
h.current.add(a), b(a);
|
|
16442
16437
|
let o = new AbortController(), s = (e) => {
|
|
@@ -16494,7 +16489,7 @@ var Nu = (e) => Au.sanitize(e, ju), Pu = (e) => Au.sanitize(e, Mu), Fu = (e) =>
|
|
|
16494
16489
|
x,
|
|
16495
16490
|
y,
|
|
16496
16491
|
r
|
|
16497
|
-
]), E = e != null && l.has(
|
|
16492
|
+
]), E = e != null && l.has(Np(e)), D = e == null ? null : Np(e);
|
|
16498
16493
|
return {
|
|
16499
16494
|
startStream: S,
|
|
16500
16495
|
handleStop: w,
|
|
@@ -17812,9 +17807,9 @@ var uh = (e) => !ah.has(e), dh = (e) => e && e === Math.floor(e) && e > 0 && isF
|
|
|
17812
17807
|
P(() => {
|
|
17813
17808
|
l.current = s;
|
|
17814
17809
|
}, [s]);
|
|
17815
|
-
let [u, d] = L(() => /* @__PURE__ */ new Map()), [f, p] = L(!0), [m, h] = L(null), [g, _] = L(0), [v, y] = L(void 0), [b, x] = L(() => /* @__PURE__ */ new Set()), S = I(/* @__PURE__ */ new Map()), [C, w] = L(!1), [T, E] = L(null), D = I(null), O = I(null), ee = I(/* @__PURE__ */ new Set()), te = I(/* @__PURE__ */ new Set()), [ne, re] = L(() => /* @__PURE__ */ new Set()), [ie, k] = L(() => /* @__PURE__ */ new Set()), [ae,
|
|
17810
|
+
let [u, d] = L(() => /* @__PURE__ */ new Map()), [f, p] = L(!0), [m, h] = L(null), [g, _] = L(0), [v, y] = L(void 0), [b, x] = L(() => /* @__PURE__ */ new Set()), S = I(/* @__PURE__ */ new Map()), [C, w] = L(!1), [T, E] = L(null), D = I(null), O = I(null), ee = I(/* @__PURE__ */ new Set()), te = I(/* @__PURE__ */ new Set()), [ne, re] = L(() => /* @__PURE__ */ new Set()), [ie, k] = L(() => /* @__PURE__ */ new Set()), [ae, A] = L(() => /* @__PURE__ */ new Set()), se = I(r);
|
|
17816
17811
|
P(() => {
|
|
17817
|
-
|
|
17812
|
+
se.current !== r && (se.current = r, c(/* @__PURE__ */ new Map()), d(/* @__PURE__ */ new Map()), o(""), y(void 0), S.current = /* @__PURE__ */ new Map(), ee.current = /* @__PURE__ */ new Set(), te.current = /* @__PURE__ */ new Set(), k(/* @__PURE__ */ new Set()), A(/* @__PURE__ */ new Set()), D.current != null && (clearTimeout(D.current), D.current = null), O.current?.(), O.current = null, E(null), w(!1), re(/* @__PURE__ */ new Set()));
|
|
17818
17813
|
}, [r]), P(() => () => {
|
|
17819
17814
|
D.current != null && clearTimeout(D.current), O.current?.();
|
|
17820
17815
|
}, []), P(() => {
|
|
@@ -17827,8 +17822,14 @@ var uh = (e) => !ah.has(e), dh = (e) => e && e === Math.floor(e) && e > 0 && isF
|
|
|
17827
17822
|
bucket: e.bucket ?? "",
|
|
17828
17823
|
dialCorePath: e.path
|
|
17829
17824
|
}]))));
|
|
17830
|
-
}).catch(() => {
|
|
17831
|
-
|
|
17825
|
+
}).catch((e) => {
|
|
17826
|
+
if (!i) {
|
|
17827
|
+
if (a !== "" && _t(e) === 404) {
|
|
17828
|
+
o(oe(a));
|
|
17829
|
+
return;
|
|
17830
|
+
}
|
|
17831
|
+
h("dialFileManager.error");
|
|
17832
|
+
}
|
|
17832
17833
|
}).finally(() => {
|
|
17833
17834
|
i || p(!1);
|
|
17834
17835
|
}), () => {
|
|
@@ -17861,7 +17862,7 @@ var uh = (e) => !ah.has(e), dh = (e) => e && e === Math.floor(e) && e > 0 && isF
|
|
|
17861
17862
|
g,
|
|
17862
17863
|
n
|
|
17863
17864
|
]);
|
|
17864
|
-
let
|
|
17865
|
+
let ce = F(() => [{
|
|
17865
17866
|
id: t,
|
|
17866
17867
|
name: n,
|
|
17867
17868
|
path: `/${n}`,
|
|
@@ -17875,7 +17876,7 @@ var uh = (e) => !ah.has(e), dh = (e) => e && e === Math.floor(e) && e > 0 && isF
|
|
|
17875
17876
|
u,
|
|
17876
17877
|
n,
|
|
17877
17878
|
t
|
|
17878
|
-
]),
|
|
17879
|
+
]), le = N((e) => {
|
|
17879
17880
|
if (e == null) {
|
|
17880
17881
|
o("");
|
|
17881
17882
|
return;
|
|
@@ -17893,9 +17894,9 @@ var uh = (e) => !ah.has(e), dh = (e) => e && e === Math.floor(e) && e > 0 && isF
|
|
|
17893
17894
|
i = t.startsWith(r) ? t.slice(r.length) : t;
|
|
17894
17895
|
}
|
|
17895
17896
|
o(i && !i.endsWith("/") ? `${i}/` : i);
|
|
17896
|
-
}, [n]),
|
|
17897
|
+
}, [n]), ue = N(() => {
|
|
17897
17898
|
_((e) => e + 1);
|
|
17898
|
-
}, []),
|
|
17899
|
+
}, []), de = ue, fe = N((o) => {
|
|
17899
17900
|
if (o.length === 0) return;
|
|
17900
17901
|
let s = new Set([...ne].map((e) => Bm(e, n))), l = (e) => e === a || a.startsWith(e) || s.has(e), u = o.filter((e) => !l(e)), f = o.filter((e) => l(e) && e !== a);
|
|
17901
17902
|
u.length > 0 && (c((e) => {
|
|
@@ -17925,11 +17926,11 @@ var uh = (e) => !ah.has(e), dh = (e) => e && e === Math.floor(e) && e > 0 && isF
|
|
|
17925
17926
|
ne,
|
|
17926
17927
|
n,
|
|
17927
17928
|
i
|
|
17928
|
-
]),
|
|
17929
|
+
]), pe = N((e, t, n) => {
|
|
17929
17930
|
c((r) => Jm(r, e, t, n));
|
|
17930
|
-
}, []),
|
|
17931
|
+
}, []), me = N((a) => {
|
|
17931
17932
|
let o = a == null ? "" : Bm(a, n), s = a ?? `/${n}`;
|
|
17932
|
-
if (
|
|
17933
|
+
if (A((e) => {
|
|
17933
17934
|
if (e.has(s)) return e;
|
|
17934
17935
|
let t = new Set(e);
|
|
17935
17936
|
return t.add(s), t;
|
|
@@ -17967,7 +17968,7 @@ var uh = (e) => !ah.has(e), dh = (e) => e && e === Math.floor(e) && e > 0 && isF
|
|
|
17967
17968
|
e,
|
|
17968
17969
|
i,
|
|
17969
17970
|
n
|
|
17970
|
-
]),
|
|
17971
|
+
]), he = F(() => {
|
|
17971
17972
|
let e = /* @__PURE__ */ new Set(), t = new Set([...ne, ...ae]);
|
|
17972
17973
|
for (let r of t) {
|
|
17973
17974
|
let t = Bm(r, n);
|
|
@@ -17979,7 +17980,7 @@ var uh = (e) => !ah.has(e), dh = (e) => e && e === Math.floor(e) && e > 0 && isF
|
|
|
17979
17980
|
ae,
|
|
17980
17981
|
s,
|
|
17981
17982
|
n
|
|
17982
|
-
]),
|
|
17983
|
+
]), j = N((a) => {
|
|
17983
17984
|
ne.forEach((e) => {
|
|
17984
17985
|
a.has(e) || te.current.delete(Bm(e, n));
|
|
17985
17986
|
}), re(a), [...a].filter((e) => {
|
|
@@ -18011,9 +18012,9 @@ var uh = (e) => !ah.has(e), dh = (e) => e && e === Math.floor(e) && e > 0 && isF
|
|
|
18011
18012
|
ne,
|
|
18012
18013
|
i,
|
|
18013
18014
|
n
|
|
18014
|
-
]),
|
|
18015
|
+
]), ge = N(() => {
|
|
18015
18016
|
D.current != null && (clearTimeout(D.current), D.current = null), O.current?.(), O.current = null, E(null), w(!1);
|
|
18016
|
-
}, []),
|
|
18017
|
+
}, []), M = N((i, o) => {
|
|
18017
18018
|
if (D.current != null && (clearTimeout(D.current), D.current = null), O.current?.(), O.current = null, !o.trim()) {
|
|
18018
18019
|
E(null), w(!1);
|
|
18019
18020
|
return;
|
|
@@ -18047,41 +18048,41 @@ var uh = (e) => !ah.has(e), dh = (e) => e && e === Math.floor(e) && e > 0 && isF
|
|
|
18047
18048
|
e,
|
|
18048
18049
|
a,
|
|
18049
18050
|
n
|
|
18050
|
-
]),
|
|
18051
|
-
let e =
|
|
18052
|
-
if (e) return Em(
|
|
18051
|
+
]), _e = a ? `/${n}/${a}` : `/${n}`, ve = F(() => {
|
|
18052
|
+
let e = ce[0];
|
|
18053
|
+
if (e) return Em(_e) === Em(`/${n}`) ? e : km(e.items ?? [], _e);
|
|
18053
18054
|
}, [
|
|
18054
|
-
|
|
18055
|
-
|
|
18055
|
+
ce,
|
|
18056
|
+
_e,
|
|
18056
18057
|
n
|
|
18057
18058
|
]);
|
|
18058
18059
|
return {
|
|
18059
|
-
items:
|
|
18060
|
+
items: ce,
|
|
18060
18061
|
isLoading: f,
|
|
18061
18062
|
error: m,
|
|
18062
|
-
path:
|
|
18063
|
+
path: _e,
|
|
18063
18064
|
folderPath: a,
|
|
18064
|
-
onPathChange:
|
|
18065
|
-
retry:
|
|
18066
|
-
onSearchFiles:
|
|
18065
|
+
onPathChange: le,
|
|
18066
|
+
retry: ue,
|
|
18067
|
+
onSearchFiles: M,
|
|
18067
18068
|
isSearching: C,
|
|
18068
18069
|
searchResults: T,
|
|
18069
|
-
clearSearchResults:
|
|
18070
|
+
clearSearchResults: ge,
|
|
18070
18071
|
expandedPaths: ne,
|
|
18071
|
-
loadedPaths:
|
|
18072
|
-
onExpandedPathsChange:
|
|
18073
|
-
onFolderPopupPathChange:
|
|
18072
|
+
loadedPaths: he,
|
|
18073
|
+
onExpandedPathsChange: j,
|
|
18074
|
+
onFolderPopupPathChange: me,
|
|
18074
18075
|
folderPopupLoadingPaths: ie,
|
|
18075
18076
|
sharedWithMeIds: F(() => r === z.Shared ? v : void 0, [r, v]),
|
|
18076
18077
|
sharedByMePaths: b,
|
|
18077
|
-
currentFolder:
|
|
18078
|
+
currentFolder: ve,
|
|
18078
18079
|
cache: s,
|
|
18079
18080
|
listingPermissionsCache: u,
|
|
18080
18081
|
sharedRootMetaRef: S,
|
|
18081
18082
|
setFolderPath: o,
|
|
18082
|
-
invalidateFolders:
|
|
18083
|
-
mergeCreatedFolder:
|
|
18084
|
-
bumpRetry:
|
|
18083
|
+
invalidateFolders: fe,
|
|
18084
|
+
mergeCreatedFolder: pe,
|
|
18085
|
+
bumpRetry: de
|
|
18085
18086
|
};
|
|
18086
18087
|
}, ag = ({ filesApi: e, bucket: t, rootLabel: n, onNotification: r }) => {
|
|
18087
18088
|
let [i, a] = L(void 0), [o, s] = L(!1);
|
|
@@ -19076,4 +19077,4 @@ var uh = (e) => !ah.has(e), dh = (e) => e && e === Math.floor(e) && e > 0 && isF
|
|
|
19076
19077
|
};
|
|
19077
19078
|
};
|
|
19078
19079
|
//#endregion
|
|
19079
|
-
export { Yt as AttachmentValidationErrorReason, Fn as AuthenticationType, xm as COLUMNS_WITHOUT_AUTHOR, Sm as COLUMNS_WITH_AUTHOR, Cm as CORE_PERMISSION_MAP, Yc as CatalogPrimaryActionType, $t as ConversationExportMode, u as ConversationTransferErrorCode, h as ConversationTransferWarningCode, bm as DATE_OPTIONS,
|
|
19080
|
+
export { Yt as AttachmentValidationErrorReason, Fn as AuthenticationType, xm as COLUMNS_WITHOUT_AUTHOR, Sm as COLUMNS_WITH_AUTHOR, Cm as CORE_PERMISSION_MAP, Yc as CatalogPrimaryActionType, $t as ConversationExportMode, u as ConversationTransferErrorCode, h as ConversationTransferWarningCode, bm as DATE_OPTIONS, mp as DEFAULT_MAX_ARCHIVE_BYTES, g as DialFileManagerActionProfile, _ as DialFileManagerVariant, mm as DialFilesApiUploadMode, $h as DownloadDestinationType, tn as EXPORT_APP_NAME, en as ExportFileNameKind, al as FavoriteEntityType, $ as FileManagerNotificationReason, hm as FileNameValidationErrorReason, gm as FileOperationKind, jc as McpResourceKind, bd as OAuthResourceKind, ym as PATH_SEPARATOR_REGEXP, af as PROMPT_CONTENT_MAX_LENGTH, of as PROMPT_COUNTER_ANNOUNCE_THRESHOLD, rf as PROMPT_DESCRIPTION_MAX_LENGTH, nf as PROMPT_NAME_MAX_LENGTH, uc as PUBLIC_SKILL_BUCKET, ef as PromptFieldError, Jr as PromptSource, vm as RESERVED_MARKER_NAME, Bf as RecipientsCountStatus, Gs as SKILL_FILE_UPLOAD_MAX_BYTES, mc as SKILL_LISTING_MAX_PAGES, pc as SKILL_LISTING_PAGE_SIZE, Ws as SKILL_MANIFEST_FILE, fc as SKILL_MANIFEST_MAX_BYTES, qs as SKILL_UPLOAD_MAX_FILES, Ks as SKILL_UPLOAD_MAX_TOTAL_BYTES, Of as SkillEditorLoadState, Lf as SkillPreviewErrorKind, lc as SkillSource, Td as TOOLSET_REDIRECT_STATE_KEY, _d as ToolsetAuthStatus, gd as ToolsetAuthTypes, vd as ToolsetCredentialsLevel, qd as ToolsetLoginOutcomeType, wd as ToolsetOAuthCallbackQuery, Cd as ToolsetOAuthChannelControlType, Sd as ToolsetOAuthFailureReason, xd as ToolsetOAuthInitiationResultType, Q as ToolsetOAuthResultType, _m as UPLOAD_CONCURRENCY, pf as UnsupportedTriggerReason, yd as WithLogin, qh as annotationToDisplayAttachment, Rh as annotationToPdfCanvasContent, mf as apSchedulerDayToJsDay, ar as appendLocaleCode, Kh as attachmentDtoToDisplayAttachment, Jh as attachmentDtosToDisplayAttachments, Ep as attachmentToDto, Dp as attachmentsToDtos, cr as buildAdditionalLocaleOptions, Lu as buildAnnouncementSignature, Ic as buildApplicationMcpUrl, An as buildChatCompletionsUrl, zc as buildConnectApi, Mn as buildDeploymentConnectApi, Og as buildExternalServiceScopeId, qm as buildFromCache, Xd as buildPromptExportEnvelope, $d as buildPromptExportFileName, $r as buildPromptOverview, df as buildPromptPath, jn as buildResponsesUrl, Im as buildSharedItemVirtualPath, Oc as buildSkillContentTree, cc as buildSkillFilesPayload, ec as buildSkillManifest, sc as buildSkillManifestForSubmit, tc as buildSkillManifestFromFrontmatter, Tc as buildSkillOverview, hd as buildToolsetAuthorizeUrl, Fc as buildToolsetMcpUrl, Eh as clearAttachmentCache, or as composeLocalePayload, Bu as createChatStreamApi, bt as createCsrfMiddleware, ed as createDeploymentChangedMessage, th as createFilesApiClient, Op as createMessagePair, En as createPublishApiClient, wt as createUnauthorizedMiddleware, nh as createUploadFileWithProgress, tr as decodeToolsetId, sr as decomposeLocalizedFields, wm as deriveActionProfile, qc as deriveAvailableTabIds, Uf as deriveConversationRowActionState, Kc as deriveFavoriteItems, Fm as dialCorePathToRelative, Xh as dialFileToAttachment, Zh as dialFilesToAttachments, Qh as dialFolderPathToAttachment, Mt as downloadAttachment, Gd as emitToolsetLoginSuccess, Nn as encodeDeploymentId, er as encodeToolsetId, Xm as fetchByTab, Zm as fetchForSearch, Wc as filterCatalogItemsBySelector, Gc as filterHiddenOwnedItems, Pn as findDeploymentByIdOrReference, jm as findDialFileByPath, Km as findFirstSuccessfulCopyMoveItem, km as findFolderByVirtualPath, Wu as formatAppVersion, ur as formatCalendarDate, Qt as formatDateYM, Zt as formatDateYMD, Om as formatOperationFolderName, xn as formatQuotedNameList, yt as getApiErrorDetails, vt as getApiErrorMessage, _t as getApiErrorStatus, xg as getBrowserTimezone, Np as getConversationPath, qf as getConversationSource, kg as getExternalServiceFallbackName, nd as getLastDeploymentId, id as getLastUserMessageToolConfiguration, Qu as getModelIdFromConversationId, oe as getParentFolderPath, ld as getQuickAppConversationStarters, uf as getRemainingCharacters, jp as getStarterConversationText, ud as getStarterPopulateText, Mp as getStarterSubmitText, dd as getStartersFromSchema, $u as getTimeOfDayGreeting, Dd as getToolsetOAuthChannelName, fd as getToolsetRedirectUri, bh as getUrlFileName, Dm as getVirtualPathName, kp as hasActiveToolConfig, Iu as hasAnnouncementContent, jh as hasAttachmentTextSource, Am as hasDialFileWritePermission, Tm as hasForbiddenNameSymbols, Fu as hasStructuredAnnouncement, Tt as includesIgnoreCase, Id as initiateOAuthLogin, nm as isAwaitingGenerationResume, gt as isConversationNotFoundError, Mm as isCopyMoveDuplicateAllowed, yg as isCustomAppSchema, Wt as isDialFileAcceptType, Ot as isDialFileId, jt as isDownloadableAttachment, Ch as isExternalSourcePreviewable, Ap as isMessageChanged, td as isMessageStreaming, ei as isOrganisationPromptItem, nr as isPublicToolsetId, bg as isQuickAppSchema, Nm as isShareActionsAllowed, Sg as isValidAbsoluteUrl, Tg as isValidFeaturesData, Qs as isValidSkillRelativePath, hf as jsDayToApSchedulerDay, Gm as mapCorePermissions, Fr as mapDeploymentDetailsDtoToEntityDetails, Xn as mapDeploymentLimitsDtoToCatalogLimits, Zn as mapDeploymentLimitsToInput, Kr as mapDeploymentToCatalogItem, Rr as mapDeploymentToolsetCredentials, Dr as mapEntityDetailsToCatalogDetails, $m as mapFileMetadataToDialFile, bf as mapFormValuesToCreateBody, xf as mapFormValuesToUpdateBody, ti as mapPromptToCatalogItem, Uc as mapPublishConversationResultDto, Hc as mapPublishHistoryEntryDto, Tf as mapScheduledTaskDtoToFormValues, Qm as mapSearchItem, vc as mapSkillToCatalogItem, wr as mapToolsetCredentials, qr as mapToolsetToCatalogItem, Jm as mergeCreatedFolderIntoCache, rd as messageHasStages, qt as mimeTypesToAttachmentExtensionLabels, Gt as mimeTypesToDialFileAcceptTypes, Kt as mimeTypesToFileAccept, ac as nameFromPath, Fd as navigateToolsetOAuthPopup, ad as normalizeResponseFormat, $s as normalizeSkillName, Em as normalizeVirtualPath, rh as openAnnotationAttachment, Pd as openToolsetOAuthPopup, lr as padTwoDigits, Dg as parseExternalServiceUrl, Cg as parseFeaturesData, Pm as parseNewFolderVirtualPath, Xr as parsePromptResourceUrl, rc as parseSkillManifest, nl as parseSkillManifestDocument, hc as parseSkillResourceUrl, Um as prepareCopyItems, eg as prepareDownloadDestination, Wm as prepareMoveRenameItems, kc as readSkillFileBytes, Ac as readSkillManifest, Jc as reconcileFilterTopics, zh as referenceAttachmentToPdfCanvasContent, Xc as resolveCatalogPrimaryAction, Ih as resolveCodeCanvasContent, Wr as resolveDeploymentFolder, Hm as resolveDialFileApiPath, At as resolveDialFileBucketAndPath, Sh as resolveExternalSourceContentType, Lh as resolveHtmlCanvasContent, Mh as resolveImageCanvasContent, Wh as resolveJsonCanvasContent, ir as resolveLocalizedText, Ph as resolveMarkdownCanvasContent, Rc as resolveMcpResourceKind, Uh as resolveOoxmlCanvasContent, Lm as resolveOwnerCoords, Hh as resolvePdfCanvasContent, kt as resolveRelativeDialFilePath, wc as resolveSkillFileDownloadPath, Sc as resolveSkillManifestFileId, Nh as resolveTextCanvasContent, Gh as resolveVisualizerCanvasContent, H as safeDecodeURI, Et as safeDecodeURIComponent, Mu as sanitizeAnnouncementHtml, Nu as sanitizeAnnouncementMessageHtml, rg as sanitizeFileName, Uu as sanitizeFooterHtml, Zd as serializePromptExport, Vu as shouldWatchForDisplayNameUpdate, oc as skillFileBytesToBlob, Df as skillFileToAttachment, tg as splitFileNameExtension, Dt as stripSurroundingSlashes, Kd as subscribeToolsetLoginSuccess, rr as toBaseLocale, od as toOverlayMessages, Vc as toPublishEntityType, Tn as toPublishRuleDto, ng as trimFileNameToByteLimit, ic as unpackSkillArchive, Ym as updateEntry, Wf as useActiveConversationSync, Gf as useAsyncConfirmDialog, Ft as useAttachmentAction, $f as useAttachmentUpload, Xt as useAttachmentValidation, il as useCatalogItemDetails, Mg as useChatSettingsFormConfig, Tp as useConversationExport, Pp as useConversationHandlers, Zp as useConversationImport, Kf as useConversationLookupMaps, Jf as useConversationPanelItems, em as useConversationScroll, pm as useConversationSources, dm as useConversationStream, ig as useDialFileListing, hg as useDialFileManager, _g as useDialFileManagerTabConfig, ag as useDialFileMetadata, og as useDialFileMutations, sg as useDialFileSharing, mg as useDialFileUploadBatch, ol as useFavoriteEntitiesState, Yf as useImportFilePicker, Hd as useOAuthCallbackCompletion, Ng as usePageFileDrag, Ig as usePanelMaxWidth, ff as usePromptsState, ul as usePublishFolders, zg as useShareLink, Hf as useShareRecipientsCount, Nf as useSkillEditorLoad, Ff as useSkillEditorSubmit, If as useSkillFileActions, Rf as useSkillFilePreview, zf as useSkillsState, Ug as useToolsMenu, Jd as useToolsetLogin, Gg as useUsageData, Fg as useViewportWidth, lf as validatePromptContent, cf as validatePromptDescription, sf as validatePromptName, Ef as validateSkillFileBatch, Bm as virtualPathToApiPath, Md as waitForToolsetOAuthResult };
|