@askly/widget 2.11.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/MIGRATION-3.0.md +58 -0
  2. package/README.md +131 -3
  3. package/dist/app/HelpTab-BrWJK4wa.js +1 -0
  4. package/dist/app/VoiceRecorder-rdqySW9p.js +1 -0
  5. package/dist/app/ar-V_LzQrur.js +1 -0
  6. package/dist/app/askly-app.js +1 -0
  7. package/dist/app/de-BN3nFgQz.js +1 -0
  8. package/dist/app/es-BvfGFMIb.js +1 -0
  9. package/dist/app/fr-DNlpcnFv.js +1 -0
  10. package/dist/app/hi-C81tFu4P.js +1 -0
  11. package/dist/app/pt-nxDVHThV.js +1 -0
  12. package/dist/app/shared-Cp0FX5Ux.js +1 -0
  13. package/dist/app/speech-8iAgRQFA.js +1 -0
  14. package/dist/index.esm.js +1 -1
  15. package/dist/index.umd.js +1 -1
  16. package/dist/loader.js +1 -0
  17. package/dist/types/app.d.ts +3 -0
  18. package/dist/types/core/api.d.ts +34 -0
  19. package/dist/types/core/config.d.ts +52 -0
  20. package/dist/{core → types/core}/events.d.ts +10 -0
  21. package/dist/types/core/format.d.ts +2 -0
  22. package/dist/types/core/html.d.ts +2 -0
  23. package/dist/{core → types/core}/speech.d.ts +2 -7
  24. package/dist/{core → types/core}/types.d.ts +8 -0
  25. package/dist/types/core/voice.d.ts +6 -0
  26. package/dist/types/i18n/en.d.ts +144 -0
  27. package/dist/types/i18n/index.d.ts +32 -0
  28. package/dist/types/i18n/locales/ar.d.ts +3 -0
  29. package/dist/types/i18n/locales/de.d.ts +3 -0
  30. package/dist/types/i18n/locales/es.d.ts +3 -0
  31. package/dist/types/i18n/locales/fr.d.ts +3 -0
  32. package/dist/types/i18n/locales/hi.d.ts +3 -0
  33. package/dist/types/i18n/locales/pt.d.ts +3 -0
  34. package/dist/types/index.d.ts +8 -0
  35. package/dist/types/loader/attrs.d.ts +4 -0
  36. package/dist/types/loader/core.d.ts +26 -0
  37. package/dist/types/ui/ChatTerms.d.ts +5 -0
  38. package/dist/{ui → types/ui}/GreetingBubble.d.ts +4 -0
  39. package/dist/{ui → types/ui}/Launcher.d.ts +5 -0
  40. package/dist/{ui → types/ui}/MessageList.d.ts +5 -0
  41. package/dist/types/widget-entry.d.ts +1 -0
  42. package/dist/types/widget.d.ts +3 -0
  43. package/dist/widget.js +1 -10
  44. package/package.json +33 -21
  45. package/dist/core/format.d.ts +0 -2
  46. package/dist/index.d.ts +0 -124
  47. package/dist/ui/ChatTerms.d.ts +0 -3
  48. package/dist/widget.d.ts +0 -4
  49. /package/dist/{core → types/core}/greeting.d.ts +0 -0
  50. /package/dist/{core → types/core}/session.d.ts +0 -0
  51. /package/dist/{core → types/core}/storage.d.ts +0 -0
  52. /package/dist/{icons.d.ts → types/icons.d.ts} +0 -0
  53. /package/dist/{identity.d.ts → types/identity.d.ts} +0 -0
  54. /package/dist/{markdown.d.ts → types/markdown.d.ts} +0 -0
  55. /package/dist/{pathRules.d.ts → types/pathRules.d.ts} +0 -0
  56. /package/dist/{realtime.d.ts → types/realtime.d.ts} +0 -0
  57. /package/dist/{ui → types/ui}/Composer.d.ts +0 -0
  58. /package/dist/{ui → types/ui}/ConversationList.d.ts +0 -0
  59. /package/dist/{ui → types/ui}/ExploreTab.d.ts +0 -0
  60. /package/dist/{ui → types/ui}/HelpTab.d.ts +0 -0
  61. /package/dist/{ui → types/ui}/NavTabs.d.ts +0 -0
  62. /package/dist/{ui → types/ui}/PanelHeader.d.ts +0 -0
  63. /package/dist/{ui → types/ui}/VoiceRecorder.d.ts +0 -0
@@ -0,0 +1,58 @@
1
+ # Migrating to @askly/widget 3.0
2
+
3
+ 3.0 changes how the widget is delivered, not what it does. Every option, method and event from
4
+ 2.x still works. Most sites have nothing to do.
5
+
6
+ ## Script tag
7
+
8
+ Nothing to change if you load it from a CDN. `dist/widget.js` is now a loader of under 5 KB
9
+ that fetches the widget on demand from the `app/` directory next to it, so the existing
10
+ one-line embed keeps working, including on `@latest`. We recommend pinning the major version:
11
+
12
+ ```html
13
+ <script src="https://unpkg.com/@askly/widget@3/dist/widget.js" data-app-id="…" async></script>
14
+ ```
15
+
16
+ If you copied `widget.js` to your own server, copy the whole `dist/` directory this time
17
+ (`widget.js` and `app/`), and keep old `app/` files around for a while after each update:
18
+ a visitor who already has the main file may still fetch its chunks.
19
+
20
+ ## npm
21
+
22
+ `react` and `react-dom` are no longer peer dependencies; you can remove them if the widget was
23
+ the only reason you had them. `import Askly from "@askly/widget"` still works and still gives
24
+ you the same API. What you import is now the loader; the widget's code is fetched from the CDN,
25
+ for your exact package version, when first needed. To keep everything on your own origin, copy
26
+ `dist/app/` to your static assets and pass its URL as `appUrl` (see the README).
27
+
28
+ If you rendered the React component directly (`import { ChatWidget } from "@askly/widget"`),
29
+ that export is gone. Use `Askly.init()`, or `<AsklyProvider>` from the new `@askly/react`.
30
+
31
+ ## Styling
32
+
33
+ The widget now renders in a Shadow DOM. CSS on your page that targeted the widget's class names
34
+ (`.askly-chat-modal`, `.askly-chat-button`, …) no longer reaches it. Colours and fonts come from
35
+ the portal; for per-page adjustments set these properties on the host elements:
36
+
37
+ ```css
38
+ askly-widget, askly-loader { --askly-brand: #0f766e; --askly-font-family: "Inter", sans-serif; }
39
+ ```
40
+
41
+ ## Content Security Policy
42
+
43
+ The widget's code is now a module that the loader imports, so a nonce on the `<script>` tag is
44
+ no longer enough on its own: add `'strict-dynamic'` to `script-src`, or list the origin you load
45
+ the widget from. If your page enforces Trusted Types, allow the policy name `askly`. With
46
+ Turnstile on, allow `https://challenges.cloudflare.com` in `script-src` and `frame-src`.
47
+
48
+ ## New
49
+
50
+ - `Askly.unmount()` removes the widget without forgetting the visitor (use it where a framework
51
+ mounts and unmounts; `shutdown()` still also resets identity, for logout).
52
+ - `<askly-chat app-id="…">` element, `appUrl` option, `@askly/react`.
53
+
54
+ ## Removed
55
+
56
+ - The `readAloud` option (removed in 2.11.0; still accepted and ignored).
57
+ - The `ChatWidget` React component export.
58
+ - Internet Explorer 11: the build targets ES2019 and needs dynamic `import()` (Chrome 73, Safari 12.1, Firefox 67 and later).
package/README.md CHANGED
@@ -22,14 +22,30 @@ Askly is an **embeddable AI support chat widget** for React and plain HTML. Drop
22
22
 
23
23
  ### Script tag (any website)
24
24
 
25
- One line, before `</body>`. The bundle is self-contained — no React or other dependencies on your page:
25
+ One line, before `</body>`:
26
26
 
27
27
  ```html
28
- <script src="https://unpkg.com/@askly/widget@latest/dist/widget.js" data-app-id="YOUR_APP_ID" async></script>
28
+ <script src="https://unpkg.com/@askly/widget@3/dist/widget.js" data-app-id="YOUR_APP_ID" async></script>
29
29
  ```
30
30
 
31
31
  That's the whole install. Your branding — name, logo, theme, welcome message — loads automatically from your Askly portal settings.
32
32
 
33
+ What the page downloads is a loader of under 5 KB. It paints the launcher at once and fetches the
34
+ widget itself (about 40 KB, from the same place as the loader) only when it is about to be
35
+ needed: when the visitor moves to the launcher, when the greeting bubble is due, when a
36
+ conversation from an earlier visit may have replies waiting, or when your code calls the API.
37
+ Voice input and the help centre are fetched separately, the first time they are used.
38
+
39
+ The widget renders inside a Shadow DOM, so your site's CSS cannot affect it and its CSS cannot
40
+ affect your site. Pin a major version (`@3`) rather than `@latest`, so a future major release
41
+ cannot change your embed without you.
42
+
43
+ You can also place it as an element, with the same attributes minus the `data-` prefix:
44
+
45
+ ```html
46
+ <askly-chat app-id="YOUR_APP_ID" position="left"></askly-chat>
47
+ ```
48
+
33
49
  ### NPM (React / bundlers)
34
50
 
35
51
  ```bash
@@ -42,7 +58,106 @@ import Askly from '@askly/widget';
42
58
  Askly.init({ appId: "YOUR_APP_ID" });
43
59
  ```
44
60
 
