@netlify/spark-ui 1.17.6 → 1.18.0-alpha.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.
Files changed (27) hide show
  1. package/dist/analytics/analytics.d.ts +9 -1
  2. package/dist/assets/AskNetlify.css +1 -1
  3. package/dist/assets/Popover.css +1 -1
  4. package/dist/chunks/{AskNetlify.1Uqf__uI.js → AskNetlify.BYFTesUF.js} +221 -213
  5. package/dist/chunks/analytics.D_dJH08O.js +20 -0
  6. package/dist/components/preact/AskNetlify/AskNetlify.js +1 -1
  7. package/dist/components/preact/AskNetlify/components/ActionBar.d.ts +7 -0
  8. package/dist/components/preact/AskNetlify/components/ActionBar.js +78 -0
  9. package/dist/components/preact/AskNetlify/components/ChatMessages.d.ts +2 -1
  10. package/dist/components/preact/AskNetlify/components/ChatMessages.js +69 -59
  11. package/dist/components/preact/AskNetlify/hooks/useAskAnalytics.js +1 -1
  12. package/dist/components/preact/Icon/index.d.ts +2 -1
  13. package/dist/components/preact/Icon/index.js +83 -40
  14. package/dist/components/preact/Popover/Popover.js +7 -7
  15. package/dist/components/preact/SearchModal/components/SearchModal/SearchModal.js +1 -1
  16. package/dist/components/preact/SearchModal/hooks/useSearchAnalytics.js +1 -1
  17. package/dist/components/preact/index.js +1 -1
  18. package/package.json +2 -2
  19. package/packages/analytics/analytics.ts +28 -4
  20. package/packages/components/preact/AskNetlify/AskNetlify.css +24 -1
  21. package/packages/components/preact/AskNetlify/AskNetlify.tsx +9 -2
  22. package/packages/components/preact/AskNetlify/components/ActionBar.tsx +118 -0
  23. package/packages/components/preact/AskNetlify/components/ChatMessages.tsx +11 -1
  24. package/packages/components/preact/Icon/index.tsx +68 -0
  25. package/packages/components/preact/Popover/Popover.css +5 -10
  26. package/packages/components/preact/Popover/Popover.tsx +2 -2
  27. package/dist/chunks/analytics.Ch1vuuOl.js +0 -13
@@ -0,0 +1,20 @@
1
+ class i {
2
+ /**
3
+ * Pushes an event payload into both Google Analytics (gtag) and Segment.
4
+ * @param eventName e.g. 'www:search_new_query'
5
+ * @param payload additional key/value data
6
+ */
7
+ track(t, n = {}) {
8
+ if (typeof gtag == "function" ? gtag("event", t, { ...n }) : console.error(`gtag is not defined. Event [${t}] failed.`), typeof window < "u" && window.analytics)
9
+ try {
10
+ window.analytics.track(t, n);
11
+ } catch (e) {
12
+ console.error(`Segment track failed for event [${t}]:`, e);
13
+ }
14
+ else
15
+ console.warn(`Segment analytics is not loaded. Event [${t}] not sent to Segment.`);
16
+ }
17
+ }
18
+ export {
19
+ i as A
20
+ };
@@ -1,6 +1,6 @@
1
1
  import "../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
2
2
  import "../../../chunks/hooks.module.DGkdD5n9.js";
3
- import { A as d } from "../../../chunks/AskNetlify.1Uqf__uI.js";
3
+ import { A as d } from "../../../chunks/AskNetlify.BYFTesUF.js";
4
4
  import "./components/QuestionList/questions.js";
5
5
  import "./components/QuestionList/QuestionList.js";
6
6
  import "./components/BackButton.js";
