@helpai/elements 0.9.3 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/elements-web-component.esm.js +26 -26
- package/elements-web-component.esm.js.map +4 -4
- package/elements.cjs.js +26 -26
- package/elements.cjs.js.map +4 -4
- package/elements.esm.js +27 -27
- package/elements.esm.js.map +4 -4
- package/elements.js +26 -26
- package/elements.js.map +4 -4
- package/index.mjs +697 -916
- package/package.json +1 -1
- package/style.css +1 -1
- package/web-component.mjs +697 -916
package/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
6
6
|
import { h, render } from "preact";
|
|
7
7
|
|
|
8
8
|
// src/ui/app.tsx
|
|
9
|
-
import { useCallback as
|
|
9
|
+
import { useCallback as useCallback6, useEffect as useEffect17, useMemo as useMemo3, useRef as useRef8, useState as useState11 } from "preact/hooks";
|
|
10
10
|
import { useSignal } from "@preact/signals";
|
|
11
11
|
|
|
12
12
|
// src/core/brand.ts
|
|
@@ -130,14 +130,6 @@ function isNestedShape(override) {
|
|
|
130
130
|
}
|
|
131
131
|
return false;
|
|
132
132
|
}
|
|
133
|
-
function localeDisplayName(target, displayInLocale) {
|
|
134
|
-
try {
|
|
135
|
-
const dn = new Intl.DisplayNames([displayInLocale], { type: "language" });
|
|
136
|
-
return dn.of(target) ?? target.toUpperCase();
|
|
137
|
-
} catch {
|
|
138
|
-
return target.toUpperCase();
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
133
|
|
|
142
134
|
// src/core/storage.ts
|
|
143
135
|
var LocalStorageAdapter = class {
|
|
@@ -741,7 +733,7 @@ var tokens_default = ':host{--__P__-accent: __BRAND_ACCENT__;--__P__-accent-text
|
|
|
741
733
|
var reset_default = '*,*:before,*:after{box-sizing:border-box;margin:0;padding:0;border:0}button{font:inherit;color:inherit;background:none;cursor:pointer;-webkit-appearance:none;appearance:none;line-height:1}button:focus-visible,[tabindex]:focus-visible,textarea:focus-visible,input:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}textarea,input{font:inherit;color:inherit;background:none;border:0;outline:0;resize:none}a{color:var(--__P__-accent);text-decoration:underline;text-underline-offset:2px}img,svg{display:block;max-width:100%}ul,ol{list-style:none}.__P__-app{display:block;width:100%;height:100%;font-family:var(--__P__-font);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-feature-settings:"cv11","ss01","ss03"}.__P__-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}\n';
|
|
742
734
|
|
|
743
735
|
// src/styles/panel.css
|
|
744
|
-
var panel_default = '.__P__-anchor{right:16px;bottom:16px}:host([data-position="bottom-left"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{right:auto;left:16px}:host([data-position="top-right"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{bottom:auto;top:16px}.__P__-anchor{position:fixed;display:flex;flex-direction:column;align-items:flex-end;gap:var(--__P__-space-3);pointer-events:none}.__P__-anchor{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=sm]{--__P__-fab-size: 44px}.__P__-anchor[data-launcher-size=md]{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=lg]{--__P__-fab-size: 68px}.__P__-anchor>*{pointer-events:auto}.__P__-fab[data-size=sm]{--__P__-fab-size: 44px;font-size:var(--__P__-text-sm)}.__P__-fab[data-size=md]{--__P__-fab-size: 56px;font-size:14px}.__P__-fab[data-size=lg]{--__P__-fab-size: 68px;font-size:var(--__P__-text-base)}.__P__-fab{display:inline-flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);color:var(--__P__-accent-text);background:var(--__P__-accent);box-shadow:var(--__P__-shadow-fab);font-weight:600;line-height:1;transform-origin:bottom right;animation:__P__-fab-in var(--__P__-dur-base) var(--__P__-ease) both;transition:transform var(--__P__-dur-base) var(--__P__-ease),opacity var(--__P__-dur-base) var(--__P__-ease),box-shadow var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab:hover{transform:translateY(-2px)}.__P__-fab:active{transform:translateY(0)}.__P__-fab:focus-visible{outline:2px solid var(--__P__-on-accent);outline-offset:3px}.__P__-fab svg{width:24px;height:24px;flex-shrink:0}@keyframes __P__-fab-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:none}}.__P__-fab[data-leaving]{position:absolute;right:0;bottom:0;animation:__P__-fab-out var(--__P__-dur-quick) var(--__P__-ease) forwards;pointer-events:none}:host([data-position^="top-"]) .__P__-fab[data-leaving]{bottom:auto;top:0}:host([data-position$="-left"]) .__P__-fab[data-leaving]{right:auto;left:0}@keyframes __P__-fab-out{0%{opacity:1;transform:none}to{opacity:0;transform:scale(.85)}}.__P__-fab[data-variant=circle]{width:var(--__P__-fab-size);height:var(--__P__-fab-size);border-radius:999px}.__P__-fab[data-variant=circle] .__P__-fab-label{display:none}.__P__-fab[data-variant=pill]{height:var(--__P__-fab-size);padding:0 18px 0 16px;border-radius:999px}.__P__-fab[data-variant=bar]{height:var(--__P__-fab-size);padding:0 22px;border-radius:var(--__P__-radius)}.__P__-fab[data-variant=minimal]{height:var(--__P__-fab-size);padding:0 var(--__P__-space-4);border-radius:999px;background:transparent;color:var(--__P__-accent);box-shadow:none;border:1px solid currentColor}.__P__-fab[data-variant=minimal]:hover{background:color-mix(in srgb,var(--__P__-accent) 12%,transparent)}.__P__-callout{--__P__-callout-fab-h: var(--__P__-fab-size, 56px);--__P__-callout-gap: clamp(12px, calc(var(--__P__-callout-fab-h) * .25), 22px);--__P__-callout-nudge-direction: -1;position:absolute;display:inline-flex;align-items:center;gap:var(--__P__-space-2);padding:10px 14px;background:var(--__P__-fg);color:var(--__P__-bg);border-radius:999px;font-size:var(--__P__-text-sm);font-weight:600;line-height:1.2;box-shadow:0 10px 30px -8px #00000059;pointer-events:auto;animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease);z-index:1;max-width:240px;white-space:nowrap}.__P__-callout[data-position=left]{right:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%)}.__P__-callout[data-position=right]{left:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%);--__P__-callout-nudge-direction: 1}.__P__-callout[data-position=top]{bottom:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-position=bottom]{top:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}:host([data-position$="-left"]) .__P__-callout[data-position=top],:host([data-position$="-left"]) .__P__-callout[data-position=bottom]{right:auto;left:0}.__P__-callout[data-shape=bubble]{border-radius:var(--__P__-radius-md);white-space:normal;width:max-content;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-shape=callout]{padding:12px 18px;font-size:14px;background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-callout:after{content:"";position:absolute;width:12px;height:12px;background:inherit;border-radius:2px;transform:rotate(45deg)}.__P__-callout[data-position=left]:after{right:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=right]:after{left:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=top]:after{bottom:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-position=bottom]:after{top:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}:host([data-position$="-left"]) .__P__-callout[data-position=top]:after,:host([data-position$="-left"]) .__P__-callout[data-position=bottom]:after{right:auto;left:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-animated]{animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease),__P__-callout-nudge 1.6s var(--__P__-ease-in-out) var(--__P__-dur-slow) infinite}@keyframes __P__-callout-in{0%{opacity:0}to{opacity:1}}@keyframes __P__-callout-nudge{0%,to{margin-left:0;margin-right:0}50%{margin-left:calc(6px * var(--__P__-callout-nudge-direction));margin-right:calc(-6px * var(--__P__-callout-nudge-direction))}}@media(prefers-reduced-motion:reduce){.__P__-callout[data-animated]{animation:__P__-callout-in 1ms var(--__P__-ease)}.__P__-icon-btn[data-recording=true],.__P__-typing span{animation:none}}.__P__-callout-close{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:999px;color:inherit;opacity:.7;cursor:pointer}.__P__-callout-close:hover{opacity:1;background:#ffffff26}.__P__-callout-close svg{width:12px;height:12px}.__P__-panel{width:var(--__P__-panel-w);height:var(--__P__-panel-h);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);background:var(--__P__-bg);color:var(--__P__-fg);border-radius:var(--__P__-radius-lg);box-shadow:var(--__P__-shadow-panel);display:flex;flex-direction:column;overflow:hidden;transform-origin:bottom right;animation:__P__-panel-in var(--__P__-dur-slow) var(--__P__-ease);border:1px solid var(--__P__-border)}:host([data-mode="open"]) .__P__-panel{width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));min-width:var(--__P__-resize-min-w, auto);min-height:var(--__P__-resize-min-h, auto);max-width:var(--__P__-resize-max-w, calc(100vw - 32px) );max-height:var(--__P__-resize-max-h, calc(100dvh - 32px) )}@keyframes __P__-panel-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}:host([data-mode="expanded"]) .__P__-panel{width:var(--__P__-expanded-w, 640px);height:var(--__P__-expanded-h, 820px);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px)}:host([data-mode="fullscreen"]){z-index:var(--__P__-z-panel)!important}:host([data-mode="fullscreen"]) .__P__-anchor{inset:0;align-items:stretch;padding:0}:host([data-mode="fullscreen"]) .__P__-panel{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0;border:0}:host([data-mode="fullscreen"]) .__P__-fab{display:none}:host([data-mode="inline"]) .__P__-anchor,:host([data-mode="standalone"]) .__P__-anchor{position:static;inset:auto;padding:0;align-items:stretch;width:100%;height:100%;min-height:0}:host([data-mode="inline"]) .__P__-panel,:host([data-mode="standalone"]) .__P__-panel{width:100%;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;animation:none}:host([data-mode="inline"]) .__P__-fab,:host([data-mode="standalone"]) .__P__-fab{display:none}:host([data-mode="inline"]){min-height:320px}:host([data-mode="inline"]) .__P__-panel{border-radius:var(--__P__-radius)}:host([data-mode="standalone"]) .__P__-panel{border-radius:0;border:0;box-shadow:none}:host([data-mode="modal"]){position:fixed!important;inset:0!important;z-index:var(--__P__-z-panel)!important;display:block!important;width:100vw;height:100dvh;background:var(--__P__-modal-backdrop, var(--__P__-backdrop));animation:__P__-backdrop-in var(--__P__-dur-base) var(--__P__-ease) both;--__P__-panel-w: min(960px, 92vw);--__P__-panel-h: min(720px, 88dvh)}:host([data-mode="modal"]) .__P__-anchor{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:var(--__P__-space-6);pointer-events:none}:host([data-mode="modal"]) .__P__-panel{pointer-events:auto;width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));max-width:calc(100vw - 48px);max-height:calc(100dvh - 48px);min-width:0;min-height:0;border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-panel);animation:__P__-modal-in var(--__P__-dur-base) var(--__P__-ease);translate:var(--__P__-modal-dx, 0px) var(--__P__-modal-dy, 0px)}:host([data-mode="modal"]) .__P__-header,:host([data-mode="modal"]) .__P__-back-header,:host([data-mode="modal"]) .__P__-home-hero{cursor:grab;touch-action:none}:host([data-mode="modal"]) .__P__-panel[data-dragging]{cursor:grabbing;user-select:none}:host([data-mode="modal"]) .__P__-panel[data-dragging] *{cursor:grabbing}:host([data-mode="modal"]) .__P__-fab{display:none}@keyframes __P__-backdrop-in{0%{background:#0000}to{background:var(--__P__-modal-backdrop, var(--__P__-backdrop))}}@keyframes __P__-modal-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}:host([data-mode="drawer"]){--__P__-panel-w: min(440px, calc(100vw - 32px) );--__P__-panel-h: 100dvh}:host([data-mode="drawer"]) .__P__-anchor{position:fixed;--__P__-inset-x: var(--__P__-panel-inset, 12px);--__P__-inset-y: var(--__P__-panel-inset, 3dvh);top:var(--__P__-inset-y);bottom:auto;right:var(--__P__-inset-x);left:auto;width:min(var(--__P__-widget-w, var(--__P__-panel-w)),calc(100vw - var(--__P__-inset-x) * 2));height:min(var(--__P__-widget-h, var(--__P__-panel-h)),calc(100dvh - var(--__P__-inset-y) * 2));padding:0;display:block;pointer-events:auto}:host([data-mode="drawer"][data-position$="-left"]) .__P__-anchor{right:auto;left:var(--__P__-inset-x)}:host([data-mode="drawer"][data-position^="bottom-"]) .__P__-anchor{top:auto;bottom:var(--__P__-inset-y)}:host([data-mode="drawer"]) .__P__-panel{width:100%;height:100%;max-width:none;max-height:none;min-width:0;min-height:0;border-radius:var(--__P__-radius, 12px);border:1px solid var(--__P__-border);box-shadow:-8px 16px 32px -12px #00000038;animation:__P__-drawer-in var(--__P__-dur-base) var(--__P__-ease)}:host([data-mode="drawer"][data-position$="-left"]) .__P__-panel{box-shadow:8px 16px 32px -12px #00000038;animation:__P__-drawer-in-left var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab[data-edge-tab]{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-2);position:fixed;top:50%;height:140px;width:auto;min-width:0;padding:10px 8px;writing-mode:vertical-rl;text-orientation:mixed;transform:translateY(-50%);transform-origin:center;animation:__P__-edge-tab-in var(--__P__-dur-base) var(--__P__-ease) both}.__P__-fab[data-edge-tab] svg{writing-mode:horizontal-tb}.__P__-fab[data-edge-tab]:hover{transform:translateY(-50%) scale(1.03)}.__P__-fab[data-edge-tab]:active{transform:translateY(-50%) scale(.97)}:host([data-position$="-right"]) .__P__-fab[data-edge-tab]{right:0;left:auto;border-radius:12px 0 0 12px;box-shadow:-6px 0 18px -8px #0000004d}:host([data-position$="-left"]) .__P__-fab[data-edge-tab]{left:0;right:auto;border-radius:0 12px 12px 0;box-shadow:6px 0 18px -8px #0000004d}.__P__-fab[data-edge-tab][data-leaving]{position:fixed;top:50%;bottom:auto;animation:__P__-edge-tab-out var(--__P__-dur-quick) var(--__P__-ease) forwards}@keyframes __P__-edge-tab-in{0%{opacity:0;transform:translateY(-50%) scale(.9)}to{opacity:1;transform:translateY(-50%) scale(1)}}@keyframes __P__-edge-tab-out{0%{opacity:1;transform:translateY(-50%) scale(1)}to{opacity:0;transform:translateY(-50%) scale(.85)}}@keyframes __P__-drawer-in{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes __P__-drawer-in-left{0%{transform:translate(-100%)}to{transform:translate(0)}}@media(prefers-reduced-motion:reduce){:host([data-mode="drawer"]) .__P__-panel,.__P__-fab[data-edge-tab]{animation:none}}.__P__-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:12px 14px;border-bottom:1px solid var(--__P__-border);background:var(--__P__-bg)}.__P__-header h1{font-size:14px;font-weight:600;flex:1;letter-spacing:-.01em}.__P__-agent{flex:1;display:inline-flex;align-items:center;gap:10px;min-width:0}.__P__-agent-avatar{position:relative;width:32px;height:32px;border-radius:999px;background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:var(--__P__-text-xs);overflow:hidden;flex-shrink:0}.__P__-agent-avatar img{width:100%;height:100%;object-fit:cover}.__P__-agent-avatar:after{content:"";position:absolute;right:-1px;bottom:-1px;width:10px;height:10px;border-radius:999px;border:2px solid var(--__P__-bg);background:var(--__P__-neutral)}.__P__-agent-avatar[data-status=online]:after{background:var(--__P__-success)}.__P__-agent-avatar[data-status=away]:after{background:var(--__P__-warning)}.__P__-agent-avatar[data-status=offline]:after{background:var(--__P__-neutral)}.__P__-agent-meta{display:flex;flex-direction:column;line-height:1.15;min-width:0}.__P__-agent-meta strong{font-size:14px;font-weight:600;letter-spacing:-.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-agent-meta span{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-suggestions{display:flex;flex-wrap:nowrap;gap:var(--__P__-space-2);padding:6px 14px 10px;overflow-x:auto;overflow-y:hidden;scroll-behavior:smooth;scroll-snap-type:x proximity;scrollbar-width:none;-ms-overflow-style:none;min-width:0}.__P__-suggestions::-webkit-scrollbar{display:none}.__P__-suggestions:before,.__P__-suggestions:after{content:"";flex:1 1 0;min-width:0}.__P__-suggestion{flex:0 0 auto;scroll-snap-align:center;padding:7px 14px;border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg);font-size:var(--__P__-text-sm);font-weight:500;white-space:nowrap;transition:background var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-suggestion:hover{border-color:var(--__P__-accent);color:var(--__P__-accent);transform:translateY(-1px)}.__P__-suggestion:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px;border-color:var(--__P__-accent)}.__P__-suggestion:active{transform:translateY(0)}.__P__-icon-btn{width:32px;height:32px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);transition:background var(--__P__-dur-quick) var(--__P__-ease),color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-icon-btn:hover{background:var(--__P__-bg-elevated);color:var(--__P__-fg)}.__P__-icon-btn:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-icon-btn:active{background:var(--__P__-border)}.__P__-icon-btn:disabled{opacity:.45;cursor:not-allowed}.__P__-icon-btn:before{content:"";position:absolute;inset:-6px}.__P__-icon-btn{position:relative}.__P__-icon-btn svg{width:18px;height:18px}.__P__-icon-btn[data-recording=true]{color:var(--__P__-accent);background:color-mix(in srgb,var(--__P__-accent) 12%,transparent);animation:__P__-pulse 1.2s var(--__P__-ease) infinite}@keyframes __P__-pulse{0%,to{box-shadow:0 0 color-mix(in srgb,var(--__P__-accent) 40%,transparent)}50%{box-shadow:0 0 0 6px color-mix(in srgb,var(--__P__-accent) 0%,transparent)}}.__P__-list{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-4);padding-bottom:var(--__P__-space-8);display:flex;flex-direction:column;gap:14px;scrollbar-width:thin;scrollbar-color:var(--__P__-border-strong) transparent;scrollbar-gutter:stable}.__P__-list::-webkit-scrollbar{width:8px}.__P__-list::-webkit-scrollbar-thumb{background:var(--__P__-border-strong);border-radius:8px}.__P__-bubble-row{display:flex}.__P__-bubble-row[data-role=user]{justify-content:flex-end}.__P__-bubble-row[data-role=assistant]{justify-content:flex-start}.__P__-bubble{max-width:85%;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);line-height:1.6;font-size:14px;word-wrap:break-word;overflow-wrap:anywhere;box-shadow:0 1px 2px #0000000a,0 1px 8px -4px #0000000f;animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-bubble ::selection{background:color-mix(in srgb,var(--__P__-accent) 30%,transparent)}@keyframes __P__-bubble-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.__P__-bubble-row[data-role=user] .__P__-bubble{background:var(--__P__-bubble-user);color:var(--__P__-bubble-user-text);border-bottom-right-radius:var(--__P__-radius-sm)}.__P__-bubble-row[data-role=assistant] .__P__-bubble{background:var(--__P__-bubble-assistant);color:var(--__P__-bubble-assistant-text);border-bottom-left-radius:var(--__P__-radius-sm)}.__P__-md>*:first-child{margin-top:0}.__P__-md>*:last-child{margin-bottom:0}.__P__-md p{margin:10px 0}.__P__-md h1,.__P__-md h2,.__P__-md h3,.__P__-md h4,.__P__-md h5,.__P__-md h6{margin:18px 0 8px;line-height:1.3;letter-spacing:-.01em;font-weight:700}.__P__-md h1{font-size:1.4em}.__P__-md h2{font-size:1.22em}.__P__-md h3{font-size:1.08em}.__P__-md h4,.__P__-md h5,.__P__-md h6{font-size:1em}.__P__-md>h1:first-child,.__P__-md>h2:first-child,.__P__-md>h3:first-child,.__P__-md>h4:first-child,.__P__-md>h5:first-child,.__P__-md>h6:first-child{margin-top:0}.__P__-md ul,.__P__-md ol{padding-left:1.5em;margin:10px 0}.__P__-md ul{list-style:disc}.__P__-md ol{list-style:decimal}.__P__-md li{margin:6px 0;padding-left:2px}.__P__-md li::marker{color:var(--__P__-fg-muted)}.__P__-md li>p{margin:6px 0}.__P__-md li>ul,.__P__-md li>ol{margin:6px 0}.__P__-md strong,.__P__-md b{font-weight:650;letter-spacing:-.005em}.__P__-md em,.__P__-md i{font-style:italic}.__P__-md code{font-family:var(--__P__-font-mono);font-size:.86em;padding:1px 6px;border-radius:5px;background:color-mix(in srgb,var(--__P__-accent) 10%,transparent);color:var(--__P__-fg);border:1px solid color-mix(in srgb,var(--__P__-accent) 16%,transparent)}.__P__-md pre{font-family:var(--__P__-font-mono);font-size:12.5px;padding:12px 14px;border-radius:var(--__P__-radius-sm);background:#7f7f7f1f;overflow-x:auto;margin:var(--__P__-space-3) 0;line-height:1.5}.__P__-md pre code{padding:0;background:none}.__P__-md a{color:inherit;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}.__P__-md a:hover{text-decoration-thickness:2px}.__P__-md blockquote{margin:14px 0;padding:6px 14px;border-left:3px solid color-mix(in srgb,var(--__P__-accent) 50%,transparent);background:color-mix(in srgb,var(--__P__-accent) 5%,transparent);border-radius:0 var(--__P__-radius-sm) var(--__P__-radius-sm) 0;color:var(--__P__-fg-muted)}.__P__-md blockquote>:first-child{margin-top:0}.__P__-md blockquote>:last-child{margin-bottom:0}.__P__-md hr{border:0;height:1px;background:color-mix(in srgb,currentColor 18%,transparent);margin:var(--__P__-space-4) 0}.__P__-md table{border-collapse:collapse;margin:var(--__P__-space-3) 0;font-size:.95em;display:block;overflow-x:auto;max-width:100%;font-variant-numeric:tabular-nums}.__P__-md th,.__P__-md td{padding:6px 10px;border-bottom:1px solid color-mix(in srgb,currentColor 12%,transparent);text-align:left}.__P__-md th{font-weight:700;background:color-mix(in srgb,currentColor 6%,transparent)}.__P__-md h1+ul,.__P__-md h1+ol,.__P__-md h2+ul,.__P__-md h2+ol,.__P__-md h3+ul,.__P__-md h3+ol,.__P__-md h4+ul,.__P__-md h4+ol{margin-top:var(--__P__-space-1)}.__P__-loading{display:inline-flex;align-items:center;gap:var(--__P__-space-2);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-loading-spinner{width:14px;height:14px;border-radius:999px;border:2px solid currentColor;border-top-color:transparent;animation:__P__-spin .8s linear infinite}@keyframes __P__-spin{to{transform:rotate(1turn)}}.__P__-typing{display:inline-flex;gap:var(--__P__-space-1);padding:var(--__P__-space-1) 0}.__P__-typing span{width:6px;height:6px;border-radius:999px;background:currentColor;opacity:.4;animation:__P__-blink 1.2s var(--__P__-ease) infinite}.__P__-typing span:nth-child(2){animation-delay:.2s}.__P__-typing span:nth-child(3){animation-delay:.4s}@keyframes __P__-blink{0%,80%,to{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-2px)}}.__P__-reasoning{margin:var(--__P__-space-1) 0 var(--__P__-space-2);padding-left:var(--__P__-space-3);border-left:2px solid var(--__P__-border-strong)}.__P__-reasoning-summary{display:inline-flex;align-items:center;gap:var(--__P__-space-1);cursor:pointer;list-style:none;user-select:none;color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-reasoning-summary::-webkit-details-marker{display:none}.__P__-reasoning-summary:before{content:"";width:5px;height:5px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(-45deg);opacity:.7;transition:transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-reasoning[open] .__P__-reasoning-summary:before{transform:rotate(45deg)}.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:__P__-reasoning-pulse 1.4s var(--__P__-ease) infinite}@keyframes __P__-reasoning-pulse{0%,to{opacity:.5}50%{opacity:1}}@media(prefers-reduced-motion:reduce){.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:none}}.__P__-reasoning-body{margin-top:var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-reasoning-body>:first-child{margin-top:0}.__P__-reasoning-body>:last-child{margin-bottom:0}.__P__-tool-chip{display:inline-flex;align-items:center;gap:6px;padding:var(--__P__-space-1) var(--__P__-space-2);margin-top:6px;border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs)}.__P__-composer{border-top:1px solid var(--__P__-border);padding:10px 12px;background:var(--__P__-bg);display:flex;flex-direction:column;gap:var(--__P__-space-2)}.__P__-composer-row{display:flex;align-items:flex-end;gap:6px}.__P__-textarea{flex:1;height:40px;max-height:160px;padding:10px 12px;border-radius:var(--__P__-radius);background:var(--__P__-bg-elevated);border:1px solid transparent;font-size:14px;line-height:1.4;transition:height var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),box-shadow var(--__P__-dur-quick) var(--__P__-ease)}.__P__-textarea:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:1px;border-color:var(--__P__-focus)}@media(pointer:coarse){.__P__-textarea,.__P__-home-search-input{font-size:16px}.__P__-textarea{height:44px}}.__P__-send{width:40px;height:40px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease),background var(--__P__-dur-quick) var(--__P__-ease)}.__P__-send[data-shape=circle]{border-radius:999px}.__P__-send[data-shape=square]{border-radius:var(--__P__-radius-sm)}.__P__-send[data-shape=pill]{width:auto;padding:0 18px;border-radius:999px}.__P__-send[data-variant=filled]{background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-send[data-variant=outline]{background:transparent;color:var(--__P__-accent);border-color:var(--__P__-accent)}.__P__-send[data-variant=outline]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 10%,transparent)}.__P__-send[data-variant=ghost]{background:transparent;color:var(--__P__-accent)}.__P__-send[data-variant=ghost]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 8%,transparent)}.__P__-send:disabled{opacity:.4;cursor:not-allowed}.__P__-send:not(:disabled):hover{transform:translateY(-1px)}.__P__-send:not(:disabled):active{transform:translateY(0)}.__P__-send:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-send svg{width:18px;height:18px}.__P__-composer-actions{display:flex;gap:var(--__P__-space-1);flex-wrap:wrap}.__P__-attachments{display:flex;flex-wrap:wrap;gap:6px}.__P__-attachment-chip{display:inline-flex;align-items:center;gap:6px;padding:var(--__P__-space-1) var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-1);border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);font-size:var(--__P__-text-xs);max-width:200px}.__P__-attachment-thumb{width:24px;height:24px;border-radius:999px;object-fit:cover;background:var(--__P__-border)}.__P__-attachment-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-attachment-remove{width:18px;height:18px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted)}.__P__-attachment-remove:hover{background:var(--__P__-border);color:var(--__P__-fg)}.__P__-dropzone{position:absolute;inset:8px;border:2px dashed var(--__P__-accent);border-radius:var(--__P__-radius);background:color-mix(in srgb,var(--__P__-accent) 8%,transparent);display:flex;align-items:center;justify-content:center;font-weight:600;color:var(--__P__-accent);pointer-events:none;z-index:10;animation:__P__-fade-in var(--__P__-dur-quick) var(--__P__-ease)}@keyframes __P__-fade-in{0%{opacity:0}to{opacity:1}}.__P__-error{margin-top:var(--__P__-space-1);padding:8px 10px;border-radius:var(--__P__-radius-sm);background:var(--__P__-danger-bg);color:var(--__P__-danger-text);font-size:var(--__P__-text-sm);display:flex;align-items:center;gap:var(--__P__-space-2)}.__P__-error button{color:inherit;text-decoration:underline;font-size:var(--__P__-text-sm)}.__P__-history{flex:1;overflow-y:auto;padding:var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-3)}.__P__-history-footer{flex:none;padding:var(--__P__-space-2) var(--__P__-space-3) var(--__P__-space-3);border-top:1px solid var(--__P__-border);background:var(--__P__-surface)}.__P__-history-new{width:100%;display:flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);padding:var(--__P__-space-2) var(--__P__-space-3);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-on-accent);cursor:pointer;font-size:var(--__P__-text-sm);font-weight:600;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-history-new svg{width:16px;height:16px}.__P__-history-new:hover{filter:brightness(1.08)}.__P__-history-new:active{transform:translateY(1px)}.__P__-history-new:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-history-empty{flex:1;display:flex;align-items:center;justify-content:center;padding:40px 16px;color:var(--__P__-fg-muted);font-size:14px;text-align:center}.__P__-history-group{display:flex;flex-direction:column;padding:0 var(--__P__-space-2)}.__P__-history-heading{font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);padding:12px 8px 6px;text-transform:uppercase;letter-spacing:.04em}.__P__-history-item{all:unset;display:flex;flex-direction:column;gap:3px;padding:10px 12px;border-radius:var(--__P__-radius-md);cursor:pointer;transition:background var(--__P__-dur-base) var(--__P__-ease)}.__P__-history-item:hover{background:var(--__P__-bg-elevated)}.__P__-history-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-history-title{font-size:14px;font-weight:500;color:var(--__P__-fg);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-preview{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-item[data-closed=true] .__P__-history-title:after{content:"\\2022";margin-left:var(--__P__-space-2);opacity:.5}.__P__-list-loading{margin:auto;padding:var(--__P__-space-6) var(--__P__-space-4);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);text-align:center}.__P__-readonly-banner{display:flex;flex-direction:column;align-items:center;gap:10px;padding:14px 12px;margin:0 var(--__P__-space-3) var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);text-align:center;font-size:var(--__P__-text-sm)}.__P__-readonly-label{line-height:1.4}.__P__-readonly-cta{appearance:none;border:0;cursor:pointer;padding:var(--__P__-space-2) var(--__P__-space-4);border-radius:999px;background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-readonly-cta:hover,.__P__-readonly-cta:focus-visible{filter:brightness(1.1)}.__P__-readonly-cta:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}.__P__-composer-footer{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:10px 16px;margin:0 var(--__P__-space-3);border-top:1px solid var(--__P__-border);text-align:center;font-size:11px;line-height:1.4;color:var(--__P__-fg-muted)}.__P__-disclaimer{max-width:320px;margin:0 auto;opacity:.9;letter-spacing:.01em}.__P__-poweredby{display:inline-flex;align-items:center;justify-content:center;gap:6px;color:inherit;text-decoration:none;opacity:.7;transition:opacity var(--__P__-dur-base) var(--__P__-ease);font-size:11px;letter-spacing:.02em}.__P__-poweredby:hover{opacity:1}.__P__-poweredby-logo{height:12px;width:auto;display:inline-block;vertical-align:middle}.__P__-poweredby-bar{flex:none;display:flex;align-items:center;justify-content:center;padding:6px 16px;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated)}.__P__-menu-wrap{position:relative;display:inline-flex}.__P__-menu{position:absolute;top:100%;right:0;margin-top:6px;min-width:200px;padding:6px;background:var(--__P__-bg);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);box-shadow:var(--__P__-shadow-panel);z-index:10;display:flex;flex-direction:column;gap:2px;animation:__P__-menu-in var(--__P__-dur-base) var(--__P__-ease)}@media(prefers-reduced-motion:reduce){.__P__-menu{animation:none}}@keyframes __P__-menu-in{0%{opacity:0;transform:translateY(-4px) scale(.98);transform-origin:top right}to{opacity:1;transform:none}}.__P__-menu-item{all:unset;display:flex;align-items:center;gap:10px;padding:8px 10px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);border-radius:var(--__P__-radius-sm);cursor:pointer;user-select:none}.__P__-menu-item:hover{background:var(--__P__-bg-elevated)}.__P__-menu-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-menu-item[disabled]{opacity:.45;cursor:not-allowed}.__P__-menu-icon{display:inline-flex;width:16px;height:16px;color:var(--__P__-fg-muted)}.__P__-menu-icon svg{width:16px;height:16px}.__P__-menu-label{flex:1}.__P__-menu-check{display:inline-flex;color:var(--__P__-accent)}.__P__-menu-check svg{width:14px;height:14px}.__P__-resize-grip{position:absolute;width:18px;height:18px;display:flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);opacity:.45;transition:opacity var(--__P__-dur-base) var(--__P__-ease);z-index:2;touch-action:none;user-select:none}.__P__-resize-grip:hover,.__P__-resize-grip:focus-visible{opacity:1}.__P__-resize-grip svg{width:10px;height:10px}.__P__-resize-grip--bottom-left{bottom:2px;left:2px;cursor:nesw-resize;transform:scaleX(-1)}.__P__-resize-grip--bottom-right{bottom:2px;right:2px;cursor:nwse-resize}.__P__-resize-grip--top-left{top:2px;left:2px;cursor:nwse-resize;transform:rotate(180deg)}.__P__-resize-grip--top-right{top:2px;right:2px;cursor:nesw-resize;transform:scaleY(-1)}:host(:not([data-mode="open"])) .__P__-resize-grip{display:none}.__P__-messenger{display:flex;flex-direction:column;overflow:hidden}.__P__-messenger-body{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.__P__-module{display:flex;flex-direction:column;height:100%;min-height:0}.__P__-module-scroll{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-3);display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-home{background:radial-gradient(125% 65% at 88% 0%,color-mix(in srgb,#fff 16%,transparent),transparent 55%),linear-gradient(180deg,var(--__P__-accent) 0%,var(--__P__-accent) 22%,color-mix(in srgb,var(--__P__-accent) 28%,var(--__P__-surface)) 44%,var(--__P__-surface) 70%);border-radius:var(--__P__-radius-lg) var(--__P__-radius-lg) 0 0}.__P__-home-scroll{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;background:transparent}.__P__-home-cards{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:4px 14px 16px}.__P__-module-pad{padding:var(--__P__-space-3) var(--__P__-space-3) 0}.__P__-module-empty{display:flex;flex-direction:column;align-items:center;gap:var(--__P__-space-3);padding:var(--__P__-space-8) var(--__P__-space-4);text-align:center;color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}.__P__-module-retry{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border-strong);border-radius:var(--__P__-radius-sm);color:var(--__P__-fg);font-weight:600;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-module-retry:hover{background:var(--__P__-hover);border-color:var(--__P__-accent)}.__P__-module-retry:active{background:var(--__P__-border)}.__P__-module-retry:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-help-list{flex:1;min-height:0;overflow-y:auto;padding-bottom:var(--__P__-space-3)}.__P__-help-group{display:flex;flex-direction:column}.__P__-help-section-title{position:sticky;top:0;z-index:1;margin:0;padding:var(--__P__-space-3) var(--__P__-space-5) var(--__P__-space-2);font-size:var(--__P__-text-xs);font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--__P__-fg-muted);background:var(--__P__-bg)}.__P__-help-card{margin:0 var(--__P__-space-3) var(--__P__-space-3);background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden}.__P__-help-card .__P__-list-row{border-bottom:0;border-radius:0}.__P__-help-card .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-help-card .__P__-list-row:hover{background:var(--__P__-hover)}.__P__-module-cta{padding:var(--__P__-space-3);border-top:1px solid var(--__P__-border)}.__P__-tabbar{display:flex;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);flex-shrink:0}.__P__-tab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-1);min-height:48px;padding:var(--__P__-space-2) var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600;transition:color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-tab:hover{color:var(--__P__-fg)}.__P__-tab[aria-selected=true]{color:var(--__P__-accent)}.__P__-tab:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-tab:active{background:var(--__P__-hover)}.__P__-tab-icon{position:relative;display:inline-flex}.__P__-tab-icon svg{width:22px;height:22px}.__P__-tab-badge{position:absolute;top:-4px;left:calc(50% + 6px);min-width:16px;height:16px;padding:0 4px;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:var(--__P__-accent);color:var(--__P__-on-accent);font-size:10px;font-weight:600;line-height:1}.__P__-home-hero{flex-shrink:0;padding:var(--__P__-space-5) var(--__P__-space-5) var(--__P__-space-3);color:var(--__P__-on-accent);--__P__-focus: var(--__P__-on-accent)}.__P__-home-hero-top{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-3);min-height:32px}.__P__-home-brand{font-size:14px;font-weight:600;letter-spacing:.01em;color:color-mix(in srgb,#fff 82%,transparent);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.__P__-home-brand-spacer{flex:1}.__P__-home-hero-actions{display:flex;align-items:center;gap:var(--__P__-space-2);flex-shrink:0}.__P__-home-close{color:#fff}.__P__-home-greeting{margin:28px 0 0;font-family:var(--__P__-font-display);font-size:var(--__P__-text-2xl);font-weight:800;line-height:1.18;letter-spacing:-.01em;overflow-wrap:anywhere}.__P__-home-lead{margin:2px 0 0;font-family:var(--__P__-font-display);font-size:var(--__P__-text-2xl);font-weight:800;line-height:1.18;letter-spacing:-.01em;color:color-mix(in srgb,var(--__P__-on-accent) 88%,transparent);overflow-wrap:anywhere}.__P__-home-avatars{display:flex}.__P__-home-avatar{width:30px;height:30px;border-radius:999px;overflow:hidden;margin-left:-10px;border:2px solid color-mix(in srgb,#fff 92%,transparent);box-shadow:0 1px 3px #0000002e;background:var(--__P__-surface);display:inline-flex;align-items:center;justify-content:center;font-size:var(--__P__-text-xs);font-weight:700;color:var(--__P__-fg)}.__P__-home-avatar:first-child{margin-left:0}.__P__-home-avatar img{width:100%;height:100%;object-fit:cover}.__P__-home-content{background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-card);overflow:hidden}.__P__-home-content-title{padding:var(--__P__-space-4) var(--__P__-space-4) var(--__P__-space-3);font-size:var(--__P__-text-sm);font-weight:700}.__P__-home-content-list{display:flex;flex-direction:column;padding:0 var(--__P__-space-2) var(--__P__-space-2)}.__P__-home-content-list .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-home-card{display:block;width:100%;text-align:left;background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);padding:var(--__P__-space-4);box-shadow:var(--__P__-shadow-card)}.__P__-home-card[data-interactive=true]{cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-home-card[data-interactive=true]:hover{background:var(--__P__-bg-elevated)}.__P__-home-card[data-interactive=true]:active{transform:translateY(1px)}.__P__-home-card[data-interactive=true]:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-recent-row{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-recent-avatar{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;flex-shrink:0;border-radius:999px;background:color-mix(in oklch,var(--__P__-accent) 14%,transparent);color:var(--__P__-accent)}.__P__-home-recent-avatar svg{width:20px;height:20px}.__P__-home-recent-body{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}.__P__-home-recent-title{font-weight:600;font-size:14px}.__P__-home-recent-preview{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-home-recent-at{color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);flex-shrink:0}.__P__-home-recent-dot{width:8px;height:8px;border-radius:999px;background:var(--__P__-accent);flex-shrink:0}.__P__-home-recent-row[data-unread=true] .__P__-home-recent-title{font-weight:700}.__P__-home-status{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-status-icon svg{width:22px;height:22px;color:var(--__P__-success)}.__P__-home-status[data-level=degraded] .__P__-home-status-icon svg{color:var(--__P__-warning)}.__P__-home-status[data-level=down] .__P__-home-status-icon svg{color:var(--__P__-danger)}.__P__-home-status-text{font-weight:600;font-size:14px}.__P__-home-search{display:flex;align-items:center;gap:var(--__P__-space-2);width:100%;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);border:1px solid var(--__P__-border);background:var(--__P__-surface);text-align:left}.__P__-home-search[data-input=true]{background:var(--__P__-bg-elevated)}.__P__-home-search:hover{border-color:var(--__P__-border-strong)}.__P__-home-search:focus-visible,.__P__-home-search:focus-within{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-search-text{flex:1;color:var(--__P__-fg-muted);font-size:14px}.__P__-home-search-input{flex:1;border:0;background:transparent;font-size:14px;color:var(--__P__-fg);outline:none}.__P__-home-search-icon svg{width:18px;height:18px;color:var(--__P__-accent)}.__P__-list-row{display:flex;align-items:center;gap:var(--__P__-space-3);width:100%;min-height:44px;text-align:left;padding:var(--__P__-space-3) var(--__P__-space-2);border-radius:var(--__P__-radius-sm)}.__P__-list-row:hover{background:var(--__P__-bg-elevated)}.__P__-list-row:active{background:var(--__P__-border)}.__P__-list-row:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-list-row-body{display:flex;flex-direction:column;min-width:0;flex:1}.__P__-list-row-title{font-weight:600;font-size:var(--__P__-text-md);line-height:1.35}.__P__-list-row-sub{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);margin-top:var(--__P__-space-1);line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-list-row-chevron svg{width:18px;height:18px;color:var(--__P__-accent);flex-shrink:0}.__P__-back-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:10px 12px;border-bottom:1px solid var(--__P__-border);flex-shrink:0}.__P__-back-title{flex:1;text-align:center;font-size:var(--__P__-text-md);font-weight:700;margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-back-spacer{width:32px;height:1px}.__P__-content{display:flex;flex-direction:column;gap:14px;width:100%;max-width:68ch;margin:0 auto}.__P__-content-hero{width:100%;border-radius:var(--__P__-radius)}.__P__-content-subtitle{color:var(--__P__-fg-muted);margin:0}.__P__-content-frame{flex:1;min-height:0;width:100%;border:0;background:#fff}.__P__-news-list{display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-news-card{display:block;width:100%;text-align:left;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden;background:var(--__P__-surface)}.__P__-news-card{transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-news-card:hover{background:var(--__P__-bg-elevated)}.__P__-news-card:active{transform:translateY(1px)}.__P__-news-card:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-news-hero{width:100%;display:block}.__P__-news-body{display:flex;flex-direction:column;gap:6px;padding:14px 16px}.__P__-news-tags{display:flex;gap:6px;flex-wrap:wrap}.__P__-news-tag{font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-accent);background:color-mix(in srgb,var(--__P__-accent) 12%,transparent);padding:2px 8px;border-radius:999px}.__P__-news-title{font-weight:700;font-size:var(--__P__-text-md)}.__P__-news-summary{color:var(--__P__-fg-muted);font-size:14px;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-modules-empty{display:flex;align-items:center;justify-content:center;position:relative}.__P__-modules-empty-close{position:absolute;top:12px;right:12px}.__P__-modules-empty-text{color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}\n';
|
|
736
|
+
var panel_default = '.__P__-anchor{right:16px;bottom:16px}:host([data-position="bottom-left"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{right:auto;left:16px}:host([data-position="top-right"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{bottom:auto;top:16px}.__P__-anchor{position:fixed;display:flex;flex-direction:column;align-items:flex-end;gap:var(--__P__-space-3);pointer-events:none}.__P__-anchor{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=sm]{--__P__-fab-size: 44px}.__P__-anchor[data-launcher-size=md]{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=lg]{--__P__-fab-size: 68px}.__P__-anchor>*{pointer-events:auto}.__P__-fab[data-size=sm]{--__P__-fab-size: 44px;font-size:var(--__P__-text-sm)}.__P__-fab[data-size=md]{--__P__-fab-size: 56px;font-size:14px}.__P__-fab[data-size=lg]{--__P__-fab-size: 68px;font-size:var(--__P__-text-base)}.__P__-fab{display:inline-flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);color:var(--__P__-accent-text);background:var(--__P__-accent);box-shadow:var(--__P__-shadow-fab);font-weight:600;line-height:1;transform-origin:bottom right;animation:__P__-fab-in var(--__P__-dur-base) var(--__P__-ease) both;transition:transform var(--__P__-dur-base) var(--__P__-ease),opacity var(--__P__-dur-base) var(--__P__-ease),box-shadow var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab:hover{transform:translateY(-2px)}.__P__-fab:active{transform:translateY(0)}.__P__-fab:focus-visible{outline:2px solid var(--__P__-on-accent);outline-offset:3px}.__P__-fab svg{width:24px;height:24px;flex-shrink:0}@keyframes __P__-fab-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:none}}.__P__-fab[data-leaving]{position:absolute;right:0;bottom:0;animation:__P__-fab-out var(--__P__-dur-quick) var(--__P__-ease) forwards;pointer-events:none}:host([data-position^="top-"]) .__P__-fab[data-leaving]{bottom:auto;top:0}:host([data-position$="-left"]) .__P__-fab[data-leaving]{right:auto;left:0}@keyframes __P__-fab-out{0%{opacity:1;transform:none}to{opacity:0;transform:scale(.85)}}.__P__-fab[data-variant=circle]{width:var(--__P__-fab-size);height:var(--__P__-fab-size);border-radius:999px}.__P__-fab[data-variant=circle] .__P__-fab-label{display:none}.__P__-fab[data-variant=pill]{height:var(--__P__-fab-size);padding:0 18px 0 16px;border-radius:999px}.__P__-fab[data-variant=bar]{height:var(--__P__-fab-size);padding:0 22px;border-radius:var(--__P__-radius)}.__P__-fab[data-variant=minimal]{height:var(--__P__-fab-size);padding:0 var(--__P__-space-4);border-radius:999px;background:transparent;color:var(--__P__-accent);box-shadow:none;border:1px solid currentColor}.__P__-fab[data-variant=minimal]:hover{background:color-mix(in srgb,var(--__P__-accent) 12%,transparent)}.__P__-callout{--__P__-callout-fab-h: var(--__P__-fab-size, 56px);--__P__-callout-gap: clamp(12px, calc(var(--__P__-callout-fab-h) * .25), 22px);--__P__-callout-nudge-direction: -1;position:absolute;display:inline-flex;align-items:center;gap:var(--__P__-space-2);padding:10px 14px;background:var(--__P__-fg);color:var(--__P__-bg);border-radius:999px;font-size:var(--__P__-text-sm);font-weight:600;line-height:1.2;box-shadow:0 10px 30px -8px #00000059;pointer-events:auto;animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease);z-index:1;max-width:240px;white-space:nowrap}.__P__-callout[data-position=left]{right:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%)}.__P__-callout[data-position=right]{left:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%);--__P__-callout-nudge-direction: 1}.__P__-callout[data-position=top]{bottom:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-position=bottom]{top:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}:host([data-position$="-left"]) .__P__-callout[data-position=top],:host([data-position$="-left"]) .__P__-callout[data-position=bottom]{right:auto;left:0}.__P__-callout[data-shape=bubble]{border-radius:var(--__P__-radius-md);white-space:normal;width:max-content;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-shape=callout]{padding:12px 18px;font-size:14px;background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-callout:after{content:"";position:absolute;width:12px;height:12px;background:inherit;border-radius:2px;transform:rotate(45deg)}.__P__-callout[data-position=left]:after{right:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=right]:after{left:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=top]:after{bottom:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-position=bottom]:after{top:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}:host([data-position$="-left"]) .__P__-callout[data-position=top]:after,:host([data-position$="-left"]) .__P__-callout[data-position=bottom]:after{right:auto;left:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-animated]{animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease),__P__-callout-nudge 1.6s var(--__P__-ease-in-out) var(--__P__-dur-slow) infinite}@keyframes __P__-callout-in{0%{opacity:0}to{opacity:1}}@keyframes __P__-callout-nudge{0%,to{margin-left:0;margin-right:0}50%{margin-left:calc(6px * var(--__P__-callout-nudge-direction));margin-right:calc(-6px * var(--__P__-callout-nudge-direction))}}@media(prefers-reduced-motion:reduce){.__P__-callout[data-animated]{animation:__P__-callout-in 1ms var(--__P__-ease)}.__P__-icon-btn[data-recording=true],.__P__-typing span{animation:none}}.__P__-callout-close{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:999px;color:inherit;opacity:.7;cursor:pointer}.__P__-callout-close:hover{opacity:1;background:#ffffff26}.__P__-callout-close svg{width:12px;height:12px}.__P__-panel{width:var(--__P__-panel-w);height:var(--__P__-panel-h);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);background:var(--__P__-bg);color:var(--__P__-fg);border-radius:var(--__P__-radius-lg);box-shadow:var(--__P__-shadow-panel);display:flex;flex-direction:column;overflow:hidden;transform-origin:bottom right;animation:__P__-panel-in var(--__P__-dur-slow) var(--__P__-ease);border:1px solid var(--__P__-border)}:host([data-mode="open"]) .__P__-panel{width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));min-width:var(--__P__-resize-min-w, auto);min-height:var(--__P__-resize-min-h, auto);max-width:var(--__P__-resize-max-w, calc(100vw - 32px) );max-height:var(--__P__-resize-max-h, calc(100dvh - 32px) )}@keyframes __P__-panel-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}:host([data-mode="expanded"]) .__P__-panel{width:var(--__P__-expanded-w, 640px);height:var(--__P__-expanded-h, 820px);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px)}:host([data-mode="fullscreen"]){z-index:var(--__P__-z-panel)!important}:host([data-mode="fullscreen"]) .__P__-anchor{inset:0;align-items:stretch;padding:0}:host([data-mode="fullscreen"]) .__P__-panel{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0;border:0}:host([data-mode="fullscreen"]) .__P__-fab{display:none}:host([data-mode="inline"]) .__P__-anchor,:host([data-mode="standalone"]) .__P__-anchor{position:static;inset:auto;padding:0;align-items:stretch;width:100%;height:100%;min-height:0}:host([data-mode="inline"]) .__P__-panel,:host([data-mode="standalone"]) .__P__-panel{width:100%;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;animation:none}:host([data-mode="inline"]) .__P__-fab,:host([data-mode="standalone"]) .__P__-fab{display:none}:host([data-mode="inline"]){min-height:320px}:host([data-mode="inline"]) .__P__-panel{border-radius:var(--__P__-radius)}:host([data-mode="standalone"]) .__P__-panel{border-radius:0;border:0;box-shadow:none}:host([data-mode="modal"]){position:fixed!important;inset:0!important;z-index:var(--__P__-z-panel)!important;display:block!important;width:100vw;height:100dvh;background:var(--__P__-modal-backdrop, var(--__P__-backdrop));animation:__P__-backdrop-in var(--__P__-dur-base) var(--__P__-ease) both;--__P__-panel-w: min(960px, 92vw);--__P__-panel-h: min(720px, 88dvh)}:host([data-mode="modal"]) .__P__-anchor{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:var(--__P__-space-6);pointer-events:none}:host([data-mode="modal"]) .__P__-panel{pointer-events:auto;width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));max-width:calc(100vw - 48px);max-height:calc(100dvh - 48px);min-width:0;min-height:0;border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-panel);animation:__P__-modal-in var(--__P__-dur-base) var(--__P__-ease);translate:var(--__P__-modal-dx, 0px) var(--__P__-modal-dy, 0px)}:host([data-mode="modal"]) .__P__-header,:host([data-mode="modal"]) .__P__-back-header,:host([data-mode="modal"]) .__P__-home-hero{cursor:grab;touch-action:none}:host([data-mode="modal"]) .__P__-panel[data-dragging]{cursor:grabbing;user-select:none}:host([data-mode="modal"]) .__P__-panel[data-dragging] *{cursor:grabbing}:host([data-mode="modal"]) .__P__-fab{display:none}@keyframes __P__-backdrop-in{0%{background:#0000}to{background:var(--__P__-modal-backdrop, var(--__P__-backdrop))}}@keyframes __P__-modal-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}:host([data-mode="drawer"]){--__P__-panel-w: min(440px, calc(100vw - 32px) );--__P__-panel-h: 100dvh}:host([data-mode="drawer"]) .__P__-anchor{position:fixed;--__P__-inset-x: var(--__P__-panel-inset, 12px);--__P__-inset-y: var(--__P__-panel-inset, 3dvh);top:var(--__P__-inset-y);bottom:auto;right:var(--__P__-inset-x);left:auto;width:min(var(--__P__-widget-w, var(--__P__-panel-w)),calc(100vw - var(--__P__-inset-x) * 2));height:min(var(--__P__-widget-h, var(--__P__-panel-h)),calc(100dvh - var(--__P__-inset-y) * 2));padding:0;display:block;pointer-events:auto}:host([data-mode="drawer"][data-position$="-left"]) .__P__-anchor{right:auto;left:var(--__P__-inset-x)}:host([data-mode="drawer"][data-position^="bottom-"]) .__P__-anchor{top:auto;bottom:var(--__P__-inset-y)}:host([data-mode="drawer"]) .__P__-panel{width:100%;height:100%;max-width:none;max-height:none;min-width:0;min-height:0;border-radius:var(--__P__-radius, 12px);border:1px solid var(--__P__-border);box-shadow:-8px 16px 32px -12px #00000038;animation:__P__-drawer-in var(--__P__-dur-base) var(--__P__-ease)}:host([data-mode="drawer"][data-position$="-left"]) .__P__-panel{box-shadow:8px 16px 32px -12px #00000038;animation:__P__-drawer-in-left var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab[data-edge-tab]{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-2);position:fixed;top:50%;height:140px;width:auto;min-width:0;padding:10px 8px;writing-mode:vertical-rl;text-orientation:mixed;transform:translateY(-50%);transform-origin:center;animation:__P__-edge-tab-in var(--__P__-dur-base) var(--__P__-ease) both}.__P__-fab[data-edge-tab] svg{writing-mode:horizontal-tb}.__P__-fab[data-edge-tab]:hover{transform:translateY(-50%) scale(1.03)}.__P__-fab[data-edge-tab]:active{transform:translateY(-50%) scale(.97)}:host([data-position$="-right"]) .__P__-fab[data-edge-tab]{right:0;left:auto;border-radius:12px 0 0 12px;box-shadow:-6px 0 18px -8px #0000004d}:host([data-position$="-left"]) .__P__-fab[data-edge-tab]{left:0;right:auto;border-radius:0 12px 12px 0;box-shadow:6px 0 18px -8px #0000004d}.__P__-fab[data-edge-tab][data-leaving]{position:fixed;top:50%;bottom:auto;animation:__P__-edge-tab-out var(--__P__-dur-quick) var(--__P__-ease) forwards}@keyframes __P__-edge-tab-in{0%{opacity:0;transform:translateY(-50%) scale(.9)}to{opacity:1;transform:translateY(-50%) scale(1)}}@keyframes __P__-edge-tab-out{0%{opacity:1;transform:translateY(-50%) scale(1)}to{opacity:0;transform:translateY(-50%) scale(.85)}}@keyframes __P__-drawer-in{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes __P__-drawer-in-left{0%{transform:translate(-100%)}to{transform:translate(0)}}@media(prefers-reduced-motion:reduce){:host([data-mode="drawer"]) .__P__-panel,.__P__-fab[data-edge-tab]{animation:none}}.__P__-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:12px 14px;border-bottom:1px solid var(--__P__-border);background:var(--__P__-bg)}.__P__-header h1{font-size:14px;font-weight:600;flex:1;letter-spacing:-.01em}.__P__-header-actions{margin-left:auto;display:flex;align-items:center;gap:var(--__P__-space-1);flex-shrink:0}.__P__-agent{flex:1;display:inline-flex;align-items:center;gap:10px;min-width:0}.__P__-agent-avatar{position:relative;width:32px;height:32px;border-radius:999px;background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:var(--__P__-text-xs);overflow:hidden;flex-shrink:0}.__P__-agent-avatar img{width:100%;height:100%;object-fit:cover}.__P__-agent-avatar:after{content:"";position:absolute;right:-1px;bottom:-1px;width:10px;height:10px;border-radius:999px;border:2px solid var(--__P__-bg);background:var(--__P__-neutral)}.__P__-agent-avatar[data-status=online]:after{background:var(--__P__-success)}.__P__-agent-avatar[data-status=away]:after{background:var(--__P__-warning)}.__P__-agent-avatar[data-status=offline]:after{background:var(--__P__-neutral)}.__P__-agent-meta{display:flex;flex-direction:column;line-height:1.15;min-width:0}.__P__-agent-meta strong{font-size:14px;font-weight:600;letter-spacing:-.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-agent-meta span{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-suggestions{display:flex;flex-wrap:nowrap;gap:var(--__P__-space-2);padding:6px 14px 10px;overflow-x:auto;overflow-y:hidden;scroll-behavior:smooth;scroll-snap-type:x proximity;scrollbar-width:none;-ms-overflow-style:none;min-width:0}.__P__-suggestions::-webkit-scrollbar{display:none}.__P__-suggestions:before,.__P__-suggestions:after{content:"";flex:1 1 0;min-width:0}.__P__-suggestion{flex:0 0 auto;scroll-snap-align:center;padding:7px 14px;border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg);font-size:var(--__P__-text-sm);font-weight:500;white-space:nowrap;transition:background var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-suggestion:hover{border-color:var(--__P__-accent);color:var(--__P__-accent);transform:translateY(-1px)}.__P__-suggestion:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px;border-color:var(--__P__-accent)}.__P__-suggestion:active{transform:translateY(0)}.__P__-icon-btn{width:32px;height:32px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);transition:background var(--__P__-dur-quick) var(--__P__-ease),color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-icon-btn:hover{background:var(--__P__-bg-elevated);color:var(--__P__-fg)}.__P__-icon-btn:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-icon-btn:active{background:var(--__P__-border)}.__P__-icon-btn:disabled{opacity:.45;cursor:not-allowed}.__P__-icon-btn:before{content:"";position:absolute;inset:-6px}.__P__-icon-btn{position:relative}.__P__-icon-btn svg{width:18px;height:18px}.__P__-icon-btn[data-recording=true]{color:var(--__P__-accent);background:color-mix(in srgb,var(--__P__-accent) 12%,transparent);animation:__P__-pulse 1.2s var(--__P__-ease) infinite}@keyframes __P__-pulse{0%,to{box-shadow:0 0 color-mix(in srgb,var(--__P__-accent) 40%,transparent)}50%{box-shadow:0 0 0 6px color-mix(in srgb,var(--__P__-accent) 0%,transparent)}}.__P__-list{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-4);padding-bottom:var(--__P__-space-8);display:flex;flex-direction:column;gap:14px;scrollbar-width:thin;scrollbar-color:var(--__P__-border-strong) transparent;scrollbar-gutter:stable}.__P__-list::-webkit-scrollbar{width:8px}.__P__-list::-webkit-scrollbar-thumb{background:var(--__P__-border-strong);border-radius:8px}.__P__-bubble-row{display:flex}.__P__-bubble-row[data-role=user]{justify-content:flex-end}.__P__-bubble-row[data-role=assistant]{justify-content:flex-start}.__P__-bubble{max-width:85%;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);line-height:1.6;font-size:14px;word-wrap:break-word;overflow-wrap:anywhere;box-shadow:0 1px 2px #0000000a,0 1px 8px -4px #0000000f;animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-bubble ::selection{background:color-mix(in srgb,var(--__P__-accent) 30%,transparent)}@keyframes __P__-bubble-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.__P__-bubble-row[data-role=user] .__P__-bubble{background:var(--__P__-bubble-user);color:var(--__P__-bubble-user-text);border-bottom-right-radius:var(--__P__-radius-sm)}.__P__-bubble-row[data-role=assistant] .__P__-bubble{background:var(--__P__-bubble-assistant);color:var(--__P__-bubble-assistant-text);border-bottom-left-radius:var(--__P__-radius-sm)}.__P__-md>*:first-child{margin-top:0}.__P__-md>*:last-child{margin-bottom:0}.__P__-md p{margin:10px 0}.__P__-md h1,.__P__-md h2,.__P__-md h3,.__P__-md h4,.__P__-md h5,.__P__-md h6{margin:18px 0 8px;line-height:1.3;letter-spacing:-.01em;font-weight:700}.__P__-md h1{font-size:1.4em}.__P__-md h2{font-size:1.22em}.__P__-md h3{font-size:1.08em}.__P__-md h4,.__P__-md h5,.__P__-md h6{font-size:1em}.__P__-md>h1:first-child,.__P__-md>h2:first-child,.__P__-md>h3:first-child,.__P__-md>h4:first-child,.__P__-md>h5:first-child,.__P__-md>h6:first-child{margin-top:0}.__P__-md ul,.__P__-md ol{padding-left:1.5em;margin:10px 0}.__P__-md ul{list-style:disc}.__P__-md ol{list-style:decimal}.__P__-md li{margin:6px 0;padding-left:2px}.__P__-md li::marker{color:var(--__P__-fg-muted)}.__P__-md li>p{margin:6px 0}.__P__-md li>ul,.__P__-md li>ol{margin:6px 0}.__P__-md strong,.__P__-md b{font-weight:650;letter-spacing:-.005em}.__P__-md em,.__P__-md i{font-style:italic}.__P__-md code{font-family:var(--__P__-font-mono);font-size:.86em;padding:1px 6px;border-radius:5px;background:color-mix(in srgb,var(--__P__-accent) 10%,transparent);color:var(--__P__-fg);border:1px solid color-mix(in srgb,var(--__P__-accent) 16%,transparent)}.__P__-md pre{font-family:var(--__P__-font-mono);font-size:12.5px;padding:12px 14px;border-radius:var(--__P__-radius-sm);background:#7f7f7f1f;overflow-x:auto;margin:var(--__P__-space-3) 0;line-height:1.5}.__P__-md pre code{padding:0;background:none}.__P__-md a{color:inherit;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}.__P__-md a:hover{text-decoration-thickness:2px}.__P__-md blockquote{margin:14px 0;padding:6px 14px;border-left:3px solid color-mix(in srgb,var(--__P__-accent) 50%,transparent);background:color-mix(in srgb,var(--__P__-accent) 5%,transparent);border-radius:0 var(--__P__-radius-sm) var(--__P__-radius-sm) 0;color:var(--__P__-fg-muted)}.__P__-md blockquote>:first-child{margin-top:0}.__P__-md blockquote>:last-child{margin-bottom:0}.__P__-md hr{border:0;height:1px;background:color-mix(in srgb,currentColor 18%,transparent);margin:var(--__P__-space-4) 0}.__P__-md table{border-collapse:collapse;margin:var(--__P__-space-3) 0;font-size:.95em;display:block;overflow-x:auto;max-width:100%;font-variant-numeric:tabular-nums}.__P__-md th,.__P__-md td{padding:6px 10px;border-bottom:1px solid color-mix(in srgb,currentColor 12%,transparent);text-align:left}.__P__-md th{font-weight:700;background:color-mix(in srgb,currentColor 6%,transparent)}.__P__-md h1+ul,.__P__-md h1+ol,.__P__-md h2+ul,.__P__-md h2+ol,.__P__-md h3+ul,.__P__-md h3+ol,.__P__-md h4+ul,.__P__-md h4+ol{margin-top:var(--__P__-space-1)}.__P__-loading{display:inline-flex;align-items:center;gap:var(--__P__-space-2);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-loading-spinner{width:14px;height:14px;border-radius:999px;border:2px solid currentColor;border-top-color:transparent;animation:__P__-spin .8s linear infinite}@keyframes __P__-spin{to{transform:rotate(1turn)}}.__P__-typing{display:inline-flex;gap:var(--__P__-space-1);padding:var(--__P__-space-1) 0}.__P__-typing span{width:6px;height:6px;border-radius:999px;background:currentColor;opacity:.4;animation:__P__-blink 1.2s var(--__P__-ease) infinite}.__P__-typing span:nth-child(2){animation-delay:.2s}.__P__-typing span:nth-child(3){animation-delay:.4s}@keyframes __P__-blink{0%,80%,to{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-2px)}}.__P__-reasoning{margin:var(--__P__-space-1) 0 var(--__P__-space-2);padding-left:var(--__P__-space-3);border-left:2px solid var(--__P__-border-strong)}.__P__-reasoning-summary{display:inline-flex;align-items:center;gap:var(--__P__-space-1);cursor:pointer;list-style:none;user-select:none;color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-reasoning-summary::-webkit-details-marker{display:none}.__P__-reasoning-summary:before{content:"";width:5px;height:5px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(-45deg);opacity:.7;transition:transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-reasoning[open] .__P__-reasoning-summary:before{transform:rotate(45deg)}.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:__P__-reasoning-pulse 1.4s var(--__P__-ease) infinite}@keyframes __P__-reasoning-pulse{0%,to{opacity:.5}50%{opacity:1}}@media(prefers-reduced-motion:reduce){.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:none}}.__P__-reasoning-body{margin-top:var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-reasoning-body>:first-child{margin-top:0}.__P__-reasoning-body>:last-child{margin-bottom:0}.__P__-tool-chip{display:inline-flex;align-items:center;gap:6px;padding:var(--__P__-space-1) var(--__P__-space-2);margin-top:6px;border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs)}.__P__-composer{border-top:1px solid var(--__P__-border);padding:10px 12px;background:var(--__P__-bg);display:flex;flex-direction:column;gap:var(--__P__-space-2)}.__P__-composer-row{display:flex;align-items:flex-end;gap:6px}.__P__-textarea{flex:1;height:40px;max-height:160px;padding:10px 12px;border-radius:var(--__P__-radius);background:var(--__P__-bg-elevated);border:1px solid transparent;font-size:14px;line-height:1.4;transition:height var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),box-shadow var(--__P__-dur-quick) var(--__P__-ease)}.__P__-textarea:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:1px;border-color:var(--__P__-focus)}@media(pointer:coarse){.__P__-textarea,.__P__-home-search-input{font-size:16px}.__P__-textarea{height:44px}}.__P__-send{width:40px;height:40px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease),background var(--__P__-dur-quick) var(--__P__-ease)}.__P__-send[data-shape=circle]{border-radius:999px}.__P__-send[data-shape=square]{border-radius:var(--__P__-radius-sm)}.__P__-send[data-shape=pill]{width:auto;padding:0 18px;border-radius:999px}.__P__-send[data-variant=filled]{background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-send[data-variant=outline]{background:transparent;color:var(--__P__-accent);border-color:var(--__P__-accent)}.__P__-send[data-variant=outline]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 10%,transparent)}.__P__-send[data-variant=ghost]{background:transparent;color:var(--__P__-accent)}.__P__-send[data-variant=ghost]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 8%,transparent)}.__P__-send:disabled{opacity:.4;cursor:not-allowed}.__P__-send:not(:disabled):hover{transform:translateY(-1px)}.__P__-send:not(:disabled):active{transform:translateY(0)}.__P__-send:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-send svg{width:18px;height:18px}.__P__-composer-actions{display:flex;gap:var(--__P__-space-1);flex-wrap:wrap}.__P__-attachments{display:flex;flex-wrap:wrap;gap:6px}.__P__-attachment-chip{display:inline-flex;align-items:center;gap:6px;padding:var(--__P__-space-1) var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-1);border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);font-size:var(--__P__-text-xs);max-width:200px}.__P__-attachment-thumb{width:24px;height:24px;border-radius:999px;object-fit:cover;background:var(--__P__-border)}.__P__-attachment-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-attachment-remove{width:18px;height:18px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted)}.__P__-attachment-remove:hover{background:var(--__P__-border);color:var(--__P__-fg)}.__P__-dropzone{position:absolute;inset:8px;border:2px dashed var(--__P__-accent);border-radius:var(--__P__-radius);background:color-mix(in srgb,var(--__P__-accent) 8%,transparent);display:flex;align-items:center;justify-content:center;font-weight:600;color:var(--__P__-accent);pointer-events:none;z-index:10;animation:__P__-fade-in var(--__P__-dur-quick) var(--__P__-ease)}@keyframes __P__-fade-in{0%{opacity:0}to{opacity:1}}.__P__-error{margin-top:var(--__P__-space-1);padding:8px 10px;border-radius:var(--__P__-radius-sm);background:var(--__P__-danger-bg);color:var(--__P__-danger-text);font-size:var(--__P__-text-sm);display:flex;align-items:center;gap:var(--__P__-space-2)}.__P__-error button{color:inherit;text-decoration:underline;font-size:var(--__P__-text-sm)}.__P__-history{flex:1;overflow-y:auto;padding:var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-3)}.__P__-history-footer{flex:none;padding:var(--__P__-space-2) var(--__P__-space-3) var(--__P__-space-3);border-top:1px solid var(--__P__-border);background:var(--__P__-surface)}.__P__-history-new{width:100%;display:flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);padding:var(--__P__-space-2) var(--__P__-space-3);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-on-accent);cursor:pointer;font-size:var(--__P__-text-sm);font-weight:600;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-history-new svg{width:16px;height:16px}.__P__-history-new:hover{filter:brightness(1.08)}.__P__-history-new:active{transform:translateY(1px)}.__P__-history-new:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-history-empty{flex:1;display:flex;align-items:center;justify-content:center;padding:40px 16px;color:var(--__P__-fg-muted);font-size:14px;text-align:center}.__P__-history-group{display:flex;flex-direction:column;padding:0 var(--__P__-space-2)}.__P__-history-heading{font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);padding:12px 8px 6px;text-transform:uppercase;letter-spacing:.04em}.__P__-history-item{all:unset;display:flex;flex-direction:column;gap:3px;padding:10px 12px;border-radius:var(--__P__-radius-md);cursor:pointer;transition:background var(--__P__-dur-base) var(--__P__-ease)}.__P__-history-item:hover{background:var(--__P__-bg-elevated)}.__P__-history-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-history-title{font-size:14px;font-weight:500;color:var(--__P__-fg);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-preview{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-item[data-closed=true] .__P__-history-title:after{content:"\\2022";margin-left:var(--__P__-space-2);opacity:.5}.__P__-list-loading{margin:auto;padding:var(--__P__-space-6) var(--__P__-space-4);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);text-align:center}.__P__-readonly-banner{display:flex;flex-direction:column;align-items:center;gap:10px;padding:14px 12px;margin:0 var(--__P__-space-3) var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);text-align:center;font-size:var(--__P__-text-sm)}.__P__-readonly-label{line-height:1.4}.__P__-readonly-cta{appearance:none;border:0;cursor:pointer;padding:var(--__P__-space-2) var(--__P__-space-4);border-radius:999px;background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-readonly-cta:hover,.__P__-readonly-cta:focus-visible{filter:brightness(1.1)}.__P__-readonly-cta:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}.__P__-composer-footer{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:10px 16px;margin:0 var(--__P__-space-3);border-top:1px solid var(--__P__-border);text-align:center;font-size:11px;line-height:1.4;color:var(--__P__-fg-muted)}.__P__-disclaimer{max-width:320px;margin:0 auto;opacity:.9;letter-spacing:.01em}.__P__-poweredby{display:inline-flex;align-items:center;justify-content:center;gap:6px;color:inherit;text-decoration:none;opacity:.7;transition:opacity var(--__P__-dur-base) var(--__P__-ease);font-size:11px;letter-spacing:.02em}.__P__-poweredby:hover{opacity:1}.__P__-poweredby-logo{height:12px;width:auto;display:inline-block;vertical-align:middle}.__P__-poweredby-bar{flex:none;display:flex;align-items:center;justify-content:center;padding:6px 16px;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated)}.__P__-menu-wrap{position:relative;display:inline-flex}.__P__-menu{position:absolute;top:100%;right:0;margin-top:6px;min-width:200px;padding:6px;background:var(--__P__-bg);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);box-shadow:var(--__P__-shadow-panel);z-index:10;display:flex;flex-direction:column;gap:2px;animation:__P__-menu-in var(--__P__-dur-base) var(--__P__-ease)}@media(prefers-reduced-motion:reduce){.__P__-menu{animation:none}}@keyframes __P__-menu-in{0%{opacity:0;transform:translateY(-4px) scale(.98);transform-origin:top right}to{opacity:1;transform:none}}.__P__-menu-item{all:unset;display:flex;align-items:center;gap:10px;padding:8px 10px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);border-radius:var(--__P__-radius-sm);cursor:pointer;user-select:none}.__P__-menu-item:hover{background:var(--__P__-bg-elevated)}.__P__-menu-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-menu-item[disabled]{opacity:.45;cursor:not-allowed}.__P__-menu-icon{display:inline-flex;width:16px;height:16px;color:var(--__P__-fg-muted)}.__P__-menu-icon svg{width:16px;height:16px}.__P__-menu-label{flex:1}.__P__-menu-check{display:inline-flex;color:var(--__P__-accent)}.__P__-menu-check svg{width:14px;height:14px}.__P__-resize-grip{position:absolute;width:18px;height:18px;display:flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);opacity:.45;transition:opacity var(--__P__-dur-base) var(--__P__-ease);z-index:2;touch-action:none;user-select:none}.__P__-resize-grip:hover,.__P__-resize-grip:focus-visible{opacity:1}.__P__-resize-grip svg{width:10px;height:10px}.__P__-resize-grip--bottom-left{bottom:2px;left:2px;cursor:nesw-resize;transform:scaleX(-1)}.__P__-resize-grip--bottom-right{bottom:2px;right:2px;cursor:nwse-resize}.__P__-resize-grip--top-left{top:2px;left:2px;cursor:nwse-resize;transform:rotate(180deg)}.__P__-resize-grip--top-right{top:2px;right:2px;cursor:nesw-resize;transform:scaleY(-1)}:host(:not([data-mode="open"])) .__P__-resize-grip{display:none}.__P__-messenger{display:flex;flex-direction:column;overflow:hidden}.__P__-messenger-body{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.__P__-module{display:flex;flex-direction:column;height:100%;min-height:0}.__P__-module-scroll{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-3);display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-home{background:radial-gradient(125% 65% at 88% 0%,color-mix(in srgb,#fff 16%,transparent),transparent 55%),linear-gradient(180deg,var(--__P__-accent) 0%,var(--__P__-accent) 22%,color-mix(in srgb,var(--__P__-accent) 28%,var(--__P__-surface)) 44%,var(--__P__-surface) 70%);border-radius:var(--__P__-radius-lg) var(--__P__-radius-lg) 0 0}.__P__-home-scroll{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;background:transparent}.__P__-home-cards{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:4px 14px 16px}.__P__-module-pad{padding:var(--__P__-space-3) var(--__P__-space-3) 0}.__P__-module-empty{display:flex;flex-direction:column;align-items:center;gap:var(--__P__-space-3);padding:var(--__P__-space-8) var(--__P__-space-4);text-align:center;color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}.__P__-module-retry{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border-strong);border-radius:var(--__P__-radius-sm);color:var(--__P__-fg);font-weight:600;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-module-retry:hover{background:var(--__P__-hover);border-color:var(--__P__-accent)}.__P__-module-retry:active{background:var(--__P__-border)}.__P__-module-retry:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-help-list{flex:1;min-height:0;overflow-y:auto;padding-bottom:var(--__P__-space-3)}.__P__-help-group{display:flex;flex-direction:column}.__P__-help-section-title{position:sticky;top:0;z-index:1;margin:0;padding:var(--__P__-space-3) var(--__P__-space-5) var(--__P__-space-2);font-size:var(--__P__-text-xs);font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--__P__-fg-muted);background:var(--__P__-bg)}.__P__-help-card{margin:0 var(--__P__-space-3) var(--__P__-space-3);background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden}.__P__-help-card .__P__-list-row{border-bottom:0;border-radius:0}.__P__-help-card .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-help-card .__P__-list-row:hover{background:var(--__P__-hover)}.__P__-module-cta{padding:var(--__P__-space-3);border-top:1px solid var(--__P__-border)}.__P__-tabbar{display:flex;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);flex-shrink:0}.__P__-tab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-1);min-height:48px;padding:var(--__P__-space-2) var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600;transition:color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-tab:hover{color:var(--__P__-fg)}.__P__-tab[aria-selected=true]{color:var(--__P__-accent)}.__P__-tab:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-tab:active{background:var(--__P__-hover)}.__P__-tab-icon{position:relative;display:inline-flex}.__P__-tab-icon svg{width:22px;height:22px}.__P__-tab-badge{position:absolute;top:-4px;left:calc(50% + 6px);min-width:16px;height:16px;padding:0 4px;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:var(--__P__-accent);color:var(--__P__-on-accent);font-size:10px;font-weight:600;line-height:1}.__P__-home-hero{flex-shrink:0;padding:var(--__P__-space-5) var(--__P__-space-5) var(--__P__-space-3);color:var(--__P__-on-accent);--__P__-focus: var(--__P__-on-accent)}.__P__-home-hero-top{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-3);min-height:32px}.__P__-home-brand{font-size:14px;font-weight:600;letter-spacing:.01em;color:color-mix(in srgb,#fff 82%,transparent);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.__P__-home-brand-spacer{flex:1}.__P__-home-hero-actions{display:flex;align-items:center;gap:var(--__P__-space-2);flex-shrink:0}.__P__-home-hero-actions .__P__-icon-btn{color:#fff}.__P__-home-greeting{margin:28px 0 0;font-family:var(--__P__-font-display);font-size:var(--__P__-text-2xl);font-weight:800;line-height:1.18;letter-spacing:-.01em;overflow-wrap:anywhere}.__P__-home-lead{margin:2px 0 0;font-family:var(--__P__-font-display);font-size:var(--__P__-text-2xl);font-weight:800;line-height:1.18;letter-spacing:-.01em;color:color-mix(in srgb,var(--__P__-on-accent) 88%,transparent);overflow-wrap:anywhere}.__P__-home-avatars{display:flex}.__P__-home-avatar{width:30px;height:30px;border-radius:999px;overflow:hidden;margin-left:-10px;border:2px solid color-mix(in srgb,#fff 92%,transparent);box-shadow:0 1px 3px #0000002e;background:var(--__P__-surface);display:inline-flex;align-items:center;justify-content:center;font-size:var(--__P__-text-xs);font-weight:700;color:var(--__P__-fg)}.__P__-home-avatar:first-child{margin-left:0}.__P__-home-avatar img{width:100%;height:100%;object-fit:cover}.__P__-home-content{background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-card);overflow:hidden}.__P__-home-content-title{padding:var(--__P__-space-4) var(--__P__-space-4) var(--__P__-space-3);font-size:var(--__P__-text-sm);font-weight:700}.__P__-home-content-list{display:flex;flex-direction:column;padding:0 var(--__P__-space-2) var(--__P__-space-2)}.__P__-home-content-list .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-home-card{display:block;width:100%;text-align:left;background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);padding:var(--__P__-space-4);box-shadow:var(--__P__-shadow-card)}.__P__-home-card[data-interactive=true]{cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-home-card[data-interactive=true]:hover{background:var(--__P__-bg-elevated)}.__P__-home-card[data-interactive=true]:active{transform:translateY(1px)}.__P__-home-card[data-interactive=true]:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-recent-row{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-recent-avatar{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;flex-shrink:0;border-radius:999px;background:color-mix(in oklch,var(--__P__-accent) 14%,transparent);color:var(--__P__-accent)}.__P__-home-recent-avatar svg{width:20px;height:20px}.__P__-home-recent-body{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}.__P__-home-recent-title{font-weight:600;font-size:14px}.__P__-home-recent-preview{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-home-recent-at{color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);flex-shrink:0}.__P__-home-recent-dot{width:8px;height:8px;border-radius:999px;background:var(--__P__-accent);flex-shrink:0}.__P__-home-recent-row[data-unread=true] .__P__-home-recent-title{font-weight:700}.__P__-home-status{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-status-icon svg{width:22px;height:22px;color:var(--__P__-success)}.__P__-home-status[data-level=degraded] .__P__-home-status-icon svg{color:var(--__P__-warning)}.__P__-home-status[data-level=down] .__P__-home-status-icon svg{color:var(--__P__-danger)}.__P__-home-status-text{font-weight:600;font-size:14px}.__P__-home-search{display:flex;align-items:center;gap:var(--__P__-space-2);width:100%;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);border:1px solid var(--__P__-border);background:var(--__P__-surface);text-align:left}.__P__-home-search[data-input=true]{background:var(--__P__-bg-elevated)}.__P__-home-search:hover{border-color:var(--__P__-border-strong)}.__P__-home-search:focus-visible,.__P__-home-search:focus-within{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-search-text{flex:1;color:var(--__P__-fg-muted);font-size:14px}.__P__-home-search-input{flex:1;border:0;background:transparent;font-size:14px;color:var(--__P__-fg);outline:none}.__P__-home-search-icon svg{width:18px;height:18px;color:var(--__P__-accent)}.__P__-list-row{display:flex;align-items:center;gap:var(--__P__-space-3);width:100%;min-height:44px;text-align:left;padding:var(--__P__-space-3) var(--__P__-space-2);border-radius:var(--__P__-radius-sm)}.__P__-list-row:hover{background:var(--__P__-bg-elevated)}.__P__-list-row:active{background:var(--__P__-border)}.__P__-list-row:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-list-row-body{display:flex;flex-direction:column;min-width:0;flex:1}.__P__-list-row-title{font-weight:600;font-size:var(--__P__-text-md);line-height:1.35}.__P__-list-row-sub{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);margin-top:var(--__P__-space-1);line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-list-row-chevron svg{width:18px;height:18px;color:var(--__P__-accent);flex-shrink:0}.__P__-back-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:10px 12px;border-bottom:1px solid var(--__P__-border);flex-shrink:0}.__P__-back-title{flex:1;text-align:center;font-size:var(--__P__-text-md);font-weight:700;margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-back-spacer{width:32px;height:1px}.__P__-content{display:flex;flex-direction:column;gap:14px;width:100%;max-width:68ch;margin:0 auto}.__P__-content-hero{width:100%;border-radius:var(--__P__-radius)}.__P__-content-subtitle{color:var(--__P__-fg-muted);margin:0}.__P__-content-frame{flex:1;min-height:0;width:100%;border:0;background:#fff}.__P__-news-list{display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-news-card{display:block;width:100%;text-align:left;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden;background:var(--__P__-surface)}.__P__-news-card{transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-news-card:hover{background:var(--__P__-bg-elevated)}.__P__-news-card:active{transform:translateY(1px)}.__P__-news-card:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-news-hero{width:100%;display:block}.__P__-news-body{display:flex;flex-direction:column;gap:6px;padding:14px 16px}.__P__-news-tags{display:flex;gap:6px;flex-wrap:wrap}.__P__-news-tag{font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-accent);background:color-mix(in srgb,var(--__P__-accent) 12%,transparent);padding:2px 8px;border-radius:999px}.__P__-news-title{font-weight:700;font-size:var(--__P__-text-md)}.__P__-news-summary{color:var(--__P__-fg-muted);font-size:14px;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-modules-empty{display:flex;align-items:center;justify-content:center;position:relative}.__P__-modules-empty-close{position:absolute;top:12px;right:12px}.__P__-modules-empty-text{color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}\n';
|
|
745
737
|
|
|
746
738
|
// src/styles/standalone.css
|
|
747
739
|
var standalone_default = ".__P__-standalone-page{margin:0;height:100vh;background:var(--__P__-bg, #fff);display:grid;place-items:stretch}\n";
|
|
@@ -829,22 +821,22 @@ function attachAdoptedSheet(shadow, doc) {
|
|
|
829
821
|
}
|
|
830
822
|
}
|
|
831
823
|
function applyThemeOverrides(host, overrides) {
|
|
832
|
-
const
|
|
833
|
-
if (overrides.accent) host.style.setProperty(`--${
|
|
834
|
-
if (overrides.accentText) host.style.setProperty(`--${
|
|
835
|
-
if (overrides.radius) host.style.setProperty(`--${
|
|
836
|
-
if (overrides.fontFamily) host.style.setProperty(`--${
|
|
824
|
+
const p29 = BRAND.cssPrefix;
|
|
825
|
+
if (overrides.accent) host.style.setProperty(`--${p29}-accent`, overrides.accent);
|
|
826
|
+
if (overrides.accentText) host.style.setProperty(`--${p29}-accent-text`, overrides.accentText);
|
|
827
|
+
if (overrides.radius) host.style.setProperty(`--${p29}-radius`, overrides.radius);
|
|
828
|
+
if (overrides.fontFamily) host.style.setProperty(`--${p29}-font`, overrides.fontFamily);
|
|
837
829
|
}
|
|
838
830
|
function applyThemeMode(host, mode) {
|
|
839
831
|
host.dataset.theme = mode;
|
|
840
832
|
}
|
|
841
833
|
function applySize(host, size) {
|
|
842
|
-
const
|
|
843
|
-
if (size.width !== void 0) host.style.setProperty(`--${
|
|
844
|
-
if (size.height !== void 0) host.style.setProperty(`--${
|
|
845
|
-
if (size.expanded?.width !== void 0) host.style.setProperty(`--${
|
|
846
|
-
if (size.expanded?.height !== void 0) host.style.setProperty(`--${
|
|
847
|
-
if (size.inset !== void 0) host.style.setProperty(`--${
|
|
834
|
+
const p29 = BRAND.cssPrefix;
|
|
835
|
+
if (size.width !== void 0) host.style.setProperty(`--${p29}-panel-w`, size.width);
|
|
836
|
+
if (size.height !== void 0) host.style.setProperty(`--${p29}-panel-h`, size.height);
|
|
837
|
+
if (size.expanded?.width !== void 0) host.style.setProperty(`--${p29}-expanded-w`, size.expanded.width);
|
|
838
|
+
if (size.expanded?.height !== void 0) host.style.setProperty(`--${p29}-expanded-h`, size.expanded.height);
|
|
839
|
+
if (size.inset !== void 0) host.style.setProperty(`--${p29}-panel-inset`, size.inset);
|
|
848
840
|
}
|
|
849
841
|
function applyPosition(host, pos) {
|
|
850
842
|
host.dataset.position = pos;
|
|
@@ -1015,11 +1007,11 @@ function toBase64Url(json) {
|
|
|
1015
1007
|
var nonEmpty = (ctx) => ctx && Object.keys(ctx).length > 0 ? ctx : void 0;
|
|
1016
1008
|
function encodeContext(user, page) {
|
|
1017
1009
|
const u = nonEmpty(user);
|
|
1018
|
-
const
|
|
1019
|
-
if (!u && !
|
|
1010
|
+
const p29 = nonEmpty(page);
|
|
1011
|
+
if (!u && !p29) return void 0;
|
|
1020
1012
|
const envelope = {};
|
|
1021
1013
|
if (u) envelope.user = u;
|
|
1022
|
-
if (
|
|
1014
|
+
if (p29) envelope.page = p29;
|
|
1023
1015
|
return toBase64Url(JSON.stringify(envelope));
|
|
1024
1016
|
}
|
|
1025
1017
|
|
|
@@ -1087,12 +1079,12 @@ function normalizeToolRef(ref) {
|
|
|
1087
1079
|
}
|
|
1088
1080
|
function messageToWireParts(m) {
|
|
1089
1081
|
const out = [];
|
|
1090
|
-
for (const
|
|
1091
|
-
if (
|
|
1092
|
-
out.push({ text:
|
|
1082
|
+
for (const p29 of m.parts) {
|
|
1083
|
+
if (p29.kind === "text" && p29.text) {
|
|
1084
|
+
out.push({ text: p29.text, type: "text" });
|
|
1093
1085
|
}
|
|
1094
|
-
if (
|
|
1095
|
-
out.push({ mediaType:
|
|
1086
|
+
if (p29.kind === "file" && p29.url) {
|
|
1087
|
+
out.push({ mediaType: p29.mediaType, type: "file", url: p29.url });
|
|
1096
1088
|
}
|
|
1097
1089
|
}
|
|
1098
1090
|
for (const a of m.attachments ?? []) {
|
|
@@ -1653,7 +1645,7 @@ function fromWireMessage(w) {
|
|
|
1653
1645
|
return { kind: "file", url: part.url, mediaType: part.mediaType };
|
|
1654
1646
|
}
|
|
1655
1647
|
return null;
|
|
1656
|
-
}).filter((
|
|
1648
|
+
}).filter((p29) => p29 !== null);
|
|
1657
1649
|
return {
|
|
1658
1650
|
id: w.id,
|
|
1659
1651
|
role: w.role,
|
|
@@ -1681,41 +1673,41 @@ function assistantText(m) {
|
|
|
1681
1673
|
}
|
|
1682
1674
|
return out;
|
|
1683
1675
|
}
|
|
1684
|
-
function partToReactive(
|
|
1685
|
-
if (
|
|
1686
|
-
return { kind:
|
|
1676
|
+
function partToReactive(p29) {
|
|
1677
|
+
if (p29.kind === "text" || p29.kind === "reasoning") {
|
|
1678
|
+
return { kind: p29.kind, id: p29.id, textSig: signal(p29.text), doneSig: signal(p29.done) };
|
|
1687
1679
|
}
|
|
1688
|
-
if (
|
|
1680
|
+
if (p29.kind === "tool") {
|
|
1689
1681
|
return {
|
|
1690
1682
|
kind: "tool",
|
|
1691
|
-
toolCallId:
|
|
1692
|
-
toolName:
|
|
1693
|
-
inputPartialSig: signal(
|
|
1694
|
-
inputSig: signal(
|
|
1695
|
-
outputSig: signal(
|
|
1696
|
-
errorSig: signal(
|
|
1697
|
-
stateSig: signal(
|
|
1683
|
+
toolCallId: p29.toolCallId,
|
|
1684
|
+
toolName: p29.toolName,
|
|
1685
|
+
inputPartialSig: signal(p29.inputPartial),
|
|
1686
|
+
inputSig: signal(p29.input),
|
|
1687
|
+
outputSig: signal(p29.output),
|
|
1688
|
+
errorSig: signal(p29.error),
|
|
1689
|
+
stateSig: signal(p29.state)
|
|
1698
1690
|
};
|
|
1699
1691
|
}
|
|
1700
|
-
return
|
|
1692
|
+
return p29;
|
|
1701
1693
|
}
|
|
1702
|
-
function partFromReactive(
|
|
1703
|
-
if (
|
|
1704
|
-
return { kind:
|
|
1694
|
+
function partFromReactive(p29) {
|
|
1695
|
+
if (p29.kind === "text" || p29.kind === "reasoning") {
|
|
1696
|
+
return { kind: p29.kind, id: p29.id, text: p29.textSig.value, done: p29.doneSig.value };
|
|
1705
1697
|
}
|
|
1706
|
-
if (
|
|
1698
|
+
if (p29.kind === "tool") {
|
|
1707
1699
|
return {
|
|
1708
1700
|
kind: "tool",
|
|
1709
|
-
toolCallId:
|
|
1710
|
-
toolName:
|
|
1711
|
-
inputPartial:
|
|
1712
|
-
input:
|
|
1713
|
-
output:
|
|
1714
|
-
error:
|
|
1715
|
-
state:
|
|
1701
|
+
toolCallId: p29.toolCallId,
|
|
1702
|
+
toolName: p29.toolName,
|
|
1703
|
+
inputPartial: p29.inputPartialSig.value,
|
|
1704
|
+
input: p29.inputSig.value,
|
|
1705
|
+
output: p29.outputSig.value,
|
|
1706
|
+
error: p29.errorSig.value,
|
|
1707
|
+
state: p29.stateSig.value
|
|
1716
1708
|
};
|
|
1717
1709
|
}
|
|
1718
|
-
return
|
|
1710
|
+
return p29;
|
|
1719
1711
|
}
|
|
1720
1712
|
|
|
1721
1713
|
// src/stream/reducer.ts
|
|
@@ -1757,8 +1749,8 @@ var StreamReducer = class {
|
|
|
1757
1749
|
ensureTextPart(m, "text", chunk.id);
|
|
1758
1750
|
return;
|
|
1759
1751
|
case "text-delta": {
|
|
1760
|
-
const
|
|
1761
|
-
|
|
1752
|
+
const p29 = ensureTextPart(m, "text", chunk.id);
|
|
1753
|
+
p29.textSig.value += chunk.delta;
|
|
1762
1754
|
return;
|
|
1763
1755
|
}
|
|
1764
1756
|
case "text-end":
|
|
@@ -1768,8 +1760,8 @@ var StreamReducer = class {
|
|
|
1768
1760
|
ensureTextPart(m, "reasoning", chunk.id).doneSig.value = false;
|
|
1769
1761
|
return;
|
|
1770
1762
|
case "reasoning-delta": {
|
|
1771
|
-
const
|
|
1772
|
-
|
|
1763
|
+
const p29 = ensureTextPart(m, "reasoning", chunk.id);
|
|
1764
|
+
p29.textSig.value += chunk.delta;
|
|
1773
1765
|
return;
|
|
1774
1766
|
}
|
|
1775
1767
|
case "reasoning-end":
|
|
@@ -1787,7 +1779,7 @@ var StreamReducer = class {
|
|
|
1787
1779
|
return;
|
|
1788
1780
|
case "source-url": {
|
|
1789
1781
|
const parts = m.partsSig.value;
|
|
1790
|
-
if (parts.some((
|
|
1782
|
+
if (parts.some((p29) => p29.kind === "source" && p29.sourceId === chunk.sourceId)) return;
|
|
1791
1783
|
appendPart(m, { kind: "source", sourceId: chunk.sourceId, url: chunk.url, title: chunk.title });
|
|
1792
1784
|
return;
|
|
1793
1785
|
}
|
|
@@ -1811,14 +1803,14 @@ var StreamReducer = class {
|
|
|
1811
1803
|
}
|
|
1812
1804
|
};
|
|
1813
1805
|
function ensureTextPart(m, kind, id) {
|
|
1814
|
-
const existing = m.partsSig.value.find((
|
|
1806
|
+
const existing = m.partsSig.value.find((p29) => p29.kind === kind && p29.id === id);
|
|
1815
1807
|
if (existing) return existing;
|
|
1816
1808
|
const part = { kind, id, textSig: signal2(""), doneSig: signal2(false) };
|
|
1817
1809
|
appendPart(m, part);
|
|
1818
1810
|
return part;
|
|
1819
1811
|
}
|
|
1820
1812
|
function ensureToolPart(m, toolCallId, toolName) {
|
|
1821
|
-
const existing = m.partsSig.value.find((
|
|
1813
|
+
const existing = m.partsSig.value.find((p29) => p29.kind === "tool" && p29.toolCallId === toolCallId);
|
|
1822
1814
|
if (existing) return existing;
|
|
1823
1815
|
const part = {
|
|
1824
1816
|
kind: "tool",
|
|
@@ -1842,26 +1834,26 @@ function applyTool(m, chunk) {
|
|
|
1842
1834
|
ensureToolPart(m, chunk.toolCallId, chunk.toolName);
|
|
1843
1835
|
return;
|
|
1844
1836
|
case "tool-input-delta": {
|
|
1845
|
-
const
|
|
1846
|
-
|
|
1837
|
+
const p29 = ensureToolPart(m, chunk.toolCallId);
|
|
1838
|
+
p29.inputPartialSig.value += chunk.delta;
|
|
1847
1839
|
return;
|
|
1848
1840
|
}
|
|
1849
1841
|
case "tool-input-available": {
|
|
1850
|
-
const
|
|
1851
|
-
|
|
1852
|
-
|
|
1842
|
+
const p29 = ensureToolPart(m, chunk.toolCallId, chunk.toolName);
|
|
1843
|
+
p29.inputSig.value = chunk.input;
|
|
1844
|
+
p29.stateSig.value = "awaiting";
|
|
1853
1845
|
return;
|
|
1854
1846
|
}
|
|
1855
1847
|
case "tool-output-available": {
|
|
1856
|
-
const
|
|
1857
|
-
|
|
1858
|
-
|
|
1848
|
+
const p29 = ensureToolPart(m, chunk.toolCallId);
|
|
1849
|
+
p29.outputSig.value = chunk.output;
|
|
1850
|
+
p29.stateSig.value = "output";
|
|
1859
1851
|
return;
|
|
1860
1852
|
}
|
|
1861
1853
|
case "tool-output-error": {
|
|
1862
|
-
const
|
|
1863
|
-
|
|
1864
|
-
|
|
1854
|
+
const p29 = ensureToolPart(m, chunk.toolCallId);
|
|
1855
|
+
p29.errorSig.value = chunk.errorText;
|
|
1856
|
+
p29.stateSig.value = "error";
|
|
1865
1857
|
return;
|
|
1866
1858
|
}
|
|
1867
1859
|
default:
|
|
@@ -2297,11 +2289,6 @@ var HistoryIcon = () => /* @__PURE__ */ jsxs("svg", { ...props, "aria-hidden": "
|
|
|
2297
2289
|
/* @__PURE__ */ jsx("path", { d: "M3.05 13A9 9 0 1 0 6 5.3L3 9" }),
|
|
2298
2290
|
/* @__PURE__ */ jsx("path", { d: "M12 7v5l3 2" })
|
|
2299
2291
|
] });
|
|
2300
|
-
var GlobeIcon = () => /* @__PURE__ */ jsxs("svg", { ...props, "aria-hidden": "true", children: [
|
|
2301
|
-
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
2302
|
-
/* @__PURE__ */ jsx("path", { d: "M2 12h20" }),
|
|
2303
|
-
/* @__PURE__ */ jsx("path", { d: "M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" })
|
|
2304
|
-
] });
|
|
2305
2292
|
var BackIcon = () => /* @__PURE__ */ jsx("svg", { ...props, "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M19 12H5M12 19l-7-7 7-7" }) });
|
|
2306
2293
|
var PopOutIcon = () => /* @__PURE__ */ jsx("svg", { ...props, "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M15 3h6v6M10 14 21 3M21 14v5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5" }) });
|
|
2307
2294
|
var TrashIcon = () => /* @__PURE__ */ jsx("svg", { ...props, "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6" }) });
|
|
@@ -2640,30 +2627,30 @@ function resolveCalloutPosition(configured, launcherPosition) {
|
|
|
2640
2627
|
}
|
|
2641
2628
|
|
|
2642
2629
|
// src/ui/panel.tsx
|
|
2643
|
-
import { useCallback as
|
|
2630
|
+
import { useCallback as useCallback2, useEffect as useEffect10, useRef as useRef6 } from "preact/hooks";
|
|
2644
2631
|
|
|
2645
2632
|
// src/ui/resize-grip.tsx
|
|
2646
2633
|
import { useEffect as useEffect2, useRef } from "preact/hooks";
|
|
2647
2634
|
import { jsx as jsx3 } from "preact/jsx-runtime";
|
|
2648
2635
|
function ResizeGrip({ panelEl, resize, position, initialSize, onSizeChange, strings }) {
|
|
2649
|
-
const
|
|
2636
|
+
const p29 = BRAND.cssPrefix;
|
|
2650
2637
|
const dragRef = useRef(null);
|
|
2651
2638
|
useEffect2(() => {
|
|
2652
2639
|
if (!panelEl) return;
|
|
2653
2640
|
const style = panelEl.style;
|
|
2654
|
-
if (resize.minWidth) style.setProperty(`--${
|
|
2655
|
-
if (resize.maxWidth) style.setProperty(`--${
|
|
2656
|
-
if (resize.minHeight) style.setProperty(`--${
|
|
2657
|
-
if (resize.maxHeight) style.setProperty(`--${
|
|
2641
|
+
if (resize.minWidth) style.setProperty(`--${p29}-resize-min-w`, resize.minWidth);
|
|
2642
|
+
if (resize.maxWidth) style.setProperty(`--${p29}-resize-max-w`, resize.maxWidth);
|
|
2643
|
+
if (resize.minHeight) style.setProperty(`--${p29}-resize-min-h`, resize.minHeight);
|
|
2644
|
+
if (resize.maxHeight) style.setProperty(`--${p29}-resize-max-h`, resize.maxHeight);
|
|
2658
2645
|
if (initialSize) {
|
|
2659
|
-
style.setProperty(`--${
|
|
2660
|
-
style.setProperty(`--${
|
|
2646
|
+
style.setProperty(`--${p29}-widget-w`, `${initialSize.width}px`);
|
|
2647
|
+
style.setProperty(`--${p29}-widget-h`, `${initialSize.height}px`);
|
|
2661
2648
|
}
|
|
2662
|
-
}, [panelEl, resize.minWidth, resize.maxWidth, resize.minHeight, resize.maxHeight,
|
|
2649
|
+
}, [panelEl, resize.minWidth, resize.maxWidth, resize.minHeight, resize.maxHeight, p29, initialSize]);
|
|
2663
2650
|
if (!panelEl) return null;
|
|
2664
2651
|
const isTop = position.startsWith("top-");
|
|
2665
2652
|
const isRight = position.endsWith("-right");
|
|
2666
|
-
const cornerClass = `${
|
|
2653
|
+
const cornerClass = `${p29}-resize-grip ${p29}-resize-grip--${isTop ? "bottom" : "top"}-${isRight ? "left" : "right"}`;
|
|
2667
2654
|
const onPointerDown = (e) => {
|
|
2668
2655
|
if (!panelEl) return;
|
|
2669
2656
|
const target = e.currentTarget;
|
|
@@ -2687,8 +2674,8 @@ function ResizeGrip({ panelEl, resize, position, initialSize, onSizeChange, stri
|
|
|
2687
2674
|
if (!d || e.pointerId !== d.pointerId || !panelEl) return;
|
|
2688
2675
|
const dx = (e.clientX - d.startX) * d.dirX;
|
|
2689
2676
|
const dy = (e.clientY - d.startY) * d.dirY;
|
|
2690
|
-
panelEl.style.setProperty(`--${
|
|
2691
|
-
panelEl.style.setProperty(`--${
|
|
2677
|
+
panelEl.style.setProperty(`--${p29}-widget-w`, `${d.startW + dx}px`);
|
|
2678
|
+
panelEl.style.setProperty(`--${p29}-widget-h`, `${d.startH + dy}px`);
|
|
2692
2679
|
};
|
|
2693
2680
|
const onPointerUp = (e) => {
|
|
2694
2681
|
const d = dragRef.current;
|
|
@@ -2771,9 +2758,6 @@ function useDragMove(panelEl, enabled) {
|
|
|
2771
2758
|
}, [panelEl, enabled]);
|
|
2772
2759
|
}
|
|
2773
2760
|
|
|
2774
|
-
// src/ui/panel.tsx
|
|
2775
|
-
import { useComputed as useComputed3 } from "@preact/signals";
|
|
2776
|
-
|
|
2777
2761
|
// src/ui/action-visibility.ts
|
|
2778
2762
|
function isActionVisible(name, mode, panelSize, ctx) {
|
|
2779
2763
|
switch (name) {
|
|
@@ -2795,9 +2779,6 @@ function isActionVisible(name, mode, panelSize, ctx) {
|
|
|
2795
2779
|
return true;
|
|
2796
2780
|
}
|
|
2797
2781
|
}
|
|
2798
|
-
function visibleActions(actions, mode, panelSize, ctx) {
|
|
2799
|
-
return actions.filter((name) => isActionVisible(name, mode, panelSize, ctx));
|
|
2800
|
-
}
|
|
2801
2782
|
function canShowClose(mode, panelSize, actions) {
|
|
2802
2783
|
if (!isActionVisible("close", mode, panelSize)) return false;
|
|
2803
2784
|
return actions.main.includes("close") || actions.overflow.includes("close");
|
|
@@ -3348,21 +3329,269 @@ function useFileDrop({ containerRef, onDrop }) {
|
|
|
3348
3329
|
return { visible };
|
|
3349
3330
|
}
|
|
3350
3331
|
|
|
3332
|
+
// src/ui/header-actions.tsx
|
|
3333
|
+
import { useComputed } from "@preact/signals";
|
|
3334
|
+
|
|
3335
|
+
// src/ui/use-popover-menu.ts
|
|
3336
|
+
import { useCallback, useEffect as useEffect6, useRef as useRef3, useState as useState4 } from "preact/hooks";
|
|
3337
|
+
function usePopoverMenu({ itemCount, initialFocusIndex }) {
|
|
3338
|
+
const [open, setOpen] = useState4(false);
|
|
3339
|
+
const triggerRef = useRef3(null);
|
|
3340
|
+
const menuRef = useRef3(null);
|
|
3341
|
+
const [focusIndex, setFocusIndex] = useState4(-1);
|
|
3342
|
+
const close = useCallback(() => {
|
|
3343
|
+
setOpen(false);
|
|
3344
|
+
setFocusIndex(-1);
|
|
3345
|
+
triggerRef.current?.focus();
|
|
3346
|
+
}, []);
|
|
3347
|
+
const toggle = useCallback(() => setOpen((v) => !v), []);
|
|
3348
|
+
useEffect6(() => {
|
|
3349
|
+
if (!open) return;
|
|
3350
|
+
const onDocClick = (e) => {
|
|
3351
|
+
const menu = menuRef.current;
|
|
3352
|
+
const trigger = triggerRef.current;
|
|
3353
|
+
if (!menu || !trigger) return;
|
|
3354
|
+
const path = e.composedPath();
|
|
3355
|
+
if (path.includes(menu) || path.includes(trigger)) return;
|
|
3356
|
+
setOpen(false);
|
|
3357
|
+
setFocusIndex(-1);
|
|
3358
|
+
};
|
|
3359
|
+
document.addEventListener("click", onDocClick, true);
|
|
3360
|
+
return () => document.removeEventListener("click", onDocClick, true);
|
|
3361
|
+
}, [open]);
|
|
3362
|
+
useEffect6(() => {
|
|
3363
|
+
if (!open) return;
|
|
3364
|
+
if (itemCount === 0) return;
|
|
3365
|
+
const desired = initialFocusIndex?.() ?? 0;
|
|
3366
|
+
const clamped = desired < 0 || desired >= itemCount ? 0 : desired;
|
|
3367
|
+
setFocusIndex(clamped);
|
|
3368
|
+
}, [open, itemCount, initialFocusIndex]);
|
|
3369
|
+
useEffect6(() => {
|
|
3370
|
+
if (!open || focusIndex < 0) return;
|
|
3371
|
+
const items = menuRef.current?.querySelectorAll("[role='menuitem']");
|
|
3372
|
+
items?.[focusIndex]?.focus();
|
|
3373
|
+
}, [open, focusIndex]);
|
|
3374
|
+
const onTriggerKey = useCallback((e) => {
|
|
3375
|
+
if (e.key === "ArrowDown" || e.key === "Enter" || e.key === " ") {
|
|
3376
|
+
e.preventDefault();
|
|
3377
|
+
setOpen(true);
|
|
3378
|
+
}
|
|
3379
|
+
}, []);
|
|
3380
|
+
const onMenuKey = useCallback(
|
|
3381
|
+
(e) => {
|
|
3382
|
+
if (itemCount === 0) return;
|
|
3383
|
+
switch (e.key) {
|
|
3384
|
+
case "Escape":
|
|
3385
|
+
e.preventDefault();
|
|
3386
|
+
close();
|
|
3387
|
+
return;
|
|
3388
|
+
case "ArrowDown":
|
|
3389
|
+
e.preventDefault();
|
|
3390
|
+
setFocusIndex((i) => (i + 1) % itemCount);
|
|
3391
|
+
return;
|
|
3392
|
+
case "ArrowUp":
|
|
3393
|
+
e.preventDefault();
|
|
3394
|
+
setFocusIndex((i) => (i - 1 + itemCount) % itemCount);
|
|
3395
|
+
return;
|
|
3396
|
+
case "Home":
|
|
3397
|
+
e.preventDefault();
|
|
3398
|
+
setFocusIndex(0);
|
|
3399
|
+
return;
|
|
3400
|
+
case "End":
|
|
3401
|
+
e.preventDefault();
|
|
3402
|
+
setFocusIndex(itemCount - 1);
|
|
3403
|
+
}
|
|
3404
|
+
},
|
|
3405
|
+
[itemCount, close]
|
|
3406
|
+
);
|
|
3407
|
+
return { open, focusIndex, triggerRef, menuRef, toggle, close, onTriggerKey, onMenuKey };
|
|
3408
|
+
}
|
|
3409
|
+
|
|
3410
|
+
// src/ui/overflow-menu.tsx
|
|
3411
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "preact/jsx-runtime";
|
|
3412
|
+
function OverflowMenu({ items, triggerLabel }) {
|
|
3413
|
+
const p29 = BRAND.cssPrefix;
|
|
3414
|
+
const menu = usePopoverMenu({ itemCount: items.length });
|
|
3415
|
+
const handleSelect = (item) => {
|
|
3416
|
+
if (item.disabled) return;
|
|
3417
|
+
item.onSelect();
|
|
3418
|
+
if (!item.keepOpen) menu.close();
|
|
3419
|
+
};
|
|
3420
|
+
return /* @__PURE__ */ jsxs6("div", { class: `${p29}-menu-wrap`, children: [
|
|
3421
|
+
/* @__PURE__ */ jsx8(
|
|
3422
|
+
"button",
|
|
3423
|
+
{
|
|
3424
|
+
ref: menu.triggerRef,
|
|
3425
|
+
type: "button",
|
|
3426
|
+
class: `${p29}-icon-btn`,
|
|
3427
|
+
"aria-label": triggerLabel,
|
|
3428
|
+
"aria-haspopup": "menu",
|
|
3429
|
+
"aria-expanded": menu.open,
|
|
3430
|
+
title: triggerLabel,
|
|
3431
|
+
onClick: menu.toggle,
|
|
3432
|
+
onKeyDown: menu.onTriggerKey,
|
|
3433
|
+
children: /* @__PURE__ */ jsx8(MoreIcon, {})
|
|
3434
|
+
}
|
|
3435
|
+
),
|
|
3436
|
+
menu.open ? /* @__PURE__ */ jsx8(
|
|
3437
|
+
"div",
|
|
3438
|
+
{
|
|
3439
|
+
ref: menu.menuRef,
|
|
3440
|
+
class: `${p29}-menu`,
|
|
3441
|
+
role: "menu",
|
|
3442
|
+
"aria-label": triggerLabel,
|
|
3443
|
+
onKeyDown: menu.onMenuKey,
|
|
3444
|
+
tabIndex: -1,
|
|
3445
|
+
children: items.map((item) => /* @__PURE__ */ jsxs6(
|
|
3446
|
+
"button",
|
|
3447
|
+
{
|
|
3448
|
+
type: "button",
|
|
3449
|
+
role: "menuitem",
|
|
3450
|
+
class: `${p29}-menu-item`,
|
|
3451
|
+
"aria-pressed": item.type === "switch" ? item.on : void 0,
|
|
3452
|
+
disabled: item.disabled,
|
|
3453
|
+
lang: item.lang,
|
|
3454
|
+
onClick: () => handleSelect(item),
|
|
3455
|
+
children: [
|
|
3456
|
+
item.icon ? /* @__PURE__ */ jsx8("span", { class: `${p29}-menu-icon`, children: item.icon }) : null,
|
|
3457
|
+
/* @__PURE__ */ jsx8("span", { class: `${p29}-menu-label`, children: item.label }),
|
|
3458
|
+
item.type === "switch" && item.on ? /* @__PURE__ */ jsx8("span", { class: `${p29}-menu-check`, "aria-hidden": "true", children: /* @__PURE__ */ jsx8(CheckIcon, {}) }) : null
|
|
3459
|
+
]
|
|
3460
|
+
},
|
|
3461
|
+
item.id
|
|
3462
|
+
))
|
|
3463
|
+
}
|
|
3464
|
+
) : null
|
|
3465
|
+
] });
|
|
3466
|
+
}
|
|
3467
|
+
|
|
3468
|
+
// src/ui/header-actions.tsx
|
|
3469
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "preact/jsx-runtime";
|
|
3470
|
+
var p9 = BRAND.cssPrefix;
|
|
3471
|
+
var NEXT_THEME = { auto: "dark", dark: "light", light: "auto" };
|
|
3472
|
+
function themeIcon(mode) {
|
|
3473
|
+
if (mode === "light") return /* @__PURE__ */ jsx9(SunIcon, {});
|
|
3474
|
+
if (mode === "dark") return /* @__PURE__ */ jsx9(MoonIcon, {});
|
|
3475
|
+
return /* @__PURE__ */ jsx9(ThemeAutoIcon, {});
|
|
3476
|
+
}
|
|
3477
|
+
function HeaderActions({ panelProps, variant }) {
|
|
3478
|
+
const { options, panelSize, feedback, onClose, onClear, onExpand, onFullscreen, onPopOut, onSoundToggle } = panelProps;
|
|
3479
|
+
const { onToggleHistory, onLocaleChange, onThemeChange } = panelProps;
|
|
3480
|
+
const s = options.strings;
|
|
3481
|
+
const mode = options.mode;
|
|
3482
|
+
const isChat = variant === "chat";
|
|
3483
|
+
const muted = useComputed(() => feedback.mutedSig.value).value;
|
|
3484
|
+
const enabled = /* @__PURE__ */ new Set([...options.actions.main, ...options.actions.overflow]);
|
|
3485
|
+
const has = (name) => enabled.has(name);
|
|
3486
|
+
const visible = (name) => isActionVisible(name, mode, panelSize, { popOutUrl: options.popOutUrl });
|
|
3487
|
+
const themeMode = options.themeMode;
|
|
3488
|
+
const themeLabel = { auto: s.themeAuto, light: s.themeLight, dark: s.themeDark };
|
|
3489
|
+
const items = [];
|
|
3490
|
+
if (has("theme")) {
|
|
3491
|
+
items.push({
|
|
3492
|
+
id: "theme",
|
|
3493
|
+
icon: themeIcon(themeMode),
|
|
3494
|
+
label: `${s.theme}: ${themeLabel[themeMode]}`,
|
|
3495
|
+
onSelect: () => onThemeChange(NEXT_THEME[themeMode]),
|
|
3496
|
+
keepOpen: true
|
|
3497
|
+
});
|
|
3498
|
+
}
|
|
3499
|
+
if (has("language") && options.availableLocales.length > 1) {
|
|
3500
|
+
for (const locale of options.availableLocales) {
|
|
3501
|
+
items.push({
|
|
3502
|
+
id: `language:${locale}`,
|
|
3503
|
+
label: `${s.language} \u2014 ${locale}`,
|
|
3504
|
+
lang: locale,
|
|
3505
|
+
type: "switch",
|
|
3506
|
+
on: locale === options.locale,
|
|
3507
|
+
onSelect: () => onLocaleChange(locale)
|
|
3508
|
+
});
|
|
3509
|
+
}
|
|
3510
|
+
}
|
|
3511
|
+
if (has("expand") && visible("expand")) {
|
|
3512
|
+
const on = panelSize === "expanded";
|
|
3513
|
+
items.push({
|
|
3514
|
+
id: "expand",
|
|
3515
|
+
icon: on ? /* @__PURE__ */ jsx9(CollapseIcon, {}) : /* @__PURE__ */ jsx9(ExpandIcon, {}),
|
|
3516
|
+
label: on ? s.collapse : s.expand,
|
|
3517
|
+
type: "switch",
|
|
3518
|
+
on,
|
|
3519
|
+
onSelect: onExpand
|
|
3520
|
+
});
|
|
3521
|
+
}
|
|
3522
|
+
if (has("fullscreen") && visible("fullscreen")) {
|
|
3523
|
+
const on = panelSize === "fullscreen";
|
|
3524
|
+
items.push({
|
|
3525
|
+
id: "fullscreen",
|
|
3526
|
+
icon: on ? /* @__PURE__ */ jsx9(FullscreenExitIcon, {}) : /* @__PURE__ */ jsx9(FullscreenIcon, {}),
|
|
3527
|
+
label: on ? s.exitFullscreen : s.fullscreen,
|
|
3528
|
+
type: "switch",
|
|
3529
|
+
on,
|
|
3530
|
+
onSelect: onFullscreen
|
|
3531
|
+
});
|
|
3532
|
+
}
|
|
3533
|
+
if (has("popOut") && visible("popOut")) {
|
|
3534
|
+
items.push({ id: "popOut", icon: /* @__PURE__ */ jsx9(PopOutIcon, {}), label: s.popOut, onSelect: onPopOut });
|
|
3535
|
+
}
|
|
3536
|
+
if (isChat && has("sound")) {
|
|
3537
|
+
items.push({
|
|
3538
|
+
id: "sound",
|
|
3539
|
+
icon: muted ? /* @__PURE__ */ jsx9(SpeakerMutedIcon, {}) : /* @__PURE__ */ jsx9(SpeakerIcon, {}),
|
|
3540
|
+
label: muted ? s.soundOff : s.soundOn,
|
|
3541
|
+
type: "switch",
|
|
3542
|
+
on: !muted,
|
|
3543
|
+
onSelect: onSoundToggle
|
|
3544
|
+
});
|
|
3545
|
+
}
|
|
3546
|
+
if (isChat && has("clear")) {
|
|
3547
|
+
items.push({ id: "clear", icon: /* @__PURE__ */ jsx9(TrashIcon, {}), label: s.newConversation, onSelect: onClear });
|
|
3548
|
+
}
|
|
3549
|
+
const showClose = !!onClose && canShowClose(mode, panelSize, options.actions);
|
|
3550
|
+
const showHistory = isChat && has("history");
|
|
3551
|
+
return /* @__PURE__ */ jsxs7("div", { class: `${p9}-header-actions`, children: [
|
|
3552
|
+
showHistory ? /* @__PURE__ */ jsx9(
|
|
3553
|
+
"button",
|
|
3554
|
+
{
|
|
3555
|
+
type: "button",
|
|
3556
|
+
class: `${p9}-icon-btn`,
|
|
3557
|
+
onClick: onToggleHistory,
|
|
3558
|
+
"aria-label": s.history,
|
|
3559
|
+
title: s.history,
|
|
3560
|
+
"data-testid": TID.actionHistory,
|
|
3561
|
+
children: /* @__PURE__ */ jsx9(HistoryIcon, {})
|
|
3562
|
+
}
|
|
3563
|
+
) : null,
|
|
3564
|
+
items.length > 0 ? /* @__PURE__ */ jsx9(OverflowMenu, { items, triggerLabel: s.moreActions }) : null,
|
|
3565
|
+
showClose ? /* @__PURE__ */ jsx9(
|
|
3566
|
+
"button",
|
|
3567
|
+
{
|
|
3568
|
+
type: "button",
|
|
3569
|
+
class: `${p9}-icon-btn`,
|
|
3570
|
+
onClick: onClose,
|
|
3571
|
+
"aria-label": s.close,
|
|
3572
|
+
title: s.close,
|
|
3573
|
+
"data-testid": TID.actionClose,
|
|
3574
|
+
children: /* @__PURE__ */ jsx9(CloseIcon, {})
|
|
3575
|
+
}
|
|
3576
|
+
) : null
|
|
3577
|
+
] });
|
|
3578
|
+
}
|
|
3579
|
+
|
|
3351
3580
|
// src/ui/message-list.tsx
|
|
3352
|
-
import { useEffect as
|
|
3353
|
-
import { useComputed as
|
|
3581
|
+
import { useEffect as useEffect8, useLayoutEffect, useRef as useRef5 } from "preact/hooks";
|
|
3582
|
+
import { useComputed as useComputed3 } from "@preact/signals";
|
|
3354
3583
|
|
|
3355
3584
|
// src/ui/message-bubble.tsx
|
|
3356
|
-
import { useComputed } from "@preact/signals";
|
|
3585
|
+
import { useComputed as useComputed2 } from "@preact/signals";
|
|
3357
3586
|
|
|
3358
3587
|
// src/ui/markdown.tsx
|
|
3359
|
-
import { useEffect as
|
|
3588
|
+
import { useEffect as useEffect7, useMemo, useRef as useRef4 } from "preact/hooks";
|
|
3360
3589
|
import { effect, signal as signal4 } from "@preact/signals";
|
|
3361
3590
|
import * as smd from "streaming-markdown";
|
|
3362
|
-
import { jsx as
|
|
3591
|
+
import { jsx as jsx10 } from "preact/jsx-runtime";
|
|
3363
3592
|
function MarkdownView({ textSig, doneSig }) {
|
|
3364
|
-
const ref =
|
|
3365
|
-
|
|
3593
|
+
const ref = useRef4(null);
|
|
3594
|
+
useEffect7(() => {
|
|
3366
3595
|
const el = ref.current;
|
|
3367
3596
|
if (!el) return;
|
|
3368
3597
|
el.classList.add(`${BRAND.cssPrefix}-md`);
|
|
@@ -3409,12 +3638,12 @@ function MarkdownView({ textSig, doneSig }) {
|
|
|
3409
3638
|
el.removeEventListener("click", onClick);
|
|
3410
3639
|
};
|
|
3411
3640
|
}, [textSig, doneSig]);
|
|
3412
|
-
return /* @__PURE__ */
|
|
3641
|
+
return /* @__PURE__ */ jsx10("div", { ref });
|
|
3413
3642
|
}
|
|
3414
3643
|
function StaticMarkdown({ text }) {
|
|
3415
3644
|
const textSig = useMemo(() => signal4(text), [text]);
|
|
3416
3645
|
const doneSig = useMemo(() => signal4(true), []);
|
|
3417
|
-
return /* @__PURE__ */
|
|
3646
|
+
return /* @__PURE__ */ jsx10(MarkdownView, { textSig, doneSig });
|
|
3418
3647
|
}
|
|
3419
3648
|
function hardenLink(a) {
|
|
3420
3649
|
const href = a.getAttribute("href") ?? "";
|
|
@@ -3427,36 +3656,36 @@ function hardenLink(a) {
|
|
|
3427
3656
|
}
|
|
3428
3657
|
|
|
3429
3658
|
// src/ui/tool-chip.tsx
|
|
3430
|
-
import { jsx as
|
|
3659
|
+
import { jsx as jsx11, jsxs as jsxs8 } from "preact/jsx-runtime";
|
|
3431
3660
|
function ToolChip({ part, strings }) {
|
|
3432
|
-
const
|
|
3433
|
-
return /* @__PURE__ */
|
|
3434
|
-
/* @__PURE__ */
|
|
3661
|
+
const p29 = BRAND.cssPrefix;
|
|
3662
|
+
return /* @__PURE__ */ jsxs8("span", { class: `${p29}-tool-chip`, role: "status", children: [
|
|
3663
|
+
/* @__PURE__ */ jsxs8("span", { children: [
|
|
3435
3664
|
strings.usedTool,
|
|
3436
3665
|
":"
|
|
3437
3666
|
] }),
|
|
3438
|
-
/* @__PURE__ */
|
|
3667
|
+
/* @__PURE__ */ jsx11("strong", { children: part.toolName })
|
|
3439
3668
|
] });
|
|
3440
3669
|
}
|
|
3441
3670
|
|
|
3442
3671
|
// src/ui/message-bubble.tsx
|
|
3443
|
-
import { jsx as
|
|
3444
|
-
var
|
|
3672
|
+
import { jsx as jsx12, jsxs as jsxs9 } from "preact/jsx-runtime";
|
|
3673
|
+
var p10 = BRAND.cssPrefix;
|
|
3445
3674
|
function MessageBubble({ message, strings, responseMode, showReasoning, showToolCalls }) {
|
|
3446
|
-
const parts =
|
|
3675
|
+
const parts = useComputed2(() => message.partsSig.value);
|
|
3447
3676
|
const partList = parts.value;
|
|
3448
|
-
const hasAnswerText =
|
|
3677
|
+
const hasAnswerText = useComputed2(
|
|
3449
3678
|
() => message.partsSig.value.some((part) => part.kind === "text" && part.textSig.value.length > 0)
|
|
3450
3679
|
);
|
|
3451
|
-
const reasoningVisible =
|
|
3680
|
+
const reasoningVisible = useComputed2(
|
|
3452
3681
|
() => showReasoning && message.partsSig.value.some((part) => part.kind === "reasoning")
|
|
3453
3682
|
);
|
|
3454
3683
|
const streaming = message.role === "assistant" && message.status === "streaming";
|
|
3455
3684
|
const bufferedHold = responseMode === "buffered" && streaming;
|
|
3456
3685
|
const working = streaming && !hasAnswerText.value;
|
|
3457
3686
|
const showStreamDots = streaming && !bufferedHold && !(reasoningVisible.value && working);
|
|
3458
|
-
return /* @__PURE__ */
|
|
3459
|
-
bufferedHold ? /* @__PURE__ */
|
|
3687
|
+
return /* @__PURE__ */ jsx12("div", { class: `${p10}-bubble-row`, "data-role": message.role, "data-testid": tid(TID.messageBubble, message.id), children: /* @__PURE__ */ jsxs9("div", { class: `${p10}-bubble`, children: [
|
|
3688
|
+
bufferedHold ? /* @__PURE__ */ jsx12(LoadingSpinner, { label: strings.loading }) : partList.map((part) => /* @__PURE__ */ jsx12(
|
|
3460
3689
|
PartView,
|
|
3461
3690
|
{
|
|
3462
3691
|
part,
|
|
@@ -3467,8 +3696,8 @@ function MessageBubble({ message, strings, responseMode, showReasoning, showTool
|
|
|
3467
3696
|
},
|
|
3468
3697
|
partKey(part)
|
|
3469
3698
|
)),
|
|
3470
|
-
showStreamDots && /* @__PURE__ */
|
|
3471
|
-
message.status === "error" && message.errorText ? /* @__PURE__ */
|
|
3699
|
+
showStreamDots && /* @__PURE__ */ jsx12(TypingDots, {}),
|
|
3700
|
+
message.status === "error" && message.errorText ? /* @__PURE__ */ jsx12("div", { class: `${p10}-error`, role: "alert", children: /* @__PURE__ */ jsx12("span", { children: message.errorText }) }) : null
|
|
3472
3701
|
] }) });
|
|
3473
3702
|
}
|
|
3474
3703
|
function PartView({
|
|
@@ -3480,16 +3709,16 @@ function PartView({
|
|
|
3480
3709
|
}) {
|
|
3481
3710
|
switch (part.kind) {
|
|
3482
3711
|
case "text":
|
|
3483
|
-
return /* @__PURE__ */
|
|
3712
|
+
return /* @__PURE__ */ jsx12(MarkdownView, { textSig: part.textSig, doneSig: part.doneSig });
|
|
3484
3713
|
case "reasoning":
|
|
3485
|
-
return showReasoning ? /* @__PURE__ */
|
|
3714
|
+
return showReasoning ? /* @__PURE__ */ jsx12(ReasoningView, { part, active, strings }) : null;
|
|
3486
3715
|
case "tool":
|
|
3487
|
-
return showToolCalls ? /* @__PURE__ */
|
|
3716
|
+
return showToolCalls ? /* @__PURE__ */ jsx12(ToolChip, { part, strings }) : null;
|
|
3488
3717
|
case "file":
|
|
3489
3718
|
if (part.mediaType.startsWith("image/")) {
|
|
3490
|
-
return /* @__PURE__ */
|
|
3719
|
+
return /* @__PURE__ */ jsx12("img", { src: part.url, alt: "", loading: "lazy" });
|
|
3491
3720
|
}
|
|
3492
|
-
return /* @__PURE__ */
|
|
3721
|
+
return /* @__PURE__ */ jsx12("a", { href: part.url, target: "_blank", rel: "noreferrer noopener", children: part.url });
|
|
3493
3722
|
case "source":
|
|
3494
3723
|
return null;
|
|
3495
3724
|
}
|
|
@@ -3499,9 +3728,9 @@ function ReasoningView({
|
|
|
3499
3728
|
active,
|
|
3500
3729
|
strings
|
|
3501
3730
|
}) {
|
|
3502
|
-
return /* @__PURE__ */
|
|
3503
|
-
/* @__PURE__ */
|
|
3504
|
-
/* @__PURE__ */
|
|
3731
|
+
return /* @__PURE__ */ jsxs9("details", { class: `${p10}-reasoning`, open: active, "data-active": active ? "true" : void 0, children: [
|
|
3732
|
+
/* @__PURE__ */ jsx12("summary", { class: `${p10}-reasoning-summary`, children: /* @__PURE__ */ jsx12("span", { class: `${p10}-reasoning-label`, children: active ? strings.thinking : strings.thoughts }) }),
|
|
3733
|
+
/* @__PURE__ */ jsx12("div", { class: `${p10}-reasoning-body`, children: /* @__PURE__ */ jsx12(MarkdownView, { textSig: part.textSig, doneSig: part.doneSig }) })
|
|
3505
3734
|
] });
|
|
3506
3735
|
}
|
|
3507
3736
|
function partKey(part) {
|
|
@@ -3518,27 +3747,27 @@ function partKey(part) {
|
|
|
3518
3747
|
}
|
|
3519
3748
|
}
|
|
3520
3749
|
function TypingDots() {
|
|
3521
|
-
return /* @__PURE__ */
|
|
3522
|
-
/* @__PURE__ */
|
|
3523
|
-
/* @__PURE__ */
|
|
3524
|
-
/* @__PURE__ */
|
|
3750
|
+
return /* @__PURE__ */ jsxs9("span", { class: `${p10}-typing`, "aria-hidden": "true", children: [
|
|
3751
|
+
/* @__PURE__ */ jsx12("span", {}),
|
|
3752
|
+
/* @__PURE__ */ jsx12("span", {}),
|
|
3753
|
+
/* @__PURE__ */ jsx12("span", {})
|
|
3525
3754
|
] });
|
|
3526
3755
|
}
|
|
3527
3756
|
function LoadingSpinner({ label }) {
|
|
3528
|
-
return /* @__PURE__ */
|
|
3529
|
-
/* @__PURE__ */
|
|
3530
|
-
/* @__PURE__ */
|
|
3757
|
+
return /* @__PURE__ */ jsxs9("span", { class: `${p10}-loading`, role: "status", children: [
|
|
3758
|
+
/* @__PURE__ */ jsx12("span", { class: `${p10}-loading-spinner`, "aria-hidden": "true" }),
|
|
3759
|
+
/* @__PURE__ */ jsx12("span", { class: `${p10}-loading-label`, children: label })
|
|
3531
3760
|
] });
|
|
3532
3761
|
}
|
|
3533
3762
|
|
|
3534
3763
|
// src/ui/message-list.tsx
|
|
3535
|
-
import { jsx as
|
|
3536
|
-
var
|
|
3764
|
+
import { jsx as jsx13, jsxs as jsxs10 } from "preact/jsx-runtime";
|
|
3765
|
+
var p11 = BRAND.cssPrefix;
|
|
3537
3766
|
var STICK_THRESHOLD = 120;
|
|
3538
3767
|
function MessageList({ messagesSig, strings, responseMode, showReasoning, showToolCalls, loading }) {
|
|
3539
|
-
const ref =
|
|
3540
|
-
const messages =
|
|
3541
|
-
const hasHydratedRef =
|
|
3768
|
+
const ref = useRef5(null);
|
|
3769
|
+
const messages = useComputed3(() => messagesSig.value);
|
|
3770
|
+
const hasHydratedRef = useRef5(false);
|
|
3542
3771
|
const firstMessageId = messages.value[0]?.id;
|
|
3543
3772
|
useLayoutEffect(() => {
|
|
3544
3773
|
const el = ref.current;
|
|
@@ -3563,14 +3792,14 @@ function MessageList({ messagesSig, strings, responseMode, showReasoning, showTo
|
|
|
3563
3792
|
clearTimeout(timerId);
|
|
3564
3793
|
};
|
|
3565
3794
|
}, [firstMessageId]);
|
|
3566
|
-
|
|
3795
|
+
useEffect8(() => {
|
|
3567
3796
|
const el = ref.current;
|
|
3568
3797
|
if (!el) return;
|
|
3569
3798
|
if (!hasHydratedRef.current) return;
|
|
3570
3799
|
const distanceFromBottom = el.scrollHeight - el.scrollTop - el.clientHeight;
|
|
3571
3800
|
if (distanceFromBottom < STICK_THRESHOLD) el.scrollTop = el.scrollHeight;
|
|
3572
3801
|
}, [messages.value.length]);
|
|
3573
|
-
|
|
3802
|
+
useEffect8(() => {
|
|
3574
3803
|
const el = ref.current;
|
|
3575
3804
|
if (!el) return;
|
|
3576
3805
|
const last = messages.value.at(-1);
|
|
@@ -3588,9 +3817,9 @@ function MessageList({ messagesSig, strings, responseMode, showReasoning, showTo
|
|
|
3588
3817
|
obs.observe(el, { childList: true, subtree: true, characterData: true });
|
|
3589
3818
|
return () => obs.disconnect();
|
|
3590
3819
|
}, [messages.value]);
|
|
3591
|
-
return /* @__PURE__ */
|
|
3592
|
-
loading && messages.value.length === 0 ? /* @__PURE__ */
|
|
3593
|
-
messages.value.map((m) => /* @__PURE__ */
|
|
3820
|
+
return /* @__PURE__ */ jsxs10("div", { ref, class: `${p11}-list`, role: "log", "aria-live": "polite", "aria-relevant": "additions text", children: [
|
|
3821
|
+
loading && messages.value.length === 0 ? /* @__PURE__ */ jsx13("div", { class: `${p11}-list-loading`, role: "status", children: strings.messagesLoading }) : null,
|
|
3822
|
+
messages.value.map((m) => /* @__PURE__ */ jsx13(
|
|
3594
3823
|
MessageBubble,
|
|
3595
3824
|
{
|
|
3596
3825
|
message: m,
|
|
@@ -3604,139 +3833,6 @@ function MessageList({ messagesSig, strings, responseMode, showReasoning, showTo
|
|
|
3604
3833
|
] });
|
|
3605
3834
|
}
|
|
3606
3835
|
|
|
3607
|
-
// src/ui/use-popover-menu.ts
|
|
3608
|
-
import { useCallback, useEffect as useEffect8, useRef as useRef5, useState as useState4 } from "preact/hooks";
|
|
3609
|
-
function usePopoverMenu({ itemCount, initialFocusIndex }) {
|
|
3610
|
-
const [open, setOpen] = useState4(false);
|
|
3611
|
-
const triggerRef = useRef5(null);
|
|
3612
|
-
const menuRef = useRef5(null);
|
|
3613
|
-
const [focusIndex, setFocusIndex] = useState4(-1);
|
|
3614
|
-
const close = useCallback(() => {
|
|
3615
|
-
setOpen(false);
|
|
3616
|
-
setFocusIndex(-1);
|
|
3617
|
-
triggerRef.current?.focus();
|
|
3618
|
-
}, []);
|
|
3619
|
-
const toggle = useCallback(() => setOpen((v) => !v), []);
|
|
3620
|
-
useEffect8(() => {
|
|
3621
|
-
if (!open) return;
|
|
3622
|
-
const onDocClick = (e) => {
|
|
3623
|
-
const menu = menuRef.current;
|
|
3624
|
-
const trigger = triggerRef.current;
|
|
3625
|
-
if (!menu || !trigger) return;
|
|
3626
|
-
const path = e.composedPath();
|
|
3627
|
-
if (path.includes(menu) || path.includes(trigger)) return;
|
|
3628
|
-
setOpen(false);
|
|
3629
|
-
setFocusIndex(-1);
|
|
3630
|
-
};
|
|
3631
|
-
document.addEventListener("click", onDocClick, true);
|
|
3632
|
-
return () => document.removeEventListener("click", onDocClick, true);
|
|
3633
|
-
}, [open]);
|
|
3634
|
-
useEffect8(() => {
|
|
3635
|
-
if (!open) return;
|
|
3636
|
-
if (itemCount === 0) return;
|
|
3637
|
-
const desired = initialFocusIndex?.() ?? 0;
|
|
3638
|
-
const clamped = desired < 0 || desired >= itemCount ? 0 : desired;
|
|
3639
|
-
setFocusIndex(clamped);
|
|
3640
|
-
}, [open, itemCount, initialFocusIndex]);
|
|
3641
|
-
useEffect8(() => {
|
|
3642
|
-
if (!open || focusIndex < 0) return;
|
|
3643
|
-
const items = menuRef.current?.querySelectorAll("[role='menuitem']");
|
|
3644
|
-
items?.[focusIndex]?.focus();
|
|
3645
|
-
}, [open, focusIndex]);
|
|
3646
|
-
const onTriggerKey = useCallback((e) => {
|
|
3647
|
-
if (e.key === "ArrowDown" || e.key === "Enter" || e.key === " ") {
|
|
3648
|
-
e.preventDefault();
|
|
3649
|
-
setOpen(true);
|
|
3650
|
-
}
|
|
3651
|
-
}, []);
|
|
3652
|
-
const onMenuKey = useCallback(
|
|
3653
|
-
(e) => {
|
|
3654
|
-
if (itemCount === 0) return;
|
|
3655
|
-
switch (e.key) {
|
|
3656
|
-
case "Escape":
|
|
3657
|
-
e.preventDefault();
|
|
3658
|
-
close();
|
|
3659
|
-
return;
|
|
3660
|
-
case "ArrowDown":
|
|
3661
|
-
e.preventDefault();
|
|
3662
|
-
setFocusIndex((i) => (i + 1) % itemCount);
|
|
3663
|
-
return;
|
|
3664
|
-
case "ArrowUp":
|
|
3665
|
-
e.preventDefault();
|
|
3666
|
-
setFocusIndex((i) => (i - 1 + itemCount) % itemCount);
|
|
3667
|
-
return;
|
|
3668
|
-
case "Home":
|
|
3669
|
-
e.preventDefault();
|
|
3670
|
-
setFocusIndex(0);
|
|
3671
|
-
return;
|
|
3672
|
-
case "End":
|
|
3673
|
-
e.preventDefault();
|
|
3674
|
-
setFocusIndex(itemCount - 1);
|
|
3675
|
-
}
|
|
3676
|
-
},
|
|
3677
|
-
[itemCount, close]
|
|
3678
|
-
);
|
|
3679
|
-
return { open, focusIndex, triggerRef, menuRef, toggle, close, onTriggerKey, onMenuKey };
|
|
3680
|
-
}
|
|
3681
|
-
|
|
3682
|
-
// src/ui/overflow-menu.tsx
|
|
3683
|
-
import { jsx as jsx12, jsxs as jsxs9 } from "preact/jsx-runtime";
|
|
3684
|
-
function OverflowMenu({ items, triggerLabel }) {
|
|
3685
|
-
const p28 = BRAND.cssPrefix;
|
|
3686
|
-
const menu = usePopoverMenu({ itemCount: items.length });
|
|
3687
|
-
const handleSelect = (item) => {
|
|
3688
|
-
if (item.disabled) return;
|
|
3689
|
-
item.onSelect();
|
|
3690
|
-
menu.close();
|
|
3691
|
-
};
|
|
3692
|
-
return /* @__PURE__ */ jsxs9("div", { class: `${p28}-menu-wrap`, children: [
|
|
3693
|
-
/* @__PURE__ */ jsx12(
|
|
3694
|
-
"button",
|
|
3695
|
-
{
|
|
3696
|
-
ref: menu.triggerRef,
|
|
3697
|
-
type: "button",
|
|
3698
|
-
class: `${p28}-icon-btn`,
|
|
3699
|
-
"aria-label": triggerLabel,
|
|
3700
|
-
"aria-haspopup": "menu",
|
|
3701
|
-
"aria-expanded": menu.open,
|
|
3702
|
-
title: triggerLabel,
|
|
3703
|
-
onClick: menu.toggle,
|
|
3704
|
-
onKeyDown: menu.onTriggerKey,
|
|
3705
|
-
children: /* @__PURE__ */ jsx12(MoreIcon, {})
|
|
3706
|
-
}
|
|
3707
|
-
),
|
|
3708
|
-
menu.open ? /* @__PURE__ */ jsx12(
|
|
3709
|
-
"div",
|
|
3710
|
-
{
|
|
3711
|
-
ref: menu.menuRef,
|
|
3712
|
-
class: `${p28}-menu`,
|
|
3713
|
-
role: "menu",
|
|
3714
|
-
"aria-label": triggerLabel,
|
|
3715
|
-
onKeyDown: menu.onMenuKey,
|
|
3716
|
-
tabIndex: -1,
|
|
3717
|
-
children: items.map((item) => /* @__PURE__ */ jsxs9(
|
|
3718
|
-
"button",
|
|
3719
|
-
{
|
|
3720
|
-
type: "button",
|
|
3721
|
-
role: "menuitem",
|
|
3722
|
-
class: `${p28}-menu-item`,
|
|
3723
|
-
"aria-pressed": item.type === "switch" ? item.on : void 0,
|
|
3724
|
-
disabled: item.disabled,
|
|
3725
|
-
lang: item.lang,
|
|
3726
|
-
onClick: () => handleSelect(item),
|
|
3727
|
-
children: [
|
|
3728
|
-
item.icon ? /* @__PURE__ */ jsx12("span", { class: `${p28}-menu-icon`, children: item.icon }) : null,
|
|
3729
|
-
/* @__PURE__ */ jsx12("span", { class: `${p28}-menu-label`, children: item.label }),
|
|
3730
|
-
item.type === "switch" && item.on ? /* @__PURE__ */ jsx12("span", { class: `${p28}-menu-check`, "aria-hidden": "true", children: /* @__PURE__ */ jsx12(CheckIcon, {}) }) : null
|
|
3731
|
-
]
|
|
3732
|
-
},
|
|
3733
|
-
item.id
|
|
3734
|
-
))
|
|
3735
|
-
}
|
|
3736
|
-
) : null
|
|
3737
|
-
] });
|
|
3738
|
-
}
|
|
3739
|
-
|
|
3740
3836
|
// src/ui/conversation-list.tsx
|
|
3741
3837
|
import { useEffect as useEffect9, useState as useState5 } from "preact/hooks";
|
|
3742
3838
|
|
|
@@ -3768,7 +3864,7 @@ function startOfDay(ms) {
|
|
|
3768
3864
|
}
|
|
3769
3865
|
|
|
3770
3866
|
// src/ui/conversation-list.tsx
|
|
3771
|
-
import { Fragment, jsx as
|
|
3867
|
+
import { Fragment, jsx as jsx14, jsxs as jsxs11 } from "preact/jsx-runtime";
|
|
3772
3868
|
var log11 = logger.scope("history");
|
|
3773
3869
|
var BUCKET_TO_STRING = {
|
|
3774
3870
|
today: "dateToday",
|
|
@@ -3777,7 +3873,7 @@ var BUCKET_TO_STRING = {
|
|
|
3777
3873
|
older: "dateOlder"
|
|
3778
3874
|
};
|
|
3779
3875
|
function ConversationList({ transport, strings, visitorId, onSelect, onNewChat }) {
|
|
3780
|
-
const
|
|
3876
|
+
const p29 = BRAND.cssPrefix;
|
|
3781
3877
|
const [state, setState] = useState5("loading");
|
|
3782
3878
|
const [sessions, setChats] = useState5([]);
|
|
3783
3879
|
useEffect9(() => {
|
|
@@ -3795,38 +3891,38 @@ function ConversationList({ transport, strings, visitorId, onSelect, onNewChat }
|
|
|
3795
3891
|
cancelled = true;
|
|
3796
3892
|
};
|
|
3797
3893
|
}, [transport, visitorId]);
|
|
3798
|
-
const newChatButton = onNewChat ? /* @__PURE__ */
|
|
3799
|
-
/* @__PURE__ */
|
|
3894
|
+
const newChatButton = onNewChat ? /* @__PURE__ */ jsx14("div", { class: `${p29}-history-footer`, children: /* @__PURE__ */ jsxs11("button", { type: "button", class: `${p29}-history-new`, onClick: onNewChat, "data-testid": TID.sidebarNewChat, children: [
|
|
3895
|
+
/* @__PURE__ */ jsx14(PlusIcon, {}),
|
|
3800
3896
|
strings.historyNewChat
|
|
3801
3897
|
] }) }) : null;
|
|
3802
3898
|
if (state === "loading") {
|
|
3803
|
-
return /* @__PURE__ */
|
|
3804
|
-
/* @__PURE__ */
|
|
3899
|
+
return /* @__PURE__ */ jsxs11(Fragment, { children: [
|
|
3900
|
+
/* @__PURE__ */ jsx14("div", { class: `${p29}-history-empty`, children: strings.historyLoading }),
|
|
3805
3901
|
newChatButton
|
|
3806
3902
|
] });
|
|
3807
3903
|
}
|
|
3808
3904
|
if (state === "error" || sessions.length === 0) {
|
|
3809
|
-
return /* @__PURE__ */
|
|
3810
|
-
/* @__PURE__ */
|
|
3905
|
+
return /* @__PURE__ */ jsxs11(Fragment, { children: [
|
|
3906
|
+
/* @__PURE__ */ jsx14("div", { class: `${p29}-history-empty`, children: strings.historyEmpty }),
|
|
3811
3907
|
newChatButton
|
|
3812
3908
|
] });
|
|
3813
3909
|
}
|
|
3814
3910
|
const groups = groupByBucket(Date.now(), sessions);
|
|
3815
|
-
return /* @__PURE__ */
|
|
3816
|
-
/* @__PURE__ */
|
|
3817
|
-
/* @__PURE__ */
|
|
3818
|
-
group.sessions.map((chat) => /* @__PURE__ */
|
|
3911
|
+
return /* @__PURE__ */ jsxs11(Fragment, { children: [
|
|
3912
|
+
/* @__PURE__ */ jsx14("div", { class: `${p29}-history`, role: "list", children: groups.map((group) => /* @__PURE__ */ jsxs11("div", { class: `${p29}-history-group`, children: [
|
|
3913
|
+
/* @__PURE__ */ jsx14("div", { class: `${p29}-history-heading`, children: strings[BUCKET_TO_STRING[group.bucket]] }),
|
|
3914
|
+
group.sessions.map((chat) => /* @__PURE__ */ jsxs11(
|
|
3819
3915
|
"button",
|
|
3820
3916
|
{
|
|
3821
3917
|
type: "button",
|
|
3822
3918
|
role: "listitem",
|
|
3823
|
-
class: `${
|
|
3919
|
+
class: `${p29}-history-item`,
|
|
3824
3920
|
onClick: () => onSelect(chat),
|
|
3825
3921
|
"data-closed": chat.canContinue ? void 0 : "true",
|
|
3826
3922
|
"data-testid": tid(TID.historyItem, chat.sessionId),
|
|
3827
3923
|
children: [
|
|
3828
|
-
/* @__PURE__ */
|
|
3829
|
-
chat.preview ? /* @__PURE__ */
|
|
3924
|
+
/* @__PURE__ */ jsx14("span", { class: `${p29}-history-title`, children: chat.title }),
|
|
3925
|
+
chat.preview ? /* @__PURE__ */ jsx14("span", { class: `${p29}-history-preview`, children: chat.preview }) : null
|
|
3830
3926
|
]
|
|
3831
3927
|
},
|
|
3832
3928
|
chat.sessionId
|
|
@@ -3837,153 +3933,21 @@ function ConversationList({ transport, strings, visitorId, onSelect, onNewChat }
|
|
|
3837
3933
|
}
|
|
3838
3934
|
|
|
3839
3935
|
// src/ui/chat-history-pane.tsx
|
|
3840
|
-
import { jsx as
|
|
3936
|
+
import { jsx as jsx15 } from "preact/jsx-runtime";
|
|
3841
3937
|
function ChatHistoryPane(props2) {
|
|
3842
|
-
return /* @__PURE__ */
|
|
3843
|
-
}
|
|
3844
|
-
|
|
3845
|
-
// src/ui/language-switcher.tsx
|
|
3846
|
-
import { useCallback as useCallback2 } from "preact/hooks";
|
|
3847
|
-
import { jsx as jsx15, jsxs as jsxs11 } from "preact/jsx-runtime";
|
|
3848
|
-
function LanguageSwitcher({ available, active, onSelect, triggerLabel }) {
|
|
3849
|
-
const p28 = BRAND.cssPrefix;
|
|
3850
|
-
const initialFocusIndex = useCallback2(() => available.indexOf(active), [available, active]);
|
|
3851
|
-
const menu = usePopoverMenu({ itemCount: available.length, initialFocusIndex });
|
|
3852
|
-
const handleSelect = (locale) => {
|
|
3853
|
-
onSelect(locale);
|
|
3854
|
-
menu.close();
|
|
3855
|
-
};
|
|
3856
|
-
return /* @__PURE__ */ jsxs11("div", { class: `${p28}-menu-wrap`, children: [
|
|
3857
|
-
/* @__PURE__ */ jsx15(
|
|
3858
|
-
"button",
|
|
3859
|
-
{
|
|
3860
|
-
ref: menu.triggerRef,
|
|
3861
|
-
type: "button",
|
|
3862
|
-
class: `${p28}-icon-btn`,
|
|
3863
|
-
"aria-label": triggerLabel,
|
|
3864
|
-
"aria-haspopup": "menu",
|
|
3865
|
-
"aria-expanded": menu.open,
|
|
3866
|
-
title: triggerLabel,
|
|
3867
|
-
onClick: menu.toggle,
|
|
3868
|
-
onKeyDown: menu.onTriggerKey,
|
|
3869
|
-
children: /* @__PURE__ */ jsx15(GlobeIcon, {})
|
|
3870
|
-
}
|
|
3871
|
-
),
|
|
3872
|
-
menu.open ? /* @__PURE__ */ jsx15(
|
|
3873
|
-
"div",
|
|
3874
|
-
{
|
|
3875
|
-
ref: menu.menuRef,
|
|
3876
|
-
class: `${p28}-menu`,
|
|
3877
|
-
role: "menu",
|
|
3878
|
-
"aria-label": triggerLabel,
|
|
3879
|
-
onKeyDown: menu.onMenuKey,
|
|
3880
|
-
tabIndex: -1,
|
|
3881
|
-
children: available.map((locale) => {
|
|
3882
|
-
const isActive = locale === active;
|
|
3883
|
-
return /* @__PURE__ */ jsxs11(
|
|
3884
|
-
"button",
|
|
3885
|
-
{
|
|
3886
|
-
type: "button",
|
|
3887
|
-
role: "menuitem",
|
|
3888
|
-
class: `${p28}-menu-item`,
|
|
3889
|
-
lang: locale,
|
|
3890
|
-
"aria-current": isActive ? "true" : void 0,
|
|
3891
|
-
onClick: () => handleSelect(locale),
|
|
3892
|
-
children: [
|
|
3893
|
-
/* @__PURE__ */ jsx15("span", { class: `${p28}-menu-label`, children: localeDisplayName(locale, active) }),
|
|
3894
|
-
isActive ? /* @__PURE__ */ jsx15("span", { class: `${p28}-menu-check`, "aria-hidden": "true", children: /* @__PURE__ */ jsx15(CheckIcon, {}) }) : null
|
|
3895
|
-
]
|
|
3896
|
-
},
|
|
3897
|
-
locale
|
|
3898
|
-
);
|
|
3899
|
-
})
|
|
3900
|
-
}
|
|
3901
|
-
) : null
|
|
3902
|
-
] });
|
|
3903
|
-
}
|
|
3904
|
-
|
|
3905
|
-
// src/ui/theme-switcher.tsx
|
|
3906
|
-
import { useCallback as useCallback3 } from "preact/hooks";
|
|
3907
|
-
import { jsx as jsx16, jsxs as jsxs12 } from "preact/jsx-runtime";
|
|
3908
|
-
var OPTIONS = ["auto", "light", "dark"];
|
|
3909
|
-
function iconFor(mode) {
|
|
3910
|
-
switch (mode) {
|
|
3911
|
-
case "light":
|
|
3912
|
-
return /* @__PURE__ */ jsx16(SunIcon, {});
|
|
3913
|
-
case "dark":
|
|
3914
|
-
return /* @__PURE__ */ jsx16(MoonIcon, {});
|
|
3915
|
-
case "auto":
|
|
3916
|
-
return /* @__PURE__ */ jsx16(ThemeAutoIcon, {});
|
|
3917
|
-
}
|
|
3918
|
-
}
|
|
3919
|
-
function ThemeSwitcher({ active, onSelect, triggerLabel, optionLabels }) {
|
|
3920
|
-
const p28 = BRAND.cssPrefix;
|
|
3921
|
-
const initialFocusIndex = useCallback3(() => OPTIONS.indexOf(active), [active]);
|
|
3922
|
-
const menu = usePopoverMenu({ itemCount: OPTIONS.length, initialFocusIndex });
|
|
3923
|
-
const handleSelect = (mode) => {
|
|
3924
|
-
onSelect(mode);
|
|
3925
|
-
menu.close();
|
|
3926
|
-
};
|
|
3927
|
-
return /* @__PURE__ */ jsxs12("div", { class: `${p28}-menu-wrap`, children: [
|
|
3928
|
-
/* @__PURE__ */ jsx16(
|
|
3929
|
-
"button",
|
|
3930
|
-
{
|
|
3931
|
-
ref: menu.triggerRef,
|
|
3932
|
-
type: "button",
|
|
3933
|
-
class: `${p28}-icon-btn`,
|
|
3934
|
-
"aria-label": triggerLabel,
|
|
3935
|
-
"aria-haspopup": "menu",
|
|
3936
|
-
"aria-expanded": menu.open,
|
|
3937
|
-
title: triggerLabel,
|
|
3938
|
-
"data-theme-active": active,
|
|
3939
|
-
onClick: menu.toggle,
|
|
3940
|
-
onKeyDown: menu.onTriggerKey,
|
|
3941
|
-
children: iconFor(active)
|
|
3942
|
-
}
|
|
3943
|
-
),
|
|
3944
|
-
menu.open ? /* @__PURE__ */ jsx16(
|
|
3945
|
-
"div",
|
|
3946
|
-
{
|
|
3947
|
-
ref: menu.menuRef,
|
|
3948
|
-
class: `${p28}-menu`,
|
|
3949
|
-
role: "menu",
|
|
3950
|
-
"aria-label": triggerLabel,
|
|
3951
|
-
onKeyDown: menu.onMenuKey,
|
|
3952
|
-
tabIndex: -1,
|
|
3953
|
-
children: OPTIONS.map((mode) => {
|
|
3954
|
-
const isActive = mode === active;
|
|
3955
|
-
return /* @__PURE__ */ jsxs12(
|
|
3956
|
-
"button",
|
|
3957
|
-
{
|
|
3958
|
-
type: "button",
|
|
3959
|
-
role: "menuitem",
|
|
3960
|
-
class: `${p28}-menu-item`,
|
|
3961
|
-
"aria-current": isActive ? "true" : void 0,
|
|
3962
|
-
onClick: () => handleSelect(mode),
|
|
3963
|
-
children: [
|
|
3964
|
-
/* @__PURE__ */ jsx16("span", { class: `${p28}-menu-icon`, children: iconFor(mode) }),
|
|
3965
|
-
/* @__PURE__ */ jsx16("span", { class: `${p28}-menu-label`, children: optionLabels[mode] }),
|
|
3966
|
-
isActive ? /* @__PURE__ */ jsx16("span", { class: `${p28}-menu-check`, "aria-hidden": "true", children: /* @__PURE__ */ jsx16(CheckIcon, {}) }) : null
|
|
3967
|
-
]
|
|
3968
|
-
},
|
|
3969
|
-
mode
|
|
3970
|
-
);
|
|
3971
|
-
})
|
|
3972
|
-
}
|
|
3973
|
-
) : null
|
|
3974
|
-
] });
|
|
3938
|
+
return /* @__PURE__ */ jsx15(ConversationList, { ...props2 });
|
|
3975
3939
|
}
|
|
3976
3940
|
|
|
3977
3941
|
// src/ui/suggestions.tsx
|
|
3978
|
-
import { jsx as
|
|
3979
|
-
var
|
|
3942
|
+
import { jsx as jsx16 } from "preact/jsx-runtime";
|
|
3943
|
+
var p12 = BRAND.cssPrefix;
|
|
3980
3944
|
function Suggestions({ suggestions, onPick }) {
|
|
3981
3945
|
if (suggestions.length === 0) return null;
|
|
3982
|
-
return /* @__PURE__ */
|
|
3946
|
+
return /* @__PURE__ */ jsx16("div", { class: `${p12}-suggestions`, role: "group", "aria-label": "Suggested replies", children: suggestions.map((s, i) => /* @__PURE__ */ jsx16(
|
|
3983
3947
|
"button",
|
|
3984
3948
|
{
|
|
3985
3949
|
type: "button",
|
|
3986
|
-
class: `${
|
|
3950
|
+
class: `${p12}-suggestion`,
|
|
3987
3951
|
onClick: () => onPick(s),
|
|
3988
3952
|
"data-testid": tid(TID.suggestion, i),
|
|
3989
3953
|
children: s.label
|
|
@@ -3993,8 +3957,8 @@ function Suggestions({ suggestions, onPick }) {
|
|
|
3993
3957
|
}
|
|
3994
3958
|
|
|
3995
3959
|
// src/ui/panel.tsx
|
|
3996
|
-
import { Fragment as Fragment2, jsx as
|
|
3997
|
-
var
|
|
3960
|
+
import { Fragment as Fragment2, jsx as jsx17, jsxs as jsxs12 } from "preact/jsx-runtime";
|
|
3961
|
+
var p13 = BRAND.cssPrefix;
|
|
3998
3962
|
function Panel(props2) {
|
|
3999
3963
|
const { options, onClose } = props2;
|
|
4000
3964
|
const s = options.strings;
|
|
@@ -4013,23 +3977,23 @@ function Panel(props2) {
|
|
|
4013
3977
|
};
|
|
4014
3978
|
}, [onClose]);
|
|
4015
3979
|
const composerAttachApiRef = useRef6(null);
|
|
4016
|
-
const onDropItems =
|
|
3980
|
+
const onDropItems = useCallback2((items) => {
|
|
4017
3981
|
composerAttachApiRef.current?.attachFromDrop(items);
|
|
4018
3982
|
}, []);
|
|
4019
3983
|
const { visible: dragOver } = useFileDrop({ containerRef, onDrop: onDropItems });
|
|
4020
3984
|
useDragMove(containerRef.current, options.mode === "modal");
|
|
4021
|
-
return /* @__PURE__ */
|
|
3985
|
+
return /* @__PURE__ */ jsxs12(
|
|
4022
3986
|
"div",
|
|
4023
3987
|
{
|
|
4024
3988
|
ref: containerRef,
|
|
4025
|
-
class: `${
|
|
3989
|
+
class: `${p13}-panel`,
|
|
4026
3990
|
role: "dialog",
|
|
4027
3991
|
"aria-modal": "false",
|
|
4028
3992
|
"aria-label": s.panelTitle,
|
|
4029
3993
|
style: { position: "relative" },
|
|
4030
3994
|
"data-testid": TID.panel,
|
|
4031
3995
|
children: [
|
|
4032
|
-
/* @__PURE__ */
|
|
3996
|
+
/* @__PURE__ */ jsx17(
|
|
4033
3997
|
PanelContent,
|
|
4034
3998
|
{
|
|
4035
3999
|
...props2,
|
|
@@ -4038,49 +4002,44 @@ function Panel(props2) {
|
|
|
4038
4002
|
composerAttachApiRef
|
|
4039
4003
|
}
|
|
4040
4004
|
),
|
|
4041
|
-
/* @__PURE__ */
|
|
4005
|
+
/* @__PURE__ */ jsx17(PoweredByBar, { poweredBy: props2.options.poweredBy })
|
|
4042
4006
|
]
|
|
4043
4007
|
}
|
|
4044
4008
|
);
|
|
4045
4009
|
}
|
|
4046
|
-
function PanelContent({
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
onSuggestion,
|
|
4077
|
-
containerEl,
|
|
4078
|
-
dragOver,
|
|
4079
|
-
composerAttachApiRef
|
|
4080
|
-
}) {
|
|
4010
|
+
function PanelContent(props2) {
|
|
4011
|
+
const {
|
|
4012
|
+
options,
|
|
4013
|
+
transport,
|
|
4014
|
+
feedback,
|
|
4015
|
+
bus,
|
|
4016
|
+
panelSize,
|
|
4017
|
+
view,
|
|
4018
|
+
canSend,
|
|
4019
|
+
isStreaming,
|
|
4020
|
+
loadingMessages,
|
|
4021
|
+
messagesSig,
|
|
4022
|
+
agent,
|
|
4023
|
+
suggestions,
|
|
4024
|
+
initialWidgetSize,
|
|
4025
|
+
visitorId,
|
|
4026
|
+
onClose,
|
|
4027
|
+
onBack,
|
|
4028
|
+
onClear,
|
|
4029
|
+
onToggleHistory,
|
|
4030
|
+
onSelectHistoryChat,
|
|
4031
|
+
onNewChat,
|
|
4032
|
+
onWidgetSizeChange,
|
|
4033
|
+
onSend,
|
|
4034
|
+
onStop,
|
|
4035
|
+
onSuggestion,
|
|
4036
|
+
containerEl,
|
|
4037
|
+
dragOver,
|
|
4038
|
+
composerAttachApiRef
|
|
4039
|
+
} = props2;
|
|
4081
4040
|
const s = options.strings;
|
|
4082
|
-
return /* @__PURE__ */
|
|
4083
|
-
view === "history" ? /* @__PURE__ */
|
|
4041
|
+
return /* @__PURE__ */ jsxs12(Fragment2, { children: [
|
|
4042
|
+
view === "history" ? /* @__PURE__ */ jsx17(
|
|
4084
4043
|
HistoryHeader,
|
|
4085
4044
|
{
|
|
4086
4045
|
strings: s,
|
|
@@ -4088,39 +4047,22 @@ function PanelContent({
|
|
|
4088
4047
|
onClose,
|
|
4089
4048
|
showClose: canShowClose(options.mode, panelSize, options.actions)
|
|
4090
4049
|
}
|
|
4091
|
-
) : /* @__PURE__ */
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
main: visibleActions(options.actions.main, options.mode, panelSize, { popOutUrl: options.popOutUrl }),
|
|
4108
|
-
overflow: visibleActions(options.actions.overflow, options.mode, panelSize, { popOutUrl: options.popOutUrl }),
|
|
4109
|
-
descriptors: buildDescriptors({
|
|
4110
|
-
strings: s,
|
|
4111
|
-
panelSize,
|
|
4112
|
-
feedback,
|
|
4113
|
-
onClear,
|
|
4114
|
-
onExpand,
|
|
4115
|
-
onFullscreen,
|
|
4116
|
-
onPopOut,
|
|
4117
|
-
onSoundToggle,
|
|
4118
|
-
onToggleHistory,
|
|
4119
|
-
onClose
|
|
4120
|
-
})
|
|
4121
|
-
}
|
|
4122
|
-
),
|
|
4123
|
-
view === "history" ? /* @__PURE__ */ jsx18(
|
|
4050
|
+
) : /* @__PURE__ */ jsxs12("header", { class: `${p13}-header`, "data-testid": TID.panelHeader, children: [
|
|
4051
|
+
onBack ? /* @__PURE__ */ jsx17(
|
|
4052
|
+
"button",
|
|
4053
|
+
{
|
|
4054
|
+
type: "button",
|
|
4055
|
+
class: `${p13}-icon-btn`,
|
|
4056
|
+
onClick: onBack,
|
|
4057
|
+
"aria-label": s.moduleBack,
|
|
4058
|
+
title: s.moduleBack,
|
|
4059
|
+
children: /* @__PURE__ */ jsx17(BackIcon, {})
|
|
4060
|
+
}
|
|
4061
|
+
) : null,
|
|
4062
|
+
agent ? /* @__PURE__ */ jsx17(AgentBadge, { agent }) : /* @__PURE__ */ jsx17("h1", { children: s.panelTitle }),
|
|
4063
|
+
/* @__PURE__ */ jsx17(HeaderActions, { panelProps: props2, variant: "chat" })
|
|
4064
|
+
] }),
|
|
4065
|
+
view === "history" ? /* @__PURE__ */ jsx17(
|
|
4124
4066
|
ChatHistoryPane,
|
|
4125
4067
|
{
|
|
4126
4068
|
transport,
|
|
@@ -4129,9 +4071,9 @@ function PanelContent({
|
|
|
4129
4071
|
onSelect: (chat) => onSelectHistoryChat(chat.sessionId),
|
|
4130
4072
|
onNewChat
|
|
4131
4073
|
}
|
|
4132
|
-
) : /* @__PURE__ */
|
|
4133
|
-
/* @__PURE__ */
|
|
4134
|
-
/* @__PURE__ */
|
|
4074
|
+
) : /* @__PURE__ */ jsxs12(Fragment2, { children: [
|
|
4075
|
+
/* @__PURE__ */ jsx17(DropZone, { visible: dragOver, strings: s }),
|
|
4076
|
+
/* @__PURE__ */ jsx17(
|
|
4135
4077
|
MessageList,
|
|
4136
4078
|
{
|
|
4137
4079
|
messagesSig,
|
|
@@ -4142,9 +4084,9 @@ function PanelContent({
|
|
|
4142
4084
|
loading: loadingMessages
|
|
4143
4085
|
}
|
|
4144
4086
|
),
|
|
4145
|
-
canSend ? /* @__PURE__ */
|
|
4146
|
-
/* @__PURE__ */
|
|
4147
|
-
/* @__PURE__ */
|
|
4087
|
+
canSend ? /* @__PURE__ */ jsxs12(Fragment2, { children: [
|
|
4088
|
+
/* @__PURE__ */ jsx17(Suggestions, { suggestions, onPick: onSuggestion }),
|
|
4089
|
+
/* @__PURE__ */ jsx17(
|
|
4148
4090
|
Composer,
|
|
4149
4091
|
{
|
|
4150
4092
|
options,
|
|
@@ -4157,10 +4099,10 @@ function PanelContent({
|
|
|
4157
4099
|
attachApiRef: composerAttachApiRef
|
|
4158
4100
|
}
|
|
4159
4101
|
)
|
|
4160
|
-
] }) : /* @__PURE__ */
|
|
4161
|
-
/* @__PURE__ */
|
|
4102
|
+
] }) : /* @__PURE__ */ jsx17(ReadOnlyBanner, { label: s.chatClosed, ctaLabel: s.startNewConversation, onNewChat: onClear }),
|
|
4103
|
+
/* @__PURE__ */ jsx17(ComposerFooter, { disclaimer: options.composerDisclaimer })
|
|
4162
4104
|
] }),
|
|
4163
|
-
options.size.resize?.enabled ? /* @__PURE__ */
|
|
4105
|
+
options.size.resize?.enabled ? /* @__PURE__ */ jsx17(
|
|
4164
4106
|
ResizeGrip,
|
|
4165
4107
|
{
|
|
4166
4108
|
panelEl: containerEl,
|
|
@@ -4179,236 +4121,86 @@ function HistoryHeader({
|
|
|
4179
4121
|
onClose,
|
|
4180
4122
|
showClose
|
|
4181
4123
|
}) {
|
|
4182
|
-
return /* @__PURE__ */
|
|
4183
|
-
/* @__PURE__ */
|
|
4124
|
+
return /* @__PURE__ */ jsxs12("header", { class: `${p13}-header`, children: [
|
|
4125
|
+
/* @__PURE__ */ jsx17(
|
|
4184
4126
|
"button",
|
|
4185
4127
|
{
|
|
4186
4128
|
type: "button",
|
|
4187
|
-
class: `${
|
|
4129
|
+
class: `${p13}-icon-btn`,
|
|
4188
4130
|
onClick: onBack,
|
|
4189
4131
|
"aria-label": strings.historyBack,
|
|
4190
4132
|
title: strings.historyBack,
|
|
4191
|
-
children: /* @__PURE__ */
|
|
4133
|
+
children: /* @__PURE__ */ jsx17(BackIcon, {})
|
|
4192
4134
|
}
|
|
4193
4135
|
),
|
|
4194
|
-
/* @__PURE__ */
|
|
4195
|
-
showClose ? /* @__PURE__ */
|
|
4136
|
+
/* @__PURE__ */ jsx17("h1", { children: strings.historyTitle }),
|
|
4137
|
+
showClose ? /* @__PURE__ */ jsx17(
|
|
4196
4138
|
"button",
|
|
4197
4139
|
{
|
|
4198
4140
|
type: "button",
|
|
4199
|
-
class: `${
|
|
4141
|
+
class: `${p13}-icon-btn`,
|
|
4200
4142
|
onClick: onClose,
|
|
4201
4143
|
"aria-label": strings.close,
|
|
4202
4144
|
title: strings.close,
|
|
4203
|
-
children: /* @__PURE__ */
|
|
4145
|
+
children: /* @__PURE__ */ jsx17(CloseIcon, {})
|
|
4204
4146
|
}
|
|
4205
4147
|
) : null
|
|
4206
4148
|
] });
|
|
4207
4149
|
}
|
|
4208
4150
|
function ReadOnlyBanner({ label, ctaLabel, onNewChat }) {
|
|
4209
|
-
return /* @__PURE__ */
|
|
4210
|
-
/* @__PURE__ */
|
|
4211
|
-
/* @__PURE__ */
|
|
4151
|
+
return /* @__PURE__ */ jsxs12("div", { class: `${p13}-readonly-banner`, role: "note", children: [
|
|
4152
|
+
/* @__PURE__ */ jsx17("span", { class: `${p13}-readonly-label`, children: label }),
|
|
4153
|
+
/* @__PURE__ */ jsx17("button", { type: "button", class: `${p13}-readonly-cta`, onClick: onNewChat, children: ctaLabel })
|
|
4212
4154
|
] });
|
|
4213
4155
|
}
|
|
4214
4156
|
function ComposerFooter({ disclaimer }) {
|
|
4215
4157
|
if (!disclaimer) return null;
|
|
4216
|
-
return /* @__PURE__ */
|
|
4158
|
+
return /* @__PURE__ */ jsx17("div", { class: `${p13}-composer-footer`, children: /* @__PURE__ */ jsx17("div", { class: `${p13}-disclaimer`, children: disclaimer }) });
|
|
4217
4159
|
}
|
|
4218
4160
|
function PoweredByBar({ poweredBy }) {
|
|
4219
4161
|
if (!poweredBy) return null;
|
|
4220
|
-
return /* @__PURE__ */
|
|
4162
|
+
return /* @__PURE__ */ jsx17("div", { class: `${p13}-poweredby-bar`, children: /* @__PURE__ */ jsx17(PoweredBy, { logoUrl: poweredBy.logoUrl, text: poweredBy.text, href: poweredBy.href }) });
|
|
4221
4163
|
}
|
|
4222
4164
|
function PoweredBy({ logoUrl, text, href }) {
|
|
4223
|
-
const inner = /* @__PURE__ */
|
|
4224
|
-
logoUrl ? /* @__PURE__ */
|
|
4225
|
-
text ? /* @__PURE__ */
|
|
4165
|
+
const inner = /* @__PURE__ */ jsxs12(Fragment2, { children: [
|
|
4166
|
+
logoUrl ? /* @__PURE__ */ jsx17("img", { class: `${p13}-poweredby-logo`, src: logoUrl, alt: "", loading: "lazy" }) : null,
|
|
4167
|
+
text ? /* @__PURE__ */ jsx17("span", { children: text }) : null
|
|
4226
4168
|
] });
|
|
4227
4169
|
if (href) {
|
|
4228
|
-
return /* @__PURE__ */
|
|
4170
|
+
return /* @__PURE__ */ jsx17("a", { class: `${p13}-poweredby`, href, target: "_blank", rel: "noopener noreferrer", children: inner });
|
|
4229
4171
|
}
|
|
4230
|
-
return /* @__PURE__ */
|
|
4231
|
-
}
|
|
4232
|
-
function Header({
|
|
4233
|
-
agent,
|
|
4234
|
-
onBack,
|
|
4235
|
-
backLabel,
|
|
4236
|
-
moreActionsLabel,
|
|
4237
|
-
languageLabel,
|
|
4238
|
-
themeLabel,
|
|
4239
|
-
themeOptionLabels,
|
|
4240
|
-
activeThemeMode,
|
|
4241
|
-
onThemeChange,
|
|
4242
|
-
panelTitle,
|
|
4243
|
-
activeLocale,
|
|
4244
|
-
availableLocales,
|
|
4245
|
-
onLocaleChange,
|
|
4246
|
-
main,
|
|
4247
|
-
overflow,
|
|
4248
|
-
descriptors
|
|
4249
|
-
}) {
|
|
4250
|
-
const showLanguage = availableLocales.length > 1;
|
|
4251
|
-
const overflowItems = [];
|
|
4252
|
-
for (const name of overflow) {
|
|
4253
|
-
if (name === "theme") continue;
|
|
4254
|
-
if (name === "language") {
|
|
4255
|
-
if (!showLanguage) continue;
|
|
4256
|
-
for (const locale of availableLocales) {
|
|
4257
|
-
overflowItems.push({
|
|
4258
|
-
id: `language:${locale}`,
|
|
4259
|
-
label: languageLabel + ` \u2014 ${locale}`,
|
|
4260
|
-
lang: locale,
|
|
4261
|
-
onSelect: () => onLocaleChange(locale),
|
|
4262
|
-
type: "switch",
|
|
4263
|
-
on: locale === activeLocale
|
|
4264
|
-
});
|
|
4265
|
-
}
|
|
4266
|
-
continue;
|
|
4267
|
-
}
|
|
4268
|
-
const d = descriptors[name];
|
|
4269
|
-
overflowItems.push({
|
|
4270
|
-
id: name,
|
|
4271
|
-
icon: d.icon,
|
|
4272
|
-
label: d.label,
|
|
4273
|
-
onSelect: d.onSelect,
|
|
4274
|
-
type: d.switchable ? "switch" : "button",
|
|
4275
|
-
on: d.switchOn
|
|
4276
|
-
});
|
|
4277
|
-
}
|
|
4278
|
-
const themeInOverflow = overflow.includes("theme");
|
|
4279
|
-
return /* @__PURE__ */ jsxs13("header", { class: `${p12}-header`, "data-testid": TID.panelHeader, children: [
|
|
4280
|
-
onBack ? /* @__PURE__ */ jsx18("button", { type: "button", class: `${p12}-icon-btn`, onClick: onBack, "aria-label": backLabel, title: backLabel, children: /* @__PURE__ */ jsx18(BackIcon, {}) }) : null,
|
|
4281
|
-
agent ? /* @__PURE__ */ jsx18(AgentBadge, { agent }) : /* @__PURE__ */ jsx18("h1", { children: panelTitle }),
|
|
4282
|
-
main.map((name) => {
|
|
4283
|
-
if (name === "language") {
|
|
4284
|
-
if (!showLanguage) return null;
|
|
4285
|
-
return /* @__PURE__ */ jsx18(
|
|
4286
|
-
LanguageSwitcher,
|
|
4287
|
-
{
|
|
4288
|
-
available: availableLocales,
|
|
4289
|
-
active: activeLocale,
|
|
4290
|
-
onSelect: onLocaleChange,
|
|
4291
|
-
triggerLabel: languageLabel
|
|
4292
|
-
},
|
|
4293
|
-
"language"
|
|
4294
|
-
);
|
|
4295
|
-
}
|
|
4296
|
-
if (name === "theme") {
|
|
4297
|
-
return /* @__PURE__ */ jsx18(
|
|
4298
|
-
ThemeSwitcher,
|
|
4299
|
-
{
|
|
4300
|
-
active: activeThemeMode,
|
|
4301
|
-
onSelect: onThemeChange,
|
|
4302
|
-
triggerLabel: themeLabel,
|
|
4303
|
-
optionLabels: themeOptionLabels
|
|
4304
|
-
},
|
|
4305
|
-
"theme"
|
|
4306
|
-
);
|
|
4307
|
-
}
|
|
4308
|
-
const d = descriptors[name];
|
|
4309
|
-
return /* @__PURE__ */ jsx18(
|
|
4310
|
-
"button",
|
|
4311
|
-
{
|
|
4312
|
-
type: "button",
|
|
4313
|
-
class: `${p12}-icon-btn`,
|
|
4314
|
-
onClick: d.onSelect,
|
|
4315
|
-
"aria-label": d.label,
|
|
4316
|
-
"aria-pressed": d.switchable ? d.switchOn : void 0,
|
|
4317
|
-
title: d.label,
|
|
4318
|
-
"data-testid": ACTION_TID[name],
|
|
4319
|
-
children: d.icon
|
|
4320
|
-
},
|
|
4321
|
-
name
|
|
4322
|
-
);
|
|
4323
|
-
}),
|
|
4324
|
-
themeInOverflow ? /* @__PURE__ */ jsx18(
|
|
4325
|
-
ThemeSwitcher,
|
|
4326
|
-
{
|
|
4327
|
-
active: activeThemeMode,
|
|
4328
|
-
onSelect: onThemeChange,
|
|
4329
|
-
triggerLabel: themeLabel,
|
|
4330
|
-
optionLabels: themeOptionLabels
|
|
4331
|
-
}
|
|
4332
|
-
) : null,
|
|
4333
|
-
overflowItems.length > 0 ? /* @__PURE__ */ jsx18(OverflowMenu, { items: overflowItems, triggerLabel: moreActionsLabel }) : null
|
|
4334
|
-
] });
|
|
4335
|
-
}
|
|
4336
|
-
function buildDescriptors(args) {
|
|
4337
|
-
const {
|
|
4338
|
-
strings,
|
|
4339
|
-
panelSize,
|
|
4340
|
-
feedback,
|
|
4341
|
-
onClear,
|
|
4342
|
-
onExpand,
|
|
4343
|
-
onFullscreen,
|
|
4344
|
-
onPopOut,
|
|
4345
|
-
onSoundToggle,
|
|
4346
|
-
onToggleHistory,
|
|
4347
|
-
onClose
|
|
4348
|
-
} = args;
|
|
4349
|
-
const expandedNow = panelSize === "expanded";
|
|
4350
|
-
const fullscreenNow = panelSize === "fullscreen";
|
|
4351
|
-
const muted = useComputed3(() => feedback.mutedSig.value).value;
|
|
4352
|
-
return {
|
|
4353
|
-
clear: { icon: /* @__PURE__ */ jsx18(TrashIcon, {}), label: strings.newConversation, onSelect: onClear },
|
|
4354
|
-
expand: {
|
|
4355
|
-
icon: expandedNow ? /* @__PURE__ */ jsx18(CollapseIcon, {}) : /* @__PURE__ */ jsx18(ExpandIcon, {}),
|
|
4356
|
-
label: expandedNow ? strings.collapse : strings.expand,
|
|
4357
|
-
onSelect: onExpand,
|
|
4358
|
-
switchable: true,
|
|
4359
|
-
switchOn: expandedNow
|
|
4360
|
-
},
|
|
4361
|
-
fullscreen: {
|
|
4362
|
-
icon: fullscreenNow ? /* @__PURE__ */ jsx18(FullscreenExitIcon, {}) : /* @__PURE__ */ jsx18(FullscreenIcon, {}),
|
|
4363
|
-
label: fullscreenNow ? strings.exitFullscreen : strings.fullscreen,
|
|
4364
|
-
onSelect: onFullscreen,
|
|
4365
|
-
switchable: true,
|
|
4366
|
-
switchOn: fullscreenNow
|
|
4367
|
-
},
|
|
4368
|
-
popOut: { icon: /* @__PURE__ */ jsx18(PopOutIcon, {}), label: strings.popOut, onSelect: onPopOut },
|
|
4369
|
-
sound: {
|
|
4370
|
-
icon: muted ? /* @__PURE__ */ jsx18(SpeakerMutedIcon, {}) : /* @__PURE__ */ jsx18(SpeakerIcon, {}),
|
|
4371
|
-
label: muted ? strings.soundOff : strings.soundOn,
|
|
4372
|
-
onSelect: onSoundToggle,
|
|
4373
|
-
switchable: true,
|
|
4374
|
-
// The switch is "on" when sound is ENABLED (not muted).
|
|
4375
|
-
switchOn: !muted
|
|
4376
|
-
},
|
|
4377
|
-
history: { icon: /* @__PURE__ */ jsx18(HistoryIcon, {}), label: strings.history, onSelect: onToggleHistory },
|
|
4378
|
-
close: { icon: /* @__PURE__ */ jsx18(CloseIcon, {}), label: strings.close, onSelect: onClose ?? (() => {
|
|
4379
|
-
}) }
|
|
4380
|
-
};
|
|
4172
|
+
return /* @__PURE__ */ jsx17("span", { class: `${p13}-poweredby`, children: inner });
|
|
4381
4173
|
}
|
|
4382
4174
|
|
|
4383
4175
|
// src/ui/sidebar.tsx
|
|
4384
|
-
import { Fragment as Fragment3, jsx as
|
|
4176
|
+
import { Fragment as Fragment3, jsx as jsx18, jsxs as jsxs13 } from "preact/jsx-runtime";
|
|
4385
4177
|
function Sidebar(props2) {
|
|
4386
|
-
const
|
|
4178
|
+
const p29 = BRAND.cssPrefix;
|
|
4387
4179
|
const { site, blocks, strings, collapsed } = props2;
|
|
4388
4180
|
const navigation = blocks?.navigation ?? [];
|
|
4389
4181
|
const linkCards = blocks?.linkCards ?? [];
|
|
4390
4182
|
const toggleLabel = collapsed ? strings.expandSidebar : strings.collapseSidebar;
|
|
4391
|
-
return /* @__PURE__ */
|
|
4392
|
-
/* @__PURE__ */
|
|
4393
|
-
/* @__PURE__ */
|
|
4394
|
-
/* @__PURE__ */
|
|
4183
|
+
return /* @__PURE__ */ jsxs13("aside", { class: `${p29}-sidebar`, "data-collapsed": collapsed ? "true" : "false", "data-testid": TID.sidebar, children: [
|
|
4184
|
+
/* @__PURE__ */ jsxs13("div", { class: `${p29}-sidebar-header`, children: [
|
|
4185
|
+
/* @__PURE__ */ jsx18(SidebarBrand, { site }),
|
|
4186
|
+
/* @__PURE__ */ jsx18(
|
|
4395
4187
|
"button",
|
|
4396
4188
|
{
|
|
4397
4189
|
type: "button",
|
|
4398
|
-
class: `${
|
|
4190
|
+
class: `${p29}-sidebar-toggle`,
|
|
4399
4191
|
"aria-label": toggleLabel,
|
|
4400
4192
|
"aria-expanded": collapsed ? "false" : "true",
|
|
4401
4193
|
title: toggleLabel,
|
|
4402
4194
|
onClick: props2.onToggleCollapsed,
|
|
4403
4195
|
"data-testid": TID.sidebarToggle,
|
|
4404
|
-
children: /* @__PURE__ */
|
|
4196
|
+
children: /* @__PURE__ */ jsx18(SidebarToggleIcon, { collapsed })
|
|
4405
4197
|
}
|
|
4406
4198
|
)
|
|
4407
4199
|
] }),
|
|
4408
|
-
collapsed ? null : /* @__PURE__ */
|
|
4409
|
-
navigation.length > 0 ? /* @__PURE__ */
|
|
4410
|
-
linkCards.length > 0 ? /* @__PURE__ */
|
|
4411
|
-
props2.showConversations ? /* @__PURE__ */
|
|
4200
|
+
collapsed ? null : /* @__PURE__ */ jsxs13(Fragment3, { children: [
|
|
4201
|
+
navigation.length > 0 ? /* @__PURE__ */ jsx18("nav", { class: `${p29}-sidebar-section`, "data-section": "navigation", children: /* @__PURE__ */ jsx18(SidebarNav, { items: navigation }) }) : null,
|
|
4202
|
+
linkCards.length > 0 ? /* @__PURE__ */ jsx18("div", { class: `${p29}-sidebar-section`, "data-section": "link-cards", children: /* @__PURE__ */ jsx18(SidebarCards, { items: linkCards }) }) : null,
|
|
4203
|
+
props2.showConversations ? /* @__PURE__ */ jsx18("div", { class: `${p29}-sidebar-conversations`, children: /* @__PURE__ */ jsx18(
|
|
4412
4204
|
ConversationList,
|
|
4413
4205
|
{
|
|
4414
4206
|
transport: props2.transport,
|
|
@@ -4422,18 +4214,18 @@ function Sidebar(props2) {
|
|
|
4422
4214
|
] });
|
|
4423
4215
|
}
|
|
4424
4216
|
function SidebarBrand({ site }) {
|
|
4425
|
-
const
|
|
4217
|
+
const p29 = BRAND.cssPrefix;
|
|
4426
4218
|
if (site?.logo?.url) {
|
|
4427
4219
|
const alt = site.logo.alt ?? site.title ?? "Logo";
|
|
4428
|
-
return /* @__PURE__ */
|
|
4429
|
-
site.logoDark?.url ? /* @__PURE__ */
|
|
4430
|
-
/* @__PURE__ */
|
|
4220
|
+
return /* @__PURE__ */ jsxs13("picture", { children: [
|
|
4221
|
+
site.logoDark?.url ? /* @__PURE__ */ jsx18("source", { srcset: site.logoDark.url, media: "(prefers-color-scheme: dark)" }) : null,
|
|
4222
|
+
/* @__PURE__ */ jsx18("img", { class: `${p29}-sidebar-logo`, src: site.logo.url, alt })
|
|
4431
4223
|
] });
|
|
4432
4224
|
}
|
|
4433
|
-
return /* @__PURE__ */
|
|
4225
|
+
return /* @__PURE__ */ jsx18("div", { class: `${p29}-sidebar-title`, children: site?.title ?? BRAND.name });
|
|
4434
4226
|
}
|
|
4435
4227
|
function SidebarToggleIcon({ collapsed }) {
|
|
4436
|
-
return /* @__PURE__ */
|
|
4228
|
+
return /* @__PURE__ */ jsx18(
|
|
4437
4229
|
"svg",
|
|
4438
4230
|
{
|
|
4439
4231
|
width: "16",
|
|
@@ -4443,38 +4235,38 @@ function SidebarToggleIcon({ collapsed }) {
|
|
|
4443
4235
|
stroke: "currentColor",
|
|
4444
4236
|
"stroke-width": "2",
|
|
4445
4237
|
"aria-hidden": "true",
|
|
4446
|
-
children: collapsed ? /* @__PURE__ */
|
|
4238
|
+
children: collapsed ? /* @__PURE__ */ jsx18("polyline", { points: "9 6 15 12 9 18" }) : /* @__PURE__ */ jsx18("polyline", { points: "15 6 9 12 15 18" })
|
|
4447
4239
|
}
|
|
4448
4240
|
);
|
|
4449
4241
|
}
|
|
4450
4242
|
function SidebarNav({ items }) {
|
|
4451
|
-
const
|
|
4452
|
-
return /* @__PURE__ */
|
|
4243
|
+
const p29 = BRAND.cssPrefix;
|
|
4244
|
+
return /* @__PURE__ */ jsx18("ul", { class: `${p29}-sidebar-nav`, children: items.map((item) => /* @__PURE__ */ jsx18("li", { children: /* @__PURE__ */ jsxs13(
|
|
4453
4245
|
"a",
|
|
4454
4246
|
{
|
|
4455
|
-
class: `${
|
|
4247
|
+
class: `${p29}-sidebar-nav-item`,
|
|
4456
4248
|
href: item.href,
|
|
4457
4249
|
target: item.href ? "_blank" : void 0,
|
|
4458
4250
|
rel: item.href ? "noreferrer" : void 0,
|
|
4459
4251
|
children: [
|
|
4460
|
-
item.icon ? /* @__PURE__ */
|
|
4461
|
-
/* @__PURE__ */
|
|
4252
|
+
item.icon ? /* @__PURE__ */ jsx18("span", { class: `${p29}-sidebar-nav-icon`, "data-icon": item.icon }) : null,
|
|
4253
|
+
/* @__PURE__ */ jsx18("span", { class: `${p29}-sidebar-nav-label`, children: item.label })
|
|
4462
4254
|
]
|
|
4463
4255
|
}
|
|
4464
4256
|
) }, item.id ?? item.label)) });
|
|
4465
4257
|
}
|
|
4466
4258
|
function SidebarCards({ items }) {
|
|
4467
|
-
const
|
|
4468
|
-
return /* @__PURE__ */
|
|
4259
|
+
const p29 = BRAND.cssPrefix;
|
|
4260
|
+
return /* @__PURE__ */ jsx18("div", { class: `${p29}-sidebar-cards`, children: items.map((item) => /* @__PURE__ */ jsxs13(
|
|
4469
4261
|
"a",
|
|
4470
4262
|
{
|
|
4471
|
-
class: `${
|
|
4263
|
+
class: `${p29}-sidebar-card`,
|
|
4472
4264
|
href: item.href,
|
|
4473
4265
|
target: item.href ? "_blank" : void 0,
|
|
4474
4266
|
rel: item.href ? "noreferrer" : void 0,
|
|
4475
4267
|
children: [
|
|
4476
|
-
/* @__PURE__ */
|
|
4477
|
-
item.description ? /* @__PURE__ */
|
|
4268
|
+
/* @__PURE__ */ jsx18("div", { class: `${p29}-sidebar-card-label`, children: item.label }),
|
|
4269
|
+
item.description ? /* @__PURE__ */ jsx18("div", { class: `${p29}-sidebar-card-desc`, children: item.description }) : null
|
|
4478
4270
|
]
|
|
4479
4271
|
},
|
|
4480
4272
|
item.id ?? item.label
|
|
@@ -4482,11 +4274,11 @@ function SidebarCards({ items }) {
|
|
|
4482
4274
|
}
|
|
4483
4275
|
|
|
4484
4276
|
// src/ui/page-shell.tsx
|
|
4485
|
-
import { jsx as
|
|
4486
|
-
var
|
|
4277
|
+
import { jsx as jsx19, jsxs as jsxs14 } from "preact/jsx-runtime";
|
|
4278
|
+
var p14 = BRAND.cssPrefix;
|
|
4487
4279
|
function PageShell(props2) {
|
|
4488
|
-
return /* @__PURE__ */
|
|
4489
|
-
/* @__PURE__ */
|
|
4280
|
+
return /* @__PURE__ */ jsxs14("main", { class: `${p14}-page-shell`, "data-sidebar-collapsed": props2.sidebarCollapsed ? "true" : "false", children: [
|
|
4281
|
+
/* @__PURE__ */ jsx19(
|
|
4490
4282
|
Sidebar,
|
|
4491
4283
|
{
|
|
4492
4284
|
site: props2.site,
|
|
@@ -4501,7 +4293,7 @@ function PageShell(props2) {
|
|
|
4501
4293
|
onToggleCollapsed: props2.onToggleSidebarCollapsed
|
|
4502
4294
|
}
|
|
4503
4295
|
),
|
|
4504
|
-
/* @__PURE__ */
|
|
4296
|
+
/* @__PURE__ */ jsx19("section", { class: `${p14}-page-chat`, "aria-label": "Chat", children: props2.children })
|
|
4505
4297
|
] });
|
|
4506
4298
|
}
|
|
4507
4299
|
|
|
@@ -4538,7 +4330,7 @@ var topScreen = (s) => activeStack(s).at(-1);
|
|
|
4538
4330
|
var atTabRoot = (s) => activeStack(s).length === 0;
|
|
4539
4331
|
|
|
4540
4332
|
// src/ui/messenger-home.tsx
|
|
4541
|
-
import { useCallback as
|
|
4333
|
+
import { useCallback as useCallback4, useEffect as useEffect15, useRef as useRef7 } from "preact/hooks";
|
|
4542
4334
|
import { useComputed as useComputed4 } from "@preact/signals";
|
|
4543
4335
|
|
|
4544
4336
|
// src/ui/modules/messages.tsx
|
|
@@ -4551,80 +4343,80 @@ var chatLayout = {
|
|
|
4551
4343
|
import { useEffect as useEffect11, useMemo as useMemo2, useState as useState6 } from "preact/hooks";
|
|
4552
4344
|
|
|
4553
4345
|
// src/ui/back-header.tsx
|
|
4554
|
-
import { jsx as
|
|
4555
|
-
var
|
|
4556
|
-
function TitleBar({ title,
|
|
4557
|
-
return /* @__PURE__ */
|
|
4558
|
-
/* @__PURE__ */
|
|
4559
|
-
/* @__PURE__ */
|
|
4560
|
-
|
|
4346
|
+
import { jsx as jsx20, jsxs as jsxs15 } from "preact/jsx-runtime";
|
|
4347
|
+
var p15 = BRAND.cssPrefix;
|
|
4348
|
+
function TitleBar({ title, actions }) {
|
|
4349
|
+
return /* @__PURE__ */ jsxs15("header", { class: `${p15}-back-header`, "data-variant": "title", children: [
|
|
4350
|
+
/* @__PURE__ */ jsx20("span", { class: `${p15}-back-spacer`, "aria-hidden": "true" }),
|
|
4351
|
+
/* @__PURE__ */ jsx20("h1", { class: `${p15}-back-title`, children: title }),
|
|
4352
|
+
actions ?? /* @__PURE__ */ jsx20("span", { class: `${p15}-back-spacer`, "aria-hidden": "true" })
|
|
4561
4353
|
] });
|
|
4562
4354
|
}
|
|
4563
|
-
function BackHeader({ title, backLabel, onBack,
|
|
4564
|
-
return /* @__PURE__ */
|
|
4565
|
-
/* @__PURE__ */
|
|
4566
|
-
/* @__PURE__ */
|
|
4567
|
-
|
|
4355
|
+
function BackHeader({ title, backLabel, onBack, actions, testid }) {
|
|
4356
|
+
return /* @__PURE__ */ jsxs15("header", { class: `${p15}-back-header`, "data-testid": testid, children: [
|
|
4357
|
+
/* @__PURE__ */ jsx20("button", { type: "button", class: `${p15}-icon-btn`, onClick: onBack, "aria-label": backLabel, title: backLabel, children: /* @__PURE__ */ jsx20(BackIcon, {}) }),
|
|
4358
|
+
/* @__PURE__ */ jsx20("h1", { class: `${p15}-back-title`, children: title }),
|
|
4359
|
+
actions ?? /* @__PURE__ */ jsx20("span", { class: `${p15}-back-spacer`, "aria-hidden": "true" })
|
|
4568
4360
|
] });
|
|
4569
4361
|
}
|
|
4570
4362
|
|
|
4571
4363
|
// src/ui/home-search.tsx
|
|
4572
|
-
import { jsx as
|
|
4573
|
-
var
|
|
4364
|
+
import { jsx as jsx21, jsxs as jsxs16 } from "preact/jsx-runtime";
|
|
4365
|
+
var p16 = BRAND.cssPrefix;
|
|
4574
4366
|
function HomeSearchButton({ placeholder, onActivate }) {
|
|
4575
|
-
return /* @__PURE__ */
|
|
4576
|
-
/* @__PURE__ */
|
|
4577
|
-
/* @__PURE__ */
|
|
4367
|
+
return /* @__PURE__ */ jsxs16("button", { type: "button", class: `${p16}-home-search`, onClick: onActivate, "data-testid": TID.homeSearch, children: [
|
|
4368
|
+
/* @__PURE__ */ jsx21("span", { class: `${p16}-home-search-text`, children: placeholder }),
|
|
4369
|
+
/* @__PURE__ */ jsx21("span", { class: `${p16}-home-search-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx21(SearchIcon, {}) })
|
|
4578
4370
|
] });
|
|
4579
4371
|
}
|
|
4580
4372
|
function HelpSearchInput({ placeholder, value, onInput }) {
|
|
4581
|
-
return /* @__PURE__ */
|
|
4582
|
-
/* @__PURE__ */
|
|
4373
|
+
return /* @__PURE__ */ jsxs16("div", { class: `${p16}-home-search`, "data-input": "true", children: [
|
|
4374
|
+
/* @__PURE__ */ jsx21(
|
|
4583
4375
|
"input",
|
|
4584
4376
|
{
|
|
4585
4377
|
type: "search",
|
|
4586
|
-
class: `${
|
|
4378
|
+
class: `${p16}-home-search-input`,
|
|
4587
4379
|
placeholder,
|
|
4588
4380
|
value,
|
|
4589
4381
|
onInput: (e) => onInput(e.currentTarget.value),
|
|
4590
4382
|
"data-testid": TID.helpSearch
|
|
4591
4383
|
}
|
|
4592
4384
|
),
|
|
4593
|
-
/* @__PURE__ */
|
|
4385
|
+
/* @__PURE__ */ jsx21("span", { class: `${p16}-home-search-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx21(SearchIcon, {}) })
|
|
4594
4386
|
] });
|
|
4595
4387
|
}
|
|
4596
4388
|
|
|
4597
4389
|
// src/ui/list-row.tsx
|
|
4598
|
-
import { jsx as
|
|
4599
|
-
var
|
|
4390
|
+
import { jsx as jsx22, jsxs as jsxs17 } from "preact/jsx-runtime";
|
|
4391
|
+
var p17 = BRAND.cssPrefix;
|
|
4600
4392
|
function ListRow({ title, subtitle, onClick, testid }) {
|
|
4601
|
-
return /* @__PURE__ */
|
|
4602
|
-
/* @__PURE__ */
|
|
4603
|
-
/* @__PURE__ */
|
|
4604
|
-
subtitle ? /* @__PURE__ */
|
|
4393
|
+
return /* @__PURE__ */ jsxs17("button", { type: "button", class: `${p17}-list-row`, onClick, "data-testid": testid, children: [
|
|
4394
|
+
/* @__PURE__ */ jsxs17("span", { class: `${p17}-list-row-body`, children: [
|
|
4395
|
+
/* @__PURE__ */ jsx22("span", { class: `${p17}-list-row-title`, children: title }),
|
|
4396
|
+
subtitle ? /* @__PURE__ */ jsx22("span", { class: `${p17}-list-row-sub`, children: subtitle }) : null
|
|
4605
4397
|
] }),
|
|
4606
|
-
/* @__PURE__ */
|
|
4398
|
+
/* @__PURE__ */ jsx22("span", { class: `${p17}-list-row-chevron`, "aria-hidden": "true", children: /* @__PURE__ */ jsx22(ChevronRightIcon, {}) })
|
|
4607
4399
|
] });
|
|
4608
4400
|
}
|
|
4609
4401
|
|
|
4610
4402
|
// src/ui/module-state.tsx
|
|
4611
|
-
import { jsx as
|
|
4612
|
-
var
|
|
4403
|
+
import { jsx as jsx23, jsxs as jsxs18 } from "preact/jsx-runtime";
|
|
4404
|
+
var p18 = BRAND.cssPrefix;
|
|
4613
4405
|
function ModuleState({
|
|
4614
4406
|
tone = "info",
|
|
4615
4407
|
message,
|
|
4616
4408
|
onRetry,
|
|
4617
4409
|
strings
|
|
4618
4410
|
}) {
|
|
4619
|
-
return /* @__PURE__ */
|
|
4620
|
-
/* @__PURE__ */
|
|
4621
|
-
onRetry ? /* @__PURE__ */
|
|
4411
|
+
return /* @__PURE__ */ jsxs18("div", { class: `${p18}-module-empty`, role: tone === "error" ? "alert" : "status", "aria-live": "polite", children: [
|
|
4412
|
+
/* @__PURE__ */ jsx23("span", { children: message }),
|
|
4413
|
+
onRetry ? /* @__PURE__ */ jsx23("button", { type: "button", class: `${p18}-module-retry`, onClick: onRetry, children: strings.errorRetry }) : null
|
|
4622
4414
|
] });
|
|
4623
4415
|
}
|
|
4624
4416
|
|
|
4625
4417
|
// src/ui/modules/help.tsx
|
|
4626
|
-
import { jsx as
|
|
4627
|
-
var
|
|
4418
|
+
import { jsx as jsx24, jsxs as jsxs19 } from "preact/jsx-runtime";
|
|
4419
|
+
var p19 = BRAND.cssPrefix;
|
|
4628
4420
|
var log12 = logger.scope("help");
|
|
4629
4421
|
var openArticle = (nav, a) => a.url ? nav.push({ kind: "iframe", url: a.url, title: a.title }) : nav.push({ kind: "content", id: a.id, title: a.title });
|
|
4630
4422
|
function groupByCategory(items) {
|
|
@@ -4653,7 +4445,7 @@ function fuzzySearch(items, query) {
|
|
|
4653
4445
|
return items.map((item) => ({ item, score: Math.max(fuzzyScore(q, item.title) * 2, fuzzyScore(q, item.description ?? "")) })).filter((r) => r.score > 0).toSorted((a, b) => b.score - a.score).map((r) => r.item);
|
|
4654
4446
|
}
|
|
4655
4447
|
function ArticleRow({ article, nav }) {
|
|
4656
|
-
return /* @__PURE__ */
|
|
4448
|
+
return /* @__PURE__ */ jsx24(
|
|
4657
4449
|
ListRow,
|
|
4658
4450
|
{
|
|
4659
4451
|
title: article.title,
|
|
@@ -4690,46 +4482,46 @@ function HelpRoot({ transport, strings, config, nav, panelProps }) {
|
|
|
4690
4482
|
const results = useMemo2(() => fuzzySearch(items, query), [items, query]);
|
|
4691
4483
|
function renderBody() {
|
|
4692
4484
|
if (query.trim().length > 0) {
|
|
4693
|
-
if (results.length === 0) return /* @__PURE__ */
|
|
4694
|
-
return /* @__PURE__ */
|
|
4485
|
+
if (results.length === 0) return /* @__PURE__ */ jsx24(ModuleState, { message: strings.helpSearchEmpty, strings });
|
|
4486
|
+
return /* @__PURE__ */ jsx24("div", { class: `${p19}-help-card`, children: results.map((a) => /* @__PURE__ */ jsx24(ArticleRow, { article: a, nav }, a.id)) });
|
|
4695
4487
|
}
|
|
4696
|
-
if (state === "loading") return /* @__PURE__ */
|
|
4488
|
+
if (state === "loading") return /* @__PURE__ */ jsx24(ModuleState, { message: strings.helpLoading, strings });
|
|
4697
4489
|
if (state === "error") {
|
|
4698
|
-
return /* @__PURE__ */
|
|
4490
|
+
return /* @__PURE__ */ jsx24(ModuleState, { tone: "error", message: errorMsg, onRetry: () => setReloadKey((k) => k + 1), strings });
|
|
4699
4491
|
}
|
|
4700
|
-
if (items.length === 0) return /* @__PURE__ */
|
|
4701
|
-
return groupByCategory(items).map(([category, rows]) => /* @__PURE__ */
|
|
4702
|
-
category ? /* @__PURE__ */
|
|
4703
|
-
/* @__PURE__ */
|
|
4492
|
+
if (items.length === 0) return /* @__PURE__ */ jsx24(ModuleState, { message: strings.helpEmpty, strings });
|
|
4493
|
+
return groupByCategory(items).map(([category, rows]) => /* @__PURE__ */ jsxs19("section", { class: `${p19}-help-group`, children: [
|
|
4494
|
+
category ? /* @__PURE__ */ jsx24("h2", { class: `${p19}-help-section-title`, children: category }) : null,
|
|
4495
|
+
/* @__PURE__ */ jsx24("div", { class: `${p19}-help-card`, children: rows.map((a) => /* @__PURE__ */ jsx24(ArticleRow, { article: a, nav }, a.id)) })
|
|
4704
4496
|
] }, category));
|
|
4705
4497
|
}
|
|
4706
|
-
return /* @__PURE__ */
|
|
4707
|
-
/* @__PURE__ */
|
|
4708
|
-
/* @__PURE__ */
|
|
4709
|
-
/* @__PURE__ */
|
|
4498
|
+
return /* @__PURE__ */ jsxs19("div", { class: `${p19}-module`, children: [
|
|
4499
|
+
/* @__PURE__ */ jsx24(TitleBar, { title: strings.helpTitle, actions: /* @__PURE__ */ jsx24(HeaderActions, { panelProps, variant: "plain" }) }),
|
|
4500
|
+
/* @__PURE__ */ jsx24("div", { class: `${p19}-module-pad`, children: /* @__PURE__ */ jsx24(HelpSearchInput, { placeholder: strings.helpSearchPlaceholder, value: query, onInput: setQuery }) }),
|
|
4501
|
+
/* @__PURE__ */ jsx24("div", { class: `${p19}-help-list`, children: renderBody() })
|
|
4710
4502
|
] });
|
|
4711
4503
|
}
|
|
4712
4504
|
var helpLayout = {
|
|
4713
4505
|
Icon: HelpIcon,
|
|
4714
|
-
Root: (props2) => /* @__PURE__ */
|
|
4506
|
+
Root: (props2) => /* @__PURE__ */ jsx24(HelpRoot, { ...props2 })
|
|
4715
4507
|
};
|
|
4716
4508
|
|
|
4717
4509
|
// src/ui/modules/home.tsx
|
|
4718
4510
|
import { useEffect as useEffect12, useState as useState7 } from "preact/hooks";
|
|
4719
4511
|
|
|
4720
4512
|
// src/ui/home-card.tsx
|
|
4721
|
-
import { jsx as
|
|
4722
|
-
var
|
|
4513
|
+
import { jsx as jsx25 } from "preact/jsx-runtime";
|
|
4514
|
+
var p20 = BRAND.cssPrefix;
|
|
4723
4515
|
function HomeCard({ onClick, children, testid }) {
|
|
4724
4516
|
if (onClick) {
|
|
4725
|
-
return /* @__PURE__ */
|
|
4517
|
+
return /* @__PURE__ */ jsx25("button", { type: "button", class: `${p20}-home-card`, "data-interactive": "true", onClick, "data-testid": testid, children });
|
|
4726
4518
|
}
|
|
4727
|
-
return /* @__PURE__ */
|
|
4519
|
+
return /* @__PURE__ */ jsx25("div", { class: `${p20}-home-card`, "data-testid": testid, children });
|
|
4728
4520
|
}
|
|
4729
4521
|
|
|
4730
4522
|
// src/ui/modules/home.tsx
|
|
4731
|
-
import { Fragment as Fragment4, jsx as
|
|
4732
|
-
var
|
|
4523
|
+
import { Fragment as Fragment4, jsx as jsx26, jsxs as jsxs20 } from "preact/jsx-runtime";
|
|
4524
|
+
var p21 = BRAND.cssPrefix;
|
|
4733
4525
|
var log13 = logger.scope("home");
|
|
4734
4526
|
function resolveGreeting(props2) {
|
|
4735
4527
|
const name = props2.options.userContext?.name;
|
|
@@ -4766,59 +4558,49 @@ function HomeRoot(props2) {
|
|
|
4766
4558
|
const avatars = config.userAvatars ?? [];
|
|
4767
4559
|
const status = config.status;
|
|
4768
4560
|
const contentTitle = config.contentBlockTitle ? moduleLabel(strings, config.contentBlockTitle) : strings.homeContentTitle;
|
|
4769
|
-
return /* @__PURE__ */
|
|
4770
|
-
/* @__PURE__ */
|
|
4771
|
-
/* @__PURE__ */
|
|
4772
|
-
config.brandName ? /* @__PURE__ */
|
|
4773
|
-
/* @__PURE__ */
|
|
4774
|
-
avatars.length > 0 ? /* @__PURE__ */
|
|
4775
|
-
|
|
4776
|
-
"button",
|
|
4777
|
-
{
|
|
4778
|
-
type: "button",
|
|
4779
|
-
class: `${p20}-icon-btn ${p20}-home-close`,
|
|
4780
|
-
onClick: panelProps.onClose,
|
|
4781
|
-
"aria-label": strings.close,
|
|
4782
|
-
title: strings.close,
|
|
4783
|
-
children: /* @__PURE__ */ jsx27(CloseIcon, {})
|
|
4784
|
-
}
|
|
4785
|
-
) : null
|
|
4561
|
+
return /* @__PURE__ */ jsx26("div", { class: `${p21}-module ${p21}-home`, "data-testid": TID.homeView, children: /* @__PURE__ */ jsxs20("div", { class: `${p21}-home-scroll`, children: [
|
|
4562
|
+
/* @__PURE__ */ jsxs20("div", { class: `${p21}-home-hero`, children: [
|
|
4563
|
+
/* @__PURE__ */ jsxs20("div", { class: `${p21}-home-hero-top`, children: [
|
|
4564
|
+
config.brandName ? /* @__PURE__ */ jsx26("span", { class: `${p21}-home-brand`, "data-testid": TID.homeBrand, children: config.brandName }) : /* @__PURE__ */ jsx26("span", { class: `${p21}-home-brand-spacer`, "aria-hidden": "true" }),
|
|
4565
|
+
/* @__PURE__ */ jsxs20("div", { class: `${p21}-home-hero-actions`, children: [
|
|
4566
|
+
avatars.length > 0 ? /* @__PURE__ */ jsx26("div", { class: `${p21}-home-avatars`, children: avatars.map((a) => /* @__PURE__ */ jsx26("span", { class: `${p21}-home-avatar`, title: a.role ? `${a.name} \xB7 ${a.role}` : a.name, children: a.avatar ? /* @__PURE__ */ jsx26("img", { src: a.avatar, alt: "", loading: "lazy" }) : /* @__PURE__ */ jsx26("span", { children: initials(a.name) }) }, a.name)) }) : null,
|
|
4567
|
+
/* @__PURE__ */ jsx26(HeaderActions, { panelProps, variant: "plain" })
|
|
4786
4568
|
] })
|
|
4787
4569
|
] }),
|
|
4788
|
-
config.showGreeting !== false ? /* @__PURE__ */
|
|
4789
|
-
/* @__PURE__ */
|
|
4790
|
-
greeting.subtitle ? /* @__PURE__ */
|
|
4570
|
+
config.showGreeting !== false ? /* @__PURE__ */ jsxs20(Fragment4, { children: [
|
|
4571
|
+
/* @__PURE__ */ jsx26("h1", { class: `${p21}-home-greeting`, "data-testid": TID.homeGreeting, children: greeting.title }),
|
|
4572
|
+
greeting.subtitle ? /* @__PURE__ */ jsx26("p", { class: `${p21}-home-lead`, children: greeting.subtitle }) : null
|
|
4791
4573
|
] }) : null
|
|
4792
4574
|
] }),
|
|
4793
|
-
/* @__PURE__ */
|
|
4794
|
-
config.showSearchBar !== false ? /* @__PURE__ */
|
|
4575
|
+
/* @__PURE__ */ jsxs20("div", { class: `${p21}-home-cards`, children: [
|
|
4576
|
+
config.showSearchBar !== false ? /* @__PURE__ */ jsx26(
|
|
4795
4577
|
HomeSearchButton,
|
|
4796
4578
|
{
|
|
4797
4579
|
placeholder: strings.homeSearchPlaceholder,
|
|
4798
4580
|
onActivate: () => nav.switchToLayout("help")
|
|
4799
4581
|
}
|
|
4800
4582
|
) : null,
|
|
4801
|
-
recent ? /* @__PURE__ */
|
|
4802
|
-
/* @__PURE__ */
|
|
4803
|
-
/* @__PURE__ */
|
|
4804
|
-
/* @__PURE__ */
|
|
4805
|
-
recent.preview ? /* @__PURE__ */
|
|
4583
|
+
recent ? /* @__PURE__ */ jsx26(HomeCard, { onClick: () => nav.selectSession(recent.sessionId), testid: TID.homeRecent, children: /* @__PURE__ */ jsxs20("div", { class: `${p21}-home-recent-row`, "data-unread": (recent.unreadCount ?? 0) > 0 ? "true" : void 0, children: [
|
|
4584
|
+
/* @__PURE__ */ jsx26("span", { class: `${p21}-home-recent-avatar`, "aria-hidden": "true", children: /* @__PURE__ */ jsx26(BubblesIcon, {}) }),
|
|
4585
|
+
/* @__PURE__ */ jsxs20("span", { class: `${p21}-home-recent-body`, children: [
|
|
4586
|
+
/* @__PURE__ */ jsx26("span", { class: `${p21}-home-recent-title`, children: recent.title }),
|
|
4587
|
+
recent.preview ? /* @__PURE__ */ jsx26("span", { class: `${p21}-home-recent-preview`, children: recent.preview }) : null
|
|
4806
4588
|
] }),
|
|
4807
|
-
(recent.unreadCount ?? 0) > 0 ? /* @__PURE__ */
|
|
4589
|
+
(recent.unreadCount ?? 0) > 0 ? /* @__PURE__ */ jsx26("span", { class: `${p21}-home-recent-dot`, "aria-label": "Unread" }) : null
|
|
4808
4590
|
] }) }) : null,
|
|
4809
|
-
status ? /* @__PURE__ */
|
|
4591
|
+
status ? /* @__PURE__ */ jsx26(
|
|
4810
4592
|
HomeCard,
|
|
4811
4593
|
{
|
|
4812
4594
|
onClick: status.url ? () => nav.push({ kind: "iframe", url: status.url, title: status.text }) : void 0,
|
|
4813
|
-
children: /* @__PURE__ */
|
|
4814
|
-
/* @__PURE__ */
|
|
4815
|
-
/* @__PURE__ */
|
|
4595
|
+
children: /* @__PURE__ */ jsxs20("div", { class: `${p21}-home-status`, "data-level": status.level ?? "operational", children: [
|
|
4596
|
+
/* @__PURE__ */ jsx26("span", { class: `${p21}-home-status-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx26(StatusOkIcon, {}) }),
|
|
4597
|
+
/* @__PURE__ */ jsx26("span", { class: `${p21}-home-status-text`, children: status.text })
|
|
4816
4598
|
] })
|
|
4817
4599
|
}
|
|
4818
4600
|
) : null,
|
|
4819
|
-
content.length > 0 ? /* @__PURE__ */
|
|
4820
|
-
/* @__PURE__ */
|
|
4821
|
-
/* @__PURE__ */
|
|
4601
|
+
content.length > 0 ? /* @__PURE__ */ jsxs20("section", { class: `${p21}-home-content`, children: [
|
|
4602
|
+
/* @__PURE__ */ jsx26("div", { class: `${p21}-home-content-title`, children: contentTitle }),
|
|
4603
|
+
/* @__PURE__ */ jsx26("div", { class: `${p21}-home-content-list`, children: content.map((item) => /* @__PURE__ */ jsx26(
|
|
4822
4604
|
ListRow,
|
|
4823
4605
|
{
|
|
4824
4606
|
title: item.title,
|
|
@@ -4834,13 +4616,13 @@ function HomeRoot(props2) {
|
|
|
4834
4616
|
}
|
|
4835
4617
|
var homeLayout = {
|
|
4836
4618
|
Icon: HomeIcon,
|
|
4837
|
-
Root: (props2) => /* @__PURE__ */
|
|
4619
|
+
Root: (props2) => /* @__PURE__ */ jsx26(HomeRoot, { ...props2 })
|
|
4838
4620
|
};
|
|
4839
4621
|
|
|
4840
4622
|
// src/ui/modules/news.tsx
|
|
4841
4623
|
import { useEffect as useEffect13, useState as useState8 } from "preact/hooks";
|
|
4842
|
-
import { jsx as
|
|
4843
|
-
var
|
|
4624
|
+
import { jsx as jsx27, jsxs as jsxs21 } from "preact/jsx-runtime";
|
|
4625
|
+
var p22 = BRAND.cssPrefix;
|
|
4844
4626
|
var log14 = logger.scope("news");
|
|
4845
4627
|
function NewsRoot({ transport, strings, config, nav, panelProps }) {
|
|
4846
4628
|
const tags = config.contentTags;
|
|
@@ -4866,38 +4648,38 @@ function NewsRoot({ transport, strings, config, nav, panelProps }) {
|
|
|
4866
4648
|
};
|
|
4867
4649
|
}, [transport, tags, reloadKey]);
|
|
4868
4650
|
function renderBody() {
|
|
4869
|
-
if (state === "loading") return /* @__PURE__ */
|
|
4651
|
+
if (state === "loading") return /* @__PURE__ */ jsx27(ModuleState, { message: strings.newsLoading, strings });
|
|
4870
4652
|
if (state === "error") {
|
|
4871
|
-
return /* @__PURE__ */
|
|
4653
|
+
return /* @__PURE__ */ jsx27(ModuleState, { tone: "error", message: errorMsg, onRetry: () => setReloadKey((k) => k + 1), strings });
|
|
4872
4654
|
}
|
|
4873
|
-
if (items.length === 0) return /* @__PURE__ */
|
|
4874
|
-
return /* @__PURE__ */
|
|
4655
|
+
if (items.length === 0) return /* @__PURE__ */ jsx27(ModuleState, { message: strings.newsEmpty, strings });
|
|
4656
|
+
return /* @__PURE__ */ jsx27("div", { class: `${p22}-news-list`, children: items.map((item) => /* @__PURE__ */ jsxs21(
|
|
4875
4657
|
"button",
|
|
4876
4658
|
{
|
|
4877
4659
|
type: "button",
|
|
4878
|
-
class: `${
|
|
4660
|
+
class: `${p22}-news-card`,
|
|
4879
4661
|
onClick: () => nav.push({ kind: "content", id: item.id, title: item.title }),
|
|
4880
4662
|
"data-testid": tid(TID.newsItem, item.id),
|
|
4881
4663
|
children: [
|
|
4882
|
-
item.image ? /* @__PURE__ */
|
|
4883
|
-
/* @__PURE__ */
|
|
4884
|
-
item.tags && item.tags.length > 0 ? /* @__PURE__ */
|
|
4885
|
-
/* @__PURE__ */
|
|
4886
|
-
item.description ? /* @__PURE__ */
|
|
4664
|
+
item.image ? /* @__PURE__ */ jsx27("img", { class: `${p22}-news-hero`, src: item.image, alt: "", loading: "lazy" }) : null,
|
|
4665
|
+
/* @__PURE__ */ jsxs21("span", { class: `${p22}-news-body`, children: [
|
|
4666
|
+
item.tags && item.tags.length > 0 ? /* @__PURE__ */ jsx27("span", { class: `${p22}-news-tags`, children: item.tags.map((t) => /* @__PURE__ */ jsx27("span", { class: `${p22}-news-tag`, children: t }, t)) }) : null,
|
|
4667
|
+
/* @__PURE__ */ jsx27("span", { class: `${p22}-news-title`, children: item.title }),
|
|
4668
|
+
item.description ? /* @__PURE__ */ jsx27("span", { class: `${p22}-news-summary`, children: item.description }) : null
|
|
4887
4669
|
] })
|
|
4888
4670
|
]
|
|
4889
4671
|
},
|
|
4890
4672
|
item.id
|
|
4891
4673
|
)) });
|
|
4892
4674
|
}
|
|
4893
|
-
return /* @__PURE__ */
|
|
4894
|
-
/* @__PURE__ */
|
|
4895
|
-
/* @__PURE__ */
|
|
4675
|
+
return /* @__PURE__ */ jsxs21("div", { class: `${p22}-module`, children: [
|
|
4676
|
+
/* @__PURE__ */ jsx27(TitleBar, { title: strings.newsTitle, actions: /* @__PURE__ */ jsx27(HeaderActions, { panelProps, variant: "plain" }) }),
|
|
4677
|
+
/* @__PURE__ */ jsx27("div", { class: `${p22}-module-scroll`, children: renderBody() })
|
|
4896
4678
|
] });
|
|
4897
4679
|
}
|
|
4898
4680
|
var newsLayout = {
|
|
4899
4681
|
Icon: NewsIcon,
|
|
4900
|
-
Root: (props2) => /* @__PURE__ */
|
|
4682
|
+
Root: (props2) => /* @__PURE__ */ jsx27(NewsRoot, { ...props2 })
|
|
4901
4683
|
};
|
|
4902
4684
|
|
|
4903
4685
|
// src/ui/modules/registry.ts
|
|
@@ -4909,28 +4691,28 @@ var LAYOUTS = {
|
|
|
4909
4691
|
};
|
|
4910
4692
|
|
|
4911
4693
|
// src/ui/home-tab-bar.tsx
|
|
4912
|
-
import { jsx as
|
|
4913
|
-
var
|
|
4694
|
+
import { jsx as jsx28, jsxs as jsxs22 } from "preact/jsx-runtime";
|
|
4695
|
+
var p23 = BRAND.cssPrefix;
|
|
4914
4696
|
function HomeTabBar({ modules, activeTab, strings, unreadCount, onSelect }) {
|
|
4915
|
-
return /* @__PURE__ */
|
|
4697
|
+
return /* @__PURE__ */ jsx28("nav", { class: `${p23}-tabbar`, role: "tablist", "aria-label": strings.panelTitle, children: modules.map((m) => {
|
|
4916
4698
|
const Icon = LAYOUTS[m.layout].Icon;
|
|
4917
4699
|
const selected = m.id === activeTab;
|
|
4918
4700
|
const badge = m.layout === "chat" && unreadCount > 0 ? unreadCount > 9 ? "9+" : String(unreadCount) : null;
|
|
4919
|
-
return /* @__PURE__ */
|
|
4701
|
+
return /* @__PURE__ */ jsxs22(
|
|
4920
4702
|
"button",
|
|
4921
4703
|
{
|
|
4922
4704
|
type: "button",
|
|
4923
4705
|
role: "tab",
|
|
4924
4706
|
"aria-selected": selected,
|
|
4925
|
-
class: `${
|
|
4707
|
+
class: `${p23}-tab`,
|
|
4926
4708
|
onClick: () => onSelect(m.id),
|
|
4927
4709
|
"data-testid": tid(TID.tab, m.id),
|
|
4928
4710
|
children: [
|
|
4929
|
-
/* @__PURE__ */
|
|
4930
|
-
/* @__PURE__ */
|
|
4931
|
-
badge ? /* @__PURE__ */
|
|
4711
|
+
/* @__PURE__ */ jsxs22("span", { class: `${p23}-tab-icon`, "aria-hidden": "true", children: [
|
|
4712
|
+
/* @__PURE__ */ jsx28(Icon, {}),
|
|
4713
|
+
badge ? /* @__PURE__ */ jsx28("span", { class: `${p23}-tab-badge`, "data-testid": TID.tabBadge, children: badge }) : null
|
|
4932
4714
|
] }),
|
|
4933
|
-
/* @__PURE__ */
|
|
4715
|
+
/* @__PURE__ */ jsx28("span", { class: `${p23}-tab-label`, children: moduleLabel(strings, m.label) })
|
|
4934
4716
|
]
|
|
4935
4717
|
},
|
|
4936
4718
|
m.id
|
|
@@ -4939,25 +4721,24 @@ function HomeTabBar({ modules, activeTab, strings, unreadCount, onSelect }) {
|
|
|
4939
4721
|
}
|
|
4940
4722
|
|
|
4941
4723
|
// src/ui/iframe-view.tsx
|
|
4942
|
-
import { jsx as
|
|
4943
|
-
var
|
|
4724
|
+
import { jsx as jsx29, jsxs as jsxs23 } from "preact/jsx-runtime";
|
|
4725
|
+
var p24 = BRAND.cssPrefix;
|
|
4944
4726
|
var SANDBOX = "allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads";
|
|
4945
|
-
function IframeView({ url, title, strings, onBack,
|
|
4946
|
-
return /* @__PURE__ */
|
|
4947
|
-
/* @__PURE__ */
|
|
4727
|
+
function IframeView({ url, title, strings, onBack, actions }) {
|
|
4728
|
+
return /* @__PURE__ */ jsxs23("div", { class: `${p24}-module`, children: [
|
|
4729
|
+
/* @__PURE__ */ jsx29(
|
|
4948
4730
|
BackHeader,
|
|
4949
4731
|
{
|
|
4950
4732
|
title: title || strings.moduleBack,
|
|
4951
4733
|
backLabel: strings.moduleBack,
|
|
4952
4734
|
onBack,
|
|
4953
|
-
|
|
4954
|
-
closeLabel: strings.close
|
|
4735
|
+
actions
|
|
4955
4736
|
}
|
|
4956
4737
|
),
|
|
4957
|
-
/* @__PURE__ */
|
|
4738
|
+
/* @__PURE__ */ jsx29(
|
|
4958
4739
|
"iframe",
|
|
4959
4740
|
{
|
|
4960
|
-
class: `${
|
|
4741
|
+
class: `${p24}-content-frame`,
|
|
4961
4742
|
src: url,
|
|
4962
4743
|
title: title || "content",
|
|
4963
4744
|
sandbox: SANDBOX,
|
|
@@ -4970,15 +4751,15 @@ function IframeView({ url, title, strings, onBack, onClose }) {
|
|
|
4970
4751
|
}
|
|
4971
4752
|
|
|
4972
4753
|
// src/ui/content-view.tsx
|
|
4973
|
-
import { useCallback as
|
|
4974
|
-
import { jsx as
|
|
4975
|
-
var
|
|
4754
|
+
import { useCallback as useCallback3, useEffect as useEffect14, useState as useState9 } from "preact/hooks";
|
|
4755
|
+
import { jsx as jsx30, jsxs as jsxs24 } from "preact/jsx-runtime";
|
|
4756
|
+
var p25 = BRAND.cssPrefix;
|
|
4976
4757
|
var log15 = logger.scope("content");
|
|
4977
|
-
function ContentView({ id, title, transport, strings, onBack,
|
|
4758
|
+
function ContentView({ id, title, transport, strings, onBack, actions }) {
|
|
4978
4759
|
const [item, setItem] = useState9(null);
|
|
4979
4760
|
const [failed, setFailed] = useState9(false);
|
|
4980
4761
|
const [reloadKey, setReloadKey] = useState9(0);
|
|
4981
|
-
const retry =
|
|
4762
|
+
const retry = useCallback3(() => {
|
|
4982
4763
|
setFailed(false);
|
|
4983
4764
|
setItem(null);
|
|
4984
4765
|
setReloadKey((k) => k + 1);
|
|
@@ -5000,34 +4781,33 @@ function ContentView({ id, title, transport, strings, onBack, onClose }) {
|
|
|
5000
4781
|
};
|
|
5001
4782
|
}, [transport, id, reloadKey]);
|
|
5002
4783
|
function renderBody() {
|
|
5003
|
-
if (failed) return /* @__PURE__ */
|
|
5004
|
-
if (item === null) return /* @__PURE__ */
|
|
5005
|
-
return /* @__PURE__ */
|
|
5006
|
-
item.image ? /* @__PURE__ */
|
|
5007
|
-
item.description ? /* @__PURE__ */
|
|
5008
|
-
item.tags && item.tags.length > 0 ? /* @__PURE__ */
|
|
5009
|
-
/* @__PURE__ */
|
|
4784
|
+
if (failed) return /* @__PURE__ */ jsx30(ModuleState, { tone: "error", message: strings.errorGeneric, onRetry: retry, strings });
|
|
4785
|
+
if (item === null) return /* @__PURE__ */ jsx30(ModuleState, { message: strings.contentLoading, strings });
|
|
4786
|
+
return /* @__PURE__ */ jsxs24("article", { class: `${p25}-content`, "data-testid": TID.contentView, children: [
|
|
4787
|
+
item.image ? /* @__PURE__ */ jsx30("img", { class: `${p25}-content-hero`, src: item.image, alt: "", loading: "lazy" }) : null,
|
|
4788
|
+
item.description ? /* @__PURE__ */ jsx30("p", { class: `${p25}-content-subtitle`, children: item.description }) : null,
|
|
4789
|
+
item.tags && item.tags.length > 0 ? /* @__PURE__ */ jsx30("span", { class: `${p25}-news-tags`, children: item.tags.map((t) => /* @__PURE__ */ jsx30("span", { class: `${p25}-news-tag`, children: t }, t)) }) : null,
|
|
4790
|
+
/* @__PURE__ */ jsx30(StaticMarkdown, { text: item.content ?? "" })
|
|
5010
4791
|
] });
|
|
5011
4792
|
}
|
|
5012
|
-
return /* @__PURE__ */
|
|
5013
|
-
/* @__PURE__ */
|
|
4793
|
+
return /* @__PURE__ */ jsxs24("div", { class: `${p25}-module`, children: [
|
|
4794
|
+
/* @__PURE__ */ jsx30(
|
|
5014
4795
|
BackHeader,
|
|
5015
4796
|
{
|
|
5016
4797
|
title: item?.title || title || strings.moduleBack,
|
|
5017
4798
|
backLabel: strings.moduleBack,
|
|
5018
4799
|
onBack,
|
|
5019
|
-
|
|
5020
|
-
closeLabel: strings.close,
|
|
4800
|
+
actions,
|
|
5021
4801
|
testid: TID.backHeader
|
|
5022
4802
|
}
|
|
5023
4803
|
),
|
|
5024
|
-
/* @__PURE__ */
|
|
4804
|
+
/* @__PURE__ */ jsx30("div", { class: `${p25}-module-scroll`, "data-testid": TID.contentScroll, children: renderBody() })
|
|
5025
4805
|
] });
|
|
5026
4806
|
}
|
|
5027
4807
|
|
|
5028
4808
|
// src/ui/messenger-home.tsx
|
|
5029
|
-
import { jsx as
|
|
5030
|
-
var
|
|
4809
|
+
import { jsx as jsx31, jsxs as jsxs25 } from "preact/jsx-runtime";
|
|
4810
|
+
var p26 = BRAND.cssPrefix;
|
|
5031
4811
|
function MessengerHome({
|
|
5032
4812
|
panelProps,
|
|
5033
4813
|
enabledModules,
|
|
@@ -5054,7 +4834,7 @@ function MessengerHome({
|
|
|
5054
4834
|
};
|
|
5055
4835
|
}, [panelProps.onClose]);
|
|
5056
4836
|
const composerAttachApiRef = useRef7(null);
|
|
5057
|
-
const onDropItems =
|
|
4837
|
+
const onDropItems = useCallback4((items) => {
|
|
5058
4838
|
composerAttachApiRef.current?.attachFromDrop(items);
|
|
5059
4839
|
}, []);
|
|
5060
4840
|
const { visible: dragOver } = useFileDrop({ containerRef, onDrop: onDropItems });
|
|
@@ -5095,11 +4875,12 @@ function MessengerHome({
|
|
|
5095
4875
|
nav: moduleNav,
|
|
5096
4876
|
panelProps
|
|
5097
4877
|
});
|
|
4878
|
+
const plainActions = /* @__PURE__ */ jsx31(HeaderActions, { panelProps, variant: "plain" });
|
|
5098
4879
|
let body;
|
|
5099
4880
|
if (top?.kind === "iframe") {
|
|
5100
|
-
body = /* @__PURE__ */
|
|
4881
|
+
body = /* @__PURE__ */ jsx31(IframeView, { url: top.url, title: top.title, strings, onBack: nav.pop, actions: plainActions });
|
|
5101
4882
|
} else if (top?.kind === "content") {
|
|
5102
|
-
body = /* @__PURE__ */
|
|
4883
|
+
body = /* @__PURE__ */ jsx31(
|
|
5103
4884
|
ContentView,
|
|
5104
4885
|
{
|
|
5105
4886
|
id: top.id,
|
|
@@ -5107,11 +4888,11 @@ function MessengerHome({
|
|
|
5107
4888
|
transport: panelProps.transport,
|
|
5108
4889
|
strings,
|
|
5109
4890
|
onBack: nav.pop,
|
|
5110
|
-
|
|
4891
|
+
actions: plainActions
|
|
5111
4892
|
}
|
|
5112
4893
|
);
|
|
5113
4894
|
} else if (activeModule?.layout === "chat") {
|
|
5114
|
-
body = /* @__PURE__ */
|
|
4895
|
+
body = /* @__PURE__ */ jsx31(
|
|
5115
4896
|
PanelContent,
|
|
5116
4897
|
{
|
|
5117
4898
|
...panelProps,
|
|
@@ -5122,23 +4903,23 @@ function MessengerHome({
|
|
|
5122
4903
|
);
|
|
5123
4904
|
} else if (activeModule) {
|
|
5124
4905
|
const Root = LAYOUTS[activeModule.layout].Root;
|
|
5125
|
-
body = Root ? /* @__PURE__ */
|
|
4906
|
+
body = Root ? /* @__PURE__ */ jsx31(Root, { ...screenProps(activeModule) }, activeModule.id) : null;
|
|
5126
4907
|
} else {
|
|
5127
4908
|
body = null;
|
|
5128
4909
|
}
|
|
5129
|
-
return /* @__PURE__ */
|
|
4910
|
+
return /* @__PURE__ */ jsxs25(
|
|
5130
4911
|
"div",
|
|
5131
4912
|
{
|
|
5132
4913
|
ref: containerRef,
|
|
5133
|
-
class: `${
|
|
4914
|
+
class: `${p26}-panel ${p26}-messenger`,
|
|
5134
4915
|
role: "dialog",
|
|
5135
4916
|
"aria-modal": "false",
|
|
5136
4917
|
"aria-label": strings.panelTitle,
|
|
5137
4918
|
style: { position: "relative" },
|
|
5138
4919
|
"data-testid": TID.messengerHome,
|
|
5139
4920
|
children: [
|
|
5140
|
-
/* @__PURE__ */
|
|
5141
|
-
showTabBar ? /* @__PURE__ */
|
|
4921
|
+
/* @__PURE__ */ jsx31("div", { class: `${p26}-messenger-body`, children: body }),
|
|
4922
|
+
showTabBar ? /* @__PURE__ */ jsx31(
|
|
5142
4923
|
HomeTabBar,
|
|
5143
4924
|
{
|
|
5144
4925
|
modules: enabledModules,
|
|
@@ -5148,8 +4929,8 @@ function MessengerHome({
|
|
|
5148
4929
|
onSelect: nav.switchTab
|
|
5149
4930
|
}
|
|
5150
4931
|
) : null,
|
|
5151
|
-
/* @__PURE__ */
|
|
5152
|
-
options.size.resize?.enabled && !(activeModule?.layout === "chat" && !top) ? /* @__PURE__ */
|
|
4932
|
+
/* @__PURE__ */ jsx31(PoweredByBar, { poweredBy: options.poweredBy }),
|
|
4933
|
+
options.size.resize?.enabled && !(activeModule?.layout === "chat" && !top) ? /* @__PURE__ */ jsx31(
|
|
5153
4934
|
ResizeGrip,
|
|
5154
4935
|
{
|
|
5155
4936
|
panelEl: containerRef.current,
|
|
@@ -5166,29 +4947,29 @@ function MessengerHome({
|
|
|
5166
4947
|
}
|
|
5167
4948
|
|
|
5168
4949
|
// src/ui/modules-empty.tsx
|
|
5169
|
-
import { jsx as
|
|
5170
|
-
var
|
|
4950
|
+
import { jsx as jsx32, jsxs as jsxs26 } from "preact/jsx-runtime";
|
|
4951
|
+
var p27 = BRAND.cssPrefix;
|
|
5171
4952
|
function ModulesEmpty({ strings, onClose }) {
|
|
5172
|
-
return /* @__PURE__ */
|
|
4953
|
+
return /* @__PURE__ */ jsxs26(
|
|
5173
4954
|
"div",
|
|
5174
4955
|
{
|
|
5175
|
-
class: `${
|
|
4956
|
+
class: `${p27}-panel ${p27}-modules-empty`,
|
|
5176
4957
|
role: "dialog",
|
|
5177
4958
|
"aria-label": strings.panelTitle,
|
|
5178
4959
|
"data-testid": TID.modulesEmpty,
|
|
5179
4960
|
children: [
|
|
5180
|
-
onClose ? /* @__PURE__ */
|
|
4961
|
+
onClose ? /* @__PURE__ */ jsx32(
|
|
5181
4962
|
"button",
|
|
5182
4963
|
{
|
|
5183
4964
|
type: "button",
|
|
5184
|
-
class: `${
|
|
4965
|
+
class: `${p27}-icon-btn ${p27}-modules-empty-close`,
|
|
5185
4966
|
onClick: onClose,
|
|
5186
4967
|
"aria-label": strings.close,
|
|
5187
4968
|
title: strings.close,
|
|
5188
|
-
children: /* @__PURE__ */
|
|
4969
|
+
children: /* @__PURE__ */ jsx32(CloseIcon, {})
|
|
5189
4970
|
}
|
|
5190
4971
|
) : null,
|
|
5191
|
-
/* @__PURE__ */
|
|
4972
|
+
/* @__PURE__ */ jsx32("p", { class: `${p27}-modules-empty-text`, children: strings.modulesEmpty })
|
|
5192
4973
|
]
|
|
5193
4974
|
}
|
|
5194
4975
|
);
|
|
@@ -5243,7 +5024,7 @@ function animateTypewriter(msg, text, charsPerSecond, abort) {
|
|
|
5243
5024
|
}
|
|
5244
5025
|
|
|
5245
5026
|
// src/ui/use-launcher-callout.ts
|
|
5246
|
-
import { useCallback as
|
|
5027
|
+
import { useCallback as useCallback5, useEffect as useEffect16, useState as useState10 } from "preact/hooks";
|
|
5247
5028
|
function useLauncherCallout({ callout, persistence }) {
|
|
5248
5029
|
const textKey = callout?.text ?? "";
|
|
5249
5030
|
const persistent = callout?.persistent ?? true;
|
|
@@ -5251,7 +5032,7 @@ function useLauncherCallout({ callout, persistence }) {
|
|
|
5251
5032
|
useEffect16(() => {
|
|
5252
5033
|
setDismissed(persistent ? false : persistence.loadCalloutDismissed(textKey));
|
|
5253
5034
|
}, [textKey, persistent, persistence]);
|
|
5254
|
-
const dismissCallout =
|
|
5035
|
+
const dismissCallout = useCallback5(() => {
|
|
5255
5036
|
setDismissed(true);
|
|
5256
5037
|
if (!persistent) persistence.saveCalloutDismissed(textKey);
|
|
5257
5038
|
}, [persistence, textKey, persistent]);
|
|
@@ -5259,9 +5040,9 @@ function useLauncherCallout({ callout, persistence }) {
|
|
|
5259
5040
|
}
|
|
5260
5041
|
|
|
5261
5042
|
// src/ui/app.tsx
|
|
5262
|
-
import { jsx as
|
|
5043
|
+
import { jsx as jsx33, jsxs as jsxs27 } from "preact/jsx-runtime";
|
|
5263
5044
|
var log16 = logger.scope("app");
|
|
5264
|
-
var
|
|
5045
|
+
var p28 = BRAND.cssPrefix;
|
|
5265
5046
|
function App({ options, hostElement, bus }) {
|
|
5266
5047
|
const [persistence] = useState11(() => createPersistence(options.widgetId, options.storage));
|
|
5267
5048
|
const [visitorId, setVisitorId] = useState11(() => persistence.getVisitorId());
|
|
@@ -5305,7 +5086,7 @@ function App({ options, hostElement, bus }) {
|
|
|
5305
5086
|
persistence
|
|
5306
5087
|
});
|
|
5307
5088
|
const calloutPersistent = options.launcher.callout?.persistent ?? true;
|
|
5308
|
-
const dismissCallout =
|
|
5089
|
+
const dismissCallout = useCallback6(() => {
|
|
5309
5090
|
log16.info("calloutDismiss");
|
|
5310
5091
|
bus.emit("calloutDismiss", void 0);
|
|
5311
5092
|
dismissCalloutRaw();
|
|
@@ -5335,7 +5116,7 @@ function App({ options, hostElement, bus }) {
|
|
|
5335
5116
|
);
|
|
5336
5117
|
const [reducer] = useState11(() => new StreamReducer(messagesSig));
|
|
5337
5118
|
const [feedback] = useState11(() => new FeedbackBus(options.sound, options.haptics));
|
|
5338
|
-
const patchAndSync =
|
|
5119
|
+
const patchAndSync = useCallback6(
|
|
5339
5120
|
(patch) => {
|
|
5340
5121
|
persistence.patchUserPrefs(patch);
|
|
5341
5122
|
transport.saveUserPrefs(persistence.loadUserPrefs()).catch((err) => {
|
|
@@ -5395,7 +5176,7 @@ function App({ options, hostElement, bus }) {
|
|
|
5395
5176
|
}
|
|
5396
5177
|
homeNav.reset(landingTab());
|
|
5397
5178
|
}, [sessionReady]);
|
|
5398
|
-
const playWelcome =
|
|
5179
|
+
const playWelcome = useCallback6(
|
|
5399
5180
|
(welcomeMessages) => {
|
|
5400
5181
|
if (!welcomeMessages || welcomeMessages.length === 0) return;
|
|
5401
5182
|
const { animation, speed } = options.welcome;
|
|
@@ -5413,7 +5194,7 @@ function App({ options, hostElement, bus }) {
|
|
|
5413
5194
|
[messagesSig, options.welcome]
|
|
5414
5195
|
);
|
|
5415
5196
|
const connectGenRef = useRef8(0);
|
|
5416
|
-
const runStartSession =
|
|
5197
|
+
const runStartSession = useCallback6(
|
|
5417
5198
|
async ({ newConversation }) => {
|
|
5418
5199
|
const myGen = ++connectGenRef.current;
|
|
5419
5200
|
const isStale = () => myGen !== connectGenRef.current;
|
|
@@ -5507,7 +5288,7 @@ function App({ options, hostElement, bus }) {
|
|
|
5507
5288
|
useEffect17(() => {
|
|
5508
5289
|
transport.setContext(options.userContext, toWirePageContext(options.pageContext));
|
|
5509
5290
|
}, [transport, userSig, pageSig]);
|
|
5510
|
-
const runResume =
|
|
5291
|
+
const runResume = useCallback6(
|
|
5511
5292
|
async (handle) => {
|
|
5512
5293
|
let bubble = null;
|
|
5513
5294
|
try {
|
|
@@ -5594,7 +5375,7 @@ function App({ options, hostElement, bus }) {
|
|
|
5594
5375
|
document.addEventListener("keydown", onKey);
|
|
5595
5376
|
return () => document.removeEventListener("keydown", onKey);
|
|
5596
5377
|
}, [isOpen, options.mode]);
|
|
5597
|
-
const handleSend =
|
|
5378
|
+
const handleSend = useCallback6(
|
|
5598
5379
|
async (text, attachments) => {
|
|
5599
5380
|
log16.info("send", { textLen: text.length, attachments: attachments.length, streaming });
|
|
5600
5381
|
if (streaming) return;
|
|
@@ -5669,18 +5450,18 @@ function App({ options, hostElement, bus }) {
|
|
|
5669
5450
|
visitorId
|
|
5670
5451
|
]
|
|
5671
5452
|
);
|
|
5672
|
-
const handleStop =
|
|
5453
|
+
const handleStop = useCallback6(() => {
|
|
5673
5454
|
log16.info("stop");
|
|
5674
5455
|
bus.emit("stop", void 0);
|
|
5675
5456
|
activeCancel?.();
|
|
5676
5457
|
}, [activeCancel, bus]);
|
|
5677
|
-
const handleSoundToggle =
|
|
5458
|
+
const handleSoundToggle = useCallback6(() => {
|
|
5678
5459
|
feedback.toggleMuted();
|
|
5679
5460
|
const muted = feedback.mutedSig.value;
|
|
5680
5461
|
log16.info("soundToggle", { muted });
|
|
5681
5462
|
bus.emit("soundToggle", { muted });
|
|
5682
5463
|
}, [feedback, bus]);
|
|
5683
|
-
const handleClose =
|
|
5464
|
+
const handleClose = useCallback6(() => {
|
|
5684
5465
|
if (resolveCloseAction(options.mode, panelSize) === "exit-fullscreen") {
|
|
5685
5466
|
log16.info("close \u2192 exit-fullscreen", { mode: options.mode });
|
|
5686
5467
|
setPanelSize("normal");
|
|
@@ -5693,7 +5474,7 @@ function App({ options, hostElement, bus }) {
|
|
|
5693
5474
|
bus.emit("close", void 0);
|
|
5694
5475
|
options.onClose?.();
|
|
5695
5476
|
}, [bus, options, persistence, panelSize]);
|
|
5696
|
-
const refreshUnread =
|
|
5477
|
+
const refreshUnread = useCallback6(() => {
|
|
5697
5478
|
if (!options.modules.list.some((m) => m.layout === "chat")) return;
|
|
5698
5479
|
transport.listSessions({ limit: 50 }).then((res) => {
|
|
5699
5480
|
unreadCountSig.value = res.sessions.reduce((sum, c) => sum + (c.unreadCount ?? 0), 0);
|
|
@@ -5705,7 +5486,7 @@ function App({ options, hostElement, bus }) {
|
|
|
5705
5486
|
unreadSeeded.current = true;
|
|
5706
5487
|
refreshUnread();
|
|
5707
5488
|
}, [sessionReady, refreshUnread]);
|
|
5708
|
-
const handleOpen =
|
|
5489
|
+
const handleOpen = useCallback6(() => {
|
|
5709
5490
|
log16.info("open", { mode: options.mode });
|
|
5710
5491
|
feedback.unlock();
|
|
5711
5492
|
setLauncherLeaving(true);
|
|
@@ -5717,7 +5498,7 @@ function App({ options, hostElement, bus }) {
|
|
|
5717
5498
|
bus.emit("open", void 0);
|
|
5718
5499
|
options.onOpen?.();
|
|
5719
5500
|
}, [bus, options, feedback, persistence, calloutDismissed, calloutPersistent, dismissCallout, refreshUnread]);
|
|
5720
|
-
const handleClear =
|
|
5501
|
+
const handleClear = useCallback6(() => {
|
|
5721
5502
|
log16.info("clear \u2192 new conversation", { wasStreaming: streaming });
|
|
5722
5503
|
bus.emit("clear", void 0);
|
|
5723
5504
|
if (streaming) activeCancel?.();
|
|
@@ -5728,27 +5509,27 @@ function App({ options, hostElement, bus }) {
|
|
|
5728
5509
|
setCanSend(true);
|
|
5729
5510
|
void runStartSession({ newConversation: true });
|
|
5730
5511
|
}, [streaming, activeCancel, messagesSig, sessionIdSig, persistence, runStartSession, bus]);
|
|
5731
|
-
const handleNewChat =
|
|
5512
|
+
const handleNewChat = useCallback6(() => {
|
|
5732
5513
|
handleClear();
|
|
5733
5514
|
setView("chat");
|
|
5734
5515
|
const chatId = options.modules.list.find((m) => m.layout === "chat")?.id;
|
|
5735
5516
|
if (chatId) homeNav.switchTab(chatId);
|
|
5736
5517
|
}, [handleClear, homeNav, options]);
|
|
5737
|
-
const handleExpand =
|
|
5518
|
+
const handleExpand = useCallback6(() => {
|
|
5738
5519
|
const nextSize = panelSize === "expanded" ? "normal" : "expanded";
|
|
5739
5520
|
log16.info("expand", { from: panelSize, expanded: nextSize === "expanded" });
|
|
5740
5521
|
setPanelSize(nextSize);
|
|
5741
5522
|
persistence.savePanelSize(nextSize);
|
|
5742
5523
|
bus.emit("expand", nextSize === "expanded");
|
|
5743
5524
|
}, [bus, panelSize, persistence]);
|
|
5744
|
-
const handleFullscreen =
|
|
5525
|
+
const handleFullscreen = useCallback6(() => {
|
|
5745
5526
|
const nextSize = panelSize === "fullscreen" ? "normal" : "fullscreen";
|
|
5746
5527
|
log16.info("fullscreen", { from: panelSize, fullscreen: nextSize === "fullscreen" });
|
|
5747
5528
|
setPanelSize(nextSize);
|
|
5748
5529
|
persistence.savePanelSize(nextSize);
|
|
5749
5530
|
bus.emit("fullscreen", nextSize === "fullscreen");
|
|
5750
5531
|
}, [bus, panelSize, persistence]);
|
|
5751
|
-
const handlePopOut =
|
|
5532
|
+
const handlePopOut = useCallback6(() => {
|
|
5752
5533
|
if (!options.popOutUrl) return;
|
|
5753
5534
|
const url = new URL(options.popOutUrl);
|
|
5754
5535
|
if (sessionIdSig.value) url.searchParams.set("chat", sessionIdSig.value);
|
|
@@ -5757,7 +5538,7 @@ function App({ options, hostElement, bus }) {
|
|
|
5757
5538
|
window.open(url.toString(), "_blank", "noopener,noreferrer");
|
|
5758
5539
|
bus.emit("popOut", void 0);
|
|
5759
5540
|
}, [bus, sessionIdSig, options.popOutUrl, options.widgetId]);
|
|
5760
|
-
const handleToggleHistory =
|
|
5541
|
+
const handleToggleHistory = useCallback6(() => {
|
|
5761
5542
|
setView((v) => {
|
|
5762
5543
|
const next = v === "history" ? "chat" : "history";
|
|
5763
5544
|
log16.info("toggleHistory", { view: next });
|
|
@@ -5765,7 +5546,7 @@ function App({ options, hostElement, bus }) {
|
|
|
5765
5546
|
return next;
|
|
5766
5547
|
});
|
|
5767
5548
|
}, [bus]);
|
|
5768
|
-
const handleLocaleChange =
|
|
5549
|
+
const handleLocaleChange = useCallback6(
|
|
5769
5550
|
(locale) => {
|
|
5770
5551
|
log16.info("localeChange", { locale });
|
|
5771
5552
|
setActiveLocale(locale);
|
|
@@ -5774,7 +5555,7 @@ function App({ options, hostElement, bus }) {
|
|
|
5774
5555
|
},
|
|
5775
5556
|
[patchAndSync, bus]
|
|
5776
5557
|
);
|
|
5777
|
-
const handleThemeChange =
|
|
5558
|
+
const handleThemeChange = useCallback6(
|
|
5778
5559
|
(mode) => {
|
|
5779
5560
|
log16.info("themeChange", { mode });
|
|
5780
5561
|
setActiveThemeMode(mode);
|
|
@@ -5784,7 +5565,7 @@ function App({ options, hostElement, bus }) {
|
|
|
5784
5565
|
},
|
|
5785
5566
|
[hostElement, patchAndSync, bus]
|
|
5786
5567
|
);
|
|
5787
|
-
const handleToggleSidebarCollapsed =
|
|
5568
|
+
const handleToggleSidebarCollapsed = useCallback6(() => {
|
|
5788
5569
|
setSidebarCollapsed((prev) => {
|
|
5789
5570
|
const next = !prev;
|
|
5790
5571
|
log16.info("sidebarToggle", { collapsed: next });
|
|
@@ -5793,7 +5574,7 @@ function App({ options, hostElement, bus }) {
|
|
|
5793
5574
|
return next;
|
|
5794
5575
|
});
|
|
5795
5576
|
}, [persistence, bus]);
|
|
5796
|
-
const handleWidgetSizeChange =
|
|
5577
|
+
const handleWidgetSizeChange = useCallback6(
|
|
5797
5578
|
(size) => {
|
|
5798
5579
|
log16.info("resize", size);
|
|
5799
5580
|
patchAndSync({ widgetSize: size });
|
|
@@ -5801,7 +5582,7 @@ function App({ options, hostElement, bus }) {
|
|
|
5801
5582
|
},
|
|
5802
5583
|
[patchAndSync, bus]
|
|
5803
5584
|
);
|
|
5804
|
-
const handleSelectHistoryChat =
|
|
5585
|
+
const handleSelectHistoryChat = useCallback6(
|
|
5805
5586
|
async (targetChatId) => {
|
|
5806
5587
|
log16.info("selectChat", { sessionId: targetChatId });
|
|
5807
5588
|
bus.emit("selectChat", { sessionId: targetChatId });
|
|
@@ -5883,12 +5664,12 @@ function App({ options, hostElement, bus }) {
|
|
|
5883
5664
|
const renderSurface = (size) => {
|
|
5884
5665
|
const closeable = isActionVisible("close", effectiveOptions.mode, size);
|
|
5885
5666
|
if (enabledModules.length === 0) {
|
|
5886
|
-
return /* @__PURE__ */
|
|
5667
|
+
return /* @__PURE__ */ jsx33(ModulesEmpty, { strings: effectiveOptions.strings, onClose: closeable ? handleClose : void 0 });
|
|
5887
5668
|
}
|
|
5888
5669
|
if (enabledModules.length === 1 && enabledModules[0]?.layout === "chat") {
|
|
5889
|
-
return /* @__PURE__ */
|
|
5670
|
+
return /* @__PURE__ */ jsx33(Panel, { ...panelProps, panelSize: size });
|
|
5890
5671
|
}
|
|
5891
|
-
return /* @__PURE__ */
|
|
5672
|
+
return /* @__PURE__ */ jsx33(
|
|
5892
5673
|
MessengerHome,
|
|
5893
5674
|
{
|
|
5894
5675
|
panelProps: { ...panelProps, panelSize: size, onClose: closeable ? handleClose : void 0 },
|
|
@@ -5906,7 +5687,7 @@ function App({ options, hostElement, bus }) {
|
|
|
5906
5687
|
void handleSelectHistoryChat(chat.sessionId);
|
|
5907
5688
|
};
|
|
5908
5689
|
const messagesEnabled = enabledModules.some((m) => m.layout === "chat");
|
|
5909
|
-
return /* @__PURE__ */
|
|
5690
|
+
return /* @__PURE__ */ jsx33("div", { class: `${p28}-anchor`, children: /* @__PURE__ */ jsx33(
|
|
5910
5691
|
PageShell,
|
|
5911
5692
|
{
|
|
5912
5693
|
site: parsedSite,
|
|
@@ -5925,15 +5706,15 @@ function App({ options, hostElement, bus }) {
|
|
|
5925
5706
|
}
|
|
5926
5707
|
if (isInlineLike) {
|
|
5927
5708
|
const inlineSize = options.mode === "standalone" ? "fullscreen" : panelSize;
|
|
5928
|
-
return /* @__PURE__ */
|
|
5709
|
+
return /* @__PURE__ */ jsx33("div", { class: `${p28}-anchor`, children: renderSurface(inlineSize) });
|
|
5929
5710
|
}
|
|
5930
5711
|
const drawerEdgeTab = options.mode === "drawer";
|
|
5931
5712
|
const triggerOwnedByPage = options.mode === "modal";
|
|
5932
5713
|
const launcherVisible = !triggerOwnedByPage && !options.launcher.hidden && (!isOpen || launcherLeaving);
|
|
5933
5714
|
const calloutToRender = launcherVisible && !launcherLeaving && !calloutDismissed && !drawerEdgeTab ? effectiveOptions.launcher.callout : null;
|
|
5934
|
-
return /* @__PURE__ */
|
|
5715
|
+
return /* @__PURE__ */ jsxs27("div", { class: `${p28}-anchor`, "data-launcher-size": effectiveOptions.launcher.size, children: [
|
|
5935
5716
|
isOpen ? renderSurface(panelSize) : null,
|
|
5936
|
-
launcherVisible ? /* @__PURE__ */
|
|
5717
|
+
launcherVisible ? /* @__PURE__ */ jsx33(
|
|
5937
5718
|
Launcher,
|
|
5938
5719
|
{
|
|
5939
5720
|
onToggle: handleOpen,
|
|
@@ -5943,7 +5724,7 @@ function App({ options, hostElement, bus }) {
|
|
|
5943
5724
|
edgeTab: drawerEdgeTab
|
|
5944
5725
|
}
|
|
5945
5726
|
) : null,
|
|
5946
|
-
calloutToRender ? /* @__PURE__ */
|
|
5727
|
+
calloutToRender ? /* @__PURE__ */ jsx33(
|
|
5947
5728
|
LauncherCallout,
|
|
5948
5729
|
{
|
|
5949
5730
|
callout: calloutToRender,
|