@squadico/chatbot 1.2.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/README.md +109 -19
  2. package/dist/answer-CDGrP8YE.js +1193 -0
  3. package/dist/answer-CDGrP8YE.js.map +1 -0
  4. package/dist/answer-DRaV2dVt.cjs +8 -0
  5. package/dist/answer-DRaV2dVt.cjs.map +1 -0
  6. package/dist/chatbot-widgets.global.js +4 -0
  7. package/dist/chatbot-widgets.global.js.map +1 -0
  8. package/dist/chatbot.global.js +12 -7
  9. package/dist/chatbot.global.js.map +1 -1
  10. package/dist/components/ChatbotWidget.d.ts.map +1 -1
  11. package/dist/components/MessageList.d.ts +4 -1
  12. package/dist/components/MessageList.d.ts.map +1 -1
  13. package/dist/components/RichText.d.ts +6 -4
  14. package/dist/components/RichText.d.ts.map +1 -1
  15. package/dist/element.d.ts.map +1 -1
  16. package/dist/extras-ClIRRLqo.js +604 -0
  17. package/dist/extras-ClIRRLqo.js.map +1 -0
  18. package/dist/extras-lsCe4xgN.cjs +4 -0
  19. package/dist/extras-lsCe4xgN.cjs.map +1 -0
  20. package/dist/index.cjs +1 -1
  21. package/dist/index.d.ts +1 -1
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +3 -2
  24. package/dist/jsx.d.ts +43 -0
  25. package/dist/jsx.d.ts.map +1 -1
  26. package/dist/lib/client.d.ts +8 -4
  27. package/dist/lib/client.d.ts.map +1 -1
  28. package/dist/lib/i18n.d.ts +20 -0
  29. package/dist/lib/i18n.d.ts.map +1 -1
  30. package/dist/lib/useChat.d.ts.map +1 -1
  31. package/dist/react.cjs +1 -1
  32. package/dist/react.cjs.map +1 -1
  33. package/dist/react.d.ts.map +1 -1
  34. package/dist/react.js +2 -2
  35. package/dist/react.js.map +1 -1
  36. package/dist/src-BjqOavOO.js +1984 -0
  37. package/dist/src-BjqOavOO.js.map +1 -0
  38. package/dist/src-DS8P9HdZ.cjs +7 -0
  39. package/dist/src-DS8P9HdZ.cjs.map +1 -0
  40. package/dist/types.d.ts +14 -2
  41. package/dist/types.d.ts.map +1 -1
  42. package/dist/widgets/approval/SqcApproval.d.ts +17 -0
  43. package/dist/widgets/approval/SqcApproval.d.ts.map +1 -0
  44. package/dist/widgets/approval/name.d.ts +3 -0
  45. package/dist/widgets/approval/name.d.ts.map +1 -0
  46. package/dist/widgets/chart/SqcChart.d.ts +19 -0
  47. package/dist/widgets/chart/SqcChart.d.ts.map +1 -0
  48. package/dist/widgets/chart/draw.d.ts +31 -0
  49. package/dist/widgets/chart/draw.d.ts.map +1 -0
  50. package/dist/widgets/chart/png.d.ts +10 -0
  51. package/dist/widgets/chart/png.d.ts.map +1 -0
  52. package/dist/widgets/chart/read.d.ts +11 -0
  53. package/dist/widgets/chart/read.d.ts.map +1 -0
  54. package/dist/widgets/chart/strings.d.ts +32 -0
  55. package/dist/widgets/chart/strings.d.ts.map +1 -0
  56. package/dist/widgets/choices/SqcChoices.d.ts +17 -0
  57. package/dist/widgets/choices/SqcChoices.d.ts.map +1 -0
  58. package/dist/widgets/confirm/SqcConfirm.d.ts +12 -0
  59. package/dist/widgets/confirm/SqcConfirm.d.ts.map +1 -0
  60. package/dist/widgets/define.d.ts +8 -0
  61. package/dist/widgets/define.d.ts.map +1 -0
  62. package/dist/widgets/element.d.ts +26 -0
  63. package/dist/widgets/element.d.ts.map +1 -0
  64. package/dist/widgets/extras-loader.d.ts +21 -0
  65. package/dist/widgets/extras-loader.d.ts.map +1 -0
  66. package/dist/widgets/extras.d.ts +3 -0
  67. package/dist/widgets/extras.d.ts.map +1 -0
  68. package/dist/widgets/extras.global.d.ts +2 -0
  69. package/dist/widgets/extras.global.d.ts.map +1 -0
  70. package/dist/widgets/form/SqcForm.d.ts +14 -0
  71. package/dist/widgets/form/SqcForm.d.ts.map +1 -0
  72. package/dist/widgets/form/reply.d.ts +7 -0
  73. package/dist/widgets/form/reply.d.ts.map +1 -0
  74. package/dist/widgets/i18n.d.ts +4 -0
  75. package/dist/widgets/i18n.d.ts.map +1 -0
  76. package/dist/widgets/index.d.ts +10 -0
  77. package/dist/widgets/index.d.ts.map +1 -0
  78. package/dist/widgets/inline.d.ts +11 -0
  79. package/dist/widgets/inline.d.ts.map +1 -0
  80. package/dist/widgets/live.d.ts +12 -0
  81. package/dist/widgets/live.d.ts.map +1 -0
  82. package/dist/widgets/names.d.ts +10 -0
  83. package/dist/widgets/names.d.ts.map +1 -0
  84. package/dist/widgets/parse/answer.d.ts +11 -0
  85. package/dist/widgets/parse/answer.d.ts.map +1 -0
  86. package/dist/widgets/parse/confirm.d.ts +19 -0
  87. package/dist/widgets/parse/confirm.d.ts.map +1 -0
  88. package/dist/widgets/parse/form.d.ts +6 -0
  89. package/dist/widgets/parse/form.d.ts.map +1 -0
  90. package/dist/widgets/styles.d.ts +3 -0
  91. package/dist/widgets/styles.d.ts.map +1 -0
  92. package/dist/widgets/table/SqcTable.d.ts +16 -0
  93. package/dist/widgets/table/SqcTable.d.ts.map +1 -0
  94. package/dist/widgets/types.d.ts +68 -0
  95. package/dist/widgets/types.d.ts.map +1 -0
  96. package/dist/widgets.cjs +1 -0
  97. package/dist/widgets.js +3 -0
  98. package/package.json +7 -2
  99. package/dist/components/Approval.d.ts +0 -37
  100. package/dist/components/Approval.d.ts.map +0 -1
  101. package/dist/components/Choices.d.ts +0 -27
  102. package/dist/components/Choices.d.ts.map +0 -1
  103. package/dist/components/Confirm.d.ts +0 -16
  104. package/dist/components/Confirm.d.ts.map +0 -1
  105. package/dist/lib/confirm.d.ts +0 -17
  106. package/dist/lib/confirm.d.ts.map +0 -1
  107. package/dist/src-2GKPJcbZ.js +0 -2708
  108. package/dist/src-2GKPJcbZ.js.map +0 -1
  109. package/dist/src-CcILETWB.cjs +0 -8
  110. package/dist/src-CcILETWB.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ChatbotWidget.d.ts","sourceRoot":"","sources":["../../src/components/ChatbotWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAOjC,OAAO,KAAK,EAAkB,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAY5E,0EAA0E;AAC1E,MAAM,WAAW,eAAe;IAC9B,IAAI,IAAI,IAAI,CAAA;IACZ,KAAK,IAAI,IAAI,CAAA;IACb,MAAM,IAAI,IAAI,CAAA;IACd,KAAK,IAAI,IAAI,CAAA;IACb,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,MAAM,IAAI,OAAO,CAAA;IACjB,SAAS,IAAI,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IACxD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAA;IACvC,+DAA+D;IAC/D,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI,KAAK,IAAI,CAAA;CAClD;AAkED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAiVpE"}
