@askly/widget 3.0.0 → 3.2.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.
- package/README.md +64 -0
- package/dist/app/HelpTab-Bkp6v19K.js +1 -0
- package/dist/app/VoiceRecorder-DI4eeIGU.js +1 -0
- package/dist/app/ar-BEKPCQV-.js +1 -0
- package/dist/app/askly-app.js +1 -1
- package/dist/app/de-BXS-sgxq.js +1 -0
- package/dist/app/es-Dj6Vnnqs.js +1 -0
- package/dist/app/fr-Bh7EpN4T.js +1 -0
- package/dist/app/hi-kcZHSMAB.js +1 -0
- package/dist/app/pt-hdmOjlnD.js +1 -0
- package/dist/app/shared-D58uTBiu.js +1 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/loader.js +1 -1
- package/dist/types/core/api.d.ts +4 -0
- package/dist/types/core/config.d.ts +8 -0
- package/dist/types/core/events.d.ts +21 -0
- package/dist/types/core/format.d.ts +2 -2
- package/dist/types/core/history.d.ts +45 -0
- package/dist/types/core/types.d.ts +13 -0
- package/dist/types/core/voice.d.ts +0 -1
- package/dist/types/i18n/en.d.ts +148 -0
- package/dist/types/i18n/index.d.ts +32 -0
- package/dist/types/i18n/locales/ar.d.ts +3 -0
- package/dist/types/i18n/locales/de.d.ts +3 -0
- package/dist/types/i18n/locales/es.d.ts +3 -0
- package/dist/types/i18n/locales/fr.d.ts +3 -0
- package/dist/types/i18n/locales/hi.d.ts +3 -0
- package/dist/types/i18n/locales/pt.d.ts +3 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/ui/ChatTerms.d.ts +3 -1
- package/dist/types/ui/GreetingBubble.d.ts +4 -0
- package/dist/types/ui/Launcher.d.ts +5 -0
- package/dist/types/ui/MessageList.d.ts +18 -4
- package/dist/types/widget.d.ts +1 -1
- package/dist/widget.js +1 -1
- package/package.json +3 -2
- package/dist/app/HelpTab-jjw4cF1_.js +0 -1
- package/dist/app/VoiceRecorder-CMc1Bz14.js +0 -1
- package/dist/app/shared-C0Z29aNi.js +0 -1
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every string the widget shows, in English. Other locales live in ./locales and may leave
|
|
3
|
+
* keys out; English fills the gaps. `{name}` marks a value filled in at runtime. Keys ending
|
|
4
|
+
* in `_one` / `_other` are plural forms chosen with Intl.PluralRules.
|
|
5
|
+
*/
|
|
6
|
+
declare const en: {
|
|
7
|
+
launcher_open: string;
|
|
8
|
+
launcher_close: string;
|
|
9
|
+
launcher_open_unread_one: string;
|
|
10
|
+
launcher_open_unread_other: string;
|
|
11
|
+
launcher_unread_overflow: string;
|
|
12
|
+
panel_label: string;
|
|
13
|
+
header_messages: string;
|
|
14
|
+
header_help_center: string;
|
|
15
|
+
header_back_to_conversations: string;
|
|
16
|
+
header_expand: string;
|
|
17
|
+
header_collapse: string;
|
|
18
|
+
header_close: string;
|
|
19
|
+
conversation_label: string;
|
|
20
|
+
sending_to_team: string;
|
|
21
|
+
uploading_attachment: string;
|
|
22
|
+
new_messages_one: string;
|
|
23
|
+
new_messages_other: string;
|
|
24
|
+
reaction_helpful: string;
|
|
25
|
+
reaction_not_helpful: string;
|
|
26
|
+
copy_message: string;
|
|
27
|
+
copied: string;
|
|
28
|
+
message_from_agent: string;
|
|
29
|
+
message_from_you: string;
|
|
30
|
+
terms_notice: string;
|
|
31
|
+
terms_link: string;
|
|
32
|
+
powered_by: string;
|
|
33
|
+
tab_explore: string;
|
|
34
|
+
tab_messages: string;
|
|
35
|
+
tab_help: string;
|
|
36
|
+
tabs_label: string;
|
|
37
|
+
conversations_empty_title: string;
|
|
38
|
+
conversations_empty_desc: string;
|
|
39
|
+
conversation_no_messages: string;
|
|
40
|
+
conversation_title: string;
|
|
41
|
+
conversation_closed_chip: string;
|
|
42
|
+
start_new_chat: string;
|
|
43
|
+
message_not_sent: string;
|
|
44
|
+
message_retry: string;
|
|
45
|
+
conversation_closed: string;
|
|
46
|
+
conversation_with_agent: string;
|
|
47
|
+
composer_label: string;
|
|
48
|
+
composer_placeholder: string;
|
|
49
|
+
composer_placeholder_lead_required: string;
|
|
50
|
+
composer_placeholder_security_check: string;
|
|
51
|
+
composer_hint: string;
|
|
52
|
+
attach_file: string;
|
|
53
|
+
insert_emoji: string;
|
|
54
|
+
emoji_picker_label: string;
|
|
55
|
+
send_message: string;
|
|
56
|
+
attachment_image_alt: string;
|
|
57
|
+
attachment_file_label: string;
|
|
58
|
+
notice_security_check_required: string;
|
|
59
|
+
voice_start: string;
|
|
60
|
+
voice_finish: string;
|
|
61
|
+
voice_status_waiting: string;
|
|
62
|
+
voice_status_listening: string;
|
|
63
|
+
voice_status_transcribing: string;
|
|
64
|
+
voice_seconds_left_one: string;
|
|
65
|
+
voice_seconds_left_other: string;
|
|
66
|
+
voice_countdown: string;
|
|
67
|
+
voice_cancel: string;
|
|
68
|
+
voice_stop: string;
|
|
69
|
+
voice_retry: string;
|
|
70
|
+
voice_error_insecure: string;
|
|
71
|
+
voice_error_unsupported: string;
|
|
72
|
+
voice_error_denied: string;
|
|
73
|
+
voice_error_no_microphone: string;
|
|
74
|
+
voice_error_no_speech: string;
|
|
75
|
+
voice_error_no_audio: string;
|
|
76
|
+
voice_error_limit: string;
|
|
77
|
+
voice_error_disabled: string;
|
|
78
|
+
voice_error_network: string;
|
|
79
|
+
voice_error_failed: string;
|
|
80
|
+
lead_prompt: string;
|
|
81
|
+
lead_email_placeholder: string;
|
|
82
|
+
lead_email_label: string;
|
|
83
|
+
lead_save: string;
|
|
84
|
+
lead_saving: string;
|
|
85
|
+
lead_dismiss: string;
|
|
86
|
+
lead_error_invalid_email: string;
|
|
87
|
+
lead_error_save_failed: string;
|
|
88
|
+
greeting_default: string;
|
|
89
|
+
greeting_default_persona: string;
|
|
90
|
+
greeting_dismiss: string;
|
|
91
|
+
welcome_default: string;
|
|
92
|
+
explore_hero_title: string;
|
|
93
|
+
explore_hero_subtitle: string;
|
|
94
|
+
explore_search_placeholder: string;
|
|
95
|
+
explore_cta_title: string;
|
|
96
|
+
explore_cta_sub: string;
|
|
97
|
+
explore_tile_help_title: string;
|
|
98
|
+
explore_tile_help_sub: string;
|
|
99
|
+
explore_tile_messages_title: string;
|
|
100
|
+
explore_tile_messages_sub: string;
|
|
101
|
+
explore_popular_questions: string;
|
|
102
|
+
explore_ask_ai_about_this: string;
|
|
103
|
+
explore_recommended_reading: string;
|
|
104
|
+
help_search_placeholder: string;
|
|
105
|
+
help_search_label: string;
|
|
106
|
+
help_searching: string;
|
|
107
|
+
help_search_no_results: string;
|
|
108
|
+
help_all_collections: string;
|
|
109
|
+
help_back_to_articles: string;
|
|
110
|
+
help_document_type_fallback: string;
|
|
111
|
+
help_written_by: string;
|
|
112
|
+
help_updated_recently: string;
|
|
113
|
+
help_read_time_one: string;
|
|
114
|
+
help_read_time_other: string;
|
|
115
|
+
help_feedback_title: string;
|
|
116
|
+
help_feedback_thanks: string;
|
|
117
|
+
help_feedback_yes: string;
|
|
118
|
+
help_feedback_somewhat: string;
|
|
119
|
+
help_feedback_no: string;
|
|
120
|
+
help_handoff_title: string;
|
|
121
|
+
help_handoff_desc: string;
|
|
122
|
+
help_handoff_prefill: string;
|
|
123
|
+
help_collection_articles: string;
|
|
124
|
+
help_article_count_one: string;
|
|
125
|
+
help_article_count_other: string;
|
|
126
|
+
help_empty_title: string;
|
|
127
|
+
help_empty_desc: string;
|
|
128
|
+
help_collection_guide_title: string;
|
|
129
|
+
help_collection_guide_desc: string;
|
|
130
|
+
help_collection_faq_title: string;
|
|
131
|
+
help_collection_faq_desc: string;
|
|
132
|
+
help_collection_troubleshooting_title: string;
|
|
133
|
+
help_collection_troubleshooting_desc: string;
|
|
134
|
+
help_collection_other_title: string;
|
|
135
|
+
help_collection_other_desc: string;
|
|
136
|
+
help_featured_article: string;
|
|
137
|
+
help_untitled_article: string;
|
|
138
|
+
help_unavailable: string;
|
|
139
|
+
link_opens_new_tab: string;
|
|
140
|
+
error_search_rate_limited: string;
|
|
141
|
+
error_search_unavailable: string;
|
|
142
|
+
error_send_rate_limited: string;
|
|
143
|
+
error_attachment_rejected: string;
|
|
144
|
+
error_attachment_upload_failed: string;
|
|
145
|
+
};
|
|
146
|
+
export type Messages = typeof en;
|
|
147
|
+
export type MessageKey = keyof Messages;
|
|
148
|
+
export default en;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Translations. English is built in; other locales are chunks fetched on demand. The host
|
|
3
|
+
* page can override any string with `Askly.updateTexts()`, and the portal can set the
|
|
4
|
+
* tenant's locale, which wins over the browser's.
|
|
5
|
+
*/
|
|
6
|
+
import { type Messages, type MessageKey } from "./en";
|
|
7
|
+
export type { Messages, MessageKey };
|
|
8
|
+
export declare const SUPPORTED_LOCALES: string[];
|
|
9
|
+
/** The language tag in use, e.g. "en", "pt-BR". */
|
|
10
|
+
export declare function getLocale(): string;
|
|
11
|
+
/** Text direction for the current locale. */
|
|
12
|
+
export declare function getDirection(): "ltr" | "rtl";
|
|
13
|
+
/** The shipped pack that best matches a requested tag: exact, then its language. */
|
|
14
|
+
export declare function resolveLocale(requested: string | undefined | null): string;
|
|
15
|
+
/**
|
|
16
|
+
* Switch locale. Resolves once the pack is in place (immediately for English or a pack
|
|
17
|
+
* already fetched). An unknown locale falls back to English; a pack that fails to load
|
|
18
|
+
* leaves English in place rather than failing.
|
|
19
|
+
*/
|
|
20
|
+
export declare function setLocale(requested: string | undefined | null): Promise<string>;
|
|
21
|
+
/** Replace any strings with the host's own wording, in whatever locale is active. */
|
|
22
|
+
export declare function updateTexts(texts: Partial<Record<MessageKey, string>>): void;
|
|
23
|
+
/** Re-render on locale or text changes. Returns the unsubscribe. */
|
|
24
|
+
export declare function onTextsChange(listener: () => void): () => void;
|
|
25
|
+
type Params = Record<string, string | number>;
|
|
26
|
+
/** A string in the current locale, with `{name}` placeholders filled in. */
|
|
27
|
+
export declare function t(key: MessageKey, params?: Params): string;
|
|
28
|
+
/** A plural string: `key_one` / `key_other` (and `_zero`, `_two`, `_few`, `_many` when a pack has them). */
|
|
29
|
+
export declare function tn(key: string, count: number, params?: Params): string;
|
|
30
|
+
export declare function formatNumber(n: number): string;
|
|
31
|
+
/** A clock time (today) or a short date (earlier) in the visitor's locale. */
|
|
32
|
+
export declare function formatTime(dateAny: any): string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -5,3 +5,4 @@ export type { AsklyApi } from "./core/api";
|
|
|
5
5
|
export type { AsklyConfig } from "./core/config";
|
|
6
6
|
export type { AsklyIdentity } from "./identity";
|
|
7
7
|
export type { AsklyEventMap, AsklyEventName, AsklyEventHandler, AsklySpace } from "./core/events";
|
|
8
|
+
export type { MessageKey as AsklyTextKey } from "./i18n/en";
|
|
@@ -4,9 +4,13 @@ export interface GreetingBubbleProps {
|
|
|
4
4
|
accentVars: React.CSSProperties;
|
|
5
5
|
aiAnswering: boolean;
|
|
6
6
|
aiAvatarUrl: string | null;
|
|
7
|
+
/** Text direction of the current locale, set on the root. */
|
|
8
|
+
dir: "ltr" | "rtl";
|
|
7
9
|
dismissGreeting: () => void;
|
|
8
10
|
faqs: Faq[];
|
|
9
11
|
greetingText: string;
|
|
12
|
+
/** Language tag of the current locale, for screen readers' pronunciation. */
|
|
13
|
+
lang: string;
|
|
10
14
|
openFromGreeting: (question?: string) => void;
|
|
11
15
|
organizationLogo: string | undefined;
|
|
12
16
|
position: "left" | "right";
|
|
@@ -6,11 +6,16 @@ export interface LauncherProps {
|
|
|
6
6
|
buttonIcon: string;
|
|
7
7
|
buttonShape: "round" | "square";
|
|
8
8
|
buttonStyle: React.CSSProperties;
|
|
9
|
+
/** Text direction of the current locale, set on the root so the badge and glyph follow it. */
|
|
10
|
+
dir: "ltr" | "rtl";
|
|
11
|
+
/** Language tag of the current locale, for screen readers' pronunciation. */
|
|
12
|
+
lang: string;
|
|
9
13
|
launcherUnread: number;
|
|
10
14
|
resolvedTheme: string;
|
|
11
15
|
setActiveChatId: (chatId: string | null) => void;
|
|
12
16
|
setActiveTab: (tab: WidgetTab) => void;
|
|
13
17
|
unreadChatId: string | undefined;
|
|
18
|
+
launcherRef?: React.RefObject<HTMLButtonElement>;
|
|
14
19
|
}
|
|
15
20
|
/** The floating button that opens and closes the panel, with the unread badge. */
|
|
16
21
|
export declare function Launcher(props: LauncherProps): React.JSX.Element;
|
|
@@ -1,13 +1,27 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { Message } from "../core/types";
|
|
3
3
|
export interface MessageListProps {
|
|
4
|
-
copiedMsgIndex:
|
|
4
|
+
copiedMsgIndex: string | null;
|
|
5
5
|
messages: Message[];
|
|
6
|
-
msgReactions: Record<
|
|
7
|
-
setCopiedMsgIndex: React.Dispatch<React.SetStateAction<
|
|
8
|
-
setMsgReactions: React.Dispatch<React.SetStateAction<Record<
|
|
6
|
+
msgReactions: Record<string, "up" | "down">;
|
|
7
|
+
setCopiedMsgIndex: React.Dispatch<React.SetStateAction<string | null>>;
|
|
8
|
+
setMsgReactions: React.Dispatch<React.SetStateAction<Record<string, "up" | "down">>>;
|
|
9
|
+
/** Send a message marked not sent again. */
|
|
10
|
+
retryMessage: (m: Message) => void;
|
|
9
11
|
showTimestamp: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Bumped by the widget whenever the locale or the host's text overrides change. The list is
|
|
14
|
+
* memoised on its props, so without this a text change would leave stale labels on screen.
|
|
15
|
+
*/
|
|
16
|
+
textsVersion: number;
|
|
10
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* What identifies a message across renders: its server id, else the id it was sent under,
|
|
20
|
+
* else its position (local lines that never reach the server, like the welcome). Positions
|
|
21
|
+
* shift when a thread is fetched, so reactions and the copied mark hang off this, not the
|
|
22
|
+
* index.
|
|
23
|
+
*/
|
|
24
|
+
export declare function messageKey(m: Message, index: number): string;
|
|
11
25
|
/** The messages of the chat on screen. */
|
|
12
26
|
declare function MessageListView(props: MessageListProps): React.JSX.Element;
|
|
13
27
|
export declare const MessageList: React.MemoExoticComponent<typeof MessageListView>;
|
package/dist/types/widget.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { ChatWidgetProps } from "./core/types";
|
|
3
|
-
export declare const ChatWidget: ({ orgId, organizationName: initialOrganizationName, themeColor: initialThemeColor, theme: initialTheme, position, orgServerRoute, enableVoiceChat: initialEnableVoiceChat, voiceInput: initialVoiceInput, welcomeMessage: initialWelcomeMessage, placeholderText, organizationLogo: initialOrganizationLogo, buttonIcon, buttonShape: initialButtonShape, autoOpen, greeting, showTimestamp, soundEnabled, soundVolume, poweredBy, userId, timestamp, signature, turnstileSiteKey, excludePaths, includePaths, configOverride, resetGeneration: initResetGeneration, greetingStartedAt, onMessageSent, onMessageReceived, onChatOpened, onChatClosed, onEscalation, }: ChatWidgetProps) => React.JSX.Element | null;
|
|
3
|
+
export declare const ChatWidget: ({ orgId, organizationName: initialOrganizationName, themeColor: initialThemeColor, theme: initialTheme, position, offset, hideLauncher, customLauncherSelector, orgServerRoute, enableVoiceChat: initialEnableVoiceChat, voiceInput: initialVoiceInput, welcomeMessage: initialWelcomeMessage, placeholderText, locale: localeProp, organizationLogo: initialOrganizationLogo, buttonIcon, buttonShape: initialButtonShape, autoOpen, greeting, showTimestamp, soundEnabled, soundVolume, poweredBy, userId, timestamp, signature, turnstileSiteKey, excludePaths, includePaths, configOverride, resetGeneration: initResetGeneration, greetingStartedAt, onMessageSent, onMessageReceived, onChatOpened, onChatClosed, onEscalation, }: ChatWidgetProps) => React.JSX.Element | null;
|
package/dist/widget.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";function t(t,e=[],o=[]){return e.length>0?e.some(e=>t.startsWith(e)):!(o.length>0)||!o.some(e=>t.startsWith(e))}const e="askly_scope_",o={};function n(t){delete o[t];try{window.localStorage.removeItem(t)}catch{}}function a(t){const r=t||"detect",i=function(t){var e;try{const e=window.localStorage.getItem(t);if(null!==e)return e}catch{}return null!==(e=o[t])&&void 0!==e?e:null}(e+r);i&&i!==r&&a(i),n("askly_visitor_"+r),n("askly_threads_"+r);for(const t of Object.keys(o))t.includes(r)&&!t.startsWith(e)&&delete o[t];try{const t=[];for(let e=0;e<window.localStorage.length;e++){const o=window.localStorage.key(e);o&&o.startsWith(`askly_conversations_${r}`)&&t.push(o)}t.forEach(t=>window.localStorage.removeItem(t))}catch{}}const r=["init","identify","reset","shutdown","unmount","open","close","toggle","show","hide","on","off","once","showSpace","showNewMessage","sendMessage","showArticle","startVoiceInput","stopVoiceInput","update"],i={isOpen:!1,getUnreadCount:0,getVisitorId:""},s=["identify","open","toggle","show","showSpace","showNewMessage","sendMessage","showArticle","startVoiceInput","update"],d="#0f172a",l="http://www.w3.org/2000/svg";const u=":host{all:initial}.askly-chat-button{position:fixed;bottom:24px;width:60px;height:60px;border:0;padding:0;display:flex;align-items:center;justify-content:center;cursor:pointer;color:#fff;background:var(--a,"+d+");border-radius:23%;box-shadow:0 12px 32px rgba(15,23,42,.28),0 4px 10px rgba(15,23,42,.16);z-index:99999;font:28px -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;transition:transform .28s cubic-bezier(.2,.8,.2,1)}.shape-round{border-radius:50%}.askly-chat-button:hover{transform:translateY(-3px) scale(1.05)}.askly-chat-button:focus-visible{outline:3px solid var(--a,"+d+");outline-offset:3px}.r{right:24px}.l{left:24px}@media (prefers-reduced-motion:reduce){.askly-chat-button{transition:none}}";function c(t){try{const e=JSON.parse(t||"[]");return Array.isArray(e)&&e.some(t=>t&&Array.isArray(t.messages)&&t.messages.some(t=>t&&"user"===t.role))}catch{return!1}}function p(t,e){const o=t.getAttribute("data-org-server-route")||void 0,n=e=>{const o=t.getAttribute(e);return null===o?void 0:"true"===o};return{appId:e,orgServerRoute:o,organizationName:t.getAttribute("data-org-name")||void 0,position:t.getAttribute("data-position")||void 0,themeColor:t.getAttribute("data-theme-color")||void 0,theme:t.getAttribute("data-theme")||void 0,enableVoiceChat:t.getAttribute("data-enable-voice")?"true"===t.getAttribute("data-enable-voice"):void 0,voiceInput:(()=>{const e=t.getAttribute("data-voice-input");return"off"!==e&&"false"!==e&&("review"===e||"auto-send"===e?e:void 0)})(),welcomeMessage:t.getAttribute("data-welcome-message")||void 0,placeholderText:t.getAttribute("data-placeholder-text")||void 0,organizationLogo:t.getAttribute("data-logo")||void 0,buttonIcon:t.getAttribute("data-button-icon")||void 0,buttonShape:t.getAttribute("data-button-shape")||void 0,autoOpen:n("data-auto-open"),greeting:(()=>{if("false"===t.getAttribute("data-greeting"))return!1;const e=t.getAttribute("data-greeting-message")||void 0,o=t.getAttribute("data-greeting-delay"),a=null===o||isNaN(parseInt(o))?void 0:parseInt(o);return void 0!==e||void 0!==a?{message:e,delayMs:a}:n("data-greeting")})(),showTimestamp:n("data-show-timestamp"),soundEnabled:n("data-sound-enabled"),debug:n("data-debug"),soundVolume:t.getAttribute("data-sound-volume")?parseFloat(t.getAttribute("data-sound-volume")):void 0,poweredBy:t.getAttribute("data-powered-by")||void 0,userId:t.getAttribute("data-user-id")||void 0,timestamp:t.getAttribute("data-timestamp")?parseInt(t.getAttribute("data-timestamp")):void 0,signature:t.getAttribute("data-signature")||void 0,turnstileSiteKey:t.getAttribute("data-turnstile-sitekey")||void 0,excludePaths:t.getAttribute("data-exclude-paths")?t.getAttribute("data-exclude-paths").split(",").map(t=>t.trim()):void 0,includePaths:t.getAttribute("data-include-paths")?t.getAttribute("data-include-paths").split(",").map(t=>t.trim()):void 0}}const g="3.0.0",h=`https://unpkg.com/@askly/widget@${g}/dist/app/askly-app.js`,m=window,b=function(){const t=document.currentScript;if(t&&t.src)return t;const e=Array.from(document.querySelectorAll("script[src]")).filter(t=>/(^|\/)(widget|loader)\.js([?#]|$)/.test(t.src));return e.find(t=>t.hasAttribute("data-app-id")||t.hasAttribute("data-widget-id")||t.hasAttribute("data-org-id"))||e[0]||null}();let f;var y,w,v;m.Askly&&"function"==typeof m.Askly.init?(f=m.Askly,3===f.v&&f.q||console.warn("[Askly] The widget script is included twice; the second copy is ignored.")):(f=function(e){let o=e;const n={q:[],v:3,_r:[],_t:0};let p=null,g=!1,h=null,m=!1,b=null,f=[],y=!1;const w=(...t)=>{h&&h.debug&&console.log("[Askly]",...t)},v=t=>t&&(t.appId||t.widgetId||t.orgId)||"detect",A=()=>{f.forEach(clearTimeout),f=[],b&&b.remove(),b=null},k=()=>{if(!h)return g=!0,Promise.resolve();if(!p){const t=(e,o)=>(w("Loading the widget from",e),import(/* webpackIgnore: true */ /* @vite-ignore */e).catch(n=>{if(o&&o!==e)return console.warn(`[Askly] Could not load the widget from ${e}; trying ${o}.`),t(o);p=null,A(),console.error("[Askly] The widget could not be loaded:",n)}));p=t(o.appUrl,o.fallbackUrl)}return p},S=(t,e)=>{if("undefined"==typeof document||b)return;if(!document.body)return void document.addEventListener("DOMContentLoaded",()=>{!m||b||p||I(t)},{once:!0});const o=t.themeColor||e&&e.themeColor||d,a=t.buttonShape||e&&e.buttonShape||"round";b=document.createElement("askly-loader");const r=b.attachShadow({mode:"open"});let i=!1;try{const t=new CSSStyleSheet;t.replaceSync(u),r.adoptedStyleSheets=[t],i=!0}catch{}if(!i){const t=document.createElement("style");t.textContent=u,r.appendChild(t)}const s=document.createElement("button");s.className=`askly-chat-button shape-${a} ${"left"===t.position?"l":"r"}`,s.type="button",s.setAttribute("aria-label","Open support chat"),s.title="Support Center",s.style.setProperty("--a",`var(--askly-brand, ${o})`),t.buttonIcon&&"💬"!==t.buttonIcon?s.textContent=t.buttonIcon:s.appendChild(function(){const t=document.createElementNS(l,"svg");t.setAttribute("width","32"),t.setAttribute("height","32"),t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("fill","none");const e=document.createElementNS(l,"g");e.setAttribute("transform","translate(24 0) scale(-1 1)");const o=document.createElementNS(l,"path");return o.setAttribute("fill","currentColor"),o.setAttribute("fill-rule","evenodd"),o.setAttribute("clip-rule","evenodd"),o.setAttribute("d","M16 2H8C4 2 2 4 2 8V21C2 21.55 2.45 22 3 22H16C20 22 22 20 22 16V8C22 4 20 2 16 2ZM15.5 12.75H8.5C8.09 12.75 7.75 12.41 7.75 12C7.75 11.59 8.09 11.25 8.5 11.25H15.5C15.91 11.25 16.25 11.59 16.25 12C16.25 12.41 15.91 12.75 15.5 12.75Z"),e.appendChild(o),t.appendChild(e),t}()),s.addEventListener("mouseenter",()=>{k()}),s.addEventListener("focus",()=>{k()}),s.addEventListener("click",()=>{n.open()}),r.appendChild(s),document.body.appendChild(b)},I=t=>{const e=t.appId||t.widgetId||t.orgId,a=(t.orgServerRoute||"https://api.askly.co.in/api/messages/widget").replace(/\/widget$/,""),r=`askly_config_${e||"detect"}`;let i=null;try{i=JSON.parse(sessionStorage.getItem(r)||"null")}catch{}S(t,i);let s=null;const d=o=>{s&&clearTimeout(s),s=null;const a=t.greeting;if(!0!==a&&(!1===a||o&&!1===o.greetingEnabled)||function(t){try{return"1"===window.sessionStorage.getItem(`askly_greeting_dismissed_${t}`)}catch{return!1}}(e||"detect"))return;const r="object"==typeof a&&"number"==typeof a.delayMs?a.delayMs:o&&"number"==typeof o.greetingDelayMs?o.greetingDelayMs:3e3;s=setTimeout(()=>{k()},Math.max(0,r-400-(Date.now()-n._t))),f.push(s)};d(i);let l=!1;try{const t=`askly_conversations_${e||"detect"}`;for(let e=0;e<localStorage.length;e++){const o=localStorage.key(e)||"";if(0===o.indexOf(t)&&c(localStorage.getItem(o))){l=!0;break}}}catch{}(t=>{const e=window.requestIdleCallback;e?e(t,{timeout:4e3}):f.push(setTimeout(t,1500))})(()=>{m&&!p&&(l?k():((()=>{if(p||"undefined"==typeof document)return;const t=document.createElement("link");t.rel="modulepreload",t.href=o.appUrl,document.head.appendChild(t)})(),i||y||(y=!0,fetch(`${a}/widget/config${e?`?org_id=${encodeURIComponent(e)}`:""}`).then(t=>t.ok?t.json():null).then(e=>{if(e&&m){try{sessionStorage.setItem(r,JSON.stringify(e))}catch{}if(e.disabled)return w("Disabled by configuration."),A(),n.q=null,void(m=!1);p||(b&&(b.remove(),b=null,S(t,e)),d(e))}}).catch(()=>{}))))})};let x=!1;const C=e=>{if(x||!e.includePaths&&!e.excludePaths)return;x=!0;const o=()=>{m&&!p&&(t(window.location.pathname,e.includePaths,e.excludePaths)?b||I(e):A())},n=t=>{const e=history[t];history[t]=function(...t){const n=e.apply(this,t);return setTimeout(o,0),n}};n("pushState"),n("replaceState"),window.addEventListener("popstate",o)};return r.forEach(e=>{const r=(...i)=>n[e]!==r?n[e](...i):(n.q&&n.q.push([e,i]),"init"===e?((e={})=>{if(h=e,m=!0,n._t=Date.now(),e.appUrl&&(o={...o,appUrl:e.appUrl}),e.appId||e.widgetId||e.orgId||console.error("[Askly] Missing required `appId`. The widget cannot load without it."),"undefined"!=typeof window){if(g||e.autoOpen||e.userId)return g=!1,void k();C(e),t(window.location.pathname,e.includePaths,e.excludePaths)?I(e):w("Hidden on this path.")}})(i[0]):"reset"===e?a(v(h)):"shutdown"===e||"unmount"===e?("shutdown"===e&&a(v(h)),m=!1,A(),n.q=[]):-1!==s.indexOf(e)&&k(),"on"===e||"once"===e?()=>{n.q?n.q=n.q.filter(t=>!(t[0]===e&&t[1][0]===i[0]&&t[1][1]===i[1])):n.off(i[0],i[1])}:void 0);n[e]=r}),Object.keys(i).forEach(t=>{const e=()=>n[t]!==e?n[t]():i[t];n[t]=e}),n.ready=()=>(k(),new Promise(t=>n._r.push(t))),n._unpaint=A,n}({appUrl:(y=b&&b.src,w=g,v=h,y?y.replace(/[?#].*$/,"").replace(/[^/]*$/,"").replace(/(\/@askly\/widget)(@[^/]*)?(\/)/,(t,e,o,n)=>`${e}@${w}${n}`)+"app/askly-app.js":v),fallbackUrl:h}),m.Askly=f);const A=function(t){if(t)return t.getAttribute("data-app-id")||t.getAttribute("data-widget-id")||t.getAttribute("data-org-id")||void 0}(b);b&&A&&f.init(p(b,A)),m.customElements&&!m.customElements.get("askly-chat")&&m.customElements.define("askly-chat",class extends HTMLElement{constructor(){super(...arguments),this._gone=null}connectedCallback(){if(this._gone)return clearTimeout(this._gone),void(this._gone=null);const t=this.getAttribute("app-id");if(!t)return;const e=document.createElement("script");Array.from(this.attributes).forEach(t=>e.setAttribute(`data-${t.name}`,t.value)),m.Askly.init(p(e,t))}disconnectedCallback(){this._gone=setTimeout(()=>{this._gone=null,m.Askly.unmount()},0)}})}();
|
|
1
|
+
!function(){"use strict";function t(t,e=[],o=[]){return e.length>0?e.some(e=>t.startsWith(e)):!(o.length>0)||!o.some(e=>t.startsWith(e))}const e="askly_scope_",o={};function n(t){delete o[t];try{window.localStorage.removeItem(t)}catch{}}function a(t){const r=t||"detect",s=function(t){var e;try{const e=window.localStorage.getItem(t);if(null!==e)return e}catch{}return null!==(e=o[t])&&void 0!==e?e:null}(e+r);s&&s!==r&&a(s),n("askly_visitor_"+r),n("askly_threads_"+r);for(const t of Object.keys(o))t.includes(r)&&!t.startsWith(e)&&delete o[t];try{const t=[];for(let e=0;e<window.localStorage.length;e++){const o=window.localStorage.key(e);o&&o.startsWith(`askly_conversations_${r}`)&&t.push(o)}t.forEach(t=>window.localStorage.removeItem(t))}catch{}}const r=["init","identify","reset","shutdown","unmount","open","close","toggle","show","hide","on","off","once","showSpace","showNewMessage","sendMessage","showArticle","startVoiceInput","stopVoiceInput","update","setLocale","updateTexts"],s={isOpen:!1,getUnreadCount:0,getVisitorId:""},i=["identify","open","toggle","show","showSpace","showNewMessage","sendMessage","showArticle","startVoiceInput","update"],l="#0f172a",d="http://www.w3.org/2000/svg";const u=":host{all:initial}.askly-chat-button{position:fixed;bottom:var(--ob,24px);width:60px;height:60px;border:0;padding:0;display:flex;align-items:center;justify-content:center;cursor:pointer;color:#fff;background:var(--a,"+l+");border-radius:23%;box-shadow:0 12px 32px rgba(15,23,42,.28),0 4px 10px rgba(15,23,42,.16);z-index:99999;font:28px -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;transition:transform .28s cubic-bezier(.2,.8,.2,1)}.shape-round{border-radius:50%}.askly-chat-button:hover{transform:translateY(-3px) scale(1.05)}.askly-chat-button:focus-visible{outline:3px solid var(--a,"+l+");outline-offset:3px}.r{right:var(--os,24px)}.l{left:var(--os,24px)}@media (max-width:600px){.askly-chat-button{bottom:var(--ob,16px)}.r{right:var(--os,16px)}.l{left:var(--os,16px)}}@media (prefers-reduced-motion:reduce){.askly-chat-button{transition:none}}";function c(t){try{const e=JSON.parse(t||"[]");return Array.isArray(e)&&e.some(t=>t&&Array.isArray(t.messages)&&t.messages.some(t=>t&&"user"===t.role))}catch{return!1}}function p(t,e){const o=t.getAttribute("data-org-server-route")||void 0,n=e=>{const o=t.getAttribute(e);return null===o?void 0:"true"===o};return{appId:e,orgServerRoute:o,organizationName:t.getAttribute("data-org-name")||void 0,position:t.getAttribute("data-position")||void 0,locale:t.getAttribute("data-locale")||void 0,hideLauncher:n("data-hide-launcher"),customLauncherSelector:t.getAttribute("data-custom-launcher-selector")||void 0,offset:(()=>{const e=t.getAttribute("data-offset-bottom"),o=t.getAttribute("data-offset-side");if(null!==e||null!==o)return{bottom:null===e||isNaN(parseInt(e))?void 0:parseInt(e),side:null===o||isNaN(parseInt(o))?void 0:parseInt(o)}})(),themeColor:t.getAttribute("data-theme-color")||void 0,theme:t.getAttribute("data-theme")||void 0,enableVoiceChat:t.getAttribute("data-enable-voice")?"true"===t.getAttribute("data-enable-voice"):void 0,voiceInput:(()=>{const e=t.getAttribute("data-voice-input");return"off"!==e&&"false"!==e&&("review"===e||"auto-send"===e?e:void 0)})(),welcomeMessage:t.getAttribute("data-welcome-message")||void 0,placeholderText:t.getAttribute("data-placeholder-text")||void 0,organizationLogo:t.getAttribute("data-logo")||void 0,buttonIcon:t.getAttribute("data-button-icon")||void 0,buttonShape:t.getAttribute("data-button-shape")||void 0,autoOpen:n("data-auto-open"),greeting:(()=>{if("false"===t.getAttribute("data-greeting"))return!1;const e=t.getAttribute("data-greeting-message")||void 0,o=t.getAttribute("data-greeting-delay"),a=null===o||isNaN(parseInt(o))?void 0:parseInt(o);return void 0!==e||void 0!==a?{message:e,delayMs:a}:n("data-greeting")})(),showTimestamp:n("data-show-timestamp"),soundEnabled:n("data-sound-enabled"),debug:n("data-debug"),soundVolume:t.getAttribute("data-sound-volume")?parseFloat(t.getAttribute("data-sound-volume")):void 0,poweredBy:t.getAttribute("data-powered-by")||void 0,userId:t.getAttribute("data-user-id")||void 0,timestamp:t.getAttribute("data-timestamp")?parseInt(t.getAttribute("data-timestamp")):void 0,signature:t.getAttribute("data-signature")||void 0,turnstileSiteKey:t.getAttribute("data-turnstile-sitekey")||void 0,excludePaths:t.getAttribute("data-exclude-paths")?t.getAttribute("data-exclude-paths").split(",").map(t=>t.trim()):void 0,includePaths:t.getAttribute("data-include-paths")?t.getAttribute("data-include-paths").split(",").map(t=>t.trim()):void 0}}const g="3.2.0",h=`https://unpkg.com/@askly/widget@${g}/dist/app/askly-app.js`,m=window,f=function(){const t=document.currentScript;if(t&&t.src)return t;const e=Array.from(document.querySelectorAll("script[src]")).filter(t=>/(^|\/)(widget|loader)\.js([?#]|$)/.test(t.src));return e.find(t=>t.hasAttribute("data-app-id")||t.hasAttribute("data-widget-id")||t.hasAttribute("data-org-id"))||e[0]||null}();let b;var y,v,w;m.Askly&&"function"==typeof m.Askly.init?(b=m.Askly,3===b.v&&b.q||console.warn("[Askly] The widget script is included twice; the second copy is ignored.")):(b=function(e){let o=e;const n={q:[],v:3,_r:[],_t:0};let p=null,g=!1,h=null,m=!1,f=null,b=[],y=!1,v=!1;const w=(...t)=>{h&&h.debug&&console.log("[Askly]",...t)},A=t=>t&&(t.appId||t.widgetId||t.orgId)||"detect",k=()=>{b.forEach(clearTimeout),b=[],f&&f.remove(),f=null},S=()=>{if(!h)return g=!0,Promise.resolve();if(!p){const t=(e,o)=>(w("Loading the widget from",e),import(/* webpackIgnore: true */ /* @vite-ignore */e).catch(n=>{if(o&&o!==e)return console.warn(`[Askly] Could not load the widget from ${e}; trying ${o}.`),t(o);p=null,k(),console.error("[Askly] The widget could not be loaded:",n)}));p=t(o.appUrl,o.fallbackUrl)}return p};let x=!1;const I=(t,e)=>{if("undefined"==typeof document||f)return;if(!document.body)return void document.addEventListener("DOMContentLoaded",()=>{!m||f||p||_(t)},{once:!0});const o=t.themeColor||e&&e.themeColor||l,a=t.buttonShape||e&&e.buttonShape||"round";f=document.createElement("askly-loader");const r=f.attachShadow({mode:"open"});let s=!1;try{const t=new CSSStyleSheet;t.replaceSync(u),r.adoptedStyleSheets=[t],s=!0}catch{}if(!s){const t=document.createElement("style");t.textContent=u,r.appendChild(t)}const i=document.createElement("button");i.className=`askly-chat-button shape-${a} ${"left"===t.position?"l":"r"}`,i.type="button",i.setAttribute("aria-label","Open support chat"),i.setAttribute("aria-expanded","false"),i.setAttribute("lang","en"),i.title="Open support chat",i.style.setProperty("--a",`var(--askly-brand, ${o})`),t.offset&&"number"==typeof t.offset.bottom&&i.style.setProperty("--ob",`${t.offset.bottom}px`),t.offset&&"number"==typeof t.offset.side&&i.style.setProperty("--os",`${t.offset.side}px`),t.buttonIcon&&"💬"!==t.buttonIcon?i.textContent=t.buttonIcon:i.appendChild(function(){const t=document.createElementNS(d,"svg");t.setAttribute("width","32"),t.setAttribute("height","32"),t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("fill","none");const e=document.createElementNS(d,"g");e.setAttribute("transform","translate(24 0) scale(-1 1)");const o=document.createElementNS(d,"path");return o.setAttribute("fill","currentColor"),o.setAttribute("fill-rule","evenodd"),o.setAttribute("clip-rule","evenodd"),o.setAttribute("d","M16 2H8C4 2 2 4 2 8V21C2 21.55 2.45 22 3 22H16C20 22 22 20 22 16V8C22 4 20 2 16 2ZM15.5 12.75H8.5C8.09 12.75 7.75 12.41 7.75 12C7.75 11.59 8.09 11.25 8.5 11.25H15.5C15.91 11.25 16.25 11.59 16.25 12C16.25 12.41 15.91 12.75 15.5 12.75Z"),e.appendChild(o),t.appendChild(e),t}()),i.addEventListener("mouseenter",()=>{S()}),i.addEventListener("focus",()=>{S()}),i.addEventListener("click",()=>{n.open()}),r.appendChild(i),document.body.appendChild(f)};let C=!1;const _=t=>{C=!0;const e=t.appId||t.widgetId||t.orgId,a=(t.orgServerRoute||"https://api.askly.co.in/api/messages/widget").replace(/\/widget$/,""),r=`askly_config_${e||"detect"}`;let s=null;try{s=JSON.parse(sessionStorage.getItem(r)||"null")}catch{}t.hideLauncher||I(t,s);let i=null;const l=o=>{i&&clearTimeout(i),i=null;const a=t.greeting;if(!0!==a&&(!1===a||o&&!1===o.greetingEnabled)||t.hideLauncher||function(t){try{return"1"===window.sessionStorage.getItem(`askly_greeting_dismissed_${t}`)}catch{return!1}}(e||"detect"))return;const r="object"==typeof a&&"number"==typeof a.delayMs?a.delayMs:o&&"number"==typeof o.greetingDelayMs?o.greetingDelayMs:3e3;i=setTimeout(()=>{S()},Math.max(0,r-400-(Date.now()-n._t))),b.push(i)};l(s);let d=!1;try{const t=`askly_conversations_${e||"detect"}`;for(let e=0;e<localStorage.length;e++){const o=localStorage.key(e)||"";if(0===o.indexOf(t)&&c(localStorage.getItem(o))){d=!0;break}}}catch{}(t=>{const e=window.requestIdleCallback;e?e(t,{timeout:4e3}):b.push(setTimeout(t,1500))})(()=>{m&&!p&&(d?S():((()=>{if(p||x||"undefined"==typeof document)return;x=!0;const t=document.createElement("link");t.rel="modulepreload",t.href=o.appUrl,document.head.appendChild(t)})(),s||y||(y=!0,fetch(`${a}/widget/config${e?`?org_id=${encodeURIComponent(e)}`:""}`).then(t=>t.ok?t.json():null).then(e=>{if(e&&m){try{sessionStorage.setItem(r,JSON.stringify(e))}catch{}if(e.disabled)return w("Disabled by configuration."),k(),n.q=null,void(m=!1);p||(f&&!t.hideLauncher&&(f.remove(),f=null,I(t,e)),l(e))}}).catch(()=>{}))))})};let E=!1;const $=e=>{if(E||!e.includePaths&&!e.excludePaths)return;E=!0;const o=()=>{m&&!p&&(t(window.location.pathname,e.includePaths,e.excludePaths)?C||_(e):(k(),C=!1))},n=t=>{const e=history[t];history[t]=function(...t){const n=e.apply(this,t);return setTimeout(o,0),n}};n("pushState"),n("replaceState"),window.addEventListener("popstate",o)};return r.forEach(e=>{const r=(...s)=>n[e]!==r?n[e](...s):(n.q&&n.q.push([e,s]),"init"===e?((e={})=>{if(h=e,m=!0,n._t=Date.now(),e.appUrl&&(o={...o,appUrl:e.appUrl}),e.appId||e.widgetId||e.orgId||console.error("[Askly] Missing required `appId`. The widget cannot load without it."),"undefined"!=typeof window){if(g||e.autoOpen||e.userId)return g=!1,void S();if($(e),e.customLauncherSelector&&!v){let t=!0;try{document.querySelector(e.customLauncherSelector)}catch{t=!1}t||console.warn(`[Askly] customLauncherSelector is not a valid selector: ${e.customLauncherSelector}`),v=!0,t&&document.addEventListener("click",t=>{if(!(m&&h&&h.customLauncherSelector&&n.q))return;const e=t.target;let o=null;try{o=e&&e.closest?e.closest(h.customLauncherSelector):null}catch{return}o&&("A"===o.tagName&&"#"===(o.getAttribute("href")||"#").charAt(0)&&t.preventDefault(),n.q.some(t=>"open"===t[0]||"toggle"===t[0])||n.open())})}t(window.location.pathname,e.includePaths,e.excludePaths)?_(e):w("Hidden on this path.")}})(s[0]):"reset"===e?a(A(h)):"shutdown"===e||"unmount"===e?("shutdown"===e&&a(A(h)),m=!1,k(),n.q=[]):-1!==i.indexOf(e)&&S(),"on"===e||"once"===e?()=>{n.q?n.q=n.q.filter(t=>!(t[0]===e&&t[1][0]===s[0]&&t[1][1]===s[1])):n.off(s[0],s[1])}:void 0);n[e]=r}),Object.keys(s).forEach(t=>{const e=()=>n[t]!==e?n[t]():s[t];n[t]=e}),n.ready=()=>(S(),new Promise(t=>n._r.push(t))),n._unpaint=k,n}({appUrl:(y=f&&f.src,v=g,w=h,y?y.replace(/[?#].*$/,"").replace(/[^/]*$/,"").replace(/(\/@askly\/widget)(@[^/]*)?(\/)/,(t,e,o,n)=>`${e}@${v}${n}`)+"app/askly-app.js":w),fallbackUrl:h}),m.Askly=b);const A=function(t){if(t)return t.getAttribute("data-app-id")||t.getAttribute("data-widget-id")||t.getAttribute("data-org-id")||void 0}(f);f&&A&&b.init(p(f,A)),m.customElements&&!m.customElements.get("askly-chat")&&m.customElements.define("askly-chat",class extends HTMLElement{constructor(){super(...arguments),this._gone=null}connectedCallback(){if(this._gone)return clearTimeout(this._gone),void(this._gone=null);const t=this.getAttribute("app-id");if(!t)return;const e=document.createElement("script");Array.from(this.attributes).forEach(t=>e.setAttribute(`data-${t.name}`,t.value)),m.Askly.init(p(e,t))}disconnectedCallback(){this._gone=setTimeout(()=>{this._gone=null,m.Askly.unmount()},0)}})}();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@askly/widget",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "Embeddable AI support chat widget for React \u2014 drop-in customer support chatbot with voice, RAG (docs-grounded) answers, and human handoff. One line to install.",
|
|
5
5
|
"main": "dist/index.umd.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"jsdelivr": "dist/widget.js",
|
|
9
9
|
"types": "dist/types/index.d.ts",
|
|
10
10
|
"scripts": {
|
|
11
|
-
"build": "rollup -c rollup.config.mjs && npm run build:react",
|
|
11
|
+
"build": "rm -rf dist && rollup -c rollup.config.mjs && npm run build:react",
|
|
12
12
|
"test": "tsc src/markdown.ts --outDir test/.build --module commonjs --target es2019 --strict --skipLibCheck && node --test test/markdown.test.cjs",
|
|
13
13
|
"typecheck": "tsc --noEmit -p .",
|
|
14
14
|
"test:e2e": "playwright test",
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
},
|
|
55
55
|
"homepage": "https://github.com/StrontiumTechnologies/Askly-SDK#readme",
|
|
56
56
|
"devDependencies": {
|
|
57
|
+
"@axe-core/playwright": "^4.13.0",
|
|
57
58
|
"@playwright/test": "^1.63.0",
|
|
58
59
|
"@rollup/plugin-alias": "^6.0.0",
|
|
59
60
|
"@rollup/plugin-commonjs": "^28.0.9",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as e,j as t,t as a,a1 as l,a2 as c,C as s,b as n,B as r}from"./shared-C0Z29aNi.js";function i(i){const{allArticles:o,articleFeedback:m,articlesLoading:d,handleSearchChange:p,handleSelectArticle:u,organizationLogo:h,organizationName:E,searchError:N,searchLoading:f,searchQuery:y,searchResults:g,selectedArticle:v,selectedCollection:k,setActiveTab:b,setArticleFeedback:x,setInput:w,setSelectedArticle:C,setSelectedCollection:S,themeColor:z}=i;return e.createElement("div",{className:"chat-body help-layout"},v?e.createElement("div",{className:"help-article-reader"},e.createElement("div",{className:"article-breadcrumb"},e.createElement("button",{className:"article-breadcrumb-link",onClick:()=>{C(null),S(null)}},"Help Center"),e.createElement("span",null,"/"),e.createElement("span",{className:"article-breadcrumb-type"},v.document_type||"Guide")),e.createElement("button",{className:"help-back-btn",onClick:()=>C(null),style:{marginBottom:14}},e.createElement(t,{size:16}),e.createElement("span",null,"Back to articles")),e.createElement("div",{className:"help-article-heading"},v.title),e.createElement("div",{className:"article-author-bar"},e.createElement("img",{src:h||"https://askly.co.in/logo-small.png",alt:E,className:"article-author-avatar"}),e.createElement("div",{className:"article-author-text"},e.createElement("span",{className:"article-author-name"},"Written by ",E," Support Team"),e.createElement("span",{className:"article-author-meta"},"Updated recently • ⏱ ",Math.max(1,Math.ceil((v.content||"").split(/\s+/).length/180))," min read"))),e.createElement("div",{className:"help-article-body",dangerouslySetInnerHTML:{__html:a(l(v.content))}}),e.createElement("div",{className:"article-feedback"},e.createElement("div",{className:"article-feedback-title"},"Did this answer your question?"),m[v.id]?e.createElement("div",{className:"article-feedback-thanks"},"🎉 Thank you for your feedback!"):e.createElement("div",{className:"article-feedback-options"},e.createElement("button",{className:"article-feedback-btn",onClick:()=>x(e=>({...e,[v.id]:"yes"}))},"😃 Yes"),e.createElement("button",{className:"article-feedback-btn",onClick:()=>x(e=>({...e,[v.id]:"somewhat"}))},"😐 Somewhat"),e.createElement("button",{className:"article-feedback-btn",onClick:()=>x(e=>({...e,[v.id]:"no"}))},"😞 No")),e.createElement("button",{className:"article-handoff",onClick:()=>{w(`I have a question about article "${v.title}": `),b("messages")}},e.createElement("div",{className:"article-handoff-text"},e.createElement("span",{className:"article-handoff-title"},e.createElement(c,{size:13})," Still have questions?"),e.createElement("span",{className:"article-handoff-desc"},"Ask our AI Agent for instant answers")),e.createElement(s,{size:16,className:"article-handoff-chevron"})))):e.createElement("div",null,e.createElement("div",{className:"home-search-input-wrapper",style:{marginBottom:14}},e.createElement(n,{size:14,className:"search-icon-svg"}),e.createElement("input",{type:"text",value:y,onChange:p,placeholder:"Search for articles..."}),f&&e.createElement("span",{className:"search-loader"})),k&&e.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:12}},e.createElement("button",{onClick:()=>S(null),style:{all:"unset",cursor:"pointer",fontSize:12,color:z,fontWeight:500,display:"flex",alignItems:"center",gap:4}},e.createElement(t,{size:14}),e.createElement("span",null,"All Collections")),e.createElement("span",{style:{fontSize:12,color:"var(--text-4)"}},"/"),e.createElement("span",{style:{fontSize:12,fontWeight:600,color:"var(--text-1)",textTransform:"capitalize"}},k)),e.createElement("div",{className:"help-articles-list"},""===y.trim()?k?(()=>{const t=o.filter(e=>(e.document_type||"guide").toLowerCase()===k.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"}},k," Articles (",t.length,")"),e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:8}},t.map(t=>e.createElement("button",{key:t.id,className:"help-article-row",onClick:()=>u(t)},e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:3,alignItems:"flex-start",textAlign:"left"}},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(s,{size:14,className:"article-row-chevron"})))))})():e.createElement("div",{className:"help-collections"},(()=>{if(d)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 t={};o.forEach(e=>{const a=(e.document_type||"guide").toLowerCase();t[a]||(t[a]=[]),t[a].push(e)});const a=Object.keys(t);return 0===a.length?e.createElement("div",{className:"askly-empty-state"},e.createElement("div",{className:"askly-empty-icon"},e.createElement(r,{size:22})),e.createElement("div",{className:"askly-empty-title"},"Help Documentation"),e.createElement("div",{className:"askly-empty-desc"},"Search above to fetch instant solutions from our knowledge base.")):a.map(a=>{const l=t[a],c="guide"===a?"Guides & Tutorials":"faq"===a?"Frequently Asked Questions":"troubleshooting"===a?"Troubleshooting & Support":"Rules & Documentation",n="guide"===a?"Setup walkthroughs, rules, and getting started guides":"faq"===a?"Quick answers to common account and service questions":"troubleshooting"===a?"Step-by-step solutions for technical issues":"Official terms, rules, and policy documentation";return e.createElement("button",{key:a,className:"help-collection-card",onClick:()=>S(a)},e.createElement("div",{className:"help-collection-left"},e.createElement("div",{className:"help-collection-icon"},e.createElement(r,{size:16})),e.createElement("div",{className:"help-collection-text"},e.createElement("div",{className:"help-collection-title"},c),e.createElement("div",{className:"help-collection-desc"},n),e.createElement("div",{className:"help-collection-count"},l.length," ",1===l.length?"article":"articles"))),e.createElement(s,{size:16,className:"help-collection-chevron"}))})})()):N?e.createElement("div",{className:"no-search-results"},N):0!==g.length||f?g.map(t=>e.createElement("button",{key:t.id,className:"help-article-row",onClick:()=>u(t)},e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:3,alignItems:"flex-start"}},e.createElement("span",{className:"article-row-title"},t.title),e.createElement("span",{className:"article-row-preview"},t.content.slice(0,80),"...")),e.createElement(s,{size:14,className:"article-row-chevron"}))):e.createElement("div",{className:"no-search-results"},'No articles matching "',y,'"'))))}export{i as HelpTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as e,q as a,g as t,X as n}from"./shared-C0Z29aNi.js";function s({phase:s,meterRef:c,maxMs:l,onStop:r,onCancel:i}){const[o,m]=e([]),[p,u]=e(0);a(()=>{if("recording"!==s)return;const e=setInterval(()=>{const{level:e,elapsedMs:a}=c.current;u(a),m(a=>(a.length>=80?a.slice(1):a).concat(e))},100);return()=>clearInterval(e)},[s]);const b="recording"===s,d=l-p,v="transcribing"===s?"Transcribing…":b?"Listening…":"Waiting for the microphone…";return t.createElement("div",{className:`askly-voice ${s}`},t.createElement("button",{type:"button",className:"askly-voice-btn",onClick:i,title:"Cancel","aria-label":"Cancel voice input"},t.createElement(n,{size:20})),t.createElement("span",{className:"askly-voice-meter","aria-hidden":"true"},o.map((e,a)=>t.createElement("i",{key:a,style:{height:`${Math.round(2+22*Math.min(1,e))}px`}}))),t.createElement("span",{className:"askly-voice-status",role:"status"},v),b&&d<=1e4&&t.createElement("span",{className:"askly-voice-time"},Math.max(0,Math.ceil(d/1e3)),"s"),b?t.createElement("button",{type:"button",className:"askly-voice-btn done",onClick:r,title:"Stop and transcribe","aria-label":"Stop and transcribe"},t.createElement("span",{className:"askly-voice-stop"})):t.createElement("span",{className:"askly-voice-btn done busy","aria-hidden":"true"},t.createElement("span",{className:"askly-voice-spinner"})))}export{s as VoiceRecorder};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e,t,n,r,o,i,_,u,l,s,a,c,f,p,h,d={},m=[],v=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,g=Array.isArray;function y(e,t){for(var n in t)e[n]=t[n];return e}function k(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function w(t,n,r){var o,i,_,u={};for(_ in n)"key"==_?o=n[_]:"ref"==_?i=n[_]:u[_]=n[_];if(arguments.length>2&&(u.children=arguments.length>3?e.call(arguments,2):r),"function"==typeof t&&null!=t.defaultProps)for(_ in t.defaultProps)void 0===u[_]&&(u[_]=t.defaultProps[_]);return b(t,u,o,i,null)}function b(e,r,o,i,_){var u={type:e,props:r,key:o,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==_?++n:_,__i:-1,__u:0};return null==_&&null!=t.vnode&&t.vnode(u),u}function C(e){return e.children}function S(e,t){this.props=e,this.context=t}function x(e,t){if(null==t)return e.__?x(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?x(e):null}function N(e){if(e.__P&&e.__d){var n=e.__v,r=n.__e,o=[],i=[],_=y({},n);_.__v=n.__v+1,t.vnode&&t.vnode(_),A(e.__P,_,n,e.__n,e.__P.namespaceURI,32&n.__u?[r]:null,o,null==r?x(n):r,!!(32&n.__u),i),_.__v=n.__v,_.__.__k[_.__i]=_,O(o,_,i),n.__e=n.__=null,_.__e!=r&&M(_)}}function M(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some(function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e}),M(e)}function E(e){(!e.__d&&(e.__d=!0)&&r.push(e)&&!$.__r++||o!=t.debounceRendering)&&((o=t.debounceRendering)||i)($)}function $(){try{for(var e,t=1;r.length;)r.length>t&&r.sort(_),e=r.shift(),t=r.length,N(e)}finally{r.length=$.__r=0}}function H(e,t,n,r,o,i,_,u,l,s,a){var c,f,p,h,v,y,k=r&&r.__k||m,w=t.length;for(l=function(e,t,n,r,o){var i,_,u,l,s,a=n.length,c=a,f=0;for(e.__k=new Array(o),i=0;i<o;i++)null!=(_=t[i])&&"boolean"!=typeof _&&"function"!=typeof _?("string"==typeof _||"number"==typeof _||"bigint"==typeof _||_.constructor==String?_=e.__k[i]=b(null,_,null,null,null):g(_)?_=e.__k[i]=b(C,{children:_},null,null,null):void 0===_.constructor&&_.__b>0?_=e.__k[i]=b(_.type,_.props,_.key,_.ref?_.ref:null,_.__v):e.__k[i]=_,l=i+f,_.__=e,_.__b=e.__b+1,u=null,-1!=(s=_.__i=I(_,n,l,c))&&(c--,(u=n[s])&&(u.__u|=2)),null==u||null==u.__v?(-1==s&&(o>a?f--:o<a&&f++),"function"!=typeof _.type&&(_.__u|=4)):s!=l&&(s==l-1?f--:s==l+1?f++:(s>l?f--:f++,_.__u|=4))):e.__k[i]=null;if(c)for(i=0;i<a;i++)null!=(u=n[i])&&!(2&u.__u)&&(u.__e==r&&(r=x(u)),z(u,u));return r}(n,t,k,l,w),c=0;c<w;c++)null!=(p=n.__k[c])&&(f=-1!=p.__i&&k[p.__i]||d,p.__i=c,y=A(e,p,f,o,i,_,u,l,s,a),h=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&W(f.ref,null,p),a.push(p.ref,p.__c||h,p)),null==v&&null!=h&&(v=h),4&p.__u?(l=P(p,l,e),f.__e&&(f.__e=null)):"function"==typeof p.type&&void 0!==y?l=y:h&&(l=h.nextSibling),p.__u&=-7);return n.__e=v,l}function P(e,t,n){var r,o;if("function"==typeof e.type){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=P(r[o],t,n));return t}e.__e!=t&&(t&&e.type&&!t.parentNode&&(t=x(e)),t=n.insertBefore(e.__e,t||null));do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function U(e,t){return t=t||[],null==e||"boolean"==typeof e||(g(e)?e.some(function(e){U(e,t)}):t.push(e)),t}function I(e,t,n,r){var o,i,_,u=e.key,l=e.type,s=t[n],a=null!=s&&!(2&s.__u);if(null===s&&null==u||a&&u==s.key&&l==s.type)return n;if(r>(a?1:0))for(o=n-1,i=n+1;o>=0||i<t.length;)if(null!=(s=t[_=o>=0?o--:i++])&&!(2&s.__u)&&u==s.key&&l==s.type)return _;return-1}function R(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||v.test(t)?n:n+"px"}function L(e,t,n,r,o){var i,_;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||R(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||R(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])i=t!=(t=t.replace(a,"$1")),_=t.toLowerCase(),t=_ in e||"onFocusOut"==t||"onFocusIn"==t?_.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n[s]=r[s]:(n[s]=c,e.addEventListener(t,i?p:f,i)):e.removeEventListener(t,i?p:f,i);else{if("http://www.w3.org/2000/svg"==o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function T(e){return function(n){if(this.l){var r=this.l[n.type+e];if(null==n[l])n[l]=c++;else if(n[l]<r[s])return;return r(t.event?t.event(n):n)}}}function A(e,n,r,o,i,_,u,l,s,a){var c,f,p,h,d,v,w,b,N,M,E,$,P,U,I,R,L=n.type;if(void 0!==n.constructor)return null;128&r.__u&&(s=!!(32&r.__u),_=[l=n.__e=r.__e]),(c=t.__b)&&c(n);e:if("function"==typeof L){f=u.length;try{if(N=n.props,M=L.prototype&&L.prototype.render,E=(c=L.contextType)&&o[c.__c],$=c?E?E.props.value:c.__:o,r.__c?b=(p=n.__c=r.__c).__=p.__E:(M?n.__c=p=new L(N,$):(n.__c=p=new S(N,$),p.constructor=L,p.render=j),E&&E.sub(p),p.state||(p.state={}),p.__n=o,h=p.__d=!0,p.__h=[],p._sb=[]),M&&null==p.__s&&(p.__s=p.state),M&&null!=L.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=y({},p.__s)),y(p.__s,L.getDerivedStateFromProps(N,p.__s))),d=p.props,v=p.state,p.__v=n,h)M&&null==L.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),M&&null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(M&&null==L.getDerivedStateFromProps&&N!==d&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(N,$),n.__v==r.__v||!p.__e&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(N,p.__s,$)){n.__v!=r.__v&&(p.props=N,p.state=p.__s,p.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(e){e&&(e.__=n)}),m.push.apply(p.__h,p._sb),p._sb=[],p.__h.length&&u.push(p),l=x(r);break e}null!=p.componentWillUpdate&&p.componentWillUpdate(N,p.__s,$),M&&null!=p.componentDidUpdate&&p.__h.push(function(){p.componentDidUpdate(d,v,w)})}if(p.context=$,p.props=N,p.__P=e,p.__e=!1,P=t.__r,U=0,M)p.state=p.__s,p.__d=!1,P&&P(n),c=p.render(p.props,p.state,p.context),m.push.apply(p.__h,p._sb),p._sb=[];else do{p.__d=!1,P&&P(n),c=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++U<25);p.state=p.__s,null!=p.getChildContext&&(o=y(y({},o),p.getChildContext())),M&&!h&&null!=p.getSnapshotBeforeUpdate&&(w=p.getSnapshotBeforeUpdate(d,v)),I=null!=c&&c.type===C&&null==c.key?D(c.props.children):c,l=H(e,g(I)?I:[I],n,r,o,i,_,u,l,s,a),p.base=n.__e,n.__u&=-161,p.__h.length&&u.push(p),b&&(p.__E=p.__=null)}catch(e){if(u.length=f,n.__v=null,s||null!=_){if(e.then){for(n.__u|=s?160:128;l&&8==l.nodeType&&l.nextSibling;)l=l.nextSibling;null!=_&&(_[_.indexOf(l)]=null),n.__e=l}else if(null!=_)for(R=_.length;R--;)k(_[R])}else n.__e=r.__e;null==n.__k&&(n.__k=r.__k||[]),e.then||V(n),t.__e(e,n,r)}}else null==_&&n.__v==r.__v?(n.__k=r.__k,n.__e=r.__e):l=n.__e=F(r.__e,n,r,o,i,_,u,s,a);return(c=t.diffed)&&c(n),128&n.__u?void 0:l}function V(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(V))}function O(e,n,r){for(var o=0;o<r.length;o++)W(r[o],r[++o],r[++o]);t.__c&&t.__c(n,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(e){e.call(n)})}catch(e){t.__e(e,n.__v)}})}function D(e){return"object"!=typeof e||null==e||e.__b>0?e:g(e)?e.map(D):void 0!==e.constructor?null:y({},e)}function F(n,r,o,i,_,u,l,s,a){var c,f,p,h,m,v,y,w=o.props||d,b=r.props,C=r.type;if("svg"==C?_="http://www.w3.org/2000/svg":"math"==C?_="http://www.w3.org/1998/Math/MathML":_||(_="http://www.w3.org/1999/xhtml"),null!=u)for(c=0;c<u.length;c++)if((m=u[c])&&"setAttribute"in m==!!C&&(C?m.localName==C:3==m.nodeType)){n=m,u[c]=null;break}if(null==n){if(null==C)return document.createTextNode(b);n=document.createElementNS(_,C,b.is&&b),s&&(t.__m&&t.__m(r,u),s=!1),u=null}if(null==C)w===b||s&&n.data==b||(n.data=b);else{if(u="textarea"==C&&null!=b.defaultValue?null:u&&e.call(n.childNodes),!s&&null!=u)for(w={},c=0;c<n.attributes.length;c++)w[(m=n.attributes[c]).name]=m.value;for(c in w)m=w[c],"dangerouslySetInnerHTML"==c?p=m:"children"==c||c in b||"value"==c&&"defaultValue"in b||"checked"==c&&"defaultChecked"in b||L(n,c,null,m,_);for(c in b)m=b[c],"children"==c?h=m:"dangerouslySetInnerHTML"==c?f=m:"value"==c?v=m:"checked"==c?y=m:s&&"function"!=typeof m||w[c]===m||L(n,c,m,w[c],_);if(f)s||p&&(f.__html==p.__html||f.__html==n.innerHTML)||(n.innerHTML=f.__html),r.__k=[];else if(p&&(n.innerHTML=""),H("template"==r.type?n.content:n,g(h)?h:[h],r,o,i,"foreignObject"==C?"http://www.w3.org/1999/xhtml":_,u,l,u?u[0]:o.__k&&x(o,0),s,a),null!=u)for(c=u.length;c--;)k(u[c]);s&&"textarea"!=C||(c="value","progress"==C&&null==v?n.removeAttribute("value"):null!=v&&(v!==n[c]||"progress"==C&&!v||"option"==C&&v!=w[c])&&L(n,c,v,w[c],_),c="checked",null!=y&&y!=n[c]&&L(n,c,y,w[c],_))}return n}function W(e,n,r){try{if("function"==typeof e){var o="function"==typeof e.__u;o&&e.__u(),o&&null==n||(e.__u=e(n))}else e.current=n}catch(e){t.__e(e,r)}}function z(e,n,r){var o,i;if(t.unmount&&t.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||W(o,null,n)),null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){t.__e(e,n)}o.base=o.__P=o.__n=null}if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&z(o[i],n,r||"function"!=typeof e.type);r||k(e.__e),e.__c=e.__=e.__e=void 0}function j(e,t,n){return this.constructor(e,n)}function q(n,r,o){var i,_,u,l;r==document&&(r=document.documentElement),t.__&&t.__(n,r),_=(i="function"==typeof o)?null:o&&o.__k||r.__k,u=[],l=[],A(r,n=(!i&&o||r).__k=w(C,null,[n]),_||d,d,r.namespaceURI,!i&&o?[o]:_?null:r.firstChild?e.call(r.childNodes):null,u,!i&&o?o:_?_.__e:r.firstChild,i,l),O(u,n,l),n.props.children=null}function B(e,t){q(e,t,B)}function Z(t,n,r){var o,i,_,u,l=y({},t.props);for(_ in t.type&&t.type.defaultProps&&(u=t.type.defaultProps),n)"key"==_?o=n[_]:"ref"==_?i=n[_]:l[_]=void 0===n[_]&&null!=u?u[_]:n[_];return arguments.length>2&&(l.children=arguments.length>3?e.call(arguments,2):r),b(t.type,l,o||t.key,i||t.ref,null)}e=m.slice,t={__e:function(e,t,n,r){for(var o,i,_;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),_=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),_=o.__d),_)return o.__E=o}catch(t){e=t}throw e}},n=0,S.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=y({},this.state),"function"==typeof e&&(e=e(y({},n),this.props)),e&&y(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),E(this))},S.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),E(this))},S.prototype.render=C,r=[],i="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,_=function(e,t){return e.__v.__b-t.__v.__b},$.__r=0,u=Math.random().toString(8),l="__d"+u,s="__a"+u,a=/(PointerCapture)$|Capture$/i,c=0,f=T(!1),p=T(!0),h=0;var J,Y,G,K,Q=0,X=[],ee=t,te=ee.__b,ne=ee.__r,re=ee.diffed,oe=ee.__c,ie=ee.unmount,_e=ee.__;function ue(e,t){ee.__h&&ee.__h(Y,e,Q||t),Q=0;var n=Y.__H||(Y.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function le(e){return Q=1,se(xe,e)}function se(e,t,n){var r=ue(J++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):xe(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=Y,!Y.__f)){var o=function(e,t,n){if(!r.__c.__H)return!0;var o=!1,_=r.__c.props!==e;if(r.__c.__H.__.some(function(e){if(e.__N){o=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(_=!0)}}),i){var u=i.call(this,e,t,n);return o?u||_:u}return!o||_};Y.__f=!0;var i=Y.shouldComponentUpdate,_=Y.componentWillUpdate;Y.componentWillUpdate=function(e,t,n){if(this.__e){var r=i;i=void 0,o(e,t,n),i=r}_&&_.call(this,e,t,n)},Y.shouldComponentUpdate=o}return r.__N||r.__}function ae(e,t){var n=ue(J++,3);!ee.__s&&Se(n.__H,t)&&(n.__=e,n.u=t,Y.__H.__h.push(n))}function ce(e,t){var n=ue(J++,4);!ee.__s&&Se(n.__H,t)&&(n.__=e,n.u=t,Y.__h.push(n))}function fe(e){return Q=5,he(function(){return{current:e}},[])}function pe(e,t,n){Q=6,ce(function(){if("function"==typeof e){var n=e(t());return function(){e(null),n&&"function"==typeof n&&n()}}if(e)return e.current=t(),function(){return e.current=null}},null==n?n:n.concat(e))}function he(e,t){var n=ue(J++,7);return Se(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function de(e,t){return Q=8,he(function(){return e},t)}function me(e){var t=Y.context[e.__c],n=ue(J++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(Y)),t.props.value):e.__}function ve(e,t){ee.useDebugValue&&ee.useDebugValue(t?t(e):e)}function ge(){var e=ue(J++,11);if(!e.__){for(var t=Y.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function ye(){for(var e;e=X.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(be),t.__h.some(Ce),t.__h=[]}catch(n){t.__h=[],ee.__e(n,e.__v)}}}ee.__b=function(e){Y=null,te&&te(e)},ee.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),_e&&_e(e,t)},ee.__r=function(e){ne&&ne(e),J=0;var t=(Y=e.__c).__H;t&&(G===Y?(t.__h=[],Y.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(be),t.__h.some(Ce),t.__h=[],J=0)),G=Y},ee.diffed=function(e){re&&re(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==X.push(t)&&K===ee.requestAnimationFrame||((K=ee.requestAnimationFrame)||we)(ye)),t.__H.__.some(function(e){e.u&&(e.__H=e.u,e.u=void 0)})),G=Y=null},ee.__c=function(e,t){t.some(function(e){try{e.__h.some(be),e.__h=e.__h.filter(function(e){return!e.__||Ce(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],ee.__e(n,e.__v)}}),oe&&oe(e,t)},ee.unmount=function(e){ie&&ie(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{be(e)}catch(e){t=e}}),n.__H=void 0,t&&ee.__e(t,n.__v))};var ke="function"==typeof requestAnimationFrame;function we(e){var t,n=function(){clearTimeout(r),ke&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);ke&&(t=requestAnimationFrame(n))}function be(e){var t=Y,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Y=t}function Ce(e){var t=Y;e.__c=e.__(),Y=t}function Se(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function xe(e,t){return"function"==typeof t?t(e):t}function Ne(e,t){for(var n in t)e[n]=t[n];return e}function Me(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function Ee(e,t){var n=t(),r=le({t:{__:n,u:t}}),o=r[0].t,i=r[1];return ce(function(){o.__=n,o.u=t,$e(o)&&i({t:o})},[e,n,t]),ae(function(){return $e(o)&&i({t:o}),e(function(){$e(o)&&i({t:o})})},[e]),n}function $e(e){try{return!((t=e.__)===(n=e.u())&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}var t,n}function He(e){e()}function Pe(e){return e}function Ue(){return[!1,He]}var Ie=ce;function Re(e,t){this.props=e,this.context=t}(Re.prototype=new S).isPureReactComponent=!0,Re.prototype.shouldComponentUpdate=function(e,t){return Me(this.props,e)||Me(this.state,t)};var Le=t.__b;t.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Le&&Le(e)};var Te="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var Ae=function(e,t){return null==e?null:U(U(e).map(t))},Ve={map:Ae,forEach:Ae,count:function(e){return e?U(e).length:0},only:function(e){var t=U(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:U},Oe=t.__e;t.__e=function(e,t,n,r){if(e.then)for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k||[]),o.__c(e,t);Oe(e,t,n,r)};var De=t.unmount;function Fe(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),e.__c.__H=null),null!=(e=Ne({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return Fe(e,t,n)})),e}function We(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return We(e,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function ze(){this.__u=0,this.o=null,this.__b=null}function je(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function qe(e){var t,n,r,o=null;function i(i){if(t||(t=e()).then(function(e){e&&(o=e.default||e),r=!0},function(e){n=e,r=!0}),n)throw n;if(!r)throw t;return o?w(o,i):null}return i.displayName="Lazy",i.__f=!0,i}function Be(){this.i=null,this.l=null}t.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),De&&De(e)},(ze.prototype=new S).__c=function(e,t){var n=t.__c,r=this;null==r.o&&(r.o=[]),r.o.push(n);var o=je(r.__v),i=!1,_=function(){i||r.__z||(i=!0,n.__R=null,o?o(l):l())};n.__R=_;var u=n.__P;n.__P=null;var l=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=We(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.__P=u,t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(_,_)},ze.prototype.componentWillUnmount=function(){this.o=[]},ze.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Fe(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&w(C,null,e.fallback);return o&&(o.__u&=-33),[w(C,null,t.__a?null:e.children),o]};var Ze=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};function Je(e){return this.getChildContext=function(){return e.context},e.children}function Ye(e){var t=this,n=e.h;if(t.componentWillUnmount=function(){q(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),!t.v){for(var r=t.__v;null!==r&&!r.__m&&null!==r.__;)r=r.__;t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],__k:{__m:r.__m},contains:function(){return!0},namespaceURI:n.namespaceURI,insertBefore:function(e,n){this.childNodes.push(e),t.h.insertBefore(e,n)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.h.removeChild(e)}}}q(w(Je,{context:t.context},e.__v),t.v)}(Be.prototype=new S).__a=function(e){var t=this,n=je(t.__v),r=t.l.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),Ze(t,e,r)):o()};n?n(i):i()}},Be.prototype.render=function(e){this.i=null,this.l=new Map;var t=U(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},Be.prototype.componentDidUpdate=Be.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){Ze(e,n,t)})};var Ge="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Ke=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Qe=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Xe=/[A-Z0-9]/g,et="undefined"!=typeof document,tt=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};function nt(e,t,n){return null==t.__k&&(t.textContent=""),q(e,t),"function"==typeof n&&n(),e?e.__c:null}S.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(S.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var rt=t.event;t.event=function(e){return rt&&(e=rt(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var ot,it={configurable:!0,get:function(){return this.class}},_t=t.vnode;t.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,r={},o=-1==n.indexOf("-");for(var i in t){var _=t[i];if(!("value"===i&&"defaultValue"in t&&null==_||et&&"children"===i&&"noscript"===n||"class"===i||"className"===i)){var u=i.toLowerCase();"defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===_?_="":"translate"===u&&"no"===_?_=!1:"o"===u[0]&&"n"===u[1]?"ondoubleclick"===u?i="ondblclick":"onchange"!==u||"input"!==n&&"textarea"!==n||tt(t.type)?"onfocus"===u?i="onfocusin":"onblur"===u?i="onfocusout":Qe.test(i)&&(i=u):u=i="oninput":o&&Ke.test(i)?i=i.replace(Xe,"-$&").toLowerCase():null===_&&(_=void 0),"oninput"===u&&r[i=u]&&(i="oninputCapture"),r[i]=_}}"select"==n&&(r.multiple&&Array.isArray(r.value)&&(r.value=U(t.children).forEach(function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)})),null!=r.defaultValue&&(r.value=U(t.children).forEach(function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,"className",it)):t.className&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=Ge,_t&&_t(e)};var ut=t.__r;t.__r=function(e){ut&&ut(e),ot=e.__c};var lt=t.diffed;t.diffed=function(e){lt&<(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),ot=null};var st={ReactCurrentDispatcher:{current:{readContext:function(e){return ot.__n[e.__c].props.value},useCallback:de,useContext:me,useDebugValue:ve,useDeferredValue:Pe,useEffect:ae,useId:ge,useImperativeHandle:pe,useInsertionEffect:Ie,useLayoutEffect:ce,useMemo:he,useReducer:se,useRef:fe,useState:le,useSyncExternalStore:Ee,useTransition:Ue}}};function at(e){return!!e&&e.$$typeof===Ge}function ct(e){return!!e.__k&&(q(null,e),!0)}var ft={useState:le,useId:ge,useReducer:se,useEffect:ae,useLayoutEffect:ce,useInsertionEffect:Ie,useTransition:Ue,useDeferredValue:Pe,useSyncExternalStore:Ee,startTransition:He,useRef:fe,useImperativeHandle:pe,useMemo:he,useCallback:de,useContext:me,useDebugValue:ve,version:"18.3.1",Children:Ve,render:nt,hydrate:function(e,t,n){return B(e,t),"function"==typeof n&&n(),e?e.__c:null},unmountComponentAtNode:ct,createPortal:function(e,t){var n=w(Ye,{__v:e,h:t});return n.containerInfo=t,n},createElement:w,createContext:function(e){function t(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__e=!0,E(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+h++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t},createFactory:function(e){return w.bind(null,e)},cloneElement:function(e){return at(e)?Z.apply(null,arguments):e},createRef:function(){return{current:null}},Fragment:C,isValidElement:at,isElement:at,isFragment:function(e){return at(e)&&e.type===C},isMemo:function(e){return!!e&&"string"==typeof e.displayName&&0==e.displayName.indexOf("Memo(")},findDOMNode:function(e){return e&&(e.base||1===e.nodeType&&e)||null},Component:S,PureComponent:Re,memo:function(e,t){function n(e){var n=this.props.ref;return n!=e.ref&&n&&("function"==typeof n?n(null):n.current=null),t?!t(this.props,e)||n!=e.ref:Me(this.props,e)}function r(t){return this.shouldComponentUpdate=n,w(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.__f=r.prototype.isReactComponent=!0,r.type=e,r},forwardRef:function(e){function t(t){var n=Ne({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=Te,t.render=e,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t},flushSync:function(e,n){var r,o=t.debounceRendering;t.debounceRendering=function(e){r=e};try{var i=e(n);return r&&r(),i}finally{t.debounceRendering=o}},unstable_batchedUpdates:function(e,t){return e(t)},StrictMode:C,Suspense:ze,SuspenseList:Be,lazy:qe,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:st};function pt(e){return{render:function(t){nt(t,e)},unmount:function(){ct(e)}}}const ht=e=>({size:t=24,color:n="currentColor",strokeWidth:r=2,...o})=>ft.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round",...o},e.map(([e,t],n)=>ft.createElement(e,{key:n,...t}))),dt=ht([["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]]),mt=ht([["path",{d:"M5 12h14"}]]),vt=ht([["path",{d:"m5 12 7-7 7 7"}],["path",{d:"M12 19V5"}]]),gt=ht([["path",{d:"M12 19v3"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3"}]]),yt=ht([["path",{d:"M15 3h6v6"}],["path",{d:"m21 3-7 7"}],["path",{d:"m3 21 7-7"}],["path",{d:"M9 21H3v-6"}]]),kt=ht([["path",{d:"m14 10 7-7"}],["path",{d:"M20 10h-6V4"}],["path",{d:"m3 21 7-7"}],["path",{d:"M4 14h6v6"}]]),wt=ht([["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551"}]]),bt=ht([["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9"}]]),Ct=ht([["path",{d:"m9 18 6-6-6-6"}]]),St=ht([["path",{d:"m15 18-6-6 6-6"}]]),xt=ht([["path",{d:"M12 7v14"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z"}]]),Nt=ht([["path",{d:"m6 9 6 6 6-6"}]]),Mt=ht([["path",{d:"M7 10v12"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z"}]]),Et=ht([["path",{d:"M17 14V2"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z"}]]),$t=ht([["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}]]),Ht=ht([["path",{d:"M20 6 9 17l-5-5"}]]),Pt=ht([["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .962 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.962 0z"}],["path",{d:"M20 3v4"}],["path",{d:"M22 5h-4"}]]),Ut=({size:e=22,className:t,style:n},r,o)=>ft.createElement("svg",{width:e,height:e,viewBox:r,fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:n},o),It=e=>Ut(e,"0 0 128 128",ft.createElement("g",{fill:"currentColor"},ft.createElement("path",{d:"M109,55c0-29.8-24.2-54-54-54C25.2,1,1,25.2,1,55s24.2,54,54,54c13.5,0,25.8-5,35.2-13.1l25.4,25.4l5.7-5.7L95.9,90.2C104,80.8,109,68.5,109,55z M55,101C29.6,101,9,80.4,9,55S29.6,9,55,9s46,20.6,46,46S80.4,101,55,101z"}),ft.createElement("path",{d:"M25.6,30.9l6.2,5.1C37.5,29,46,25,55,25v-8C43.6,17,32.9,22.1,25.6,30.9z"}),ft.createElement("path",{d:"M17,55h8c0-2.1,0.2-4.1,0.6-6.1l-7.8-1.6C17.3,49.8,17,52.4,17,55z"}))),Rt=e=>Ut(e,"0 0 24 24",ft.createElement("path",{fill:"currentColor",d:"M16 2H8C4 2 2 4 2 8V21C2 21.55 2.45 22 3 22H16C20 22 22 20 22 16V8C22 4 20 2 16 2ZM14 15.25H7C6.59 15.25 6.25 14.91 6.25 14.5C6.25 14.09 6.59 13.75 7 13.75H14C14.41 13.75 14.75 14.09 14.75 14.5C14.75 14.91 14.41 15.25 14 15.25ZM17 10.25H7C6.59 10.25 6.25 9.91 6.25 9.5C6.25 9.09 6.59 8.75 7 8.75H17C17.41 8.75 17.75 9.09 17.75 9.5C17.75 9.91 17.41 10.25 17 10.25Z"})),Lt=({size:e=26,className:t,style:n})=>ft.createElement("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:n},ft.createElement("g",{transform:"translate(24 0) scale(-1 1)"},ft.createElement("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M16 2H8C4 2 2 4 2 8V21C2 21.55 2.45 22 3 22H16C20 22 22 20 22 16V8C22 4 20 2 16 2ZM15.5 12.75H8.5C8.09 12.75 7.75 12.41 7.75 12C7.75 11.59 8.09 11.25 8.5 11.25H15.5C15.91 11.25 16.25 11.59 16.25 12C16.25 12.41 15.91 12.75 15.5 12.75Z"}))),Tt=e=>Ut(e,"0 0 24 24",ft.createElement(ft.Fragment,null,ft.createElement("path",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",d:"M12 20H12.01"}),ft.createElement("path",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",d:"M7 9C7 7.87439 7.37194 6.83566 7.99963 6C8.91184 4.78555 10.3642 4 12 4C14.7614 4 17 6.23858 17 9C17 11.4212 15.279 13.4405 12.9936 13.9013C12.4522 14.0104 12 14.4477 12 15V15V16"}))),At={};function Vt(e,t){return(At[e]=At[e]||[]).push(t),()=>Ot(e,t)}function Ot(e,t){const n=At[e];if(n)for(let e=n.length-1;e>=0;e--)n[e]!==t&&n[e].original!==t||n.splice(e,1)}function Dt(e,t){const n=r=>{Ot(e,n),t(r)};return n.original=t,Vt(e,n)}function Ft(e,...t){const n=At[e];if(n)for(const r of n.slice())try{r(t[0])}catch(t){console.error(`[Askly] "${e}" handler failed:`,t)}}let Wt=null,zt=[],jt=!1;function qt(){jt=!0}function Bt(e){Wt?Wt(e):jt?zt.push(e):console.warn(`[Askly] ${e.type}() ignored: the widget is not initialised on this page.`)}function Zt(e){Wt=e,jt=!1;const t=zt;return zt=[],t.forEach(e),()=>{Wt===e&&(Wt=null)}}function Jt(){zt=[],jt=!1}const Yt={ready:!1,open:!1,unread:0,visitorId:""};function Gt(){Yt.ready=!1,Yt.open=!1,Yt.unread=0,Yt.visitorId=""}function Kt(e){try{const t=window.localStorage.getItem(e),n=t?JSON.parse(t):[];return Array.isArray(n)?n:[]}catch{return[]}}function Qt(e,t){try{return void window.localStorage.setItem(e,JSON.stringify(t))}catch{}try{const n=t.filter(e=>e.messages.some(e=>"user"===e.role)).slice(0,30).map(e=>e.messages.length>200?{...e,messages:e.messages.slice(-200)}:e);window.localStorage.setItem(e,JSON.stringify(n))}catch{}}class Xt{constructor(e){this.options=e,this.token=null,this.supported=!0,this.userId=null,this.human=!1,this.pending=null,this.lastFailure=null}apply(e){e&&"string"==typeof e.session_token&&(this.token=e.session_token,this.userId=e.session_verified&&"string"==typeof e.session_user_id?e.session_user_id:null,this.human=!!e.session_human,this.options.onChange())}clear(){this.token=null,this.pending=null,this.userId=null,this.human=!1,this.options.onChange()}start(e){const t=this.options.getOrganizationId();if(!this.supported||!t)return Promise.resolve(null);if(this.pending)return this.pending;const n=this.options.getVisitorId();let r=null;return r=(async()=>{try{const r=await fetch(this.options.api("/session"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e?{organization_id:t,token:e}:{organization_id:t,visitor_id:n})});if(404===r.status||405===r.status)return this.supported=!1,null;if(!r.ok)return this.lastFailure=401===r.status?"rejected":"transient",null;this.lastFailure=null;const o=await r.json();return n!==this.options.getVisitorId()?null:(this.token&&this.token!==e||this.apply(o),this.token)}catch{return this.lastFailure="transient",null}finally{this.pending===r&&(this.pending=null)}})(),this.pending=r,r}async request(e,t={}){var n;const r=n=>fetch("function"==typeof e?e(!!n):e,{...t,headers:{...t.headers,...n?{Authorization:`Bearer ${n}`}:{}}}),o=null!==(n=this.token)&&void 0!==n?n:await this.start(),i=await r(o);if(401!==i.status||!o)return{res:i,token:o};let _=await this.start(o);if(!_||_===o){const e=this.token;if(e&&e!==o)_=e;else{if("rejected"!==this.lastFailure)return{res:i,token:o};this.clear(),_=await this.start()}}return{res:await r(_),token:_}}async fetch(e,t={}){return(await this.request(e,t)).res}}let en;function tn(){if(void 0===en){const e="undefined"!=typeof window?window.trustedTypes:void 0;if(en=null,e&&e.createPolicy)try{en=e.createPolicy("askly",{createHTML:e=>e,createScriptURL:e=>e})}catch{en=null}}return en}function nn(e){const t=tn();return t?t.createHTML(e):e}function rn(e){const t=tn();return t?t.createScriptURL(e):e}function on(e){return!1===e||"off"===e?"off":!0===e||"review"===e?"review":"auto-send"===e?"auto-send":void 0}function _n(e){switch(e){case"insecure":return"Voice input needs a secure (https) page.";case"unsupported":return"Voice input isn't supported in this browser.";case"denied":return"Microphone access is blocked. Allow it in your browser's site settings to use voice input.";case"no-microphone":return"No microphone was found.";case"no-speech":return"I didn't catch that. Please try again.";case"no-audio":return"No sound is coming from your microphone. Check that it isn't muted and that the right one is selected.";case"limit":return"Voice input isn't available right now. Please type your message.";case"disabled":return"Voice input is turned off.";case"network":return"Your recording couldn't be transcribed. Check your connection and try again.";default:return"Your recording couldn't be transcribed. Please try again or type your message."}}const un=3e3,ln=3;function sn(e,t,n){const r="Hi from {organizationName}. How can we help?";let o="string"==typeof e&&e.trim()?e:t?"Hi, I'm {ai_name} from {organizationName}. How can I help?":r;return t||-1===o.indexOf("{ai_name}")||(o=r),o.replace(/\{ai_name\}/g,()=>t||"").replace(/\{organizationName\}/g,()=>n).trim()}function an(e){try{return"1"===window.sessionStorage.getItem(`askly_greeting_dismissed_${e}`)}catch{return!1}}function cn(e){try{window.sessionStorage.setItem(`askly_greeting_dismissed_${e}`,"1")}catch{}}function fn(e){Ft("shown"===e?"greeting:shown":"clicked"===e?"greeting:clicked":"greeting:dismissed");try{window.dispatchEvent(new Event(`askly:greeting:${e}`))}catch{}}const pn={headings:!1,blockquotes:!1,images:!1},hn={headings:!0,blockquotes:!0,images:!0};function dn(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function mn(e){const t=e.trim();return/^(https?:\/\/|mailto:|tel:)/i.test(t)&&!/[\s\0-]/.test(t)}function vn(e,t){return`<a href="${dn(e.trim())}" target="_blank" rel="noopener noreferrer" class="message-inline-link">${t}</a>`}class gn{constructor(){this.items=[]}put(e){return this.items.push(e),`${this.items.length-1}`}restore(e){return e.replace(/(\d+)/g,(e,t)=>this.items[Number(t)])}}const yn=/`([^`\n]+)`/g,kn=/!\[([^\]\n]*)\]\(((?:[^()\s]|\([^()\s]*\))+)\)/g,wn=/\[([^\]\n]+)\]\(((?:[^()\s]|\([^()\s]*\))+)\)/g,bn=/(^|[^\w"'=/\]\(])(https?:\/\/[^\s<>()]*[^\s<>().,;:!?'"])/g,Cn=/\*\*(?=\S)([\s\S]*?\S)\*\*/g,Sn=/(^|[^\w*])\*(?=\S)([^*\n]*?\S)\*(?![\w*])/g,xn=/(^|[^\w_])_(?=\S)([^_\n]*?\S)_(?![\w_])/g;function Nn(e,t){const n=new gn;let r=e;return t.emphasis&&(r=r.replace(yn,(e,t)=>n.put(`<code class="inline-code">${dn(t)}</code>`))),t.images?r=r.replace(kn,(e,t,r)=>function(e){const t=e.trim();return/^https:\/\//i.test(t)&&!/[\s\0-]/.test(t)}(r)?n.put(`<img src="${dn(r.trim())}" alt="${dn(t)}" class="message-inline-image" />`):n.put(dn(t))):t.links&&(r=r.replace(kn,(e,t,r)=>n.put(mn(r)?vn(r,dn(t||r)):dn(t||r)))),t.links&&(r=r.replace(wn,(e,t,r)=>n.put(mn(r)?vn(r,dn(t)):dn(t)))),r=r.replace(bn,(e,t,r)=>t+n.put(vn(r,dn(r)))),r=dn(r),t.emphasis&&(r=r.replace(Cn,"<strong>$1</strong>"),r=r.replace(Sn,"$1<em>$2</em>"),r=r.replace(xn,"$1<em>$2</em>")),r=r.replace(/\n/g,"<br />"),n.restore(r)}const Mn=/^\s{0,3}```\s*([\w+-]*)\s*$/,En=/^\s{0,3}```\s*$/,$n=/^\s{0,3}(#{1,3})\s+(.+?)\s*#*\s*$/,Hn=/^\s{0,3}>\s?(.*)$/,Pn=/^\s*([-*+]|\d{1,3}[.)])\s+(.*)$/,Un=/^\s{2,}\S/;function In(e,t){const n={emphasis:!0,links:!0,images:t.images},r=e.replace(/\r\n?/g,"\n").split("\n"),o=[];let i=0;const _=e=>Mn.test(e)||Pn.test(e)||t.headings&&$n.test(e)||t.blockquotes&&Hn.test(e);for(;i<r.length;){const e=r[i];if(""===e.trim()){i++;continue}const u=e.match(Mn);if(u){const e=u[1],t=[];for(i++;i<r.length&&!En.test(r[i]);)t.push(r[i]),i++;for(i++;t.length&&""===t[t.length-1].trim();)t.pop();const n=e?` class="language-${e}"`:"";o.push(`<pre><code${n}>${dn(t.join("\n"))}</code></pre>`);continue}if(t.headings){const t=e.match($n);if(t){const e=t[1].length;o.push(`<h${e}>${Nn(t[2],n)}</h${e}>`),i++;continue}}if(t.blockquotes&&Hn.test(e)){const e=[];for(;i<r.length;){const t=r[i].match(Hn);if(!t)break;e.push(t[1]),i++}o.push(`<blockquote><p>${Nn(e.join("\n"),n)}</p></blockquote>`);continue}const l=e.match(Pn);if(l){const e=/\d/.test(l[1]),t=e?parseInt(l[1],10):1,_=[];for(;i<r.length;){const e=r[i].match(Pn);if(e)_.push(e[2]),i++;else{if(!_.length||!Un.test(r[i]))break;_[_.length-1]+=" "+r[i].trim(),i++}}const u=e?"ol":"ul",s=e&&1!==t?` start="${t}"`:"";o.push(`<${u}${s}>${_.map(e=>`<li>${Nn(e,n)}</li>`).join("")}</${u}>`);continue}const s=[e];for(i++;i<r.length&&""!==r[i].trim()&&!_(r[i]);)s.push(r[i]),i++;o.push(`<p>${Nn(s.join("\n"),n)}</p>`)}return o.join("")}function Rn(e){return e?In(e,pn):""}function Ln(e){return e?In(e,hn):""}function Tn(e){return e?Nn(e,{emphasis:!1,links:!1,images:!1}):""}function An(e){return e?e.replace(/```[\s\S]*?```/g," [Code] ").replace(/!\[[^\]]*\]\([^)]*\)/g,"[Image]").replace(/\[[^\]]*\]\([^)]*\)/g,"[Link]").replace(/`([^`]*)`/g,"$1").replace(/\*\*([^*]*)\*\*/g,"$1").replace(/(^|[^\w*])\*([^*\n]+)\*(?![\w*])/g,"$1$2").replace(/(^|[^\w_])_([^_\n]+)_(?![\w_])/g,"$1$2").replace(/^\s{0,3}#{1,6}\s+/gm,"").replace(/^\s*(?:[-*+]|\d{1,3}[.)])\s+/gm,"").replace(/^\s{0,3}>\s?/gm,"").replace(/\s+/g," ").trim():""}function Vn(e){if(!e)return"";try{const t=new Date(e);return isNaN(t.getTime())?"":t.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"})}catch(e){return""}}export{Jt as $,vt as A,xt as B,Ct as C,fn as D,cn as E,Ft as F,ln as G,rn as H,on as I,Zt as J,Yt as K,Lt as L,gt as M,Gt as N,_n as O,wt as P,un as Q,Bt as R,bt as S,Rt as T,Dt as U,Ot as V,Xt as W,dt as X,Vt as Y,pt as Z,ce as _,Nt as a,qt as a0,Ln as a1,Pt as a2,It as b,Tt as c,ze as d,mt as e,Vn as f,ft as g,kt as h,yt as i,St as j,Mt as k,Et as l,Ht as m,$t as n,Tn as o,le as p,ae as q,Rn as r,An as s,nn as t,fe as u,Kt as v,Qt as w,sn as x,an as y,qe as z};
|