@syntrologie/runtime-sdk 2.14.0 → 2.15.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 (57) hide show
  1. package/README.md +1 -0
  2. package/dist/SmartCanvasElementLit.d.ts +166 -0
  3. package/dist/actions/schema.js +4 -3
  4. package/dist/actions/types.d.ts +8 -2
  5. package/dist/anchor/AnchorResolver.d.ts +1 -0
  6. package/dist/api-lit.d.ts +84 -0
  7. package/dist/apps/builtinRuntimeModules-lit.d.ts +20 -0
  8. package/dist/bootstrap-types.d.ts +10 -0
  9. package/dist/chunk-2IQ2PTLJ.js +871 -0
  10. package/dist/chunk-2IQ2PTLJ.js.map +7 -0
  11. package/dist/{chunk-YLLWLUQX.js → chunk-4HXPGXUC.js} +1 -16
  12. package/dist/{chunk-YLLWLUQX.js.map → chunk-4HXPGXUC.js.map} +1 -1
  13. package/dist/{chunk-JCDCANR7.js → chunk-CVMZW3II.js} +951 -1040
  14. package/dist/chunk-CVMZW3II.js.map +7 -0
  15. package/dist/{chunk-IR6UOR63.js → chunk-GX7BBYX6.js} +2 -2
  16. package/dist/chunk-JMHRHAEL.js +18 -0
  17. package/dist/chunk-JMHRHAEL.js.map +7 -0
  18. package/dist/{chunk-77TNZ66J.js → chunk-XVRDKBYF.js} +3 -3
  19. package/dist/components/SyntroCanvasOverlay.d.ts +100 -0
  20. package/dist/components/SyntroDrawer.d.ts +110 -0
  21. package/dist/components/SyntroLauncher.d.ts +105 -0
  22. package/dist/components/SyntroTileCard.d.ts +74 -0
  23. package/dist/components/SyntroTileWheel.d.ts +51 -0
  24. package/dist/config/schema.js +3 -2
  25. package/dist/controllers/DecisionController.d.ts +48 -0
  26. package/dist/controllers/NotificationsController.d.ts +59 -0
  27. package/dist/controllers/RuntimeController.d.ts +52 -0
  28. package/dist/controllers/RuntimeEventsController.d.ts +42 -0
  29. package/dist/controllers/ThemeController.d.ts +110 -0
  30. package/dist/controllers/index.d.ts +13 -0
  31. package/dist/decisions/schema.js +2 -1
  32. package/dist/decisions/types.d.ts +4 -0
  33. package/dist/editorLoader.d.ts +5 -0
  34. package/dist/index-lit.d.ts +40 -0
  35. package/dist/index.js +1264 -19
  36. package/dist/index.js.map +4 -4
  37. package/dist/interop/LitInReact.d.ts +27 -0
  38. package/dist/interop/ReactInLit.d.ts +42 -0
  39. package/dist/interop/index.d.ts +7 -0
  40. package/dist/metrics/sessionMetrics.d.ts +4 -0
  41. package/dist/notifications/SyntroToastStack.d.ts +43 -0
  42. package/dist/react-compat.d.ts +114 -0
  43. package/dist/react.js +6 -4
  44. package/dist/react.js.map +1 -1
  45. package/dist/smart-canvas.esm.js +856 -240
  46. package/dist/smart-canvas.esm.js.map +4 -4
  47. package/dist/smart-canvas.js +31411 -40000
  48. package/dist/smart-canvas.js.map +4 -4
  49. package/dist/smart-canvas.min.js +855 -240
  50. package/dist/smart-canvas.min.js.map +4 -4
  51. package/dist/theme/index.js +30 -0
  52. package/dist/theme/index.js.map +7 -0
  53. package/dist/version.d.ts +1 -1
  54. package/package.json +10 -1
  55. package/dist/chunk-JCDCANR7.js.map +0 -7
  56. /package/dist/{chunk-IR6UOR63.js.map → chunk-GX7BBYX6.js.map} +0 -0
  57. /package/dist/{chunk-77TNZ66J.js.map → chunk-XVRDKBYF.js.map} +0 -0
