@farris/x-ui 0.1.9 → 0.2.1

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.
@@ -4248,8 +4248,8 @@ function Ws() {
4248
4248
  CUSTOM_ELEMENT: L
4249
4249
  } = ca;
4250
4250
  let {
4251
- IS_ALLOWED_URI: U
4252
- } = ca, W = null;
4251
+ IS_ALLOWED_URI: W
4252
+ } = ca, U = null;
4253
4253
  const B = se({}, [...oa, ...nr, ...ur, ...ir, ...aa]);
4254
4254
  let P = null;
4255
4255
  const R = se({}, [...sa, ...rr, ...la, ...Ru]);
@@ -4308,7 +4308,7 @@ function Ws() {
4308
4308
  let E = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
4309
4309
  if (!(bn && bn === E)) {
4310
4310
  if ((!E || typeof E != "object") && (E = {}), E = Dt(E), $n = // eslint-disable-next-line unicorn/prefer-includes
4311
- Ll.indexOf(E.PARSER_MEDIA_TYPE) === -1 ? Rl : E.PARSER_MEDIA_TYPE, Se = $n === "application/xhtml+xml" ? er : Hu, W = et(E, "ALLOWED_TAGS") ? se({}, E.ALLOWED_TAGS, Se) : B, P = et(E, "ALLOWED_ATTR") ? se({}, E.ALLOWED_ATTR, Se) : R, Hi = et(E, "ALLOWED_NAMESPACES") ? se({}, E.ALLOWED_NAMESPACES, er) : Il, Ni = et(E, "ADD_URI_SAFE_ATTR") ? se(Dt(wo), E.ADD_URI_SAFE_ATTR, Se) : wo, yo = et(E, "ADD_DATA_URI_TAGS") ? se(Dt(xo), E.ADD_DATA_URI_TAGS, Se) : xo, Et = et(E, "FORBID_CONTENTS") ? se({}, E.FORBID_CONTENTS, Se) : zi, q = et(E, "FORBID_TAGS") ? se({}, E.FORBID_TAGS, Se) : Dt({}), ee = et(E, "FORBID_ATTR") ? se({}, E.FORBID_ATTR, Se) : Dt({}), mn = et(E, "USE_PROFILES") ? E.USE_PROFILES : !1, Q = E.ALLOW_ARIA_ATTR !== !1, ae = E.ALLOW_DATA_ATTR !== !1, pe = E.ALLOW_UNKNOWN_PROTOCOLS || !1, Te = E.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Ie = E.SAFE_FOR_TEMPLATES || !1, pt = E.SAFE_FOR_XML !== !1, je = E.WHOLE_DOCUMENT || !1, zt = E.RETURN_DOM || !1, Cu = E.RETURN_DOM_FRAGMENT || !1, _u = E.RETURN_TRUSTED_TYPE || !1, Gt = E.FORCE_BODY || !1, bo = E.SANITIZE_DOM !== !1, vo = E.SANITIZE_NAMED_PROPS || !1, Bi = E.KEEP_CONTENT !== !1, Hn = E.IN_PLACE || !1, U = E.ALLOWED_URI_REGEXP || $s, gn = E.NAMESPACE || Nt, Du = E.MATHML_TEXT_INTEGRATION_POINTS || Du, Fu = E.HTML_INTEGRATION_POINTS || Fu, z = E.CUSTOM_ELEMENT_HANDLING || {}, E.CUSTOM_ELEMENT_HANDLING && Ao(E.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (z.tagNameCheck = E.CUSTOM_ELEMENT_HANDLING.tagNameCheck), E.CUSTOM_ELEMENT_HANDLING && Ao(E.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (z.attributeNameCheck = E.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), E.CUSTOM_ELEMENT_HANDLING && typeof E.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (z.allowCustomizedBuiltInElements = E.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Ie && (ae = !1), Cu && (zt = !0), mn && (W = se({}, aa), P = ju(null), mn.html === !0 && (se(W, oa), se(P, sa)), mn.svg === !0 && (se(W, nr), se(P, rr), se(P, Ru)), mn.svgFilters === !0 && (se(W, ur), se(P, rr), se(P, Ru)), mn.mathMl === !0 && (se(W, ir), se(P, la), se(P, Ru))), et(E, "ADD_TAGS") || (Z.tagCheck = null), et(E, "ADD_ATTR") || (Z.attributeCheck = null), E.ADD_TAGS && (typeof E.ADD_TAGS == "function" ? Z.tagCheck = E.ADD_TAGS : (W === B && (W = Dt(W)), se(W, E.ADD_TAGS, Se))), E.ADD_ATTR && (typeof E.ADD_ATTR == "function" ? Z.attributeCheck = E.ADD_ATTR : (P === R && (P = Dt(P)), se(P, E.ADD_ATTR, Se))), E.ADD_URI_SAFE_ATTR && se(Ni, E.ADD_URI_SAFE_ATTR, Se), E.FORBID_CONTENTS && (Et === zi && (Et = Dt(Et)), se(Et, E.FORBID_CONTENTS, Se)), E.ADD_FORBID_CONTENTS && (Et === zi && (Et = Dt(Et)), se(Et, E.ADD_FORBID_CONTENTS, Se)), Bi && (W["#text"] = !0), je && se(W, ["html", "head", "body"]), W.table && (se(W, ["tbody"]), delete q.tbody), E.TRUSTED_TYPES_POLICY) {
4311
+ Ll.indexOf(E.PARSER_MEDIA_TYPE) === -1 ? Rl : E.PARSER_MEDIA_TYPE, Se = $n === "application/xhtml+xml" ? er : Hu, U = et(E, "ALLOWED_TAGS") ? se({}, E.ALLOWED_TAGS, Se) : B, P = et(E, "ALLOWED_ATTR") ? se({}, E.ALLOWED_ATTR, Se) : R, Hi = et(E, "ALLOWED_NAMESPACES") ? se({}, E.ALLOWED_NAMESPACES, er) : Il, Ni = et(E, "ADD_URI_SAFE_ATTR") ? se(Dt(wo), E.ADD_URI_SAFE_ATTR, Se) : wo, yo = et(E, "ADD_DATA_URI_TAGS") ? se(Dt(xo), E.ADD_DATA_URI_TAGS, Se) : xo, Et = et(E, "FORBID_CONTENTS") ? se({}, E.FORBID_CONTENTS, Se) : zi, q = et(E, "FORBID_TAGS") ? se({}, E.FORBID_TAGS, Se) : Dt({}), ee = et(E, "FORBID_ATTR") ? se({}, E.FORBID_ATTR, Se) : Dt({}), mn = et(E, "USE_PROFILES") ? E.USE_PROFILES : !1, Q = E.ALLOW_ARIA_ATTR !== !1, ae = E.ALLOW_DATA_ATTR !== !1, pe = E.ALLOW_UNKNOWN_PROTOCOLS || !1, Te = E.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Ie = E.SAFE_FOR_TEMPLATES || !1, pt = E.SAFE_FOR_XML !== !1, je = E.WHOLE_DOCUMENT || !1, zt = E.RETURN_DOM || !1, Cu = E.RETURN_DOM_FRAGMENT || !1, _u = E.RETURN_TRUSTED_TYPE || !1, Gt = E.FORCE_BODY || !1, bo = E.SANITIZE_DOM !== !1, vo = E.SANITIZE_NAMED_PROPS || !1, Bi = E.KEEP_CONTENT !== !1, Hn = E.IN_PLACE || !1, W = E.ALLOWED_URI_REGEXP || $s, gn = E.NAMESPACE || Nt, Du = E.MATHML_TEXT_INTEGRATION_POINTS || Du, Fu = E.HTML_INTEGRATION_POINTS || Fu, z = E.CUSTOM_ELEMENT_HANDLING || {}, E.CUSTOM_ELEMENT_HANDLING && Ao(E.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (z.tagNameCheck = E.CUSTOM_ELEMENT_HANDLING.tagNameCheck), E.CUSTOM_ELEMENT_HANDLING && Ao(E.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (z.attributeNameCheck = E.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), E.CUSTOM_ELEMENT_HANDLING && typeof E.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (z.allowCustomizedBuiltInElements = E.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Ie && (ae = !1), Cu && (zt = !0), mn && (U = se({}, aa), P = ju(null), mn.html === !0 && (se(U, oa), se(P, sa)), mn.svg === !0 && (se(U, nr), se(P, rr), se(P, Ru)), mn.svgFilters === !0 && (se(U, ur), se(P, rr), se(P, Ru)), mn.mathMl === !0 && (se(U, ir), se(P, la), se(P, Ru))), et(E, "ADD_TAGS") || (Z.tagCheck = null), et(E, "ADD_ATTR") || (Z.attributeCheck = null), E.ADD_TAGS && (typeof E.ADD_TAGS == "function" ? Z.tagCheck = E.ADD_TAGS : (U === B && (U = Dt(U)), se(U, E.ADD_TAGS, Se))), E.ADD_ATTR && (typeof E.ADD_ATTR == "function" ? Z.attributeCheck = E.ADD_ATTR : (P === R && (P = Dt(P)), se(P, E.ADD_ATTR, Se))), E.ADD_URI_SAFE_ATTR && se(Ni, E.ADD_URI_SAFE_ATTR, Se), E.FORBID_CONTENTS && (Et === zi && (Et = Dt(Et)), se(Et, E.FORBID_CONTENTS, Se)), E.ADD_FORBID_CONTENTS && (Et === zi && (Et = Dt(Et)), se(Et, E.ADD_FORBID_CONTENTS, Se)), Bi && (U["#text"] = !0), je && se(U, ["html", "head", "body"]), U.table && (se(U, ["tbody"]), delete q.tbody), E.TRUSTED_TYPES_POLICY) {
4312
4312
  if (typeof E.TRUSTED_TYPES_POLICY.createHTML != "function")
4313
4313
  throw Gn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
4314
4314
  if (typeof E.TRUSTED_TYPES_POLICY.createScriptURL != "function")
@@ -4407,10 +4407,10 @@ function Ws() {
4407
4407
  const te = Se(E.nodeName);
4408
4408
  if (jt(N.uponSanitizeElement, E, {
4409
4409
  tagName: te,
4410
- allowedTags: W
4410
+ allowedTags: U
4411
4411
  }), pt && E.hasChildNodes() && !So(E.firstElementChild) && Ge(/<[/\w!]/g, E.innerHTML) && Ge(/<[/\w!]/g, E.textContent) || E.nodeType === qn.progressingInstruction || pt && E.nodeType === qn.comment && Ge(/<[/\w]/g, E.data))
4412
4412
  return St(E), !0;
4413
- if (!(Z.tagCheck instanceof Function && Z.tagCheck(te)) && (!W[te] || q[te])) {
4413
+ if (!(Z.tagCheck instanceof Function && Z.tagCheck(te)) && (!U[te] || q[te])) {
4414
4414
  if (!q[te] && To(te) && (z.tagNameCheck instanceof RegExp && Ge(z.tagNameCheck, te) || z.tagNameCheck instanceof Function && z.tagNameCheck(te)))
4415
4415
  return !1;
4416
4416
  if (Bi && !Et[te]) {
@@ -4446,7 +4446,7 @@ function Ws() {
4446
4446
  G === "is" && z.allowCustomizedBuiltInElements && (z.tagNameCheck instanceof RegExp && Ge(z.tagNameCheck, te) || z.tagNameCheck instanceof Function && z.tagNameCheck(te)))
4447
4447
  ) return !1;
4448
4448
  } else if (!Ni[G]) {
4449
- if (!Ge(U, Wn(te, F, ""))) {
4449
+ if (!Ge(W, Wn(te, F, ""))) {
4450
4450
  if (!((G === "src" || G === "xlink:href" || G === "href") && E !== "script" && yf(te, "data:") === 0 && yo[E])) {
4451
4451
  if (!(pe && !Ge(I, Wn(te, F, "")))) {
4452
4452
  if (te)
@@ -4548,7 +4548,7 @@ function Ws() {
4548
4548
  if (pn || $i(E), t.removed = [], typeof ne == "string" && (Hn = !1), Hn) {
4549
4549
  if (ne.nodeName) {
4550
4550
  const Ht = Se(ne.nodeName);
4551
- if (!W[Ht] || q[Ht])
4551
+ if (!U[Ht] || q[Ht])
4552
4552
  throw Gn("root node is forbidden and cannot be sanitized in-place");
4553
4553
  }
4554
4554
  } else if (ne instanceof a)
@@ -4575,7 +4575,7 @@ function Ws() {
4575
4575
  return (P.shadowroot || P.shadowrootmode) && (He = H.call(u, He, !0)), He;
4576
4576
  }
4577
4577
  let Ke = je ? G.outerHTML : G.innerHTML;
4578
- return je && W["!doctype"] && G.ownerDocument && G.ownerDocument.doctype && G.ownerDocument.doctype.name && Ge(Us, G.ownerDocument.doctype.name) && (Ke = "<!DOCTYPE " + G.ownerDocument.doctype.name + `>
4578
+ return je && U["!doctype"] && G.ownerDocument && G.ownerDocument.doctype && G.ownerDocument.doctype.name && Ge(Us, G.ownerDocument.doctype.name) && (Ke = "<!DOCTYPE " + G.ownerDocument.doctype.name + `>
4579
4579
  ` + Ke), Ie && Lu([$, O, V], (Ht) => {
4580
4580
  Ke = Wn(Ke, Ht, " ");
4581
4581
  }), y && _u ? y.createHTML(Ke) : Ke;
@@ -5789,13 +5789,13 @@ var Pr = { exports: {} };
5789
5789
  return yield F({ scripts: { dependencies: [], entry: B, umd: R.umd, crossOrigin: R.crossOrigin } });
5790
5790
  });
5791
5791
  }
5792
- function U(B) {
5792
+ function W(B) {
5793
5793
  return h(this, null, function* () {
5794
5794
  return yield F({ scripts: { dependencies: [], entry: "" }, styles: { urls: [B] } });
5795
5795
  });
5796
5796
  }
5797
- const W = F;
5798
- n.importComponent = F, n.importModule = W, n.importScript = L, n.importStyle = U, Object.defineProperty(n, Symbol.toStringTag, { value: "Module" });
5797
+ const U = F;
5798
+ n.importComponent = F, n.importModule = U, n.importScript = L, n.importStyle = W, Object.defineProperty(n, Symbol.toStringTag, { value: "Module" });
5799
5799
  });
5800
5800
  })(Pr, Pr.exports);
5801
5801
  var Lh = Pr.exports;
@@ -6590,7 +6590,7 @@ function Yh(e, t, n, u) {
6590
6590
  const ae = Math.min(Z, Q);
6591
6591
  return { popoverLeft: ee, popoverTop: ae, arrowLeft: 0, maxHeight: 0 };
6592
6592
  }
6593
- const U = /* @__PURE__ */ new Map([
6593
+ const W = /* @__PURE__ */ new Map([
6594
6594
  ["top", H],
6595
6595
  ["top-left", V],
6596
6596
  ["bottom", _],
@@ -6599,14 +6599,14 @@ function Yh(e, t, n, u) {
6599
6599
  ["right-top", L],
6600
6600
  ["auto", I]
6601
6601
  ]);
6602
- function W(R) {
6602
+ function U(R) {
6603
6603
  var Q;
6604
6604
  e.keepWidthWithReference && D(R);
6605
6605
  const z = R.getBoundingClientRect();
6606
6606
  s.value = z.top, c.value = z.left;
6607
6607
  const q = t.value ? t.value.getBoundingClientRect() : { height: 4, width: 4 }, ee = (Q = n.value) == null ? void 0 : Q.getBoundingClientRect();
6608
6608
  o.value = ee.width;
6609
- const Z = U.get(d.value);
6609
+ const Z = W.get(d.value);
6610
6610
  if (Z) {
6611
6611
  const { arrowLeft: ae, popoverLeft: pe, popoverTop: Te, maxHeight: Ie } = Z(ee, z, q);
6612
6612
  l.value = ae, h.value = pe, m.value = Te, a.value = Ie || -1;
@@ -6615,7 +6615,7 @@ function Yh(e, t, n, u) {
6615
6615
  function B(R) {
6616
6616
  if (R) {
6617
6617
  const z = R.getBoundingClientRect();
6618
- (z.left !== c.value || z.top !== s.value) && W(R);
6618
+ (z.left !== c.value || z.top !== s.value) && U(R);
6619
6619
  }
6620
6620
  }
6621
6621
  function P() {
@@ -6628,7 +6628,7 @@ function Yh(e, t, n, u) {
6628
6628
  popoverWidth: o,
6629
6629
  fitToReference: D,
6630
6630
  followToReferencePosition: B,
6631
- locateToReference: W,
6631
+ locateToReference: U,
6632
6632
  resetPosition: P
6633
6633
  };
6634
6634
  }
@@ -7274,9 +7274,11 @@ const nu = /* @__PURE__ */ ie({
7274
7274
  }, [e.content.toolDescription ?? "tool"]), f("div", {
7275
7275
  class: d.value
7276
7276
  }, [n.value ? f(zn, {
7277
- status: "Error"
7277
+ status: "Error",
7278
+ variant: "tool-use"
7278
7279
  }, null) : f(zn, {
7279
- status: i.value ? "Done" : o.value ? "Working" : "NotStart"
7280
+ status: i.value ? "Done" : o.value ? "Working" : "NotStart",
7281
+ variant: "tool-use"
7280
7282
  }, null), f("span", {
7281
7283
  class: "f-chat-tool-use-status-text"
7282
7284
  }, [a.value])]), f("i", {
@@ -7436,10 +7438,10 @@ const Xu = /* @__PURE__ */ ie({
7436
7438
  showDivider: V
7437
7439
  } = e.content.structuredContent, _ = (L) => {
7438
7440
  const {
7439
- content: U,
7440
- label: W
7441
+ content: W,
7442
+ label: U
7441
7443
  } = L;
7442
- return W || U && typeof U == "string" ? f(at, null, [f("span", {
7444
+ return U || W && typeof W == "string" ? f(at, null, [f("span", {
7443
7445
  class: "f-chat-bubble-structured-section-item-dot"
7444
7446
  }, null), L.label && f("span", {
7445
7447
  class: "f-chat-bubble-structured-section-item-label"
@@ -7451,8 +7453,8 @@ const Xu = /* @__PURE__ */ ie({
7451
7453
  class: ["f-chat-bubble-structured", {
7452
7454
  "structure-content-divider": V
7453
7455
  }]
7454
- }, [O.map((L, U) => f("div", {
7455
- key: U,
7456
+ }, [O.map((L, W) => f("div", {
7457
+ key: W,
7456
7458
  class: ["f-chat-bubble-structured-section", {
7457
7459
  "section-divider": L.showDivider
7458
7460
  }]
@@ -7469,10 +7471,10 @@ const Xu = /* @__PURE__ */ ie({
7469
7471
  class: "f-chat-bubble-structured-section-title"
7470
7472
  }, [L.title])]), L.items && L.items.length > 0 && f("div", {
7471
7473
  class: "f-chat-bubble-structured-section-items"
7472
- }, [L.items.map((W, B) => f("div", {
7474
+ }, [L.items.map((U, B) => f("div", {
7473
7475
  key: B,
7474
7476
  class: "f-chat-bubble-structured-section-item"
7475
- }, [_(W)]))])]))]);
7477
+ }, [_(U)]))])]))]);
7476
7478
  }, X = () => {
7477
7479
  const O = p.value;
7478
7480
  if (!O) return null;
@@ -9488,8 +9490,8 @@ See: https://github.com/francoischalifour/medium-zoom`);
9488
9490
  g.push(C), C.classList.add("medium-zoom-image");
9489
9491
  }), y.forEach(function(C) {
9490
9492
  var I = C.type, F = C.listener, L = C.options;
9491
- _.forEach(function(U) {
9492
- U.addEventListener(I, F, L);
9493
+ _.forEach(function(W) {
9494
+ W.addEventListener(I, F, L);
9493
9495
  });
9494
9496
  }), H;
9495
9497
  }, d = function() {
@@ -9532,9 +9534,9 @@ See: https://github.com/francoischalifour/medium-zoom`);
9532
9534
  if (D.container instanceof Object)
9533
9535
  C = cn({}, C, D.container), I = C.width - C.left - C.right - D.margin * 2, F = C.height - C.top - C.bottom - D.margin * 2;
9534
9536
  else {
9535
- var L = Ju(D.container) ? D.container : document.querySelector(D.container), U = L.getBoundingClientRect(), W = U.width, B = U.height, P = U.left, R = U.top;
9537
+ var L = Ju(D.container) ? D.container : document.querySelector(D.container), W = L.getBoundingClientRect(), U = W.width, B = W.height, P = W.left, R = W.top;
9536
9538
  C = cn({}, C, {
9537
- width: W,
9539
+ width: U,
9538
9540
  height: B,
9539
9541
  left: P,
9540
9542
  top: R
@@ -9549,8 +9551,8 @@ See: https://github.com/francoischalifour/medium-zoom`);
9549
9551
  _(H);
9550
9552
  return;
9551
9553
  }
9552
- var C = function W() {
9553
- k = !1, S.zoomed.removeEventListener("transitionend", W), S.original.dispatchEvent(xn("medium-zoom:opened", {
9554
+ var C = function U() {
9555
+ k = !1, S.zoomed.removeEventListener("transitionend", U), S.original.dispatchEvent(xn("medium-zoom:opened", {
9554
9556
  detail: { zoom: H }
9555
9557
  })), _(H);
9556
9558
  };
@@ -9584,8 +9586,8 @@ See: https://github.com/francoischalifour/medium-zoom`);
9584
9586
  }, 10);
9585
9587
  } else if (S.original.hasAttribute("srcset")) {
9586
9588
  S.zoomedHd = S.zoomed.cloneNode(), S.zoomedHd.removeAttribute("sizes"), S.zoomedHd.removeAttribute("loading");
9587
- var U = S.zoomedHd.addEventListener("load", function() {
9588
- S.zoomedHd.removeEventListener("load", U), S.zoomedHd.classList.add("medium-zoom-image--opened"), S.zoomedHd.addEventListener("click", p), document.body.appendChild(S.zoomedHd), V();
9589
+ var W = S.zoomedHd.addEventListener("load", function() {
9590
+ S.zoomedHd.removeEventListener("load", W), S.zoomedHd.classList.add("medium-zoom-image--opened"), S.zoomedHd.addEventListener("click", p), document.body.appendChild(S.zoomedHd), V();
9589
9591
  });
9590
9592
  } else
9591
9593
  V();
@@ -10057,16 +10059,16 @@ const tn = {
10057
10059
  return "";
10058
10060
  const v = (I = t.usedLanguageTextRef.value) == null ? void 0 : I.copyCode.text, A = t.customIconRef.value.copy || v, b = !!t.customIconRef.value.copy, g = `<span class="${K}-collapse-tips">${Tt("collapse-tips", t.customIconRef.value)}</span>`, [y] = a(l[h]);
10059
10061
  if (y === null) {
10060
- const { open: F, tagContainer: L, tagHeader: U } = c(l[h]), W = [["class", `${K}-code`]];
10061
- F && W.push(["open", ""]);
10062
+ const { open: F, tagContainer: L, tagHeader: W } = c(l[h]), U = [["class", `${K}-code`]];
10063
+ F && U.push(["open", ""]);
10062
10064
  const B = {
10063
- attrs: Zr(l[h], W)
10065
+ attrs: Zr(l[h], U)
10064
10066
  };
10065
10067
  l[h].info = l[h].info.replace(i, "");
10066
10068
  const P = n(l, h, m, p, x);
10067
10069
  return `
10068
10070
  <${L} ${x.renderAttrs(B)}>
10069
- <${U} class="${K}-code-head">
10071
+ <${W} class="${K}-code-head">
10070
10072
  <div class="${K}-code-flag"><span></span><span></span><span></span></div>
10071
10073
  <div class="${K}-code-action">
10072
10074
  <span class="${K}-code-lang">${e.utils.escapeHtml(l[h].info.trim())}</span>
@@ -10074,7 +10076,7 @@ const tn = {
10074
10076
  ${t.extraTools instanceof Function ? t.extraTools({ lang: l[h].info.trim() }) : t.extraTools || ""}
10075
10077
  ${L === "details" ? g : ""}
10076
10078
  </div>
10077
- </${U}>
10079
+ </${W}>
10078
10080
  ${P}
10079
10081
  </${L}>
10080
10082
  `;
@@ -10411,9 +10413,9 @@ const tn = {
10411
10413
  g.set({
10412
10414
  highlight: (_, C, I) => {
10413
10415
  if (k) {
10414
- const U = k(_, C, I);
10415
- if (U)
10416
- return U;
10416
+ const W = k(_, C, I);
10417
+ if (W)
10418
+ return W;
10417
10419
  }
10418
10420
  let F;
10419
10421
  !e.noHighlight && m.value ? m.value.getLanguage(C) ? F = m.value.highlight(_, {
@@ -11411,24 +11413,24 @@ function vl() {
11411
11413
  function L(B) {
11412
11414
  return F ? !0 : n.indexOf(C, B) !== -1;
11413
11415
  }
11414
- var U = [], W = !1;
11416
+ var W = [], U = !1;
11415
11417
  return {
11416
11418
  onIgnoreTag: function(B, P, R) {
11417
11419
  if (L(B))
11418
11420
  if (R.isClosing) {
11419
11421
  var z = "[/removed]", q = R.position + z.length;
11420
- return U.push([
11421
- W !== !1 ? W : R.position,
11422
+ return W.push([
11423
+ U !== !1 ? U : R.position,
11422
11424
  q
11423
- ]), W = !1, z;
11425
+ ]), U = !1, z;
11424
11426
  } else
11425
- return W || (W = R.position), "[removed]";
11427
+ return U || (U = R.position), "[removed]";
11426
11428
  else
11427
11429
  return I(B, P, R);
11428
11430
  },
11429
11431
  remove: function(B) {
11430
11432
  var P = "", R = 0;
11431
- return n.forEach(U, function(z) {
11433
+ return n.forEach(W, function(z) {
11432
11434
  P += B.slice(R, z[0]), R = z[1];
11433
11435
  }), P += B.slice(R), P;
11434
11436
  }
@@ -11442,10 +11444,10 @@ function vl() {
11442
11444
  break;
11443
11445
  }
11444
11446
  I += C.slice(F, L);
11445
- var U = C.indexOf("-->", L);
11446
- if (U === -1)
11447
+ var W = C.indexOf("-->", L);
11448
+ if (W === -1)
11447
11449
  break;
11448
- F = U + 3;
11450
+ F = W + 3;
11449
11451
  }
11450
11452
  return I;
11451
11453
  }
@@ -11639,9 +11641,9 @@ function qp() {
11639
11641
  if (V.isWhite) {
11640
11642
  if (V.isClosing)
11641
11643
  return "</" + N + ">";
11642
- var C = a($), I = p[N], F = r(C.html, function(L, U) {
11643
- var W = i.indexOf(I, L) !== -1, B = A(N, L, U, W);
11644
- return o(B) ? W ? (U = g(N, L, U, T), U ? L + "=" + k + U + k : L) : (B = b(N, L, U, W), o(B) ? void 0 : B) : B;
11644
+ var C = a($), I = p[N], F = r(C.html, function(L, W) {
11645
+ var U = i.indexOf(I, L) !== -1, B = A(N, L, W, U);
11646
+ return o(B) ? U ? (W = g(N, L, W, T), W ? L + "=" + k + W + k : L) : (B = b(N, L, W, U), o(B) ? void 0 : B) : B;
11645
11647
  });
11646
11648
  return $ = "<" + N, F && ($ += " " + F), C.closing && ($ += " /"), $ += ">", $;
11647
11649
  } else
@@ -11766,14 +11768,14 @@ const ni = /* @__PURE__ */ ie({
11766
11768
  const C = n.value;
11767
11769
  if (!C) return;
11768
11770
  h.value = !1, r.value = !1, i.value = !1;
11769
- const I = Date.now(), F = 200, L = 300, U = 1e4;
11770
- let W = !1, B = null, P = null;
11771
+ const I = Date.now(), F = 200, L = 300, W = 1e4;
11772
+ let U = !1, B = null, P = null;
11771
11773
  P = window.setTimeout(() => {
11772
- P = null, W || (i.value = !0);
11774
+ P = null, U || (i.value = !0);
11773
11775
  }, F);
11774
11776
  const R = () => {
11775
- if (W) return;
11776
- if (W = !0, B && (window.clearTimeout(B), B = null), P && (window.clearTimeout(P), P = null), h.value = !0, O(C), i.value) {
11777
+ if (U) return;
11778
+ if (U = !0, B && (window.clearTimeout(B), B = null), P && (window.clearTimeout(P), P = null), h.value = !0, O(C), i.value) {
11777
11779
  const ee = Date.now() - I, Z = Math.max(0, L - ee);
11778
11780
  setTimeout(() => {
11779
11781
  r.value = !0;
@@ -11787,11 +11789,11 @@ const ni = /* @__PURE__ */ ie({
11787
11789
  q(), window.setTimeout(q, 0), window.setTimeout(q, 120);
11788
11790
  }, z = () => {
11789
11791
  var q;
11790
- W || (W = !0, P && (window.clearTimeout(P), P = null), console.warn("ChatPreview: iframe load timeout"), h.value = !0, r.value = !0, (q = e.onIframeLoad) == null || q.call(e));
11792
+ U || (U = !0, P && (window.clearTimeout(P), P = null), console.warn("ChatPreview: iframe load timeout"), h.value = !0, r.value = !0, (q = e.onIframeLoad) == null || q.call(e));
11791
11793
  };
11792
11794
  C.addEventListener("load", R, {
11793
11795
  once: !0
11794
- }), B = window.setTimeout(z, U), m = () => {
11796
+ }), B = window.setTimeout(z, W), m = () => {
11795
11797
  C.removeEventListener("load", R), B && (window.clearTimeout(B), B = null), P && (window.clearTimeout(P), P = null);
11796
11798
  };
11797
11799
  }, {
@@ -11911,10 +11913,10 @@ const ni = /* @__PURE__ */ ie({
11911
11913
  background: rgba(0, 0, 0, 0.2);
11912
11914
  }
11913
11915
  `, (I.head || I.documentElement).appendChild(L);
11914
- const U = "f-chat-preview-injected-scrollbar-script";
11915
- if (I.getElementById(U)) return;
11916
- const W = I.createElement("script");
11917
- W.id = U, W.textContent = `
11916
+ const W = "f-chat-preview-injected-scrollbar-script";
11917
+ if (I.getElementById(W)) return;
11918
+ const U = I.createElement("script");
11919
+ U.id = W, U.textContent = `
11918
11920
  (function() {
11919
11921
  var hideTimer = null;
11920
11922
  var HIDE_DELAY = 800;
@@ -11935,7 +11937,7 @@ const ni = /* @__PURE__ */ ie({
11935
11937
  document.addEventListener('mouseenter', show);
11936
11938
  document.addEventListener('mouseleave', scheduleHide);
11937
11939
  })();
11938
- `, (I.head || I.documentElement).appendChild(W);
11940
+ `, (I.head || I.documentElement).appendChild(U);
11939
11941
  } catch {
11940
11942
  }
11941
11943
  }
@@ -14653,11 +14655,11 @@ const kr = /* @__PURE__ */ ie({
14653
14655
  else if (L === "multi_select")
14654
14656
  C[F.id] = F.default_value ? JSON.parse(F.default_value) : [];
14655
14657
  else if (L === "form") {
14656
- const U = {};
14658
+ const W = {};
14657
14659
  if (Array.isArray(F.fields))
14658
- for (const W of F.fields)
14659
- U[W.name] = W.default_value ?? "";
14660
- C[F.id] = U;
14660
+ for (const U of F.fields)
14661
+ W[U.name] = U.default_value ?? "";
14662
+ C[F.id] = W;
14661
14663
  } else C[F.id] = F.default_value ?? "";
14662
14664
  I[F.id] = {
14663
14665
  active: !1,
@@ -14679,7 +14681,7 @@ const kr = /* @__PURE__ */ ie({
14679
14681
  };
14680
14682
  for (const F of _) {
14681
14683
  C[F.id] = F.answer;
14682
- const L = e.content.questions.find((U) => U.id === F.id);
14684
+ const L = e.content.questions.find((W) => W.id === F.id);
14683
14685
  L && kn(L.ui_type) === "select" && typeof F.answer == "string" && !(L.options ?? []).some((B) => B.label === F.answer) && F.answer !== "" && (I[F.id] = {
14684
14686
  active: !0,
14685
14687
  text: F.answer
@@ -14709,10 +14711,10 @@ const kr = /* @__PURE__ */ ie({
14709
14711
  if (F === "text" && (typeof L != "string" || L.trim() === "") || F === "select" && (typeof L != "string" || L.trim() === "" || L === $t && (((C = (_ = r.value[I.id]) == null ? void 0 : _.text) == null ? void 0 : C.trim()) ?? "") === "") || F === "confirm" && typeof L != "boolean" || F === "multi_select" && (!Array.isArray(L) || L.length === 0))
14710
14712
  return !1;
14711
14713
  if (F === "form") {
14712
- const U = I.fields ?? [], W = L;
14713
- for (const B of U)
14714
+ const W = I.fields ?? [], U = L;
14715
+ for (const B of W)
14714
14716
  if (B.required) {
14715
- const P = W[B.name];
14717
+ const P = U[B.name];
14716
14718
  if (typeof P != "string" || P.trim() === "") return !1;
14717
14719
  }
14718
14720
  }
@@ -14760,11 +14762,11 @@ const kr = /* @__PURE__ */ ie({
14760
14762
  if (!m.value) return;
14761
14763
  const _ = [];
14762
14764
  for (const L of e.content.questions) {
14763
- const U = kn(L.ui_type);
14764
- let W = u.value[L.id];
14765
- U === "select" && W === $t && (W = ((I = (C = r.value[L.id]) == null ? void 0 : C.text) == null ? void 0 : I.trim()) ?? ""), U === "number" && (W = Number(W)), _.push({
14765
+ const W = kn(L.ui_type);
14766
+ let U = u.value[L.id];
14767
+ W === "select" && U === $t && (U = ((I = (C = r.value[L.id]) == null ? void 0 : C.text) == null ? void 0 : I.trim()) ?? ""), W === "number" && (U = Number(U)), _.push({
14766
14768
  id: L.id,
14767
- answer: W
14769
+ answer: U
14768
14770
  });
14769
14771
  }
14770
14772
  t.value = !0, (F = e.onSubmitAnswers) == null || F.call(e, _);
@@ -14781,10 +14783,10 @@ const kr = /* @__PURE__ */ ie({
14781
14783
  }, null)]);
14782
14784
  }
14783
14785
  function y(_, C, I, F, L) {
14784
- const U = (P) => {
14786
+ const W = (P) => {
14785
14787
  let R = Number(_) || 0;
14786
14788
  R += P, F !== void 0 && (R = Math.max(F, R)), L !== void 0 && (R = Math.min(L, R)), I(String(R));
14787
- }, W = L !== void 0 && Number(_ || 0) >= L, B = F !== void 0 && Number(_ || 0) <= F;
14789
+ }, U = L !== void 0 && Number(_ || 0) >= L, B = F !== void 0 && Number(_ || 0) <= F;
14788
14790
  return f("div", {
14789
14791
  class: "f-hitl-num-wrap"
14790
14792
  }, [f("input", {
@@ -14800,15 +14802,15 @@ const kr = /* @__PURE__ */ ie({
14800
14802
  }, [f("button", {
14801
14803
  type: "button",
14802
14804
  class: "f-hitl-num-btn",
14803
- disabled: C || W,
14804
- onClick: () => U(1)
14805
+ disabled: C || U,
14806
+ onClick: () => W(1)
14805
14807
  }, [f("span", {
14806
14808
  class: "fx-icon fx-icon-foldup"
14807
14809
  }, null)]), f("button", {
14808
14810
  type: "button",
14809
14811
  class: "f-hitl-num-btn",
14810
14812
  disabled: C || B,
14811
- onClick: () => U(-1)
14813
+ onClick: () => W(-1)
14812
14814
  }, [f("span", {
14813
14815
  class: "fx-icon fx-icon-expanddown"
14814
14816
  }, null)])])]);
@@ -14842,18 +14844,18 @@ const kr = /* @__PURE__ */ ie({
14842
14844
  }, [_.label]), C]);
14843
14845
  }
14844
14846
  function D(_, C, I) {
14845
- const F = u.value[_.id] ?? "", L = u.value[_.id] ?? [], U = r.value[_.id] ?? {
14847
+ const F = u.value[_.id] ?? "", L = u.value[_.id] ?? [], W = r.value[_.id] ?? {
14846
14848
  active: !1,
14847
14849
  text: ""
14848
- }, W = I === "single", B = W && F === $t || U.active, P = _.allow_other && B, R = (Z) => W ? F === Z.label && !U.active : L.includes(Z.label), z = (Z) => () => {
14849
- i.value || (W ? v(_, Z.label) : A(_, Z.label));
14850
+ }, U = I === "single", B = U && F === $t || W.active, P = _.allow_other && B, R = (Z) => U ? F === Z.label && !W.active : L.includes(Z.label), z = (Z) => () => {
14851
+ i.value || (U ? v(_, Z.label) : A(_, Z.label));
14850
14852
  }, q = () => {
14851
14853
  if (!i.value)
14852
- if (W)
14854
+ if (U)
14853
14855
  v(_, $t);
14854
14856
  else {
14855
- const Z = U.text;
14856
- U.active ? (p(_.id, L.filter((Q) => Q !== Z)), r.value = {
14857
+ const Z = W.text;
14858
+ W.active ? (p(_.id, L.filter((Q) => Q !== Z)), r.value = {
14857
14859
  ...r.value,
14858
14860
  [_.id]: {
14859
14861
  active: !1,
@@ -14863,9 +14865,9 @@ const kr = /* @__PURE__ */ ie({
14863
14865
  ...r.value,
14864
14866
  [_.id]: {
14865
14867
  active: !0,
14866
- text: U.text
14868
+ text: W.text
14867
14869
  }
14868
- }, U.text && !L.includes(U.text) && p(_.id, [...L, U.text]));
14870
+ }, W.text && !L.includes(W.text) && p(_.id, [...L, W.text]));
14869
14871
  }
14870
14872
  }, ee = (Z) => {
14871
14873
  const Q = Z.target.value;
@@ -14875,7 +14877,7 @@ const kr = /* @__PURE__ */ ie({
14875
14877
  active: !0,
14876
14878
  text: Q
14877
14879
  }
14878
- }, W ? p(_.id, $t) : p(_.id, [...L.filter((ae) => ae !== U.text), Q]);
14880
+ }, U ? p(_.id, $t) : p(_.id, [...L.filter((ae) => ae !== W.text), Q]);
14879
14881
  };
14880
14882
  return f("div", {
14881
14883
  key: _.id
@@ -14898,7 +14900,7 @@ const kr = /* @__PURE__ */ ie({
14898
14900
  }, null) : null])]) : null]), P ? f("input", {
14899
14901
  class: "f-hitl-input f-hitl-input--other",
14900
14902
  type: "text",
14901
- value: U.text,
14903
+ value: W.text,
14902
14904
  placeholder: "请输入自定义内容",
14903
14905
  disabled: i.value,
14904
14906
  onInput: ee
@@ -14915,21 +14917,24 @@ const kr = /* @__PURE__ */ ie({
14915
14917
  const L = C[F.name] ?? "";
14916
14918
  return F.type === "select" ? T(F, f("div", {
14917
14919
  class: "f-hitl-select-group"
14918
- }, [(F.options ?? []).map((U) => f("button", {
14919
- key: U,
14920
- type: "button",
14921
- class: ["f-hitl-opt", {
14922
- "f-hitl-opt--active": L === U
14923
- }],
14924
- disabled: i.value,
14925
- onClick: () => x(_.id, F.name, U)
14926
- }, [U]))])) : F.type === "number" ? T(F, y(L, i.value, (U) => x(_.id, F.name, U), F.min, F.max)) : F.type === "date" ? T(F, g(L, i.value, (U) => x(_.id, F.name, U))) : T(F, f("input", {
14920
+ }, [(F.options ?? []).map((W) => {
14921
+ const U = typeof W == "string" ? W : W.label ?? "";
14922
+ return f("button", {
14923
+ key: U,
14924
+ type: "button",
14925
+ class: ["f-hitl-opt", {
14926
+ "f-hitl-opt--active": L === U
14927
+ }],
14928
+ disabled: i.value,
14929
+ onClick: () => x(_.id, F.name, U)
14930
+ }, [U]);
14931
+ })])) : F.type === "number" ? T(F, y(L, i.value, (W) => x(_.id, F.name, W), F.min, F.max)) : F.type === "date" ? T(F, g(L, i.value, (W) => x(_.id, F.name, W))) : T(F, f("input", {
14927
14932
  class: "f-hitl-input",
14928
14933
  type: "text",
14929
14934
  value: L,
14930
14935
  placeholder: F.default_value ?? "请输入",
14931
14936
  disabled: i.value,
14932
- onInput: (U) => x(_.id, F.name, U.target.value)
14937
+ onInput: (W) => x(_.id, F.name, W.target.value)
14933
14938
  }, null));
14934
14939
  })])]);
14935
14940
  }
@@ -15014,13 +15019,13 @@ const kr = /* @__PURE__ */ ie({
15014
15019
  }, [ce("暂不支持 ui_type「"), String(_.ui_type), ce("」,请升级前端。")])]);
15015
15020
  }
15016
15021
  function H(_) {
15017
- const C = kn(_.ui_type), I = (L, U, W) => f("input", {
15022
+ const C = kn(_.ui_type), I = (L, W, U) => f("input", {
15018
15023
  class: "f-hitl-input",
15019
15024
  type: L,
15020
- value: U,
15025
+ value: W,
15021
15026
  readonly: !0,
15022
- min: W == null ? void 0 : W.min,
15023
- max: W == null ? void 0 : W.max
15027
+ min: U == null ? void 0 : U.min,
15028
+ max: U == null ? void 0 : U.max
15024
15029
  }, null);
15025
15030
  if (C === "text") {
15026
15031
  const L = u.value[_.id] ?? "";
@@ -15030,12 +15035,12 @@ const kr = /* @__PURE__ */ ie({
15030
15035
  }, [I("text", L)]);
15031
15036
  }
15032
15037
  if (C === "multi_select") {
15033
- const L = u.value[_.id] ?? [], U = Array.isArray(_.options) ? _.options : [], W = new Set(U.map((P) => P.label)), B = L.filter((P) => !W.has(P));
15038
+ const L = u.value[_.id] ?? [], W = Array.isArray(_.options) ? _.options : [], U = new Set(W.map((P) => P.label)), B = L.filter((P) => !U.has(P));
15034
15039
  return f("div", {
15035
15040
  key: _.id
15036
15041
  }, [f("div", {
15037
15042
  class: "f-hitl-option-list"
15038
- }, [U.filter((P) => L.includes(P.label)).map((P) => f("div", {
15043
+ }, [W.filter((P) => L.includes(P.label)).map((P) => f("div", {
15039
15044
  class: "f-hitl-opt-row",
15040
15045
  key: P.label
15041
15046
  }, [f("div", {
@@ -15050,10 +15055,10 @@ const kr = /* @__PURE__ */ ie({
15050
15055
  }, [f("span", null, [P])])]))])]);
15051
15056
  }
15052
15057
  if (C === "select") {
15053
- const L = u.value[_.id] ?? "", U = r.value[_.id] ?? {
15058
+ const L = u.value[_.id] ?? "", W = r.value[_.id] ?? {
15054
15059
  active: !1,
15055
15060
  text: ""
15056
- }, W = Array.isArray(_.options) ? _.options : [], B = L === $t || U.active;
15061
+ }, U = Array.isArray(_.options) ? _.options : [], B = L === $t || W.active;
15057
15062
  return f("div", {
15058
15063
  key: _.id
15059
15064
  }, [f("div", {
@@ -15062,7 +15067,7 @@ const kr = /* @__PURE__ */ ie({
15062
15067
  class: "f-hitl-opt-row"
15063
15068
  }, [f("div", {
15064
15069
  class: "f-hitl-opt-row__label"
15065
- }, [f("span", null, [U.text || "其他"])])]) : W.filter((P) => P.label === L).map((P) => f("div", {
15070
+ }, [f("span", null, [W.text || "其他"])])]) : U.filter((P) => P.label === L).map((P) => f("div", {
15066
15071
  class: "f-hitl-opt-row",
15067
15072
  key: P.label
15068
15073
  }, [f("div", {
@@ -15084,19 +15089,19 @@ const kr = /* @__PURE__ */ ie({
15084
15089
  }, [L === !0 ? "是" : "否"])])]);
15085
15090
  }
15086
15091
  if (C === "form") {
15087
- const L = u.value[_.id] ?? {}, U = _.fields ?? [];
15092
+ const L = u.value[_.id] ?? {}, W = _.fields ?? [];
15088
15093
  return f("div", {
15089
15094
  class: "f-hitl-field",
15090
15095
  key: _.id
15091
15096
  }, [f("div", {
15092
15097
  class: "f-hitl-form-group"
15093
- }, [U.map((W) => {
15094
- const B = L[W.name] ?? "";
15098
+ }, [W.map((U) => {
15099
+ const B = L[U.name] ?? "";
15095
15100
  let P;
15096
- return W.type === "number" ? P = I("number", B, {
15097
- min: W.min,
15098
- max: W.max
15099
- }) : W.type === "date" ? P = I("date", B) : P = I("text", B), T(W, P);
15101
+ return U.type === "number" ? P = I("number", B, {
15102
+ min: U.min,
15103
+ max: U.max
15104
+ }) : U.type === "date" ? P = I("date", B) : P = I("text", B), T(U, P);
15100
15105
  })])]);
15101
15106
  }
15102
15107
  if (C === "date") {
@@ -15197,7 +15202,7 @@ const kr = /* @__PURE__ */ ie({
15197
15202
  onClick: b
15198
15203
  }, [ce("提交")])])]);
15199
15204
  }
15200
- return () => t.value ? O() : V();
15205
+ return () => i.value ? O() : V();
15201
15206
  }
15202
15207
  });
15203
15208
  kr.install = (e) => {