{"compiledCode":"\"use strict\";Object.defineProperty(exports, \"__esModule\", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/** Heartwood v2.12 · Dedicated public conversation. */\nvar _react = require('react');\nconst CHAT_ENDPOINT = \"/support/chat\";\n\n\n\n\n\n\n\n\n\n\n\nfunction readQuickPrompts(value) {\nif (!Array.isArray(value)) return [];\nreturn value.slice(0, 8).flatMap((entry) => {\nif (!entry || typeof entry !== \"object\" || !(\"label\" in entry) || !(\"prompt\" in entry)) return [];\nif (typeof entry.label !== \"string\" || typeof entry.prompt !== \"string\") return [];\nconst label = entry.label.trim(), prompt = entry.prompt.trim();\nreturn label && prompt && Array.from(label).length <= 40 && Array.from(prompt).length <= 200 ? [{ label, prompt }] : [];\n});\n}\nconst uid = () => Math.random().toString(36).slice(2, 10);\n/** Readiness never creates a conversation. */\nfunction useAssistant() {\nconst [msgs, setMsgs] = _react.useState([]);\nconst [cid, setCid] = _react.useState(undefined);\nconst [state, setState] = _react.useState(\"idle\");\nconst [draft, setDraft] = _react.useState.call(void 0, \"\");\nconst [lastFailed, setLastFailed] = _react.useState(\"\");\nconst [recorded, setRecorded] = _react.useState.call(void 0, false);\nconst [availability, setAvailability] = _react.useState(\"checking\");\nconst [quickPrompts, setQuickPrompts] = _react.useState([]);\nconst request = _react.useRef({ version: 0, sending: false });\nconst check = _react.useCallback.call(void 0, async () => {\nif (request.current.sending) return;\n_optionalChain([request, 'access', _ => _.current, 'access', _2 => _2.controller, 'optionalAccess', _3 => _3.abort, 'call', _4 => _4()]);\nconst controller = new AbortController();\nconst version = ++request.current.version;\nrequest.current.controller = controller;\nsetAvailability(\"checking\");\nconst timeout = setTimeout(() => controller.abort(), 6000);\ntry {\nconst res = await fetch(CHAT_ENDPOINT, { credentials: \"include\", cache: \"no-store\", signal: controller.signal });\nconst json = res.ok ? await res.json() : null;\nif (version !== request.current.version) return;\nsetAvailability(_optionalChain([json, 'optionalAccess', _5 => _5.status]) === \"ready\" ? \"ready\" : _optionalChain([json, 'optionalAccess', _6 => _6.status]) === \"saved_only\" ? \"saved\" : _optionalChain([json, 'optionalAccess', _7 => _7.status]) === \"unavailable\" ? \"off\" : _optionalChain([json, 'optionalAccess', _8 => _8.status]) === \"human_only\" ? \"human\" : \"unknown\");\nsetQuickPrompts(_optionalChain([json, 'optionalAccess', _9 => _9.status]) === \"ready\" || _optionalChain([json, 'optionalAccess', _10 => _10.status]) === \"saved_only\" ? readQuickPrompts(json.quickPrompts) : []);\nif ([\"ready\", \"saved_only\", \"human_only\"].includes(_optionalChain([json, 'optionalAccess', _11 => _11.status]))) setState(current => current === \"off\" ? \"idle\" : current);\n} catch (e2) {\nif (version === request.current.version) setAvailability(\"unknown\");\n} finally {\nclearTimeout(timeout);\n}\n}, []);\n_react.useEffect.call(void 0, () => {\nvoid check();\nreturn () => {\n++request.current.version;\n_optionalChain([request, 'access', _12 => _12.current, 'access', _13 => _13.controller, 'optionalAccess', _14 => _14.abort, 'call', _15 => _15()]);\n};\n}, [check]);\nconst send = _react.useCallback.call(void 0, \nasync (text, prior = msgs) => {\nconst clean = text.trim();\nif (!clean || request.current.sending) return;\n_optionalChain([request, 'access', _16 => _16.current, 'access', _17 => _17.controller, 'optionalAccess', _18 => _18.abort, 'call', _19 => _19()]);\nconst controller = new AbortController();\nconst version = ++request.current.version;\nrequest.current.controller = controller;\nrequest.current.sending = true;\nconst timeout = setTimeout(() => controller.abort(), 45000);\nconst user = { id: uid(), role: \"user\", content: clean };\nconst next = [...prior.filter((m) => !m.failed), user];\nsetMsgs(next);\nsetDraft(\"\");\nsetLastFailed(\"\");\nsetRecorded(false);\nsetState(\"sending\");\ntry {\nconst res = await fetch(CHAT_ENDPOINT, {\nmethod: \"POST\",\nheaders: { \"Content-Type\": \"application/json\" },\ncredentials: \"include\",\nsignal: controller.signal,\nbody: JSON.stringify({\nconversationId: cid,\nmessages: next.map((m) => ({ role: m.role, content: m.content })),\nroutePath: \"/assistant\",\npageTitle: typeof document !== \"undefined\" ? document.title : undefined,\n}),\n});\nif (version !== request.current.version) return;\nif (!res.ok) {\nsetMsgs([...next.slice(0, -1), { ...user, failed: true }]);\nsetLastFailed(clean);\nsetState(res.status === 404 || res.status === 403 || res.status === 410 ? \"off\" : \"error\");\nsetAvailability(current => current === \"saved\" && ![403, 404, 410].includes(res.status) ? \"saved\" : \"unknown\");\nreturn;\n}\nconst json = await res.json();\nif (version !== request.current.version) return;\nif (![\"answered\", \"not_found\", \"unavailable\", \"handoff_requested\", \"auto_reply\"].includes(json.status) || typeof json.answer !== \"string\" || !json.answer.trim()) throw new Error(\"Invalid chat response\");\nconst confirmed = typeof json.conversationId === \"string\" && Boolean(json.conversationId);\nif (confirmed) setCid(json.conversationId);\nsetRecorded(confirmed);\nconst status = json.status;\nif (status === \"unavailable\") {\nsetMsgs([...next.slice(0, -1), { ...user, failed: !json.conversationId }]);\nsetLastFailed(clean);\nsetAvailability(current => current === \"saved\" ? \"saved\" : \"off\");\nsetState(\"off\");\nreturn;\n}\nsetMsgs([\n...next,\n{\nid: uid(),\nrole: \"assistant\",\ncontent: String(json.answer || \"\"),\nsources: Array.isArray(json.sources) ? json.sources.filter((s) => s && typeof s.id === \"string\" && typeof s.label === \"string\" && typeof s.routePath === \"string\" && s.routePath.startsWith(\"/\") && !s.routePath.startsWith(\"//\") && !s.routePath.includes(\"\\\\\")) : [],\nstatus,\n},\n]);\nsetAvailability(current => status === \"auto_reply\" || status === \"handoff_requested\" ? \"human\" : current === \"saved\" ? \"saved\" : \"ready\");\nsetState(\"ready\");\n} catch (e3) {\nif (version !== request.current.version) return;\nsetMsgs([...next.slice(0, -1), { ...user, failed: true }]);\nsetLastFailed(clean);\nsetState(\"error\");\nsetAvailability(current => current === \"saved\" ? \"saved\" : \"unknown\");\n} finally {\nclearTimeout(timeout);\nif (version === request.current.version) request.current.sending = false;\n}\n},\n[msgs, cid, state],\n);\nconst retry = _react.useCallback.call(void 0, () => {\nif (lastFailed) void send(lastFailed, msgs);\n}, [lastFailed, msgs, send]);\nreturn { msgs, state, availability, quickPrompts, recorded, draft, setDraft, send, retry, check, lastFailed };\n}\n\nconst SUGGESTIONS = [\n  [\"Plan a SaaS website\", \"I’m building a software business. Help me plan a website that explains the product and supports my customers.\"],\n  [\"Explain Cedros\", \"How do the website and assistant work together in Cedros?\"],\n  [\"Help my customers\", \"How can a Cedros website help my customers while keeping me in control?\"],\n] ;\n\nfunction stateLabel(a) {\n  if (a.state === \"sending\") return \"Replying…\";\n  if (a.state === \"error\") return \"Reply failed\";\n  if (a.availability === \"saved\") return \"Saved replies\";\n  if (a.state === \"off\" || a.availability === \"off\") return \"Assistant off\";\n  if (a.availability === \"checking\") return \"Checking…\";\n  if (a.availability === \"unknown\") return \"Unconfirmed\";\n  if (a.availability === \"human\") return \"Team inbox\";\n  return a.msgs.length ? a.recorded ? \"Recorded\" : \"Answered\" : \"Ready\";\n}\n\nconst CSS = `\nbody:has(.ca){overflow:hidden}\nbody:has(.ca) :is(header[class*=\"-site__header\"],footer[class*=\"-site__footer\"],[id$=\"site-support-chat-root\"]){display:none}\n.ca{--bg:#F6F5F2;--ink:#07111F;--muted:#5F6065;--panel:#FFFDF7;--line:#D9D7D2;--ring:#2F6C7D;--user:#E7EEEF;position:fixed;inset:0;top:var(--chat-top,0px);height:var(--chat-height,100dvh);z-index:45;display:flex;flex-direction:column;background:var(--bg);color:var(--ink);font:400 1rem/1.55 \"IBM Plex Sans\",\"Avenir Next\",\"Segoe UI\",sans-serif;isolation:isolate}\n:where(html[class*=\"-dark\"],.dark) .ca{--bg:#101212;--ink:#F6F5F2;--muted:#A6A7A9;--panel:#1A1D1E;--line:#414747;--ring:#7FB0BD;--user:#252D2E;color-scheme:dark}\n.ca *{box-sizing:border-box}.ca p,.ca h1{margin:0}.ca a{color:inherit;text-underline-offset:.25em}.ca button,.ca textarea{font:inherit}.ca button{cursor:pointer}.ca :is(a,button):focus-visible{outline:2px solid var(--ring);outline-offset:4px}\n.ca-sr{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}\n.ca-head{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:1rem;min-height:76px;padding:12px max(24px,env(safe-area-inset-right)) 12px max(24px,env(safe-area-inset-left));flex:none}\n.ca-back{justify-self:start;display:inline-flex;gap:.7rem;align-items:center;min-height:44px;font-size:.88rem;text-decoration:none}.ca-back:hover{text-decoration:underline}\n.ca-name{font-size:.92rem;font-weight:500}.hw-comp__state{justify-self:end;display:flex;align-items:center;gap:.5rem;font-size:.78rem;color:var(--muted)}.hw-comp__state{position:relative;min-width:7rem;justify-content:flex-end;padding-left:14px}.hw-comp__state i{position:absolute;left:0}.hw-comp__state i{width:6px;height:6px;border-radius:50%;background:currentColor}.hw-comp__state i[data-ready]{background:var(--ring)}\n.hw-comp{display:flex;flex-direction:column;flex:1;min-height:0;width:min(100% - 48px,48rem);margin-inline:auto;padding-bottom:max(24px,env(safe-area-inset-bottom))}\n.hw-comp:not([data-thread]){justify-content:safe center}.ca-empty{flex:none;display:grid;place-items:center;text-align:center;padding:0 0 2rem}.ca-empty h1{font:400 clamp(2.6rem,4.5vw,4rem)/1.08 \"Newsreader\",\"Iowan Old Style\",Palatino,Georgia,serif;letter-spacing:-.025em}\n.hw-thread{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:2rem 6px 2rem 0;scrollbar-width:thin;scrollbar-color:var(--line) transparent}\n.hw-msg{max-width:100%;font-size:1rem;line-height:1.65;overflow-wrap:anywhere}.hw-msg+.hw-msg{margin-top:1.75rem}.hw-msg--u{width:fit-content;max-width:88%;margin-left:auto;padding:.75rem 1.1rem;background:var(--user);border-radius:16px 16px 4px 16px}.hw-msg p{white-space:pre-wrap}.hw-msg p+p{margin-top:.75rem}.hw-msg__who{display:block;margin-bottom:.6rem;font-size:.78rem;font-weight:500;color:var(--muted)}\n.hw-msg__src{display:flex;flex-wrap:wrap;gap:.4rem 1rem;margin-top:.85rem;font-size:.8rem;color:var(--muted)}.hw-msg__meta{display:block;margin-top:.6rem;font-size:.78rem;color:var(--muted)}\n.ca-compose{flex:none;padding-top:.75rem}.hw-comp__field{padding:1rem 1.1rem .8rem;border:1px solid var(--line);border-radius:16px;background:var(--panel);box-shadow:0 6px 24px -18px #0005}.hw-comp__field:has(textarea:focus){border-color:var(--ring);box-shadow:0 0 0 1px var(--ring)}\n.ca textarea.hw-comp__ta{display:block;width:100%;min-height:3rem;max-height:176px;padding:0;resize:none;border:0;outline:none;box-shadow:none;background:transparent;color:var(--ink);font:inherit;line-height:1.5}.hw-comp__ta::placeholder{color:var(--muted);opacity:1}\n.hw-comp__tools{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin-top:.75rem}.hw-comp__key{font-size:.72rem;color:var(--muted)}.hw-comp__send{display:inline-flex;align-items:center;justify-content:center;gap:.65rem;min-height:44px;min-width:84px;padding:0 14px;border:0;border-radius:9px;background:var(--ink);color:var(--bg);font-size:.85rem}.hw-comp__send svg{width:18px;height:18px}.hw-comp__send[aria-disabled=true]{opacity:.5;cursor:default}\n.hw-sugg{height:88px;overflow-y:auto;align-content:flex-start;display:flex;flex-wrap:wrap;justify-content:center;gap:0 1.5rem;margin-top:.65rem}.hw-sugg[data-loading]{visibility:hidden}.hw-sugg button{min-height:44px;padding:.5rem 0;border:0;background:transparent;color:var(--muted);font-size:.82rem;text-underline-offset:.3em}.hw-sugg button:hover{color:var(--ink);text-decoration:underline}\n.hw-notice{margin:0 0 1rem;padding:.75rem 1rem;border-left:2px solid var(--ring);background:var(--user);font-size:.88rem}.hw-notice__row{display:flex;flex-wrap:wrap;gap:.25rem 1rem;margin-top:.35rem}.hw-notice__row :is(a,button){display:inline-flex;align-items:center;min-height:44px;padding:0;border:0;background:transparent;color:var(--ink);text-decoration:underline;text-underline-offset:.25em}.hw-comp__bar{padding-top:.6rem;text-align:center;font-size:.72rem;color:var(--muted)}\n@media(min-height:700px){.hw-comp:not([data-thread]){padding-bottom:clamp(24px,10vh,100px)}}\n@media(max-width:600px){.ca-head{grid-template-columns:1fr auto;gap:.35rem .8rem;min-height:64px;padding:10px 20px}.ca-name{display:none}.hw-comp{width:calc(100% - 40px);padding-bottom:max(16px,env(safe-area-inset-bottom))}.ca-empty h1{font-size:2.6rem;max-width:12ch}.hw-thread{padding-top:1rem}.hw-comp__field{padding:.85rem}.hw-comp__ta{min-height:4.5rem}.hw-comp__key{font-size:.66rem}.hw-sugg{gap:0 1.1rem}.hw-sugg button{font-size:.76rem}.hw-comp:not([data-thread]){padding-bottom:max(24px,env(safe-area-inset-bottom))}.ca-back{font-size:.85rem}.hw-comp__state{font-size:.75rem}}\n@media(max-height:520px){.ca-head{min-height:52px;padding-block:4px}.ca-empty{min-height:4rem;padding:.5rem 0}.ca-empty h1{font-size:2rem}.hw-comp{padding-bottom:12px}.hw-comp__ta{min-height:3rem}.hw-comp:not([data-saved]) .hw-sugg{display:none}.hw-comp:has(.hw-notice) .ca-empty{display:none}.ca-compose{max-height:100%;overflow-y:auto}.hw-comp__key{display:none}.hw-comp__tools{justify-content:flex-end}}\n@media(prefers-reduced-motion:reduce){.ca *{scroll-behavior:auto!important;animation:none!important;transition:none!important}}\n`;\n\nfunction Thread({ msgs, state }) {\n  const ref = _react.useRef(null);\n  _react.useEffect.call(void 0, () => { const el = ref.current; if (el) el.scrollTop = el.scrollHeight; }, [msgs.length, state]);\n  return React.createElement('div', { className: \"hw-thread\", ref: ref, role: \"log\", 'aria-label': \"Conversation with the Cedros assistant\"    , 'aria-live': \"polite\", 'aria-relevant': \"additions\",}\n    , msgs.map(m => React.createElement('div', { className: `hw-msg hw-msg--${m.role === \"user\" ? \"u\" : \"a\"}`, key: m.id,}\n      , React.createElement('span', { className: m.role === \"assistant\" ? \"hw-msg__who\" : \"ca-sr\",}, m.role === \"assistant\" ? \"Cedros assistant\" : \"You\")\n      , m.content.split(/\\n{2,}/).map((p, i) => React.createElement('p', { key: i,}, p))\n      , _optionalChain([m, 'access', _20 => _20.sources, 'optionalAccess', _21 => _21.length]) ? React.createElement('div', { className: \"hw-msg__src\",}, React.createElement('span', null, \"Based on\" ), m.sources.slice(0, 3).map(s => React.createElement('a', { href: s.routePath, key: s.id,}, s.label))) : null\n      , m.status === \"not_found\" ? React.createElement('span', { className: \"hw-msg__meta\",}, \"That isn't in the published Cedros material yet.\"       ) : null\n      , m.status === \"handoff_requested\" ? React.createElement('span', { className: \"hw-msg__meta\",}, \"Handed to a person.\"   ) : null\n      , m.failed ? React.createElement('span', { className: \"hw-msg__meta\",}, \"Delivery not confirmed.\"  ) : null\n    ))\n    , state === \"sending\" ? React.createElement('div', { className: \"hw-msg\",}, React.createElement('span', { className: \"hw-msg__who\",}, \"Cedros assistant\" ), React.createElement('p', null, \"Replying…\")) : null\n  );\n}\n\nfunction Composer({ a }) {\n  const input = _react.useRef(null);\n  const id = _react.useMemo.call(void 0, () => `ca-${uid()}`, []);\n  const hasThread = a.msgs.length > 0;\n  const canSend = !!a.draft.trim() && a.state !== \"sending\";\n  const canRetry = !!a.lastFailed && (a.availability !== \"saved\" || a.state === \"error\");\n  const suggestions = a.quickPrompts.length ? a.quickPrompts.map(({ label, prompt }) => [label, prompt]) : a.availability === \"saved\" ? [] : SUGGESTIONS;\n  const grow = _react.useCallback.call(void 0, () => {\n    const el = input.current;\n    if (!el) return;\n    el.style.height = \"auto\";\n    el.style.height = `${Math.min(el.scrollHeight, 176)}px`;\n    el.style.overflowY = el.scrollHeight > 176 ? \"auto\" : \"hidden\";\n  }, []);\n  _react.useLayoutEffect.call(void 0, grow, [grow, a.draft]);\n  _react.useEffect.call(void 0, () => {\n    const el = input.current;\n    if (!el) return;\n    let width = el.clientWidth;\n    const observer = typeof ResizeObserver === \"undefined\" ? null : new ResizeObserver(() => {\n      if (el.clientWidth !== width) { width = el.clientWidth; grow(); }\n    });\n    _optionalChain([observer, 'optionalAccess', _22 => _22.observe, 'call', _23 => _23(el)]);\n    let mounted = true;\n    void _optionalChain([document, 'access', _24 => _24.fonts, 'optionalAccess', _25 => _25.ready, 'access', _26 => _26.then, 'call', _27 => _27(() => { if (mounted) grow(); })]);\n    return () => { mounted = false; _optionalChain([observer, 'optionalAccess', _28 => _28.disconnect, 'call', _29 => _29()]); };\n  }, [grow]);\n  const submit = () => { if (canSend) void a.send(a.draft); };\n  return React.createElement('div', { className: \"hw-comp\", 'data-thread': hasThread ? \"\" : undefined, 'data-saved': a.availability === \"saved\" ? \"\" : undefined,}\n    , hasThread ? React.createElement(React.Fragment, null, React.createElement('h1', { className: \"ca-sr\",}, \"What are you building?\"   ), React.createElement(Thread, { msgs: a.msgs, state: a.state,} )) : React.createElement('div', { className: \"ca-empty\",}, React.createElement('h1', null, \"What are you building?\"   ))\n    , React.createElement('div', { className: \"ca-compose\",}\n      , a.state === \"error\" || a.state === \"off\" || a.availability === \"off\" || a.availability === \"human\" || a.availability === \"saved\" ? React.createElement('div', { className: \"hw-notice\", role: \"status\",}\n        , React.createElement('p', null, a.state === \"error\" ? \"The request couldn't finish. Your text is still here.\" : a.availability === \"saved\" ? \"Prewritten replies are available for the suggested questions below. AI replies are currently off; contact us for anything else.\" : a.state === \"off\" || a.availability === \"off\" ? \"The assistant is unavailable. You can retry or contact Cedros.\" : \"AI replies are off. Messages go to the team inbox.\")\n        , React.createElement('div', { className: \"hw-notice__row\",}, React.createElement('button', { type: \"button\", onClick: canRetry ? a.retry : a.check,}, canRetry ? \"Retry message\" : \"Check again\"), React.createElement('a', { href: \"/contact\",}, \"Contact Cedros\" ))\n      ) : null\n      , React.createElement('div', { className: \"hw-comp__field\",}\n        , React.createElement('label', { className: \"ca-sr\", htmlFor: id,}, \"Message the Cedros assistant\"   )\n        , React.createElement('textarea', { ref: input, id: id, className: \"hw-comp__ta\", rows: 2, value: a.draft,\n          placeholder: hasThread ? \"Ask a follow-up, or describe what you want the website to handle.\" : \"Describe your business, ask about Cedros, or tell us what you want the website to handle.\",\n          onChange: e => a.setDraft(e.target.value),\n          onKeyDown: e => { if (e.key === \"Enter\" && !e.shiftKey && !e.nativeEvent.isComposing) { e.preventDefault(); submit(); } },\n          'aria-describedby': `${id}-hint`, enterKeyHint: \"send\",} )\n        , React.createElement('div', { className: \"hw-comp__tools\",}, React.createElement('span', { className: \"hw-comp__key\", id: `${id}-hint`,}, \"Shift + Enter for a new line\"      ), React.createElement('button', { className: \"hw-comp__send\", type: \"button\", 'aria-label': \"Send to the Cedros assistant\"    , 'aria-disabled': !canSend, onClick: submit,}, \"Send \" , React.createElement('svg', { viewBox: \"0 0 20 20\"   , fill: \"none\", stroke: \"currentColor\", strokeWidth: \"1.6\", strokeLinecap: \"round\", strokeLinejoin: \"round\", 'aria-hidden': \"true\",}, React.createElement('path', { d: \"M10 16V4M4.5 9.5 10 4l5.5 5.5\"     ,} ))))\n      )\n      , !hasThread || a.availability === \"saved\" ? React.createElement('div', { className: \"hw-sugg\", 'data-loading': a.availability === \"checking\" ? \"\" : undefined, 'aria-busy': a.availability === \"checking\", 'aria-label': \"Suggested requests\" ,}, suggestions.map(([label, prompt], index) => React.createElement('button', { type: \"button\", key: index, onClick: () => { a.setDraft(prompt); _optionalChain([input, 'access', _30 => _30.current, 'optionalAccess', _31 => _31.focus, 'call', _32 => _32({ preventScroll: true })]); },}, label))) : null\n      , a.recorded ? React.createElement('div', { className: \"hw-comp__bar\",}, \"Conversation recorded.\" ) : null\n    )\n  );\n}\n\nfunction AssistantHeader({ a }) {\n  return React.createElement('div', { className: \"ca-head\",}, React.createElement('a', { className: \"ca-back\", href: \"/\",}, React.createElement('span', { 'aria-hidden': \"true\",}, \"←\"), \" Back to Cedros\"   ), React.createElement('span', { className: \"ca-name\",}, \"Cedros assistant\" ), React.createElement('span', { className: \"hw-comp__state\", role: \"status\", title: a.availability === \"unknown\" ? \"Assistant availability could not be confirmed. You can still try a question.\" : undefined,}, React.createElement('i', { 'aria-hidden': \"true\", 'data-ready': a.availability === \"ready\" ? \"\" : undefined,} ), stateLabel(a)));\n}\n\n function CedrosAssistant() {\n  const a = useAssistant();\n  const root = _react.useRef(null);\n  _react.useEffect.call(void 0, () => {\n    const viewport = window.visualViewport, el = root.current;\n    if (!viewport || !el) return;\n    const sync = () => {\n      if (viewport.scale !== 1) return;\n      el.style.setProperty(\"--chat-height\", `${viewport.height}px`);\n      el.style.setProperty(\"--chat-top\", `${viewport.offsetTop}px`);\n    };\n    sync();\n    viewport.addEventListener(\"resize\", sync);\n    viewport.addEventListener(\"scroll\", sync);\n    return () => { viewport.removeEventListener(\"resize\", sync); viewport.removeEventListener(\"scroll\", sync); };\n  }, []);\n  return React.createElement('div', { className: \"ca\", ref: root,}\n    , React.createElement('style', null, CSS)\n    , React.createElement(AssistantHeader, { a: a,} )\n    , React.createElement(Composer, { a: a,} )\n  );\n} exports.default = CedrosAssistant;"}