package/dist/index.js CHANGED
@@ -31,7 +31,6 @@ import {
31
31
  WidgetRegistry,
32
32
  appRegistry,
33
33
  applyStaticSlotStyles,
34
- base,
35
34
  cleanupAppContext,
36
35
  createActionEngine,
37
36
  createAnchorResolver,
@@ -76,8 +75,6 @@ import {
76
75
  normalizePostHogEvent,
77
76
  playEnterAnimation,
78
77
  playExitAnimation,
79
- purple,
80
- red,
81
78
  registerConfigPredicates,
82
79
  registerSmartCanvasElement,
83
80
  resolveConfigUri,
@@ -86,7 +83,6 @@ import {
86
83
  setupAdjacentPositioning,
87
84
  setupInlinePositioning,
88
85
  shouldNormalizeEvent,
89
- slateGrey,
90
86
  useDecision,
91
87
  useNotifications,
92
88
  useNotifyWatcher,
@@ -104,7 +100,13 @@ import {
104
100
  validateEventName,
105
101
  validateProps,
106
102
  widgetRegistry
107
- } from "./chunk-JCDCANR7.js";
103
+ } from "./chunk-CVMZW3II.js";
104
+ import {
105
+ base,
106
+ purple,
107
+ red,
108
+ slateGrey
109
+ } from "./chunk-2IQ2PTLJ.js";
108
110
  import {
109
111
  AddClassZ,
110
112
  AnchorIdZ,
@@ -138,8 +140,8 @@ import {
138
140
  WaitZ,
139
141
  WidgetConfigZ,
140
142
  coreActionStepSchemas
141
- } from "./chunk-77TNZ66J.js";
142
- import "./chunk-IR6UOR63.js";
143
+ } from "./chunk-XVRDKBYF.js";
144
+ import "./chunk-GX7BBYX6.js";
143
145
  import {
144
146
  ActivationConfigZ,
145
147
  AnchorVisibleConditionZ,
@@ -164,12 +166,14 @@ import {
164
166
  StateEqualsConditionZ,
165
167
  TriggerWhenZ,
166
168
  ViewportConditionZ,
167
- __publicField,
168
169
  decisionSchemas,
169
170
  validateActivationConfig,
170
171
  validateCondition,
171
172
  validateStrategy
172
- } from "./chunk-YLLWLUQX.js";
173
+ } from "./chunk-4HXPGXUC.js";
174
+ import {
175
+ __publicField
176
+ } from "./chunk-JMHRHAEL.js";
173
177
 
174
178
  // src/index.ts
175
179
  import React4 from "react";
@@ -506,6 +510,342 @@ var ChatAssistantMountableWidget = {
506
510
  }
507
511
  };
508
512
 
513
+ // ../adaptives/adaptive-chatbot/dist/ChatAssistantLit.js
514
+ import { html, LitElement, nothing } from "lit";
515
+ import { styleMap } from "lit/directives/style-map.js";
516
+ var __classPrivateFieldGet = function(receiver, state, kind, f) {
517
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
518
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
519
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
520
+ };
521
+ var __classPrivateFieldSet = function(receiver, state, value, kind, f) {
522
+ if (kind === "m") throw new TypeError("Private method is not writable");
523
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
524
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
525
+ return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
526
+ };
527
+ var _ChatAssistantElement_instances;
528
+ var _ChatAssistantElement_batchHandle;
529
+ var _ChatAssistantElement_inputEl;
530
+ var _ChatAssistantElement_messageListEl;
531
+ var _ChatAssistantElement_renderBubble;
532
+ var _ChatAssistantElement_handleSubmit;
533
+ var _ChatAssistantElement_sendMessage;
534
+ var TOKEN_PURPLE_4 = "#6a59ce";
535
+ var TOKEN_WHITE = "#ffffff";
536
+ var TOKEN_SLATE_10 = "#cbd0d7";
537
+ var TOKEN_SLATE_12 = "#f6f7f9";
538
+ var TOKEN_SLATE_8 = "#87919f";
539
+ var TOKEN_RED_4 = "#ff2524";
540
+ var _nextId = 0;
541
+ function generateId2() {
542
+ return `msg-${Date.now()}-${++_nextId}`;
543
+ }
544
+ var containerStyle = {
545
+ display: "flex",
546
+ flexDirection: "column",
547
+ height: "100%",
548
+ fontFamily: "system-ui, -apple-system, sans-serif",
549
+ fontSize: "14px",
550
+ touchAction: "none"
551
+ };
552
+ var messageListStyle = {
553
+ flex: "1",
554
+ overflowY: "auto",
555
+ padding: "12px",
556
+ display: "flex",
557
+ flexDirection: "column",
558
+ gap: "8px"
559
+ };
560
+ var bubbleBaseStyle = {
561
+ maxWidth: "85%",
562
+ padding: "8px 12px",
563
+ borderRadius: "12px",
564
+ lineHeight: "1.5",
565
+ wordBreak: "break-word"
566
+ };
567
+ var userBubbleExtra = {
568
+ alignSelf: "flex-end",
569
+ backgroundColor: `var(--sc-color-primary, ${TOKEN_PURPLE_4})`,
570
+ color: `var(--sc-color-primary-text, ${TOKEN_WHITE})`,
571
+ borderBottomRightRadius: "4px"
572
+ };
573
+ var assistantBubbleExtra = {
574
+ alignSelf: "flex-start",
575
+ backgroundColor: "var(--sc-chat-assistant-bubble-bg, rgba(255, 255, 255, 0.08))",
576
+ color: `var(--sc-content-text-color, ${TOKEN_SLATE_10})`,
577
+ borderBottomLeftRadius: "4px"
578
+ };
579
+ var loadingDotsStyle = {
580
+ alignSelf: "flex-start",
581
+ padding: "8px 16px",
582
+ backgroundColor: "var(--sc-chat-loading-bg, rgba(255, 255, 255, 0.05))",
583
+ borderRadius: "12px",
584
+ color: `var(--sc-content-text-secondary-color, ${TOKEN_SLATE_8})`,
585
+ fontSize: "13px"
586
+ };
587
+ var errorBannerStyle = {
588
+ padding: "8px 12px",
589
+ backgroundColor: "var(--sc-color-error-bg, rgba(239, 68, 68, 0.1))",
590
+ color: `var(--sc-color-error, ${TOKEN_RED_4})`,
591
+ fontSize: "13px",
592
+ borderRadius: "8px",
593
+ margin: "0 12px"
594
+ };
595
+ var inputFormStyle = {
596
+ display: "flex",
597
+ gap: "8px",
598
+ padding: "12px",
599
+ borderTop: "1px solid var(--sc-content-border-color, rgba(255, 255, 255, 0.06))"
600
+ };
601
+ var inputStyle = {
602
+ flex: "1",
603
+ padding: "8px 12px",
604
+ borderRadius: "8px",
605
+ border: "1px solid var(--sc-content-border-color, rgba(255, 255, 255, 0.1))",
606
+ backgroundColor: "var(--sc-chat-input-bg, rgba(0, 0, 0, 0.2))",
607
+ color: `var(--sc-content-heading-color, ${TOKEN_SLATE_12})`,
608
+ fontSize: "14px",
609
+ outline: "none",
610
+ fontFamily: "inherit"
611
+ };
612
+ var sendButtonStyle = {
613
+ padding: "8px 16px",
614
+ borderRadius: "8px",
615
+ border: "none",
616
+ backgroundColor: `var(--sc-color-primary, ${TOKEN_PURPLE_4})`,
617
+ color: `var(--sc-color-primary-text, ${TOKEN_WHITE})`,
618
+ fontWeight: "600",
619
+ fontSize: "13px",
620
+ cursor: "pointer",
621
+ whiteSpace: "nowrap"
622
+ };
623
+ var sendButtonDisabledExtra = {
624
+ opacity: "0.5",
625
+ cursor: "not-allowed"
626
+ };
627
+ var ChatAssistantElement = class extends LitElement {
628
+ constructor() {
629
+ super(...arguments);
630
+ _ChatAssistantElement_instances.add(this);
631
+ this.config = void 0;
632
+ this.runtime = void 0;
633
+ this.tileId = "chatbot-widget";
634
+ this._messages = [];
635
+ this._isLoading = false;
636
+ this._error = null;
637
+ _ChatAssistantElement_batchHandle.set(this, null);
638
+ _ChatAssistantElement_inputEl.set(this, null);
639
+ _ChatAssistantElement_messageListEl.set(this, null);
640
+ _ChatAssistantElement_handleSubmit.set(this, (e) => {
641
+ var _a2;
642
+ e.preventDefault();
643
+ const input = (_a2 = __classPrivateFieldGet(this, _ChatAssistantElement_inputEl, "f")) != null ? _a2 : this.querySelector("[data-chat-input]");
644
+ if (!input || !input.value.trim() || this._isLoading)
645
+ return;
646
+ const text = input.value;
647
+ input.value = "";
648
+ __classPrivateFieldGet(this, _ChatAssistantElement_instances, "m", _ChatAssistantElement_sendMessage).call(this, text);
649
+ });
650
+ }
651
+ createRenderRoot() {
652
+ return this;
653
+ }
654
+ // ---------- Lifecycle: connectedCallback --------------------------------
655
+ connectedCallback() {
656
+ super.connectedCallback();
657
+ }
658
+ // ---------- Lifecycle: disconnectedCallback -----------------------------
659
+ disconnectedCallback() {
660
+ var _a2;
661
+ super.disconnectedCallback();
662
+ if ((_a2 = __classPrivateFieldGet(this, _ChatAssistantElement_batchHandle, "f")) == null ? void 0 : _a2.isApplied()) {
663
+ __classPrivateFieldGet(this, _ChatAssistantElement_batchHandle, "f").revertAll().catch((err) => {
664
+ console.error("[ChatAssistantElement] Failed to revert actions on disconnect:", err);
665
+ });
666
+ __classPrivateFieldSet(this, _ChatAssistantElement_batchHandle, null, "f");
667
+ }
668
+ }
669
+ // ---------- Lifecycle: firstUpdated -------------------------------------
670
+ firstUpdated() {
671
+ __classPrivateFieldSet(this, _ChatAssistantElement_inputEl, this.querySelector("[data-chat-input]"), "f");
672
+ __classPrivateFieldSet(this, _ChatAssistantElement_messageListEl, this.querySelector("[data-message-list]"), "f");
673
+ }
674
+ // ---------- Lifecycle: updated ------------------------------------------
675
+ updated(changed) {
676
+ var _a2;
677
+ if (changed.has("_messages") || changed.has("_isLoading")) {
678
+ if (__classPrivateFieldGet(this, _ChatAssistantElement_messageListEl, "f")) {
679
+ __classPrivateFieldGet(this, _ChatAssistantElement_messageListEl, "f").scrollTop = __classPrivateFieldGet(this, _ChatAssistantElement_messageListEl, "f").scrollHeight;
680
+ }
681
+ }
682
+ if (changed.has("config") && ((_a2 = this.config) == null ? void 0 : _a2.greeting) && this._messages.length === 0) {
683
+ this._messages = [
684
+ {
685
+ id: generateId2(),
686
+ role: "assistant",
687
+ text: this.config.greeting,
688
+ timestamp: Date.now()
689
+ }
690
+ ];
691
+ }
692
+ }
693
+ // ---------- Render -------------------------------------------------------
694
+ render() {
695
+ return html`
696
+ <div style=${styleMap(containerStyle)} data-testid="chat-assistant">
697
+ <!-- Message list -->
698
+ <div style=${styleMap(messageListStyle)} data-message-list>
699
+ ${this._messages.map((msg) => __classPrivateFieldGet(this, _ChatAssistantElement_instances, "m", _ChatAssistantElement_renderBubble).call(this, msg))}
700
+ ${this._isLoading ? html`<div style=${styleMap(loadingDotsStyle)}>Thinking...</div>` : nothing}
701
+ </div>
702
+
703
+ <!-- Error banner -->
704
+ ${this._error ? html`<div style=${styleMap(errorBannerStyle)}>${this._error}</div>` : nothing}
705
+
706
+ <!-- Composer -->
707
+ <form
708
+ style=${styleMap(inputFormStyle)}
709
+ @submit=${__classPrivateFieldGet(this, _ChatAssistantElement_handleSubmit, "f")}
710
+ >
711
+ <input
712
+ data-chat-input
713
+ style=${styleMap(inputStyle)}
714
+ placeholder="Ask anything..."
715
+ ?disabled=${this._isLoading}
716
+ data-testid="chat-input"
717
+ />
718
+ <button
719
+ type="submit"
720
+ ?disabled=${this._isLoading}
721
+ style=${styleMap(this._isLoading ? { ...sendButtonStyle, ...sendButtonDisabledExtra } : sendButtonStyle)}
722
+ data-testid="chat-send"
723
+ >
724
+ Send
725
+ </button>
726
+ </form>
727
+ </div>
728
+ `;
729
+ }
730
+ // ---------- Public API --------------------------------------------------
731
+ /** Programmatically clear the conversation (mirrors useChat.clearMessages) */
732
+ clearMessages() {
733
+ var _a2;
734
+ this._messages = [];
735
+ this._error = null;
736
+ if ((_a2 = __classPrivateFieldGet(this, _ChatAssistantElement_batchHandle, "f")) == null ? void 0 : _a2.isApplied()) {
737
+ __classPrivateFieldGet(this, _ChatAssistantElement_batchHandle, "f").revertAll().catch((err) => {
738
+ console.error("[ChatAssistantElement] Failed to revert actions on clear:", err);
739
+ });
740
+ __classPrivateFieldSet(this, _ChatAssistantElement_batchHandle, null, "f");
741
+ }
742
+ sessionStorage.removeItem(`syntro:chatbot:history:${this.tileId}`);
743
+ }
744
+ };
745
+ _ChatAssistantElement_batchHandle = /* @__PURE__ */ new WeakMap(), _ChatAssistantElement_inputEl = /* @__PURE__ */ new WeakMap(), _ChatAssistantElement_messageListEl = /* @__PURE__ */ new WeakMap(), _ChatAssistantElement_handleSubmit = /* @__PURE__ */ new WeakMap(), _ChatAssistantElement_instances = /* @__PURE__ */ new WeakSet(), _ChatAssistantElement_renderBubble = function _ChatAssistantElement_renderBubble2(msg) {
746
+ const isUser = msg.role === "user";
747
+ const bubbleStyle = isUser ? { ...bubbleBaseStyle, ...userBubbleExtra } : { ...bubbleBaseStyle, ...assistantBubbleExtra };
748
+ return html`<div style=${styleMap(bubbleStyle)}>${msg.text}</div>`;
749
+ }, _ChatAssistantElement_sendMessage = // ---------- Message sending logic (replaces useChat) --------------------
750
+ async function _ChatAssistantElement_sendMessage2(text) {
751
+ var _a2, _b;
752
+ const trimmed = text.trim();
753
+ if (!trimmed || !this.config || !this.runtime)
754
+ return;
755
+ this._error = null;
756
+ const userMessage = {
757
+ id: generateId2(),
758
+ role: "user",
759
+ text: trimmed,
760
+ timestamp: Date.now()
761
+ };
762
+ this._messages = [...this._messages, userMessage];
763
+ this._isLoading = true;
764
+ this.dispatchEvent(new CustomEvent("chat-message-sent", {
765
+ detail: { text: trimmed },
766
+ bubbles: true
767
+ }));
768
+ try {
769
+ const maxHistory = (_a2 = this.config.maxHistory) != null ? _a2 : 20;
770
+ const historySlice = [...this._messages].slice(-maxHistory).map((m2) => ({
771
+ role: m2.role,
772
+ content: m2.text
773
+ }));
774
+ const response = await sendMessage(this.config.backendUrl, {
775
+ message: trimmed,
776
+ history: historySlice,
777
+ mlflow_run_id: this.config.mlflowRunId
778
+ });
779
+ const { displayText, actions } = parseActions(response.response);
780
+ const assistantMessage = {
781
+ id: generateId2(),
782
+ role: "assistant",
783
+ text: displayText,
784
+ timestamp: Date.now()
785
+ };
786
+ this._messages = [...this._messages, assistantMessage];
787
+ if (actions.length > 0) {
788
+ if ((_b = __classPrivateFieldGet(this, _ChatAssistantElement_batchHandle, "f")) == null ? void 0 : _b.isApplied()) {
789
+ await __classPrivateFieldGet(this, _ChatAssistantElement_batchHandle, "f").revertAll();
790
+ }
791
+ __classPrivateFieldSet(this, _ChatAssistantElement_batchHandle, await this.runtime.actions.applyBatch(actions), "f");
792
+ this.runtime.events.publish("chatbot.actions_applied", {
793
+ count: actions.length,
794
+ kinds: actions.map((a) => a.kind),
795
+ tileId: this.tileId
796
+ });
797
+ }
798
+ this.dispatchEvent(new CustomEvent("chat-response-received", {
799
+ detail: { text: displayText, actions },
800
+ bubbles: true
801
+ }));
802
+ } catch (err) {
803
+ const message = err instanceof Error ? err.message : "An unexpected error occurred";
804
+ this._error = message;
805
+ } finally {
806
+ this._isLoading = false;
807
+ }
808
+ };
809
+ ChatAssistantElement.properties = {
810
+ // Public inputs
811
+ config: { attribute: false },
812
+ runtime: { attribute: false },
813
+ tileId: { type: String },
814
+ // Internal reactive state
815
+ _messages: { state: true },
816
+ _isLoading: { state: true },
817
+ _error: { state: true }
818
+ };
819
+ var TAG_NAME = "syntro-chat-assistant";
820
+ var registerChatAssistantElement = () => {
821
+ if (typeof window === "undefined")
822
+ return;
823
+ if (!customElements.get(TAG_NAME)) {
824
+ customElements.define(TAG_NAME, ChatAssistantElement);
825
+ }
826
+ };
827
+ var ChatAssistantLitMountable = {
828
+ mount(container, mountConfig) {
829
+ const { config, runtime: runtime7, tileId = "chatbot-widget" } = mountConfig != null ? mountConfig : {};
830
+ if (!config || !runtime7) {
831
+ container.innerHTML = `<div style="padding: 16px; color: var(--sc-content-text-secondary-color, ${TOKEN_SLATE_8});">Chat widget requires config and runtime.</div>`;
832
+ return () => {
833
+ container.innerHTML = "";
834
+ };
835
+ }
836
+ registerChatAssistantElement();
837
+ const el = document.createElement("syntro-chat-assistant");
838
+ el.config = config;
839
+ el.runtime = runtime7;
840
+ el.tileId = tileId;
841
+ el.style.cssText = "display:flex;flex-direction:column;height:100%;width:100%;";
842
+ container.appendChild(el);
843
+ return () => {
844
+ el.remove();
845
+ };
846
+ }
847
+ };
848
+
509
849
  // ../adaptives/adaptive-chatbot/dist/runtime.js
510
850
  var runtime3 = {
511
851
  id: "adaptive-chatbot",
@@ -524,6 +864,15 @@ var runtime3 = {
524
864
  description: "AI-powered chat assistant that can execute DOM actions",
525
865
  icon: "\u{1F4AC}"
526
866
  }
867
+ },
868
+ {
869
+ id: "adaptive-chatbot:assistant-lit",
870
+ component: ChatAssistantLitMountable,
871
+ metadata: {
872
+ name: "Chat Assistant (Lit)",
873
+ description: "Lit web component chat assistant \u2014 no React dependency",
874
+ icon: "\u{1F4AC}"
875
+ }
527
876
  }
528
877
  ]
