@ada-support/embed2 1.1.5 → 1.1.9
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/dist/npm-entry/businessEvents/businessEvent.d.ts +1 -1
- package/dist/npm-entry/campaigns/campaign.d.ts +1 -2
- package/dist/npm-entry/client/components/ButtonFrame/index.d.ts +1 -1
- package/dist/npm-entry/client/components/ChatFrame/index.d.ts +69 -4
- package/dist/npm-entry/client/components/Container/index.d.ts +1 -1
- package/dist/npm-entry/client/components/IFrame/index.d.ts +1 -2
- package/dist/npm-entry/client/helpers/event-subscriptions/index.d.ts +3 -3
- package/dist/npm-entry/client/index.d.ts +7 -10
- package/dist/npm-entry/common/helpers/getAlignment.d.ts +1 -1
- package/dist/npm-entry/common/helpers/http.d.ts +1 -1
- package/dist/npm-entry/common/helpers/startup.d.ts +1 -1
- package/dist/npm-entry/common/helpers/url/index.d.ts +2 -2
- package/dist/npm-entry/common/lib/channel.d.ts +2 -1
- package/dist/npm-entry/common/types/events.d.ts +4 -34
- package/dist/npm-entry/common/types/index.d.ts +2 -39
- package/dist/npm-entry/common/types/store-state.d.ts +1 -38
- package/dist/npm-entry/index-npm.d.ts +1 -1
- package/dist/npm-entry/index.js +88 -97
- package/dist/npm-entry/services/helpers.d.ts +1 -1
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { StartOptions } from "@ada-support/embed-types";
|
|
1
2
|
import type { TrackEventParams } from "common/types";
|
|
2
|
-
import type { StartOptions } from "common/types/store-state";
|
|
3
3
|
import type { BusinessEvent } from "./types";
|
|
4
4
|
export declare function trackEventImpl(adaSettings: StartOptions, chatterToken: string, params: TrackEventParams): void;
|
|
5
5
|
export declare const getEventsToTrigger: (businessEvents: BusinessEvent[]) => BusinessEvent[];
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
+
import type { EvaluateCampaignParams, StartOptions } from "@ada-support/embed-types";
|
|
1
2
|
import type { MessageService } from "client/lib/message-service";
|
|
2
|
-
import type { EvaluateCampaignParams } from "common/types";
|
|
3
|
-
import type { StartOptions } from "common/types/store-state";
|
|
4
3
|
import type { MarketingCampaign } from "./types";
|
|
5
4
|
interface TriggerCampaignImplParams {
|
|
6
5
|
adaSettings: StartOptions;
|
|
@@ -1,10 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { StartOptions } from "@ada-support/embed-types";
|
|
2
|
+
import { Component, h } from "preact";
|
|
2
3
|
import type { MessageService } from "client/lib/message-service";
|
|
3
4
|
import type { StoreProxy } from "client/lib/store-proxy";
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
5
|
+
import type { FrameChannel } from "common/lib/fc";
|
|
6
|
+
import type { CreateNotificationPayload, MessagePayload } from "common/types/events";
|
|
7
|
+
import type { StoreState } from "common/types/store-state";
|
|
8
|
+
interface PropsFromState {
|
|
9
|
+
handle: StoreState["handle"];
|
|
10
|
+
domain: StoreState["domain"];
|
|
11
|
+
cluster: StoreState["cluster"];
|
|
12
|
+
isDrawerOpen: boolean;
|
|
13
|
+
greeting: StoreState["greeting"];
|
|
14
|
+
language: StoreState["language"];
|
|
15
|
+
wasIntroShown: boolean;
|
|
16
|
+
parentElement: StoreState["parentElement"];
|
|
17
|
+
privateMode: StoreState["privateMode"];
|
|
18
|
+
testMode: StoreState["testMode"];
|
|
19
|
+
client: StoreState["client"];
|
|
20
|
+
chatDimensions: StoreState["chatDimensions"];
|
|
21
|
+
drawerHasBeenOpened: StoreState["drawerHasBeenOpened"];
|
|
22
|
+
}
|
|
6
23
|
interface OwnProps {
|
|
7
|
-
name: Module;
|
|
8
24
|
adaSettings: StartOptions;
|
|
9
25
|
store: StoreProxy;
|
|
10
26
|
messageService: MessageService;
|
|
@@ -12,5 +28,54 @@ interface OwnProps {
|
|
|
12
28
|
resetChat: () => void;
|
|
13
29
|
skipGreeting: boolean;
|
|
14
30
|
}
|
|
31
|
+
interface PropsFromDispatch {
|
|
32
|
+
setConnectionState: (payload: MessagePayload) => Promise<StoreState>;
|
|
33
|
+
setState: (payload: Partial<StoreState>) => Promise<StoreState>;
|
|
34
|
+
toggleChat: () => Promise<StoreState>;
|
|
35
|
+
}
|
|
36
|
+
declare type ChatFrameProps = PropsFromState & OwnProps & PropsFromDispatch;
|
|
37
|
+
interface ChatFrameState {
|
|
38
|
+
isMounted: boolean;
|
|
39
|
+
closeTransitionTime: number;
|
|
40
|
+
}
|
|
41
|
+
export declare class ChatFrame extends Component<ChatFrameProps, ChatFrameState> {
|
|
42
|
+
iframeRef: import("preact").RefObject<any>;
|
|
43
|
+
pageYOffset: number;
|
|
44
|
+
documentBodyOverflow: string;
|
|
45
|
+
documentBodyPosition: string;
|
|
46
|
+
documentBodyTop: string;
|
|
47
|
+
documentBodyBottom: string;
|
|
48
|
+
documentBodyLeft: string;
|
|
49
|
+
documentBodyRight: string;
|
|
50
|
+
channel?: FrameChannel;
|
|
51
|
+
chatRenderTimeout?: number;
|
|
52
|
+
state: ChatFrameState;
|
|
53
|
+
componentDidMount(): void;
|
|
54
|
+
componentDidUpdate(prevProps: ChatFrameProps): void;
|
|
55
|
+
componentWillUnmount(): void;
|
|
56
|
+
get darkMode(): boolean;
|
|
57
|
+
getIframeSrc(): string;
|
|
58
|
+
get styles(): string;
|
|
59
|
+
get hasVisibleProactiveMessages(): boolean;
|
|
60
|
+
get visibleProactiveStyles(): string;
|
|
61
|
+
static get parentElementStyles(): string;
|
|
62
|
+
get chooseStyles(): string;
|
|
63
|
+
handleScrollLock(): void;
|
|
64
|
+
/**
|
|
65
|
+
* Lock the document body from scrolling. If we don't do this,
|
|
66
|
+
* there are SERIOUS issues on iOS.
|
|
67
|
+
*/
|
|
68
|
+
lockDocumentBodyFromScrolling(): void;
|
|
69
|
+
/**
|
|
70
|
+
* Set back initial values from client document body
|
|
71
|
+
*/
|
|
72
|
+
unlockDocumentBodyFromScrolling(): void;
|
|
73
|
+
notificationOnClickHandler(isChatOpen: boolean): void;
|
|
74
|
+
handleNotifications(payload: CreateNotificationPayload): void;
|
|
75
|
+
handleChatEvent(type: string, payload: unknown, id?: string): Promise<void>;
|
|
76
|
+
bindChatEventHandlers(): void;
|
|
77
|
+
frameLoaded(): void;
|
|
78
|
+
render(): h.JSX.Element;
|
|
79
|
+
}
|
|
15
80
|
declare const _default: (ownProps: OwnProps) => h.JSX.Element;
|
|
16
81
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type { StartOptions } from "@ada-support/embed-types";
|
|
1
2
|
import { h } from "preact";
|
|
2
3
|
import type { MessageService } from "client/lib/message-service";
|
|
3
4
|
import type { StoreProxy } from "client/lib/store-proxy";
|
|
4
|
-
import type { StartOptions } from "common/types/store-state";
|
|
5
5
|
interface OwnProps {
|
|
6
6
|
store: StoreProxy;
|
|
7
7
|
messageService: MessageService;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { h } from "preact";
|
|
2
2
|
import type { MessageService } from "client/lib/message-service";
|
|
3
3
|
import type { StoreProxy } from "client/lib/store-proxy";
|
|
4
|
-
import type { Module } from "common/types/modules";
|
|
5
4
|
interface OwnProps {
|
|
6
|
-
name:
|
|
5
|
+
name: "button" | "x-storage" | "intro" | "drawer-mask";
|
|
7
6
|
roleDescription?: string;
|
|
8
7
|
styles: string;
|
|
9
8
|
store: StoreProxy;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import type { AdaEventDataKeyedByEvent, AdaEventKey, AdaEventSubscriptionCallback } from "@ada-support/embed-types";
|
|
2
2
|
export declare function unsubscribeEvent(id: number): void;
|
|
3
|
-
export declare function subscribeEvent(eventKey:
|
|
4
|
-
export declare function publishEvent(eventKey:
|
|
3
|
+
export declare function subscribeEvent<K extends AdaEventKey>(eventKey: K, callback: AdaEventSubscriptionCallback<K>): number;
|
|
4
|
+
export declare function publishEvent<K extends AdaEventKey>(eventKey: K, data: AdaEventDataKeyedByEvent[K]): void;
|
|
@@ -1,25 +1,22 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AdaEventKey, AdaEventSubscriptionCallback, EvaluateCampaignParams, ResetParams, StartOptions, WindowInfo } from "@ada-support/embed-types";
|
|
2
2
|
import { MessageService } from "client/lib/message-service";
|
|
3
3
|
import { StoreProxy } from "client/lib/store-proxy";
|
|
4
4
|
import "client/lib/error-tracker";
|
|
5
5
|
import type { Client } from "common/models/client";
|
|
6
|
-
import type { EvaluateCampaignParams, ResetParams, WindowInfo } from "common/types";
|
|
7
6
|
import type { MetaFieldPayload } from "common/types/store";
|
|
8
|
-
import type { StartOptions } from "common/types/store-state";
|
|
9
7
|
import type { CustomEventChannel } from "./lib/ce";
|
|
10
8
|
export declare class Embed {
|
|
11
|
-
client
|
|
12
|
-
storage
|
|
9
|
+
client?: Client;
|
|
10
|
+
storage?: Storage;
|
|
13
11
|
localChannel: CustomEventChannel;
|
|
14
12
|
store: StoreProxy;
|
|
15
13
|
messageService: MessageService;
|
|
16
|
-
buttonWasMoved: boolean;
|
|
17
14
|
adaSettings: StartOptions;
|
|
18
15
|
initialized: Promise<void>;
|
|
19
|
-
entryContainer
|
|
16
|
+
entryContainer?: HTMLElement;
|
|
20
17
|
unmountCallback: () => void;
|
|
21
|
-
initializationReject
|
|
22
|
-
initializationResolve
|
|
18
|
+
initializationReject?: (error: Error) => void;
|
|
19
|
+
initializationResolve?: () => void;
|
|
23
20
|
private debounceCampaignTrigger;
|
|
24
21
|
static embed2Version: string;
|
|
25
22
|
constructor(adaSettings: StartOptions, unmountCallback: () => void);
|
|
@@ -36,7 +33,7 @@ export declare class Embed {
|
|
|
36
33
|
triggerCampaign(campaignKey: string, triggerCampaignParams?: {}): Promise<void>;
|
|
37
34
|
evaluateCampaignConditions(options: EvaluateCampaignParams): Promise<void>;
|
|
38
35
|
createProactive(body: string, duration: number, responseId?: string): Promise<void>;
|
|
39
|
-
subscribeEvent(eventKey:
|
|
36
|
+
subscribeEvent<K extends AdaEventKey>(eventKey: K, callback: AdaEventSubscriptionCallback<K>): number;
|
|
40
37
|
unsubscribeEvent(id: number): void;
|
|
41
38
|
closeCampaign(): Promise<void>;
|
|
42
39
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { StartOptions } from "
|
|
1
|
+
import type { StartOptions } from "@ada-support/embed-types";
|
|
2
2
|
export declare function getAlignment(adaSettings: StartOptions): "right" | "left";
|
|
@@ -9,5 +9,5 @@ interface InterfaceRequestObject {
|
|
|
9
9
|
/**
|
|
10
10
|
* Vanilla HTTP request. Returns a Promise.
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export declare function httpRequest<T = object>(obj: InterfaceRequestObject): Promise<T>;
|
|
13
13
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
interface GetEmbedUrlParams {
|
|
2
|
-
frameName:
|
|
2
|
+
frameName: "button" | "x-storage" | "intro" | "drawer-mask";
|
|
3
3
|
handle: string;
|
|
4
4
|
cluster?: string;
|
|
5
5
|
domain?: string;
|
|
6
6
|
}
|
|
7
7
|
export interface CSInterface {
|
|
8
|
-
name:
|
|
8
|
+
name: "api" | "chat";
|
|
9
9
|
handle: string;
|
|
10
10
|
cluster?: string;
|
|
11
11
|
domain?: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { EvaluateCampaignParams, ResetParams } from "@ada-support/embed-types";
|
|
1
2
|
import type { FetchEventStatusType } from "common/constants/events";
|
|
2
3
|
import type { AdaCustomEvent, Refhandler } from "common/types/events";
|
|
3
|
-
import type {
|
|
4
|
+
import type { SendGreetingParams, StoreDispatchPayload, StoreGetPayload, TrackEventParams } from "common/types/index";
|
|
4
5
|
import type { MetaFieldPayload } from "common/types/store";
|
|
5
6
|
import type { StoreState } from "common/types/store-state";
|
|
6
7
|
export interface EmbedRequestPayloadByEvent {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AdaEventDataKeyedByEvent, AdaEventKey } from "@ada-support/embed-types";
|
|
1
2
|
import type { FetchEventStatusType } from "common/constants/events";
|
|
2
3
|
import type { EmbedEvent, EmbedRequestEvent, PayloadByEvent } from "common/lib/channel";
|
|
3
4
|
export interface MessagePayload {
|
|
@@ -13,9 +14,9 @@ export interface CustomJavascriptEventPayload {
|
|
|
13
14
|
event_name: string;
|
|
14
15
|
};
|
|
15
16
|
}
|
|
16
|
-
export interface PublishEventPayload {
|
|
17
|
-
eventKey:
|
|
18
|
-
data:
|
|
17
|
+
export interface PublishEventPayload<K extends AdaEventKey> {
|
|
18
|
+
eventKey: K;
|
|
19
|
+
data: AdaEventDataKeyedByEvent[K];
|
|
19
20
|
}
|
|
20
21
|
export interface AdaCustomEvent<E extends (EmbedEvent | string) = string> {
|
|
21
22
|
type: E;
|
|
@@ -24,34 +25,3 @@ export interface AdaCustomEvent<E extends (EmbedEvent | string) = string> {
|
|
|
24
25
|
status?: FetchEventStatusType;
|
|
25
26
|
}
|
|
26
27
|
export declare type Refhandler<E extends (EmbedRequestEvent | string) = string> = (handleEvent: MessageEvent | CustomEventInit<AdaCustomEvent<E>>) => void;
|
|
27
|
-
interface ChatterMetaData {
|
|
28
|
-
"initialurl": string;
|
|
29
|
-
"user_agent": string;
|
|
30
|
-
"browser": string;
|
|
31
|
-
"browser_version": string;
|
|
32
|
-
"device": string;
|
|
33
|
-
"introshown": "True" | "False";
|
|
34
|
-
"language": string;
|
|
35
|
-
"test_user": string;
|
|
36
|
-
"last_question_asked": string;
|
|
37
|
-
"last_answer_id": string;
|
|
38
|
-
}
|
|
39
|
-
interface ChatterData extends ChatterMetaData {
|
|
40
|
-
"chatter_token": string;
|
|
41
|
-
"channel": string;
|
|
42
|
-
}
|
|
43
|
-
export interface ChatterEventPayload {
|
|
44
|
-
"chatter_id": string;
|
|
45
|
-
"session_id": string;
|
|
46
|
-
"event_data": {
|
|
47
|
-
"user_data": {
|
|
48
|
-
"all_data": ChatterData;
|
|
49
|
-
"meta": ChatterMetaData;
|
|
50
|
-
"global": Record<string, unknown>;
|
|
51
|
-
"local": Record<string, unknown>;
|
|
52
|
-
};
|
|
53
|
-
"chatter_transcript": string;
|
|
54
|
-
"event_name": string;
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AdaEmbedAPI } from "@ada-support/embed-types";
|
|
2
2
|
import type { ActionTypes } from "common/constants/actions";
|
|
3
|
-
import type {
|
|
4
|
-
import type { StartOptions, StoreState } from "./store-state";
|
|
3
|
+
import type { StoreState } from "./store-state";
|
|
5
4
|
export interface StoreAction {
|
|
6
5
|
[key: string]: string | object | number;
|
|
7
6
|
type: ActionTypes;
|
|
@@ -16,13 +15,6 @@ export interface StoreDispatchPayload {
|
|
|
16
15
|
export interface StoreGetPayload {
|
|
17
16
|
key: string;
|
|
18
17
|
}
|
|
19
|
-
export interface ResetParams {
|
|
20
|
-
resetChatHistory?: boolean;
|
|
21
|
-
metaFields?: MetaFieldPayload;
|
|
22
|
-
sensitiveMetaFields?: MetaFieldPayload;
|
|
23
|
-
greeting?: string;
|
|
24
|
-
language?: string;
|
|
25
|
-
}
|
|
26
18
|
export interface TrackEventParams {
|
|
27
19
|
eventKey: string;
|
|
28
20
|
value?: number;
|
|
@@ -36,35 +28,6 @@ export interface TriggerCampaignParams {
|
|
|
36
28
|
ignoreStatus?: boolean;
|
|
37
29
|
ignoreFrequency?: boolean;
|
|
38
30
|
}
|
|
39
|
-
export interface EvaluateCampaignParams {
|
|
40
|
-
ignoreStatus?: boolean;
|
|
41
|
-
ignoreFrequency?: boolean;
|
|
42
|
-
}
|
|
43
|
-
export interface MessageHandler {
|
|
44
|
-
(type: string, payload: object, id: string): any;
|
|
45
|
-
}
|
|
46
|
-
export interface WindowInfo {
|
|
47
|
-
isDrawerOpen: boolean;
|
|
48
|
-
isChatOpen: boolean;
|
|
49
|
-
hasActiveChatter: boolean;
|
|
50
|
-
hasClosedChat: boolean;
|
|
51
|
-
}
|
|
52
|
-
export interface AdaEmbedAPI {
|
|
53
|
-
start(adaSettings: StartOptions): Promise<void>;
|
|
54
|
-
stop(): Promise<void>;
|
|
55
|
-
toggle(): Promise<void>;
|
|
56
|
-
deleteHistory(): Promise<void>;
|
|
57
|
-
setMetaFields(options: MetaFieldPayload): Promise<void>;
|
|
58
|
-
setSensitiveMetaFields(options: MetaFieldPayload): Promise<void>;
|
|
59
|
-
getInfo(): Promise<WindowInfo>;
|
|
60
|
-
reset(resetParams?: ResetParams): Promise<void>;
|
|
61
|
-
createProactive(body: string, duration?: number, responseId?: string): Promise<void>;
|
|
62
|
-
trackEvent(eventKey: string, value: number, meta: object): Promise<void>;
|
|
63
|
-
triggerCampaign(campaignKey: string, options: object): Promise<void>;
|
|
64
|
-
evaluateCampaignConditions(options: EvaluateCampaignParams): Promise<void>;
|
|
65
|
-
subscribeEvent(eventKey: string, callback: EventSubscriptionCallback): Promise<number>;
|
|
66
|
-
unsubscribeEvent(id: number): Promise<void>;
|
|
67
|
-
}
|
|
68
31
|
export interface CustomWindow extends Window {
|
|
69
32
|
adaEmbed: AdaEmbedAPI;
|
|
70
33
|
navigator: Navigator;
|
|
@@ -1,43 +1,6 @@
|
|
|
1
|
+
import type { StartOptions } from "@ada-support/embed-types";
|
|
1
2
|
import type { ConnectionState } from "common/constants/events";
|
|
2
3
|
import type { Client } from "common/models/client";
|
|
3
|
-
import type { ChatterEventPayload } from "common/types/events";
|
|
4
|
-
export interface StartOptions {
|
|
5
|
-
handle?: string;
|
|
6
|
-
lazy?: boolean;
|
|
7
|
-
styles?: string;
|
|
8
|
-
domain?: string;
|
|
9
|
-
cluster?: string;
|
|
10
|
-
language?: string;
|
|
11
|
-
greeting?: string;
|
|
12
|
-
hideMask?: boolean;
|
|
13
|
-
metaFields?: Record<string, unknown>;
|
|
14
|
-
sensitiveMetaFields?: Record<string, unknown>;
|
|
15
|
-
parentElement?: string | HTMLElement;
|
|
16
|
-
privateMode?: boolean;
|
|
17
|
-
chatFrameTimeoutCallback?(): void;
|
|
18
|
-
adaReadyCallback?(params: {
|
|
19
|
-
isRolledOut: boolean;
|
|
20
|
-
}): void;
|
|
21
|
-
analyticsCallback?(analytics: Record<string, unknown>): void;
|
|
22
|
-
chatterTokenCallback?(chatter: string): void;
|
|
23
|
-
onAdaEmbedLoaded?(): void;
|
|
24
|
-
toggleCallback?(isDrawerOpen: boolean): void;
|
|
25
|
-
eventCallbacks?: {
|
|
26
|
-
[eventName: string]: ((customJavascriptEvent: object) => void) | undefined;
|
|
27
|
-
};
|
|
28
|
-
zdChatterAuthCallback?(callback: (token: string) => void): void;
|
|
29
|
-
embedStyles?: string;
|
|
30
|
-
rolloutOverride?: number;
|
|
31
|
-
crossWindowPersistence?: boolean;
|
|
32
|
-
testMode?: boolean;
|
|
33
|
-
customDomains?: {
|
|
34
|
-
embedLegacy: string;
|
|
35
|
-
embedModern: string;
|
|
36
|
-
};
|
|
37
|
-
preload?: boolean;
|
|
38
|
-
conversationEndCallback?(payload: ChatterEventPayload): void;
|
|
39
|
-
align?: "right" | "left" | "auto";
|
|
40
|
-
}
|
|
41
4
|
export interface StoreState extends StartOptionsNoFunction {
|
|
42
5
|
chatterCreated?: string | null;
|
|
43
6
|
chatterToken?: string | null;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("
|
|
1
|
+
declare const _default: import("@ada-support/embed-types").AdaEmbedAPI;
|
|
2
2
|
export default _default;
|
package/dist/npm-entry/index.js
CHANGED
|
@@ -8798,7 +8798,7 @@ var client = new error_tracker_BrowserClient({
|
|
|
8798
8798
|
return event;
|
|
8799
8799
|
},
|
|
8800
8800
|
environment: "production",
|
|
8801
|
-
release: "1.1.
|
|
8801
|
+
release: "1.1.9-c54a4e9",
|
|
8802
8802
|
sampleRate: 0.25,
|
|
8803
8803
|
autoSessionTracking: false,
|
|
8804
8804
|
// Integrations don't seem to work with Sentry: https://github.com/getsentry/sentry-javascript/issues/2541
|
|
@@ -9500,7 +9500,7 @@ function getEmbedURL(_ref) {
|
|
|
9500
9500
|
polyfillVersionString = "legacy";
|
|
9501
9501
|
}
|
|
9502
9502
|
|
|
9503
|
-
return concat_default()(_context5 = concat_default()(_context6 = concat_default()(_context7 = "".concat(host, "/embed/")).call(_context7, polyfillVersionString, "/")).call(_context6, frameName, "/")).call(_context5, "
|
|
9503
|
+
return concat_default()(_context5 = concat_default()(_context6 = concat_default()(_context7 = "".concat(host, "/embed/")).call(_context7, polyfillVersionString, "/")).call(_context6, frameName, "/")).call(_context5, "c54a4e9", "/index.html");
|
|
9504
9504
|
}
|
|
9505
9505
|
/**
|
|
9506
9506
|
* Generate the Chat / API URL
|
|
@@ -9596,7 +9596,7 @@ var actions = {
|
|
|
9596
9596
|
domain: currentState.domain,
|
|
9597
9597
|
route: "chatters/".concat(currentState.chatterToken, "/live_chat_unread_amount")
|
|
9598
9598
|
});
|
|
9599
|
-
(0,http/*
|
|
9599
|
+
(0,http/* httpRequest */.c)({
|
|
9600
9600
|
url: url,
|
|
9601
9601
|
method: "DELETE"
|
|
9602
9602
|
}).catch(function (e) {
|
|
@@ -9616,7 +9616,7 @@ var actions = {
|
|
|
9616
9616
|
domain: currentState.domain
|
|
9617
9617
|
});
|
|
9618
9618
|
|
|
9619
|
-
(0,http/*
|
|
9619
|
+
(0,http/* httpRequest */.c)({
|
|
9620
9620
|
url: "".concat(_url, "business_events/track"),
|
|
9621
9621
|
method: "POST",
|
|
9622
9622
|
body: stringify_default()({
|
|
@@ -10357,7 +10357,7 @@ function trackEventImpl(adaSettings, chatterToken, params) {
|
|
|
10357
10357
|
value = params.value,
|
|
10358
10358
|
meta = params.meta; // eslint-disable-next-line @typescript-eslint/ban-types
|
|
10359
10359
|
|
|
10360
|
-
(0,http/*
|
|
10360
|
+
(0,http/* httpRequest */.c)({
|
|
10361
10361
|
url: "".concat(baseApiUrl, "business_events/track"),
|
|
10362
10362
|
method: "POST",
|
|
10363
10363
|
body: stringify_default()({
|
|
@@ -10562,7 +10562,7 @@ function triggerCampaignImpl(_ref) {
|
|
|
10562
10562
|
domain: domain
|
|
10563
10563
|
}); // eslint-disable-next-line @typescript-eslint/ban-types
|
|
10564
10564
|
|
|
10565
|
-
(0,http/*
|
|
10565
|
+
(0,http/* httpRequest */.c)({
|
|
10566
10566
|
url: url,
|
|
10567
10567
|
method: "POST",
|
|
10568
10568
|
body: stringify_default()({
|
|
@@ -10927,7 +10927,7 @@ function _fetchClient() {
|
|
|
10927
10927
|
case 0:
|
|
10928
10928
|
_context.prev = 0;
|
|
10929
10929
|
_context.next = 3;
|
|
10930
|
-
return (0,http/*
|
|
10930
|
+
return (0,http/* httpRequest */.c)({
|
|
10931
10931
|
url: getClientCacheUrl(handle, cluster, domain)
|
|
10932
10932
|
});
|
|
10933
10933
|
|
|
@@ -10955,7 +10955,7 @@ function _fetchClient() {
|
|
|
10955
10955
|
case 11:
|
|
10956
10956
|
_context.prev = 11;
|
|
10957
10957
|
_context.next = 14;
|
|
10958
|
-
return (0,http/*
|
|
10958
|
+
return (0,http/* httpRequest */.c)({
|
|
10959
10959
|
url: getURL({
|
|
10960
10960
|
name: "api",
|
|
10961
10961
|
handle: handle,
|
|
@@ -11604,7 +11604,6 @@ function ChatFrame_isNativeReflectConstruct() { if (typeof Reflect === "undefine
|
|
|
11604
11604
|
|
|
11605
11605
|
|
|
11606
11606
|
var documentBodyStyle = window.document.body.style;
|
|
11607
|
-
|
|
11608
11607
|
var ChatFrame = /*#__PURE__*/function (_Component) {
|
|
11609
11608
|
(0,inherits/* default */.Z)(ChatFrame, _Component);
|
|
11610
11609
|
|
|
@@ -11639,8 +11638,6 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
|
|
|
11639
11638
|
|
|
11640
11639
|
(0,defineProperty/* default */.Z)((0,assertThisInitialized/* default */.Z)(_this), "documentBodyRight", documentBodyStyle.right);
|
|
11641
11640
|
|
|
11642
|
-
(0,defineProperty/* default */.Z)((0,assertThisInitialized/* default */.Z)(_this), "url", _this.getURL);
|
|
11643
|
-
|
|
11644
11641
|
(0,defineProperty/* default */.Z)((0,assertThisInitialized/* default */.Z)(_this), "channel", void 0);
|
|
11645
11642
|
|
|
11646
11643
|
(0,defineProperty/* default */.Z)((0,assertThisInitialized/* default */.Z)(_this), "chatRenderTimeout", void 0);
|
|
@@ -11661,13 +11658,12 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
|
|
|
11661
11658
|
var _this$props = this.props,
|
|
11662
11659
|
adaSettings = _this$props.adaSettings,
|
|
11663
11660
|
handle = _this$props.handle,
|
|
11664
|
-
name = _this$props.name,
|
|
11665
11661
|
setChatHasBeenRendered = _this$props.setChatHasBeenRendered,
|
|
11666
11662
|
messageService = _this$props.messageService,
|
|
11667
11663
|
store = _this$props.store;
|
|
11668
11664
|
setChatHasBeenRendered();
|
|
11669
|
-
this.channel = messageService.registerFrameChannel(
|
|
11670
|
-
store.addChannelListener(
|
|
11665
|
+
this.channel = messageService.registerFrameChannel("chat", this.iframeRef.current.contentWindow, this.iframeRef.current.src);
|
|
11666
|
+
store.addChannelListener("chat");
|
|
11671
11667
|
this.bindChatEventHandlers();
|
|
11672
11668
|
this.handleScrollLock(); // We use this log to track number of chat impressions (times when users see chat iFrame render first time).
|
|
11673
11669
|
|
|
@@ -11694,10 +11690,8 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
|
|
|
11694
11690
|
}, {
|
|
11695
11691
|
key: "componentWillUnmount",
|
|
11696
11692
|
value: function componentWillUnmount() {
|
|
11697
|
-
var
|
|
11698
|
-
|
|
11699
|
-
name = _this$props2.name;
|
|
11700
|
-
messageService.unregisterChannel(name);
|
|
11693
|
+
var messageService = this.props.messageService;
|
|
11694
|
+
messageService.unregisterChannel("chat");
|
|
11701
11695
|
}
|
|
11702
11696
|
}, {
|
|
11703
11697
|
key: "darkMode",
|
|
@@ -11714,36 +11708,32 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
|
|
|
11714
11708
|
var systemDarkMode = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
11715
11709
|
return theme === "dark" || theme === "auto" && systemDarkMode;
|
|
11716
11710
|
}
|
|
11717
|
-
/**
|
|
11718
|
-
* @override
|
|
11719
|
-
*/
|
|
11720
|
-
|
|
11721
11711
|
}, {
|
|
11722
|
-
key: "
|
|
11723
|
-
|
|
11724
|
-
var _this$
|
|
11725
|
-
|
|
11726
|
-
|
|
11727
|
-
|
|
11728
|
-
|
|
11729
|
-
|
|
11730
|
-
|
|
11731
|
-
|
|
11732
|
-
|
|
11733
|
-
|
|
11734
|
-
|
|
11735
|
-
adaSettings = _this$props3.adaSettings;
|
|
11712
|
+
key: "getIframeSrc",
|
|
11713
|
+
value: function getIframeSrc() {
|
|
11714
|
+
var _this$props2 = this.props,
|
|
11715
|
+
handle = _this$props2.handle,
|
|
11716
|
+
domain = _this$props2.domain,
|
|
11717
|
+
cluster = _this$props2.cluster,
|
|
11718
|
+
greeting = _this$props2.greeting,
|
|
11719
|
+
language = _this$props2.language,
|
|
11720
|
+
skipGreeting = _this$props2.skipGreeting,
|
|
11721
|
+
wasIntroShown = _this$props2.wasIntroShown,
|
|
11722
|
+
privateMode = _this$props2.privateMode,
|
|
11723
|
+
testMode = _this$props2.testMode,
|
|
11724
|
+
adaSettings = _this$props2.adaSettings;
|
|
11736
11725
|
|
|
11737
11726
|
if (!handle) {
|
|
11738
11727
|
throw new errors/* AdaEmbedError */.S("`handle` is not defined");
|
|
11739
11728
|
}
|
|
11740
11729
|
|
|
11741
11730
|
return getURL({
|
|
11742
|
-
name:
|
|
11731
|
+
name: "chat",
|
|
11743
11732
|
handle: handle,
|
|
11744
11733
|
cluster: cluster,
|
|
11745
11734
|
domain: domain,
|
|
11746
11735
|
qp: {
|
|
11736
|
+
embedVersion: slice_default()("c54a4e9").call("c54a4e9", 0, 7),
|
|
11747
11737
|
greeting: greeting,
|
|
11748
11738
|
language: language,
|
|
11749
11739
|
skipGreeting: skipGreeting,
|
|
@@ -11760,11 +11750,11 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
|
|
|
11760
11750
|
get: function get() {
|
|
11761
11751
|
var _client$ui_settings2, _client$ui_settings2$, _context10, _context11, _context12, _context13, _context14;
|
|
11762
11752
|
|
|
11763
|
-
var _this$
|
|
11764
|
-
isDrawerOpen = _this$
|
|
11765
|
-
client = _this$
|
|
11766
|
-
testMode = _this$
|
|
11767
|
-
adaSettings = _this$
|
|
11753
|
+
var _this$props3 = this.props,
|
|
11754
|
+
isDrawerOpen = _this$props3.isDrawerOpen,
|
|
11755
|
+
client = _this$props3.client,
|
|
11756
|
+
testMode = _this$props3.testMode,
|
|
11757
|
+
adaSettings = _this$props3.adaSettings;
|
|
11768
11758
|
|
|
11769
11759
|
if (!client) {
|
|
11770
11760
|
return "";
|
|
@@ -11801,10 +11791,10 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
|
|
|
11801
11791
|
get: function get() {
|
|
11802
11792
|
var _client$ui_settings3, _client$ui_settings3$, _context15, _context16, _context17;
|
|
11803
11793
|
|
|
11804
|
-
var _this$
|
|
11805
|
-
chatDimensions = _this$
|
|
11806
|
-
client = _this$
|
|
11807
|
-
adaSettings = _this$
|
|
11794
|
+
var _this$props4 = this.props,
|
|
11795
|
+
chatDimensions = _this$props4.chatDimensions,
|
|
11796
|
+
client = _this$props4.client,
|
|
11797
|
+
adaSettings = _this$props4.adaSettings;
|
|
11808
11798
|
|
|
11809
11799
|
if (!(client !== null && client !== void 0 && client.chat_button)) {
|
|
11810
11800
|
return "";
|
|
@@ -11820,11 +11810,11 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
|
|
|
11820
11810
|
}, {
|
|
11821
11811
|
key: "chooseStyles",
|
|
11822
11812
|
get: function get() {
|
|
11823
|
-
var _this$
|
|
11824
|
-
parentElement = _this$
|
|
11825
|
-
client = _this$
|
|
11826
|
-
isDrawerOpen = _this$
|
|
11827
|
-
drawerHasBeenOpened = _this$
|
|
11813
|
+
var _this$props5 = this.props,
|
|
11814
|
+
parentElement = _this$props5.parentElement,
|
|
11815
|
+
client = _this$props5.client,
|
|
11816
|
+
isDrawerOpen = _this$props5.isDrawerOpen,
|
|
11817
|
+
drawerHasBeenOpened = _this$props5.drawerHasBeenOpened;
|
|
11828
11818
|
|
|
11829
11819
|
if (parentElement) {
|
|
11830
11820
|
return ChatFrame.parentElementStyles;
|
|
@@ -11853,9 +11843,9 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
|
|
|
11853
11843
|
value: function handleScrollLock() {
|
|
11854
11844
|
var _this3 = this;
|
|
11855
11845
|
|
|
11856
|
-
var _this$
|
|
11857
|
-
isDrawerOpen = _this$
|
|
11858
|
-
parentElement = _this$
|
|
11846
|
+
var _this$props6 = this.props,
|
|
11847
|
+
isDrawerOpen = _this$props6.isDrawerOpen,
|
|
11848
|
+
parentElement = _this$props6.parentElement;
|
|
11859
11849
|
var closeTransitionTime = this.state.closeTransitionTime; // Lock scroll only on mobile
|
|
11860
11850
|
|
|
11861
11851
|
if (!isMobile) {
|
|
@@ -11945,9 +11935,9 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
|
|
|
11945
11935
|
var title = payload.title,
|
|
11946
11936
|
body = payload.body,
|
|
11947
11937
|
icon = payload.icon;
|
|
11948
|
-
var _this$
|
|
11949
|
-
isDrawerOpen = _this$
|
|
11950
|
-
parentElement = _this$
|
|
11938
|
+
var _this$props7 = this.props,
|
|
11939
|
+
isDrawerOpen = _this$props7.isDrawerOpen,
|
|
11940
|
+
parentElement = _this$props7.parentElement;
|
|
11951
11941
|
var isChatOpen = isDrawerOpen || Boolean(parentElement);
|
|
11952
11942
|
var onClickHandler = this.notificationOnClickHandler.bind(this, isChatOpen);
|
|
11953
11943
|
createNotification(title, isChatOpen, onClickHandler, {
|
|
@@ -11961,13 +11951,13 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
|
|
|
11961
11951
|
var _handleChatEvent = (0,asyncToGenerator/* default */.Z)( /*#__PURE__*/regenerator_default().mark(function _callee(type, payload, id) {
|
|
11962
11952
|
var _this4 = this;
|
|
11963
11953
|
|
|
11964
|
-
var _this$
|
|
11954
|
+
var _this$props8, adaSettings, setState, setConnectionState, _ref, eventKey, data, _ref2, analytics, analyticsCallback, client, _ref3, chatter, created, chatterTokenCallback, _client, _ref4, zdSessionId, zdPreviousTags, storage, _client2, _ref5, zdMessagingExternalUserId, zdMessagingChatterCreated, _client3, _ref6, inLiveChat, eventCallbacks, customJavascriptEvent, specificCallback, genericCallback, resetChat, zdChatterAuthCallback, conversationEndCallback;
|
|
11965
11955
|
|
|
11966
11956
|
return regenerator_default().wrap(function _callee$(_context22) {
|
|
11967
11957
|
while (1) {
|
|
11968
11958
|
switch (_context22.prev = _context22.next) {
|
|
11969
11959
|
case 0:
|
|
11970
|
-
_this$
|
|
11960
|
+
_this$props8 = this.props, adaSettings = _this$props8.adaSettings, setState = _this$props8.setState, setConnectionState = _this$props8.setConnectionState;
|
|
11971
11961
|
_context22.t0 = type;
|
|
11972
11962
|
_context22.next = _context22.t0 === GET_WINDOW_ORIGIN ? 4 : _context22.t0 === CHAT_STARTED ? 8 : _context22.t0 === CHAT_WEBSOCKET_CONNECTED ? 14 : _context22.t0 === PUBLISH_EVENT ? 16 : _context22.t0 === ANALYTICS_EVENT ? 19 : _context22.t0 === CHATTER_EVENT ? 23 : _context22.t0 === "ZD_SESSION" ? 33 : _context22.t0 === ZD_MESSAGING_HANDOFF ? 42 : _context22.t0 === CHATTER_LIVECHAT_EVENT ? 51 : _context22.t0 === CUSTOM_JAVASCRIPT_EVENT ? 59 : _context22.t0 === RESET_FROM_CHAT_EVENT ? 68 : _context22.t0 === ZD_JWT_AUTH_EVENT ? 71 : _context22.t0 === CREATE_NOTIFICATION_EVENT ? 89 : _context22.t0 === BROWSER_HAS_NOTIFICATIONS_EVENT ? 91 : _context22.t0 === REQUEST_NOTIFICATIONS_EVENT ? 95 : _context22.t0 === END_CONVERSATION_EVENT ? 97 : 100;
|
|
11973
11963
|
break;
|
|
@@ -12304,10 +12294,8 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
|
|
|
12304
12294
|
value: function bindChatEventHandlers() {
|
|
12305
12295
|
var _this5 = this;
|
|
12306
12296
|
|
|
12307
|
-
var
|
|
12308
|
-
|
|
12309
|
-
messageService = _this$props10.messageService;
|
|
12310
|
-
var channel = messageService.getChannel(name);
|
|
12297
|
+
var messageService = this.props.messageService;
|
|
12298
|
+
var channel = messageService.getChannel("chat");
|
|
12311
12299
|
|
|
12312
12300
|
if (!channel) {
|
|
12313
12301
|
throw new errors/* AdaEmbedError */.S("`channel` is not defined");
|
|
@@ -12322,11 +12310,12 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
|
|
|
12322
12310
|
value: function frameLoaded() {
|
|
12323
12311
|
var _this6 = this;
|
|
12324
12312
|
|
|
12325
|
-
var _this$
|
|
12326
|
-
handle = _this$
|
|
12327
|
-
adaSettings = _this$
|
|
12313
|
+
var _this$props9 = this.props,
|
|
12314
|
+
handle = _this$props9.handle,
|
|
12315
|
+
adaSettings = _this$props9.adaSettings; // SUP-1141- TODO: Remove chatFrameTimeoutCallback
|
|
12328
12316
|
|
|
12329
|
-
var
|
|
12317
|
+
var _ref7 = adaSettings,
|
|
12318
|
+
chatFrameTimeoutCallback = _ref7.chatFrameTimeoutCallback;
|
|
12330
12319
|
this.chatRenderTimeout = window.setTimeout(function () {
|
|
12331
12320
|
var _this6$channel;
|
|
12332
12321
|
|
|
@@ -12341,18 +12330,17 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
|
|
|
12341
12330
|
chatFrameTimeoutCallback();
|
|
12342
12331
|
}
|
|
12343
12332
|
|
|
12344
|
-
publishEvent("ada:chat_frame_timeout",
|
|
12333
|
+
publishEvent("ada:chat_frame_timeout", undefined);
|
|
12345
12334
|
}
|
|
12346
12335
|
}, 5000);
|
|
12347
12336
|
}
|
|
12348
12337
|
}, {
|
|
12349
12338
|
key: "render",
|
|
12350
12339
|
value: function render() {
|
|
12351
|
-
var _this$
|
|
12352
|
-
|
|
12353
|
-
|
|
12354
|
-
|
|
12355
|
-
var iFrameName = "ada-".concat(name, "-frame");
|
|
12340
|
+
var _this$props10 = this.props,
|
|
12341
|
+
client = _this$props10.client,
|
|
12342
|
+
isDrawerOpen = _this$props10.isDrawerOpen;
|
|
12343
|
+
var iFrameName = "ada-chat-frame";
|
|
12356
12344
|
|
|
12357
12345
|
var roleDescription = function roleDescription() {
|
|
12358
12346
|
var _context23;
|
|
@@ -12365,7 +12353,7 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
|
|
|
12365
12353
|
};
|
|
12366
12354
|
|
|
12367
12355
|
return v("iframe", {
|
|
12368
|
-
src: this.
|
|
12356
|
+
src: this.getIframeSrc(),
|
|
12369
12357
|
scrolling: "no",
|
|
12370
12358
|
style: this.chooseStyles,
|
|
12371
12359
|
frameBorder: "0",
|
|
@@ -13508,7 +13496,7 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
13508
13496
|
|
|
13509
13497
|
_context8.prev = 14;
|
|
13510
13498
|
_context8.next = 17;
|
|
13511
|
-
return (0,http/*
|
|
13499
|
+
return (0,http/* httpRequest */.c)({
|
|
13512
13500
|
url: "".concat(baseApiUrl, "business_events/")
|
|
13513
13501
|
});
|
|
13514
13502
|
|
|
@@ -13532,7 +13520,7 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
13532
13520
|
|
|
13533
13521
|
_context8.prev = 26;
|
|
13534
13522
|
_context8.next = 29;
|
|
13535
|
-
return (0,http/*
|
|
13523
|
+
return (0,http/* httpRequest */.c)({
|
|
13536
13524
|
url: "".concat(baseApiUrl, "campaigns/")
|
|
13537
13525
|
});
|
|
13538
13526
|
|
|
@@ -13661,7 +13649,6 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
13661
13649
|
}, {
|
|
13662
13650
|
key: "renderChatFrame",
|
|
13663
13651
|
value: function renderChatFrame() {
|
|
13664
|
-
var name = CHAT_IFRAME;
|
|
13665
13652
|
var _this$props14 = this.props,
|
|
13666
13653
|
messageService = _this$props14.messageService,
|
|
13667
13654
|
store = _this$props14.store,
|
|
@@ -13672,7 +13659,6 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
13672
13659
|
|
|
13673
13660
|
if (this.shouldRenderChatFrame) {
|
|
13674
13661
|
return v(components_ChatFrame, {
|
|
13675
|
-
name: name,
|
|
13676
13662
|
setChatHasBeenRendered: this.setChatHasBeenRenderedBound,
|
|
13677
13663
|
adaSettings: adaSettings,
|
|
13678
13664
|
store: store,
|
|
@@ -13881,8 +13867,6 @@ var Embed = /*#__PURE__*/function () {
|
|
|
13881
13867
|
|
|
13882
13868
|
(0,defineProperty/* default */.Z)(this, "messageService", void 0);
|
|
13883
13869
|
|
|
13884
|
-
(0,defineProperty/* default */.Z)(this, "buttonWasMoved", void 0);
|
|
13885
|
-
|
|
13886
13870
|
(0,defineProperty/* default */.Z)(this, "adaSettings", void 0);
|
|
13887
13871
|
|
|
13888
13872
|
(0,defineProperty/* default */.Z)(this, "initialized", void 0);
|
|
@@ -13974,7 +13958,7 @@ var Embed = /*#__PURE__*/function () {
|
|
|
13974
13958
|
key: "setUpFrameParent",
|
|
13975
13959
|
value: function setUpFrameParent() {
|
|
13976
13960
|
var parentElement = this.adaSettings.parentElement;
|
|
13977
|
-
var targetElement;
|
|
13961
|
+
var targetElement = null;
|
|
13978
13962
|
|
|
13979
13963
|
if (!parentElement) {
|
|
13980
13964
|
return null;
|
|
@@ -14335,7 +14319,7 @@ var Embed = /*#__PURE__*/function () {
|
|
|
14335
14319
|
case 9:
|
|
14336
14320
|
_context12.prev = 9;
|
|
14337
14321
|
_context12.t0 = _context12["catch"](4);
|
|
14338
|
-
throw new errors/* AdaEmbedError */.S(_context12.t0);
|
|
14322
|
+
throw new errors/* AdaEmbedError */.S("".concat(_context12.t0));
|
|
14339
14323
|
|
|
14340
14324
|
case 12:
|
|
14341
14325
|
case "end":
|
|
@@ -14416,9 +14400,9 @@ window.__AdaEmbedConstructor = Embed;
|
|
|
14416
14400
|
/* harmony export */ "yv": function() { return /* binding */ isProduction; },
|
|
14417
14401
|
/* harmony export */ "Mk": function() { return /* binding */ embed2Version; }
|
|
14418
14402
|
/* harmony export */ });
|
|
14419
|
-
var isModern = new RegExp("((CPU[ +]OS|iPhone[ +]OS|CPU[ +]iPhone|CPU IPhone OS)[ +]+(15|(1[6-9]|[2-9]\\d|\\d{3,}))[_.]\\d+(?:[_.]\\d+)?)|((Chromium|Chrome)\\/(
|
|
14403
|
+
var isModern = new RegExp("((CPU[ +]OS|iPhone[ +]OS|CPU[ +]iPhone|CPU IPhone OS)[ +]+(15|(1[6-9]|[2-9]\\d|\\d{3,}))[_.]\\d+(?:[_.]\\d+)?)|((Chromium|Chrome)\\/(100|(10[1-9]|1[1-9]\\d|[2-9]\\d\\d|\\d{4,}))\\.\\d+(?:\\.\\d+)?)|(Version\\/(15|(1[6-9]|[2-9]\\d|\\d{3,}))\\.\\d+(?:\\.\\d+)? Safari\\/)|(Firefox\\/(99|([1-9]\\d\\d|\\d{4,}))\\.\\d+\\.\\d+)|(Firefox\\/(99|([1-9]\\d\\d|\\d{4,}))\\.\\d+(pre|[ab]\\d+[a-z]*)?)").test(navigator.userAgent);
|
|
14420
14404
|
var isProduction = "production" === "production";
|
|
14421
|
-
var embed2Version = "
|
|
14405
|
+
var embed2Version = "c54a4e9";
|
|
14422
14406
|
|
|
14423
14407
|
/***/ }),
|
|
14424
14408
|
|
|
@@ -14613,7 +14597,7 @@ function warn(warningText) {
|
|
|
14613
14597
|
|
|
14614
14598
|
"use strict";
|
|
14615
14599
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
14616
|
-
/* harmony export */ "
|
|
14600
|
+
/* harmony export */ "c": function() { return /* binding */ httpRequest; }
|
|
14617
14601
|
/* harmony export */ });
|
|
14618
14602
|
/* harmony import */ var _babel_runtime_corejs3_core_js_stable_promise__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(875);
|
|
14619
14603
|
/* harmony import */ var _babel_runtime_corejs3_core_js_stable_promise__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_promise__WEBPACK_IMPORTED_MODULE_0__);
|
|
@@ -14628,20 +14612,19 @@ function warn(warningText) {
|
|
|
14628
14612
|
function httpRequest(obj) {
|
|
14629
14613
|
return new (_babel_runtime_corejs3_core_js_stable_promise__WEBPACK_IMPORTED_MODULE_0___default())(function (resolve, reject) {
|
|
14630
14614
|
var method = obj.method || "GET";
|
|
14615
|
+
var headers = obj.headers;
|
|
14631
14616
|
var xhr = new XMLHttpRequest();
|
|
14632
14617
|
|
|
14633
14618
|
if ("withCredentials" in xhr) {
|
|
14634
14619
|
// XMLHttpRequest for Chrome/Firefox/Opera/Safari.
|
|
14635
14620
|
xhr.open(method, obj.url, true);
|
|
14636
14621
|
} else {
|
|
14637
|
-
// CORS not supported.
|
|
14638
|
-
xhr = null;
|
|
14639
14622
|
return;
|
|
14640
14623
|
}
|
|
14641
14624
|
|
|
14642
|
-
if (
|
|
14643
|
-
_babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_1___default()(
|
|
14644
|
-
xhr.setRequestHeader(key,
|
|
14625
|
+
if (headers) {
|
|
14626
|
+
_babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_1___default()(headers).forEach(function (key) {
|
|
14627
|
+
xhr.setRequestHeader(key, headers[key]);
|
|
14645
14628
|
});
|
|
14646
14629
|
}
|
|
14647
14630
|
|
|
@@ -14754,7 +14737,7 @@ function _log() {
|
|
|
14754
14737
|
|
|
14755
14738
|
case 2:
|
|
14756
14739
|
_context.next = 4;
|
|
14757
|
-
return (0,common_helpers_http__WEBPACK_IMPORTED_MODULE_12__/*
|
|
14740
|
+
return (0,common_helpers_http__WEBPACK_IMPORTED_MODULE_12__/* .httpRequest */ .c)({
|
|
14758
14741
|
url: "".concat(DD_BASE_URL).concat(DD_TOKEN, "?ddsource=browser&ddtags=version:1.5.0"),
|
|
14759
14742
|
method: "POST",
|
|
14760
14743
|
body: _babel_runtime_corejs3_core_js_stable_json_stringify__WEBPACK_IMPORTED_MODULE_10___default()(_objectSpread(_objectSpread({
|
|
@@ -14764,9 +14747,9 @@ function _log() {
|
|
|
14764
14747
|
service: "embed",
|
|
14765
14748
|
env: "production",
|
|
14766
14749
|
embedVersion: 2,
|
|
14767
|
-
version: "1.1.
|
|
14750
|
+
version: "1.1.9",
|
|
14768
14751
|
isNpm: true,
|
|
14769
|
-
commitHash: "
|
|
14752
|
+
commitHash: "c54a4e9"
|
|
14770
14753
|
}))
|
|
14771
14754
|
});
|
|
14772
14755
|
|
|
@@ -25707,7 +25690,7 @@ function _loadClientChunk() {
|
|
|
25707
25690
|
polyfillVersionString = "legacy";
|
|
25708
25691
|
}
|
|
25709
25692
|
|
|
25710
|
-
clientScriptSource = concat_default()(_context17 = concat_default()(_context18 = "".concat(host, "/embed/")).call(_context18, polyfillVersionString, "/client/")).call(_context17, "
|
|
25693
|
+
clientScriptSource = concat_default()(_context17 = concat_default()(_context18 = "".concat(host, "/embed/")).call(_context18, polyfillVersionString, "/client/")).call(_context17, "c54a4e9", "/index.js");
|
|
25711
25694
|
} // `window.__AdaEmbedConstructor` gets created in the "client" bundle
|
|
25712
25695
|
|
|
25713
25696
|
|
|
@@ -25812,14 +25795,22 @@ function createEmbedObject() {
|
|
|
25812
25795
|
return loadClientChunk(adaSettings);
|
|
25813
25796
|
|
|
25814
25797
|
case 5:
|
|
25815
|
-
if (
|
|
25798
|
+
if (window.__AdaEmbedConstructor) {
|
|
25816
25799
|
_context2.next = 7;
|
|
25817
25800
|
break;
|
|
25818
25801
|
}
|
|
25819
25802
|
|
|
25820
|
-
throw new
|
|
25803
|
+
throw new Error("`window.__AdaEmbedConstructor` is not defined");
|
|
25821
25804
|
|
|
25822
25805
|
case 7:
|
|
25806
|
+
if (!(adaSettings.customDomains && window.__AdaEmbedConstructor.embed2Version !== config_info/* embed2Version */.Mk)) {
|
|
25807
|
+
_context2.next = 9;
|
|
25808
|
+
break;
|
|
25809
|
+
}
|
|
25810
|
+
|
|
25811
|
+
throw new errors/* AdaEmbedError */.S("Entry script version does not match version specified in customDomains.");
|
|
25812
|
+
|
|
25813
|
+
case 9:
|
|
25823
25814
|
/**
|
|
25824
25815
|
* We bind the window.__AdaEmbed instead of importing the Embed class because entry is a
|
|
25825
25816
|
* separate bundle.
|
|
@@ -25840,7 +25831,7 @@ function createEmbedObject() {
|
|
|
25840
25831
|
});
|
|
25841
25832
|
return _context2.abrupt("return", embed.initialized);
|
|
25842
25833
|
|
|
25843
|
-
case
|
|
25834
|
+
case 13:
|
|
25844
25835
|
case "end":
|
|
25845
25836
|
return _context2.stop();
|
|
25846
25837
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ada-support/embed2",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.9",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/npm-entry",
|
|
6
6
|
"typings": "dist/npm-entry/index.d.ts",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"build:modern": "NODE_ENV=production BROWSERSLIST_ENV=modern npx webpack --config webpack.prod.ts",
|
|
11
11
|
"build:npm-types": "tsc --project tsconfig.npm.json --declaration --outDir dist/npm-entry --emitDeclarationOnly --allowJs false --checkJs false",
|
|
12
12
|
"build:npm": "./npm-build.sh",
|
|
13
|
-
"lint": "tsc --noEmit --strict false && ./node_modules/.bin/eslint --report-unused-disable-directives --ext .js,.jsx,.ts,.tsx . --max-warnings
|
|
13
|
+
"lint": "tsc --noEmit --strict false && ./node_modules/.bin/eslint --report-unused-disable-directives --ext .js,.jsx,.ts,.tsx . --max-warnings 28",
|
|
14
14
|
"lint:fix": "yarn lint --fix",
|
|
15
15
|
"deploy-legacy": "TS_NODE_PROJECT=wp.tsconfig.json NODE_ENV=production BROWSERSLIST_ENV=legacy npx webpack --config webpack.prod.ts",
|
|
16
16
|
"deploy-modern": "TS_NODE_PROJECT=wp.tsconfig.json NODE_ENV=production BROWSERSLIST_ENV=modern npx webpack --config webpack.prod.ts",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"author": "",
|
|
55
55
|
"license": "ISC",
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@ada-support/embed-types": "^1.0.
|
|
57
|
+
"@ada-support/embed-types": "^1.0.4",
|
|
58
58
|
"@ada-support/eslint-config-ada": "^1.2.1",
|
|
59
59
|
"@types/enzyme": "^3.10.11",
|
|
60
60
|
"@types/jest": "^27.0.2",
|