@uipath/ui-widgets-conversational-agent-chat 1.0.2 → 1.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.
- package/README.md +63 -6
- package/dist/ConversationalAgentChat.css +18184 -7
- package/dist/ConversationalAgentChat.d.ts +1 -1
- package/dist/ConversationalAgentChat.d.ts.map +1 -1
- package/dist/ConversationalAgentChat.js +617 -139
- package/dist/ConversationalAgentChat.js.map +1 -1
- package/dist/ConversationalAgentChat.stories.d.ts +14 -1
- package/dist/ConversationalAgentChat.stories.d.ts.map +1 -1
- package/dist/ConversationalAgentChat.stories.js +5 -12
- package/dist/ConversationalAgentChat.stories.js.map +1 -1
- package/dist/ConversationalAgentPickerChat.d.ts +4 -0
- package/dist/ConversationalAgentPickerChat.d.ts.map +1 -0
- package/dist/ConversationalAgentPickerChat.js +113 -0
- package/dist/ConversationalAgentPickerChat.js.map +1 -0
- package/dist/ConversationalAgentPickerChat.stories.d.ts +96 -0
- package/dist/ConversationalAgentPickerChat.stories.d.ts.map +1 -0
- package/dist/ConversationalAgentPickerChat.stories.js +209 -0
- package/dist/ConversationalAgentPickerChat.stories.js.map +1 -0
- package/dist/components/AgentList.d.ts +10 -0
- package/dist/components/AgentList.d.ts.map +1 -0
- package/dist/components/AgentList.js +20 -0
- package/dist/components/AgentList.js.map +1 -0
- package/dist/components/AgentSchemaForm/AgentSchemaField.d.ts +26 -0
- package/dist/components/AgentSchemaForm/AgentSchemaField.d.ts.map +1 -0
- package/dist/components/AgentSchemaForm/AgentSchemaField.js +96 -0
- package/dist/components/AgentSchemaForm/AgentSchemaField.js.map +1 -0
- package/dist/components/AgentSchemaForm/AgentSchemaForm.d.ts +38 -0
- package/dist/components/AgentSchemaForm/AgentSchemaForm.d.ts.map +1 -0
- package/dist/components/AgentSchemaForm/AgentSchemaForm.js +105 -0
- package/dist/components/AgentSchemaForm/AgentSchemaForm.js.map +1 -0
- package/dist/components/AgentSchemaForm/AgentSchemaForm.stories.d.ts +30 -0
- package/dist/components/AgentSchemaForm/AgentSchemaForm.stories.d.ts.map +1 -0
- package/dist/components/AgentSchemaForm/AgentSchemaForm.stories.js +236 -0
- package/dist/components/AgentSchemaForm/AgentSchemaForm.stories.js.map +1 -0
- package/dist/components/AgentSchemaForm/FieldShell.d.ts +12 -0
- package/dist/components/AgentSchemaForm/FieldShell.d.ts.map +1 -0
- package/dist/components/AgentSchemaForm/FieldShell.js +4 -0
- package/dist/components/AgentSchemaForm/FieldShell.js.map +1 -0
- package/dist/components/AgentSchemaForm/index.d.ts +5 -0
- package/dist/components/AgentSchemaForm/index.d.ts.map +1 -0
- package/dist/components/AgentSchemaForm/index.js +2 -0
- package/dist/components/AgentSchemaForm/index.js.map +1 -0
- package/dist/components/AgentSchemaForm/inputs/ArrayField.d.ts +7 -0
- package/dist/components/AgentSchemaForm/inputs/ArrayField.d.ts.map +1 -0
- package/dist/components/AgentSchemaForm/inputs/ArrayField.js +28 -0
- package/dist/components/AgentSchemaForm/inputs/ArrayField.js.map +1 -0
- package/dist/components/AgentSchemaForm/inputs/ObjectField.d.ts +8 -0
- package/dist/components/AgentSchemaForm/inputs/ObjectField.d.ts.map +1 -0
- package/dist/components/AgentSchemaForm/inputs/ObjectField.js +75 -0
- package/dist/components/AgentSchemaForm/inputs/ObjectField.js.map +1 -0
- package/dist/components/AgentSchemaForm/inputs/validation.d.ts +10 -0
- package/dist/components/AgentSchemaForm/inputs/validation.d.ts.map +1 -0
- package/dist/components/AgentSchemaForm/inputs/validation.js +41 -0
- package/dist/components/AgentSchemaForm/inputs/validation.js.map +1 -0
- package/dist/components/AgentSchemaForm/resolveSchema.d.ts +7 -0
- package/dist/components/AgentSchemaForm/resolveSchema.d.ts.map +1 -0
- package/dist/components/AgentSchemaForm/resolveSchema.js +162 -0
- package/dist/components/AgentSchemaForm/resolveSchema.js.map +1 -0
- package/dist/components/AgentSchemaForm/types.d.ts +34 -0
- package/dist/components/AgentSchemaForm/types.d.ts.map +1 -0
- package/dist/components/AgentSchemaForm/types.js +8 -0
- package/dist/components/AgentSchemaForm/types.js.map +1 -0
- package/dist/components/FeedbackDialog.d.ts +2 -1
- package/dist/components/FeedbackDialog.d.ts.map +1 -1
- package/dist/components/FeedbackDialog.js +6 -2
- package/dist/components/FeedbackDialog.js.map +1 -1
- package/dist/components/InputsPage.d.ts +18 -0
- package/dist/components/InputsPage.d.ts.map +1 -0
- package/dist/components/InputsPage.js +32 -0
- package/dist/components/InputsPage.js.map +1 -0
- package/dist/components/Loader.d.ts +6 -0
- package/dist/components/Loader.d.ts.map +1 -0
- package/dist/components/Loader.js +6 -0
- package/dist/components/Loader.js.map +1 -0
- package/dist/components/SettingsDialog/InputsSection.d.ts +15 -0
- package/dist/components/SettingsDialog/InputsSection.d.ts.map +1 -0
- package/dist/components/SettingsDialog/InputsSection.js +29 -0
- package/dist/components/SettingsDialog/InputsSection.js.map +1 -0
- package/dist/components/SettingsDialog/ProfileSection.d.ts +7 -0
- package/dist/components/SettingsDialog/ProfileSection.d.ts.map +1 -0
- package/dist/components/SettingsDialog/ProfileSection.js +146 -0
- package/dist/components/SettingsDialog/ProfileSection.js.map +1 -0
- package/dist/components/SettingsDialog/SettingsDialog.d.ts +33 -0
- package/dist/components/SettingsDialog/SettingsDialog.d.ts.map +1 -0
- package/dist/components/SettingsDialog/SettingsDialog.js +18 -0
- package/dist/components/SettingsDialog/SettingsDialog.js.map +1 -0
- package/dist/components/SettingsDialog/index.d.ts +3 -0
- package/dist/components/SettingsDialog/index.d.ts.map +1 -0
- package/dist/components/SettingsDialog/index.js +2 -0
- package/dist/components/SettingsDialog/index.js.map +1 -0
- package/dist/components/ToolConfirmation.d.ts +20 -0
- package/dist/components/ToolConfirmation.d.ts.map +1 -0
- package/dist/components/ToolConfirmation.js +20 -0
- package/dist/components/ToolConfirmation.js.map +1 -0
- package/dist/components/ToolConfirmationRenderer.d.ts +15 -0
- package/dist/components/ToolConfirmationRenderer.d.ts.map +1 -0
- package/dist/components/ToolConfirmationRenderer.js +52 -0
- package/dist/components/ToolConfirmationRenderer.js.map +1 -0
- package/dist/components/agentUtils.d.ts +4 -0
- package/dist/components/agentUtils.d.ts.map +1 -0
- package/dist/components/agentUtils.js +24 -0
- package/dist/components/agentUtils.js.map +1 -0
- package/dist/components/useFavorites.d.ts +7 -0
- package/dist/components/useFavorites.d.ts.map +1 -0
- package/dist/components/useFavorites.js +47 -0
- package/dist/components/useFavorites.js.map +1 -0
- package/dist/constants/countries.d.ts +251 -0
- package/dist/constants/countries.d.ts.map +1 -0
- package/dist/constants/countries.js +250 -0
- package/dist/constants/countries.js.map +1 -0
- package/dist/hooks/useResolvedAgent.d.ts +34 -0
- package/dist/hooks/useResolvedAgent.d.ts.map +1 -0
- package/dist/hooks/useResolvedAgent.js +99 -0
- package/dist/hooks/useResolvedAgent.js.map +1 -0
- package/dist/i18n/i18n.config.d.ts +2 -0
- package/dist/i18n/i18n.config.d.ts.map +1 -0
- package/dist/i18n/i18n.config.js +24 -0
- package/dist/i18n/i18n.config.js.map +1 -0
- package/dist/i18n/index.d.ts +2 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +2 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/locales/en/index.json +306 -0
- package/dist/i18n/locales/keys/index.json +306 -0
- package/dist/icons/ConversationalAgentIcon.d.ts +7 -0
- package/dist/icons/ConversationalAgentIcon.d.ts.map +1 -0
- package/dist/icons/ConversationalAgentIcon.js +8 -0
- package/dist/icons/ConversationalAgentIcon.js.map +1 -0
- package/dist/icons/TimeIcon.d.ts +2 -0
- package/dist/icons/TimeIcon.d.ts.map +1 -0
- package/dist/icons/TimeIcon.js +3 -0
- package/dist/icons/TimeIcon.js.map +1 -0
- package/dist/index.d.ts +10 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +90 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -1
- package/dist/utils/normalizeValue.d.ts +7 -0
- package/dist/utils/normalizeValue.d.ts.map +1 -0
- package/dist/utils/normalizeValue.js +31 -0
- package/dist/utils/normalizeValue.js.map +1 -0
- package/dist/utils/resolveAgent.d.ts +17 -0
- package/dist/utils/resolveAgent.d.ts.map +1 -0
- package/dist/utils/resolveAgent.js +25 -0
- package/dist/utils/resolveAgent.js.map +1 -0
- package/dist/utils/telemetryUtils.d.ts +1 -1
- package/dist/utils/telemetryUtils.d.ts.map +1 -1
- package/dist/utils/telemetryUtils.js +2 -2
- package/dist/utils/telemetryUtils.js.map +1 -1
- package/dist/utils.d.ts +11 -3
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +36 -9
- package/dist/utils.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +10 -5
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ConversationalAgent } from "@uipath/uipath-typescript/conversational-agent";
|
|
2
|
+
import type { InputSchema } from "../AgentSchemaForm/types";
|
|
3
|
+
export interface SettingsDialogProps {
|
|
4
|
+
conversationalAgent: ConversationalAgent;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
/**
|
|
7
|
+
* Used as React `key` on `ProfileSection` so form/load state reset when the
|
|
8
|
+
* user switches agent (or folder) without relying on `ConversationalAgent` reference.
|
|
9
|
+
*/
|
|
10
|
+
profileResetKey: string;
|
|
11
|
+
/**
|
|
12
|
+
* Agent's input schema. When present (and non-empty), an `Inputs` section
|
|
13
|
+
* appears alongside profile so users can edit/re-apply agent inputs on the
|
|
14
|
+
* active conversation.
|
|
15
|
+
*/
|
|
16
|
+
inputSchema?: InputSchema | null;
|
|
17
|
+
/** Last-applied agent inputs, used to pre-populate the inputs form. */
|
|
18
|
+
initialInputs?: Record<string, unknown>;
|
|
19
|
+
/** Persists agent inputs against the current conversation. */
|
|
20
|
+
onApplyInputs?: (values: Record<string, unknown>) => Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* `key` for `InputsSection` so its form state resets on agent or
|
|
23
|
+
* conversation switch.
|
|
24
|
+
*/
|
|
25
|
+
inputsResetKey?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Settings content rendered inline into Apollo's settings panel via
|
|
29
|
+
* `AutopilotChatService`'s `settingsRenderer` config. Apollo owns the panel
|
|
30
|
+
* chrome (header, back/close, backdrop); this component just fills the body.
|
|
31
|
+
*/
|
|
32
|
+
export declare const SettingsDialog: ({ conversationalAgent, onClose, profileResetKey, inputSchema, initialInputs, onApplyInputs, inputsResetKey, }: SettingsDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
//# sourceMappingURL=SettingsDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsDialog.d.ts","sourceRoot":"","sources":["../../../src/components/SettingsDialog/SettingsDialog.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AAE1F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAI5D,MAAM,WAAW,mBAAmB;IAClC,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;;OAGG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACjC,uEAAuE;IACvE,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,8DAA8D;IAC9D,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnE;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,+GAQ5B,mBAAmB,4CAkDrB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger, } from "@uipath/apollo-wind";
|
|
3
|
+
import { useTranslation } from "react-i18next";
|
|
4
|
+
import { InputsSection } from "./InputsSection";
|
|
5
|
+
import { ProfileSection } from "./ProfileSection";
|
|
6
|
+
/**
|
|
7
|
+
* Settings content rendered inline into Apollo's settings panel via
|
|
8
|
+
* `AutopilotChatService`'s `settingsRenderer` config. Apollo owns the panel
|
|
9
|
+
* chrome (header, back/close, backdrop); this component just fills the body.
|
|
10
|
+
*/
|
|
11
|
+
export const SettingsDialog = ({ conversationalAgent, onClose, profileResetKey, inputSchema, initialInputs, onApplyInputs, inputsResetKey, }) => {
|
|
12
|
+
const { t } = useTranslation();
|
|
13
|
+
const showInputs = inputSchema != null &&
|
|
14
|
+
onApplyInputs != null &&
|
|
15
|
+
Object.keys(inputSchema.properties ?? {}).length > 0;
|
|
16
|
+
return (_jsx("div", { className: "p-4", children: _jsxs(Accordion, { type: "multiple", defaultValue: [], className: "flex flex-col gap-2", children: [showInputs && (_jsxs(AccordionItem, { value: "inputs", className: "rounded-md border-b-0 bg-accent", children: [_jsx(AccordionTrigger, { className: "px-4 hover:no-underline", children: t("agent_inputs_title") }), _jsx(AccordionContent, { className: "px-4", children: _jsx(InputsSection, { inputSchema: inputSchema, initialValues: initialInputs, onApplyInputs: onApplyInputs, onApplied: onClose }, inputsResetKey) })] })), _jsxs(AccordionItem, { value: "profile", className: "rounded-md border-b-0 bg-accent", children: [_jsx(AccordionTrigger, { className: "px-4 hover:no-underline", children: t("profile_information_title") }), _jsx(AccordionContent, { className: "px-4", children: _jsx(ProfileSection, { conversationalAgent: conversationalAgent, onSaved: onClose }, profileResetKey) })] })] }) }));
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=SettingsDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsDialog.js","sourceRoot":"","sources":["../../../src/components/SettingsDialog/SettingsDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AA2BlD;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAC7B,mBAAmB,EACnB,OAAO,EACP,eAAe,EACf,WAAW,EACX,aAAa,EACb,aAAa,EACb,cAAc,GACM,EAAE,EAAE;IACxB,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAC;IAC/B,MAAM,UAAU,GACd,WAAW,IAAI,IAAI;QACnB,aAAa,IAAI,IAAI;QACrB,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IACvD,OAAO,CACL,cAAK,SAAS,EAAC,KAAK,YAClB,MAAC,SAAS,IACR,IAAI,EAAC,UAAU,EACf,YAAY,EAAE,EAAE,EAChB,SAAS,EAAC,qBAAqB,aAE9B,UAAU,IAAI,CACb,MAAC,aAAa,IACZ,KAAK,EAAC,QAAQ,EACd,SAAS,EAAC,iCAAiC,aAE3C,KAAC,gBAAgB,IAAC,SAAS,EAAC,yBAAyB,YAClD,CAAC,CAAC,oBAAoB,CAAC,GACP,EACnB,KAAC,gBAAgB,IAAC,SAAS,EAAC,MAAM,YAChC,KAAC,aAAa,IAEZ,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,OAAO,IAJb,cAAc,CAKnB,GACe,IACL,CACjB,EACD,MAAC,aAAa,IACZ,KAAK,EAAC,SAAS,EACf,SAAS,EAAC,iCAAiC,aAE3C,KAAC,gBAAgB,IAAC,SAAS,EAAC,yBAAyB,YAClD,CAAC,CAAC,2BAA2B,CAAC,GACd,EACnB,KAAC,gBAAgB,IAAC,SAAS,EAAC,MAAM,YAChC,KAAC,cAAc,IAEb,mBAAmB,EAAE,mBAAmB,EACxC,OAAO,EAAE,OAAO,IAFX,eAAe,CAGpB,GACe,IACL,IACN,GACR,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SettingsDialog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/SettingsDialog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ToolCallConfirmationValue } from "@uipath/uipath-typescript/conversational-agent";
|
|
2
|
+
/** Strings for tool confirmation UI; pass from the chat root so parallel React roots stay in sync with locale. */
|
|
3
|
+
export interface ToolConfirmationLabels {
|
|
4
|
+
cancel: string;
|
|
5
|
+
confirm: string;
|
|
6
|
+
statusCancelled: string;
|
|
7
|
+
statusConfirmed: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ToolConfirmationProps {
|
|
10
|
+
confirmationData: ToolCallConfirmationValue;
|
|
11
|
+
isCompleted: boolean;
|
|
12
|
+
wasRejected?: boolean;
|
|
13
|
+
labels: ToolConfirmationLabels;
|
|
14
|
+
onApprove: (endValue: {
|
|
15
|
+
input?: unknown;
|
|
16
|
+
}) => void;
|
|
17
|
+
onCancel: () => void;
|
|
18
|
+
}
|
|
19
|
+
export declare function ToolConfirmation({ confirmationData, isCompleted, wasRejected, labels, onApprove, onCancel, }: ToolConfirmationProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
//# sourceMappingURL=ToolConfirmation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolConfirmation.d.ts","sourceRoot":"","sources":["../../src/components/ToolConfirmation.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gDAAgD,CAAC;AAQhG,kHAAkH;AAClH,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,qBAAqB;IACpC,gBAAgB,EAAE,yBAAyB,CAAC;IAC5C,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,EAAE,sBAAsB,CAAC;IAC/B,SAAS,EAAE,CAAC,QAAQ,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IACnD,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,MAAM,EACN,SAAS,EACT,QAAQ,GACT,EAAE,qBAAqB,2CAiEvB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useState } from "react";
|
|
3
|
+
import { Button, cn } from "@uipath/apollo-wind";
|
|
4
|
+
import { AgentSchemaForm, } from "./AgentSchemaForm/AgentSchemaForm";
|
|
5
|
+
import { normalizeValue } from "../utils/normalizeValue";
|
|
6
|
+
export function ToolConfirmation({ confirmationData, isCompleted, wasRejected, labels, onApprove, onCancel, }) {
|
|
7
|
+
const formRef = useRef(null);
|
|
8
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
9
|
+
if (isCompleted) {
|
|
10
|
+
return (_jsxs("div", { className: "my-3 flex flex-col gap-2 rounded-lg border border-border bg-background p-4", children: [_jsx("span", { className: "text-sm font-semibold", children: confirmationData.toolName }), _jsx("span", { className: cn("text-[13px] italic", wasRejected ? "text-destructive" : "text-success-text"), children: wasRejected ? labels.statusCancelled : labels.statusConfirmed })] }));
|
|
11
|
+
}
|
|
12
|
+
return (_jsxs("div", { className: "my-3 flex flex-col gap-3 rounded-lg border border-border bg-background p-4", children: [_jsx("span", { className: "border-b border-border pb-3 text-sm font-semibold", children: confirmationData.toolName }), _jsx(AgentSchemaForm, { inputSchema: confirmationData.inputSchema, initialValues: normalizeValue(confirmationData.inputValue ?? {}), disabled: isSubmitting, formRef: formRef, collapsibleOptional: true, onSubmit: async (data) => {
|
|
13
|
+
setIsSubmitting(true);
|
|
14
|
+
onApprove({ input: data });
|
|
15
|
+
} }), _jsxs("div", { className: "mt-1 flex justify-end gap-2", children: [_jsx(Button, { type: "button", variant: "outline", disabled: isSubmitting, onClick: () => {
|
|
16
|
+
setIsSubmitting(true);
|
|
17
|
+
onCancel();
|
|
18
|
+
}, children: labels.cancel }), _jsx(Button, { type: "button", disabled: isSubmitting, onClick: () => formRef.current?.submit(), children: labels.confirm })] })] }));
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=ToolConfirmation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolConfirmation.js","sourceRoot":"","sources":["../../src/components/ToolConfirmation.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EACL,eAAe,GAEhB,MAAM,mCAAmC,CAAC;AAE3C,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,EAAE,YAAY,EACtB,OAAO,EAAE,GAAG,EAAE;4BACZ,eAAe,CAAC,IAAI,CAAC,CAAC;4BACtB,QAAQ,EAAE,CAAC;wBACb,CAAC,YAEA,MAAM,CAAC,MAAM,GACP,EACT,KAAC,MAAM,IACL,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,YAEvC,MAAM,CAAC,OAAO,GACR,IACL,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AutopilotChatMessage } from "@uipath/apollo-react/material/components";
|
|
2
|
+
import { type ToolConfirmationLabels } from "./ToolConfirmation";
|
|
3
|
+
/** Resolves labels for a separate React root (tool confirmation widget). Prefer passing overrides from the chat component where `useTranslation` runs. */
|
|
4
|
+
export declare function resolveToolConfirmationLabels(overrides?: Partial<ToolConfirmationLabels>): ToolConfirmationLabels;
|
|
5
|
+
export interface ToolConfirmationRenderer {
|
|
6
|
+
render(container: HTMLElement, message: AutopilotChatMessage, labelOverrides?: Partial<ToolConfirmationLabels>): void;
|
|
7
|
+
unmountAll(): void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Creates a per-instance renderer for tool confirmation widgets. Each
|
|
11
|
+
* `<ConversationalAgentChat>` instance owns its own renderer so that
|
|
12
|
+
* unmounting one instance never tears down another's React roots.
|
|
13
|
+
*/
|
|
14
|
+
export declare function createToolConfirmationRenderer(): ToolConfirmationRenderer;
|
|
15
|
+
//# sourceMappingURL=ToolConfirmationRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolConfirmationRenderer.d.ts","sourceRoot":"","sources":["../../src/components/ToolConfirmationRenderer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAGrF,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,oBAAoB,CAAC;AAM5B,0JAA0J;AAC1J,wBAAgB,6BAA6B,CAC3C,SAAS,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,GAC1C,sBAAsB,CAWxB;AAED,MAAM,WAAW,wBAAwB;IACvC,MAAM,CACJ,SAAS,EAAE,WAAW,EACtB,OAAO,EAAE,oBAAoB,EAC7B,cAAc,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,GAC/C,IAAI,CAAC;IACR,UAAU,IAAI,IAAI,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,IAAI,wBAAwB,CAsCzE"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createRoot } from "react-dom/client";
|
|
3
|
+
import i18next from "i18next";
|
|
4
|
+
import { initI18n } from "../i18n";
|
|
5
|
+
import { ToolConfirmation, } from "./ToolConfirmation";
|
|
6
|
+
// Ensure i18next is initialized when this module is imported directly (i.e.
|
|
7
|
+
// without first importing ConversationalAgentChat). Idempotent.
|
|
8
|
+
initI18n();
|
|
9
|
+
/** Resolves labels for a separate React root (tool confirmation widget). Prefer passing overrides from the chat component where `useTranslation` runs. */
|
|
10
|
+
export function resolveToolConfirmationLabels(overrides) {
|
|
11
|
+
return {
|
|
12
|
+
cancel: overrides?.cancel ?? i18next.t("cancel"),
|
|
13
|
+
confirm: overrides?.confirm ?? i18next.t("tool_confirmation_confirm"),
|
|
14
|
+
statusCancelled: overrides?.statusCancelled ??
|
|
15
|
+
i18next.t("tool_confirmation_status_cancelled"),
|
|
16
|
+
statusConfirmed: overrides?.statusConfirmed ??
|
|
17
|
+
i18next.t("tool_confirmation_status_confirmed"),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Creates a per-instance renderer for tool confirmation widgets. Each
|
|
22
|
+
* `<ConversationalAgentChat>` instance owns its own renderer so that
|
|
23
|
+
* unmounting one instance never tears down another's React roots.
|
|
24
|
+
*/
|
|
25
|
+
export function createToolConfirmationRenderer() {
|
|
26
|
+
// Tracks every React root we create for tool-confirmation rendering so the
|
|
27
|
+
// widget can unmount them on its own teardown. Without this, React keeps
|
|
28
|
+
// internal state for each container until GC and may warn about reusing a
|
|
29
|
+
// container with a new tree.
|
|
30
|
+
const roots = new Map();
|
|
31
|
+
return {
|
|
32
|
+
render(container, message, labelOverrides) {
|
|
33
|
+
const meta = message.meta;
|
|
34
|
+
if (!meta?.confirmationData)
|
|
35
|
+
return;
|
|
36
|
+
let root = roots.get(container);
|
|
37
|
+
if (!root) {
|
|
38
|
+
root = createRoot(container);
|
|
39
|
+
roots.set(container, root);
|
|
40
|
+
}
|
|
41
|
+
const labels = resolveToolConfirmationLabels(labelOverrides);
|
|
42
|
+
root.render(_jsx(ToolConfirmation, { confirmationData: meta.confirmationData, isCompleted: meta.isCompleted, wasRejected: meta.wasRejected, labels: labels, onApprove: meta.onApprove, onCancel: meta.onCancel }));
|
|
43
|
+
},
|
|
44
|
+
unmountAll() {
|
|
45
|
+
for (const root of roots.values()) {
|
|
46
|
+
root.unmount();
|
|
47
|
+
}
|
|
48
|
+
roots.clear();
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=ToolConfirmationRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolConfirmationRenderer.js","sourceRoot":"","sources":["../../src/components/ToolConfirmationRenderer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,kBAAkB,CAAC;AAEzD,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EACL,gBAAgB,GAEjB,MAAM,oBAAoB,CAAC;AAE5B,4EAA4E;AAC5E,gEAAgE;AAChE,QAAQ,EAAE,CAAC;AAEX,0JAA0J;AAC1J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,CAAC,QAAQ,GACvB,CACH,CAAC;QACJ,CAAC;QACD,UAAU;YACR,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;gBAClC,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,CAAC;YACD,KAAK,CAAC,KAAK,EAAE,CAAC;QAChB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentUtils.d.ts","sourceRoot":"","sources":["../../src/components/agentUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAexC,wBAAgB,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAEpD;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOjD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const AVATAR_COLORS = [
|
|
2
|
+
"#7c3aed",
|
|
3
|
+
"#2563eb",
|
|
4
|
+
"#0891b2",
|
|
5
|
+
"#059669",
|
|
6
|
+
"#dc2626",
|
|
7
|
+
"#ea580c",
|
|
8
|
+
"#d97706",
|
|
9
|
+
"#db2777",
|
|
10
|
+
"#0d9488",
|
|
11
|
+
"#475569",
|
|
12
|
+
];
|
|
13
|
+
export function agentKey(agent) {
|
|
14
|
+
return `${agent.folderId}-${agent.id}`;
|
|
15
|
+
}
|
|
16
|
+
export function colorForName(name) {
|
|
17
|
+
let hash = 0;
|
|
18
|
+
for (let i = 0; i < name.length; i++) {
|
|
19
|
+
hash = (hash << 5) - hash + name.charCodeAt(i);
|
|
20
|
+
hash |= 0;
|
|
21
|
+
}
|
|
22
|
+
return AVATAR_COLORS[Math.abs(hash) % AVATAR_COLORS.length];
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=agentUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentUtils.js","sourceRoot":"","sources":["../../src/components/agentUtils.ts"],"names":[],"mappings":"AAEA,MAAM,aAAa,GAAG;IACpB,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;CACV,CAAC;AAEF,MAAM,UAAU,QAAQ,CAAC,KAAmB;IAC1C,OAAO,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,EAAE,EAAE,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,IAAI,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAC/C,IAAI,IAAI,CAAC,CAAC;IACZ,CAAC;IACD,OAAO,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { UiPath } from "@uipath/uipath-typescript/core";
|
|
2
|
+
export interface UseFavoritesResult {
|
|
3
|
+
favorites: Set<string>;
|
|
4
|
+
toggle: (key: string) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const useFavorites: (sdk: UiPath) => UseFavoritesResult;
|
|
7
|
+
//# sourceMappingURL=useFavorites.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFavorites.d.ts","sourceRoot":"","sources":["../../src/components/useFavorites.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAiCxD,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACvB,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/B;AAED,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,KAAG,kBAoB1C,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { useCallback, useState } from "react";
|
|
2
|
+
const STORAGE_KEY_PREFIX = "uipath-ui-widgets.conv-agent-favorites";
|
|
3
|
+
const storageKeyForSdk = (sdk) => {
|
|
4
|
+
const { orgName, tenantName } = sdk.config;
|
|
5
|
+
return `${STORAGE_KEY_PREFIX}:${encodeURIComponent(orgName)}:${encodeURIComponent(tenantName)}`;
|
|
6
|
+
};
|
|
7
|
+
const load = (key) => {
|
|
8
|
+
if (typeof window === "undefined")
|
|
9
|
+
return new Set();
|
|
10
|
+
try {
|
|
11
|
+
const raw = window.localStorage.getItem(key);
|
|
12
|
+
if (!raw)
|
|
13
|
+
return new Set();
|
|
14
|
+
const parsed = JSON.parse(raw);
|
|
15
|
+
return new Set(Array.isArray(parsed) ? parsed.filter((v) => typeof v === "string") : []);
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
return new Set();
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const save = (key, favorites) => {
|
|
22
|
+
if (typeof window === "undefined")
|
|
23
|
+
return;
|
|
24
|
+
try {
|
|
25
|
+
window.localStorage.setItem(key, JSON.stringify(Array.from(favorites)));
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
// ignore quota / privacy-mode errors
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
export const useFavorites = (sdk) => {
|
|
32
|
+
const [favorites, setFavorites] = useState(() => load(storageKeyForSdk(sdk)));
|
|
33
|
+
const toggle = useCallback((key) => {
|
|
34
|
+
const storageKey = storageKeyForSdk(sdk);
|
|
35
|
+
setFavorites((prev) => {
|
|
36
|
+
const next = new Set(prev);
|
|
37
|
+
if (next.has(key))
|
|
38
|
+
next.delete(key);
|
|
39
|
+
else
|
|
40
|
+
next.add(key);
|
|
41
|
+
save(storageKey, next);
|
|
42
|
+
return next;
|
|
43
|
+
});
|
|
44
|
+
}, [sdk]);
|
|
45
|
+
return { favorites, toggle };
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=useFavorites.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFavorites.js","sourceRoot":"","sources":["../../src/components/useFavorites.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE9C,MAAM,kBAAkB,GAAG,wCAAwC,CAAC;AAEpE,MAAM,gBAAgB,GAAG,CAAC,GAAW,EAAU,EAAE;IAC/C,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC;IAC3C,OAAO,GAAG,kBAAkB,IAAI,kBAAkB,CAAC,OAAO,CAAC,IAAI,kBAAkB,CAAC,UAAU,CAAC,EAAE,CAAC;AAClG,CAAC,CAAC;AAEF,MAAM,IAAI,GAAG,CAAC,GAAW,EAAe,EAAE;IACxC,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO,IAAI,GAAG,EAAE,CAAC;IACpD,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC7C,IAAI,CAAC,GAAG;YAAE,OAAO,IAAI,GAAG,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC/B,OAAO,IAAI,GAAG,CACZ,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CACzE,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,GAAG,E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_name_afghanistan";
|
|
3
|
+
readonly AX: "country_name_aland_islands";
|
|
4
|
+
readonly AL: "country_name_albania";
|
|
5
|
+
readonly DZ: "country_name_algeria";
|
|
6
|
+
readonly AS: "country_name_american_samoa";
|
|
7
|
+
readonly AD: "country_name_andorra";
|
|
8
|
+
readonly AO: "country_name_angola";
|
|
9
|
+
readonly AI: "country_name_anguilla";
|
|
10
|
+
readonly AQ: "country_name_antarctica";
|
|
11
|
+
readonly AG: "country_name_antigua_and_barbuda";
|
|
12
|
+
readonly AR: "country_name_argentina";
|
|
13
|
+
readonly AM: "country_name_armenia";
|
|
14
|
+
readonly AW: "country_name_aruba";
|
|
15
|
+
readonly AU: "country_name_australia";
|
|
16
|
+
readonly AT: "country_name_austria";
|
|
17
|
+
readonly AZ: "country_name_azerbaijan";
|
|
18
|
+
readonly BS: "country_name_bahamas";
|
|
19
|
+
readonly BH: "country_name_bahrain";
|
|
20
|
+
readonly BD: "country_name_bangladesh";
|
|
21
|
+
readonly BB: "country_name_barbados";
|
|
22
|
+
readonly BY: "country_name_belarus";
|
|
23
|
+
readonly BE: "country_name_belgium";
|
|
24
|
+
readonly BZ: "country_name_belize";
|
|
25
|
+
readonly BJ: "country_name_benin";
|
|
26
|
+
readonly BM: "country_name_bermuda";
|
|
27
|
+
readonly BT: "country_name_bhutan";
|
|
28
|
+
readonly BO: "country_name_bolivia";
|
|
29
|
+
readonly BQ: "country_name_bonaire_sint_eustatius_and_saba";
|
|
30
|
+
readonly BA: "country_name_bosnia_and_herzegovina";
|
|
31
|
+
readonly BW: "country_name_botswana";
|
|
32
|
+
readonly BV: "country_name_bouvet_island";
|
|
33
|
+
readonly BR: "country_name_brazil";
|
|
34
|
+
readonly IO: "country_name_british_indian_ocean_territory";
|
|
35
|
+
readonly BN: "country_name_brunei_darussalam";
|
|
36
|
+
readonly BG: "country_name_bulgaria";
|
|
37
|
+
readonly BF: "country_name_burkina_faso";
|
|
38
|
+
readonly BI: "country_name_burundi";
|
|
39
|
+
readonly KH: "country_name_cambodia";
|
|
40
|
+
readonly CM: "country_name_cameroon";
|
|
41
|
+
readonly CA: "country_name_canada";
|
|
42
|
+
readonly IC: "country_name_canary_islands";
|
|
43
|
+
readonly CV: "country_name_cape_verde";
|
|
44
|
+
readonly KY: "country_name_cayman_islands";
|
|
45
|
+
readonly CF: "country_name_central_african_republic";
|
|
46
|
+
readonly EA: "country_name_ceuta_and_melilla";
|
|
47
|
+
readonly TD: "country_name_chad";
|
|
48
|
+
readonly CL: "country_name_chile";
|
|
49
|
+
readonly CN: "country_name_china";
|
|
50
|
+
readonly CX: "country_name_christmas_island";
|
|
51
|
+
readonly CC: "country_name_cocos_keeling_islands";
|
|
52
|
+
readonly CO: "country_name_colombia";
|
|
53
|
+
readonly KM: "country_name_comoros";
|
|
54
|
+
readonly CG: "country_name_congo";
|
|
55
|
+
readonly CK: "country_name_cook_islands";
|
|
56
|
+
readonly CR: "country_name_costa_rica";
|
|
57
|
+
readonly CI: "country_name_cote_d_ivoire";
|
|
58
|
+
readonly HR: "country_name_croatia";
|
|
59
|
+
readonly CW: "country_name_curacao";
|
|
60
|
+
readonly CY: "country_name_cyprus";
|
|
61
|
+
readonly CZ: "country_name_czech_republic";
|
|
62
|
+
readonly DK: "country_name_denmark";
|
|
63
|
+
readonly DJ: "country_name_djibouti";
|
|
64
|
+
readonly DM: "country_name_dominica";
|
|
65
|
+
readonly DO: "country_name_dominican_republic";
|
|
66
|
+
readonly EC: "country_name_ecuador";
|
|
67
|
+
readonly EG: "country_name_egypt";
|
|
68
|
+
readonly SV: "country_name_el_salvador";
|
|
69
|
+
readonly GQ: "country_name_equatorial_guinea";
|
|
70
|
+
readonly ER: "country_name_eritrea";
|
|
71
|
+
readonly EE: "country_name_estonia";
|
|
72
|
+
readonly ET: "country_name_ethiopia";
|
|
73
|
+
readonly FK: "country_name_falkland_islands";
|
|
74
|
+
readonly FO: "country_name_faroe_islands";
|
|
75
|
+
readonly FJ: "country_name_fiji";
|
|
76
|
+
readonly FI: "country_name_finland";
|
|
77
|
+
readonly FR: "country_name_france";
|
|
78
|
+
readonly GF: "country_name_french_guiana";
|
|
79
|
+
readonly PF: "country_name_french_polynesia";
|
|
80
|
+
readonly TF: "country_name_french_southern_territories";
|
|
81
|
+
readonly GA: "country_name_gabon";
|
|
82
|
+
readonly GM: "country_name_gambia";
|
|
83
|
+
readonly GE: "country_name_georgia";
|
|
84
|
+
readonly DE: "country_name_germany";
|
|
85
|
+
readonly GH: "country_name_ghana";
|
|
86
|
+
readonly GI: "country_name_gibraltar";
|
|
87
|
+
readonly GR: "country_name_greece";
|
|
88
|
+
readonly GL: "country_name_greenland";
|
|
89
|
+
readonly GD: "country_name_grenada";
|
|
90
|
+
readonly GP: "country_name_guadeloupe";
|
|
91
|
+
readonly GU: "country_name_guam";
|
|
92
|
+
readonly GT: "country_name_guatemala";
|
|
93
|
+
readonly GG: "country_name_guernsey";
|
|
94
|
+
readonly GN: "country_name_guinea";
|
|
95
|
+
readonly GW: "country_name_guinea_bissau";
|
|
96
|
+
readonly GY: "country_name_guyana";
|
|
97
|
+
readonly HT: "country_name_haiti";
|
|
98
|
+
readonly HM: "country_name_heard_island_and_mcdonald_islands";
|
|
99
|
+
readonly VA: "country_name_holy_see";
|
|
100
|
+
readonly HN: "country_name_honduras";
|
|
101
|
+
readonly HK: "country_name_hong_kong";
|
|
102
|
+
readonly HU: "country_name_hungary";
|
|
103
|
+
readonly IS: "country_name_iceland";
|
|
104
|
+
readonly IN: "country_name_india";
|
|
105
|
+
readonly ID: "country_name_indonesia";
|
|
106
|
+
readonly IQ: "country_name_iraq";
|
|
107
|
+
readonly IE: "country_name_ireland";
|
|
108
|
+
readonly IM: "country_name_isle_of_man";
|
|
109
|
+
readonly IL: "country_name_israel";
|
|
110
|
+
readonly IT: "country_name_italy";
|
|
111
|
+
readonly JM: "country_name_jamaica";
|
|
112
|
+
readonly JP: "country_name_japan";
|
|
113
|
+
readonly JE: "country_name_jersey";
|
|
114
|
+
readonly JO: "country_name_jordan";
|
|
115
|
+
readonly KZ: "country_name_kazakhstan";
|
|
116
|
+
readonly KE: "country_name_kenya";
|
|
117
|
+
readonly KI: "country_name_kiribati";
|
|
118
|
+
readonly KR: "country_name_korea_republic_of";
|
|
119
|
+
readonly XK: "country_name_kosovo";
|
|
120
|
+
readonly KW: "country_name_kuwait";
|
|
121
|
+
readonly KG: "country_name_kyrgyzstan";
|
|
122
|
+
readonly LA: "country_name_lao_peoples_democratic_republic";
|
|
123
|
+
readonly LV: "country_name_latvia";
|
|
124
|
+
readonly LB: "country_name_lebanon";
|
|
125
|
+
readonly LS: "country_name_lesotho";
|
|
126
|
+
readonly LR: "country_name_liberia";
|
|
127
|
+
readonly LY: "country_name_libya";
|
|
128
|
+
readonly LI: "country_name_liechtenstein";
|
|
129
|
+
readonly LT: "country_name_lithuania";
|
|
130
|
+
readonly LU: "country_name_luxembourg";
|
|
131
|
+
readonly MO: "country_name_macau";
|
|
132
|
+
readonly MK: "country_name_macedonia";
|
|
133
|
+
readonly MG: "country_name_madagascar";
|
|
134
|
+
readonly MW: "country_name_malawi";
|
|
135
|
+
readonly MY: "country_name_malaysia";
|
|
136
|
+
readonly MV: "country_name_maldives";
|
|
137
|
+
readonly ML: "country_name_mali";
|
|
138
|
+
readonly MT: "country_name_malta";
|
|
139
|
+
readonly MH: "country_name_marshall_islands";
|
|
140
|
+
readonly MQ: "country_name_martinique";
|
|
141
|
+
readonly MR: "country_name_mauritania";
|
|
142
|
+
readonly MU: "country_name_mauritius";
|
|
143
|
+
readonly YT: "country_name_mayotte";
|
|
144
|
+
readonly MX: "country_name_mexico";
|
|
145
|
+
readonly FM: "country_name_micronesia";
|
|
146
|
+
readonly MD: "country_name_moldova_republic_of";
|
|
147
|
+
readonly MC: "country_name_monaco";
|
|
148
|
+
readonly MN: "country_name_mongolia";
|
|
149
|
+
readonly ME: "country_name_montenegro";
|
|
150
|
+
readonly MS: "country_name_montserrat";
|
|
151
|
+
readonly MA: "country_name_morocco";
|
|
152
|
+
readonly MZ: "country_name_mozambique";
|
|
153
|
+
readonly MM: "country_name_myanmar";
|
|
154
|
+
readonly NA: "country_name_namibia";
|
|
155
|
+
readonly NR: "country_name_nauru";
|
|
156
|
+
readonly NP: "country_name_nepal";
|
|
157
|
+
readonly NL: "country_name_netherlands";
|
|
158
|
+
readonly NC: "country_name_new_caledonia";
|
|
159
|
+
readonly NZ: "country_name_new_zealand";
|
|
160
|
+
readonly NI: "country_name_nicaragua";
|
|
161
|
+
readonly NE: "country_name_niger";
|
|
162
|
+
readonly NG: "country_name_nigeria";
|
|
163
|
+
readonly NU: "country_name_niue";
|
|
164
|
+
readonly NF: "country_name_norfolk_island";
|
|
165
|
+
readonly MP: "country_name_northern_mariana_islands";
|
|
166
|
+
readonly NO: "country_name_norway";
|
|
167
|
+
readonly OM: "country_name_oman";
|
|
168
|
+
readonly PK: "country_name_pakistan";
|
|
169
|
+
readonly PW: "country_name_palau";
|
|
170
|
+
readonly PS: "country_name_palestinian_territory";
|
|
171
|
+
readonly PA: "country_name_panama";
|
|
172
|
+
readonly PG: "country_name_papua_new_guinea";
|
|
173
|
+
readonly PY: "country_name_paraguay";
|
|
174
|
+
readonly PE: "country_name_peru";
|
|
175
|
+
readonly PH: "country_name_philippines";
|
|
176
|
+
readonly PN: "country_name_pitcairn";
|
|
177
|
+
readonly PL: "country_name_poland";
|
|
178
|
+
readonly PT: "country_name_portugal";
|
|
179
|
+
readonly PR: "country_name_puerto_rico";
|
|
180
|
+
readonly QA: "country_name_qatar";
|
|
181
|
+
readonly RE: "country_name_reunion";
|
|
182
|
+
readonly RO: "country_name_romania";
|
|
183
|
+
readonly RU: "country_name_russian_federation";
|
|
184
|
+
readonly RW: "country_name_rwanda";
|
|
185
|
+
readonly BL: "country_name_saint_barthelemy";
|
|
186
|
+
readonly SH: "country_name_saint_helena";
|
|
187
|
+
readonly KN: "country_name_saint_kitts_and_nevis";
|
|
188
|
+
readonly LC: "country_name_saint_lucia";
|
|
189
|
+
readonly MF: "country_name_saint_martin";
|
|
190
|
+
readonly PM: "country_name_saint_pierre_and_miquelon";
|
|
191
|
+
readonly VC: "country_name_saint_vincent_and_the_grenadines";
|
|
192
|
+
readonly WS: "country_name_samoa";
|
|
193
|
+
readonly SM: "country_name_san_marino";
|
|
194
|
+
readonly ST: "country_name_sao_tome_and_principe";
|
|
195
|
+
readonly SA: "country_name_saudi_arabia";
|
|
196
|
+
readonly SN: "country_name_senegal";
|
|
197
|
+
readonly CS: "country_name_serbia_and_montenegro";
|
|
198
|
+
readonly RS: "country_name_serbia";
|
|
199
|
+
readonly SC: "country_name_seychelles";
|
|
200
|
+
readonly SL: "country_name_sierra_leone";
|
|
201
|
+
readonly SG: "country_name_singapore";
|
|
202
|
+
readonly SX: "country_name_sint_maarten";
|
|
203
|
+
readonly SK: "country_name_slovakia";
|
|
204
|
+
readonly SI: "country_name_slovenia";
|
|
205
|
+
readonly SB: "country_name_solomon_islands";
|
|
206
|
+
readonly SO: "country_name_somalia";
|
|
207
|
+
readonly ZA: "country_name_south_africa";
|
|
208
|
+
readonly GS: "country_name_south_georgia";
|
|
209
|
+
readonly SS: "country_name_south_sudan";
|
|
210
|
+
readonly ES: "country_name_spain";
|
|
211
|
+
readonly LK: "country_name_sri_lanka";
|
|
212
|
+
readonly SR: "country_name_suriname";
|
|
213
|
+
readonly SJ: "country_name_svalbard_and_jan_mayen";
|
|
214
|
+
readonly SZ: "country_name_swaziland";
|
|
215
|
+
readonly SE: "country_name_sweden";
|
|
216
|
+
readonly CH: "country_name_switzerland";
|
|
217
|
+
readonly TW: "country_name_taiwan";
|
|
218
|
+
readonly TJ: "country_name_tajikistan";
|
|
219
|
+
readonly TZ: "country_name_tanzania";
|
|
220
|
+
readonly TH: "country_name_thailand";
|
|
221
|
+
readonly TL: "country_name_timor_leste";
|
|
222
|
+
readonly TG: "country_name_togo";
|
|
223
|
+
readonly TK: "country_name_tokelau";
|
|
224
|
+
readonly TO: "country_name_tonga";
|
|
225
|
+
readonly TT: "country_name_trinidad_and_tobago";
|
|
226
|
+
readonly TN: "country_name_tunisia";
|
|
227
|
+
readonly TR: "country_name_turkey";
|
|
228
|
+
readonly TM: "country_name_turkmenistan";
|
|
229
|
+
readonly TC: "country_name_turks_and_caicos_islands";
|
|
230
|
+
readonly TV: "country_name_tuvalu";
|
|
231
|
+
readonly UM: "country_name_us_minor_outlying_islands";
|
|
232
|
+
readonly UG: "country_name_uganda";
|
|
233
|
+
readonly UA: "country_name_ukraine";
|
|
234
|
+
readonly AE: "country_name_united_arab_emirates";
|
|
235
|
+
readonly GB: "country_name_united_kingdom";
|
|
236
|
+
readonly US: "country_name_united_states";
|
|
237
|
+
readonly UY: "country_name_uruguay";
|
|
238
|
+
readonly UZ: "country_name_uzbekistan";
|
|
239
|
+
readonly VU: "country_name_vanuatu";
|
|
240
|
+
readonly VE: "country_name_venezuela";
|
|
241
|
+
readonly VN: "country_name_vietnam";
|
|
242
|
+
readonly VI: "country_name_virgin_islands_usa";
|
|
243
|
+
readonly VG: "country_name_virgin_islands_british";
|
|
244
|
+
readonly WF: "country_name_wallis_and_futuna";
|
|
245
|
+
readonly EH: "country_name_western_sahara";
|
|
246
|
+
readonly YE: "country_name_yemen";
|
|
247
|
+
readonly ZM: "country_name_zambia";
|
|
248
|
+
readonly ZW: "country_name_zimbabwe";
|
|
249
|
+
};
|
|
250
|
+
export type CountryCode = keyof typeof COUNTRY_CODES;
|
|
251
|
+
//# sourceMappingURL=countries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"countries.d.ts","sourceRoot":"","sources":["../../src/constants/countries.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwPhB,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,aAAa,CAAC"}
|