529
878
  };
@@ -2057,19 +2406,19 @@ function getAnswerText(answer) {
2057
2406
  }
2058
2407
  function renderAnswer(answer) {
2059
2408
  if (typeof answer === "string") {
2060
- const html2 = marked.parse(answer);
2409
+ const html5 = marked.parse(answer);
2061
2410
  return (
2062
2411
  // biome-ignore lint/security/noDangerouslySetInnerHtml: content is CMS/config content, not user-controlled input
2063
- _jsx2("div", { style: { margin: 0 }, "data-faq-markdown": "", dangerouslySetInnerHTML: { __html: html2 } })
2412
+ _jsx2("div", { style: { margin: 0 }, "data-faq-markdown": "", dangerouslySetInnerHTML: { __html: html5 } })
2064
2413
  );
2065
2414
  }
2066
2415
  if (answer.type === "rich") {
2067
2416
  return _jsx2("div", { style: { margin: 0 }, dangerouslySetInnerHTML: { __html: answer.html } });
2068
2417
  }
2069
- const html = marked.parse(answer.content);
2418
+ const html4 = marked.parse(answer.content);
2070
2419
  return (
2071
2420
  // biome-ignore lint/security/noDangerouslySetInnerHtml: markdown content is CMS/config content, not user-controlled input
2072
- _jsx2("div", { style: { margin: 0 }, "data-faq-markdown": "", dangerouslySetInnerHTML: { __html: html } })
2421
+ _jsx2("div", { style: { margin: 0 }, "data-faq-markdown": "", dangerouslySetInnerHTML: { __html: html4 } })
2073
2422
  );
2074
2423
  }
2075
2424
  function resolveFeedbackConfig(feedback) {
@@ -2299,7 +2648,7 @@ function FAQWidget({ config, runtime: runtime7, instanceId }) {
2299
2648
  value
2300
2649
  });
2301
2650
  }, [runtime7.events]);
2302
- const containerStyle = {
2651
+ const containerStyle2 = {
2303
2652
  ...baseStyles.container,
2304
2653
  ...themeStyles[resolvedTheme].container
2305
2654
  };
@@ -2317,9 +2666,9 @@ function FAQWidget({ config, runtime: runtime7, instanceId }) {
2317
2666
  };
2318
2667
  const renderItems = (items) => items.map((q2, index) => _jsx2(FAQItem, { item: q2, isExpanded: expandedIds.has(q2.config.id), isHighlighted: highlightId === q2.config.id, isLast: index === items.length - 1, onToggle: () => handleToggle(q2.config.id), theme: resolvedTheme, feedbackConfig, feedbackValue: feedbackState.get(q2.config.id), onFeedback: handleFeedback }, q2.config.id));
2319
2668
  if (visibleQuestions.length === 0) {
2320
- return _jsx2("div", { style: containerStyle, "data-adaptive-id": instanceId, "data-adaptive-type": "adaptive-faq", children: _jsx2("div", { style: emptyStateStyle, children: "You're all set for now! We'll surface answers here when they're relevant to what you're doing." }) });
2669
+ return _jsx2("div", { style: containerStyle2, "data-adaptive-id": instanceId, "data-adaptive-type": "adaptive-faq", children: _jsx2("div", { style: emptyStateStyle, children: "You're all set for now! We'll surface answers here when they're relevant to what you're doing." }) });
2321
2670
  }
2322
- return _jsxs2("div", { style: containerStyle, "data-adaptive-id": instanceId, "data-adaptive-type": "adaptive-faq", children: [config.searchable && _jsxs2("div", { style: baseStyles.searchWrapper, children: [_jsx2("style", { children: `[data-adaptive-id="${instanceId}"] input::placeholder { color: var(--sc-content-search-color, inherit); opacity: 0.7; }` }), _jsx2("input", { type: "text", placeholder: "Search questions...", value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), style: searchInputStyle })] }), _jsx2("div", { style: baseStyles.accordion, children: hasCategories ? Array.from(categoryGroups.entries()).map(([category, items]) => _jsxs2(React2.Fragment, { children: [category && _jsx2("div", { style: categoryHeaderStyle, "data-category-header": category, children: category }), renderItems(items)] }, category != null ? category : "__ungrouped")) : renderItems(filteredQuestions) }), config.searchable && filteredQuestions.length === 0 && searchQuery && _jsxs2("div", { style: { ...baseStyles.noResults, ...themeStyles[resolvedTheme].emptyState }, children: ['No questions found matching "', searchQuery, '"'] })] });
2671
+ return _jsxs2("div", { style: containerStyle2, "data-adaptive-id": instanceId, "data-adaptive-type": "adaptive-faq", children: [config.searchable && _jsxs2("div", { style: baseStyles.searchWrapper, children: [_jsx2("style", { children: `[data-adaptive-id="${instanceId}"] input::placeholder { color: var(--sc-content-search-color, inherit); opacity: 0.7; }` }), _jsx2("input", { type: "text", placeholder: "Search questions...", value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), style: searchInputStyle })] }), _jsx2("div", { style: baseStyles.accordion, children: hasCategories ? Array.from(categoryGroups.entries()).map(([category, items]) => _jsxs2(React2.Fragment, { children: [category && _jsx2("div", { style: categoryHeaderStyle, "data-category-header": category, children: category }), renderItems(items)] }, category != null ? category : "__ungrouped")) : renderItems(filteredQuestions) }), config.searchable && filteredQuestions.length === 0 && searchQuery && _jsxs2("div", { style: { ...baseStyles.noResults, ...themeStyles[resolvedTheme].emptyState }, children: ['No questions found matching "', searchQuery, '"'] })] });
2323
2672
  }