@@ -0,0 +1,7 @@
1
+ interface ActionBarProps {
2
+ answer: string;
3
+ questionAnswerId: string;
4
+ addFeedback: (id: string, type: string, meta?: object) => void;
5
+ }
6
+ export declare function ActionBar({ answer, questionAnswerId, addFeedback }: ActionBarProps): import("preact").JSX.Element;
7
+ export {};
@@ -0,0 +1,78 @@
1
+ import { u as t } from "../../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
2
+ import i from "../../Icon/index.js";
3
+ import s from "../../Popover/Popover.js";
4
+ import { A as b } from "../../../../chunks/analytics.D_dJH08O.js";
5
+ const d = (n) => {
6
+ const e = n.target.closest("button");
7
+ if (!e) return;
8
+ const o = e.classList.contains("btn-feedback-helpful"), r = e.classList.contains("btn-feedback-incorrect");
9
+ if (!o && !r) return;
10
+ const c = e.closest(".n-ask-action-bar"), f = c == null ? void 0 : c.querySelector(".btn-feedback-helpful"), p = c == null ? void 0 : c.querySelector(".btn-feedback-incorrect");
11
+ [f, p].forEach((l) => {
12
+ if (!l) return;
13
+ l.querySelectorAll('[id*="icon"]').forEach((a, u) => {
14
+ u === 0 ? a.classList.remove("hidden") : a.classList.add("hidden");
15
+ });
16
+ }), e.querySelectorAll('[id*="icon"]').forEach((l) => {
17
+ l.classList.toggle("hidden");
18
+ });
19
+ }, h = async (n) => {
20
+ const e = document.getElementById("copy-popover");
21
+ try {
22
+ await navigator.clipboard.writeText(n), e && (e.textContent = "Copied", setTimeout(() => {
23
+ e.textContent = "Copy", e.blur();
24
+ }, 2e3));
25
+ } catch (o) {
26
+ console.error("Failed to copy code: ", o), e && (e.textContent = "Failed to copy", setTimeout(() => {
27
+ e.textContent = "Copy", e.blur();
28
+ }, 2e3));
29
+ }
30
+ };
31
+ function x({ answer: n, questionAnswerId: e, addFeedback: o }) {
32
+ const r = new b();
33
+ return /* @__PURE__ */ t("div", { className: "n-ask-action-bar", children: [
34
+ /* @__PURE__ */ t(s, { id: "copy", content: "Copy", children: /* @__PURE__ */ t(
35
+ "button",
36
+ {
37
+ onClick: () => {
38
+ h(n), r.track("ask:copy_answer", { id: e });
39
+ },
40
+ children: /* @__PURE__ */ t(i, { name: "copy" })
41
+ }
42
+ ) }),
43
+ /* @__PURE__ */ t(s, { id: "feedback-helpful", content: "Helpful", children: /* @__PURE__ */ t(
44
+ "button",
45
+ {
46
+ class: "btn-feedback-helpful n-stack",
47
+ onClick: (c) => {
48
+ d(c), o(e, "upvote"), r.track("ask:feedback_helpful", { id: e });
49
+ },
50
+ children: [
51
+ /* @__PURE__ */ t(i, { name: "thumbsUp" }),
52
+ /* @__PURE__ */ t(i, { name: "thumbsUpSolid", className: "hidden" })
53
+ ]
54
+ }
55
+ ) }),
56
+ /* @__PURE__ */ t(s, { id: "feedback-incorrect", content: "Not helpful", children: /* @__PURE__ */ t(
57
+ "button",
58
+ {
59
+ class: "btn-feedback-incorrect n-stack",
60
+ onClick: (c) => {
61
+ d(c), o(e, "downvote", {
62
+ incorrect: !0,
63
+ irrelevant: !1,
64
+ unaddressed: !1,
65
+ issue: "This information isn't accurate"
66
+ }), r.track("ask:feedback_not_helpful", { id: e });
67
+ },
68
+ children: [
69
+ /* @__PURE__ */ t(i, { name: "thumbsDown" }),
70
+ /* @__PURE__ */ t(i, { name: "thumbsDownSolid", className: "hidden" })
71
+ ]
72
+ }
73
+ ) })
74
+ ] });
75
+ }
76
+ export {
77
+ x as ActionBar
78
+ };
@@ -1,6 +1,7 @@
1
1
  import { Ref } from 'preact';