45
- The npm builds (`index.esm.js` / `index.umd.js`) treat React as a peer dependency, so your bundle isn't double-shipping it.
61
+ The package has no dependencies and no React peer dependency. What you import is the same small
62
+ loader as the script tag; the widget's code is fetched from the CDN, for exactly the package
63
+ version you installed, when it is first needed. It adds about 3 KB to your bundle.
64
+
65
+ To serve the widget from your own origin instead, copy `node_modules/@askly/widget/dist/app/` to
66
+ your static assets and point the loader at it:
67
+
68
+ ```javascript
69
+ Askly.init({ appId: "YOUR_APP_ID", appUrl: "/static/askly/app/askly-app.js" });
70
+ ```
71
+
72
+ ### React
73
+
74
+ ```bash
75
+ npm install @askly/widget @askly/react
76
+ ```
77
+
78
+ ```tsx
79
+ import { AsklyProvider, useAskly } from "@askly/react";
80
+
81
+ <AsklyProvider appId="YOUR_APP_ID">
82
+ <App />
83
+ </AsklyProvider>
84
+
85
+ // anywhere below the provider
86
+ const askly = useAskly();
87
+ askly.showNewMessage("Hi, I have a question about billing.");
88
+ ```
89
+
90
+ `AsklyProvider` initialises the widget on mount and removes it on unmount; `useAsklyEvent(name, handler)`
91
+ and `useAsklyIdentity(identity)` wrap `Askly.on()` and `Askly.identify()`.
92
+
93
+ ### Languages
94
+
95
+ The widget's own texts (buttons, labels, notices) come in English, Arabic, German, Spanish,
96
+ French, Hindi and Portuguese. The language is the portal's setting when there is one, else the
97
+ `locale` option, else the visitor's browser language; anything unsupported falls back to
98
+ English. Other languages are fetched as a small chunk (about 3 KB) only when used. Arabic (and
99
+ other right-to-left languages) lays the widget out right to left. Dates and numbers follow the
100
+ locale. Content your team writes, such as the welcome message, FAQs and articles, is shown as
101
+ written.
102
+
103
+ ```javascript
104
+ Askly.init({ appId: "…", locale: "fr" }); // or data-locale="fr"
105
+ Askly.setLocale("pt-BR"); // switch at runtime
106
+ Askly.updateTexts({ start_new_chat: "Talk to us", tab_help: "Docs" }); // your own wording, any locale
107
+ ```
108
+
109
+ The keys for `updateTexts()` are the ones in `src/i18n/en.ts`; TypeScript users can import
110
+ `AsklyTextKey`.
111
+
112
+ ### Accessibility
113
+
114
+ The launcher is a button with its open state exposed; the panel is a dialog that takes focus
115
+ when it opens, returns it when it closes, closes on Escape, and keeps keyboard focus inside on
116
+ phones where it fills the screen. Sections are tabs with arrow-key navigation, the conversation
117
+ is a live log so replies are read out, every icon button is named, errors are announced inline,
118
+ colours meet WCAG 2.2 AA contrast, and the test suite runs axe on every screen.
119
+
120
+ ### Launcher options
121
+
122
+ ```javascript
123
+ Askly.init({
124
+ appId: "…",
125
+ position: "left", // which side; default "right"
126
+ offset: { bottom: 40, side: 32 }, // px from the viewport edges (default 24, 16 on phones)
127
+ hideLauncher: true, // no launcher: open through the API or a custom one
128
+ customLauncherSelector: "#contact-us, .help-link", // host elements that open and close the panel
129
+ });
130
+ ```
131
+
132
+ Each has a `data-` attribute (`data-position`, `data-offset-bottom`, `data-offset-side`,
133
+ `data-hide-launcher`, `data-custom-launcher-selector`). Custom launchers get `aria-expanded`
134
+ kept in sync. "Powered by Askly" is removed for plans that include white-label, from the
135
+ portal; an embed cannot remove it.
136
+
137
+ ### Theming from your page
138
+
139
+ Colours come from the portal. If you need to adjust them per page, set these two custom
140
+ properties on the widget's host elements; they are the one thing that crosses into the widget
141
+ and they win over the portal's values:
142
+
143
+ ```css
144
+ askly-widget, askly-loader { --askly-brand: #0f766e; --askly-font-family: "Inter", sans-serif; }
145
+ ```
146
+
147
+ (`askly-loader` is the launcher shown before the widget's code has been fetched.)
148
+
149
+ ### Content Security Policy
150
+
151
+ With a strict CSP:
152
+
153
+ - `script-src` must allow the origin the widget is loaded from (the loader and the widget come
154
+ from the same place). A nonce on the `<script>` tag alone is not enough, because the widget's
155
+ code is a module the loader imports: add `'strict-dynamic'`, or list the origin.
156
+ - `connect-src` must include the Askly API, and `media-src` needs `blob:` if voice input is on.
157
+ - With Cloudflare Turnstile on, `script-src` and `frame-src` must allow `https://challenges.cloudflare.com`.
158
+ - Pages that enforce Trusted Types must allow the policy name `askly` (`trusted-types askly`).
159
+ - Styles use constructed stylesheets, so `style-src` needs no `'unsafe-inline'` in current
160
+ browsers. Safari and iOS before 16.4 fall back to a `<style>` element, which does need it.
46
161
 
47
162
  ## Quick Start
48
163
 
@@ -373,11 +488,24 @@ npm install
373
488
  npm run build
374
489
  ```
375
490
 
491
+ `npm run build` produces:
492
+
493
+ | File | What |
494
+ | :--- | :--- |
495
+ | `dist/widget.js` (= `dist/loader.js`) | The script-tag loader. |
496
+ | `dist/app/askly-app.js` | The widget, an ES module the loader imports; `dist/app/*-[hash].js` are its lazy chunks. |
497
+ | `dist/index.esm.js`, `dist/index.umd.js` | The npm entry (the loader as a module). |
498
+ | `dist/types/` | Type declarations. |
499
+ | `packages/react/dist/` | `@askly/react`. |
500
+
501
+ `npm run size` checks the budgets: 5 KB for the loader, 42 KB for the app (gzip).
502
+
376
503
  ### Releasing
377
504
 
378
505
  ```bash
379
506
  npm version <patch|minor|major>
380
507
  npm publish # prepublishOnly rebuilds dist/
508
+ cd packages/react && npm version <same> && npm publish
381
509
  ```
382
510
 
383
511
  **Publishing is not the last step.** The tenant portal bundles this package
@@ -0,0 +1 @@
1
+ import{g as e,t,n as l,b as a,o as c,aa as n,ab as s,C as r,d as i,f as o,B as m}from"./shared-Cp0FX5Ux.js";function p(e){switch(e){case"guide":return{title:t("help_collection_guide_title"),desc:t("help_collection_guide_desc")};case"faq":return{title:t("help_collection_faq_title"),desc:t("help_collection_faq_desc")};case"troubleshooting":return{title:t("help_collection_troubleshooting_title"),desc:t("help_collection_troubleshooting_desc")};default:return{title:t("help_collection_other_title"),desc:t("help_collection_other_desc")}}}function d(d){const{allArticles:h,articleFeedback:u,articlesLoading:E,handleSearchChange:_,handleSelectArticle:y,organizationLogo:f,organizationName:N,searchError:b,searchLoading:k,searchQuery:v,searchResults:g,selectedArticle:x,selectedCollection:w,setActiveTab:C,setArticleFeedback:z,setInput:S,setSelectedArticle:A,setSelectedCollection:L,themeColor:I}=d;return e.createElement("div",{className:"chat-body help-layout"},x?e.createElement("div",{className:"help-article-reader"},e.createElement("div",{className:"article-breadcrumb"},e.createElement("button",{type:"button",className:"article-breadcrumb-link",onClick:()=>{A(null),L(null)}},t("header_help_center")),e.createElement("span",{"aria-hidden":"true"},"/"),e.createElement("span",{className:"article-breadcrumb-type"},x.document_type?p(x.document_type.toLowerCase()).title:t("help_document_type_fallback"))),e.createElement("button",{type:"button",className:"help-back-btn",onClick:()=>A(null),style:{marginBottom:14}},e.createElement(l,{size:16,className:"askly-flip-rtl"}),e.createElement("span",null,t("help_back_to_articles"))),e.createElement("h1",{className:"help-article-heading",tabIndex:-1},x.title),e.createElement("div",{className:"article-author-bar"},e.createElement("img",{src:f||"https://askly.co.in/logo-small.png",alt:N,className:"article-author-avatar"}),e.createElement("div",{className:"article-author-text"},e.createElement("span",{className:"article-author-name"},t("help_written_by",{organizationName:N})),e.createElement("span",{className:"article-author-meta"},t("help_updated_recently")," • ",e.createElement("span",{"aria-hidden":"true"},"⏱ "),a("help_read_time",(q=x.content,Math.max(1,Math.ceil((q||"").split(/\s+/).length/180))))))),e.createElement("div",{className:"help-article-body",dangerouslySetInnerHTML:{__html:c(n(x.content))}}),e.createElement("div",{className:"article-feedback"},e.createElement("div",{className:"article-feedback-title"},t("help_feedback_title")),u[x.id]?e.createElement("div",{className:"article-feedback-thanks",role:"status"},e.createElement("span",{"aria-hidden":"true"},"🎉 "),t("help_feedback_thanks")):e.createElement("div",{className:"article-feedback-options"},e.createElement("button",{type:"button",className:"article-feedback-btn",onClick:()=>z(e=>({...e,[x.id]:"yes"}))},e.createElement("span",{"aria-hidden":"true"},"😃 "),t("help_feedback_yes")),e.createElement("button",{type:"button",className:"article-feedback-btn",onClick:()=>z(e=>({...e,[x.id]:"somewhat"}))},e.createElement("span",{"aria-hidden":"true"},"😐 "),t("help_feedback_somewhat")),e.createElement("button",{type:"button",className:"article-feedback-btn",onClick:()=>z(e=>({...e,[x.id]:"no"}))},e.createElement("span",{"aria-hidden":"true"},"😞 "),t("help_feedback_no"))),e.createElement("button",{type:"button",className:"article-handoff",onClick:()=>{S(t("help_handoff_prefill",{title:x.title})),C("messages")}},e.createElement("div",{className:"article-handoff-text"},e.createElement("span",{className:"article-handoff-title"},e.createElement(s,{size:13})," ",t("help_handoff_title")),e.createElement("span",{className:"article-handoff-desc"},t("help_handoff_desc"))),e.createElement(r,{size:16,className:"article-handoff-chevron askly-flip-rtl"})))):e.createElement("div",null,e.createElement("div",{className:"home-search-input-wrapper",style:{marginBottom:14}},e.createElement(i,{size:14,className:"search-icon-svg"}),e.createElement("input",{type:"text",value:v,onChange:_,placeholder:t("help_search_placeholder"),"aria-label":t("help_search_label")}),k&&e.createElement("span",{className:"search-loader"})),w&&e.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:12}},e.createElement("button",{type:"button",onClick:()=>L(null),style:{all:"unset",cursor:"pointer",fontSize:12,color:I,fontWeight:500,display:"flex",alignItems:"center",gap:4}},e.createElement(l,{size:14,className:"askly-flip-rtl"}),e.createElement("span",null,t("help_all_collections"))),e.createElement("span",{style:{fontSize:12,color:"var(--text-4)"},"aria-hidden":"true"},"/"),e.createElement("span",{style:{fontSize:12,fontWeight:600,color:"var(--text-1)",textTransform:"capitalize"}},p(w).title)),e.createElement("div",{className:"help-articles-list"},""===v.trim()?w?(()=>{const l=h.filter(e=>(e.document_type||"guide").toLowerCase()===w.toLowerCase());return e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:10,width:"100%"}},e.createElement("div",{style:{fontSize:11,fontWeight:600,color:"var(--text-3)",textTransform:"uppercase",letterSpacing:"0.5px"}},t("help_collection_articles",{collection:p(w).title,count:o(l.length)})),e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:8}},l.map(t=>e.createElement("button",{type:"button",key:t.id,className:"help-article-row",onClick:()=>y(t)},e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:3,alignItems:"flex-start",textAlign:"start"}},e.createElement("span",{className:"article-row-title"},t.title),t.content&&e.createElement("span",{className:"article-row-preview"},t.content.replace(/[\n\r]+/g," ").slice(0,85),"…")),e.createElement(r,{size:14,className:"article-row-chevron askly-flip-rtl"})))))})():e.createElement("div",{className:"help-collections"},(()=>{if(E)return[0,1,2].map(t=>e.createElement("div",{key:t,className:"help-collection-card is-skeleton"},e.createElement("div",{className:"help-collection-left"},e.createElement("span",{className:"askly-skeleton help-collection-icon-skel"}),e.createElement("div",{className:"help-collection-text"},e.createElement("span",{className:"askly-skeleton askly-skeleton-line",style:{width:"60%"}}),e.createElement("span",{className:"askly-skeleton askly-skeleton-line",style:{width:"90%"}})))));const l={};h.forEach(e=>{const t=(e.document_type||"guide").toLowerCase();l[t]||(l[t]=[]),l[t].push(e)});const c=Object.keys(l);return 0===c.length?e.createElement("div",{className:"askly-empty-state"},e.createElement("div",{className:"askly-empty-icon"},e.createElement(m,{size:22})),e.createElement("div",{className:"askly-empty-title"},t("help_empty_title")),e.createElement("div",{className:"askly-empty-desc"},t("help_empty_desc"))):c.map(t=>{const c=l[t],{title:n,desc:s}=p(t);return e.createElement("button",{type:"button",key:t,className:"help-collection-card",onClick:()=>L(t)},e.createElement("div",{className:"help-collection-left"},e.createElement("div",{className:"help-collection-icon"},e.createElement(m,{size:16})),e.createElement("div",{className:"help-collection-text"},e.createElement("div",{className:"help-collection-title"},n),e.createElement("div",{className:"help-collection-desc"},s),e.createElement("div",{className:"help-collection-count"},a("help_article_count",c.length)))),e.createElement(r,{size:16,className:"help-collection-chevron askly-flip-rtl"}))})})()):b?e.createElement("div",{className:"no-search-results"},b):0!==g.length||k?g.map(t=>e.createElement("button",{type:"button",key:t.id,className:"help-article-row",onClick:()=>y(t)},e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:3,alignItems:"flex-start",textAlign:"start"}},e.createElement("span",{className:"article-row-title"},t.title),e.createElement("span",{className:"article-row-preview"},t.content.slice(0,80),"…")),e.createElement(r,{size:14,className:"article-row-chevron askly-flip-rtl"}))):e.createElement("div",{className:"no-search-results",role:"status"},t("help_search_no_results",{query:v})))));var q}export{d as HelpTab};
@@ -0,0 +1 @@
1
+ import{x as e,y as t,t as a,b as s,g as n,f as c,X as l}from"./shared-Cp0FX5Ux.js";function i({phase:i,meterRef:o,maxMs:r,onStop:m,onCancel:v}){const[u,p]=e([]),[d,y]=e(0);t(()=>{if("recording"!==i)return;const e=setInterval(()=>{const{level:e,elapsedMs:t}=o.current;y(t),p(t=>(t.length>=80?t.slice(1):t).concat(e))},100);return()=>clearInterval(e)},[i]);const b="recording"===i,_=r-d,h=Math.max(0,Math.ceil(_/1e3)),k=b&&_<=1e4,E=a("transcribing"===i?"voice_status_transcribing":b?"voice_status_listening":"voice_status_waiting"),g=b&&_<=5e3?`${E} ${s("voice_seconds_left",h)}`:E;return n.createElement("div",{className:`askly-voice ${i}`},n.createElement("button",{type:"button",className:"askly-voice-btn",onClick:v,title:a("voice_cancel"),"aria-label":a("voice_cancel")},n.createElement(l,{size:20})),n.createElement("span",{className:"askly-voice-meter","aria-hidden":"true"},u.map((e,t)=>n.createElement("i",{key:t,style:{height:`${Math.round(2+22*Math.min(1,e))}px`}}))),n.createElement("span",{className:"askly-voice-status",role:"status"},g),k&&n.createElement("span",{className:"askly-voice-time","aria-hidden":"true"},a("voice_countdown",{count:c(h)})),b?n.createElement("button",{type:"button",className:"askly-voice-btn done",onClick:m,title:a("voice_stop"),"aria-label":a("voice_stop")},n.createElement("span",{className:"askly-voice-stop"})):n.createElement("span",{className:"askly-voice-btn done busy","aria-hidden":"true"},n.createElement("span",{className:"askly-voice-spinner"})))}export{i as VoiceRecorder};
@@ -0,0 +1 @@
1
+ const e={launcher_open:"فتح محادثة الدعم",launcher_close:"إغلاق محادثة الدعم",launcher_open_unread_zero:"فتح محادثة الدعم، لا توجد رسائل جديدة",launcher_open_unread_one:"فتح محادثة الدعم، رسالة جديدة واحدة",launcher_open_unread_two:"فتح محادثة الدعم، رسالتان جديدتان",launcher_open_unread_few:"فتح محادثة الدعم، {count} رسائل جديدة",launcher_open_unread_many:"فتح محادثة الدعم، {count} رسالة جديدة",launcher_open_unread_other:"فتح محادثة الدعم، {count} رسالة جديدة",launcher_unread_overflow:"{count}+",panel_label:"دعم {organizationName}",header_messages:"الرسائل",header_help_center:"مركز المساعدة",header_back_to_conversations:"الرجوع إلى المحادثات",header_expand:"تكبير النافذة",header_collapse:"تصغير النافذة",header_close:"إغلاق",conversation_label:"محادثة",sending_to_team:"جارٍ الإرسال إلى الفريق…",uploading_attachment:"جارٍ رفع المرفق…",new_messages_zero:"لا توجد رسائل جديدة",new_messages_one:"رسالة جديدة واحدة",new_messages_two:"رسالتان جديدتان",new_messages_few:"{count} رسائل جديدة",new_messages_many:"{count} رسالة جديدة",new_messages_other:"{count} رسالة جديدة",reaction_helpful:"مفيد",reaction_not_helpful:"غير مفيد",copy_message:"نسخ الرسالة",copied:"تم النسخ",message_from_agent:"موظف الدعم",message_from_you:"أنت",terms_notice:"بالدردشة معنا، فإنك توافق على {terms}",terms_link:"الشروط",powered_by:"مدعوم من {brand}",tab_explore:"استكشاف",tab_messages:"الرسائل",tab_help:"المساعدة",tabs_label:"الأقسام",conversations_empty_title:"لا توجد محادثات بعد",conversations_empty_desc:"ابدأ محادثة وسيساعدك وكيل الذكاء الاصطناعي وفريقنا.",conversation_no_messages:"لا توجد رسائل بعد",conversation_title:"محادثة رقم {number}",start_new_chat:"اطرح سؤالًا",composer_label:"الرسالة",composer_placeholder:"اكتب رسالتك…",composer_placeholder_lead_required:"أضف بريدك الإلكتروني أعلاه للمتابعة…",composer_placeholder_security_check:"أكمل التحقق الأمني للدردشة…",composer_hint:"اضغط Enter للإرسال، وShift+Enter لسطر جديد",attach_file:"إرفاق ملف (10 ميغابايت كحد أقصى)",insert_emoji:"إدراج رمز تعبيري",emoji_picker_label:"اختر رمزًا تعبيريًا",send_message:"إرسال الرسالة",attachment_image_alt:"صورة مرفقة",attachment_file_label:"ملف مرفق: {name}",notice_security_check_required:"يرجى إكمال التحقق الأمني أولًا.",voice_start:"إدخال صوتي",voice_finish:"إنهاء التسجيل",voice_status_waiting:"في انتظار الميكروفون…",voice_status_listening:"جارٍ الاستماع…",voice_status_transcribing:"جارٍ التحويل إلى نص…",voice_seconds_left_zero:"انتهى الوقت",voice_countdown:"{count} ث",voice_seconds_left_one:"ثانية واحدة متبقية",voice_seconds_left_two:"ثانيتان متبقيتان",voice_seconds_left_few:"{count} ثوانٍ متبقية",voice_seconds_left_many:"{count} ثانية متبقية",voice_seconds_left_other:"{count} ثانية متبقية",voice_cancel:"إلغاء الإدخال الصوتي",voice_stop:"إيقاف التسجيل وتحويله إلى نص",voice_retry:"حاول مرة أخرى",voice_error_insecure:"يتطلب الإدخال الصوتي صفحة آمنة (https).",voice_error_unsupported:"الإدخال الصوتي غير مدعوم في هذا المتصفح.",voice_error_denied:"الوصول إلى الميكروفون محظور. اسمح به من إعدادات الموقع في متصفحك لاستخدام الإدخال الصوتي.",voice_error_no_microphone:"لم يتم العثور على ميكروفون.",voice_error_no_speech:"لم نسمع ذلك جيدًا. يرجى المحاولة مرة أخرى.",voice_error_no_audio:"لا يصدر أي صوت من الميكروفون. تأكد من أنه غير مكتوم ومن اختيار الميكروفون الصحيح.",voice_error_limit:"الإدخال الصوتي غير متاح حاليًا. يرجى كتابة رسالتك.",voice_error_disabled:"الإدخال الصوتي معطَّل.",voice_error_network:"تعذّر تحويل تسجيلك إلى نص. تحقق من اتصالك وحاول مرة أخرى.",voice_error_failed:"تعذّر تحويل تسجيلك إلى نص. يرجى المحاولة مرة أخرى أو كتابة رسالتك.",lead_prompt:"اترك بريدك الإلكتروني وسنردّ عليك هناك إذا غادرت.",lead_email_placeholder:"you@example.com",lead_email_label:"بريدك الإلكتروني",lead_save:"حفظ",lead_saving:"جارٍ الحفظ…",lead_dismiss:"لا، شكرًا",lead_error_invalid_email:"لا يبدو هذا عنوان بريد إلكتروني صحيحًا.",lead_error_save_failed:"تعذّر الحفظ الآن. يمكنك متابعة المحادثة.",greeting_default:"مرحبًا من {organizationName}. كيف يمكننا مساعدتك؟",greeting_default_persona:"مرحبًا، أنا {ai_name} من {organizationName}. كيف يمكنني مساعدتك؟",greeting_dismiss:"إغلاق الترحيب",welcome_default:"مرحبًا! كيف يمكنني مساعدتك اليوم؟",explore_hero_title:"أهلًا بك",explore_hero_subtitle:"كيف يمكننا مساعدتك؟",explore_search_placeholder:"ابحث عن مساعدة…",explore_cta_title:"اسأل وكيل الذكاء الاصطناعي",explore_cta_sub:"إجابات فورية على مدار الساعة — أو تواصل مع الفريق",explore_tile_help_title:"مركز المساعدة",explore_tile_help_sub:"أدلة ومستندات",explore_tile_messages_title:"الرسائل",explore_tile_messages_sub:"محادثاتك",explore_popular_questions:"أسئلة شائعة",explore_ask_ai_about_this:"اسأل وكيل الذكاء الاصطناعي عن هذا",explore_recommended_reading:"قراءات مقترحة",help_search_placeholder:"ابحث في المقالات…",help_search_label:"البحث في المقالات",help_searching:"جارٍ البحث…",help_search_no_results:"لا توجد مقالات مطابقة لـ «{query}»",help_all_collections:"جميع المجموعات",help_back_to_articles:"الرجوع إلى المقالات",help_document_type_fallback:"دليل",help_written_by:"بقلم فريق دعم {organizationName}",help_updated_recently:"تم التحديث مؤخرًا",help_read_time_zero:"أقل من دقيقة للقراءة",help_read_time_one:"دقيقة واحدة للقراءة",help_read_time_two:"دقيقتان للقراءة",help_read_time_few:"{count} دقائق للقراءة",help_read_time_many:"{count} دقيقة للقراءة",help_read_time_other:"{count} دقيقة للقراءة",help_feedback_title:"هل أجاب هذا عن سؤالك؟",help_feedback_thanks:"شكرًا على ملاحظاتك!",help_feedback_yes:"نعم",help_feedback_somewhat:"إلى حدٍّ ما",help_feedback_no:"لا",help_handoff_title:"لا تزال لديك أسئلة؟",help_handoff_desc:"اسأل وكيل الذكاء الاصطناعي للحصول على إجابات فورية",help_handoff_prefill:"لديّ سؤال حول المقالة «{title}»: ",help_collection_articles:"مقالات {collection} ({count})",help_article_count_zero:"لا توجد مقالات",help_article_count_one:"مقالة واحدة",help_article_count_two:"مقالتان",help_article_count_few:"{count} مقالات",help_article_count_many:"{count} مقالة",help_article_count_other:"{count} مقالة",help_empty_title:"وثائق المساعدة",help_empty_desc:"ابحث أعلاه للحصول على حلول فورية من قاعدة معارفنا.",help_collection_guide_title:"الأدلة والدروس",help_collection_guide_desc:"شروحات الإعداد والقواعد وأدلة البدء",help_collection_faq_title:"الأسئلة المتكررة",help_collection_faq_desc:"إجابات سريعة عن الأسئلة الشائعة حول الحساب والخدمة",help_collection_troubleshooting_title:"استكشاف الأخطاء والدعم",help_collection_troubleshooting_desc:"حلول خطوة بخطوة للمشكلات التقنية",help_collection_other_title:"القواعد والوثائق",help_collection_other_desc:"الشروط الرسمية والقواعد ووثائق السياسات",help_featured_article:"مقالة مميزة",help_untitled_article:"مقالة بدون عنوان",help_unavailable:"تعذّر تحميل مركز المساعدة. تحقق من اتصالك وحاول مرة أخرى.",link_opens_new_tab:"(يُفتح في علامة تبويب جديدة)",error_search_rate_limited:"أنت تبحث بسرعة كبيرة. يرجى الانتظار قليلًا ثم المحاولة مرة أخرى.",error_search_unavailable:"البحث غير متاح حاليًا. يرجى المحاولة مرة أخرى بعد قليل.",error_send_rate_limited:"أنت ترسل الرسائل بسرعة كبيرة. يرجى الانتظار قليلًا ثم المحاولة مرة أخرى.",error_send_failed:"عذرًا، حدث خطأ ما. يرجى المحاولة مرة أخرى.",error_attachment_rejected:"لا يمكن إرفاق هذا الملف. قد يكون كبيرًا جدًا (الحد 10 ميغابايت) أو من نوع غير مسموح به.",error_attachment_upload_failed:"تعذّر رفع هذا المرفق. يرجى المحاولة مرة أخرى."};export{e as default};
@@ -0,0 +1 @@
1
+ import{g as e,t,T as a,f as r,s as n,a as o,C as s,b as l,c as i,L as c,G as d,X as p,d as u,B as m,A as g,e as h,h as f,P as y,S as x,M as b,i as v,j as k,z as w,k as E,l as _,m as N,n as z,o as I,p as S,q as C,r as A,u as q,v as T,w as j,x as M,y as $,D as L,E as R,F as D,W as O,H as U,I as P,J as F,K as V,N as Y,O as H,Q as B,R as G,_ as J,U as K,V as X,Y as W,Z as Q,$ as Z,a0 as ee,a1 as te,a2 as ae,a3 as re,a4 as ne,a5 as oe,a6 as se,a7 as le,a8 as ie,a9 as ce}from"./shared-Cp0FX5Ux.js";function de(e,t=[],a=[]){return t.length>0?t.some(t=>e.startsWith(t)):!(a.length>0)||!a.some(t=>e.startsWith(t))}const pe=[1e3,2e3,5e3,15e3,3e4,6e4];function ue(e){let t,a="message";const r=[];for(const n of e.split("\n")){if(!n||":"===n.charAt(0))continue;const e=n.indexOf(":"),o=-1===e?n:n.slice(0,e),s=-1===e?"":n.slice(e+1).replace(/^ /,"");"event"===o?a=s:"id"===o?t=s:"data"===o&&r.push(s)}if(0===r.length)return null;try{return{type:a,id:t,data:JSON.parse(r.join("\n"))}}catch{return null}}const me="askly_visitor_",ge="askly_scope_",he={};function fe(e){var t;try{const t=window.localStorage.getItem(e);if(null!==t)return t}catch{}return null!==(t=he[e])&&void 0!==t?t:null}function ye(e,t){he[e]=t;try{window.localStorage.setItem(e,t)}catch{}}function xe(e){delete he[e];try{window.localStorage.removeItem(e)}catch{}}function be(e,t){const a=me+(e||"detect"),r=fe(a);if(r)return r;if(t&&t!==e){const e=fe(me+t);if(e)return ye(a,e),e}const n=function(){try{if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();if("undefined"!=typeof crypto&&"function"==typeof crypto.getRandomValues){const e=crypto.getRandomValues(new Uint8Array(16));e[6]=15&e[6]|64,e[8]=63&e[8]|128;const t=Array.from(e,e=>e.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}}catch{}return`v-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}();return ye(a,n),n}function ve(e){const t=e||"detect",a=fe(ge+t);a&&a!==t&&ve(a),xe(me+t),xe("askly_threads_"+t);for(const e of Object.keys(he))e.includes(t)&&!e.startsWith(ge)&&delete he[e];try{const e=[];for(let a=0;a<window.localStorage.length;a++){const r=window.localStorage.key(a);r&&r.startsWith(`askly_conversations_${t}`)&&e.push(r)}e.forEach(e=>window.localStorage.removeItem(e))}catch{}}function ke(){return`chat_${Date.now()}_${Math.random().toString(36).slice(2,8)}`}let we=null;const Ee=new Set;function _e(e){we=e,Ee.forEach(t=>{try{t(e)}catch(e){console.error("[Askly] identify listener failed:",e)}})}const Ne=new Set;let ze=0;function Ie(){return ze}function Se(l){const{conversations:i,setActiveChatId:c,startNewChat:d}=l;return e.createElement("div",{className:"conversations-list-container"},e.createElement("div",{className:"conversations-scrollable"},0===i.length&&e.createElement("div",{className:"askly-empty-state"},e.createElement("div",{className:"askly-empty-icon"},e.createElement(a,{size:22})),e.createElement("div",{className:"askly-empty-title"},t("conversations_empty_title")),e.createElement("div",{className:"askly-empty-desc"},t("conversations_empty_desc"))),i.map((a,l)=>{const d=a.messages[a.messages.length-1],p=d?d.content:t("conversation_no_messages"),u=a.lastUpdated?new Date(a.lastUpdated):new Date;return e.createElement("button",{type:"button",key:a.id,className:"conversation-list-item",onClick:()=>c(a.id)},e.createElement("div",{className:"conversation-item-left"},e.createElement("div",{className:"conversation-item-details"},e.createElement("span",{className:"conversation-item-title"},t("conversation_title",{number:r(i.length-l)})),e.createElement("span",{className:"conversation-item-preview"},n(p).slice(0,50)))),e.createElement("div",{className:"conversation-item-right"},e.createElement("span",{className:"conversation-item-time"},o(u)),e.createElement(s,{size:14,className:"askly-flip-rtl"})))})),e.createElement("button",{type:"button",className:"start-new-chat-btn",onClick:()=>d()},t("start_new_chat")))}function Ce(a){const{open:n,setOpen:o,buttonIcon:s,buttonShape:d,buttonStyle:p,dir:u,lang:m,launcherUnread:g,resolvedTheme:h,setActiveChatId:f,setActiveTab:y,unreadChatId:x,launcherRef:b}=a,v=n?t("launcher_close"):g>0?l("launcher_open_unread",g):t("launcher_open");return e.createElement("button",{ref:b,type:"button",className:`askly-chat-button shape-${d} ${n?"open":""}`,"data-askly-theme":h,dir:u,lang:m,style:p,onClick:()=>{!n&&x&&(y("messages"),f(x)),o(!n)},"aria-expanded":n,"aria-controls":"askly-panel","aria-label":v,title:v},n?e.createElement(i,{size:24}):"💬"===s?e.createElement(c,{size:32}):s,!n&&g>0&&e.createElement("span",{className:"askly-launcher-badge",role:"status","aria-label":l("new_messages",g)},g>9?t("launcher_unread_overflow",{count:r(9)}):r(g)))}function Ae(a){const{accentVars:r,aiAnswering:n,aiAvatarUrl:o,dir:s,dismissGreeting:l,faqs:i,greetingText:c,lang:u,openFromGreeting:m,organizationLogo:g,position:h,resolvedTheme:f}=a;return e.createElement("div",{className:`askly-greeting askly-greeting-${h}`,"data-askly-theme":f,dir:s,lang:u,style:r,role:"status"},e.createElement("div",{className:"askly-greeting-card"},e.createElement("button",{type:"button",className:"askly-greeting-body",onClick:()=>m()},(n&&o||g)&&e.createElement("img",{src:n&&o||g,alt:"",className:"askly-greeting-avatar"}),e.createElement("span",{className:"askly-greeting-text"},c)),e.createElement("button",{type:"button",className:"askly-greeting-close",onClick:l,"aria-label":t("greeting_dismiss"),title:t("greeting_dismiss")},e.createElement(p,{size:14}))),i.length>0&&e.createElement("div",{className:"askly-greeting-chips"},i.slice(0,d).map((t,a)=>e.createElement("button",{type:"button",key:a,className:"quick-reply-chip askly-greeting-chip",onClick:()=>m(t.question)},t.question))))}function qe(n){const{allArticles:o,articlesLoading:l,expandedFaqIndex:c,faqs:d,handleSearchChange:p,handleSelectArticle:g,organizationLogo:h,organizationName:f,searchError:y,searchLoading:x,searchQuery:b,searchResults:v,setActiveTab:k,setExpandedFaqIndex:w,setInput:E}=n;return e.createElement("div",{className:"chat-body home-layout"},e.createElement("div",{className:"home-hero"},e.createElement("div",{className:"home-hero-brand"},e.createElement("img",{src:h||"https://askly.co.in/logo-small.png",alt:f,className:"home-hero-logo"})),e.createElement("div",{className:"home-hero-title"},t("explore_hero_title")),e.createElement("div",{className:"home-hero-subtitle"},t("explore_hero_subtitle"))),e.createElement("div",{className:"home-content"},e.createElement("div",{className:"explore-search"},e.createElement(u,{size:16,className:"explore-search-icon"}),e.createElement("input",{type:"text",value:b,onChange:p,placeholder:t("explore_search_placeholder"),"aria-label":t("help_search_label")}),x&&e.createElement("span",{className:"search-loader"})),""!==b.trim()?e.createElement("div",{className:"explore-search-panel"},y?e.createElement("div",{className:"no-search-results"},y):0!==v.length||x?v.map(t=>e.createElement("button",{type:"button",key:t.id,className:"search-result-item",onClick:()=>{g(t),k("help")}},e.createElement(m,{size:13,style:{flexShrink:0}}),e.createElement("span",{className:"search-result-title"},t.title),e.createElement(s,{size:14,className:"askly-flip-rtl",style:{marginInlineStart:"auto",flexShrink:0}}))):e.createElement("div",{className:"no-search-results",role:"status"},t("help_search_no_results",{query:b}))):e.createElement(e.Fragment,null,e.createElement("button",{type:"button",className:"explore-cta",onClick:()=>k("messages")},e.createElement("span",{className:"explore-cta-orbs","aria-hidden":"true"}),e.createElement("span",{className:"explore-cta-text"},e.createElement("span",{className:"explore-cta-title"},t("explore_cta_title")),e.createElement("span",{className:"explore-cta-sub"},t("explore_cta_sub"))),e.createElement("span",{className:"explore-cta-arrow"},e.createElement(s,{size:18,className:"askly-flip-rtl"}))),e.createElement("div",{className:"explore-tiles"},e.createElement("button",{type:"button",className:"explore-tile",onClick:()=>k("help")},e.createElement("span",{className:"explore-tile-icon"},e.createElement(m,{size:18})),e.createElement("span",{className:"explore-tile-title"},t("explore_tile_help_title")),e.createElement("span",{className:"explore-tile-sub"},t("explore_tile_help_sub"))),e.createElement("button",{type:"button",className:"explore-tile",onClick:()=>k("messages")},e.createElement("span",{className:"explore-tile-icon"},e.createElement(a,{size:18})),e.createElement("span",{className:"explore-tile-title"},t("explore_tile_messages_title")),e.createElement("span",{className:"explore-tile-sub"},t("explore_tile_messages_sub")))),d.length>0&&e.createElement("div",{className:"explore-section"},e.createElement("div",{className:"explore-section-head"},e.createElement("span",null,t("explore_popular_questions")),e.createElement("span",{className:"explore-section-count"},r(d.length))),e.createElement("div",{className:"explore-faq-list"},d.map((a,r)=>{const n=c===r,o=`askly-faq-answer-${r}`;return e.createElement("div",{key:r,className:"explore-faq "+(n?"open":"")},e.createElement("button",{type:"button",className:"explore-faq-q","aria-expanded":n,"aria-controls":o,onClick:()=>w(n?null:r)},e.createElement("span",null,a.question),e.createElement(i,{size:15,className:"explore-faq-chevron"})),n&&e.createElement("div",{className:"explore-faq-a",id:o},e.createElement("div",null,a.answer),e.createElement("button",{type:"button",className:"faq-ask-link",onClick:()=>{E(a.question),k("messages")}},e.createElement("span",null,t("explore_ask_ai_about_this")),e.createElement(s,{size:12,className:"askly-flip-rtl"}))))}))),(l||o.length>0)&&e.createElement("div",{className:"explore-section"},e.createElement("div",{className:"explore-section-head"},e.createElement("span",null,t("explore_recommended_reading"))),e.createElement("div",{className:"recommended-articles-list"},l?[0,1,2].map(t=>e.createElement("div",{key:t,className:"rec-article-skeleton"},e.createElement("span",{className:"askly-skeleton askly-skeleton-chip"}),e.createElement("span",{className:"askly-skeleton askly-skeleton-line"}))):o.slice(0,3).map(t=>e.createElement("button",{type:"button",key:t.id,className:"rec-article-row",onClick:()=>{g(t),k("help")}},e.createElement(m,{size:13,className:"rec-article-icon"}),e.createElement("span",{className:"rec-article-title"},t.title),e.createElement(s,{size:14,className:"rec-article-chevron askly-flip-rtl"}))))))))}const Te=["explore","messages","help"];function je(r){const{activeTab:n,setActiveTab:o,setSelectedArticle:s}=r,l=g(null),i=e=>{o(e),"explore"===e&&s(null)},c=(t,a,r)=>{const o=n===t;return e.createElement("button",{type:"button",role:"tab",id:`askly-tab-${t}`,"aria-selected":o,"aria-controls":`askly-tabpanel-${t}`,tabIndex:o?0:-1,className:"nav-tab-btn "+(o?"active":""),onClick:()=>i(t)},e.createElement("span",{className:"nav-tab-icon"},r),e.createElement("span",null,a))};return e.createElement("div",{className:"chat-nav-tabs",role:"tablist","aria-label":t("tabs_label"),ref:l,onKeyDown:e=>{var t;const a=Te.indexOf(n),r="rtl"===f()?"ArrowLeft":"ArrowRight",o="ArrowRight"===r?"ArrowLeft":"ArrowRight";let s;switch(e.key){case r:s=(a+1)%Te.length;break;case o:s=(a-1+Te.length)%Te.length;break;case"Home":s=0;break;case"End":s=Te.length-1;break;default:return}e.preventDefault();const c=Te[s];i(c);const d=null===(t=l.current)||void 0===t?void 0:t.querySelector(`#askly-tab-${c}`);null==d||d.focus()}},c("explore",t("tab_explore"),e.createElement(u,{active:"explore"===n})),c("messages",t("tab_messages"),e.createElement(a,{active:"messages"===n})),c("help",t("tab_help"),e.createElement(h,{active:"help"===n})))}const Me=w(()=>import("./VoiceRecorder-rdqySW9p.js").then(e=>({default:e.VoiceRecorder})).catch(()=>({default:$e})));function $e({onCancel:t}){return e.useEffect(()=>{t()},[]),null}const Le=["😀","😃","😄","😁","😆","😅","😂","🤣","😊","😇","🙂","🙃","😉","😌","😍","🥰","😘","😗","😙","😚","😋","😛","😝","😜","🤪","🤠","🥳","😎","🤓","🧐","👍","👎","👌","✌️","🤞","🤟","🤘","🤙","👋","👏"];function Re(a){const{cancelVoiceInput:r,fileInputRef:n,handleEmojiClick:o,handleFileChange:s,handleFileUploadClick:l,input:i,inputRef:c,isTyping:d,leadRequired:p,placeholderText:u,sendMessage:m,setInput:g,setShowEmojiPicker:h,showEmojiPicker:f,startVoiceInput:w,stopVoiceInput:E,turnstileBlocked:_,uploadingFile:N,voiceInputEnabled:z,voiceMaxMs:I,voiceMeterRef:S,voicePhase:C}=a,A="idle"!==C,q=d||N||p||_||A;return e.createElement("div",{className:"chat-footer "+(A?"voice-active":"")},A&&e.createElement(k,{fallback:e.createElement("div",{className:"askly-voice"})},e.createElement(Me,{phase:C,meterRef:S,maxMs:I,onStop:E,onCancel:r})),e.createElement("div",{className:"composer-input-row",style:A?{display:"none"}:void 0},e.createElement("textarea",{ref:c,rows:1,value:i,onChange:e=>g(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||e.nativeEvent.isComposing||229===e.nativeEvent.keyCode||(e.preventDefault(),m())},"aria-label":t("composer_label"),"aria-describedby":"askly-composer-hint",placeholder:p?t("composer_placeholder_lead_required"):_?t("composer_placeholder_security_check"):u,disabled:q}),e.createElement("span",{id:"askly-composer-hint",className:"askly-sr-only"},t("composer_hint"))),e.createElement("input",{type:"file",ref:n,style:{display:"none"},onChange:s}),e.createElement("div",{className:"composer-actions-row",style:A?{display:"none"}:void 0},e.createElement("div",{className:"composer-actions-left"},e.createElement("button",{type:"button",className:"footer-action-btn",onClick:l,disabled:q,"aria-label":t("attach_file"),title:t("attach_file")},e.createElement(y,{size:18})),e.createElement("button",{type:"button",className:"footer-action-btn "+(f?"active":""),onClick:()=>h(!f),disabled:q,"aria-label":t("insert_emoji"),title:t("insert_emoji"),"aria-haspopup":"dialog","aria-expanded":f,"aria-controls":"askly-emoji-picker"},e.createElement(x,{size:18})),z&&e.createElement("button",{type:"button",className:"voice-btn "+("recording"===C?"listening":""),onClick:"recording"===C?E:w,title:t("recording"===C?"voice_finish":"voice_start"),"aria-label":t("recording"===C?"voice_finish":"voice_start"),"aria-pressed":"recording"===C,disabled:"recording"!==C&&q},e.createElement(b,{size:18}))),e.createElement("button",{type:"button",onClick:()=>m(),disabled:q||!i.trim(),className:"send-btn","aria-label":t("send_message"),title:t("send_message")},e.createElement(v,{size:18}))),f&&e.createElement("div",{id:"askly-emoji-picker",className:"askly-emoji-picker",role:"dialog","aria-label":t("emoji_picker_label"),onKeyDown:e=>{"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),h(!1))}},Le.map(t=>e.createElement("button",{type:"button",key:t,onClick:()=>o(t),className:"emoji-item","aria-label":t},t))))}function De(a){const{activeChatId:r,activeTab:n,aiAnswering:o,aiAvatarUrl:s,aiName:l,headerStyle:i,isExpanded:c,organizationLogo:d,organizationName:p,setActiveChatId:u,setIsExpanded:m,setOpen:g}=a,h=t(c?"header_collapse":"header_expand"),f=e.createElement("div",{style:{display:"flex",gap:8,alignItems:"center"}},e.createElement("button",{type:"button",className:"header-action-btn",onClick:()=>m(!c),"aria-label":h,"aria-pressed":c,title:h},c?e.createElement(_,{size:16}):e.createElement(N,{size:16})),e.createElement("button",{type:"button",className:"header-action-btn",onClick:()=>g(!1),"aria-label":t("header_close"),title:t("header_close")},e.createElement(E,{size:18})));if("explore"===n)return e.createElement("div",{className:"chat-header chat-header-floating"},e.createElement("div",{className:"header-content"}),f);if("messages"===n&&null!==r)return e.createElement("div",{className:"chat-header",style:i},e.createElement("div",{className:"header-content"},e.createElement("button",{type:"button",className:"header-back-arrow-btn",onClick:()=>u(null),"aria-label":t("header_back_to_conversations"),title:t("header_back_to_conversations")},e.createElement(z,{size:20,className:"askly-flip-rtl"})),(()=>{const t=o&&s||d,a=o&&l||p;return e.createElement(e.Fragment,null,e.createElement("img",{src:t||"https://askly.co.in/logo-small.png",alt:a,className:"header-avatar "+(t?"":"is-default-logo")}),o&&l&&e.createElement("div",{className:"header-title"},l))})()),f);const y=t("help"===n?"header_help_center":"header_messages");return e.createElement("div",{className:"chat-header",style:i},e.createElement("div",{className:"header-content"},e.createElement("div",{className:"header-title header-title-lg"},y)),f)}function Oe(e){var t;return"markdown"===(null!==(t=e.format)&&void 0!==t?t:"agent"===e.role?"markdown":"text")?T(e.content):j(e.content)}const Ue=e.memo(function(a){const{copiedMsgIndex:r,messages:n,msgReactions:s,setCopiedMsgIndex:l,setMsgReactions:i,showTimestamp:c}=a;return e.createElement(e.Fragment,null,n.map((a,d)=>{const p="agent"===a.role;p&&(0===d||n[d-1].role);const u=s[d],m=r===d;return e.createElement("div",{key:d,className:`msg-wrapper ${a.role}`},e.createElement("div",{className:"msg-column"},e.createElement("div",{className:`msg ${a.role}`},e.createElement("span",{className:"askly-sr-only"},t(p?"message_from_agent":"message_from_you"),": "),e.createElement("div",{className:"msg-content",dangerouslySetInnerHTML:{__html:I(Oe(a))}}),c&&a.timestamp&&e.createElement("div",{className:"msg-time"},o(a.timestamp))),p&&a.content&&e.createElement("div",{className:"msg-reactions"},e.createElement("button",{type:"button",className:"msg-reaction-btn "+("up"===u?"active":""),"aria-label":t("reaction_helpful"),title:t("reaction_helpful"),"aria-pressed":"up"===u,onClick:()=>i(e=>({...e,[d]:"up"===e[d]?void 0:"up"}))},e.createElement(S,{size:13})),e.createElement("button",{type:"button",className:"msg-reaction-btn "+("down"===u?"active":""),"aria-label":t("reaction_not_helpful"),title:t("reaction_not_helpful"),"aria-pressed":"down"===u,onClick:()=>i(e=>({...e,[d]:"down"===e[d]?void 0:"down"}))},e.createElement(C,{size:13})),e.createElement("button",{type:"button",className:"msg-reaction-btn","aria-label":t(m?"copied":"copy_message"),title:t(m?"copied":"copy_message"),onClick:()=>{var e;try{null===(e=navigator.clipboard)||void 0===e||e.writeText(a.content)}catch(e){}l(d),setTimeout(()=>l(e=>e===d?null:e),1500)}},m?e.createElement(A,{size:13}):e.createElement(q,{size:13})))))}))});function Pe(t,a,r){const n=`{${a}}`,o=t.indexOf(n);return-1===o?e.createElement(e.Fragment,null,t," ",r):e.createElement(e.Fragment,null,t.slice(0,o),r,t.slice(o+n.length))}function Fe({showPoweredBy:a=!0}){const r=e.createElement("a",{href:"https://askly.co.in/terms",target:"_blank",rel:"noopener noreferrer",className:"askly-terms-link"},t("terms_link")),n=e.createElement("a",{href:"https://askly.co.in",target:"_blank",rel:"noopener noreferrer",className:"askly-powered-link"},"Askly");return e.createElement("div",{className:"chat-terms-notice"},e.createElement("span",null,Pe(t("terms_notice"),"terms",r)),a&&e.createElement("span",{className:"chat-terms-divider","aria-hidden":"true"},"·"),a&&e.createElement("span",null,Pe(t("powered_by"),"brand",n)))}const Ve=w(()=>import("./HelpTab-BrWJK4wa.js").then(e=>({default:e.HelpTab})).catch(()=>({default:Ye})));function Ye(){return e.createElement("div",{className:"askly-lead-error askly-composer-notice",role:"alert"},t("help_unavailable"))}const He=({orgId:a,organizationName:n="Askly",themeColor:o="#0f172a",theme:s="auto",position:c="right",offset:d,hideLauncher:p=!1,customLauncherSelector:u,orgServerRoute:m,enableVoiceChat:h,voiceInput:y,welcomeMessage:x,placeholderText:b,locale:v,organizationLogo:w,buttonIcon:E="💬",buttonShape:_="round",autoOpen:N=!1,greeting:z,showTimestamp:I=!1,soundEnabled:S=!1,soundVolume:C=.4,poweredBy:A="Team Askly",userId:q,timestamp:T,signature:j,turnstileSiteKey:re,excludePaths:ne=[],includePaths:oe=[],configOverride:se,resetGeneration:le,greetingStartedAt:ie,onMessageSent:ce,onMessageReceived:me,onChatOpened:he,onChatClosed:xe,onEscalation:_e})=>{var ze,Te,Me;const[$e,Le]=M("undefined"!=typeof window?window.location.pathname:""),[Oe,Pe]=M(n),[Ye,He]=M(w),[Be,Ge]=M(o),[Je,Ke]=M(s),[Xe,We]=M(_),[Qe,Ze]=M("off"),[et,tt]=M(!0),[at,rt]=M(X(y)||(!1===h?"off":void 0)),[nt,ot]=M(null),[st,lt]=M(null),it="object"==typeof z&&null!==z?z:null,[ct,dt]=M(!0),[pt,ut]=M(null),[mt,gt]=M(ae),[ht,ft]=M(!1),[yt,xt]=M(!0),[bt,vt]=M("smart"),[kt,wt]=M(null),[Et,_t]=M(!1),[Nt,zt]=M(!1),[It,St]=M(!1),[Ct,At]=M(!("undefined"==typeof window||!window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches);$(()=>{if("undefined"==typeof window||!window.matchMedia)return;const e=window.matchMedia("(prefers-color-scheme: dark)"),t=e=>At(e.matches);return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]);const qt="auto"===Je?Ct?"dark":"light":Je,[Tt,jt]=M(x),[Mt,$t]=M(a),[Lt,Rt]=M(null),[Dt,Ot]=M(null),[Ut,Pt]=M(0);$(()=>L(()=>Pt(e=>e+1)),[]);const Ft=R(Lt||Dt||v||("undefined"!=typeof navigator?navigator.language:void 0));$(()=>{D(Ft)},[Ft]);const Vt=f(),Yt=ee(),Ht=Tt||t("welcome_default"),Bt=kt||t("lead_prompt"),Gt=e=>{if(!e||"object"!=typeof e)return e;const t={...e};return delete t.__fromServer,t},Jt=e=>{if(!e)return;var r,n;e.orgId&&($t(e.orgId),r=a||"detect",(n=e.orgId)&&n!==r&&fe(ge+r)!==n&&ye(ge+r,n),sn.current=!0),e.organizationName&&Pe(e.organizationName),e.logoUrl&&He(e.logoUrl),e.themeColor&&Ge(e.themeColor),"light"!==e.theme&&"dark"!==e.theme&&"auto"!==e.theme||Ke(e.theme),"round"!==e.buttonShape&&"square"!==e.buttonShape||We(e.buttonShape);const o=X(e.voiceInput);if(o&&Ze(o),"boolean"==typeof e.showPoweredBy&&e.__fromServer&&tt(e.showPoweredBy),void 0!==e.ai_name&&ot(e.ai_name||null),void 0!==e.ai_avatar_url&&lt(e.ai_avatar_url||null),void 0!==e.greetingEnabled&&dt(!!e.greetingEnabled),void 0!==e.greetingMessage&&ut("string"==typeof e.greetingMessage&&e.greetingMessage.trim()?e.greetingMessage:null),"number"==typeof e.greetingDelayMs&&e.greetingDelayMs>=0&&gt(e.greetingDelayMs),void 0!==e.ai_answering&&xt(e.ai_answering),e.leadCapture&&vt(e.leadCapture),e.leadCapturePrompt&&wt(e.leadCapturePrompt),e.welcomeMessage&&jt(e.welcomeMessage),void 0!==e.locale&&Ot("string"==typeof e.locale&&e.locale.trim()?e.locale.trim():null),e.faqs&&Array.isArray(e.faqs)&&aa(e.faqs),e.featured_articles&&Array.isArray(e.featured_articles)){const a=e.featured_articles.map((e,a)=>({id:e.id||`featured_${a}`,title:e.title||t("help_featured_article"),content:e.content||"",document_type:e.document_type||"guide",score:1}));sa(a)}};$(()=>{const e=`askly_config_${a||"detect"}`;let t=null;try{t="undefined"!=typeof window?window.sessionStorage:null}catch{t=null}if(t)try{const a=t.getItem(e);a&&(Jt({...JSON.parse(a),__fromServer:!0}),ft(!0))}catch{}se&&Jt(Gt(se));(async()=>{try{const r=m.replace(/\/messages\/widget$/,"")+"/messages/widget/config",n=a?`?org_id=${a}`:"",o=await fetch(`${r}${n}`);if(o.ok){const a=await o.json();if(Jt({...a,__fromServer:!0}),t)try{t.setItem(e,JSON.stringify(a))}catch{}se&&Jt(Gt(se)),Jt(Gt(yo.current)),ft(!0)}}catch(e){console.warn("[Askly] Failed to load remote widget config, using local properties:",e)}finally{ho(!0)}})()},[a,m,n,o,h,x,se]),$(()=>{if("undefined"==typeof window)return;const e=()=>{Le(window.location.pathname)},t=window.history.pushState,a=window.history.replaceState;let r=!0;const n=function(...a){t.apply(this,a),r&&e()},o=function(...t){a.apply(this,t),r&&e()};return window.history.pushState=n,window.history.replaceState=o,window.addEventListener("popstate",e),()=>{r=!1,window.removeEventListener("popstate",e),window.history.pushState===n&&(window.history.pushState=t),window.history.replaceState===o&&(window.history.replaceState=a)}},[]);const[Kt,Xt]=M(N),[Wt,Qt]=M("messages");$(()=>{const e=()=>Xt(!0),t=()=>Xt(!1),a=()=>Xt(e=>!e);return window.addEventListener("askly:open",e),window.addEventListener("askly:close",t),window.addEventListener("askly:toggle",a),()=>{window.removeEventListener("askly:open",e),window.removeEventListener("askly:close",t),window.removeEventListener("askly:toggle",a)}},[]);const[Zt,ea]=M(!1),[ta,aa]=M([]),[ra,na]=M(null),[oa,sa]=M([]),[la,ia]=M("all"),[ca,da]=M({}),[pa,ua]=M(null),ma=de($e,oe,ne),[ga,ha]=M(0),fa=Mt||"detect",ya=g(void 0),xa=g(!1),ba=e.useMemo(()=>{if("undefined"==typeof window)return"";xa.current&&ya.current&&ya.current!==fa&&(xa.current=!1,ve(fa));const e=be(fa,ya.current);return ya.current=fa,e},[fa,ga]),va=g(ba);va.current=ba;const[ka,wa]=M(!1),Ea=g(Mt);Ea.current=Mt;const _a=g(m);_a.current=m;const Na=e=>_a.current.replace(/\/messages\/widget$/,"")+"/messages/widget"+e,za=g(null);za.current||(za.current=new O({api:Na,getOrganizationId:()=>Ea.current,getVisitorId:()=>va.current,onChange:()=>wa(!!za.current&&za.current.human)}));const Ia=za.current;$(()=>()=>Ia.clear(),[ba]);const[Sa,Ca]=M(null),[Aa,qa]=M(!0),Ta=Aa?q:void 0,ja=Aa?j:void 0,Ma=Aa?T:void 0,$a=(null==Sa?void 0:Sa.userId)||Ta,La=`askly_conversations_${fa}_${$a||ba||"guest"}`,[Ra,Da]=M(()=>"undefined"!=typeof window?U(La):[]),Oa=g(Ra);Oa.current=Ra;const Ua=g(fa),Pa=g($a||ba);$(()=>{if("undefined"==typeof window)return;const e=U(La),t=$a||ba,a=Ua.current!==fa,r=Pa.current===t;Ua.current=fa,Pa.current=t,a&&r&&0===e.length&&Oa.current.length>0||Da(e)},[La]);const[Fa,Va]=M(null),Ya=g(Fa);Ya.current=Fa;const[Ha,Ba]=M([]),[Ga,Ja]=M(""),[Ka,Xa]=M([]),Wa=Ka.includes(Fa||"primary"),[Qa,Za]=M(null),er="off"===Qe||"off"===at?"off":at||Qe,[tr,ar]=M("idle"),[rr,nr]=M(null),[or,sr]=M(!1),lr=g({level:0,elapsedMs:0}),ir=g(null),cr=g(null),dr=g(null),pr=g(0),ur=g(!1),mr=g(()=>{}),[gr,hr]=M(!1),[fr,yr]=M(null),[xr,br]=M(0),[vr,kr]=M(!1),wr=g(!1),Er=g(null),_r=!(!(null==Sa?void 0:Sa.hash)&&!ja||vr),Nr=!!re&&!_r&&!ka,zr=Nr&&!fr,[Ir,Sr]=M(""),[Cr,Ar]=M([]),[qr,Tr]=M(!1),[jr,Mr]=M(null),[$r,Lr]=M(null),[Rr,Dr]=M([]),[Or,Ur]=M(!0),[Pr,Fr]=M({}),[Vr,Yr]=M(null),Hr=g(null);$(()=>{(async()=>{if(Mt){Ur(!0);try{const e=m.replace(/\/messages\/widget$/,"")+"/knowledge/widget/list",a=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organization_id:Mt,limit:20})});if(a.ok){const e=await a.json(),r=(e.results||e.documents||[]).map(e=>({id:e.id||e._id,title:e.title||e.filename||t("help_untitled_article"),content:e.content||"",document_type:e.document_type||"guide",score:e.score||0}));Dr(r)}}catch(e){console.error("Failed to load article catalog:",e)}finally{Ur(!1)}}})()},[Mt,m]);const[Br,Gr]=M(!1),[Jr,Kr]=M(!1),Xr=g(null),Wr=g(!0),Qr=g(!1),Zr=g(0),[en,tn]=M(0),an=g(null),rn=g(null),nn=g(null),on=g(fa);on.current=fa;const sn=g(!1),ln=g(0),cn=ln.current;$(()=>{"undefined"!=typeof window&&cn===ln.current&&P(La,Ra)},[Ra,La]),$(()=>{const e=()=>{ln.current+=1,mr.current(),Ia.clear(),wr.current=!1,kr(!1),Nn.current=new Set,An([]),sr(!1),ur.current=!1,ve(on.current),sn.current||(xa.current=!0),va.current=be(on.current),Ca(null),qa(!1),Da([]),Va(null),Ba([]),Ja(""),Xa([]),_t(!1),zt(!1),St(!1),Kn(""),Zn(null),Sr(""),Ar([]),Lr(null),Fr({}),Yr(null),Za(null),ha(e=>e+1)},t=(a=e,Ne.add(a),()=>{Ne.delete(a)});var a;return void 0!==le&&Ie()!==le&&e(),()=>{t(),ln.current+=1,mr.current()}},[]);const[dn,pn]=M(null);$(()=>{if(Fa){const e=Ra.find(e=>e.id===Fa);Ba(e?e.messages:[])}else Ba([]);pn(Fa)},[Fa]),$(()=>{Fa&&Ha.length>0&&Da(e=>{const t=e.find(e=>e.id===Fa);return t&&JSON.stringify(t.messages)===JSON.stringify(Ha)?e:t?e.map(e=>e.id===Fa?{...e,messages:Ha,lastUpdated:(new Date).toISOString()}:e):Ha.some(e=>"user"===e.role)?[{id:Fa,messages:Ha,lastUpdated:(new Date).toISOString()},...e]:e})},[Ha,Fa]),$(()=>{var e;if(Mt&&ba)return e=async e=>{if(Ca(e),!e.hash)return void console.warn("[Askly] identify() called without `hash`. The user will not be linked server-side. Generate the HMAC on your backend — see the Askly docs.");e.timestamp||console.warn("[Askly] identify() called with `hash` but no `timestamp`. The server recomputes the HMAC from the timestamp it was signed with, so verification will fail without it."),Ia.userId&&Ia.userId!==e.userId&&Ia.clear(),wr.current=!1,kr(!1);let t=()=>{};const a=new Promise(e=>{t=e});Er.current=a;try{const t=va.current,a=Ia.token,r=await fetch(Na("/identify"),{method:"POST",headers:{"Content-Type":"application/json",...a?{Authorization:`Bearer ${a}`}:{}},body:JSON.stringify({organization_id:Mt,visitor_id:t,user_id:e.userId,timestamp:e.timestamp||Math.floor(Date.now()/1e3),signature:e.hash,email:e.email,name:e.name,phone:e.phone,attributes:e.attributes||{}})});r.ok?t===va.current&&(B("identify:success",{userId:e.userId}),Ia.apply(await r.json().catch(()=>null))):(console.error(`[Askly] identify() was rejected by the server (HTTP ${r.status}). The user is not linked to their Askly profile, and messages are sent as an anonymous visitor.`),400!==r.status&&403!==r.status||(wr.current=!0,kr(!0)),B("identify:error",{userId:e.userId,status:r.status}))}catch(t){console.error("[Askly] identify() request failed:",t),B("identify:error",{userId:e.userId})}finally{t(),Er.current===a&&(Er.current=null)}},Ee.add(e),we&&e(we),()=>{Ee.delete(e)}},[Mt,ba,m]);const un=()=>{const e=ke(),t={id:e,messages:Ht?[{role:"agent",content:Ht,timestamp:new Date,format:"markdown"}]:[],lastUpdated:(new Date).toISOString()};return Da(e=>[t,...e]),Va(e),e},mn=F(null!==(ze=null==it?void 0:it.message)&&void 0!==ze?ze:pt,yt?nt:null,Oe),gn=null!==(Te=null==it?void 0:it.delayMs)&&void 0!==Te?Te:mt,hn=!1!==z&&(!0===z||ct)&&!N&&!p,fn=a||"detect",yn=Ra.some(e=>e.messages.some(e=>"user"===e.role)),[xn,bn]=M(!1),[vn,kn]=M("undefined"==typeof document||!document.hidden),wn=Ra.reduce((e,t)=>e+(t.unread||0),0),En=null===(Me=Ra.filter(e=>(e.unread||0)>0).sort((e,t)=>e.lastUpdated<t.lastUpdated?1:-1)[0])||void 0===Me?void 0:Me.id,_n=g(Wt);_n.current=Wt;const Nn=g(new Set);$(()=>{Kt&&"messages"===Wt&&Fa&&Ra.some(e=>e.id===Fa&&(e.unread||0)>0)&&Da(e=>e.map(e=>e.id===Fa?{...e,unread:0}:e))},[Kt,Wt,Fa,Ra]);const[zn,In]=M(!1),Sn=g(!1);$(()=>{if(!hn||!ht||Kt||!ma||Sn.current)return;if(yn)return;if("undefined"==typeof window||V(fn))return;const e=ie?Date.now()-ie:0,t=setTimeout(()=>{Sn.current=!0,In(!0),Y("shown")},Math.max(0,gn-e));return()=>clearTimeout(t)},[hn,ht,Kt,ma,gn,fn,yn]),$(()=>{Kt&&(Sn.current=!0,zn&&In(!1),hn&&"undefined"!=typeof window&&H(fn))},[Kt]);const[Cn,An]=M([]),[qn,Tn]=M(0),jn=g(null),Mn=g(0);$(()=>{qn!==Mn.current&&Kt&&nn.current&&(Mn.current=qn,nn.current.focus())},[qn,Kt,Wt,Fa,Ha.length]),$(()=>{"messages"!==Wt||0!==Ra.length||Fa||un()},[Wt,Ra.length,Fa]),$(()=>{const e=e=>1===e.length&&"agent"===e[0].role&&!e[0].messageId&&"greeting"!==e[0].kind&&e[0].content!==Ht;Da(t=>t.some(t=>e(t.messages))?t.map(t=>e(t.messages)?{...t,messages:[{...t.messages[0],content:Ht}]}:t):t),Ba(t=>e(t)?[{...t[0],content:Ht}]:t)},[Ht]);const $n=(e,t)=>{e!==Ya.current?Da(a=>a.map(a=>a.id===e?{...a,messages:[...a.messages,t],lastUpdated:(new Date).toISOString()}:a)):Ba(e=>[...e,t])},Ln=g(Ha);$(()=>{Ln.current=Ha},[Ha]);const Rn=g({chatId:null,ids:new Set});$(()=>{if(!(Kt&&ma&&"messages"===Wt&&Fa&&Mt&&ba))return;let e=!1;const t=e=>`${Na("/conversation")}?org_id=${encodeURIComponent(Mt)}`+(e?"":`&visitor_id=${encodeURIComponent(ba)}`)+`&thread_key=${encodeURIComponent(Fa)}`,a=async()=>{if("undefined"==typeof document||!document.hidden)try{const a=await Ia.fetch(t);if(!a.ok)return;const r=await a.json();if(e)return;void 0!==r.contact_known&&_t(r.contact_known);const n=(r.messages||[]).filter(e=>"human"===e.role&&e.message_id),o=Rn.current;o.chatId!==Fa&&(o.chatId=Fa,o.ids=new Set);const s=new Set(Ln.current.map(e=>e.messageId).filter(Boolean));o.ids.forEach(e=>s.add(e)),Nn.current.forEach(e=>s.add(e));const l=n.filter(e=>!s.has(e.message_id)).map(e=>({role:"agent",content:e.content,timestamp:e.timestamp?new Date(e.timestamp):new Date,messageId:e.message_id,format:"markdown"===e.format?"markdown":"text"}));if(!e&&l.length>0){const e=l.filter(e=>!Nn.current.has(e.messageId));l.forEach(e=>{o.ids.add(e.messageId),Nn.current.add(e.messageId)}),e.length>0&&(Ba(t=>{const a=new Set(t.map(e=>e.messageId).filter(Boolean)),r=e.filter(e=>!a.has(e.messageId));return r.length?[...t,...r]:t}),Vn("received"),e.forEach(e=>{null==me||me(e.content),B("message:received",{text:e.content,conversationId:Fa,from:"agent",messageId:e.messageId})}))}}catch{}},r=setInterval(a,xn?3e4:4e3);a();const n=()=>{document.hidden||a()};return document.addEventListener("visibilitychange",n),()=>{e=!0,clearInterval(r),document.removeEventListener("visibilitychange",n)}},[Kt,ma,Wt,Fa,Mt,m,ba,xn]),$(()=>{if("undefined"==typeof document)return;let e;const t=()=>{clearTimeout(e),document.hidden?e=setTimeout(()=>kn(!1),15e3):kn(!0)};return document.addEventListener("visibilitychange",t),()=>{clearTimeout(e),document.removeEventListener("visibilitychange",t)}},[]),$(()=>{if(!(Mt&&ba&&ma&&vn&&yn))return;if("undefined"==typeof fetch||"undefined"==typeof AbortController||"undefined"==typeof TextDecoder)return;const e=e=>e&&"human"===e.role&&e.message_id?{role:"agent",content:e.content,timestamp:e.timestamp?new Date(e.timestamp):new Date,messageId:e.message_id,format:"markdown"===e.format?"markdown":"text"}:null,t=(e,t)=>{var a;const r=t.messageId;if(Nn.current.has(r))return;Nn.current.add(r);const n=e===Ya.current;if((n?Ln.current:(null===(a=Oa.current.find(t=>t.id===e))||void 0===a?void 0:a.messages)||[]).some(e=>e.messageId===r))return;const o=Hn.current&&n&&"messages"===_n.current;n&&Ba(e=>e.some(e=>e.messageId===r)?e:[...e,t]),Da(a=>{const s=a.find(t=>t.id===e),l=(new Date).toISOString();return s?a.map(a=>{if(a.id!==e)return a;const s=n||a.messages.some(e=>e.messageId===r)?a.messages:[...a.messages,t];return{...a,messages:s,lastUpdated:l,unread:o?a.unread:(a.unread||0)+1}}):n?a:[{id:e,messages:[t],lastUpdated:l,unread:1},...a]}),Vn("received"),null==me||me(t.content),B("message:received",{text:t.content,conversationId:e,from:"agent",messageId:r})};let a=!1;const r=function(e){let t=!1,a=null,r=null;const n=e=>new Promise(t=>{const a=setTimeout(t,e);r=()=>{clearTimeout(a),t()}});return(async()=>{let r=0;for(;!t;){let o,s=0,l=!1;a=new AbortController;const i=()=>{clearTimeout(o),o=setTimeout(()=>a&&a.abort(),45e3)};try{const r=await e.connect(a.signal);if(t)return;if(!r||404===r.status||405===r.status)return void e.onDown("unsupported");if(!r.ok)throw new Error(`stream HTTP ${r.status}`);if(!r.body||"function"!=typeof r.body.getReader)return void e.onDown("unsupported");const n=r.body.getReader(),o=new TextDecoder;let c="";for(i();;){const{value:a,done:r}=await n.read();if(r)break;i(),c+=o.decode(a,{stream:!0}).replace(/\r\n/g,"\n");let d=c.indexOf("\n\n");for(;-1!==d;){const a=ue(c.slice(0,d));c=c.slice(d+2),d=c.indexOf("\n\n"),a&&!t&&("ready"===a.type?(s=Date.now(),e.onLive()):"reconnect"===a.type?l=!0:e.onEvent(a))}if(l)break}}catch{}finally{clearTimeout(o);try{a.abort()}catch{}}if(t)return;e.onDown("down");const c=s>0&&Date.now()-s>=3e4;c?r=0:r+=1;const d=c&&l?500:pe[Math.min(r,pe.length-1)];await n(d/2+Math.random()*(d/2))}})(),{close:()=>{if(t=!0,a)try{a.abort()}catch{}r&&r()},kick:()=>{if(!t){if(a)try{a.abort()}catch{}r&&r()}}}}({connect:async e=>{var t;if(!Ia.supported)return null;if(!(null!==(t=Ia.token)&&void 0!==t?t:await Ia.start())){if(!Ia.supported)return null;throw new Error("no session yet")}const{res:a,token:r}=await Ia.request(`${Na("/events")}?org_id=${encodeURIComponent(Mt)}`,{headers:{Accept:"text/event-stream"},signal:e});if(!r)throw new Error("session lost");return a},onEvent:a=>{if("message"!==a.type||!a.data||"string"!=typeof a.data.thread_key)return;const r=e(a.data.message);r&&t(a.data.thread_key,r)},onLive:()=>{bn(!0),(async()=>{const r=Oa.current.filter(e=>e.messages.some(e=>"user"===e.role)).slice(0,5);for(const n of r){if(a)return;try{const r=await Ia.fetch(e=>`${Na("/conversation")}?org_id=${encodeURIComponent(Mt)}`+(e?"":`&visitor_id=${encodeURIComponent(ba)}`)+`&thread_key=${encodeURIComponent(n.id)}`);if(!r.ok||a)continue;const o=await r.json();for(const r of o.messages||[]){const o=e(r);o&&!a&&t(n.id,o)}}catch{}}})()},onDown:()=>bn(!1)});let n=!0;const o=setInterval(async()=>{if(n&&Ia.token)try{const e=await Ia.fetch(`${Na("/presence")}?org_id=${encodeURIComponent(Mt)}`,{method:"POST"});404!==e.status&&405!==e.status||(n=!1)}catch{}},45e3),s=()=>r.kick();return window.addEventListener("online",s),()=>{a=!0,clearInterval(o),window.removeEventListener("online",s),r.close(),bn(!1)}},[Mt,ba,ma,vn,yn,m]),$(()=>{if(Kt&&Nr&&"undefined"!=typeof window&&!document.getElementById("cloudflare-turnstile-script")){const e=document.createElement("script");e.id="cloudflare-turnstile-script",e.src=G("https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit"),e.async=!0,e.defer=!0,document.head.appendChild(e)}},[Kt,Nr]);const Dn=Kt&&ma&&"messages"===Wt&&null!==Fa;$(()=>{if(!Nr||!Dn||"undefined"==typeof window)return;let e,t=!1;const a=()=>{if(t)return;const r=window.turnstile,n=document.getElementById("askly-turnstile-container");if(r&&n)try{an.current=r.render(n,{sitekey:re,callback:e=>{yr(e),Za(null)},"expired-callback":()=>{yr(null)},"error-callback":()=>{yr(null)}})}catch(e){console.error("[Askly] Turnstile render error:",e)}else e=setTimeout(a,300)};return e=setTimeout(a,150),()=>{t=!0,clearTimeout(e);const a=an.current;if(an.current=null,a&&window.turnstile)try{window.turnstile.remove(a)}catch{}yr(null)}},[Nr,Dn,Fa,re]),$(()=>{if(0===xr)return;const e=an.current;if(e&&window.turnstile)try{window.turnstile.reset(e)}catch(e){console.error("[Askly] Turnstile reset error:",e)}},[xr]);const On=g(null),Un=()=>{if("undefined"==typeof window)return null;if(!On.current){const e=window.AudioContext||window.webkitAudioContext;if(!e)return null;try{On.current=new e}catch{return null}}return On.current},Pn=()=>{const e=Un();e&&"suspended"===e.state&&e.resume().catch(()=>{})},Fn={sent:[{freq:392,start:0,duration:.08}],received:[{freq:587.33,start:0,duration:.09},{freq:783.99,start:.09,duration:.14}],error:[{freq:311.13,start:0,duration:.14,type:"sawtooth"},{freq:233.08,start:.12,duration:.18,type:"sawtooth"}],escalation:[{freq:880,start:0,duration:.12},{freq:1174.66,start:.11,duration:.2,type:"triangle"}]},Vn=e=>{if(!S)return;const t=Un();if(!t)return;"suspended"===t.state&&t.resume().catch(()=>{});const a=Fn[e]||Fn.received,r=t.currentTime,n=.35*Math.max(0,Math.min(1,C));for(const e of a){const a=t.createOscillator(),o=t.createGain();a.type=e.type||"sine",a.frequency.value=e.freq;const s=r+e.start;o.gain.setValueAtTime(1e-4,s),o.gain.exponentialRampToValueAtTime(n,s+.012),o.gain.exponentialRampToValueAtTime(1e-4,s+e.duration),a.connect(o).connect(t.destination),a.start(s),a.stop(s+e.duration+.03)}},Yn=g(!1);$(()=>{Yn.current?Kt&&ma?(Pn(),null==he||he(),B("open")):(mr.current(),null==xe||xe(),B("close")):Yn.current=!0},[Kt&&ma]);const Hn=g(Kt);Hn.current=Kt;$(()=>()=>{Hr.current&&clearTimeout(Hr.current)},[]);const Bn=e=>{const a=e.target.value;if(Sr(a),Hr.current&&clearTimeout(Hr.current),!a.trim())return Ar([]),Mr(null),void Tr(!1);Tr(!0),Hr.current=setTimeout(()=>(async e=>{if(!e.trim())return Ar([]),void Mr(null);Tr(!0),Mr(null);try{const a=m.replace(/\/messages\/widget$/,"")+"/knowledge/widget/search",r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organization_id:Mt||"",query:e,top_k:5})});if(r.ok){const e=await r.json();Ar(e.results||[])}else Ar([]),Mr(429===r.status?t("error_search_rate_limited"):t("error_search_unavailable"))}catch(e){console.error("RAG search failed:",e),Ar([]),Mr(t("error_search_unavailable"))}finally{Tr(!1)}})(a),350)},Gn=e=>{Lr(e)},[Jn,Kn]=M(""),[Xn,Wn]=M(!1),[Qn,Zn]=M(null),eo=!Et&&("always"===bt?0===Ha.filter(e=>"user"===e.role).length:"smart"===bt&&(Nt||!yt));$(()=>{var e;eo&&(null===(e=jn.current)||void 0===e||e.focus())},[eo]);const to=Ha[Ha.length-1],ao="smart"===bt&&!Et&&!eo&&!It&&!Wa&&Ha.some(e=>"user"===e.role)&&"agent"===(null==to?void 0:to.role),ro=(e="smooth")=>{const t=Xr.current;if(!t)return;const a="undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":e;"function"==typeof t.scrollTo?t.scrollTo({top:t.scrollHeight,behavior:a}):t.scrollTop=t.scrollHeight,Wr.current=!0,tn(0)};J(()=>{if(Zr.current=0,Wr.current=!0,tn(0),null===Fa)return;Qr.current=!0;const e=Xr.current;e&&(e.scrollTop=e.scrollHeight)},[Fa]),$(()=>{var e;if(!Xr.current||null===Fa)return;const t=Ha.length-Zr.current;Zr.current=Ha.length;const a=t>0&&"user"===(null===(e=Ha[Ha.length-1])||void 0===e?void 0:e.role);Wr.current||a?(ro(Qr.current?"auto":"smooth"),Qr.current=!1):t>0&&tn(e=>e+t)},[Ha,Wa,Jr,eo,Fa]),$(()=>{const e=Xr.current;if(!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>{Wr.current&&(e.scrollTop=e.scrollHeight)});return t.observe(e),()=>t.disconnect()},[Fa]);J(()=>{const e=nn.current;e&&(e.style.height="auto",e.style.height=`${Math.min(e.scrollHeight,120)}px`,e.style.overflowY=e.scrollHeight>120?"auto":"hidden")},[Ga,Fa]);const no=async()=>{const e=Jn.trim();if(e&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)){if(Mt&&ba){Wn(!0),Zn(null);try{if(!(await Ia.fetch(Na("/contact-details"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organization_id:Mt,visitor_id:ba,email:e,timestamp:Math.floor(Date.now()/1e3)})})).ok)throw new Error("Could not save that address.");_t(!0),B("lead:captured"),Kn("")}catch{Zn(t("lead_error_save_failed"))}finally{Wn(!1)}}}else Zn(t("lead_error_invalid_email"))},oo=async(e,a)=>{const r=("string"==typeof e?e:Ga).trim();if(!r)return;if(eo)return;if(zr)return void Za(t("notice_security_check_required"));const n=Fa,o=n||"primary",s=ln.current,l=an.current,i=(null==Sa?void 0:Sa.timestamp)||Ma||Math.floor(Date.now()/1e3),c=!(!a||!a.voice)||"string"!=typeof e&&ur.current;ur.current=!1;const d={role:"user",content:r,timestamp:new Date,format:"text"};Ba(e=>[...e,d]),Ja(""),Za(null),cr.current=null,nr(null),Xa(e=>e.includes(o)?e:[...e,o]),Pn(),Vn("sent"),null==ce||ce(r),B("message:sent",{text:r,conversationId:o});try{Er.current&&await Er.current,Ia.token||await Ia.start();const e={organization_id:Mt||"",visitor_id:va.current,thread_key:o,message:r,timestamp:i,context:{url:"undefined"!=typeof window?window.location.href:void 0,title:"undefined"!=typeof document?document.title:void 0,referrer:"undefined"!=typeof document&&document.referrer||void 0,locale:"undefined"!=typeof navigator?navigator.language:void 0,screen:"undefined"!=typeof window&&window.screen?`${window.screen.width}x${window.screen.height}`:void 0}};c&&(e.metadata={input_mode:"voice"}),$a&&(e.user_id=$a);const t=(null==Sa?void 0:Sa.hash)||ja,a=!!Ia.userId&&Ia.userId===$a;!t||a||wr.current?e.timestamp=Math.floor(Date.now()/1e3):e.signature=t,fr&&(e.turnstile_token=fr);const{res:l,token:d}=await Ia.request(m,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!l.ok){const e=await l.json().catch(()=>({})),t=new Error(e.detail||`HTTP ${l.status}`);throw t.status=l.status,t}const p=await l.json();if(s!==ln.current)return;if(Ia.token&&Ia.token!==d||Ia.apply(p),p.reply){const e={role:"agent",content:p.reply,timestamp:new Date,format:"text"===p.format?"text":"markdown"};$n(n,e)}void 0!==p.contact_known&&_t(p.contact_known),p.escalated||p.should_escalate?(zt(!0),Vn("escalation"),null==_e||_e(p),B("escalated",{conversationId:o})):p.reply&&Vn("received"),p.reply&&(null==me||me(p.reply),B("message:received",{text:p.reply,conversationId:o,from:"ai",messageId:p.message_id}))}catch(e){if(s!==ln.current)return;console.error("[Askly] Message failed:",e),B("error",{message:"Message could not be sent",status:null==e?void 0:e.status}),$n(n,{role:"agent",content:429===(null==e?void 0:e.status)?t("error_send_rate_limited"):t("error_send_failed"),timestamp:new Date,format:"text"}),Vn("error"),hr(!0),setTimeout(()=>hr(!1),500)}finally{Xa(e=>e.filter(e=>e!==o)),Nr&&an.current===l&&(yr(null),br(e=>e+1))}},so=g(null);so.current={sendMessage:oo,voiceInput:er,leadRequired:eo,turnstileBlocked:zr,isTyping:Wa,uploadingFile:Jr,input:Ga};const lo=(e,t=!1)=>{const a=te(e);ar("idle"),nr(t?a:null),Za(a),B("voice:error",{code:e})},io=async e=>{const t=pr.current,a=ln.current,r=Ya.current;cr.current=e,ar("transcribing"),nr(null);const n="undefined"!=typeof AbortController?new AbortController:null;dr.current=n;const o=setTimeout(()=>null==n?void 0:n.abort(),3e4);try{Ia.token||await Ia.start();const o=new FormData;o.append("organization_id",Mt||""),o.append("file",e.blob,-1!==e.blob.type.indexOf("mp4")?"clip.mp4":"clip.webm"),o.append("duration_ms",String(Math.round(e.durationMs))),"undefined"!=typeof navigator&&navigator.language&&o.append("language",navigator.language);const s=await Ia.fetch(Na("/transcribe"),{method:"POST",body:o,signal:n?n.signal:void 0});if(t!==pr.current||a!==ln.current)return;if(!s.ok){const e=(await s.json().catch(()=>({}))).detail;return console.error("[Askly] Transcription failed:",s.status,e),void("voice_disabled"===e?lo("disabled"):429===s.status?lo("limit"):lo("failed",s.status>=500))}const l=await s.json();if(t!==pr.current||a!==ln.current)return;cr.current=null;const i="string"==typeof l.text?l.text.trim():"";if(!i)return void lo("no-speech");ar("idle"),Za(null),B("voice:transcript",{text:i,language:l.language||void 0});const c=so.current;!("auto-send"!==c.voiceInput||c.leadRequired||c.turnstileBlocked||c.isTyping||c.uploadingFile||c.input.trim()||r!==Ya.current)?c.sendMessage(i,{voice:!0}):(ur.current=!0,Ja(e=>e+(""===e||/\s$/.test(e)?"":" ")+i))}catch(e){if(t!==pr.current||a!==ln.current)return;console.error("[Askly] Transcription failed:",e),lo("network",!0)}finally{clearTimeout(o),dr.current===n&&(dr.current=null)}},co=async()=>{if("off"===er||"idle"!==tr)return;if(eo||zr||Wa||Jr)return;const e=++pr.current;cr.current=null,lr.current={level:0,elapsedMs:0},nr(null),Za(null),Gr(!1),ar("starting");try{const{startRecording:t}=await(import("./speech-8iAgRQFA.js"));if(e!==pr.current)return;const a=await t({maxMs:6e4,silenceMs:2e3,noSpeechMs:8e3,onMeter:(e,t)=>{lr.current={level:e,elapsedMs:t}},onDone:t=>{e===pr.current&&(ir.current=null,B("voice:stop",{durationMs:t.durationMs}),"ok"!==t.outcome?lo(t.outcome):t.blob.size<200?lo("no-speech"):io(t))}});if(e!==pr.current)return void a.cancel();ir.current=a,ar("recording"),B("voice:start")}catch(t){if(e!==pr.current)return;lo(t&&t.code||"failed")}},po=()=>{var e;null===(e=ir.current)||void 0===e||e.stop()},uo=()=>{var e,t;pr.current+=1,null===(e=ir.current)||void 0===e||e.cancel(),ir.current=null,null===(t=dr.current)||void 0===t||t.abort(),dr.current=null,cr.current=null,nr(null),ar("idle")};mr.current=uo;$(()=>{"idle"!==tr&&uo()},[Dn,Fa]);const mo=g(tr);$(()=>{const e=mo.current;mo.current=tr,"idle"!==e&&"idle"===tr&&Dn&&Tn(e=>e+1)},[tr]),$(()=>{""===Ga&&(ur.current=!1)},[Ga]),$(()=>{if("idle"===tr)return;if("off"===er)return void uo();const e=e=>{"Escape"===e.key&&uo()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[tr,er]),$(()=>{var e;const t=Cn[0];if(!t||!Kt||!ma||"messages"!==Wt)return;const a=null!==(e=t.chatId)&&void 0!==e?e:Fa;if(!a)return void(Ra.length>0&&Va(Ra[0].id));if(Fa!==a||dn!==a)return;const r=()=>{const e=Cn.map(e=>e.text).filter(e=>!!e);An([]),e.length&&Ja(e.join("\n")),Tn(e=>e+1)};if(!t.send)return An(e=>e.slice(1)),null!==t.text&&Ja(t.text),void Tn(e=>e+1);if(eo)return r();if(zr){const e=setTimeout(r,1e4);return()=>clearTimeout(e)}Wa||(An(e=>e.slice(1)),oo(t.text))},[Cn,Kt,ma,Wt,Fa,dn,Ra.length,eo,zr,Wa]);const[go,ho]=M(!1);$(()=>{if(or&&go)return"off"===er?(sr(!1),console.warn("[Askly] startVoiceInput() ignored: voice input is turned off."),void B("voice:error",{code:"disabled"})):void(!Dn||dn!==Fa||Cn.length>0||(sr(!1),eo||zr||Wa||Jr?console.warn("[Askly] startVoiceInput() ignored: the message box is not available yet."):co()))},[or,go,er,Dn,dn,Fa,Cn.length]);const fo=g(()=>{}),yo=g({}),[xo,bo]=M(null);fo.current=e=>{const t="close"===e.type||"update"===e.type||"setLocale"===e.type||"updateTexts"===e.type;if(ma||t)switch(e.type){case"open":Xt(!0);break;case"close":Xt(!1);break;case"toggle":Xt(e=>!e);break;case"showSpace":Qt("home"===e.space?"explore":"help"===e.space?"help":"messages"),Xt(!0);break;case"showNewMessage":case"sendMessage":{const t="sendMessage"===e.type,a="string"==typeof e.text?e.text:null;if(t&&!(a||"").trim())break;Qt("messages"),Xt(!0),An(e=>[...e,{chatId:null,text:t?a.trim():a,send:t}]);break}case"showArticle":bo(e.articleId);break;case"startVoiceInput":go&&"off"===er||(Qt("messages"),Xt(!0),An(e=>[...e,{chatId:null,text:null,send:!1}])),sr(!0);break;case"stopVoiceInput":po();break;case"update":{const t=["organizationName","logoUrl","themeColor","theme","buttonShape","welcomeMessage","ai_name","ai_avatar_url","greetingEnabled","greetingMessage","greetingDelayMs","faqs"],a={};for(const r of t)e.config&&void 0!==e.config[r]&&(a[r]=e.config[r]);const r=X(e.config&&e.config.voiceInput)||(e.config&&!1===e.config.enableVoiceChat?"off":void 0);r&&rt(r),yo.current={...yo.current,...a},Jt(Gt(a));break}case"setLocale":"string"==typeof e.locale&&e.locale.trim()?Rt(e.locale.trim()):Rt(null);break;case"updateTexts":e.texts&&"object"==typeof e.texts&&K(e.texts)}else console.warn(`[Askly] ${e.type}() ignored: the widget is hidden on this path.`)},$(()=>{if(!xo)return;const e=Rr.concat(oa).find(e=>e.id===xo);e?(bo(null),Lr(e),Qt("help"),Xt(!0)):go&&!Or&&Mt&&(bo(null),console.warn(`[Askly] showArticle(): no article with id "${xo}".`))},[xo,Rr,oa,Or,Mt]),$(()=>W(e=>fo.current(e)),[]);const vo=Kt&&ma,ko=g(null),wo=g(null),Eo=g(null),[_o,No]=M(()=>"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(max-width: 600px)").matches);$(()=>{if("undefined"==typeof window||"function"!=typeof window.matchMedia)return;const e=window.matchMedia("(max-width: 600px)"),t=()=>No(e.matches);return e.addEventListener?e.addEventListener("change",t):e.addListener(t),()=>{e.removeEventListener?e.removeEventListener("change",t):e.removeListener(t)}},[]);const zo=g(vo);$(()=>{const e=ko.current;if(vo&&!zo.current){const t=e&&e.getRootNode().activeElement||document.activeElement;Eo.current=t&&t!==document.body?t:null,setTimeout(()=>{const e=ko.current;if(!e)return;(_o?e:e.querySelector("textarea:not([disabled])")||e.querySelector("input:not([disabled])")||e.querySelector('[role="tab"][tabindex="0"]')||e.querySelector("button:not([disabled])")||e).focus({preventScroll:!0})},0)}else if(!vo&&zo.current){const e=Eo.current;Eo.current=null,setTimeout(()=>{var t;e&&e.isConnected?e.focus():null===(t=wo.current)||void 0===t||t.focus()},0)}zo.current=vo},[vo]);const Io=g(Br);Io.current=Br;const So=g(tr);So.current=tr,$(()=>{if(!vo||"undefined"==typeof document)return;const e=e=>{if("Escape"!==e.key||e.defaultPrevented)return;if(Io.current||"idle"!==So.current)return;const t=document.activeElement,a=ko.current?ko.current.getRootNode().host:null;t&&t!==document.body&&t!==document.documentElement&&t!==a||Xt(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[vo]),$(()=>{if(Wa||zr||Jr||!Dn||!ko.current)return;const e=ko.current.getRootNode().activeElement;e&&ko.current.contains(e)||Tn(e=>e+1)},[Wa,zr,Jr,Dn]);const Co=(()=>{if(!u||"undefined"==typeof document)return null;try{return document.querySelector(u),u}catch{return console.warn(`[Askly] customLauncherSelector is not a valid selector: ${u}`),null}})();$(()=>{if(!Co)return;const e=e=>{const t=e.target,a=t&&t.closest?t.closest(Co):null;a&&("A"===a.tagName&&"#"===(a.getAttribute("href")||"#").charAt(0)&&e.preventDefault(),Xt(e=>!e))};return document.addEventListener("click",e),()=>document.removeEventListener("click",e)},[Co]),$(()=>{if(!Co)return;const e=()=>{document.querySelectorAll(Co).forEach(e=>{e.setAttribute("aria-expanded",vo?"true":"false"),e.setAttribute("aria-haspopup","dialog")})};e();let t=null;const a="undefined"!=typeof MutationObserver?new MutationObserver(()=>{t||(t=requestAnimationFrame(()=>{t=null,e()}))}):null;return null==a||a.observe(document.body,{childList:!0,subtree:!0}),()=>{null==a||a.disconnect(),t&&cancelAnimationFrame(t)}},[Co,vo]),$(()=>{if(!vo||!_o||"undefined"==typeof document||!document.body)return;const e=document.body,t={overflow:e.style.overflow,position:e.style.position,top:e.style.top,left:e.style.left,right:e.style.right,width:e.style.width},a=window.scrollY;e.style.overflow="hidden",e.style.position="fixed",e.style.top=`-${a}px`,e.style.left="0",e.style.right="0",e.style.width="100%";const r=window.visualViewport,n=()=>{const e=ko.current;e&&r&&(e.style.setProperty("--askly-vv-height",`${Math.round(r.height)}px`),e.style.setProperty("--askly-vv-top",`${Math.round(r.offsetTop)}px`),Wr.current&&ro("auto"))};return r&&(r.addEventListener("resize",n),r.addEventListener("scroll",n),n()),()=>{Object.assign(e.style,t),window.scrollTo(0,a),r&&(r.removeEventListener("resize",n),r.removeEventListener("scroll",n));const o=ko.current;o&&(o.style.removeProperty("--askly-vv-height"),o.style.removeProperty("--askly-vv-top"))}},[vo,_o]),$(()=>{Q.open=vo},[vo]),$(()=>{Q.visitorId=ba},[ba]),$(()=>{Q.unread!==wn&&(Q.unread=wn,B("unread",{count:wn}))},[wn]),$(()=>{go&&!Q.ready&&(Q.ready=!0,B("ready",{visitorId:va.current}))},[go]),$(()=>()=>{Q.open&&B("close"),Q.unread>0&&B("unread",{count:0}),Z()},[]);const Ao="#0f172a"===Be||"#6366f1"===Be||"#2563eb"===Be,qo={...Ao?{}:{"--askly-accent":`var(--askly-brand, ${Be})`}};if(!Ao){const e=/^#([0-9a-f]{6})$/i.exec(Be.trim());if(e){const[t,a,r]=[0,2,4].map(t=>{const a=parseInt(e[1].slice(t,t+2),16)/255;return a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4)}),n=.2126*t+.7152*a+.0722*r;qo["--askly-accent-contrast"]=n>.4?"#0f172a":"#ffffff"}}d&&"number"==typeof d.bottom&&(qo["--askly-offset-bottom"]=`${d.bottom}px`),d&&"number"==typeof d.side&&(qo["--askly-offset-side"]=`${d.side}px`),p&&(qo["--askly-launcher-clearance"]="0px");const To={right:"right"===c?"var(--askly-offset-side, var(--askly-offset-default, 24px))":"auto",left:"left"===c?"var(--askly-offset-side, var(--askly-offset-default, 24px))":"auto"},jo={...To,...qo},Mo={...To,...qo},$o={conversations:Ra,setActiveChatId:Va,startNewChat:un},Lo={open:Kt,setOpen:Xt,buttonIcon:E,buttonShape:Xe,buttonStyle:jo,launcherUnread:wn,resolvedTheme:qt,setActiveChatId:Va,setActiveTab:Qt,unreadChatId:En,dir:Vt,lang:Yt,launcherRef:wo},Ro={accentVars:qo,aiAnswering:yt,aiAvatarUrl:st,dismissGreeting:()=>{Sn.current=!0,In(!1),H(fn),Y("dismissed")},faqs:ta,greetingText:mn,openFromGreeting:e=>{const t={role:"agent",content:mn,timestamp:new Date,format:"text",kind:"greeting"},a=Ra.find(e=>!e.messages.some(e=>"user"===e.role)),r=a?a.id:ke();Da(e=>a?e.map(e=>e.id===r?{...e,messages:[t],lastUpdated:(new Date).toISOString()}:e):[{id:r,messages:[t],lastUpdated:(new Date).toISOString()},...e]),Fa===r&&Ba([t]),Va(r),Qt("messages"),Xt(!0),e&&An(t=>[...t,{chatId:r,text:e,send:!0}]),Tn(e=>e+1),Y("clicked")},organizationLogo:Ye,position:c,resolvedTheme:qt,dir:Vt,lang:Yt},Do={allArticles:Rr,articlesLoading:Or,expandedFaqIndex:ra,faqs:ta,handleSearchChange:Bn,handleSelectArticle:Gn,organizationLogo:Ye,organizationName:Oe,searchError:jr,searchLoading:qr,searchQuery:Ir,searchResults:Cr,setActiveTab:Qt,setExpandedFaqIndex:na,setInput:Ja},Oo={allArticles:Rr,articleFeedback:ca,articlesLoading:Or,handleSearchChange:Bn,handleSelectArticle:Gn,organizationLogo:Ye,organizationName:Oe,searchError:jr,searchLoading:qr,searchQuery:Ir,searchResults:Cr,selectedArticle:$r,selectedCollection:pa,setActiveTab:Qt,setArticleFeedback:da,setInput:Ja,setSelectedArticle:Lr,setSelectedCollection:ua,themeColor:Be},Uo={activeTab:Wt,setActiveTab:Qt,setSelectedArticle:Lr},Po={cancelVoiceInput:uo,fileInputRef:rn,handleEmojiClick:e=>{var t;Ja(t=>t+e),Gr(!1),null===(t=nn.current)||void 0===t||t.focus()},handleFileChange:async e=>{var a,r;const n=null===(a=e.target.files)||void 0===a?void 0:a[0];if(n){Kr(!0);try{const e=m.replace(/\/widget$/,"")+"/widget/upload",a=new FormData;a.append("organization_id",Mt||""),a.append("file",n);const o=await Ia.fetch(e,{method:"POST",body:a});if(!o.ok){const e=await o.json().catch(()=>({})),t=new Error(e.detail||"Upload failed");throw t.status=o.status,t}const s=await o.json(),l=n.type.startsWith("image/")?`![${t("attachment_image_alt")}](${s.blob_url})`:`[${t("attachment_file_label",{name:n.name})}](${s.blob_url})`;Ja(e=>e+(e.endsWith(" ")||""===e?"":" ")+l),null===(r=nn.current)||void 0===r||r.focus(),Za(null)}catch(e){console.error("[Askly] Attachment upload failed:",e),Za(400===(null==e?void 0:e.status)?t("error_attachment_rejected"):t("error_attachment_upload_failed"))}finally{Kr(!1),e.target&&(e.target.value="")}}},handleFileUploadClick:()=>{var e;null===(e=rn.current)||void 0===e||e.click()},input:Ga,inputRef:nn,isTyping:Wa,leadRequired:eo,placeholderText:b||t("composer_placeholder"),sendMessage:oo,setInput:Ja,setShowEmojiPicker:Gr,showEmojiPicker:Br,startVoiceInput:co,stopVoiceInput:po,turnstileBlocked:zr,uploadingFile:Jr,voiceInputEnabled:"off"!==er,voiceMaxMs:6e4,voiceMeterRef:lr,voicePhase:tr},Fo={activeChatId:Fa,activeTab:Wt,aiAnswering:yt,aiAvatarUrl:st,aiName:nt,headerStyle:{},isExpanded:Zt,organizationLogo:Ye,organizationName:Oe,setActiveChatId:Va,setIsExpanded:ea,setOpen:Xt},Vo={copiedMsgIndex:Vr,messages:Ha,msgReactions:Pr,setCopiedMsgIndex:Yr,setMsgReactions:Fr,showTimestamp:I,textsVersion:Ut};return ma?e.createElement(e.Fragment,null,!p&&e.createElement(Ce,{...Lo}),zn&&!Kt&&e.createElement(Ae,{...Ro}),Kt&&e.createElement("div",{id:"askly-panel",role:"dialog","aria-label":t("panel_label",{organizationName:Oe}),"aria-modal":_o?"true":void 0,tabIndex:-1,ref:ko,onKeyDown:e=>{if("Escape"===e.key){if("idle"!==tr)return;return e.stopPropagation(),Br?void Gr(!1):void Xt(!1)}if("Tab"!==e.key||!_o||!ko.current)return;const t=Array.from(ko.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')).filter(e=>null!==e.offsetParent||e===document.activeElement);if(!t.length)return;const a=t[0],r=t[t.length-1],n=ko.current.getRootNode().activeElement;e.shiftKey&&n===a?(e.preventDefault(),r.focus()):e.shiftKey||n!==r||(e.preventDefault(),a.focus())},className:`askly-chat-modal ${Zt?"expanded":""} ${gr?"askly-shake":""}`,"data-askly-theme":qt,style:Mo,dir:Vt,lang:Yt},e.createElement(De,{...Fo}),"explore"===Wt&&e.createElement("div",{id:"askly-tabpanel-explore",role:"tabpanel","aria-labelledby":"askly-tab-explore",className:"askly-tabpanel"},e.createElement(qe,{...Do})),"messages"===Wt&&(null===Fa?e.createElement("div",{id:"askly-tabpanel-messages",role:"tabpanel","aria-labelledby":"askly-tab-messages",className:"askly-tabpanel"},e.createElement(Se,{...$o})):e.createElement("div",{className:"chat-screen"},e.createElement("div",{className:"chat-stream"},e.createElement("div",{className:"chat-body",role:"log","aria-label":t("conversation_label"),tabIndex:0,ref:Xr,onScroll:()=>{const e=Xr.current;if(!e)return;const t=e.scrollHeight-e.scrollTop-e.clientHeight<=80;Wr.current=t,t&&tn(0)},onLoadCapture:()=>{Wr.current&&ro("auto")}},e.createElement(Ue,{...Vo}),ta.length>0&&Ha.length<=1&&!Wa&&!eo&&e.createElement("div",{className:"quick-replies"},ta.slice(0,4).map((t,a)=>e.createElement("button",{key:a,className:"quick-reply-chip",onClick:()=>oo(t.question)},t.question))),ao&&e.createElement("div",{className:"askly-lead-card"},e.createElement("div",{className:"askly-lead-copy"},Bt),e.createElement("div",{className:"askly-lead-row"},e.createElement("input",{type:"email",value:Jn,onChange:e=>{Kn(e.target.value),Zn(null)},onKeyDown:e=>{"Enter"===e.key&&no()},placeholder:t("lead_email_placeholder"),disabled:Xn,"aria-label":t("lead_email_label")}),e.createElement("button",{className:"askly-lead-submit",onClick:()=>{no()},disabled:Xn||!Jn.trim()},t(Xn?"lead_saving":"lead_save"))),Qn&&e.createElement("div",{className:"askly-lead-error"},Qn),e.createElement("button",{className:"askly-lead-dismiss",onClick:()=>St(!0)},t("lead_dismiss"))),Wa&&e.createElement("div",{className:"msg-wrapper agent"},yt?e.createElement("div",{className:"typing-indicator"},e.createElement("span",null),e.createElement("span",null),e.createElement("span",null)):e.createElement("div",{className:"msg agent",style:{opacity:.75,fontStyle:"italic"}},t("sending_to_team"))),Jr&&e.createElement("div",{className:"msg-wrapper user"},e.createElement("div",{className:"msg user",style:{opacity:.7,display:"flex",alignItems:"center",gap:8}},e.createElement("span",{className:"search-loader",style:{borderColor:"#fff",borderTopColor:"transparent"}}),e.createElement("span",null,t("uploading_attachment")))),Nr&&e.createElement("div",{className:"askly-turnstile-wrapper",style:fr?{display:"none"}:void 0},e.createElement("slot",{name:"turnstile"}))),en>0&&e.createElement("button",{type:"button",className:"askly-jump-latest",onClick:()=>ro("smooth"),"aria-live":"polite"},e.createElement(i,{size:14}),l("new_messages",en),e.createElement("span",{className:"askly-jump-badge"},r(en)))),eo&&e.createElement("div",{className:"askly-lead-card askly-lead-required"},e.createElement("div",{className:"askly-lead-copy"},Bt),e.createElement("div",{className:"askly-lead-row"},e.createElement("input",{type:"email",value:Jn,onChange:e=>{Kn(e.target.value),Zn(null)},onKeyDown:e=>{"Enter"===e.key&&no()},placeholder:t("lead_email_placeholder"),disabled:Xn,ref:jn,"aria-label":t("lead_email_label")}),e.createElement("button",{className:"askly-lead-submit",onClick:()=>{no()},disabled:Xn||!Jn.trim()},t(Xn?"lead_saving":"lead_save"))),Qn&&e.createElement("div",{className:"askly-lead-error"},Qn)),Qa&&e.createElement("div",{className:"askly-lead-error askly-composer-notice",role:"alert"},Qa,null!==rr&&rr===Qa&&e.createElement("button",{type:"button",className:"askly-notice-action",onClick:()=>{const e=cr.current;e&&"idle"===tr&&(pr.current+=1,Za(null),io(e))}},t("voice_retry"))),e.createElement(Re,{...Po}),e.createElement(Fe,{showPoweredBy:et}))),"help"===Wt&&e.createElement("div",{id:"askly-tabpanel-help",role:"tabpanel","aria-labelledby":"askly-tab-help",className:"askly-tabpanel"},e.createElement(k,{fallback:null},e.createElement(Ve,{...Oo}))),!("messages"===Wt&&null!==Fa)&&e.createElement(je,{...Uo}))):null};var Be=':host{all:initial;display:block}.askly-chat-button,.askly-chat-modal,.askly-greeting{--askly-bg:#fff;--askly-surface:#fff;--askly-surface-2:#f6f7f9;--askly-surface-3:#eef0f4;--askly-header-bg:hsla(0,0%,100%,.82);--askly-header-fg:#0f172a;--askly-accent:var(--askly-brand,#2563eb);--askly-accent-contrast:#fff;--askly-border:rgba(15,23,42,.08);--askly-border-strong:#e2e5ea;--text-1:#0f172a;--text-2:#334155;--text-3:#64748b;--text-4:#64748b;--askly-online:#22c55e;--askly-danger:#ef4444;--askly-danger-bg:#fee2e2;--askly-success:#16a34a;--askly-success-bg:rgba(22,163,74,.09);--askly-link:#2563eb;--askly-scrollbar:#cbd5e1;--askly-scrollbar-hover:#94a3b8;--askly-accent-strong:color-mix(in srgb,var(--askly-accent) 92%,#000);--askly-accent-soft:color-mix(in srgb,var(--askly-accent) 12%,transparent);--askly-accent-ring:color-mix(in srgb,var(--askly-accent) 22%,transparent);--askly-elev-1:0 1px 2px rgba(15,23,42,.06),0 1px 3px rgba(15,23,42,.05);--askly-elev-2:0 4px 12px rgba(15,23,42,.08),0 2px 4px rgba(15,23,42,.04);--askly-elev-3:0 18px 48px rgba(15,23,42,.18),0 6px 16px rgba(15,23,42,.1);--askly-elev-launch:0 10px 30px rgba(15,23,42,.28),0 4px 10px rgba(15,23,42,.18);--askly-radius-sm:10px;--askly-radius-md:14px;--askly-radius-lg:20px;--askly-radius-xl:22px;--askly-ease:cubic-bezier(0.16,1,0.3,1);--askly-ease-snappy:cubic-bezier(0.4,0,0.2,1);--askly-font:var(--askly-font-family,"Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif);--askly-offset-default:24px}.askly-chat-button[data-askly-theme=dark],.askly-chat-modal[data-askly-theme=dark],.askly-greeting[data-askly-theme=dark]{--askly-bg:#0f1115;--askly-surface:#181b21;--askly-surface-2:#21252d;--askly-surface-3:#2b303a;--askly-header-bg:rgba(15,17,21,.78);--askly-header-fg:#f4f5f7;--askly-accent:var(--askly-brand,#3b82f6);--askly-accent-contrast:#fff;--askly-border:hsla(0,0%,100%,.09);--askly-border-strong:#333944;--text-1:#f3f4f6;--text-2:#d2d6dd;--text-3:#9aa2af;--text-4:#8b93a1;--askly-online:#4ade80;--askly-danger:#f87171;--askly-danger-bg:hsla(0,91%,71%,.15);--askly-success:#4ade80;--askly-success-bg:rgba(74,222,128,.12);--askly-link:#7cb0ff;--askly-scrollbar:#3a3f4a;--askly-scrollbar-hover:#4d5462;--askly-accent-strong:color-mix(in srgb,var(--askly-accent) 90%,#fff);--askly-elev-1:0 1px 2px rgba(0,0,0,.4);--askly-elev-2:0 6px 16px rgba(0,0,0,.45);--askly-elev-3:0 20px 55px rgba(0,0,0,.62),0 6px 16px rgba(0,0,0,.5);--askly-elev-launch:0 12px 34px rgba(0,0,0,.55)}.askly-chat-button{align-items:center;background:var(--askly-accent);border:none;border-radius:23%;bottom:var(--askly-offset-bottom,var(--askly-offset-default));box-shadow:var(--askly-elev-launch);color:var(--askly-accent-contrast);cursor:pointer;display:flex;font-family:var(--askly-font);font-size:28px;height:60px;justify-content:center;position:fixed;transition:transform .28s var(--askly-ease),box-shadow .28s var(--askly-ease),border-radius .28s var(--askly-ease);width:60px;z-index:99999}.askly-chat-button:hover{box-shadow:0 18px 40px rgba(15,23,42,.34),0 6px 14px rgba(15,23,42,.22);transform:translateY(-3px) scale(1.05)}.askly-chat-button:active{transform:scale(.94)}.askly-launcher-badge{background:#dc2626;border-radius:999px;box-shadow:0 0 0 2px var(--askly-bg);box-sizing:border-box;color:#fff;font-size:11px;font-weight:600;height:20px;line-height:20px;min-width:20px;padding:0 5px;position:absolute;right:-4px;text-align:center;top:-4px}.askly-chat-button.shape-square{border-radius:23%}.askly-chat-button.shape-round{border-radius:50%}.askly-chat-modal{-webkit-font-smoothing:antialiased;animation:slideUp .36s var(--askly-ease);background:var(--askly-bg);border:none;border-radius:var(--askly-radius-lg);bottom:calc(var(--askly-offset-bottom, var(--askly-offset-default)) + var(--askly-launcher-clearance, 76px));box-shadow:var(--askly-elev-3);color:var(--text-1);display:flex;flex-direction:column;font-family:var(--askly-font);height:min(704px,100vh - 120px);height:min(704px,100dvh - 120px);max-height:calc(100vh - 120px);max-height:calc(100dvh - 120px);max-width:calc(100vw - 48px);overflow:hidden;position:fixed;width:min(384px,100vw - 48px);z-index:99998}@keyframes slideUp{0%{opacity:0;transform:translateY(24px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes asklyShake{0%,to{transform:translateX(0)}20%{transform:translateX(-6px)}40%{transform:translateX(6px)}60%{transform:translateX(-4px)}80%{transform:translateX(4px)}}.askly-chat-modal.askly-shake{animation:asklyShake .45s cubic-bezier(.36,.07,.19,.97)}.chat-header{align-items:center;backdrop-filter:saturate(1.4) blur(12px);-webkit-backdrop-filter:saturate(1.4) blur(12px);background:var(--askly-header-bg);border-bottom:1px solid var(--askly-border);color:var(--askly-header-fg,inherit);display:flex;flex-shrink:0;justify-content:space-between;padding:15px 18px}.chat-header.chat-header-floating{backdrop-filter:none;-webkit-backdrop-filter:none;background:transparent;border-bottom:none!important;left:0;padding:12px 14px;pointer-events:none;position:absolute;right:0;top:0;z-index:5}.chat-header-floating .header-action-btn{color:#fff;opacity:.92;pointer-events:auto}.chat-header-floating .header-action-btn:hover{background:hsla(0,0%,100%,.22);color:#fff;opacity:1}.header-title.header-title-lg{font-size:18px;font-weight:700;letter-spacing:-.02em}.header-content{align-items:center;display:flex;gap:12px}.header-avatar{border:none;border-radius:0;box-shadow:none;max-height:32px;max-width:120px;object-fit:contain}.header-title{font-size:16px;font-weight:600;letter-spacing:-.01em}.header-status{align-items:center;display:flex;font-size:11px;gap:6px;opacity:.9}@keyframes pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.5;transform:scale(.85)}}.chat-body{background:var(--askly-bg);display:flex;flex:1;flex-direction:column;gap:10px;min-height:0;overflow-y:auto;padding:20px}.chat-body,.chat-footer textarea,.conversations-scrollable,.help-layout,.home-layout,.home-search-results{-webkit-overflow-scrolling:touch;overscroll-behavior:contain;scrollbar-color:var(--askly-scrollbar) transparent;scrollbar-width:thin}.chat-body:hover,.chat-footer textarea:hover,.conversations-scrollable:hover,.help-layout:hover,.home-layout:hover,.home-search-results:hover{scrollbar-color:var(--askly-scrollbar-hover) transparent}.chat-body::-webkit-scrollbar,.chat-footer textarea::-webkit-scrollbar,.conversations-scrollable::-webkit-scrollbar,.help-layout::-webkit-scrollbar,.home-layout::-webkit-scrollbar,.home-search-results::-webkit-scrollbar{width:8px}.chat-body::-webkit-scrollbar-track,.chat-footer textarea::-webkit-scrollbar-track,.conversations-scrollable::-webkit-scrollbar-track,.help-layout::-webkit-scrollbar-track,.home-layout::-webkit-scrollbar-track,.home-search-results::-webkit-scrollbar-track{background:transparent}.chat-body::-webkit-scrollbar-thumb,.chat-footer textarea::-webkit-scrollbar-thumb,.conversations-scrollable::-webkit-scrollbar-thumb,.help-layout::-webkit-scrollbar-thumb,.home-layout::-webkit-scrollbar-thumb,.home-search-results::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:var(--askly-scrollbar);border:2px solid transparent;border-radius:10px}.chat-body::-webkit-scrollbar-thumb:hover,.chat-footer textarea::-webkit-scrollbar-thumb:hover,.conversations-scrollable::-webkit-scrollbar-thumb:hover,.help-layout::-webkit-scrollbar-thumb:hover,.home-layout::-webkit-scrollbar-thumb:hover,.home-search-results::-webkit-scrollbar-thumb:hover{background-color:var(--askly-scrollbar-hover)}.msg-wrapper{align-items:flex-end;animation:fadeIn .32s var(--askly-ease);display:flex;gap:8px}@keyframes fadeIn{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.msg-wrapper.user{flex-direction:row-reverse}.msg-column{display:flex;flex-direction:column;gap:4px;max-width:78%;min-width:0}.msg-wrapper.user .msg-column{align-items:flex-end}.msg-avatar{align-items:center;align-self:flex-start;background:linear-gradient(145deg,var(--askly-accent),var(--askly-accent-strong));border-radius:50%;box-shadow:var(--askly-elev-1);color:var(--askly-accent-contrast);display:flex;flex-shrink:0;font-size:12px;font-weight:700;height:28px;justify-content:center;overflow:hidden;width:28px}.msg-avatar img{height:100%;object-fit:cover;width:100%}.msg-avatar.msg-avatar-hidden{visibility:hidden}.msg{word-wrap:break-word;border-radius:18px;max-width:100%;padding:10px 14px;position:relative;width:fit-content}.msg,.msg-content{overflow-wrap:anywhere}.msg-content{font-size:13.5px;line-height:1.55}.msg-content p{margin:0 0 8px}.msg-content ol,.msg-content ul{margin:4px 0 8px;padding-inline-start:20px}.msg-content li{margin-top:3px}.msg-content>:last-child{margin-bottom:0}.msg-content strong{font-weight:650}.msg-content code.inline-code{background:var(--askly-surface-3);border:1px solid var(--askly-border);border-radius:5px;padding:1px 5px}.msg-content code.inline-code,.msg-content pre{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}.msg-content pre{background:var(--askly-surface);border:1px solid var(--askly-border);border-radius:8px;box-sizing:border-box;display:block;line-height:1.5;margin:6px 0 8px;max-width:100%;overflow-x:auto;padding:8px 10px;white-space:pre}.msg-content pre code{background:none;border:0;font:inherit;padding:0}.askly-chat-modal[data-askly-theme=dark] .msg.agent .msg-content pre{background:var(--askly-surface-2)}.msg.user .msg-content code.inline-code,.msg.user .msg-content pre{background:hsla(0,0%,100%,.18);border-color:hsla(0,0%,100%,.28);color:inherit}.msg.user{background:linear-gradient(145deg,var(--askly-accent),var(--askly-accent-strong));border-end-end-radius:6px;box-shadow:var(--askly-elev-1);color:var(--askly-accent-contrast)}.msg.agent{background:var(--askly-surface-2);border:1px solid var(--askly-border);border-end-start-radius:6px;color:var(--text-1)}.askly-chat-modal[data-askly-theme=dark] .msg.agent{background:var(--askly-surface)}.msg-time{font-size:10px;margin-top:5px;opacity:.6;text-align:end}.msg.user .msg-time{color:var(--askly-accent-contrast);opacity:.9}.msg-reactions{display:flex;gap:2px;opacity:0;padding-inline-start:4px;transform:translateY(-2px);transition:opacity .18s var(--askly-ease),transform .18s var(--askly-ease)}.msg-reactions:focus-within,.msg-wrapper:hover .msg-reactions{opacity:1;transform:translateY(0)}.msg-reaction-btn{all:unset;align-items:center;border-radius:7px;color:var(--text-4);cursor:pointer;display:flex;height:24px;justify-content:center;transition:background .15s,color .15s;width:26px}.msg-reaction-btn:hover{background:var(--askly-surface-2);color:var(--text-2)}.msg-reaction-btn.active{background:var(--askly-accent-soft);color:var(--askly-accent)}.quick-replies{animation:fadeIn .32s var(--askly-ease);display:flex;flex-wrap:wrap;gap:8px;margin:4px 0 2px;margin-inline-start:36px}.quick-reply-chip{all:unset;background:var(--askly-surface);border:1px solid var(--askly-border-strong);border-radius:999px;box-sizing:border-box;color:var(--askly-accent);cursor:pointer;font-size:12.5px;font-weight:500;line-height:1.2;max-width:100%;padding:8px 14px;transition:all .16s var(--askly-ease)}.quick-reply-chip:hover{background:var(--askly-accent-soft);border-color:var(--askly-accent);transform:translateY(-1px)}.typing-indicator{align-items:center;background:var(--askly-surface-2);border:1px solid var(--askly-border);border-end-start-radius:6px;border-radius:18px;display:flex;gap:4px;padding:12px 16px;width:fit-content}.typing-indicator span{animation:bounce 1.4s ease-in-out infinite both;background:var(--text-4);border-radius:50%;height:6px;width:6px}.typing-indicator span:first-child{animation-delay:-.32s}.typing-indicator span:nth-child(2){animation-delay:-.16s}@keyframes bounce{0%,80%,to{opacity:.4;transform:scale(0)}40%{opacity:1;transform:scale(1)}}.chat-footer{background:var(--askly-surface);border:1px solid var(--askly-border-strong);border-radius:var(--askly-radius-lg);box-shadow:var(--askly-elev-1);display:flex;flex-direction:column;flex-shrink:0;gap:6px;margin:10px 16px 12px;padding:10px 12px 8px;position:relative;transition:border-color .2s var(--askly-ease),box-shadow .2s var(--askly-ease)}.chat-footer:hover{border-color:var(--text-3)}.chat-footer:focus-within{border-color:var(--askly-accent);box-shadow:0 0 0 3px var(--askly-accent-ring)}.composer-input-row{align-items:stretch;display:flex;width:100%}.chat-footer textarea{background:transparent;border:none;border-radius:0;box-sizing:border-box;color:var(--text-1);display:block;flex:1;font-family:inherit;font-size:14px;line-height:20px;margin:0;max-height:120px;min-height:32px;min-width:0;outline:none;overflow-y:hidden;padding:6px 8px;resize:none;width:100%}.chat-footer textarea::placeholder{color:var(--text-4)}.chat-footer textarea:disabled{cursor:not-allowed;opacity:.6}.chat-screen,.chat-stream{display:flex;flex:1;flex-direction:column;min-height:0}.chat-stream{position:relative}.askly-jump-latest{align-items:center;animation:fadeIn .2s var(--askly-ease);background:var(--askly-surface);border:1px solid var(--askly-border-strong);border-radius:999px;bottom:12px;box-shadow:var(--askly-elev-2);box-sizing:border-box;color:var(--text-2);cursor:pointer;display:inline-flex;font-family:inherit;font-size:12px;font-weight:600;gap:6px;left:50%;line-height:1;padding:6px 12px;position:absolute;transform:translateX(-50%);white-space:nowrap;z-index:6}.askly-jump-latest:hover{border-color:var(--text-3);color:var(--text-1)}.askly-jump-badge{align-items:center;background:var(--askly-accent);border-radius:999px;box-sizing:border-box;color:var(--askly-accent-contrast);display:inline-flex;font-size:11px;height:18px;justify-content:center;min-width:18px;padding:0 5px}.composer-actions-row{align-items:center;display:flex;justify-content:space-between;width:100%}.composer-actions-left{align-items:center;display:flex;gap:2px}.voice-btn{align-items:center;background:none;border:none;border-radius:50%;color:var(--text-4);cursor:pointer;display:flex;flex-shrink:0;height:34px;justify-content:center;transition:all .2s;width:34px}.voice-btn:hover{background:var(--askly-accent-soft);color:var(--askly-accent)}.voice-btn.listening{animation:pulseRed 1.5s ease-in-out infinite;background:var(--askly-danger-bg);color:var(--askly-danger)}@keyframes pulseRed{0%,to{box-shadow:0 0 0 0 rgba(239,68,68,.4)}50%{box-shadow:0 0 0 8px rgba(239,68,68,0)}}.chat-footer.voice-active{border-color:var(--text-3);border-radius:999px;padding:8px 10px}.askly-voice{align-items:center;display:flex;gap:10px;height:44px}.askly-voice-meter{align-items:center;display:flex;flex:1;gap:3px;height:26px;justify-content:flex-end;min-width:0;overflow:hidden}.askly-voice-meter i{background:var(--text-1);border-radius:1px;display:block;flex-shrink:0;min-height:2px;width:2px}.askly-voice.transcribing .askly-voice-meter{opacity:.4}.askly-voice-status{clip:rect(0 0 0 0);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}.askly-voice-time{color:var(--text-3);flex-shrink:0;font-size:12px;font-variant-numeric:tabular-nums}.askly-voice-btn{align-items:center;background:none;border:none;border-radius:50%;color:var(--text-1);cursor:pointer;display:flex;flex-shrink:0;height:40px;justify-content:center;padding:0;width:40px}.askly-voice-btn.done,.askly-voice-btn:hover{background:var(--askly-accent-soft)}.askly-voice-btn.done{box-shadow:inset 0 0 0 2px var(--askly-border-strong)}.askly-voice-btn.done:hover{box-shadow:inset 0 0 0 2px var(--text-3)}.askly-voice-btn.busy{cursor:default}.askly-voice-stop{background:var(--text-1);border-radius:3px;height:13px;width:13px}.askly-voice-spinner{animation:asklyVoiceSpin .8s linear infinite;border:2px solid var(--askly-border-strong);border-radius:50%;border-top-color:var(--text-1);height:16px;width:16px}@keyframes asklyVoiceSpin{to{transform:rotate(1turn)}}.askly-notice-action{align-items:center;background:none;border:none;color:inherit;cursor:pointer;display:inline-flex;font:inherit;font-weight:600;margin-inline-start:8px;min-height:24px;padding:0;text-decoration:underline}@media (prefers-reduced-motion:reduce){.askly-voice-spinner{animation-duration:2.4s}}.send-btn{align-items:center;background:linear-gradient(145deg,var(--askly-accent),var(--askly-accent-strong));border:none;border-radius:50%;box-shadow:var(--askly-elev-1);color:var(--askly-accent-contrast);cursor:pointer;display:flex;flex-shrink:0;height:36px;justify-content:center;transition:all .2s var(--askly-ease);width:36px}.send-btn:hover:not(:disabled){filter:brightness(1.06);transform:scale(1.08)}.send-btn:active:not(:disabled){transform:scale(.94)}.send-btn:disabled{box-shadow:none;cursor:not-allowed;opacity:.45}.footer-action-btn{align-items:center;background:none;border:none;border-radius:50%;color:var(--text-4);cursor:pointer;display:flex;flex-shrink:0;height:34px;justify-content:center;transition:all .2s;width:34px}.footer-action-btn.active,.footer-action-btn:hover{background:var(--askly-surface-2);color:var(--text-1)}.chat-powered-by{background:var(--askly-bg);border-top:1px solid var(--askly-border);color:var(--text-4);font-size:11px;padding:8px 16px;text-align:center}.chat-powered-by strong{color:var(--text-2);font-weight:600}.chat-terms-notice{align-items:center;background:var(--askly-bg);border-top:1px solid var(--askly-border);color:var(--text-4);display:flex;flex-shrink:0;font-size:10px;gap:4px;justify-content:center;padding:5px 10px;text-align:center;white-space:nowrap}.chat-terms-divider{color:var(--text-4);opacity:.5}.askly-powered-link,.askly-terms-link{color:var(--text-3);font-weight:600;text-decoration:none;transition:color .15s var(--askly-ease)}.askly-powered-link:hover,.askly-terms-link:hover{color:var(--askly-accent);text-decoration:underline}.askly-turnstile-wrapper{background:var(--askly-bg);border-bottom:1px solid var(--askly-border);border-top:1px solid var(--askly-border);display:flex;justify-content:center;margin:10px 0;padding:12px 16px}.askly-lead-card{background:var(--askly-surface-2);border:1px solid var(--askly-border-strong);border-radius:14px;display:flex;flex-direction:column;gap:8px;margin:10px 0;padding:12px 14px}.askly-lead-required{background:var(--askly-bg);border-bottom:none;border-left:none;border-radius:0;border-right:none;flex-shrink:0;margin:0}.askly-lead-copy{color:var(--text-2);font-size:12.5px;line-height:1.5}.askly-lead-row{align-items:center;display:flex;gap:8px}.askly-lead-row input{background:var(--askly-bg);border:1.5px solid var(--askly-border-strong);border-radius:999px;box-sizing:border-box;color:var(--text-1);flex:1;font-family:inherit;font-size:13px;height:38px;min-width:0;outline:none;padding:0 12px;transition:all .2s var(--askly-ease)}.askly-lead-row input::placeholder{color:var(--text-4)}.askly-lead-row input:focus{background:var(--askly-surface);border-color:var(--askly-accent);box-shadow:0 0 0 3px var(--askly-accent-ring)}.askly-lead-row input:disabled{cursor:not-allowed;opacity:.6}.askly-lead-submit{all:unset;background:var(--askly-accent);border-radius:999px;color:var(--askly-accent-contrast);cursor:pointer;flex-shrink:0;font-size:12.5px;font-weight:600;height:38px;padding:0 16px;text-align:center;transition:all .2s var(--askly-ease)}.askly-lead-submit:hover:not(:disabled){background:var(--askly-accent-strong)}.askly-lead-submit:disabled{cursor:not-allowed;opacity:.5}.askly-lead-error{color:#dc2626;font-size:11.5px;line-height:1.45}.askly-lead-dismiss{all:unset;align-items:center;align-self:flex-start;color:var(--text-4);cursor:pointer;display:inline-flex;font-size:11.5px;min-height:24px;text-decoration:underline}.askly-lead-dismiss:hover{color:var(--text-2)}@media (min-width:601px){.askly-chat-modal.expanded{max-width:calc(100vw - 48px);width:min(700px,100vw - 48px)}}.home-layout{background:var(--askly-bg);gap:0;overflow-y:auto;padding:0}.home-hero,.home-layout{display:flex;flex-direction:column}.home-hero{background:radial-gradient(120% 90% at 15% 0,color-mix(in srgb,var(--askly-accent) 94%,#fff) 0,transparent 55%),linear-gradient(150deg,var(--askly-accent),var(--askly-accent-strong));color:var(--askly-accent-contrast);flex-shrink:0;gap:4px;overflow:hidden;padding:34px 24px 28px;position:relative}.home-hero:before{inset:0;mask-image:linear-gradient(180deg,#000 40%,transparent);-webkit-mask-image:linear-gradient(180deg,#000 40%,transparent)}.home-hero:after,.home-hero:before{content:"";pointer-events:none;position:absolute}.home-hero:after{background:linear-gradient(120deg,hsla(0,0%,100%,.18),transparent 60%);height:160%;inset-inline-end:-20%;top:-40%;transform:rotate(18deg);width:70%}[dir=rtl] .home-hero:after{transform:rotate(-18deg)}.home-hero>*{position:relative;z-index:1}.home-hero-brand{align-items:center;display:flex;gap:9px;margin-bottom:18px}.home-hero-logo{max-height:34px;max-width:124px;object-fit:contain;object-position:left center;opacity:.96}[dir=rtl] .home-hero-logo{object-position:right center}.home-hero-title{font-size:23px;font-weight:700;letter-spacing:-.02em;line-height:1.2}.home-hero-wave{animation:wave 2.4s ease-in-out infinite;display:inline-block;transform-origin:70% 70%}@keyframes wave{0%,60%,to{transform:rotate(0deg)}10%{transform:rotate(14deg)}20%{transform:rotate(-8deg)}30%{transform:rotate(14deg)}40%{transform:rotate(-4deg)}50%{transform:rotate(10deg)}}.home-hero-subtitle{font-size:23px;font-weight:700;letter-spacing:-.02em;line-height:1.2;opacity:.72}.home-content{display:flex;flex-direction:column;flex-shrink:0;gap:12px;margin-top:0;padding:16px 16px 20px;position:relative;z-index:2}.home-action-card{all:unset;align-items:center;background:var(--askly-surface);border:1px solid var(--askly-border);border-radius:var(--askly-radius-md);box-shadow:var(--askly-elev-2);box-sizing:border-box;cursor:pointer;display:flex;gap:12px;justify-content:space-between;padding:16px 18px;transition:transform .2s var(--askly-ease),box-shadow .2s var(--askly-ease),border-color .2s var(--askly-ease)}.home-action-card:hover{border-color:var(--askly-border-strong);box-shadow:var(--askly-elev-3);transform:translateY(-2px)}.card-title{color:var(--text-1);font-size:14.5px;font-weight:600;margin-bottom:2px}.card-desc{color:var(--text-3);font-size:12px;line-height:1.4}.card-icon-chip{align-items:center;background:var(--askly-accent-soft);border-radius:12px;color:var(--askly-accent);display:flex;flex-shrink:0;height:40px;justify-content:center;width:40px}.faq-card{align-items:stretch;cursor:default;flex-direction:column;gap:10px}.faq-card:hover{border-color:var(--askly-border);box-shadow:var(--askly-elev-2);transform:none}.faq-card-head{align-items:center;display:flex;justify-content:space-between}.faq-count-badge{background:var(--askly-accent-soft);border-radius:999px;color:var(--askly-accent);font-size:10px;font-weight:600;padding:3px 8px}.faq-list{display:flex;flex-direction:column;gap:6px}.faq-item{background:var(--askly-surface-2);border:1px solid var(--askly-border);border-radius:var(--askly-radius-sm);overflow:hidden;transition:border-color .2s var(--askly-ease),background .2s var(--askly-ease)}.faq-item.open{background:var(--askly-surface);border-color:var(--askly-accent)}.faq-question{all:unset;align-items:center;box-sizing:border-box;color:var(--text-1);cursor:pointer;display:flex;font-size:12.5px;font-weight:500;gap:8px;justify-content:space-between;padding:10px 12px;text-align:start;width:100%}.faq-chevron{color:var(--text-3);flex-shrink:0;transition:transform .22s var(--askly-ease)}.faq-item.open .faq-chevron{color:var(--askly-accent);transform:rotate(180deg)}.faq-answer{border-top:1px solid var(--askly-border);color:var(--text-2);font-size:12px;line-height:1.55;padding:8px 12px 12px}.faq-ask-ai,.faq-ask-link{all:unset;align-items:center;color:var(--askly-accent);cursor:pointer;display:inline-flex;font-size:11.5px;font-weight:600;gap:4px;margin-top:10px;min-height:24px}.faq-ask-ai:hover,.faq-ask-link:hover{text-decoration:underline}.home-search-card{background:var(--askly-surface);border:1px solid var(--askly-border);border-radius:var(--askly-radius-md);box-shadow:var(--askly-elev-2);padding:16px 18px}.home-search-input-wrapper{align-items:center;display:flex;position:relative;width:100%}.home-search-input-wrapper input{background:var(--askly-bg);border:1.5px solid var(--askly-border-strong);border-radius:999px;box-sizing:border-box;color:var(--text-1);font-size:13px;height:40px;outline:none;padding:0;padding-inline:36px 12px;transition:all .2s var(--askly-ease);width:100%}.home-search-input-wrapper input::placeholder{color:var(--text-4)}.home-search-input-wrapper input:focus{background:var(--askly-surface);border-color:var(--askly-accent);box-shadow:0 0 0 3px var(--askly-accent-ring)}.search-icon-svg{color:var(--text-4);inset-inline-start:13px;pointer-events:none;position:absolute}.search-loader{animation:spin .6s linear infinite;border:2px solid var(--askly-border-strong);border-radius:50%;border-top-color:var(--askly-accent);height:14px;inset-inline-end:12px;position:absolute;width:14px}@keyframes spin{to{transform:rotate(1turn)}}.home-search-results{border-top:1px solid var(--askly-border);display:flex;flex-direction:column;gap:4px;margin-top:10px;max-height:200px;overflow-y:auto;padding-top:10px}.search-result-item{all:unset;align-items:center;border-radius:var(--askly-radius-sm);box-sizing:border-box;color:var(--text-2);cursor:pointer;display:flex;font-size:13px;gap:8px;padding:9px 10px;text-align:start;transition:background .15s,color .15s;width:100%}.search-result-item:hover{background:var(--askly-surface-2);color:var(--text-1)}.search-result-title{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.no-search-results{color:var(--text-4);font-size:12.5px;padding:14px;text-align:center}.recommended-articles{border-top:1px solid var(--askly-border);margin-top:12px;padding-top:12px}.recommended-articles-head{color:var(--text-3);font-size:10.5px;font-weight:700;letter-spacing:.6px;margin-bottom:8px;text-transform:uppercase}.recommended-articles-list{display:flex;flex-direction:column;gap:6px}.rec-article-row{all:unset;align-items:center;background:var(--askly-surface-2);border:1px solid var(--askly-border);border-radius:var(--askly-radius-sm);box-sizing:border-box;cursor:pointer;display:flex;gap:8px;padding:9px 11px;transition:all .16s var(--askly-ease)}.rec-article-row:hover{background:var(--askly-accent-soft);border-color:var(--askly-accent)}.rec-article-icon{color:var(--text-3);flex-shrink:0}.rec-article-row:hover .rec-article-icon{color:var(--askly-accent)}.rec-article-title{color:var(--text-1);flex:1;font-size:12px;font-weight:500;overflow:hidden;text-align:start;text-overflow:ellipsis;white-space:nowrap}.rec-article-chevron{color:var(--text-4);flex-shrink:0}.rec-article-skeleton{background:var(--askly-surface-2);border-radius:var(--askly-radius-sm);gap:8px;padding:9px 11px}.explore-search,.rec-article-skeleton{align-items:center;border:1px solid var(--askly-border);display:flex}.explore-search{background:var(--askly-surface);border-radius:999px;box-shadow:var(--askly-elev-2);box-sizing:border-box;height:46px;padding:0 14px;position:relative;transition:border-color .2s var(--askly-ease),box-shadow .2s var(--askly-ease);width:100%}.explore-search:focus-within{border-color:var(--askly-accent);box-shadow:0 0 0 3px var(--askly-accent-ring),var(--askly-elev-2)}.explore-search-icon{color:var(--text-4);flex-shrink:0}.explore-search input{background:transparent;border:none;color:var(--text-1);flex:1;font-family:inherit;font-size:13.5px;min-width:0;outline:none;padding:0 10px}.explore-search input::placeholder{color:var(--text-4)}.explore-search .search-loader{margin-inline-start:auto;position:static}.explore-search-panel{background:var(--askly-surface);border:1px solid var(--askly-border);border-radius:var(--askly-radius-md);box-shadow:var(--askly-elev-1);display:flex;flex-direction:column;gap:4px;padding:6px}.explore-cta{all:unset;align-items:center;background:linear-gradient(135deg,var(--askly-accent),var(--askly-accent-strong));border-radius:var(--askly-radius-md);box-shadow:var(--askly-elev-2);box-sizing:border-box;color:var(--askly-accent-contrast);cursor:pointer;display:flex;gap:13px;overflow:hidden;padding:16px;position:relative;transition:transform .2s var(--askly-ease),box-shadow .2s var(--askly-ease)}.explore-cta:hover{box-shadow:var(--askly-elev-3);transform:translateY(-2px)}.explore-cta:active{transform:scale(.99)}.explore-cta-orbs{background:radial-gradient(60px 60px at 88% -10%,hsla(0,0%,100%,.28),transparent 70%),radial-gradient(80px 80px at 108% 120%,hsla(0,0%,100%,.16),transparent 70%);inset:0;pointer-events:none;position:absolute}.explore-cta-icon{align-items:center;backdrop-filter:blur(4px);background:hsla(0,0%,100%,.18);border-radius:13px;display:flex;flex-shrink:0;height:42px;justify-content:center;position:relative;width:42px}.explore-cta-icon svg{animation:askly-twinkle 3.2s var(--askly-ease) infinite}@keyframes askly-twinkle{0%,to{opacity:1;transform:scale(1) rotate(0deg)}50%{opacity:.75;transform:scale(1.12) rotate(8deg)}}.explore-cta-text{display:flex;flex-direction:column;gap:2px;min-width:0;position:relative}.explore-cta-title{font-size:15px;font-weight:700;letter-spacing:-.01em}.explore-cta-sub{color:var(--askly-accent-contrast);font-size:11.5px;line-height:1.35;opacity:.9}.explore-cta-arrow{align-items:center;display:flex;margin-inline-start:auto;opacity:.85;position:relative;transition:transform .2s var(--askly-ease)}.explore-cta:hover .explore-cta-arrow{opacity:1;transform:translateX(3px)}[dir=rtl] .explore-cta:hover .explore-cta-arrow{transform:translateX(-3px)}.explore-tiles{display:grid;gap:10px;grid-template-columns:1fr 1fr}.explore-tile{all:unset;background:var(--askly-surface);border:1px solid var(--askly-border);border-radius:var(--askly-radius-md);box-shadow:var(--askly-elev-1);box-sizing:border-box;cursor:pointer;display:flex;flex-direction:column;gap:3px;padding:14px;transition:transform .18s var(--askly-ease),box-shadow .18s var(--askly-ease),border-color .18s var(--askly-ease)}.explore-tile:hover{border-color:var(--askly-border-strong);box-shadow:var(--askly-elev-2);transform:translateY(-2px)}.explore-tile-icon{align-items:center;background:var(--askly-accent-soft);border-radius:11px;color:var(--askly-accent);display:flex;height:36px;justify-content:center;margin-bottom:5px;width:36px}.explore-tile-title{color:var(--text-1);font-size:13.5px;font-weight:600}.explore-tile-sub{color:var(--text-3);font-size:11px}.explore-section{display:flex;flex-direction:column;gap:8px}.explore-section-head{align-items:center;color:var(--text-3);display:flex;font-size:11px;font-weight:700;gap:8px;letter-spacing:.6px;padding:0 2px;text-transform:uppercase}.explore-section-count{background:var(--askly-accent-soft);border-radius:999px;color:var(--askly-accent);font-size:10px;font-weight:700;letter-spacing:0;padding:1px 7px;text-transform:none}.explore-faq-list{background:var(--askly-surface);border:1px solid var(--askly-border);border-radius:var(--askly-radius-md);box-shadow:var(--askly-elev-1);display:flex;flex-direction:column;overflow:hidden}.explore-faq{border-bottom:1px solid var(--askly-border)}.explore-faq:last-child{border-bottom:none}.explore-faq-q{all:unset;align-items:center;box-sizing:border-box;color:var(--text-1);cursor:pointer;display:flex;font-size:13px;font-weight:500;gap:10px;justify-content:space-between;padding:13px 14px;transition:background .15s;width:100%}.explore-faq-q:hover{background:var(--askly-surface-2)}.explore-faq-chevron{color:var(--text-4);flex-shrink:0;transition:transform .22s var(--askly-ease),color .15s}.explore-faq.open .explore-faq-q{background:var(--askly-surface-2)}.explore-faq.open .explore-faq-chevron{color:var(--askly-accent);transform:rotate(180deg)}.explore-faq-a{background:var(--askly-surface-2);color:var(--text-2);font-size:12.5px;line-height:1.55;padding:0 14px 14px}.explore-faq-a>div:first-child{padding-top:2px}.askly-skeleton{background:var(--askly-surface-3);border-radius:6px;display:block;overflow:hidden;position:relative}.askly-skeleton:after{animation:shimmer 1.4s infinite;background:linear-gradient(90deg,transparent,color-mix(in srgb,var(--text-4) 22%,transparent),transparent);content:"";inset:0;position:absolute;transform:translateX(-100%)}@keyframes shimmer{to{transform:translateX(100%)}}[dir=rtl] .askly-skeleton:after{animation-direction:reverse}.askly-skeleton-line{height:10px;width:100%}.askly-skeleton-chip{border-radius:5px;flex-shrink:0;height:16px;width:16px}.askly-empty-state{align-items:center;display:flex;flex-direction:column;gap:6px;margin:auto 0;padding:44px 24px;text-align:center}.askly-empty-icon{align-items:center;background:var(--askly-accent-soft);border-radius:16px;color:var(--askly-accent);display:flex;height:52px;justify-content:center;margin-bottom:8px;width:52px}.askly-empty-title{color:var(--text-1);font-size:14px;font-weight:600}.askly-empty-desc{color:var(--text-3);font-size:12px;line-height:1.5;max-width:240px}.chat-nav-tabs{background:var(--askly-surface);border-top:1px solid var(--askly-border);display:flex;flex-shrink:0;gap:6px;padding:8px 10px calc(8px + env(safe-area-inset-bottom, 0px))}.nav-tab-btn{all:unset;align-items:center;border-radius:var(--askly-radius-md);box-sizing:border-box;color:var(--text-4);cursor:pointer;display:flex;flex:1;flex-direction:column;font-size:11px;font-weight:500;gap:4px;padding:7px 6px;transition:color .2s var(--askly-ease),background .2s var(--askly-ease)}.nav-tab-btn:hover{color:var(--text-2)}.nav-tab-btn:hover .nav-tab-icon{transform:translateY(-1px)}.nav-tab-icon{align-items:center;display:flex;justify-content:center;transition:transform .2s var(--askly-ease)}.nav-tab-btn.active{color:var(--askly-accent);font-weight:600}.nav-tab-btn.active .nav-tab-icon svg{animation:navTabPop .3s var(--askly-ease)}@keyframes navTabPop{0%{transform:scale(.85)}55%{transform:scale(1.1)}to{transform:scale(1)}}.askly-emoji-picker{background:var(--askly-surface);border:1px solid var(--askly-border-strong);border-radius:var(--askly-radius-md);bottom:calc(100% + 8px);box-shadow:var(--askly-elev-3);display:grid;gap:4px;grid-template-columns:repeat(6,1fr);height:180px;inset-inline-end:20px;overflow-y:auto;padding:10px;position:absolute;width:240px;z-index:10}.emoji-item{all:unset;align-items:center;border-radius:8px;cursor:pointer;display:flex;font-size:18px;justify-content:center;padding:4px;transition:background .15s}.emoji-item:hover{background:var(--askly-surface-2)}.header-action-btn{align-items:center;background:none;border:none;border-radius:8px;color:var(--askly-header-fg,var(--text-2));cursor:pointer;display:flex;height:28px;justify-content:center;opacity:.7;transition:all .15s;width:28px}.header-action-btn:hover{background:rgba(0,0,0,.06);color:var(--askly-header-fg,var(--text-1));opacity:1}.askly-chat-modal[data-askly-theme=dark] .header-action-btn:hover{background:hsla(0,0%,100%,.14)}.header-back-arrow-btn{align-items:center;background:none;border:none;border-radius:50%;color:var(--askly-header-fg,var(--text-1));cursor:pointer;display:flex;justify-content:center;margin-inline-end:-4px;padding:4px;transition:background .2s}.header-back-arrow-btn:hover{background:rgba(0,0,0,.06)}.askly-chat-modal[data-askly-theme=dark] .header-back-arrow-btn:hover{background:hsla(0,0%,100%,.14)}.help-layout{background:var(--askly-bg);overflow-x:hidden;overflow-y:auto;padding:20px}.help-collections{display:flex;flex-direction:column;gap:12px}.help-collection-card{all:unset;align-items:center;background:var(--askly-surface);border:1px solid var(--askly-border);border-radius:var(--askly-radius-md);box-shadow:var(--askly-elev-1);box-sizing:border-box;cursor:pointer;display:flex;gap:12px;justify-content:space-between;padding:14px;text-align:start;transition:transform .16s var(--askly-ease),box-shadow .16s var(--askly-ease),border-color .16s var(--askly-ease)}.help-collection-card:not(.is-skeleton):hover{border-color:var(--askly-border-strong);box-shadow:var(--askly-elev-2);transform:translateY(-2px)}.help-collection-left{align-items:flex-start;display:flex;gap:12px;min-width:0}.help-collection-icon{align-items:center;background:linear-gradient(145deg,var(--askly-accent),var(--askly-accent-strong));box-shadow:var(--askly-elev-1);color:#fff;display:flex;justify-content:center}.help-collection-icon,.help-collection-icon-skel{border-radius:10px;flex-shrink:0;height:36px;width:36px}.help-collection-text{display:flex;flex-direction:column;gap:3px;min-width:0}.help-collection-title{color:var(--text-1);font-size:13.5px;font-weight:600}.help-collection-desc{color:var(--text-3);font-size:11.5px;line-height:1.4}.help-collection-count{color:var(--askly-accent);font-size:10.5px;font-weight:600;margin-top:3px}.help-collection-chevron{color:var(--text-4);flex-shrink:0}.help-articles-list{display:flex;flex-direction:column;gap:10px}.help-article-row{all:unset;align-items:center;background:var(--askly-surface);border:1px solid var(--askly-border);border-radius:var(--askly-radius-md);box-shadow:var(--askly-elev-1);box-sizing:border-box;cursor:pointer;display:flex;gap:12px;justify-content:space-between;padding:14px 16px;text-align:start;transition:transform .18s var(--askly-ease),box-shadow .18s var(--askly-ease),border-color .18s var(--askly-ease);width:100%}.help-article-row:hover{border-color:var(--askly-border-strong);box-shadow:var(--askly-elev-2);transform:translateY(-1px)}.help-article-row>div:first-child{flex:1;min-width:0}.article-row-title{color:var(--text-1);font-size:13.5px;font-weight:600;overflow-wrap:anywhere}.article-row-preview{-webkit-line-clamp:2;-webkit-box-orient:vertical;color:var(--text-3);display:-webkit-box;font-size:12px;line-height:1.4;overflow:hidden;overflow-wrap:anywhere}.help-collection-desc,.help-collection-title{overflow-wrap:anywhere}.article-row-chevron{color:var(--text-4);flex-shrink:0;transition:color .15s}.help-article-row:hover .article-row-chevron{color:var(--askly-accent)}.help-article-reader{background:transparent;border:none;border-radius:0;box-shadow:none;padding:0}.article-breadcrumb{align-items:center;color:var(--text-3);display:flex;font-size:11px;gap:6px;margin-bottom:12px}.article-breadcrumb-link{all:unset;align-items:center;color:var(--askly-accent);cursor:pointer;display:inline-flex;font-weight:600;min-height:24px}.article-breadcrumb-link:hover{text-decoration:underline}.article-breadcrumb-type{text-transform:capitalize}.help-back-btn{all:unset;align-items:center;color:var(--text-3);cursor:pointer;display:inline-flex;font-size:12px;font-weight:600;gap:4px;min-height:24px;transition:color .15s}.help-back-btn:hover{color:var(--askly-accent)}.help-article-heading{color:var(--text-1);font-size:19px;font-weight:700;letter-spacing:-.01em;line-height:1.32;margin-bottom:10px}.article-author-bar{align-items:center;border-bottom:1px solid var(--askly-border);display:flex;gap:10px;margin-bottom:18px;padding-bottom:14px}.article-author-avatar{border:1px solid var(--askly-border);border-radius:50%;flex-shrink:0;height:30px;object-fit:cover;width:30px}.article-author-text{display:flex;flex-direction:column;gap:2px}.article-author-name{color:var(--text-1);font-size:11.5px;font-weight:600}.article-author-meta{color:var(--text-3);font-size:10.5px}.help-article-body{color:var(--text-2);font-size:13.5px;line-height:1.65;overflow-wrap:anywhere}.help-article-body h1,.help-article-body h2,.help-article-body h3{color:var(--text-1);font-weight:700;letter-spacing:-.01em;margin:18px 0 8px}.help-article-body p{margin:0 0 12px}.help-article-body ol,.help-article-body ul{margin:0 0 12px;padding-inline-start:22px}.help-article-body li{margin-top:4px}.help-article-body pre{background:var(--askly-surface-2);border:1px solid var(--askly-border);border-radius:8px;box-sizing:border-box;display:block;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.5;margin:0 0 12px;max-width:100%;overflow-x:auto;padding:10px 12px;white-space:pre}.help-article-body pre code{background:none;border:0;font:inherit;padding:0}.help-article-body blockquote{border-inline-start:3px solid var(--askly-border-strong);color:var(--text-3);margin:0 0 12px;padding:2px 0;padding-inline-start:12px}.help-article-body code.inline-code{background:var(--askly-surface-2);border:1px solid var(--askly-border);border-radius:5px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;padding:2px 6px}.article-feedback{border-top:1px solid var(--askly-border);display:flex;flex-direction:column;gap:12px;margin-top:24px;padding-top:16px}.article-feedback-title{color:var(--text-1);font-size:12.5px;font-weight:600;text-align:center}.article-feedback-thanks{background:var(--askly-success-bg);border:1px solid color-mix(in srgb,var(--askly-success) 25%,transparent);border-radius:var(--askly-radius-sm);color:var(--askly-success);font-size:12px;font-weight:600;padding:10px 14px;text-align:center}.article-feedback-options{display:flex;gap:10px;justify-content:center}.article-feedback-btn{all:unset;align-items:center;background:var(--askly-surface-2);border:1px solid var(--askly-border);border-radius:var(--askly-radius-sm);color:var(--text-1);cursor:pointer;display:inline-flex;font-size:12px;font-weight:500;gap:6px;padding:8px 14px;transition:all .15s var(--askly-ease)}.article-feedback-btn:hover{background:var(--askly-accent-soft);border-color:var(--askly-accent)}.article-handoff{all:unset;align-items:center;background:var(--askly-accent-soft);border:1px solid color-mix(in srgb,var(--askly-accent) 40%,transparent);border-radius:var(--askly-radius-sm);box-sizing:border-box;cursor:pointer;display:flex;gap:10px;justify-content:space-between;margin-top:10px;padding:11px 13px;transition:all .16s var(--askly-ease)}.article-handoff:hover{background:color-mix(in srgb,var(--askly-accent) 16%,transparent);border-color:var(--askly-accent)}.article-handoff-text{display:flex;flex-direction:column;gap:2px}.article-handoff-title{align-items:center;color:var(--text-1);display:inline-flex;font-size:12px;font-weight:600;gap:6px}.article-handoff-title svg{color:var(--askly-accent)}.article-handoff-desc{color:var(--text-3);font-size:11px}.article-handoff-chevron{color:var(--askly-accent);flex-shrink:0}.help-catalog-intro{color:var(--text-4);padding:40px 20px;text-align:center}.message-inline-image{border:1px solid var(--askly-border);border-radius:10px;margin-top:6px;max-width:100%}.message-inline-link{color:inherit;font-weight:500;text-decoration:underline}.msg.agent .message-inline-link{color:var(--askly-link)}.conversations-list-container{background:var(--askly-bg);box-sizing:border-box;display:flex;flex:1;flex-direction:column;min-height:0;overflow:hidden;padding:20px}.conversations-scrollable{display:flex;flex:1;flex-direction:column;gap:8px;margin-bottom:16px;min-height:0;overflow-y:auto;padding-inline-end:2px}.conversation-list-item{all:unset;align-items:center;background:var(--askly-surface);border:1px solid var(--askly-border);border-radius:var(--askly-radius-md);box-shadow:var(--askly-elev-1);box-sizing:border-box;cursor:pointer;display:flex;justify-content:space-between;padding:12px 14px;transition:transform .18s var(--askly-ease),box-shadow .18s var(--askly-ease),border-color .18s var(--askly-ease);width:100%}.conversation-list-item:hover{border-color:var(--askly-border-strong);box-shadow:var(--askly-elev-2);transform:translateY(-1px)}.conversation-item-left{align-items:center;display:flex;gap:12px;overflow:hidden;text-align:start}.conversation-item-icon{align-items:center;background:var(--askly-surface-2);border:1px solid var(--askly-border);border-radius:50%;display:flex;flex-shrink:0;font-size:16px;height:36px;justify-content:center;object-fit:cover;width:36px}.conversation-item-details{align-items:flex-start;display:flex;flex-direction:column;gap:2px;overflow:hidden}.conversation-item-title{color:var(--text-1);font-size:13px;font-weight:600}.conversation-item-preview{color:var(--text-3);font-size:11.5px;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.conversation-item-right{align-items:center;color:var(--text-4);display:flex;flex-shrink:0;gap:6px}.conversation-item-time{font-size:10px}.start-new-chat-btn{all:unset;align-items:center;background:linear-gradient(145deg,var(--askly-accent),var(--askly-accent-strong));border-radius:var(--askly-radius-md);box-shadow:var(--askly-elev-2);box-sizing:border-box;color:var(--askly-accent-contrast);cursor:pointer;display:flex;flex-shrink:0;font-size:13.5px;font-weight:600;height:44px;justify-content:center;text-align:center;transition:transform .18s var(--askly-ease),box-shadow .18s var(--askly-ease),filter .18s var(--askly-ease);width:100%}.start-new-chat-btn:hover{box-shadow:var(--askly-elev-3);filter:brightness(1.05);transform:translateY(-1px)}.start-new-chat-btn:active{transform:scale(.98)}.askly-greeting{-webkit-font-smoothing:antialiased;animation:asklyGreetingIn .32s var(--askly-ease);bottom:calc(var(--askly-offset-bottom, var(--askly-offset-default)) + var(--askly-launcher-clearance, 74px));display:flex;flex-direction:column;font-family:var(--askly-font);gap:8px;max-width:min(300px,calc(100vw - 48px));position:fixed;z-index:99998}.askly-greeting-right{align-items:flex-end;right:var(--askly-offset-side,var(--askly-offset-default))}.askly-greeting-left{left:var(--askly-offset-side,var(--askly-offset-default))}.askly-greeting-left,.askly-greeting-right[dir=rtl]{align-items:flex-start}.askly-greeting-left[dir=rtl]{align-items:flex-end}@keyframes asklyGreetingIn{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.askly-greeting-card{background:var(--askly-surface);border:1px solid var(--askly-border);border-radius:16px;box-shadow:var(--askly-elev-3);color:var(--text-1);position:relative}.askly-greeting-body{all:unset;align-items:center;border-radius:16px;box-sizing:border-box;color:inherit;cursor:pointer;display:flex;font-size:13.5px;gap:10px;line-height:1.45;padding:12px 14px;padding-inline-end:34px}.askly-greeting-body:focus-visible,.askly-greeting-chip:focus-visible,.askly-greeting-close:focus-visible{outline:2px solid var(--askly-accent);outline-offset:2px}.askly-greeting-avatar{border-radius:50%;flex-shrink:0;height:28px;object-fit:cover;width:28px}.askly-greeting-close{all:unset;align-items:center;border-radius:50%;box-sizing:border-box;color:var(--text-3);cursor:pointer;display:flex;height:24px;inset-inline-end:6px;justify-content:center;position:absolute;top:6px;width:24px}.askly-greeting-close:hover{background:var(--askly-surface-2);color:var(--text-1)}.askly-greeting-chips{align-items:inherit;display:flex;flex-direction:column;gap:6px}.askly-greeting-chip{box-shadow:var(--askly-elev-1,0 1px 2px rgba(15,23,42,.08))}.askly-chat-button:focus-visible,.askly-chat-modal :is(button,a,[tabindex]):focus-visible,.askly-greeting :is(button):focus-visible{outline:2px solid var(--askly-accent);outline-offset:2px}.askly-tabpanel{display:contents}.askly-sr-only{clip:rect(0 0 0 0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;user-select:none;-webkit-user-select:none;white-space:nowrap;width:1px}[dir=rtl] .askly-flip-rtl{transform:scaleX(-1)}@media (max-width:600px){.askly-chat-button,.askly-chat-modal,.askly-greeting{--askly-offset-default:16px}.askly-chat-modal,.askly-chat-modal.expanded{border:none!important;border-radius:0!important;bottom:0!important;height:var(--askly-vv-height,100dvh)!important;left:0!important;max-height:var(--askly-vv-height,100dvh)!important;max-width:100vw!important;overscroll-behavior:contain;right:0!important;top:var(--askly-vv-top,auto);touch-action:pan-y;width:100vw!important}.chat-header{border-radius:0!important}.header-expand-btn{display:none}.askly-greeting{bottom:calc(var(--askly-offset-bottom, var(--askly-offset-default)) + var(--askly-launcher-clearance, 72px));max-width:calc(100vw - 32px)}.askly-greeting-right{right:var(--askly-offset-side,var(--askly-offset-default))}.askly-greeting-left{left:var(--askly-offset-side,var(--askly-offset-default))}.askly-greeting-chips{display:none}.askly-greeting-text{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.askly-chat-button.open{display:none}}@media (prefers-reduced-motion:reduce){.askly-chat-modal,.askly-greeting,.askly-jump-latest,.askly-skeleton:after,.explore-cta-icon svg,.home-hero-wave,.msg-wrapper,.nav-tab-btn.active .nav-tab-icon svg,.quick-replies,.typing-indicator span,.voice-btn.listening{animation:none!important}.askly-chat-button,.conversation-list-item,.help-article-row,.home-action-card,.send-btn{transition:none!important}.askly-chat-button:hover{transform:none!important}}.askly-composer-notice{padding:6px 16px}';const Ge="askly-widget";let Je,Ke;let Xe=null,We=null,Qe=0,Ze=!1;const et=(...e)=>{Ze&&console.log("[Askly]",...e)},tt={init:(t={})=>{Ze=!!t.debug,et("Initializing...");const a=t.orgServerRoute||"https://api.askly.co.in/api/messages/widget",r=t.appId||t.widgetId||t.orgId;if(Ke=r,r||console.error("[Askly] Missing required `appId`. The widget cannot load without it."),de("undefined"!=typeof window?window.location.pathname:"",t.includePaths,t.excludePaths)||et("Hidden on this path until navigation allows it."),document.querySelector(Ge))return void console.warn("[Askly] Widget already initialized on this page; ignoring duplicate init().");const n=document.createElement(Ge),o=n.attachShadow({mode:"open"});!function(e){if(void 0===Je)try{Je=new CSSStyleSheet,Je.replaceSync(Be)}catch{Je=null}if(Je&&"adoptedStyleSheets"in e)try{return void(e.adoptedStyleSheets=[Je])}catch{}const t=document.createElement("style");t.textContent=Be,e.appendChild(t)}(o);const s=document.createElement("div");o.appendChild(s);const l=document.createElement("div");l.id="askly-turnstile-container",l.slot="turnstile",n.appendChild(l),document.body.appendChild(n),ce();const i=le(s);i.render(e.createElement(He,{...t,orgId:r,orgServerRoute:a,resetGeneration:Ie(),greetingStartedAt:Qe||Date.now()})),Xe=i,We=n,et("ChatWidget rendered."),t.userId&&_e({userId:t.userId,hash:t.signature,timestamp:t.timestamp})},identify:e=>{e&&e.userId?_e(e):console.error("[Askly] identify() requires a `userId`.")},reset:()=>{we=null,ve(Ke||"detect"),ze+=1,Ne.forEach(e=>{try{e()}catch(e){console.error("[Askly] reset listener failed:",e)}})},shutdown:()=>{tt.reset(),tt.unmount()},unmount:()=>{if(Xe){try{Xe.unmount()}catch{}Xe=null}ie();const e=We||document.querySelector(Ge);e&&e.remove(),We=null},open:()=>re({type:"open"}),close:()=>re({type:"close"}),toggle:()=>re({type:"toggle"}),show:()=>re({type:"open"}),hide:()=>re({type:"close"}),isOpen:()=>Q.open,getUnreadCount:()=>Q.unread,getVisitorId:()=>Q.visitorId,on:(e,t)=>se(e,t),off:(e,t)=>oe(e,t),once:(e,t)=>ne(e,t),ready:()=>new Promise(e=>{Q.ready?e():ne("ready",()=>e())}),showSpace:e=>re({type:"showSpace",space:e}),showNewMessage:e=>re({type:"showNewMessage",text:e}),sendMessage:e=>re({type:"sendMessage",text:e}),showArticle:e=>re({type:"showArticle",articleId:e}),startVoiceInput:()=>re({type:"startVoiceInput"}),stopVoiceInput:()=>re({type:"stopVoiceInput"}),update:e=>re({type:"update",config:e}),setLocale:e=>re({type:"setLocale",locale:e}),updateTexts:e=>re({type:"updateTexts",texts:e})};if("undefined"!=typeof window){const e=window,t=e.Askly&&3===e.Askly.v&&Array.isArray(e.Askly.q)?e.Askly:void 0;if(t){const e=t.q||[];t.q=null,Qe=t._t||0,t._unpaint&&t._unpaint(),Object.keys(tt).forEach(e=>{t[e]=tt[e]}),e.filter(e=>"on"===e[0]||"once"===e[0]).forEach(([e,t])=>tt[e](...t)),e.filter(e=>"on"!==e[0]&&"once"!==e[0]).forEach(([e,t])=>{try{tt[e](...t)}catch(t){console.error(`[Askly] ${e}() failed:`,t)}});const a=t._r;t._r=[],a.length&&tt.ready().then(()=>a.forEach(e=>e()))}else e.Askly||(e.Askly=tt)}
@@ -0,0 +1 @@
1
+ const e={launcher_open:"Support-Chat öffnen",launcher_close:"Support-Chat schließen",launcher_open_unread_one:"Support-Chat öffnen, {count} neue Nachricht",launcher_open_unread_other:"Support-Chat öffnen, {count} neue Nachrichten",launcher_unread_overflow:"{count}+",panel_label:"{organizationName} Support",header_messages:"Nachrichten",header_help_center:"Hilfe-Center",header_back_to_conversations:"Zurück zu den Unterhaltungen",header_expand:"Fenster vergrößern",header_collapse:"Fenster verkleinern",header_close:"Schließen",conversation_label:"Unterhaltung",sending_to_team:"Wird an das Team gesendet…",uploading_attachment:"Anhang wird hochgeladen…",new_messages_one:"{count} neue Nachricht",new_messages_other:"{count} neue Nachrichten",reaction_helpful:"Hilfreich",reaction_not_helpful:"Nicht hilfreich",copy_message:"Nachricht kopieren",copied:"Kopiert",message_from_agent:"Support",message_from_you:"Sie",terms_notice:"Mit dem Chat stimmen Sie unseren {terms} zu",terms_link:"Nutzungsbedingungen",powered_by:"Bereitgestellt von {brand}",tab_explore:"Entdecken",tab_messages:"Nachrichten",tab_help:"Hilfe",tabs_label:"Bereiche",conversations_empty_title:"Noch keine Unterhaltungen",conversations_empty_desc:"Starten Sie einen Chat – unser KI-Agent und unser Team helfen Ihnen gern weiter.",conversation_no_messages:"Noch keine Nachrichten",conversation_title:"Chat Nr. {number}",start_new_chat:"Frage stellen",composer_label:"Nachricht",composer_placeholder:"Nachricht eingeben…",composer_placeholder_lead_required:"Geben Sie oben Ihre E-Mail-Adresse ein, um fortzufahren…",composer_placeholder_security_check:"Bestätigen Sie die Sicherheitsprüfung, um zu chatten…",composer_hint:"Enter zum Senden, Shift+Enter für eine neue Zeile",attach_file:"Datei anhängen (max. 10 MB)",insert_emoji:"Emoji einfügen",emoji_picker_label:"Emoji auswählen",send_message:"Nachricht senden",attachment_image_alt:"Bildanhang",attachment_file_label:"Dateianhang: {name}",notice_security_check_required:"Bitte schließen Sie zuerst die Sicherheitsprüfung ab.",voice_start:"Spracheingabe",voice_finish:"Aufnahme beenden",voice_status_waiting:"Warten auf das Mikrofon…",voice_status_listening:"Ich höre zu…",voice_status_transcribing:"Wird transkribiert…",voice_countdown:"{count} s",voice_seconds_left_one:"Noch 1 Sekunde",voice_seconds_left_other:"Noch {count} Sekunden",voice_cancel:"Spracheingabe abbrechen",voice_stop:"Beenden und transkribieren",voice_retry:"Erneut versuchen",voice_error_insecure:"Die Spracheingabe benötigt eine sichere (https) Seite.",voice_error_unsupported:"Die Spracheingabe wird in diesem Browser nicht unterstützt.",voice_error_denied:"Der Mikrofonzugriff ist blockiert. Erlauben Sie ihn in den Website-Einstellungen Ihres Browsers, um die Spracheingabe zu nutzen.",voice_error_no_microphone:"Es wurde kein Mikrofon gefunden.",voice_error_no_speech:"Das habe ich nicht verstanden. Bitte versuchen Sie es noch einmal.",voice_error_no_audio:"Von Ihrem Mikrofon kommt kein Ton. Prüfen Sie, ob es stummgeschaltet ist und ob das richtige Mikrofon ausgewählt ist.",voice_error_limit:"Die Spracheingabe ist gerade nicht verfügbar. Bitte tippen Sie Ihre Nachricht.",voice_error_disabled:"Die Spracheingabe ist deaktiviert.",voice_error_network:"Ihre Aufnahme konnte nicht transkribiert werden. Prüfen Sie Ihre Verbindung und versuchen Sie es erneut.",voice_error_failed:"Ihre Aufnahme konnte nicht transkribiert werden. Bitte versuchen Sie es erneut oder tippen Sie Ihre Nachricht.",lead_prompt:"Hinterlassen Sie Ihre E-Mail-Adresse, dann antworten wir Ihnen dort, falls Sie nicht mehr da sind.",lead_email_placeholder:"sie@beispiel.de",lead_email_label:"Ihre E-Mail-Adresse",lead_save:"Speichern",lead_saving:"Wird gespeichert…",lead_dismiss:"Nein, danke",lead_error_invalid_email:"Das sieht nicht wie eine E-Mail-Adresse aus.",lead_error_save_failed:"Das konnte gerade nicht gespeichert werden. Sie können einfach weiterchatten.",greeting_default:"Hallo von {organizationName}. Wie können wir helfen?",greeting_default_persona:"Hallo, ich bin {ai_name} von {organizationName}. Wie kann ich helfen?",greeting_dismiss:"Begrüßung ausblenden",welcome_default:"Hallo! Wie kann ich Ihnen heute helfen?",explore_hero_title:"Hallo",explore_hero_subtitle:"Wie können wir helfen?",explore_search_placeholder:"Hilfe suchen…",explore_cta_title:"Unseren KI-Agenten fragen",explore_cta_sub:"Sofortige Antworten, rund um die Uhr – oder das Team erreichen",explore_tile_help_title:"Hilfe-Center",explore_tile_help_sub:"Anleitungen & Dokumentation",explore_tile_messages_title:"Nachrichten",explore_tile_messages_sub:"Ihre Unterhaltungen",explore_popular_questions:"Häufige Fragen",explore_ask_ai_about_this:"KI-Agenten dazu fragen",explore_recommended_reading:"Leseempfehlungen",help_search_placeholder:"Artikel suchen…",help_search_label:"Artikel suchen",help_searching:"Suche läuft…",help_search_no_results:"Keine Artikel zu „{query}“",help_all_collections:"Alle Sammlungen",help_back_to_articles:"Zurück zu den Artikeln",help_document_type_fallback:"Anleitung",help_written_by:"Verfasst vom Support-Team von {organizationName}",help_updated_recently:"Kürzlich aktualisiert",help_read_time_one:"{count} Min. Lesezeit",help_read_time_other:"{count} Min. Lesezeit",help_feedback_title:"Hat das Ihre Frage beantwortet?",help_feedback_thanks:"Vielen Dank für Ihr Feedback!",help_feedback_yes:"Ja",help_feedback_somewhat:"Teilweise",help_feedback_no:"Nein",help_handoff_title:"Noch Fragen?",help_handoff_desc:"Fragen Sie unseren KI-Agenten für sofortige Antworten",help_handoff_prefill:"Ich habe eine Frage zum Artikel „{title}“: ",help_collection_articles:"Artikel in {collection} ({count})",help_article_count_one:"{count} Artikel",help_article_count_other:"{count} Artikel",help_empty_title:"Hilfe-Dokumentation",help_empty_desc:"Suchen Sie oben, um sofort Lösungen aus unserer Wissensdatenbank zu erhalten.",help_collection_guide_title:"Anleitungen & Tutorials",help_collection_guide_desc:"Einrichtungshilfen, Regeln und Erste-Schritte-Anleitungen",help_collection_faq_title:"Häufig gestellte Fragen",help_collection_faq_desc:"Schnelle Antworten auf häufige Fragen zu Konto und Service",help_collection_troubleshooting_title:"Fehlerbehebung & Support",help_collection_troubleshooting_desc:"Schritt-für-Schritt-Lösungen für technische Probleme",help_collection_other_title:"Regeln & Dokumentation",help_collection_other_desc:"Offizielle Bedingungen, Regeln und Richtlinien",help_featured_article:"Empfohlener Artikel",help_untitled_article:"Artikel ohne Titel",help_unavailable:"Das Hilfe-Center konnte nicht geladen werden. Prüfen Sie Ihre Verbindung und versuchen Sie es erneut.",link_opens_new_tab:"(öffnet in einem neuen Tab)",error_search_rate_limited:"Sie suchen zu schnell. Bitte warten Sie einen Moment und versuchen Sie es erneut.",error_search_unavailable:"Die Suche ist gerade nicht verfügbar. Bitte versuchen Sie es in Kürze erneut.",error_send_rate_limited:"Sie senden Nachrichten zu schnell. Bitte warten Sie einen Moment und versuchen Sie es erneut.",error_send_failed:"Leider ist etwas schiefgelaufen. Bitte versuchen Sie es erneut.",error_attachment_rejected:"Diese Datei kann nicht angehängt werden. Sie ist möglicherweise zu groß (max. 10 MB) oder hat einen nicht zugelassenen Dateityp.",error_attachment_upload_failed:"Dieser Anhang konnte nicht hochgeladen werden. Bitte versuchen Sie es erneut."};export{e as default};