2324
2673
  var FAQMountableWidget = {
2325
2674
  mount(container, config) {
@@ -2343,6 +2692,485 @@ var FAQMountableWidget = {
2343
2692
  }
2344
2693
  };
2345
2694
 
2695
+ // ../adaptives/adaptive-faq/dist/FAQWidgetLit.js
2696
+ import { html as html2, LitElement as LitElement2, nothing as nothing2 } from "lit";
2697
+ import { styleMap as styleMap2 } from "lit/directives/style-map.js";
2698
+ import { unsafeHTML } from "lit/directives/unsafe-html.js";
2699
+ function sm(styles2) {
2700
+ return styles2;
2701
+ }
2702
+ var marked2 = new B({ async: false, gfm: true, breaks: true });
2703
+ function getAnswerText2(answer) {
2704
+ if (typeof answer === "string")
2705
+ return answer;
2706
+ if (answer.type === "rich")
2707
+ return answer.html;
2708
+ return answer.content;
2709
+ }
2710
+ function renderAnswerHtml(answer) {
2711
+ if (typeof answer === "string") {
2712
+ return marked2.parse(answer);
2713
+ }
2714
+ if (answer.type === "rich") {
2715
+ return answer.html;
2716
+ }
2717
+ return marked2.parse(answer.content);
2718
+ }
2719
+ function resolveFeedbackConfig2(feedback) {
2720
+ if (!feedback)
2721
+ return null;
2722
+ if (feedback === true)
2723
+ return { style: "thumbs" };
2724
+ return feedback;
2725
+ }
2726
+ function getFeedbackPrompt2(feedbackConfig) {
2727
+ var _a2;
2728
+ return (_a2 = feedbackConfig.prompt) != null ? _a2 : "Was this helpful?";
2729
+ }
2730
+ function resolveTheme(theme) {
2731
+ var _a2;
2732
+ if (theme && theme !== "auto")
2733
+ return theme;
2734
+ if (typeof window !== "undefined") {
2735
+ return ((_a2 = window.matchMedia) == null ? void 0 : _a2.call(window, "(prefers-color-scheme: dark)").matches) ? "dark" : "light";
2736
+ }
2737
+ return "light";
2738
+ }
2739
+ var FAQAccordionElement = class extends LitElement2 {
2740
+ constructor() {
2741
+ super(...arguments);
2742
+ this.faqConfig = {
2743
+ expandBehavior: "single",
2744
+ searchable: false,
2745
+ theme: "auto",
2746
+ actions: []
2747
+ };
2748
+ this.runtime = null;
2749
+ this.instanceId = "faq-widget";
2750
+ this._expandedIds = /* @__PURE__ */ new Set();
2751
+ this._highlightId = null;
2752
+ this._searchQuery = "";
2753
+ this._feedbackState = /* @__PURE__ */ new Map();
2754
+ this._hoveredId = null;
2755
+ this._unsubContext = null;
2756
+ this._unsubAccumulator = null;
2757
+ this._unsubCta = null;
2758
+ this._unsubDeepLink = null;
2759
+ this._unsubSessionMetrics = null;
2760
+ this._highlightTimer = null;
2761
+ }
2762
+ // -----------------------------------------------------------------------
2763
+ // Light DOM — no Shadow DOM so CSS variables from the host page apply
2764
+ // -----------------------------------------------------------------------
2765
+ createRenderRoot() {
2766
+ return this;
2767
+ }
2768
+ // -----------------------------------------------------------------------
2769
+ // Lifecycle
2770
+ // -----------------------------------------------------------------------
2771
+ connectedCallback() {
2772
+ super.connectedCallback();
2773
+ this._subscribeAll();
2774
+ }
2775
+ disconnectedCallback() {
2776
+ super.disconnectedCallback();
2777
+ this._unsubscribeAll();
2778
+ if (this._highlightTimer !== null) {
2779
+ clearTimeout(this._highlightTimer);
2780
+ this._highlightTimer = null;
2781
+ }
2782
+ }
2783
+ // Re-subscribe when runtime changes (property may be set after connectedCallback)
2784
+ updated(changedProps) {
2785
+ if (changedProps.has("runtime")) {
2786
+ this._unsubscribeAll();
2787
+ this._subscribeAll();
2788
+ }
2789
+ }
2790
+ // -----------------------------------------------------------------------
2791
+ // Subscription management
2792
+ // -----------------------------------------------------------------------
2793
+ _subscribeAll() {
2794
+ var _a2, _b;
2795
+ if (!this.runtime)
2796
+ return;
2797
+ this._unsubContext = this.runtime.context.subscribe(() => {
2798
+ this.requestUpdate();
2799
+ });
2800
+ if ((_a2 = this.runtime.accumulator) == null ? void 0 : _a2.subscribe) {
2801
+ this._unsubAccumulator = this.runtime.accumulator.subscribe(() => {
2802
+ this.requestUpdate();
2803
+ });
2804
+ }
2805
+ if ((_b = this.runtime.sessionMetrics) == null ? void 0 : _b.subscribe) {
2806
+ this._unsubSessionMetrics = this.runtime.sessionMetrics.subscribe(() => {
2807
+ this.requestUpdate();
2808
+ });
2809
+ }
2810
+ if (this.runtime.events.subscribe) {
2811
+ if (this.runtime.events.getRecent) {
2812
+ const recentEvents = this.runtime.events.getRecent({ patterns: ["^action\\.tooltip_cta_clicked$", "^action\\.modal_cta_clicked$"] }, 10);
2813
+ const pendingEvent = recentEvents.filter((e) => {
2814
+ var _a3;
2815
+ const actionId = (_a3 = e.props) == null ? void 0 : _a3.actionId;
2816
+ return typeof actionId === "string" && actionId.startsWith("faq:open:");
2817
+ }).pop();
2818
+ if (pendingEvent && Date.now() - pendingEvent.ts < 1e4) {
2819
+ const questionId = pendingEvent.props.actionId.replace("faq:open:", "");
2820
+ this._expandedIds = /* @__PURE__ */ new Set([questionId]);
2821
+ requestAnimationFrame(() => {
2822
+ const el = document.querySelector(`[data-faq-item-id="${questionId}"]`);
2823
+ if (el)
2824
+ el.scrollIntoView({ behavior: "smooth", block: "center" });
2825
+ });
2826
+ }
2827
+ }
2828
+ this._unsubCta = this.runtime.events.subscribe({ patterns: ["^action\\.tooltip_cta_clicked$", "^action\\.modal_cta_clicked$"] }, (event) => {
2829
+ var _a3, _b2;
2830
+ const actionId = (_a3 = event.props) == null ? void 0 : _a3.actionId;
2831
+ if (typeof actionId !== "string" || !actionId.startsWith("faq:open:"))
2832
+ return;
2833
+ const questionId = actionId.replace("faq:open:", "");
2834
+ this._expandedIds = /* @__PURE__ */ new Set([questionId]);
2835
+ requestAnimationFrame(() => {
2836
+ const el = document.querySelector(`[data-faq-item-id="${questionId}"]`);
2837
+ if (el)
2838
+ el.scrollIntoView({ behavior: "smooth", block: "center" });
2839
+ });
2840
+ (_b2 = this.runtime) == null ? void 0 : _b2.events.publish("canvas.requestOpen");
2841
+ });
2842
+ }
2843
+ if (this.runtime.events.subscribe) {
2844
+ const handleDeepLink = (event) => {
2845
+ var _a3, _b2;
2846
+ const tileId = (_a3 = event.props) == null ? void 0 : _a3.tileId;
2847
+ const itemId = (_b2 = event.props) == null ? void 0 : _b2.itemId;
2848
+ if (tileId !== this.instanceId)
2849
+ return;
2850
+ if (!itemId)
2851
+ return;
2852
+ this._expandedIds = /* @__PURE__ */ new Set([itemId]);
2853
+ this._highlightId = itemId;
2854
+ if (this._highlightTimer !== null)
2855
+ clearTimeout(this._highlightTimer);
2856
+ this._highlightTimer = setTimeout(() => {
2857
+ this._highlightId = null;
2858
+ this._highlightTimer = null;
2859
+ }, 1500);
2860
+ requestAnimationFrame(() => {
2861
+ const el = document.querySelector(`[data-faq-item-id="${itemId}"]`);
2862
+ if (el)
2863
+ el.scrollIntoView({ behavior: "smooth", block: "center" });
2864
+ });
2865
+ };
2866
+ if (this.runtime.events.getRecent) {
2867
+ const recent = this.runtime.events.getRecent({ names: ["notification.deep_link"] }, 5);
2868
+ const pending = recent.filter((e) => {
2869
+ var _a3, _b2;
2870
+ return ((_a3 = e.props) == null ? void 0 : _a3.tileId) === this.instanceId && ((_b2 = e.props) == null ? void 0 : _b2.itemId);
2871
+ }).pop();
2872
+ if (pending && Date.now() - pending.ts < 1e4) {
2873
+ handleDeepLink(pending);
2874
+ }
2875
+ }
2876
+ this._unsubDeepLink = this.runtime.events.subscribe({ names: ["notification.deep_link"] }, handleDeepLink);
2877
+ }
2878
+ }
2879
+ _unsubscribeAll() {
2880
+ var _a2, _b, _c, _d, _e2;
2881
+ (_a2 = this._unsubContext) == null ? void 0 : _a2.call(this);
2882
+ (_b = this._unsubAccumulator) == null ? void 0 : _b.call(this);
2883
+ (_c = this._unsubSessionMetrics) == null ? void 0 : _c.call(this);
2884
+ (_d = this._unsubCta) == null ? void 0 : _d.call(this);
2885
+ (_e2 = this._unsubDeepLink) == null ? void 0 : _e2.call(this);
2886
+ this._unsubContext = null;
2887
+ this._unsubAccumulator = null;
2888
+ this._unsubSessionMetrics = null;
2889
+ this._unsubCta = null;
2890
+ this._unsubDeepLink = null;
2891
+ }
2892
+ // -----------------------------------------------------------------------
2893
+ // Handlers
2894
+ // -----------------------------------------------------------------------
2895
+ _handleToggle(id) {
2896
+ var _a2;
2897
+ const prev = this._expandedIds;
2898
+ let next;
2899
+ if (this.faqConfig.expandBehavior === "single") {
2900
+ next = prev.has(id) ? /* @__PURE__ */ new Set() : /* @__PURE__ */ new Set([id]);
2901
+ } else {
2902
+ next = new Set(prev);
2903
+ if (prev.has(id)) {
2904
+ next.delete(id);
2905
+ } else {
2906
+ next.add(id);
2907
+ }
2908
+ }
2909
+ const willBeExpanded = !prev.has(id);
2910
+ this._expandedIds = next;
2911
+ (_a2 = this.runtime) == null ? void 0 : _a2.events.publish("faq:toggled", {
2912
+ instanceId: this.instanceId,
2913
+ questionId: id,
2914
+ expanded: willBeExpanded,
2915
+ timestamp: Date.now()
2916
+ });
2917
+ }
2918
+ _handleFeedback(itemId, question, value) {
2919
+ var _a2;
2920
+ const next = new Map(this._feedbackState);
2921
+ next.set(itemId, value);
2922
+ this._feedbackState = next;
2923
+ (_a2 = this.runtime) == null ? void 0 : _a2.events.publish("faq:feedback", { itemId, question, value });
2924
+ }
2925
+ // -----------------------------------------------------------------------
2926
+ // Computed helpers
2927
+ // -----------------------------------------------------------------------
2928
+ _visibleQuestions() {
2929
+ var _a2;
2930
+ return ((_a2 = this.faqConfig.actions) != null ? _a2 : []).filter((q2) => {
2931
+ if (!q2.triggerWhen)
2932
+ return true;
2933
+ if (!this.runtime)
2934
+ return true;
2935
+ const result = this.runtime.evaluateSync(q2.triggerWhen);
2936
+ return result.value;
2937
+ });
2938
+ }
2939
+ _orderedQuestions(visible) {
2940
+ if (this.faqConfig.ordering === "priority") {
2941
+ return [...visible].sort((a, b2) => {
2942
+ var _a2, _b;
2943
+ return ((_a2 = b2.config.priority) != null ? _a2 : 0) - ((_b = a.config.priority) != null ? _b : 0);
2944
+ });
2945
+ }
2946
+ return visible;
2947
+ }
2948
+ _filteredQuestions(ordered) {
2949
+ const q2 = this._searchQuery.trim().toLowerCase();
2950
+ if (!this.faqConfig.searchable || !q2)
2951
+ return ordered;
2952
+ return ordered.filter((item) => {
2953
+ var _a2;
2954
+ return item.config.question.toLowerCase().includes(q2) || getAnswerText2(item.config.answer).toLowerCase().includes(q2) || ((_a2 = item.config.category) == null ? void 0 : _a2.toLowerCase().includes(q2));
2955
+ });
2956
+ }
2957
+ _categoryGroups(filtered) {
2958
+ const groups = /* @__PURE__ */ new Map();
2959
+ for (const item of filtered) {
2960
+ const cat = item.config.category;
2961
+ if (!groups.has(cat))
2962
+ groups.set(cat, []);
2963
+ groups.get(cat).push(item);
2964
+ }
2965
+ return groups;
2966
+ }
2967
+ // -----------------------------------------------------------------------
2968
+ // Render helpers
2969
+ // -----------------------------------------------------------------------
2970
+ _renderAnswer(answer) {
2971
+ const html_str = renderAnswerHtml(answer);
2972
+ return html2`<div style="margin:0" data-faq-markdown="">${unsafeHTML(html_str)}</div>`;
2973
+ }
2974
+ _renderFeedback(item, feedbackConfig, feedbackValue, theme) {
2975
+ const colors = themeStyles[theme];
2976
+ const feedbackStyle = { ...baseStyles.feedback, ...colors.feedbackPrompt };
2977
+ return html2`
2978
+ <div style=${styleMap2(sm(feedbackStyle))}>
2979
+ <span>${getFeedbackPrompt2(feedbackConfig)}</span>
2980
+ <button
2981
+ type="button"
2982
+ style=${styleMap2(sm({
2983
+ ...baseStyles.feedbackButton,
2984
+ ...feedbackValue === "up" ? baseStyles.feedbackButtonSelected : {}
2985
+ }))}
2986
+ aria-label="Thumbs up"
2987
+ @click=${() => this._handleFeedback(item.config.id, item.config.question, "up")}
2988
+ >\uD83D\uDC4D</button>
2989
+ <button
2990
+ type="button"
2991
+ style=${styleMap2(sm({
2992
+ ...baseStyles.feedbackButton,
2993
+ ...feedbackValue === "down" ? baseStyles.feedbackButtonSelected : {}
2994
+ }))}
2995
+ aria-label="Thumbs down"
2996
+ @click=${() => this._handleFeedback(item.config.id, item.config.question, "down")}
2997
+ >\uD83D\uDC4E</button>
2998
+ </div>
2999
+ `;
3000
+ }
3001
+ _renderItem(item, isLast, theme, feedbackConfig) {
3002
+ const colors = themeStyles[theme];
3003
+ const isExpanded = this._expandedIds.has(item.config.id);
3004
+ const isHighlighted = this._highlightId === item.config.id;
3005
+ const isHovered = this._hoveredId === item.config.id;
3006
+ const itemStyle = {
3007
+ ...baseStyles.item,
3008
+ ...colors.item,
3009
+ ...isExpanded ? colors.itemExpanded : {},
3010
+ ...isHighlighted ? {
3011
+ boxShadow: `0 0 0 2px ${purple[4]}, 0 0 12px rgba(106, 89, 206, 0.4)`,
3012
+ transition: "box-shadow 0.3s ease"
3013
+ } : {},
3014
+ ...!isLast ? { borderBottom: "var(--sc-content-item-divider, none)" } : {}
3015
+ };
3016
+ const questionStyle = {
3017
+ ...baseStyles.question,
3018
+ ...colors.question,
3019
+ ...isHovered ? colors.questionHover : {}
3020
+ };
3021
+ const chevronStyle = {
3022
+ ...baseStyles.chevron,
3023
+ transform: isExpanded ? "rotate(90deg)" : "rotate(0deg)"
3024
+ };
3025
+ const answerStyle = {
3026
+ ...baseStyles.answer,
3027
+ ...colors.answer,
3028
+ maxHeight: isExpanded ? "500px" : "0",
3029
+ paddingBottom: isExpanded ? "16px" : "0"
3030
+ };
3031
+ return html2`
3032
+ <div
3033
+ style=${styleMap2(sm(itemStyle))}
3034
+ data-faq-item-id=${item.config.id}
3035
+ >
3036
+ <button
3037
+ type="button"
3038
+ style=${styleMap2(sm(questionStyle))}
3039
+ aria-expanded=${isExpanded}
3040
+ @click=${() => this._handleToggle(item.config.id)}
3041
+ @mouseenter=${() => {
3042
+ this._hoveredId = item.config.id;
3043
+ }}
3044
+ @mouseleave=${() => {
3045
+ this._hoveredId = null;
3046
+ }}
3047
+ >
3048
+ <span>${item.config.question}</span>
3049
+ <span style=${styleMap2(sm(chevronStyle))}>\u203A</span>
3050
+ </button>
3051
+
3052
+ <div
3053
+ style=${styleMap2(sm(answerStyle))}
3054
+ aria-hidden=${!isExpanded}
3055
+ >
3056
+ ${this._renderAnswer(item.config.answer)}
3057
+ ${isExpanded && feedbackConfig ? this._renderFeedback(item, feedbackConfig, this._feedbackState.get(item.config.id), theme) : nothing2}
3058
+ </div>
3059
+ </div>
3060
+ `;
3061
+ }
3062
+ _renderItems(items, theme, feedbackConfig) {
3063
+ return items.map((item, index) => this._renderItem(item, index === items.length - 1, theme, feedbackConfig));
3064
+ }
3065
+ // -----------------------------------------------------------------------
3066
+ // Render
3067
+ // -----------------------------------------------------------------------
3068
+ render() {
3069
+ const theme = resolveTheme(this.faqConfig.theme);
3070
+ const colors = themeStyles[theme];
3071
+ const feedbackConfig = resolveFeedbackConfig2(this.faqConfig.feedback);
3072
+ const visible = this._visibleQuestions();
3073
+ const ordered = this._orderedQuestions(visible);
3074
+ const filtered = this._filteredQuestions(ordered);
3075
+ const hasCategories = filtered.some((q2) => q2.config.category);
3076
+ const groups = hasCategories ? this._categoryGroups(filtered) : null;
3077
+ const containerStyle2 = {
3078
+ ...baseStyles.container,
3079
+ ...colors.container
3080
+ };
3081
+ const emptyStateStyle = {
3082
+ ...baseStyles.emptyState,
3083
+ ...colors.emptyState
3084
+ };
3085
+ const categoryHeaderStyle = {
3086
+ ...baseStyles.categoryHeader,
3087
+ ...colors.categoryHeader
3088
+ };
3089
+ const searchInputStyle = {
3090
+ ...baseStyles.searchInput,
3091
+ ...colors.searchInput
3092
+ };
3093
+ if (visible.length === 0) {
3094
+ return html2`
3095
+ <div
3096
+ style=${styleMap2(sm(containerStyle2))}
3097
+ data-adaptive-id=${this.instanceId}
3098
+ data-adaptive-type="adaptive-faq"
3099
+ >
3100
+ <div style=${styleMap2(sm(emptyStateStyle))}>
3101
+ You're all set for now! We'll surface answers here when they're relevant to what
3102
+ you're doing.
3103
+ </div>
3104
+ </div>
3105
+ `;
3106
+ }
3107
+ return html2`
3108
+ <div
3109
+ style=${styleMap2(sm(containerStyle2))}
3110
+ data-adaptive-id=${this.instanceId}
3111
+ data-adaptive-type="adaptive-faq"
3112
+ >
3113
+ ${this.faqConfig.searchable ? html2`
3114
+ <div style=${styleMap2(sm(baseStyles.searchWrapper))}>
3115
+ <style>
3116
+ [data-adaptive-id="${this.instanceId}"] input::placeholder {
3117
+ color: var(--sc-content-search-color, inherit);
3118
+ opacity: 0.7;
3119
+ }
3120
+ </style>
3121
+ <input
3122
+ type="text"
3123
+ placeholder="Search questions..."
3124
+ .value=${this._searchQuery}
3125
+ style=${styleMap2(sm(searchInputStyle))}
3126
+ @input=${(e) => {
3127
+ this._searchQuery = e.target.value;
3128
+ }}
3129
+ />
3130
+ </div>
3131
+ ` : nothing2}
3132
+
3133
+ <div style=${styleMap2(sm(baseStyles.accordion))}>
3134
+ ${groups ? Array.from(groups.entries()).map(([category, items]) => html2`
3135
+ ${category ? html2`
3136
+ <div
3137
+ style=${styleMap2(sm(categoryHeaderStyle))}
3138
+ data-category-header=${category}
3139
+ >
3140
+ ${category}
3141
+ </div>
3142
+ ` : nothing2}
3143
+ ${this._renderItems(items, theme, feedbackConfig)}
3144
+ `) : this._renderItems(filtered, theme, feedbackConfig)}
3145
+ </div>
3146
+
3147
+ ${this.faqConfig.searchable && filtered.length === 0 && this._searchQuery ? html2`
3148
+ <div
3149
+ style=${styleMap2(sm({ ...baseStyles.noResults, ...colors.emptyState }))}
3150
+ >
3151
+ No questions found matching &quot;${this._searchQuery}&quot;
3152
+ </div>
3153
+ ` : nothing2}
3154
+ </div>
3155
+ `;
3156
+ }
3157
+ };
3158
+ FAQAccordionElement.properties = {
3159
+ // Public API — set from the outside
3160
+ faqConfig: { attribute: false },
3161
+ runtime: { attribute: false },
3162
+ instanceId: { type: String },
3163
+ // Internal reactive state (prefixed with _ to signal "private")
3164
+ _expandedIds: { state: true },
3165
+ _highlightId: { state: true },
3166
+ _searchQuery: { state: true },
3167
+ _feedbackState: { state: true },
3168
+ _hoveredId: { state: true }
3169
+ };
3170
+ if (!customElements.get("syntro-faq-accordion")) {
3171
+ customElements.define("syntro-faq-accordion", FAQAccordionElement);
3172
+ }
3173
+
2346
3174
  // ../adaptives/adaptive-faq/dist/runtime.js
2347
3175
  var runtime4 = {
2348
3176
  id: "adaptive-faq",
@@ -2784,7 +3612,7 @@ function NavWidget({ config, runtime: runtime7, instanceId }) {
2784
3612
  pulseElement(el);
2785
3613
  setTimeout(() => el.focus(), 400);
2786
3614
  }, [runtime7.events, instanceId]);
2787
- const containerStyle = {
3615
+ const containerStyle2 = {
2788
3616
  ...baseStyles2.container,
2789
3617
  ...themeStyles2[resolvedTheme].container
2790
3618
  };
@@ -2798,9 +3626,9 @@ function NavWidget({ config, runtime: runtime7, instanceId }) {
2798
3626
  };
2799
3627
  const renderItems = (items) => items.map((tip, index) => _jsx3(NavTipItem, { item: tip, isExpanded: expandedIds.has(tip.config.id), isLast: index === items.length - 1, onToggle: () => handleToggle(tip.config.id), onNavigate: handleNavigate, onFocusAnchor: handleFocusAnchor, theme: resolvedTheme }, tip.config.id));
2800
3628
  if (visibleTips.length === 0) {
2801
- return _jsx3("div", { style: containerStyle, "data-adaptive-id": instanceId, "data-adaptive-type": "adaptive-nav", children: _jsx3("div", { style: emptyStateStyle, children: "You're all set for now! We'll share helpful tips here when they're relevant to what you're doing." }) });
3629
+ return _jsx3("div", { style: containerStyle2, "data-adaptive-id": instanceId, "data-adaptive-type": "adaptive-nav", children: _jsx3("div", { style: emptyStateStyle, children: "You're all set for now! We'll share helpful tips here when they're relevant to what you're doing." }) });
2802
3630
  }
2803
- return _jsx3("div", { style: containerStyle, "data-adaptive-id": instanceId, "data-adaptive-type": "adaptive-nav", children: _jsx3("div", { style: baseStyles2.accordion, children: hasCategories ? Array.from(categoryGroups.entries()).map(([category, items]) => _jsxs3(React3.Fragment, { children: [category && _jsx3("div", { style: categoryHeaderStyle, "data-category-header": category, children: category }), renderItems(items)] }, category != null ? category : "__ungrouped")) : renderItems(visibleTips) }) });
3631
+ return _jsx3("div", { style: containerStyle2, "data-adaptive-id": instanceId, "data-adaptive-type": "adaptive-nav", children: _jsx3("div", { style: baseStyles2.accordion, children: hasCategories ? Array.from(categoryGroups.entries()).map(([category, items]) => _jsxs3(React3.Fragment, { children: [category && _jsx3("div", { style: categoryHeaderStyle, "data-category-header": category, children: category }), renderItems(items)] }, category != null ? category : "__ungrouped")) : renderItems(visibleTips) }) });
2804
3632
  }
2805
3633
  var NavMountableWidget = {
2806
3634
  mount(container, config) {
@@ -2823,6 +3651,423 @@ var NavMountableWidget = {
2823
3651
  }
2824
3652
  };
2825
3653
 
3654
+ // ../adaptives/adaptive-nav/dist/NavWidgetLit.js
3655
+ import { html as html3, LitElement as LitElement3, nothing as nothing3 } from "lit";
3656
+ import { styleMap as styleMap3 } from "lit/directives/style-map.js";
3657
+ import { unsafeHTML as unsafeHTML2 } from "lit/directives/unsafe-html.js";
3658
+ var __classPrivateFieldGet2 = function(receiver, state, kind, f) {
3659
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3660
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
3661
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
3662
+ };
3663
+ var __classPrivateFieldSet2 = function(receiver, state, value, kind, f) {
3664
+ if (kind === "m") throw new TypeError("Private method is not writable");
3665
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
3666
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
3667
+ return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
3668
+ };
3669
+ var _NavWidgetLit_instances;
3670
+ var _NavWidgetLit_contextUnsub;
3671
+ var _NavWidgetLit_accumulatorUnsub;
3672
+ var _NavWidgetLit_subscribeRuntime;
3673
+ var _NavWidgetLit_unsubscribeRuntime;
3674
+ var _NavWidgetLit_getVisibleTips;
3675
+ var _NavWidgetLit_getResolvedTheme;
3676
+ var _NavWidgetLit_handleToggle;
3677
+ var _NavWidgetLit_handleNavigate;
3678
+ var _NavWidgetLit_handleFocusAnchor;
3679
+ var _NavWidgetLit_publishEvent;
3680
+ var _NavWidgetLit_renderTipItem;
3681
+ var TOKEN_PURPLE_42 = "#6a59ce";
3682
+ var TOKEN_SLATE_GREY_7 = "#677384";
3683
+ var TOKEN_SLATE_GREY_8 = "#87919f";
3684
+ var EMOJI_SVG_MAP2 = {
3685
+ "\u{1F4B5}": '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="20" height="12" x="2" y="6" rx="2"/><circle cx="12" cy="12" r="2"/><path d="M6 12h.01M18 12h.01"/></svg>',
3686
+ "\u{1F3DB}\uFE0F": '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="3" x2="21" y1="22" y2="22"/><line x1="6" x2="6" y1="18" y2="11"/><line x1="10" x2="10" y1="18" y2="11"/><line x1="14" x2="14" y1="18" y2="11"/><line x1="18" x2="18" y1="18" y2="11"/><polygon points="12 2 20 7 4 7"/></svg>',
3687
+ "\u23ED\uFE0F": '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="5 4 15 12 5 20 5 4"/><line x1="19" x2="19" y1="5" y2="19"/></svg>',
3688
+ "\u27A1\uFE0F": '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg>',
3689
+ "\u{1F4A1}": '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"/><path d="M9 18h6"/><path d="M10 22h4"/></svg>',
3690
+ "\u{1F4B0}": '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="20" height="12" x="2" y="6" rx="2"/><circle cx="12" cy="12" r="2"/><path d="M6 12h.01M18 12h.01"/></svg>',
3691
+ "\u{1F4CB}": '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="8" height="4" x="8" y="2" rx="1" ry="1"/><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/><path d="M12 11h4"/><path d="M12 16h4"/><path d="M8 11h.01"/><path d="M8 16h.01"/></svg>',
3692
+ "\u2705": '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><path d="m9 11 3 3L22 4"/></svg>',
3693
+ "\u26A0\uFE0F": '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/><path d="M12 9v4"/><path d="M12 17h.01"/></svg>'
3694
+ };
3695
+ function escapeHtml2(str) {
3696
+ return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
3697
+ }
3698
+ function renderIcon2(emoji) {
3699
+ var _a2;
3700
+ return (_a2 = EMOJI_SVG_MAP2[emoji]) != null ? _a2 : escapeHtml2(emoji);
3701
+ }
3702
+ function routeMatchesCurrent2(routes) {
3703
+ if (typeof window === "undefined")
3704
+ return false;
3705
+ const current = window.location.pathname;
3706
+ return routes.some((route) => {
3707
+ const routePath = route.split("?")[0].split("#")[0];
3708
+ if (routePath.endsWith("/**")) {
3709
+ return current.startsWith(routePath.slice(0, -3));
3710
+ }
3711
+ return current === routePath;
3712
+ });
3713
+ }
3714
+ function pulseElement2(el) {
3715
+ const keyframes = [
3716
+ { boxShadow: "0 0 0 0 rgba(13, 148, 136, 0.5)" },
3717
+ { boxShadow: "0 0 0 8px rgba(13, 148, 136, 0)" }
3718
+ ];
3719
+ el.animate(keyframes, { duration: 600, iterations: 3, easing: "ease-out" });
3720
+ }
3721
+ function resolveTheme2(theme) {
3722
+ var _a2;
3723
+ if (theme === "dark")
3724
+ return "dark";
3725
+ if (theme === "light")
3726
+ return "light";
3727
+ if (typeof window !== "undefined") {
3728
+ return ((_a2 = window.matchMedia) == null ? void 0 : _a2.call(window, "(prefers-color-scheme: dark)").matches) ? "dark" : "light";
3729
+ }
3730
+ return "light";
3731
+ }
3732
+ var NavWidgetLit = class extends LitElement3 {
3733
+ constructor() {
3734
+ super(...arguments);
3735
+ _NavWidgetLit_instances.add(this);
3736
+ this.config = { expandBehavior: "single", theme: "auto", actions: [] };
3737
+ this.runtime = void 0;
3738
+ this.instanceId = "nav-widget";
3739
+ this._expandedIds = /* @__PURE__ */ new Set();
3740
+ this._renderTick = 0;
3741
+ this._hoveredId = null;
3742
+ _NavWidgetLit_contextUnsub.set(this, null);
3743
+ _NavWidgetLit_accumulatorUnsub.set(this, null);
3744
+ }
3745
+ createRenderRoot() {
3746
+ return this;
3747
+ }
3748
+ // ---------- Lifecycle: connectedCallback ---------------------------------
3749
+ connectedCallback() {
3750
+ super.connectedCallback();
3751
+ __classPrivateFieldGet2(this, _NavWidgetLit_instances, "m", _NavWidgetLit_subscribeRuntime).call(this);
3752
+ }
3753
+ // ---------- Lifecycle: disconnectedCallback ------------------------------
3754
+ disconnectedCallback() {
3755
+ super.disconnectedCallback();
3756
+ __classPrivateFieldGet2(this, _NavWidgetLit_instances, "m", _NavWidgetLit_unsubscribeRuntime).call(this);
3757
+ }
3758
+ // ---------- Lifecycle: updated -------------------------------------------
3759
+ updated(changed) {
3760
+ if (changed.has("runtime")) {
3761
+ __classPrivateFieldGet2(this, _NavWidgetLit_instances, "m", _NavWidgetLit_unsubscribeRuntime).call(this);
3762
+ __classPrivateFieldGet2(this, _NavWidgetLit_instances, "m", _NavWidgetLit_subscribeRuntime).call(this);
3763
+ }
3764
+ }
3765
+ // ---------- Render --------------------------------------------------------
3766
+ render() {
3767
+ const visibleTips = __classPrivateFieldGet2(this, _NavWidgetLit_instances, "m", _NavWidgetLit_getVisibleTips).call(this);
3768
+ const theme = __classPrivateFieldGet2(this, _NavWidgetLit_instances, "m", _NavWidgetLit_getResolvedTheme).call(this);
3769
+ const containerStyle2 = styleMap3({
3770
+ fontFamily: "var(--sc-font-family, system-ui, -apple-system, sans-serif)",
3771
+ maxWidth: "100%",
3772
+ overflow: "hidden",
3773
+ backgroundColor: "transparent",
3774
+ color: "inherit"
3775
+ });
3776
+ const accordionStyle = styleMap3({
3777
+ display: "flex",
3778
+ flexDirection: "column",
3779
+ gap: "var(--sc-content-item-gap, 6px)"
3780
+ });
3781
+ const categoryHeaderStyle = styleMap3({
3782
+ fontSize: "var(--sc-content-category-font-size, 12px)",
3783
+ fontWeight: "600",
3784
+ textTransform: "uppercase",
3785
+ letterSpacing: "0.05em",
3786
+ padding: "var(--sc-content-category-padding, 8px 4px 4px 4px)",
3787
+ color: theme === "dark" ? TOKEN_SLATE_GREY_8 : TOKEN_SLATE_GREY_7
3788
+ });
3789
+ const emptyStateStyle = styleMap3({
3790
+ fontSize: "13px",
3791
+ padding: "16px",
3792
+ textAlign: "center",
3793
+ color: theme === "dark" ? TOKEN_SLATE_GREY_7 : TOKEN_SLATE_GREY_8
3794
+ });
3795
+ if (visibleTips.length === 0) {
3796
+ return html3`
3797
+ <div
3798
+ style=${containerStyle2}
3799
+ data-adaptive-id=${this.instanceId}
3800
+ data-adaptive-type="adaptive-nav"
3801
+ >
3802
+ <div style=${emptyStateStyle}>
3803
+ You're all set for now! We'll share helpful tips here when they're relevant to what
3804
+ you're doing.
3805
+ </div>
3806
+ </div>
3807
+ `;
3808
+ }
3809
+ const categoryGroups = /* @__PURE__ */ new Map();
3810
+ for (const tip of visibleTips) {
3811
+ const cat = tip.config.category;
3812
+ if (!categoryGroups.has(cat)) {
3813
+ categoryGroups.set(cat, []);
3814
+ }
3815
+ categoryGroups.get(cat).push(tip);
3816
+ }
3817
+ const hasCategories = visibleTips.some((t) => t.config.category);
3818
+ return html3`
3819
+ <div
3820
+ style=${containerStyle2}
3821
+ data-adaptive-id=${this.instanceId}
3822
+ data-adaptive-type="adaptive-nav"
3823
+ >
3824
+ <div style=${accordionStyle}>
3825
+ ${hasCategories ? Array.from(categoryGroups.entries()).map(([category, items]) => html3`
3826
+ ${category ? html3`<div style=${categoryHeaderStyle} data-category-header=${category}>${category}</div>` : nothing3}
3827
+ ${items.map((tip, idx) => __classPrivateFieldGet2(this, _NavWidgetLit_instances, "m", _NavWidgetLit_renderTipItem).call(this, tip, idx, items.length))}
3828
+ `) : visibleTips.map((tip, idx) => __classPrivateFieldGet2(this, _NavWidgetLit_instances, "m", _NavWidgetLit_renderTipItem).call(this, tip, idx, visibleTips.length))}
3829
+ </div>
3830
+ </div>
3831
+ `;
3832
+ }
3833
+ };
3834
+ _NavWidgetLit_contextUnsub = /* @__PURE__ */ new WeakMap(), _NavWidgetLit_accumulatorUnsub = /* @__PURE__ */ new WeakMap(), _NavWidgetLit_instances = /* @__PURE__ */ new WeakSet(), _NavWidgetLit_subscribeRuntime = function _NavWidgetLit_subscribeRuntime2() {
3835
+ var _a2;
3836
+ if (!this.runtime)
3837
+ return;
3838
+ __classPrivateFieldSet2(this, _NavWidgetLit_contextUnsub, this.runtime.context.subscribe(() => {
3839
+ this._renderTick += 1;
3840
+ }), "f");
3841
+ if ((_a2 = this.runtime.accumulator) == null ? void 0 : _a2.subscribe) {
3842
+ __classPrivateFieldSet2(this, _NavWidgetLit_accumulatorUnsub, this.runtime.accumulator.subscribe(() => {
3843
+ this._renderTick += 1;
3844
+ }), "f");
3845
+ }
3846
+ }, _NavWidgetLit_unsubscribeRuntime = function _NavWidgetLit_unsubscribeRuntime2() {
3847
+ var _a2, _b;
3848
+ (_a2 = __classPrivateFieldGet2(this, _NavWidgetLit_contextUnsub, "f")) == null ? void 0 : _a2.call(this);
3849
+ __classPrivateFieldSet2(this, _NavWidgetLit_contextUnsub, null, "f");
3850
+ (_b = __classPrivateFieldGet2(this, _NavWidgetLit_accumulatorUnsub, "f")) == null ? void 0 : _b.call(this);
3851
+ __classPrivateFieldSet2(this, _NavWidgetLit_accumulatorUnsub, null, "f");
3852
+ }, _NavWidgetLit_getVisibleTips = function _NavWidgetLit_getVisibleTips2() {
3853
+ void this._renderTick;
3854
+ if (!this.runtime)
3855
+ return this.config.actions;
3856
+ return this.config.actions.filter((tip) => {
3857
+ if (!tip.triggerWhen)
3858
+ return true;
3859
+ try {
3860
+ const result = this.runtime.evaluateSync(tip.triggerWhen);
3861
+ return result.value;
3862
+ } catch {
3863
+ return false;
3864
+ }
3865
+ });
3866
+ }, _NavWidgetLit_getResolvedTheme = function _NavWidgetLit_getResolvedTheme2() {
3867
+ return resolveTheme2(this.config.theme);
3868
+ }, _NavWidgetLit_handleToggle = function _NavWidgetLit_handleToggle2(id) {
3869
+ const wasExpanded = this._expandedIds.has(id);
3870
+ let next;
3871
+ if (this.config.expandBehavior === "single") {
3872
+ for (const prevId of this._expandedIds) {
3873
+ if (prevId !== id) {
3874
+ __classPrivateFieldGet2(this, _NavWidgetLit_instances, "m", _NavWidgetLit_publishEvent).call(this, "nav:toggled", {
3875
+ tipId: prevId,
3876
+ expanded: false
3877
+ });
3878
+ }
3879
+ }
3880
+ next = wasExpanded ? /* @__PURE__ */ new Set() : /* @__PURE__ */ new Set([id]);
3881
+ } else {
3882
+ next = new Set(this._expandedIds);
3883
+ if (wasExpanded) {
3884
+ next.delete(id);
3885
+ } else {
3886
+ next.add(id);
3887
+ }
3888
+ }
3889
+ __classPrivateFieldGet2(this, _NavWidgetLit_instances, "m", _NavWidgetLit_publishEvent).call(this, "nav:toggled", {
3890
+ tipId: id,
3891
+ expanded: !wasExpanded
3892
+ });
3893
+ this._expandedIds = next;
3894
+ }, _NavWidgetLit_handleNavigate = function _NavWidgetLit_handleNavigate2(href, external) {
3895
+ const normalized = href.trim().toLowerCase();
3896
+ if (normalized.startsWith("javascript:") || normalized.startsWith("data:"))
3897
+ return;
3898
+ __classPrivateFieldGet2(this, _NavWidgetLit_instances, "m", _NavWidgetLit_publishEvent).call(this, "nav:tip_clicked", { href, external });
3899
+ this.dispatchEvent(new CustomEvent("nav-tip-clicked", {
3900
+ bubbles: true,
3901
+ detail: { href, external, instanceId: this.instanceId }
3902
+ }));
3903
+ if (external) {
3904
+ window.open(href, "_blank", "noopener,noreferrer");
3905
+ } else {
3906
+ const url = new URL(href, window.location.origin);
3907
+ url.search = window.location.search;
3908
+ if (!navigateWithFrameworkRouter(url.toString())) {
3909
+ window.history.pushState(null, "", url.toString());
3910
+ window.dispatchEvent(new PopStateEvent("popstate"));
3911
+ }
3912
+ }
3913
+ }, _NavWidgetLit_handleFocusAnchor = function _NavWidgetLit_handleFocusAnchor2(anchor) {
3914
+ const el = document.querySelector(anchor.selector);
3915
+ if (!(el instanceof HTMLElement))
3916
+ return;
3917
+ __classPrivateFieldGet2(this, _NavWidgetLit_instances, "m", _NavWidgetLit_publishEvent).call(this, "nav:tip_focused", {
3918
+ selector: anchor.selector,
3919
+ route: anchor.route
3920
+ });
3921
+ this.dispatchEvent(new CustomEvent("nav-tip-focused", {
3922
+ bubbles: true,
3923
+ detail: { selector: anchor.selector, instanceId: this.instanceId }
3924
+ }));
3925
+ el.scrollIntoView({ behavior: "smooth", block: "center" });
3926
+ pulseElement2(el);
3927
+ setTimeout(() => el.focus(), 400);
3928
+ }, _NavWidgetLit_publishEvent = function _NavWidgetLit_publishEvent2(name, props) {
3929
+ var _a2;
3930
+ (_a2 = this.runtime) == null ? void 0 : _a2.events.publish(name, {
3931
+ instanceId: this.instanceId,
3932
+ timestamp: Date.now(),
3933
+ ...props
3934
+ });
3935
+ }, _NavWidgetLit_renderTipItem = function _NavWidgetLit_renderTipItem2(tip, index, total) {
3936
+ const { id, title, description, href, icon, external, anchor, category: _cat } = tip.config;
3937
+ const isExpanded = this._expandedIds.has(id);
3938
+ const isLast = index === total - 1;
3939
+ const isHovered = this._hoveredId === id;
3940
+ const theme = __classPrivateFieldGet2(this, _NavWidgetLit_instances, "m", _NavWidgetLit_getResolvedTheme).call(this);
3941
+ const effectiveHref = anchor ? Array.isArray(anchor.route) ? anchor.route[0] : anchor.route : href;
3942
+ const isSamePage = anchor ? routeMatchesCurrent2(Array.isArray(anchor.route) ? anchor.route : [anchor.route]) : effectiveHref ? routeMatchesCurrent2([effectiveHref]) : false;
3943
+ const hasSelector = (anchor == null ? void 0 : anchor.selector) && anchor.selector !== "*";
3944
+ const isFocusAction = isSamePage && hasSelector;
3945
+ const hasAction = !!effectiveHref || isFocusAction;
3946
+ const ctaLabel = isFocusAction ? "Focus \u2192" : external ? "Go \u2197" : "Go \u2192";
3947
+ const itemStyle = styleMap3({
3948
+ borderRadius: "var(--sc-content-border-radius, 8px)",
3949
+ overflow: "hidden",
3950
+ transition: "box-shadow 0.2s ease",
3951
+ backgroundColor: "var(--sc-content-background)",
3952
+ border: "var(--sc-content-border)",
3953
+ ...isExpanded ? {
3954
+ boxShadow: theme === "dark" ? "0 4px 12px rgba(0, 0, 0, 0.15)" : "0 4px 12px rgba(0, 0, 0, 0.08)"
3955
+ } : {},
3956
+ ...!isLast ? { borderBottom: "var(--sc-content-item-divider, none)" } : {}
3957
+ });
3958
+ const headerStyle = styleMap3({
3959
+ display: "flex",
3960
+ alignItems: "center",
3961
+ gap: "8px",
3962
+ width: "100%",
3963
+ padding: "var(--sc-content-item-padding, 12px 16px)",
3964
+ border: "none",
3965
+ cursor: "pointer",
3966
+ fontSize: "var(--sc-content-item-font-size, 15px)",
3967
+ fontWeight: "500",
3968
+ fontFamily: "inherit",
3969
+ textAlign: "left",
3970
+ transition: "background-color 0.15s ease",
3971
+ backgroundColor: isHovered ? "var(--sc-content-background-hover)" : "transparent",
3972
+ color: "var(--sc-content-text-color)"
3973
+ });
3974
+ const chevronStyle = styleMap3({
3975
+ fontSize: "20px",
3976
+ transition: "transform 0.2s ease",
3977
+ marginLeft: "auto",
3978
+ flexShrink: "0",
3979
+ color: "var(--sc-content-chevron-color, currentColor)",
3980
+ transform: isExpanded ? "rotate(90deg)" : "rotate(0deg)"
3981
+ });
3982
+ const bodyStyle = styleMap3({
3983
+ overflow: "hidden",
3984
+ transition: "max-height 0.25s ease, padding-bottom 0.25s ease",
3985
+ padding: "var(--sc-content-body-padding, 0 16px 12px 16px)",
3986
+ color: "var(--sc-content-text-secondary-color)",
3987
+ maxHeight: isExpanded ? "500px" : "0",
3988
+ paddingBottom: isExpanded ? "16px" : "0"
3989
+ });
3990
+ const descriptionStyle = styleMap3({
3991
+ fontSize: "var(--sc-content-body-font-size, 14px)",
3992
+ lineHeight: "1.5",
3993
+ margin: "0"
3994
+ });
3995
+ const linkButtonStyle = styleMap3({
3996
+ display: "inline-flex",
3997
+ alignItems: "center",
3998
+ gap: "4px",
3999
+ marginTop: "10px",
4000
+ padding: "6px 12px",
4001
+ borderRadius: "6px",
4002
+ textDecoration: "none",
4003
+ fontSize: "13px",
4004
+ fontWeight: "500",
4005
+ cursor: "pointer",
4006
+ border: "none",
4007
+ transition: "background-color 0.15s ease",
4008
+ backgroundColor: `var(--sc-color-primary, ${TOKEN_PURPLE_42})`,
4009
+ color: "#ffffff"
4010
+ });
4011
+ const iconStyle = styleMap3({
4012
+ fontSize: "16px",
4013
+ flexShrink: "0"
4014
+ });
4015
+ const onLinkClick = (e) => {
4016
+ e.preventDefault();
4017
+ e.stopPropagation();
4018
+ if (isFocusAction && anchor) {
4019
+ __classPrivateFieldGet2(this, _NavWidgetLit_instances, "m", _NavWidgetLit_handleFocusAnchor).call(this, anchor);
4020
+ } else if (effectiveHref) {
4021
+ __classPrivateFieldGet2(this, _NavWidgetLit_instances, "m", _NavWidgetLit_handleNavigate).call(this, effectiveHref, external != null ? external : false);
4022
+ }
4023
+ };
4024
+ return html3`
4025
+ <div
4026
+ style=${itemStyle}
4027
+ data-nav-tip-id=${id}
4028
+ >
4029
+ <button
4030
+ type="button"
4031
+ style=${headerStyle}
4032
+ aria-expanded=${isExpanded}
4033
+ @click=${() => __classPrivateFieldGet2(this, _NavWidgetLit_instances, "m", _NavWidgetLit_handleToggle).call(this, id)}
4034
+ @mouseenter=${() => {
4035
+ this._hoveredId = id;
4036
+ }}
4037
+ @mouseleave=${() => {
4038
+ this._hoveredId = null;
4039
+ }}
4040
+ >
4041
+ ${icon ? html3`<span style=${iconStyle}>${unsafeHTML2(renderIcon2(icon))}</span>` : nothing3}
4042
+ <span>${title}</span>
4043
+ <span style=${chevronStyle}>${"\u203A"}</span>
4044
+ </button>
4045
+ <div style=${bodyStyle} aria-hidden=${!isExpanded}>
4046
+ <p style=${descriptionStyle}>${description}</p>
4047
+ ${hasAction ? html3`
4048
+ <a
4049
+ href=${effectiveHref || "#"}
4050
+ style=${linkButtonStyle}
4051
+ target=${external ? "_blank" : nothing3}
4052
+ rel=${external ? "noopener noreferrer" : nothing3}
4053
+ @click=${onLinkClick}
4054
+ >${ctaLabel}</a>
4055
+ ` : nothing3}
4056
+ </div>
4057
+ </div>
4058
+ `;
4059
+ };
4060
+ NavWidgetLit.properties = {
4061
+ // Public inputs
4062
+ config: { attribute: false },
4063
+ runtime: { attribute: false },
4064
+ instanceId: { type: String },
4065
+ // Internal reactive state
4066
+ _expandedIds: { state: true },
4067
+ _renderTick: { state: true },
4068
+ _hoveredId: { state: true }
4069
+ };
4070
+
2826
4071
  // ../adaptives/adaptive-nav/dist/runtime.js
2827
4072
  var executeScrollTo = async (action, context) => {
2828
4073
  var _a2, _b, _c, _d;