1
+ {"version":3,"file":"ChatbotWidget.d.ts","sourceRoot":"","sources":["../../src/components/ChatbotWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAOjC,OAAO,KAAK,EAAkB,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAa5E,0EAA0E;AAC1E,MAAM,WAAW,eAAe;IAC9B,IAAI,IAAI,IAAI,CAAA;IACZ,KAAK,IAAI,IAAI,CAAA;IACb,MAAM,IAAI,IAAI,CAAA;IACd,KAAK,IAAI,IAAI,CAAA;IACb,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,MAAM,IAAI,OAAO,CAAA;IACjB,SAAS,IAAI,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IACxD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAA;IACvC,+DAA+D;IAC/D,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI,KAAK,IAAI,CAAA;CAClD;AAkED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAsVpE"}
@@ -25,8 +25,11 @@ export interface MessageListProps {
25
25
  onChoice: (label: string) => void;
26
26
  /** Decides the tool call the last message put on hold. */
27
27
  onDecide: (approved: boolean, label: string) => void;
28
+ /** A widget asked for the composer (`sqc-compose`): the visitor will write
29
+ * their own answer. */
30
+ onCompose?: () => void;
28
31
  /** Reads the bytes of a file a turn carried. Absent where nothing can. */
29
32
  onLoadAttachment?: AttachmentLoader;
30
33
  }
31
- export declare function MessageList({ messages, locale, assistantName, suggestions, showSuggestions, busy, withHuman, onSuggestion, onChoice, onDecide, onLoadAttachment, }: MessageListProps): JSX.Element;
34
+ export declare function MessageList({ messages, locale, assistantName, suggestions, showSuggestions, busy, withHuman, onSuggestion, onChoice, onDecide, onCompose, onLoadAttachment, }: MessageListProps): JSX.Element;
32
35
  //# sourceMappingURL=MessageList.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MessageList.d.ts","sourceRoot":"","sources":["../../src/components/MessageList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAGjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,KAAK,EAAkB,WAAW,EAAE,MAAM,UAAU,CAAA;AAoB3D,wEAAwE;AACxE,MAAM,MAAM,gBAAgB,GAAG,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;AAuLtE;iCACiC;AACjC,wBAAgB,QAAQ,IAAI,GAAG,CAAC,OAAO,CActC;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,WAAW,EAAE,CAAA;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,wCAAwC;IACxC,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB;2BACuB;IACvB,eAAe,EAAE,OAAO,CAAA;IACxB,oEAAoE;IACpE,IAAI,CAAC,EAAE,OAAO,CAAA;IACd;kEAC8D;IAC9D,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,+DAA+D;IAC/D,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,0DAA0D;IAC1D,QAAQ,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACpD,0EAA0E;IAC1E,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;CACpC;AAED,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,MAAM,EACN,aAAa,EACb,WAAW,EACX,eAAe,EACf,IAAI,EACJ,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,gBAAgB,GACjB,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,CAoEhC"}
1
+ {"version":3,"file":"MessageList.d.ts","sourceRoot":"","sources":["../../src/components/MessageList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAKjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,KAAK,EAAkB,WAAW,EAAmB,MAAM,UAAU,CAAA;AAyD5E,wEAAwE;AACxE,MAAM,MAAM,gBAAgB,GAAG,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;AA4OtE;iCACiC;AACjC,wBAAgB,QAAQ,IAAI,GAAG,CAAC,OAAO,CActC;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,WAAW,EAAE,CAAA;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,wCAAwC;IACxC,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB;2BACuB;IACvB,eAAe,EAAE,OAAO,CAAA;IACxB,oEAAoE;IACpE,IAAI,CAAC,EAAE,OAAO,CAAA;IACd;kEAC8D;IAC9D,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,+DAA+D;IAC/D,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,0DAA0D;IAC1D,QAAQ,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACpD;4BACwB;IACxB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,0EAA0E;IAC1E,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;CACpC;AAED,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,MAAM,EACN,aAAa,EACb,WAAW,EACX,eAAe,EACf,IAAI,EACJ,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,gBAAgB,GACjB,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,CAgHhC"}
@@ -7,13 +7,15 @@
7
7
  * above all **never** any injected HTML — everything is produced as Preact
8
8
  * nodes, hence escaped by construction.
9
9
  */
10
- import type { JSX } from 'preact';
10
+ import { type JSX } from 'preact';
11
11
  import type { Locale } from '../lib/i18n';
12
12
  export interface RichTextProps {
13
13
  text: string;
14
14
  locale: Locale;
15
- /** Makes the checkboxes clickable; absent, they stay displayed but frozen. */
16
- onChoice?: (label: string) => void;
15
+ /** The widgets still await an answer; false freezes them (answered, older, in flight). */
16
+ live?: boolean;
17
+ /** May close with Yes / No when the answer ends on a closed question. Absent: never. */
18
+ confirmable?: boolean;
17
19
  }
18
- export declare function RichText({ text, locale, onChoice }: RichTextProps): JSX.Element;
20
+ export declare function RichText({ text, locale, live, confirmable }: RichTextProps): JSX.Element;
19
21
  //# sourceMappingURL=RichText.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RichText.d.ts","sourceRoot":"","sources":["../../src/components/RichText.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AACjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AA+IzC,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACnC;AAED,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,aAAa,GAAG,GAAG,CAAC,OAAO,CAyL/E"}
1
+ {"version":3,"file":"RichText.d.ts","sourceRoot":"","sources":["../../src/components/RichText.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAY,KAAK,GAAG,EAAE,MAAM,QAAQ,CAAA;AAE3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAqEzC,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,0FAA0F;IAC1F,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,wFAAwF;IACxF,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB;AAuLD,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,aAAa,GAAG,GAAG,CAAC,OAAO,CAWxF"}
@@ -1 +1 @@
1
- {"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../src/element.tsx"],"names":[],"mappings":"AAkBA,eAAO,MAAM,QAAQ,qBAAqB,CAAA;AA6W1C;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,GAAG,GAAE,MAAiB,GAAG,IAAI,CAM1D"}
1
+ {"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../src/element.tsx"],"names":[],"mappings":"AAkBA,eAAO,MAAM,QAAQ,qBAAqB,CAAA;AA+W1C;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,GAAG,GAAE,MAAiB,GAAG,IAAI,CAM1D"}
@@ -0,0 +1,604 @@
1
+ import { C as e, D as t, b as n, c as r, g as i, i as a, l as o, o as s, u as c, w as l, x as u } from "./answer-CDGrP8YE.js";
2
+ //#region \0rolldown/runtime.js
3
+ var d = Object.defineProperty, f = (e, t) => {
4
+ let n = {};
5
+ for (var r in e) d(n, r, {
6
+ get: e[r],
7
+ enumerable: !0
8
+ });
9
+ return t || d(n, Symbol.toStringTag, { value: "Module" }), n;
10
+ }, p = ".approval{flex-direction:column;gap:8px;margin:11px 0 2px;display:flex}.actions{flex-wrap:wrap;gap:8px;display:flex}.request{color:var(--w-text);margin:0;font-size:13px}.args{border:1px solid var(--w-border);background:var(--w-surface);border-radius:12px;flex-direction:column;gap:4px;margin:0;padding:8px 10px;font-size:12px;display:flex}.arg{gap:8px;display:flex}.arg dt{color:var(--w-muted);flex:none;font-weight:500}.arg dd{overflow-wrap:anywhere;min-width:0;color:var(--w-text);margin:0}.approval button{border:1px solid var(--w-border);background:var(--w-bg);height:32px;color:var(--w-text);cursor:pointer;border-radius:12px;flex:auto;padding:0 12px;font-size:13px;font-weight:500}.approval .yes:not(:disabled){background:var(--w-accent);color:var(--w-on-accent);border-color:#0000;font-weight:600}.approval button:hover:not(:disabled){border-color:var(--w-border-strong);background:var(--w-surface)}.approval .yes:hover:not(:disabled){background:var(--w-accent-hover);border-color:#0000}.approval button:disabled{cursor:default}.approval button:disabled[aria-pressed=false]{opacity:.45}.approval button[aria-pressed=true]{border-color:var(--w-border-strong);background:var(--w-selected);color:var(--w-text);font-weight:600}";
11
+ //#endregion
12
+ //#region src/widgets/approval/SqcApproval.tsx
13
+ function m(e, t) {
14
+ let { confirm: n } = r(t);
15
+ return e === !0 ? n.yes : e === !1 ? n.no : typeof e == "string" ? e : JSON.stringify(e) ?? String(e);
16
+ }
17
+ function h({ call: t, locked: o, language: s }) {
18
+ let { approval: c } = r(s), [l, u] = e(null), d = n(!1), f = !o && l === null, p = t ? Object.entries(t.arguments) : [], h = (e, t) => {
19
+ o || d.current || (d.current = !0, u(e), t.currentTarget?.dispatchEvent(new CustomEvent("sqc-decision", {
20
+ detail: { approved: e },
21
+ bubbles: !0,
22
+ composed: !0
23
+ })));
24
+ };
25
+ return /* @__PURE__ */ i("div", {
26
+ class: "approval",
27
+ role: "group",
28
+ "aria-label": c.group,
29
+ children: [
30
+ t && /* @__PURE__ */ i("p", {
31
+ class: "request",
32
+ children: c.request.replace("{tool}", a(t.tool))
33
+ }),
34
+ p.length > 0 && /* @__PURE__ */ i("dl", {
35
+ class: "args",
36
+ children: p.map(([e, t]) => /* @__PURE__ */ i("div", {
37
+ class: "arg",
38
+ children: [/* @__PURE__ */ i("dt", { children: a(e) }), /* @__PURE__ */ i("dd", {
39
+ class: "value",
40
+ children: m(t, s)
41
+ })]
42
+ }, e))
43
+ }),
44
+ /* @__PURE__ */ i("div", {
45
+ class: "actions",
46
+ children: [/* @__PURE__ */ i("button", {
47
+ type: "button",
48
+ class: "yes",
49
+ "aria-pressed": l === !0,
50
+ disabled: !f,
51
+ onClick: (e) => h(!0, e),
52
+ children: c.approve
53
+ }), /* @__PURE__ */ i("button", {
54
+ type: "button",
55
+ class: "no",
56
+ "aria-pressed": l === !1,
57
+ disabled: !f,
58
+ onClick: (e) => h(!1, e),
59
+ children: c.reject
60
+ })]
61
+ })
62
+ ]
63
+ });
64
+ }
65
+ //#endregion
66
+ //#region src/widgets/chart/chart.css?inline
67
+ var g = ".name{color:var(--w-muted);font-size:12px}.chart{color:var(--w-text);background:var(--w-surface);border:1px solid var(--w-border);border-radius:12px;flex-direction:column;gap:8px;margin:0;padding:12px;font-size:13px;display:flex}.head{justify-content:space-between;align-items:flex-start;gap:8px;display:flex}figcaption{overflow-wrap:anywhere;font-weight:600}.download,.toggle{background:var(--w-bg);border:1px solid var(--w-border-strong);cursor:pointer;border-radius:8px;flex-shrink:0;padding:2px 8px;font-size:12px}.toggle{color:var(--w-muted);align-self:flex-start}.legend{color:var(--w-muted);flex-wrap:wrap;gap:4px 12px;margin:0;padding:0;font-size:12px;list-style:none;display:flex}.legend li{align-items:center;gap:4px;display:flex}.legend i{border-radius:2px;width:10px;height:10px}.plot{position:relative}svg{width:100%;height:auto;display:block}.tip{white-space:nowrap;pointer-events:none;color:var(--w-bg);background:var(--w-text);border-radius:6px;flex-direction:column;padding:4px 8px;font-size:12px;display:flex;position:absolute;transform:translate(-50%,calc(-100% - 8px))}.data{border:1px solid var(--w-border);border-radius:8px;max-height:192px;overflow:auto}table{border-collapse:collapse;width:100%;font-size:12px}th,td{text-align:left;font-variant-numeric:tabular-nums;padding:4px 8px}th{color:var(--w-muted);background:var(--w-bg);font-weight:500}tbody tr{border-top:1px solid var(--w-border)}", _ = [
68
+ "#2448cc",
69
+ "#0d7f78",
70
+ "#b86e00",
71
+ "#a92f73",
72
+ "#557c00",
73
+ "#5a6a80"
74
+ ];
75
+ function v(e) {
76
+ let t = Math.min(e, _.length - 1);
77
+ return `var(--sqc-series-${t + 1}, ${_[t]})`;
78
+ }
79
+ function y(e, t, n, r) {
80
+ let i = t === e ? 0 : (r - n) / (t - e);
81
+ return (t) => n + (t - e) * i;
82
+ }
83
+ function b(e, t) {
84
+ e === t && (--e, t += 1);
85
+ let n = (t - e) / 5, r = 10 ** Math.floor(Math.log10(n)), i = [
86
+ 1,
87
+ 2,
88
+ 5,
89
+ 10
90
+ ].map((e) => e * r).find((e) => e >= n) ?? n, a = [];
91
+ for (let n = Math.floor(e / i) * i; n <= t + i / 2 && (a.push(Number(n.toPrecision(12))), !(n >= t)); n += i);
92
+ return a;
93
+ }
94
+ var x = (e) => e.length > 14 ? `${e.slice(0, 13)}…` : e, S = "fill:var(--w-muted);font-size:11px", C = "stroke:var(--w-border)";
95
+ function w(e) {
96
+ let { values: t, scale: n, axis: r, from: a, to: o, format: s } = e;
97
+ return /* @__PURE__ */ i("g", { children: t.map((e) => {
98
+ let t = n(e);
99
+ return r === "y" ? /* @__PURE__ */ i("g", { children: [/* @__PURE__ */ i("line", {
100
+ x1: a,
101
+ x2: o,
102
+ y1: t,
103
+ y2: t,
104
+ style: C
105
+ }), /* @__PURE__ */ i("text", {
106
+ x: a - 6,
107
+ y: t + 4,
108
+ "text-anchor": "end",
109
+ style: S,
110
+ children: s(e)
111
+ })] }, e) : /* @__PURE__ */ i("g", { children: [/* @__PURE__ */ i("line", {
112
+ y1: a,
113
+ y2: o,
114
+ x1: t,
115
+ x2: t,
116
+ style: C
117
+ }), /* @__PURE__ */ i("text", {
118
+ y: o + 16,
119
+ x: t,
120
+ "text-anchor": "middle",
121
+ style: S,
122
+ children: s(e)
123
+ })] }, e);
124
+ }) });
125
+ }
126
+ function T({ bottom: e, left: t }) {
127
+ return /* @__PURE__ */ i("g", {
128
+ style: S,
129
+ children: [e && /* @__PURE__ */ i("text", {
130
+ x: 280,
131
+ y: 276,
132
+ "text-anchor": "middle",
133
+ children: e
134
+ }), t && /* @__PURE__ */ i("text", {
135
+ transform: "translate(12 140) rotate(-90)",
136
+ "text-anchor": "middle",
137
+ children: t
138
+ })]
139
+ });
140
+ }
141
+ function E(e, t, n, r, i, a) {
142
+ let o = Math.min(a - i, Math.PI * 2 - 1e-4), s = i + o, c = +(o > Math.PI), l = (n, r) => `${(e + n * Math.cos(r)).toFixed(2)} ${(t + n * Math.sin(r)).toFixed(2)}`, u = `M${l(n, i)}A${n} ${n} 0 ${c} 1 ${l(n, s)}`;
143
+ return r > 0 ? `${u}L${l(r, s)}A${r} ${r} 0 ${c} 0 ${l(r, i)}Z` : `${u}L${e} ${t}Z`;
144
+ }
145
+ function D({ chart: e, format: n, onTip: r }) {
146
+ let a = 280 - (e.xLabel ? 44 : 28), o = (e, t) => (e ? `${e}: ` : "") + n(t), s;
147
+ if (e.type === "pie") {
148
+ let t = e.series[0].values, n = t.reduce((e, t) => e + Math.max(t, 0), 0) || 1, a = -Math.PI / 2;
149
+ s = /* @__PURE__ */ i("g", {
150
+ class: "series",
151
+ style: "stroke:var(--w-bg);stroke-width:2",
152
+ children: e.categories.map((s, c) => {
153
+ let l = a;
154
+ a += Math.max(t[c], 0) / n * Math.PI * 2;
155
+ let u = (l + a) / 2;
156
+ return /* @__PURE__ */ i("path", {
157
+ d: E(280, 140, 130, e.donut ? 71.5 : 0, l, a),
158
+ style: `fill:${v(c)}`,
159
+ onMouseEnter: () => r({
160
+ x: 280 + 65 * Math.cos(u),
161
+ y: 140 + 65 * Math.sin(u),
162
+ title: s,
163
+ line: o(e.series[0].name, t[c])
164
+ })
165
+ }, c);
166
+ })
167
+ });
168
+ } else if (e.type === "scatter") {
169
+ let o = e.series.flatMap((e) => e.points), c = b(Math.min(...o.map((e) => e.x)), Math.max(...o.map((e) => e.x))), l = b(Math.min(...o.map((e) => e.y)), Math.max(...o.map((e) => e.y))), u = e.yLabel ? 60 : 44, d = y(c[0], c[c.length - 1], u, 548), f = y(l[0], l[l.length - 1], a, 10);
170
+ s = /* @__PURE__ */ i(t, { children: [
171
+ /* @__PURE__ */ i(w, {
172
+ values: l,
173
+ scale: f,
174
+ axis: "y",
175
+ from: u,
176
+ to: 548,
177
+ format: n
178
+ }),
179
+ /* @__PURE__ */ i(w, {
180
+ values: c,
181
+ scale: d,
182
+ axis: "x",
183
+ from: 10,
184
+ to: a,
185
+ format: n
186
+ }),
187
+ e.series.map((t, a) => /* @__PURE__ */ i("g", {
188
+ class: "series",
189
+ style: `fill:${v(a)}`,
190
+ children: t.points.map((a, o) => /* @__PURE__ */ i("circle", {
191
+ cx: d(a.x),
192
+ cy: f(a.y),
193
+ r: 4,
194
+ onMouseEnter: () => r({
195
+ x: d(a.x),
196
+ y: f(a.y),
197
+ title: t.name,
198
+ line: `${e.xLabel || "x"}: ${n(a.x)}, ${e.yLabel || "y"}: ${n(a.y)}`
199
+ })
200
+ }, o))
201
+ }, a)),
202
+ /* @__PURE__ */ i(T, {
203
+ bottom: e.xLabel,
204
+ left: e.yLabel
205
+ })
206
+ ] });
207
+ } else {
208
+ let { categories: c, series: l } = e, u = e.stacked && e.type !== "line", d = e.type === "bar" && e.horizontal, f = c.map(() => 0), p = c.map(() => 0), m = l.map((e) => e.values.map((e, t) => {
209
+ if (!u) return [0, e];
210
+ let n = e >= 0 ? f : p, r = n[t];
211
+ return n[t] += e, [r, n[t]];
212
+ })), h = m.flat().map(([, e]) => e);
213
+ e.type !== "line" && h.push(0);
214
+ let g = b(Math.min(...h), Math.max(...h)), _ = g[0], C = g[g.length - 1], E = d ? e.xLabel ? 112 : 96 : e.yLabel ? 60 : 44, D = d ? [10, a] : [E, 548], O = (D[1] - D[0]) / c.length, k = (e) => D[0] + O * (e + .5), A = d ? y(_, C, E, 548) : y(_, C, a, 10), j = Math.ceil(c.length / 12), M = (e, t, n, i) => () => r({
215
+ x: n,
216
+ y: i,
217
+ title: c[t],
218
+ line: o(l[e].name, l[e].values[t])
219
+ }), N;
220
+ if (e.type === "bar") {
221
+ let e = O * .8, t = u ? e : e / l.length;
222
+ N = l.map((e, n) => /* @__PURE__ */ i("g", {
223
+ class: "series",
224
+ style: `fill:${v(n)}`,
225
+ children: m[n].map(([e, r], a) => {
226
+ let o = D[0] + O * a + O * .1 + (u ? 0 : t * n), s = A(Math.min(e, r)), c = A(Math.max(e, r)), l = d ? {
227
+ x: s,
228
+ y: o,
229
+ width: c - s,
230
+ height: t
231
+ } : {
232
+ x: o,
233
+ y: c,
234
+ width: t,
235
+ height: s - c
236
+ };
237
+ return /* @__PURE__ */ i("rect", {
238
+ ...l,
239
+ onMouseEnter: M(n, a, l.x + l.width / 2, l.y)
240
+ }, a);
241
+ })
242
+ }, n));
243
+ } else N = l.map((t, n) => {
244
+ let r = v(n), a = m[n].map(([, e], t) => [k(t), A(e)]), o = a.map(([e, t], n) => `${n ? "L" : "M"}${e} ${t}`).join(""), s = a.map(([e], t) => `L${e} ${A(m[n][t][0])}`).reverse().join("");
245
+ return /* @__PURE__ */ i("g", {
246
+ class: "series",
247
+ style: `stroke:${r};fill:${r}`,
248
+ children: [
249
+ e.type === "area" && /* @__PURE__ */ i("path", {
250
+ d: `${o}${s}Z`,
251
+ style: `stroke:none;fill-opacity:${u ? .7 : .2}`
252
+ }),
253
+ /* @__PURE__ */ i("path", {
254
+ d: o,
255
+ style: "fill:none;stroke-width:2"
256
+ }),
257
+ a.map(([e, t], r) => /* @__PURE__ */ i("circle", {
258
+ cx: e,
259
+ cy: t,
260
+ r: 3,
261
+ onMouseEnter: M(n, r, e, t)
262
+ }, r))
263
+ ]
264
+ }, n);
265
+ });
266
+ s = /* @__PURE__ */ i(t, { children: [
267
+ /* @__PURE__ */ i(w, {
268
+ values: g,
269
+ scale: A,
270
+ axis: d ? "x" : "y",
271
+ from: d ? 10 : E,
272
+ to: d ? a : 548,
273
+ format: n
274
+ }),
275
+ /* @__PURE__ */ i("g", {
276
+ style: S,
277
+ children: c.map((e, t) => t % j ? null : d ? /* @__PURE__ */ i("text", {
278
+ x: E - 6,
279
+ y: k(t) + 4,
280
+ "text-anchor": "end",
281
+ children: x(e)
282
+ }, t) : /* @__PURE__ */ i("text", {
283
+ x: k(t),
284
+ y: a + 16,
285
+ "text-anchor": "middle",
286
+ children: x(e)
287
+ }, t))
288
+ }),
289
+ N,
290
+ /* @__PURE__ */ i(T, {
291
+ bottom: d ? e.yLabel : e.xLabel,
292
+ left: d ? e.xLabel : e.yLabel
293
+ })
294
+ ] });
295
+ }
296
+ return /* @__PURE__ */ i("svg", {
297
+ viewBox: "0 0 560 280",
298
+ role: "img",
299
+ "aria-label": e.title,
300
+ style: "font-family:var(--w-font)",
301
+ onMouseLeave: () => r(null),
302
+ children: s
303
+ });
304
+ }
305
+ //#endregion
306
+ //#region src/widgets/chart/png.ts
307
+ var O = 2;
308
+ function k(e, t, n) {
309
+ let r = getComputedStyle(t), i = e.cloneNode(!0);
310
+ i.setAttribute("xmlns", "http://www.w3.org/2000/svg"), i.setAttribute("width", "560"), i.setAttribute("height", "280");
311
+ let a = new XMLSerializer().serializeToString(i).replace(/var\((--[\w-]+)(?:,\s*([^()]*))?\)/g, (e, t, n) => r.getPropertyValue(t).trim() || n?.trim() || e), o = new Image();
312
+ o.onload = () => {
313
+ let e = document.createElement("canvas");
314
+ e.width = 560 * O, e.height = 280 * O;
315
+ let t = e.getContext("2d");
316
+ t && (t.scale(O, O), t.fillStyle = r.getPropertyValue("--w-bg").trim() || "#fff", t.fillRect(0, 0, 560, 280), t.drawImage(o, 0, 0, 560, 280), e.toBlob((e) => {
317
+ if (!e) return;
318
+ let t = URL.createObjectURL(e), r = document.createElement("a");
319
+ r.href = t, r.download = n, r.click(), URL.revokeObjectURL(t);
320
+ }, "image/png"));
321
+ }, o.src = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(a)}`;
322
+ }
323
+ //#endregion
324
+ //#region src/widgets/types.ts
325
+ var A = [
326
+ "bar",
327
+ "line",
328
+ "area",
329
+ "pie",
330
+ "scatter"
331
+ ], j = (e) => typeof e == "number" && Number.isFinite(e), M = (e) => typeof e == "string" ? e : "", N = (e, t) => typeof e == "object" && e ? e[t] : void 0;
332
+ function P(e, t) {
333
+ let n = [];
334
+ for (let r of e) {
335
+ let e = N(r, "values");
336
+ if (!Array.isArray(e) || e.length !== t || !e.every(j)) return null;
337
+ n.push({
338
+ name: M(N(r, "name")),
339
+ values: e
340
+ });
341
+ }
342
+ return n;
343
+ }
344
+ function F(e) {
345
+ let t = [];
346
+ for (let n of e) {
347
+ let e = N(n, "points");
348
+ if (!Array.isArray(e) || !e.every((e) => j(N(e, "x")) && j(N(e, "y")))) return null;
349
+ t.push({
350
+ name: M(N(n, "name")),
351
+ points: e
352
+ });
353
+ }
354
+ return t;
355
+ }
356
+ function I(e) {
357
+ let t;
358
+ try {
359
+ t = JSON.parse(e);
360
+ } catch {
361
+ return null;
362
+ }
363
+ let n = N(t, "type"), r = N(t, "series");
364
+ if (!A.includes(n) || !Array.isArray(r) || !r.length) return null;
365
+ let i = {
366
+ title: M(N(t, "title")),
367
+ xLabel: M(N(t, "x_label")),
368
+ yLabel: M(N(t, "y_label")),
369
+ stacked: N(t, "stacked") === !0,
370
+ horizontal: N(t, "horizontal") === !0,
371
+ donut: N(t, "donut") === !0
372
+ };
373
+ if (n === "scatter") {
374
+ let e = F(r);
375
+ return e && {
376
+ ...i,
377
+ type: n,
378
+ series: e
379
+ };
380
+ }
381
+ let a = N(t, "categories");
382
+ if (!Array.isArray(a)) return null;
383
+ let o = a.map(String), s = P(r, o.length);
384
+ return s && {
385
+ ...i,
386
+ type: n,
387
+ categories: o,
388
+ series: s
389
+ };
390
+ }
391
+ //#endregion
392
+ //#region src/widgets/chart/strings.ts
393
+ var L = {
394
+ en: {
395
+ download: "Download PNG",
396
+ show: "Show data",
397
+ hide: "Hide data",
398
+ category: "Category",
399
+ series: "Series"
400
+ },
401
+ fr: {
402
+ download: "Télécharger en PNG",
403
+ show: "Afficher les données",
404
+ hide: "Masquer les données",
405
+ category: "Catégorie",
406
+ series: "Série"
407
+ },
408
+ es: {
409
+ download: "Descargar PNG",
410
+ show: "Mostrar datos",
411
+ hide: "Ocultar datos",
412
+ category: "Categoría",
413
+ series: "Serie"
414
+ }
415
+ };
416
+ function R(e) {
417
+ return L[e] ?? L.en;
418
+ }
419
+ //#endregion
420
+ //#region src/widgets/chart/SqcChart.tsx
421
+ function z(e) {
422
+ let { chart: t, t: n, format: r } = e;
423
+ return /* @__PURE__ */ i("div", {
424
+ class: "data",
425
+ children: /* @__PURE__ */ i("table", { children: [/* @__PURE__ */ i("thead", { children: t.type === "scatter" ? /* @__PURE__ */ i("tr", { children: [
426
+ /* @__PURE__ */ i("th", { children: n.series }),
427
+ /* @__PURE__ */ i("th", { children: t.xLabel || "x" }),
428
+ /* @__PURE__ */ i("th", { children: t.yLabel || "y" })
429
+ ] }) : /* @__PURE__ */ i("tr", { children: [/* @__PURE__ */ i("th", { children: t.xLabel || n.category }), t.series.map((e, t) => /* @__PURE__ */ i("th", { children: e.name }, t))] }) }), /* @__PURE__ */ i("tbody", { children: t.type === "scatter" ? t.series.flatMap((e, t) => e.points.map((n, a) => /* @__PURE__ */ i("tr", { children: [
430
+ /* @__PURE__ */ i("td", { children: e.name }),
431
+ /* @__PURE__ */ i("td", { children: r(n.x) }),
432
+ /* @__PURE__ */ i("td", { children: r(n.y) })
433
+ ] }, `${t}-${a}`))) : t.categories.map((e, n) => /* @__PURE__ */ i("tr", { children: [/* @__PURE__ */ i("td", { children: e }), t.series.map((e, t) => /* @__PURE__ */ i("td", { children: r(e.values[n]) }, t))] }, n)) })] })
434
+ });
435
+ }
436
+ function B(t) {
437
+ let { chart: r, body: a, filename: o = "", language: s } = t, c = R(s), [d, f] = e(null), [p, m] = e(null), [h, g] = e(!1), _ = n(null), y = u(() => new Intl.NumberFormat(s), [s]), b = (e) => y.format(e);
438
+ l(() => {
439
+ if (r || !a) return;
440
+ let e = !0;
441
+ return Promise.resolve(a).then((t) => e && f(I(t)), () => e && f(null)), () => {
442
+ e = !1;
443
+ };
444
+ }, [r, a]);
445
+ let x = r ?? d;
446
+ if (!x) return /* @__PURE__ */ i("span", {
447
+ class: "name",
448
+ children: o
449
+ });
450
+ let S = x.title || o, C = x.type === "pie" ? x.categories : x.series.length > 1 ? x.series.map((e) => e.name) : [];
451
+ return /* @__PURE__ */ i("figure", {
452
+ class: "chart",
453
+ children: [
454
+ /* @__PURE__ */ i("div", {
455
+ class: "head",
456
+ children: [/* @__PURE__ */ i("figcaption", { children: S }), /* @__PURE__ */ i("button", {
457
+ type: "button",
458
+ class: "download",
459
+ onClick: () => {
460
+ let e = _.current?.querySelector("svg"), t = _.current?.getRootNode()?.host;
461
+ e && t && k(e, t, `${S}.png`);
462
+ },
463
+ children: c.download
464
+ })]
465
+ }),
466
+ C.length > 0 && /* @__PURE__ */ i("ul", {
467
+ class: "legend",
468
+ children: C.map((e, t) => /* @__PURE__ */ i("li", { children: [/* @__PURE__ */ i("i", { style: `background:${v(t)}` }), e] }, t))
469
+ }),
470
+ /* @__PURE__ */ i("div", {
471
+ class: "plot",
472
+ ref: _,
473
+ children: [/* @__PURE__ */ i(D, {
474
+ chart: x,
475
+ format: b,
476
+ onTip: m
477
+ }), p && /* @__PURE__ */ i("div", {
478
+ class: "tip",
479
+ role: "tooltip",
480
+ style: `left:${p.x / 560 * 100}%;top:${p.y / 280 * 100}%`,
481
+ children: [/* @__PURE__ */ i("strong", { children: p.title }), /* @__PURE__ */ i("span", { children: p.line })]
482
+ })]
483
+ }),
484
+ /* @__PURE__ */ i("button", {
485
+ type: "button",
486
+ class: "toggle",
487
+ "aria-expanded": h,
488
+ onClick: () => g(!h),
489
+ children: h ? c.hide : c.show
490
+ }),
491
+ h && /* @__PURE__ */ i(z, {
492
+ chart: x,
493
+ t: c,
494
+ format: b
495
+ })
496
+ ]
497
+ });
498
+ }
499
+ //#endregion
500
+ //#region src/widgets/form/reply.ts
501
+ function V(e, t) {
502
+ return e.fields.map((e) => [e.label, (t[e.name] ?? "").trim()]).filter(([, e]) => e).map(([e, t]) => `${e} : ${t}`).join("\n");
503
+ }
504
+ //#endregion
505
+ //#region src/widgets/form/SqcForm.tsx
506
+ var H = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
507
+ function U(e, t, n) {
508
+ let r = t.trim();
509
+ return r ? e.type === "email" && !H.test(r) ? n.email : e.type === "number" && !Number.isFinite(Number(r)) ? n.number : null : e.required ? n.required : null;
510
+ }
511
+ function W({ form: t, locked: n, language: a, reply: o }) {
512
+ let s = r(a).form, [c, l] = e({}), u = t?.fields ?? [], d = (e) => {
513
+ l((t) => {
514
+ if (!(e in t)) return t;
515
+ let n = { ...t };
516
+ return delete n[e], n;
517
+ });
518
+ };
519
+ return /* @__PURE__ */ i("form", {
520
+ class: "form",
521
+ noValidate: !0,
522
+ onSubmit: (e) => {
523
+ if (e.preventDefault(), n || !t) return;
524
+ let r = new FormData(e.currentTarget), i = {}, a = {};
525
+ for (let e of u) {
526
+ let t = r.get(e.name);
527
+ i[e.name] = typeof t == "string" ? t : "";
528
+ let n = U(e, i[e.name], s);
529
+ n && (a[e.name] = n);
530
+ }
531
+ l(a), Object.keys(a).length === 0 && o(V(t, i));
532
+ },
533
+ children: [
534
+ t?.title && /* @__PURE__ */ i("p", {
535
+ class: "title",
536
+ children: t.title
537
+ }),
538
+ u.map((e) => {
539
+ let t = `f-${e.name}`, r = c[e.name], a = {
540
+ id: t,
541
+ name: e.name,
542
+ disabled: n,
543
+ required: e.required,
544
+ "aria-invalid": r ? !0 : void 0,
545
+ "aria-describedby": r ? `${t}-error` : void 0
546
+ };
547
+ return /* @__PURE__ */ i("div", {
548
+ class: "field",
549
+ children: [
550
+ /* @__PURE__ */ i("label", {
551
+ for: t,
552
+ children: [e.label, e.required && /* @__PURE__ */ i("span", {
553
+ "aria-hidden": "true",
554
+ children: " *"
555
+ })]
556
+ }),
557
+ e.type === "select" ? /* @__PURE__ */ i("select", {
558
+ ...a,
559
+ onChange: () => d(e.name),
560
+ children: [/* @__PURE__ */ i("option", { value: "" }), (e.options ?? []).map((e) => /* @__PURE__ */ i("option", {
561
+ value: e,
562
+ children: e
563
+ }, e))]
564
+ }) : /* @__PURE__ */ i("input", {
565
+ ...a,
566
+ type: e.type,
567
+ onInput: () => d(e.name)
568
+ }),
569
+ r && /* @__PURE__ */ i("span", {
570
+ class: "error",
571
+ id: `${t}-error`,
572
+ children: r
573
+ })
574
+ ]
575
+ }, e.name);
576
+ }),
577
+ /* @__PURE__ */ i("button", {
578
+ type: "submit",
579
+ class: "submit",
580
+ disabled: n,
581
+ children: t?.submit || s.submit
582
+ })
583
+ ]
584
+ });
585
+ }
586
+ //#endregion
587
+ //#region src/widgets/form/form.css?inline
588
+ var G = ".form{color:var(--w-text);background:var(--w-surface);border:1px solid var(--w-border);border-radius:12px;flex-direction:column;gap:10px;margin:10px 0 2px;padding:12px;font-size:13px;display:flex}.title{margin:0;font-weight:600}.field{flex-direction:column;gap:4px;display:flex}label{color:var(--w-muted);overflow-wrap:anywhere;font-size:12px}input,select{height:32px;font:inherit;color:var(--w-text);background:var(--w-bg);border:1px solid var(--w-border-strong);border-radius:8px;padding:0 9px}input:focus-visible{box-shadow:var(--w-focus);outline:none}select:focus-visible{box-shadow:var(--w-focus);outline:none}[aria-invalid=true]{border-color:#b42318}.error{color:#b42318;font-size:11.5px}input:disabled,select:disabled{opacity:.7}.submit{background:var(--w-accent);height:32px;color:var(--w-on-accent);cursor:pointer;border:0;border-radius:12px;align-self:flex-end;padding:0 14px;font-size:13px;font-weight:600}.submit:hover:not(:disabled){background:var(--w-accent-hover)}.submit:disabled{opacity:.4;cursor:default}", K = /* @__PURE__ */ f({ defineWidgetExtras: () => J }), q = [
589
+ s,
590
+ G,
591
+ g,
592
+ p
593
+ ].join("\n");
594
+ function J() {
595
+ typeof customElements > "u" || (customElements.get(o.form) || customElements.define(o.form, c(W, ["form"], q)), customElements.get(o.chart) || customElements.define(o.chart, c(B, [
596
+ "chart",
597
+ "body",
598
+ "filename"
599
+ ], q)), customElements.get(o.approval) || customElements.define(o.approval, c(h, ["call"], q)));
600
+ }
601
+ //#endregion
602
+ export { K as n, I as r, J as t };
603
+
604
+ //# sourceMappingURL=extras-ClIRRLqo.js.map