2
- export declare function ChatMessages({ conversation, lastMessageRef, isPreparingAnswer, }: {
2
+ export declare function ChatMessages({ conversation, lastMessageRef, isPreparingAnswer, addFeedback, }: {
3
3
  conversation: any[];
4
4
  lastMessageRef: Ref<HTMLDivElement>;
5
5
  isPreparingAnswer: boolean;
6
+ addFeedback: any;
6
7
  }): import("preact").JSX.Element;
@@ -4,7 +4,8 @@ var d = (n, e, t) => ye(n, typeof e != "symbol" ? e + "" : e, t);
4
4
  import { u as w } from "../../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
5
5
  import Se from "../../Icon/index.js";
6
6
  import { SourcesList as $e } from "./SourcesList.js";
7
- import { Fragment as Re } from "preact";
7
+ import { ActionBar as Re } from "./ActionBar.js";
8
+ import { Fragment as ve } from "preact";
8
9
  function H() {
9
10
  return {
10
11
  async: !1,
@@ -92,31 +93,31 @@ var x = {
92
93
  fencesBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}(?:\`\`\`|~~~)`),
93
94
  headingBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}#`),
94
95
  htmlBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}<(?:[a-z].*>|!--)`, "i")
95
- }, ve = /^(?:[ \t]*(?:\n|$))+/, Te = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, ze = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, L = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, _e = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Q = /(?:[*+-]|\d{1,9}[.)])/, ce = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, he = u(ce).replace(/bull/g, Q).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Ae = u(ce).replace(/bull/g, Q).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), F = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Le = /^[^\n]+/, U = /(?!\s*\])(?:\\.|[^\[\]\\])+/, Ie = u(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", U).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Ce = u(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, Q).getRegex(), q = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", X = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Pe = u(
96
+ }, Te = /^(?:[ \t]*(?:\n|$))+/, ze = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, _e = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, L = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Ae = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Q = /(?:[*+-]|\d{1,9}[.)])/, ce = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, he = u(ce).replace(/bull/g, Q).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Le = u(ce).replace(/bull/g, Q).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), F = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Ie = /^[^\n]+/, U = /(?!\s*\])(?:\\.|[^\[\]\\])+/, Ce = u(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", U).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Pe = u(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, Q).getRegex(), q = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", X = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Be = u(
96
97
  "^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))",
97
98
  "i"
98
- ).replace("comment", X).replace("tag", q).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), pe = u(F).replace("hr", L).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", q).getRegex(), Be = u(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", pe).getRegex(), W = {
99
- blockquote: Be,
100
- code: Te,
101
- def: Ie,
102
- fences: ze,
103
- heading: _e,
99
+ ).replace("comment", X).replace("tag", q).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), pe = u(F).replace("hr", L).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", q).getRegex(), Ee = u(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", pe).getRegex(), W = {
100
+ blockquote: Ee,
101
+ code: ze,
102
+ def: Ce,
103
+ fences: _e,
104
+ heading: Ae,
104
105
  hr: L,
105
- html: Pe,
106
+ html: Be,
106
107
  lheading: he,
107
- list: Ce,
108
- newline: ve,
108
+ list: Pe,
109
+ newline: Te,
109
110
  paragraph: pe,
110
111
  table: A,
111
- text: Le
112
+ text: Ie
112
113
  }, re = u(
113
114
  "^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"
114
- ).replace("hr", L).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", q).getRegex(), Ee = {
115
+ ).replace("hr", L).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", q).getRegex(), qe = {
115
116
  ...W,
116
- lheading: Ae,
117
+ lheading: Le,
117
118
  table: re,
118
119
  paragraph: u(F).replace("hr", L).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", re).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", q).getRegex()
119
- }, qe = {
120
+ }, Ze = {
120
121
  ...W,
121
122
  html: u(
122
123
  `^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`
@@ -128,64 +129,64 @@ var x = {
128
129
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
129
130
  paragraph: u(F).replace("hr", L).replace("heading", ` *#{1,6} *[^
130
131
  ]`).replace("lheading", he).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
131
- }, Ze = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, De = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, ue = /^( {2,}|\\)\n(?!\s*$)/, Me = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Z = /[\p{P}\p{S}]/u, J = /[\s\p{P}\p{S}]/u, ge = /[^\s\p{P}\p{S}]/u, Ge = u(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, J).getRegex(), fe = /(?!~)[\p{P}\p{S}]/u, Ne = /(?!~)[\s\p{P}\p{S}]/u, Oe = /(?:[^\s\p{P}\p{S}]|~)/u, je = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g, de = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, He = u(de, "u").replace(/punct/g, Z).getRegex(), Qe = u(de, "u").replace(/punct/g, fe).getRegex(), ke = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Fe = u(ke, "gu").replace(/notPunctSpace/g, ge).replace(/punctSpace/g, J).replace(/punct/g, Z).getRegex(), Ue = u(ke, "gu").replace(/notPunctSpace/g, Oe).replace(/punctSpace/g, Ne).replace(/punct/g, fe).getRegex(), Xe = u(
132
+ }, De = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Me = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, ue = /^( {2,}|\\)\n(?!\s*$)/, Ge = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Z = /[\p{P}\p{S}]/u, J = /[\s\p{P}\p{S}]/u, ge = /[^\s\p{P}\p{S}]/u, Ne = u(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, J).getRegex(), fe = /(?!~)[\p{P}\p{S}]/u, Oe = /(?!~)[\s\p{P}\p{S}]/u, je = /(?:[^\s\p{P}\p{S}]|~)/u, He = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g, de = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Qe = u(de, "u").replace(/punct/g, Z).getRegex(), Fe = u(de, "u").replace(/punct/g, fe).getRegex(), ke = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ue = u(ke, "gu").replace(/notPunctSpace/g, ge).replace(/punctSpace/g, J).replace(/punct/g, Z).getRegex(), Xe = u(ke, "gu").replace(/notPunctSpace/g, je).replace(/punctSpace/g, Oe).replace(/punct/g, fe).getRegex(), We = u(
132
133
  "^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)",
133
134
  "gu"
134
- ).replace(/notPunctSpace/g, ge).replace(/punctSpace/g, J).replace(/punct/g, Z).getRegex(), We = u(/\\(punct)/, "gu").replace(/punct/g, Z).getRegex(), Je = u(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Ke = u(X).replace("(?:-->|$)", "-->").getRegex(), Ve = u(
135
+ ).replace(/notPunctSpace/g, ge).replace(/punctSpace/g, J).replace(/punct/g, Z).getRegex(), Je = u(/\\(punct)/, "gu").replace(/punct/g, Z).getRegex(), Ke = u(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Ve = u(X).replace("(?:-->|$)", "-->").getRegex(), Ye = u(
135
136
  "^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>"
136
- ).replace("comment", Ke).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), P = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, Ye = u(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", P).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), be = u(/^!?\[(label)\]\[(ref)\]/).replace("label", P).replace("ref", U).getRegex(), xe = u(/^!?\[(ref)\](?:\[\])?/).replace("ref", U).getRegex(), et = u("reflink|nolink(?!\\()", "g").replace("reflink", be).replace("nolink", xe).getRegex(), K = {
137
+ ).replace("comment", Ve).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), P = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, et = u(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", P).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), be = u(/^!?\[(label)\]\[(ref)\]/).replace("label", P).replace("ref", U).getRegex(), xe = u(/^!?\[(ref)\](?:\[\])?/).replace("ref", U).getRegex(), tt = u("reflink|nolink(?!\\()", "g").replace("reflink", be).replace("nolink", xe).getRegex(), K = {
137
138
  _backpedal: A,
138
139
  // only used for GFM url
139
- anyPunctuation: We,
140
- autolink: Je,
141
- blockSkip: je,
140
+ anyPunctuation: Je,
141
+ autolink: Ke,
142
+ blockSkip: He,
142
143
  br: ue,
143
- code: De,
144
+ code: Me,
144
145
  del: A,
145
- emStrongLDelim: He,
146
- emStrongRDelimAst: Fe,
147
- emStrongRDelimUnd: Xe,
148
- escape: Ze,
149
- link: Ye,
146
+ emStrongLDelim: Qe,
147
+ emStrongRDelimAst: Ue,
148
+ emStrongRDelimUnd: We,
149
+ escape: De,
150
+ link: et,
150
151
  nolink: xe,
151
- punctuation: Ge,
152
+ punctuation: Ne,
152
153
  reflink: be,
153
- reflinkSearch: et,
154
- tag: Ve,
155
- text: Me,
154
+ reflinkSearch: tt,
155
+ tag: Ye,
156
+ text: Ge,
156
157
  url: A
157
- }, tt = {
158
+ }, nt = {
158
159
  ...K,
159
160
  link: u(/^!?\[(label)\]\((.*?)\)/).replace("label", P).getRegex(),
160
161
  reflink: u(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", P).getRegex()
161
162
  }, N = {
162
163
  ...K,
163
- emStrongRDelimAst: Ue,
164
- emStrongLDelim: Qe,
164
+ emStrongRDelimAst: Xe,
165
+ emStrongLDelim: Fe,
165
166
  url: u(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
166
167
  _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
167
168
  del: /^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,
168
169
  text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
169
- }, nt = {
170
+ }, rt = {
170
171
  ...N,
171
172
  br: u(ue).replace("{2,}", "*").getRegex(),
172
173
  text: u(N.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
173
174
  }, I = {
174
175
  normal: W,
175
- gfm: Ee,
176
- pedantic: qe
176
+ gfm: qe,
177
+ pedantic: Ze
177
178
  }, z = {
178
179
  normal: K,
179
180
  gfm: N,
180
- breaks: nt,
181
- pedantic: tt
182
- }, rt = {
181
+ breaks: rt,
182
+ pedantic: nt
183
+ }, st = {
183
184
  "&": "&amp;",
184
185
  "<": "&lt;",
185
186
  ">": "&gt;",
186
187
  '"': "&quot;",
187
188
  "'": "&#39;"
188
- }, se = (n) => rt[n];
189
+ }, se = (n) => st[n];
189
190
  function y(n, e) {
190
191
  if (e) {
191
192
  if (x.escapeTest.test(n))
@@ -228,7 +229,7 @@ function _(n, e, t) {
228
229
  s++;
229
230
  return n.slice(0, r - s);
230
231
  }
231
- function st(n, e) {
232
+ function it(n, e) {
232
233
  if (n.indexOf(e[1]) === -1)
233
234
  return -1;
234
235
  let t = 0;
@@ -254,7 +255,7 @@ function ae(n, e, t, r, s) {
254
255
  };
255
256
  return r.state.inLink = !1, h;
256
257
  }
257
- function it(n, e, t) {
258
+ function lt(n, e, t) {
258
259
  const r = n.match(t.other.indentCodeCompensation);
259
260
  if (r === null)
260
261
  return e;
@@ -302,7 +303,7 @@ var B = class {
302
303
  fences(n) {
303
304
  const e = this.rules.block.fences.exec(n);
304
305
  if (e) {
305
- const t = e[0], r = it(t, e[3] || "", this.rules);
306
+ const t = e[0], r = lt(t, e[3] || "", this.rules);
306
307
  return {
307
308
  type: "code",
308
309
  raw: t,
@@ -588,7 +589,7 @@ ${o}` : o;
588
589
  if ((t.length - i.length) % 2 === 0)
589
590
  return;
590
591
  } else {
591
- const i = st(e[2], "()");
592
+ const i = it(e[2], "()");
592
593
  if (i === -2)
593
594
  return;
594
595
  if (i > -1) {
@@ -1361,7 +1362,7 @@ ${n}</tr>
1361
1362
  "preprocess",
1362
1363
  "postprocess",
1363
1364
  "processAllTokens"
1364
- ])), G), lt = class {
1365
+ ])), G), at = class {
1365
1366
  constructor(...n) {
1366
1367
  d(this, "defaults", H());
1367
1368
  d(this, "options", this.setOptions);
@@ -1533,7 +1534,7 @@ Please report this to https://github.com/markedjs/marked.`, n) {
1533
1534
  throw t;
1534
1535
  };
1535
1536
  }
1536
- }, R = new lt();
1537
+ }, R = new at();
1537
1538
  function f(n, e) {
1538
1539
  return R.parse(n, e);
1539
1540
  }
@@ -1565,38 +1566,47 @@ f.walkTokens;
1565
1566
  f.parseInline;
1566
1567
  $.parse;
1567
1568
  S.lex;
1568
- function ut({
1569
+ function ft({
1569
1570
  conversation: n,
1570
1571
  lastMessageRef: e,
1571
- isPreparingAnswer: t
1572
+ isPreparingAnswer: t,
1573
+ addFeedback: r
1572
1574
  }) {
1573
- return /* @__PURE__ */ w(Re, { children: [
1574
- n.map((r, s) => {
1575
- const i = s === n.length - 1;
1575
+ return /* @__PURE__ */ w(ve, { children: [
1576
+ n.map((s, i) => {
1577
+ const c = i === n.length - 1;
1576
1578
  return /* @__PURE__ */ w("div", { class: "n-ask-message", children: [
1577
1579
  /* @__PURE__ */ w("div", { class: "n-ask-message-right", children: /* @__PURE__ */ w(
1578
1580
  "div",
1579
1581
  {
1580
- ref: i ? e : null,
1582
+ ref: c ? e : null,
1581
1583
  class: "n-ask-message-bubble n-ask-user-message",
1582
- children: /* @__PURE__ */ w("p", { children: r.question })
1584
+ children: /* @__PURE__ */ w("p", { children: s.question })
1583
1585
  }
1584
1586
  ) }),
1585
- /* @__PURE__ */ w("div", { class: "n-ask-message-left", children: r.answer && /* @__PURE__ */ w("div", { class: "n-ask-message-bubble n-ask-bot-message", children: [
1587
+ /* @__PURE__ */ w("div", { class: "n-ask-message-left", children: s.answer && /* @__PURE__ */ w("div", { class: "n-ask-message-bubble n-ask-bot-message flow", children: [
1586
1588
  /* @__PURE__ */ w(
1587
1589
  "div",
1588
1590
  {
1589
1591
  class: "n-ask-message-answer n-ask-prose prose flow",
1590
- dangerouslySetInnerHTML: { __html: f.parse(r.answer) }
1592
+ dangerouslySetInnerHTML: { __html: f.parse(s.answer) }
1593
+ }
1594
+ ),
1595
+ s.id && /* @__PURE__ */ w(
1596
+ Re,
1597
+ {
1598
+ answer: s.answer,
1599
+ addFeedback: r,
1600
+ questionAnswerId: s.id
1591
1601
  }
1592
1602
  ),
1593
- r.id && /* @__PURE__ */ w($e, { sources: r.sources })
1603
+ s.id && /* @__PURE__ */ w($e, { sources: s.sources })
1594
1604
  ] }) })
1595
- ] }, r.id || `qa-${s}`);
1605
+ ] }, s.id || `qa-${i}`);
1596
1606
  }),
1597
1607
  t && /* @__PURE__ */ w("div", { class: "n-ask-message-loader", children: /* @__PURE__ */ w(Se, { name: "askNetlify" }) })
1598
1608
  ] });
1599
1609
  }
1600
1610
  export {
1601
- ut as ChatMessages
1611
+ ft as ChatMessages
1602
1612
  };
@@ -1,5 +1,5 @@
1
1
  import { A as o, q as n } from "../../../../chunks/hooks.module.DGkdD5n9.js";
2
- import { A as u } from "../../../../chunks/analytics.Ch1vuuOl.js";
2
+ import { A as u } from "../../../../chunks/analytics.D_dJH08O.js";
3
3
  function A() {
4
4
  const r = o(new u()).current, s = n((e) => {
5
5
  !e.question || !e.threadId || r == null || r.track("ask:new_query", {
@@ -1,6 +1,7 @@
1
1
  type Props = {
2
2
  name: IconName;
3
+ className?: string;
3
4
  };
4
5
  export default function Icon(props: Props): import("preact").JSX.Element | undefined;
5
- export type IconName = 'askNetlify' | 'book' | 'caretRight' | 'code' | 'comment' | 'cube' | 'lightbulb' | 'link' | 'pageWithLines' | 'pencil' | 'rss' | 'search' | 'terminal' | 'question' | 'linkedin' | 'netlify' | 'bluesky' | 'twitter' | 'youtube';
6
+ export type IconName = 'askNetlify' | 'book' | 'caretRight' | 'check' | 'code' | 'comment' | 'copy' | 'cube' | 'lightbulb' | 'link' | 'pageWithLines' | 'pencil' | 'rss' | 'search' | 'terminal' | 'thumbsDown' | 'thumbsDownSolid' | 'thumbsUp' | 'thumbsUpSolid' | 'question' | 'linkedin' | 'netlify' | 'bluesky' | 'twitter' | 'youtube';
6
7
  export {};