@sidebandai/sideband-core 1.4.6 → 1.4.7-rc.1
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 +2 -4
- package/dist/core/survey-session-store.d.ts +8 -4
- package/dist/core/survey-session-store.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +163 -161
- package/dist/types.d.ts +5 -3
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -49,11 +49,9 @@ pulses.
|
|
|
49
49
|
If your site sends a Content Security Policy, allow the Sideband API origin in
|
|
50
50
|
`connect-src`. Without it, the browser blocks every send.
|
|
51
51
|
|
|
52
|
-
|
|
|
52
|
+
| Channel | Origin to allow |
|
|
53
53
|
| --- | --- |
|
|
54
|
-
| Production
|
|
55
|
-
| Development (`syncEndpoint: 'dev'`) | `https://api.dev-sideband.ai` |
|
|
56
|
-
| A custom `baseUrl` | That URL's origin |
|
|
54
|
+
| Development or Production | `https://api.sideband.ai` |
|
|
57
55
|
|
|
58
56
|
```text
|
|
59
57
|
connect-src 'self' https://api.sideband.ai
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Interaction, Pulse, PulseAnswer, PulseCompletion, PulseCompletionAction, PulseQuestion, SidebandCoreConfig, SentimentPresentationOptions, BarPosition,
|
|
1
|
+
import type { Interaction, Pulse, PulseAnswer, PulseCompletion, PulseCompletionAction, PulseQuestion, SidebandCoreConfig, SentimentPresentationOptions, BarPosition, SimulatedPulseDefinition, SurveyAnswerMap, SurveyAnswerValue, SurveyPresentationKind, SyncResponse } from '../types';
|
|
2
2
|
export type FabState = 'hidden' | 'expanded';
|
|
3
3
|
export type SurveyAnswerDraft = {
|
|
4
4
|
answer_key?: string;
|
|
@@ -8,7 +8,6 @@ export type SurveySessionState = {
|
|
|
8
8
|
presentationId: number;
|
|
9
9
|
sentimentPresentation: 'sheet' | 'snackbar' | 'bar';
|
|
10
10
|
barPosition: BarPosition;
|
|
11
|
-
barBehavior: BarBehavior;
|
|
12
11
|
isSimulated: boolean;
|
|
13
12
|
snackbar: SnackbarState | null;
|
|
14
13
|
survey: Pulse;
|
|
@@ -46,7 +45,7 @@ export type SurveyStoreSnapshot = {
|
|
|
46
45
|
};
|
|
47
46
|
export type SurveyStoreUpdateReason = 'transition' | 'text' | 'select' | 'destroyed';
|
|
48
47
|
export type SurveyStoreListener = (reason?: SurveyStoreUpdateReason) => void;
|
|
49
|
-
type SurveyStoreDeps = {
|
|
48
|
+
type SurveyStoreDeps = SentimentPresentationOptions & {
|
|
50
49
|
syncInteraction: (interaction: Interaction) => Promise<unknown>;
|
|
51
50
|
trackEvent?: (eventName: string, metadata?: Record<string, string>) => void;
|
|
52
51
|
shouldPresentPulse?: SidebandCoreConfig['shouldPresentPulse'];
|
|
@@ -57,6 +56,12 @@ export declare function buildFabTitle(pulse: Pulse): string;
|
|
|
57
56
|
export declare function getChoiceValue(choice: PulseAnswer): string;
|
|
58
57
|
/** Identifies the reserved, case-sensitive canonical Other choice. */
|
|
59
58
|
export declare function isSystemOtherChoice(choice: PulseAnswer): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Time from a bar answer until the store opens the follow-up card. The bar
|
|
61
|
+
* shows its acknowledgment card for this time (Figma 5245:20537: the message
|
|
62
|
+
* starts to leave 1755 ms after the tap). Other compact entries open at 500 ms.
|
|
63
|
+
*/
|
|
64
|
+
export declare const BAR_ACKNOWLEDGEMENT_MS = 1755;
|
|
60
65
|
export declare function isPositiveSentimentChoice(choice: PulseAnswer): boolean;
|
|
61
66
|
/**
|
|
62
67
|
* Framework-neutral state machine for a canonical node-keyed pending pulse.
|
|
@@ -123,7 +128,6 @@ export declare class SurveySessionStore {
|
|
|
123
128
|
private commitCurrentAnswer;
|
|
124
129
|
private advanceFrom;
|
|
125
130
|
private completeTerminal;
|
|
126
|
-
private dismiss;
|
|
127
131
|
private dismissOrPartial;
|
|
128
132
|
private queueInteraction;
|
|
129
133
|
private emitPresentationEvent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"survey-session-store.d.ts","sourceRoot":"","sources":["../../src/core/survey-session-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,KAAK,EACL,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,aAAa,EACb,kBAAkB,
|
|
1
|
+
{"version":3,"file":"survey-session-store.d.ts","sourceRoot":"","sources":["../../src/core/survey-session-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,KAAK,EACL,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,aAAa,EACb,kBAAkB,EAClB,4BAA4B,EAC5B,WAAW,EACX,wBAAwB,EACxB,eAAe,EACf,iBAAiB,EAGjB,sBAAsB,EACtB,YAAY,EACb,MAAM,UAAU,CAAA;AAEjB,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAA;AAE5C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,cAAc,EAAE,MAAM,CAAA;IACtB,qBAAqB,EAAE,OAAO,GAAG,UAAU,GAAG,KAAK,CAAA;IACnD,WAAW,EAAE,WAAW,CAAA;IACxB,WAAW,EAAE,OAAO,CAAA;IACpB,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAA;IAC9B,MAAM,EAAE,KAAK,CAAA;IACb,OAAO,EAAE,eAAe,CAAA;IACxB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;IACzC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,UAAU,EAAE,eAAe,GAAG,IAAI,CAAA;IAClC,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,QAAQ,EAAE,QAAQ,CAAA;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11 +3,11 @@ export type { SidebandClient } from './client/create-sideband-client';
|
|
|
3
3
|
export { createContextResolver, getDeviceId, getSessionId } from './core/context';
|
|
4
4
|
export { createSidebandRuntime } from './core/create-sideband-runtime';
|
|
5
5
|
export { resolveSnackbarPresentation } from './core/snackbar-presentation';
|
|
6
|
-
export { SurveySessionStore, buildFabTitle, getChoiceValue, isSystemOtherChoice, isPositiveSentimentChoice, } from './core/survey-session-store';
|
|
6
|
+
export { SurveySessionStore, BAR_ACKNOWLEDGEMENT_MS, buildFabTitle, getChoiceValue, isSystemOtherChoice, isPositiveSentimentChoice, } from './core/survey-session-store';
|
|
7
7
|
export { SyncEngine } from './core/sync-engine';
|
|
8
8
|
export type { InteractionPersistence, PersistedInteraction, SyncEngineDeps, SyncEngineOptions, } from './core/sync-engine';
|
|
9
9
|
export { PendingInteractionStorageError } from './core/pending-interactions';
|
|
10
10
|
export type { PendingInteractionStorageReason } from './core/pending-interactions';
|
|
11
11
|
export type { FabState, SurveyAnswerDraft, SnackbarState, SurveySessionState, SurveyStoreSnapshot, SurveyStoreUpdateReason, } from './core/survey-session-store';
|
|
12
|
-
export type { AnsweredInteraction, ApiErrorDetail, ClientContext, CompletionActionStyle, CompletionActionType, CompletionIconType, CompletionType, DismissedInteraction, EventMetadata, EventRecord, Fab, FabOffset, FabPlacement, FabPoint, Interaction, Platform, PendingPulse, SyncEndpoint, Pulse, PulseAnswer, PulseCompletion, PulseCompletionAction, PulseQuestion, QuestionType, SentimentPresentation, SentimentPresentationOptions, BarPosition,
|
|
12
|
+
export type { AnsweredInteraction, ApiErrorDetail, ClientContext, CompletionActionStyle, CompletionActionType, CompletionIconType, CompletionType, DismissedInteraction, EventMetadata, EventRecord, Fab, FabOffset, FabPlacement, FabPoint, Interaction, Platform, PendingPulse, SyncEndpoint, Pulse, PulseAnswer, PulseCompletion, PulseCompletionAction, PulseQuestion, QuestionType, SentimentPresentation, SentimentPresentationOptions, BarPosition, SimulatedPulseDefinition, SidebandClientConfig, SidebandCoreConfig, SidebandRuntime, SidebandRuntimeConfig, SurveyAnswerMap, SurveyAnswerValue, SurveyPresentationDecision, PresentedPulseKind, SurveyPresentationKind, SyncErrorResponse, ServiceUnavailableError, SyncOptions, SyncRequest, SyncResponse, TrackedEvent, TrackOptions, Theme, ThemeColor, TimerStyle, } from './types';
|
|
13
13
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AACxF,YAAY,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AACrE,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAA;AACtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAA;AAC1E,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,YAAY,EACV,sBAAsB,EACtB,oBAAoB,EACpB,cAAc,EACd,iBAAiB,GAClB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAA;AAC5E,YAAY,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAA;AAClF,YAAY,EACV,QAAQ,EACR,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,6BAA6B,CAAA;AACpC,YAAY,EACV,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,E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,EACb,WAAW,EACX,GAAG,EACH,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,KAAK,EACL,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,aAAa,EACb,YAAY,EACZ,qBAAqB,EACrB,4BAA4B,EAC5B,WAAW,EACX,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,eAAe,EACf,iBAAiB,EACjB,0BAA0B,EAC1B,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,uBAAuB,EACvB,WAAW,EACX,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,KAAK,EACL,UAAU,EACV,UAAU,GACX,MAAM,SAAS,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -52,7 +52,7 @@ function d() {
|
|
|
52
52
|
r("local")?.removeItem(e);
|
|
53
53
|
} catch {}
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function f(e, t = "1.4.7-rc.1") {
|
|
56
56
|
let n = {
|
|
57
57
|
device_id: s(),
|
|
58
58
|
platform: "web",
|
|
@@ -67,54 +67,54 @@ function ee(e, t = "1.4.6") {
|
|
|
67
67
|
}
|
|
68
68
|
return n;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function ee(e) {
|
|
71
71
|
return Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0));
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function p(e, t, n) {
|
|
74
74
|
return async () => {
|
|
75
75
|
let r = typeof t == "function" ? await t() : t;
|
|
76
76
|
return {
|
|
77
|
-
...
|
|
78
|
-
...
|
|
77
|
+
...f(e, n),
|
|
78
|
+
...ee(r ?? {})
|
|
79
79
|
};
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
82
|
//#endregion
|
|
83
83
|
//#region src/core/validate-input.ts
|
|
84
|
-
function
|
|
84
|
+
function te(e) {
|
|
85
85
|
if (typeof e != "string" || !e.trim()) throw TypeError("Sideband.configure apiKey must be a non-empty string.");
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function m(e, t = "Sideband.configure appVersion") {
|
|
88
88
|
if (typeof e != "string" || !e.trim() || Array.from(e).length > 64) throw TypeError(`${t} must be a non-empty string of at most 64 characters.`);
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function h(e, t) {
|
|
91
91
|
if (typeof e != "string" || !e.length) throw TypeError("Sideband.track eventName must be a non-empty string.");
|
|
92
92
|
if (t !== void 0) {
|
|
93
93
|
if (typeof t != "object" || !t || Array.isArray(t)) throw TypeError("Sideband.track metadata must be a string-to-string map.");
|
|
94
94
|
for (let [e, n] of Object.entries(t)) if (typeof n != "string") throw TypeError(`Sideband.track metadata value for "${e}" must be a string.`);
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function ne(e) {
|
|
98
98
|
return Array.from(e).length;
|
|
99
99
|
}
|
|
100
|
-
function
|
|
101
|
-
return
|
|
100
|
+
function g(e) {
|
|
101
|
+
return ne(e) > 256;
|
|
102
102
|
}
|
|
103
103
|
//#endregion
|
|
104
104
|
//#region src/core/sync-attempt.ts
|
|
105
|
-
var
|
|
106
|
-
function
|
|
105
|
+
var _ = Symbol("sideband.syncAttemptMetadata"), v = /* @__PURE__ */ new WeakSet();
|
|
106
|
+
function re(e, t) {
|
|
107
107
|
let n = { ...e };
|
|
108
|
-
return n[
|
|
108
|
+
return n[_] = t, n;
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
return e?.[
|
|
110
|
+
function ie(e) {
|
|
111
|
+
return e?.[_];
|
|
112
112
|
}
|
|
113
113
|
function ae(e) {
|
|
114
|
-
(typeof e == "object" && e || typeof e == "function") &&
|
|
114
|
+
(typeof e == "object" && e || typeof e == "function") && v.add(e);
|
|
115
115
|
}
|
|
116
116
|
function oe(e) {
|
|
117
|
-
return (typeof e == "object" && !!e || typeof e == "function") &&
|
|
117
|
+
return (typeof e == "object" && !!e || typeof e == "function") && v.has(e);
|
|
118
118
|
}
|
|
119
119
|
//#endregion
|
|
120
120
|
//#region src/client/create-sideband-client.ts
|
|
@@ -128,20 +128,20 @@ function b(e) {
|
|
|
128
128
|
if (typeof fetch != "function") throw Error("Sideband requires a fetch implementation.");
|
|
129
129
|
return fetch;
|
|
130
130
|
}
|
|
131
|
-
async function
|
|
131
|
+
async function ce(e) {
|
|
132
132
|
return typeof e == "function" ? await e() : e;
|
|
133
133
|
}
|
|
134
|
-
async function
|
|
134
|
+
async function le(e) {
|
|
135
135
|
let t = typeof e == "function" ? await e() : e;
|
|
136
136
|
return new Headers(t);
|
|
137
137
|
}
|
|
138
|
-
function
|
|
138
|
+
function x(e) {
|
|
139
139
|
return e.baseUrl ?? y[e.syncEndpoint ?? "prod"];
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function ue(e) {
|
|
142
142
|
return new URL(se, e).toString();
|
|
143
143
|
}
|
|
144
|
-
async function
|
|
144
|
+
async function de(e) {
|
|
145
145
|
let t = await e.text();
|
|
146
146
|
if (!t) return null;
|
|
147
147
|
try {
|
|
@@ -150,10 +150,10 @@ async function ue(e) {
|
|
|
150
150
|
return t;
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function fe(e, t) {
|
|
154
154
|
return typeof e == "object" && e && "error" in e && typeof e.error == "object" && e.error !== null && "message" in e.error && typeof e.error.message == "string" ? e.error.message : t;
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function pe(e) {
|
|
157
157
|
let t = e.headers.get("retry-after");
|
|
158
158
|
if (!t) return;
|
|
159
159
|
let n = Number(t);
|
|
@@ -161,7 +161,7 @@ function fe(e) {
|
|
|
161
161
|
let r = Date.parse(t);
|
|
162
162
|
if (!Number.isNaN(r)) return Math.max((r - Date.now()) / 1e3, 0);
|
|
163
163
|
}
|
|
164
|
-
var
|
|
164
|
+
var S = class extends Error {
|
|
165
165
|
status;
|
|
166
166
|
body;
|
|
167
167
|
retryAfterSeconds;
|
|
@@ -169,14 +169,14 @@ var C = class extends Error {
|
|
|
169
169
|
super(e), this.name = "SidebandApiError", this.status = t, this.body = n, this.retryAfterSeconds = r;
|
|
170
170
|
}
|
|
171
171
|
};
|
|
172
|
-
function
|
|
173
|
-
if (
|
|
172
|
+
function C(e) {
|
|
173
|
+
if (te(e.apiKey), e.syncEndpoint !== void 0 && !Object.hasOwn(y, e.syncEndpoint)) throw TypeError("Sideband.configure syncEndpoint must be local, dev, or prod.");
|
|
174
174
|
async function t(t, n) {
|
|
175
|
-
let r = b(e.fetch), i = t.context ?? await
|
|
176
|
-
|
|
177
|
-
let a = await
|
|
175
|
+
let r = b(e.fetch), i = t.context ?? await ce(e.context);
|
|
176
|
+
m(i.app_version, "Sideband context.app_version");
|
|
177
|
+
let a = await le(e.headers), o = ie(n);
|
|
178
178
|
a.set("content-type", "application/json"), a.set("x-bc-api-key", e.apiKey), a.set("x-bc-sync-attempt", String(o?.attempt ?? 1)), o?.retryReason ? a.set("x-bc-sync-retry-reason", o.retryReason) : a.delete("x-bc-sync-retry-reason");
|
|
179
|
-
let s =
|
|
179
|
+
let s = ue(x(e)), c = {
|
|
180
180
|
method: "POST",
|
|
181
181
|
headers: a,
|
|
182
182
|
body: JSON.stringify({
|
|
@@ -191,12 +191,12 @@ function w(e) {
|
|
|
191
191
|
} catch (e) {
|
|
192
192
|
throw ae(e), e;
|
|
193
193
|
}
|
|
194
|
-
let u = await
|
|
195
|
-
if (!l.ok) throw new
|
|
194
|
+
let u = await de(l);
|
|
195
|
+
if (!l.ok) throw new S(fe(u, "Sideband sync request failed."), l.status, u, pe(l));
|
|
196
196
|
return u;
|
|
197
197
|
}
|
|
198
198
|
async function r(e, r, i) {
|
|
199
|
-
return
|
|
199
|
+
return h(e, r), t({ events: [{
|
|
200
200
|
event_id: n(),
|
|
201
201
|
event_name: e,
|
|
202
202
|
metadata: r,
|
|
@@ -210,21 +210,21 @@ function w(e) {
|
|
|
210
210
|
}
|
|
211
211
|
//#endregion
|
|
212
212
|
//#region src/core/pending-interactions.ts
|
|
213
|
-
var
|
|
213
|
+
var me = "sideband:pending_interactions:", he = 1440 * 60 * 1e3, ge = /* @__PURE__ */ new Set([
|
|
214
214
|
"completed",
|
|
215
215
|
"partial",
|
|
216
216
|
"not_now",
|
|
217
217
|
"never"
|
|
218
|
-
]),
|
|
218
|
+
]), w = class extends Error {
|
|
219
219
|
reason;
|
|
220
220
|
constructor(e, t, n) {
|
|
221
221
|
super(t, n === void 0 ? void 0 : { cause: n }), this.name = "PendingInteractionStorageError", this.reason = e;
|
|
222
222
|
}
|
|
223
223
|
};
|
|
224
|
-
function
|
|
225
|
-
return `${
|
|
224
|
+
function T(e, t) {
|
|
225
|
+
return `${me}${E(`${t}\n${e}`)}`;
|
|
226
226
|
}
|
|
227
|
-
function
|
|
227
|
+
function E(e) {
|
|
228
228
|
let t = 3735928559, n = 1103547991;
|
|
229
229
|
for (let r = 0; r < e.length; r += 1) {
|
|
230
230
|
let i = e.charCodeAt(r);
|
|
@@ -232,82 +232,82 @@ function D(e) {
|
|
|
232
232
|
}
|
|
233
233
|
return t = Math.imul(t ^ t >>> 16, 2246822507) ^ Math.imul(n ^ n >>> 13, 3266489909), n = Math.imul(n ^ n >>> 16, 2246822507) ^ Math.imul(t ^ t >>> 13, 3266489909), (4294967296 * (2097151 & n) + (t >>> 0)).toString(36);
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function D() {
|
|
236
236
|
if (typeof window > "u") return null;
|
|
237
237
|
try {
|
|
238
238
|
return window.sessionStorage;
|
|
239
239
|
} catch (e) {
|
|
240
|
-
throw new
|
|
240
|
+
throw new w("storage_unavailable", "Sideband cannot use sessionStorage; pending answers are kept for this page only.", e);
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
|
-
function
|
|
243
|
+
function O(e) {
|
|
244
244
|
return e === void 0 || typeof e == "string";
|
|
245
245
|
}
|
|
246
|
-
function
|
|
246
|
+
function k(e) {
|
|
247
247
|
return !!e && typeof e == "object" && !Array.isArray(e) && Object.values(e).every((e) => {
|
|
248
248
|
if (!e || typeof e != "object") return !1;
|
|
249
249
|
let t = e;
|
|
250
|
-
return typeof t.answered_at == "string" &&
|
|
250
|
+
return typeof t.answered_at == "string" && O(t.answer_key) && O(t.value);
|
|
251
251
|
});
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function A(e) {
|
|
254
254
|
if (!e || typeof e != "object") return !1;
|
|
255
255
|
let t = e;
|
|
256
|
-
return typeof t.pulse_id != "string" || typeof t.action != "string" || !
|
|
256
|
+
return typeof t.pulse_id != "string" || typeof t.action != "string" || !ge.has(t.action) || t.pulse_version !== void 0 && typeof t.pulse_version != "number" || !O(t.impression_id) || !O(t.responded_at) ? !1 : t.action === "completed" || t.action === "partial" ? k(t.answers) && O(t.completion_action_id) : !0;
|
|
257
257
|
}
|
|
258
|
-
function
|
|
258
|
+
function j(e) {
|
|
259
259
|
if (!e || typeof e != "object") return !1;
|
|
260
260
|
let t = e;
|
|
261
|
-
return typeof t.stored_at == "number" && (t.user_id === null || typeof t.user_id == "string") &&
|
|
261
|
+
return typeof t.stored_at == "number" && (t.user_id === null || typeof t.user_id == "string") && A(t.interaction);
|
|
262
262
|
}
|
|
263
|
-
function
|
|
264
|
-
let n =
|
|
263
|
+
function M(e, t = Date.now()) {
|
|
264
|
+
let n = D(), r;
|
|
265
265
|
try {
|
|
266
266
|
r = n?.getItem(e) ?? null;
|
|
267
267
|
} catch (e) {
|
|
268
|
-
throw new
|
|
268
|
+
throw new w("storage_unavailable", "Sideband could not read pending answers.", e);
|
|
269
269
|
}
|
|
270
270
|
if (!r) return [];
|
|
271
271
|
try {
|
|
272
272
|
let e = JSON.parse(r);
|
|
273
|
-
return Array.isArray(e) ? e.filter(
|
|
273
|
+
return Array.isArray(e) ? e.filter(j).filter((e) => t - e.stored_at < he).slice(-10) : [];
|
|
274
274
|
} catch {
|
|
275
275
|
return [];
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
|
-
function
|
|
279
|
-
let n =
|
|
278
|
+
function N(e, t) {
|
|
279
|
+
let n = D();
|
|
280
280
|
if (!n) return;
|
|
281
281
|
let r = t.slice(-10);
|
|
282
282
|
try {
|
|
283
283
|
r.length ? n.setItem(e, JSON.stringify(r)) : n.removeItem(e);
|
|
284
284
|
} catch (e) {
|
|
285
|
-
throw new
|
|
285
|
+
throw new w("storage_write_failed", "Sideband could not save pending answers to sessionStorage (it may be full); they are kept for this page only.", e);
|
|
286
286
|
}
|
|
287
|
-
if (r.length < t.length) throw new
|
|
287
|
+
if (r.length < t.length) throw new w("queue_full", "Sideband keeps at most 10 pending answers across page loads; the oldest were not saved.");
|
|
288
288
|
}
|
|
289
289
|
//#endregion
|
|
290
290
|
//#region src/core/sync-engine.ts
|
|
291
|
-
var
|
|
292
|
-
function
|
|
291
|
+
var P = 20, F = 50, I = 1, L = 15, _e = 1e3, ve = 300 * 1e3, R = 2147483647, ye = 1e4;
|
|
292
|
+
function be(e, t, n) {
|
|
293
293
|
return Math.min(Math.max(e, t), n);
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function xe(e) {
|
|
296
296
|
let t = e?.status;
|
|
297
297
|
return typeof t == "number" ? t : void 0;
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function Se(e) {
|
|
300
300
|
let t = e?.status;
|
|
301
301
|
return typeof t != "number" || t === 408 || t === 425 || t === 429 || t >= 500;
|
|
302
302
|
}
|
|
303
|
-
function
|
|
303
|
+
function z(e) {
|
|
304
304
|
let t = e?.retryAfterSeconds;
|
|
305
305
|
return typeof t == "number" && Number.isFinite(t) ? Math.max(t, 0) * 1e3 : void 0;
|
|
306
306
|
}
|
|
307
|
-
function
|
|
308
|
-
return e?.status === 503 &&
|
|
307
|
+
function Ce(e) {
|
|
308
|
+
return e?.status === 503 && z(e) !== void 0 ? "server_retry" : oe(e) ? "network" : "server_error";
|
|
309
309
|
}
|
|
310
|
-
var
|
|
310
|
+
var B = class {
|
|
311
311
|
deps;
|
|
312
312
|
maxBatchSize;
|
|
313
313
|
flushIntervalMs;
|
|
@@ -347,7 +347,7 @@ var V = class {
|
|
|
347
347
|
syncAttempts = 0;
|
|
348
348
|
detachLifecycle = null;
|
|
349
349
|
constructor(e, t = {}) {
|
|
350
|
-
this.deps = e, this.maxBatchSize =
|
|
350
|
+
this.deps = e, this.maxBatchSize = be(t.maxBatchSize ?? P, 1, F), this.flushIntervalMs = Math.max(t.flushIntervalSeconds ?? I, 1) * 1e3, this.retryIntervalMs = Math.max(t.retryIntervalSeconds ?? L, 1) * 1e3, this.maxQueuedEvents = Math.max(t.maxQueuedEvents ?? _e, this.maxBatchSize);
|
|
351
351
|
}
|
|
352
352
|
start() {
|
|
353
353
|
this.started || this.destroyed || (this.started = !0, this.restoreInteractions(), this.attachLifecycle(), this.track("system_app_launch"));
|
|
@@ -366,7 +366,7 @@ var V = class {
|
|
|
366
366
|
};
|
|
367
367
|
}
|
|
368
368
|
track(e, t, n) {
|
|
369
|
-
if (
|
|
369
|
+
if (h(e, t), this.destroyed) return;
|
|
370
370
|
let r = Date.now();
|
|
371
371
|
if (this.enqueueEvent(e, t, n?.timestamp ?? (/* @__PURE__ */ new Date()).toISOString(), r), this.enforceQueueLimit(), e === "system_did_present_pulse") {
|
|
372
372
|
this.requestUrgent();
|
|
@@ -489,7 +489,7 @@ var V = class {
|
|
|
489
489
|
...e.context ? { context: e.context } : {},
|
|
490
490
|
...e.events.length ? { events: e.events.map((e) => e.record) } : {},
|
|
491
491
|
...e.interaction ? { interaction: e.interaction } : {}
|
|
492
|
-
},
|
|
492
|
+
}, re({
|
|
493
493
|
signal: t,
|
|
494
494
|
...e.trigger === "forced-lifecycle" ? { keepalive: !0 } : {}
|
|
495
495
|
}, {
|
|
@@ -527,16 +527,16 @@ var V = class {
|
|
|
527
527
|
this.hasWork() && !this.manualFlushPromise && this.requestRegular();
|
|
528
528
|
}
|
|
529
529
|
handleFailure(e, t) {
|
|
530
|
-
if (this.lastAttemptAccepted = !1, t.interaction &&
|
|
530
|
+
if (this.lastAttemptAccepted = !1, t.interaction && xe(e) === 404) {
|
|
531
531
|
this.dropInteraction(t.interaction), this.clearRetryState(), this.reportError(e), this.regularDueAt = null, this.urgentDueAt = null, this.requestRegular();
|
|
532
532
|
return;
|
|
533
533
|
}
|
|
534
|
-
if (!
|
|
534
|
+
if (!Se(e)) {
|
|
535
535
|
t.interaction && (this.unpersistedInteractions.add(t.interaction), this.persistInteractions()), this.retrySnapshot = null, this.automaticRetrySuspended = !0, this.regularDueAt = null, this.reportError(e);
|
|
536
536
|
return;
|
|
537
537
|
}
|
|
538
|
-
this.failureStreak += 1, t.attempt = Math.min(t.attempt + 1, 1e3), t.retryReason =
|
|
539
|
-
let n =
|
|
538
|
+
this.failureStreak += 1, t.attempt = Math.min(t.attempt + 1, 1e3), t.retryReason = Ce(e), this.retrySnapshot = t;
|
|
539
|
+
let n = z(e), r = Math.min(this.retryIntervalMs * 2 ** (this.failureStreak - 1), ve) * (.5 + Math.random() * .5), i = Math.max(r, n ?? 0);
|
|
540
540
|
this.retryUntil = Date.now() + i, this.regularDueAt = this.retryUntil, t.trigger !== "regular" && (this.pendingForcedRetry = t.trigger), this.failureStreak === 1 && this.reportError(e);
|
|
541
541
|
}
|
|
542
542
|
clearRetryState() {
|
|
@@ -597,7 +597,7 @@ var V = class {
|
|
|
597
597
|
}
|
|
598
598
|
this.pendingForcedRetry = null, this.beginAttempt(t);
|
|
599
599
|
}
|
|
600
|
-
}, Math.min(Math.max(e - Date.now(), 0),
|
|
600
|
+
}, Math.min(Math.max(e - Date.now(), 0), R)));
|
|
601
601
|
}
|
|
602
602
|
clearTimer() {
|
|
603
603
|
this.timerId !== null && (clearTimeout(this.timerId), this.timerId = null), this.timerDueAt = null;
|
|
@@ -664,7 +664,7 @@ var V = class {
|
|
|
664
664
|
storedAt: e.storedAt
|
|
665
665
|
}), this.replayedInteractions.add(e.interaction), e.interaction)), this.restoredInteractions.length && (this.restoreReleaseTimer = setTimeout(() => {
|
|
666
666
|
this.restoreReleaseTimer = null, !(this.destroyed || !this.restoredInteractions.length) && (this.releaseRestoredInteractions(), this.requestRegular());
|
|
667
|
-
},
|
|
667
|
+
}, ye));
|
|
668
668
|
}
|
|
669
669
|
releaseRestoredInteractions() {
|
|
670
670
|
this.restoreReleaseTimer !== null && (clearTimeout(this.restoreReleaseTimer), this.restoreReleaseTimer = null), this.restoredInteractions.length && (this.queuedInteractions = [...this.restoredInteractions, ...this.queuedInteractions], this.restoredInteractions = []);
|
|
@@ -709,34 +709,34 @@ var V = class {
|
|
|
709
709
|
};
|
|
710
710
|
//#endregion
|
|
711
711
|
//#region src/core/create-sideband-runtime.ts
|
|
712
|
-
function
|
|
713
|
-
|
|
714
|
-
let t =
|
|
712
|
+
function we(e) {
|
|
713
|
+
m(e.appVersion);
|
|
714
|
+
let t = Te(e.onError), n = p(e.appVersion, e.context, e.libraryVersion), r = e.context && typeof e.context == "object" ? e.context.user_id ?? null : null, i = async () => {
|
|
715
715
|
let e = await n();
|
|
716
716
|
return r = e.user_id ?? null, t === null ? e : {
|
|
717
717
|
...e,
|
|
718
718
|
user_id: t
|
|
719
719
|
};
|
|
720
|
-
}, a =
|
|
720
|
+
}, a = C({
|
|
721
721
|
baseUrl: e.baseUrl,
|
|
722
722
|
syncEndpoint: e.syncEndpoint,
|
|
723
723
|
apiKey: e.apiKey,
|
|
724
724
|
context: i,
|
|
725
725
|
headers: e.headers,
|
|
726
726
|
fetch: e.fetch
|
|
727
|
-
}), o =
|
|
727
|
+
}), o = T(e.apiKey, x(e)), c = new B({
|
|
728
728
|
sendSync: (e, t) => a.sync(e, t),
|
|
729
729
|
resolveContext: i,
|
|
730
730
|
onSyncResponse: e.onSyncResponse,
|
|
731
731
|
onError: e.onError,
|
|
732
732
|
interactionPersistence: {
|
|
733
|
-
restore: () =>
|
|
733
|
+
restore: () => M(o).map((e) => ({
|
|
734
734
|
interaction: e.interaction,
|
|
735
735
|
owner: e.user_id,
|
|
736
736
|
storedAt: e.stored_at
|
|
737
737
|
})),
|
|
738
738
|
save: (e) => {
|
|
739
|
-
|
|
739
|
+
N(o, e.map((e) => ({
|
|
740
740
|
interaction: e.interaction,
|
|
741
741
|
user_id: e.owner,
|
|
742
742
|
stored_at: e.storedAt
|
|
@@ -751,7 +751,7 @@ function Ce(e) {
|
|
|
751
751
|
maxQueuedEvents: e.maxQueuedEvents,
|
|
752
752
|
maxServerPacingSeconds: e.maxServerPacingSeconds
|
|
753
753
|
}), l = (n) => {
|
|
754
|
-
if (n !== null &&
|
|
754
|
+
if (n !== null && g(n)) {
|
|
755
755
|
e.onError?.(/* @__PURE__ */ Error("Sideband.tagUser rejected a user ID longer than 256 characters."));
|
|
756
756
|
return;
|
|
757
757
|
}
|
|
@@ -776,13 +776,13 @@ function Ce(e) {
|
|
|
776
776
|
destroy: () => c.destroy()
|
|
777
777
|
};
|
|
778
778
|
}
|
|
779
|
-
function
|
|
779
|
+
function Te(e) {
|
|
780
780
|
let t = l();
|
|
781
|
-
return t === null || !
|
|
781
|
+
return t === null || !g(t) ? t : (d(), e?.(/* @__PURE__ */ Error("Sideband cleared a stored user ID longer than 256 characters.")), null);
|
|
782
782
|
}
|
|
783
783
|
//#endregion
|
|
784
784
|
//#region src/core/snackbar-presentation.ts
|
|
785
|
-
function
|
|
785
|
+
function Ee(e) {
|
|
786
786
|
if (!e || typeof e != "object") return !1;
|
|
787
787
|
let t = e;
|
|
788
788
|
return [
|
|
@@ -796,39 +796,40 @@ function Te(e) {
|
|
|
796
796
|
return typeof r == "number" && Number.isFinite(r) && typeof i == "number" && Number.isFinite(i) && (e !== "offset" || Number.isInteger(r) && Number.isInteger(i));
|
|
797
797
|
});
|
|
798
798
|
}
|
|
799
|
-
function
|
|
799
|
+
function De(e, t) {
|
|
800
800
|
return {
|
|
801
801
|
imageUrl: e.imageUrl ?? t?.imageUrl,
|
|
802
|
-
placement:
|
|
802
|
+
placement: Ee(e.placement) ? e.placement : t?.placement
|
|
803
803
|
};
|
|
804
804
|
}
|
|
805
805
|
//#endregion
|
|
806
806
|
//#region src/core/survey-session-store.ts
|
|
807
|
-
var
|
|
807
|
+
var V = {
|
|
808
808
|
destroyed: !1,
|
|
809
809
|
state: null
|
|
810
|
-
},
|
|
811
|
-
function
|
|
810
|
+
}, Oe = 0;
|
|
811
|
+
function ke(e) {
|
|
812
812
|
return e.fab?.title ?? e.title;
|
|
813
813
|
}
|
|
814
|
-
function
|
|
814
|
+
function Ae(e) {
|
|
815
815
|
return e.id;
|
|
816
816
|
}
|
|
817
|
-
function
|
|
817
|
+
function H(e) {
|
|
818
818
|
return typeof e.impression_id == "string" ? `${e.pulse_id}:${e.version}:${e.impression_id}` : `${e.pulse_id}:${e.version}`;
|
|
819
819
|
}
|
|
820
|
-
function
|
|
820
|
+
function U(e) {
|
|
821
821
|
return typeof e.impression_id == "string" ? { impression_id: e.impression_id } : {};
|
|
822
822
|
}
|
|
823
|
-
function
|
|
823
|
+
function W(e, t) {
|
|
824
824
|
return t ? e.questions[t] ?? null : null;
|
|
825
825
|
}
|
|
826
|
-
function
|
|
826
|
+
function G(e, t) {
|
|
827
827
|
return t ? e.completions[t] ?? null : null;
|
|
828
828
|
}
|
|
829
|
-
function
|
|
829
|
+
function K(e) {
|
|
830
830
|
return e.id === "system_other";
|
|
831
831
|
}
|
|
832
|
+
var q = 1755;
|
|
832
833
|
function J(e) {
|
|
833
834
|
let t = `${e.id} ${e.label}`.toLowerCase();
|
|
834
835
|
return !t.includes("no") && !t.includes("down") && !t.includes("bad");
|
|
@@ -836,8 +837,11 @@ function J(e) {
|
|
|
836
837
|
function Y(e) {
|
|
837
838
|
return e.type === "yes_no" || e.type === "multiple_choice";
|
|
838
839
|
}
|
|
840
|
+
function je(e, t, n) {
|
|
841
|
+
return t?.type !== "yes_no" || t.answers?.length !== 2 || t.answers.some(K) ? "sheet" : e.sentimentPresentation === void 0 ? t.isSnackBar == null ? n === "bar" ? "bar" : n === "snackbar" && e.fab ? "snackbar" : "sheet" : t.isSnackBar ? "snackbar" : "sheet" : e.sentimentPresentation === "toolbar" ? "bar" : e.sentimentPresentation === "snackbar" ? "snackbar" : "sheet";
|
|
842
|
+
}
|
|
839
843
|
function X(e, t) {
|
|
840
|
-
return !!(
|
|
844
|
+
return !!(W(e, t) || G(e, t));
|
|
841
845
|
}
|
|
842
846
|
function Z(e) {
|
|
843
847
|
if (!e.pulse_id || !Number.isFinite(e.version) || !e.root_node_id) return "Pulse is missing a usable id, version, or root node.";
|
|
@@ -873,8 +877,8 @@ function Q(e, t) {
|
|
|
873
877
|
}
|
|
874
878
|
return e.next_node_id ?? null;
|
|
875
879
|
}
|
|
876
|
-
var
|
|
877
|
-
snapshot =
|
|
880
|
+
var Me = class {
|
|
881
|
+
snapshot = V;
|
|
878
882
|
listeners = /* @__PURE__ */ new Set();
|
|
879
883
|
deps;
|
|
880
884
|
fabTimeoutId = null;
|
|
@@ -894,7 +898,7 @@ var Ae = class {
|
|
|
894
898
|
return this.snapshot;
|
|
895
899
|
}
|
|
896
900
|
getServerSnapshot() {
|
|
897
|
-
return
|
|
901
|
+
return V;
|
|
898
902
|
}
|
|
899
903
|
subscribe(e) {
|
|
900
904
|
return this.destroyed ? () => {} : (this.listeners.add(e), () => this.listeners.delete(e));
|
|
@@ -904,7 +908,7 @@ var Ae = class {
|
|
|
904
908
|
}
|
|
905
909
|
currentQuestion() {
|
|
906
910
|
let e = this.snapshot.state;
|
|
907
|
-
return e ?
|
|
911
|
+
return e ? W(e.survey, e.currentNodeId) : null;
|
|
908
912
|
}
|
|
909
913
|
currentAnswer() {
|
|
910
914
|
let e = this.snapshot.state, t = this.currentQuestion();
|
|
@@ -936,7 +940,7 @@ var Ae = class {
|
|
|
936
940
|
let e = this.snapshot.state;
|
|
937
941
|
if (!e) return 0;
|
|
938
942
|
if (e.completion || e.isCompleting) return 1;
|
|
939
|
-
let t = Math.max(this.projectedQuestionIds(e).length, 1), n =
|
|
943
|
+
let t = Math.max(this.projectedQuestionIds(e).length, 1), n = W(e.survey, e.survey.root_node_id), r = n && !this.rendersAsSentiment(e, n) ? 1 : 0;
|
|
940
944
|
return Math.min((Object.keys(e.answers).length + r) / t, 1);
|
|
941
945
|
}
|
|
942
946
|
canContinue() {
|
|
@@ -946,7 +950,7 @@ var Ae = class {
|
|
|
946
950
|
let n = e.drafts[t.node_id];
|
|
947
951
|
if (!n?.answer_key) return !t.required;
|
|
948
952
|
let r = t.answers?.find((e) => e.id === n.answer_key);
|
|
949
|
-
return !!(r && (!
|
|
953
|
+
return !!(r && (!K(r) || !t.required || n.value?.trim()));
|
|
950
954
|
}
|
|
951
955
|
async handleSyncResponse(e) {
|
|
952
956
|
let t = e.pending_pulse;
|
|
@@ -956,7 +960,7 @@ var Ae = class {
|
|
|
956
960
|
this.reportError(Error(n));
|
|
957
961
|
return;
|
|
958
962
|
}
|
|
959
|
-
let r =
|
|
963
|
+
let r = H(t);
|
|
960
964
|
if (this.seenPulseKeys.has(r)) return;
|
|
961
965
|
this.seenPulseKeys.add(r);
|
|
962
966
|
let i = ++this.decisionGeneration, a = await this.resolvePresentationDecision(t);
|
|
@@ -965,29 +969,28 @@ var Ae = class {
|
|
|
965
969
|
await this.sendPresentationDecline(t, a);
|
|
966
970
|
return;
|
|
967
971
|
}
|
|
968
|
-
this.beginPulse(t,
|
|
972
|
+
this.beginPulse(t, !1);
|
|
969
973
|
}
|
|
970
974
|
}
|
|
971
975
|
presentPulse(e, t = {}) {
|
|
972
|
-
return this.presentLocalPulse(e, t
|
|
976
|
+
return this.presentLocalPulse(e, t, !1);
|
|
973
977
|
}
|
|
974
978
|
presentSimulatedPulse(e) {
|
|
975
|
-
return this.presentLocalPulse(e.pulse, e
|
|
979
|
+
return this.presentLocalPulse(e.pulse, e, !0);
|
|
976
980
|
}
|
|
977
981
|
presentLocalPulse(e, t, n) {
|
|
978
982
|
if (this.destroyed) return !1;
|
|
979
983
|
let r = Z(e);
|
|
980
|
-
return r ? (this.reportError(Error(r)), !1) : (this.decisionGeneration += 1, this.beginPulse(e,
|
|
984
|
+
return r ? (this.reportError(Error(r)), !1) : (this.decisionGeneration += 1, this.beginPulse(e, n, t), !0);
|
|
981
985
|
}
|
|
982
|
-
beginPulse(e, t, n) {
|
|
983
|
-
let r =
|
|
986
|
+
beginPulse(e, t, n = {}) {
|
|
987
|
+
let r = W(e, e.root_node_id), i = G(e, e.root_node_id), a = je(e, r, n.sentimentPresentation ?? this.deps.sentimentPresentation), o = a !== "sheet";
|
|
984
988
|
this.clearSurveyTransitionTimeouts(), this.publish({
|
|
985
|
-
presentationId: ++
|
|
986
|
-
sentimentPresentation:
|
|
987
|
-
barPosition: "bottom",
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
snackbar: s ? {
|
|
989
|
+
presentationId: ++Oe,
|
|
990
|
+
sentimentPresentation: a,
|
|
991
|
+
barPosition: n.barPosition ?? this.deps.barPosition ?? "bottom",
|
|
992
|
+
isSimulated: t,
|
|
993
|
+
snackbar: o ? {
|
|
991
994
|
phase: "question",
|
|
992
995
|
selectedKey: null,
|
|
993
996
|
startedAt: null,
|
|
@@ -1001,8 +1004,8 @@ var Ae = class {
|
|
|
1001
1004
|
currentNodeId: r?.node_id ?? null,
|
|
1002
1005
|
completion: i,
|
|
1003
1006
|
history: r ? [r.node_id] : [],
|
|
1004
|
-
fabState: e.fab ||
|
|
1005
|
-
isOpen: !e.fab && !
|
|
1007
|
+
fabState: e.fab || o ? "expanded" : "hidden",
|
|
1008
|
+
isOpen: !e.fab && !o || !!i,
|
|
1006
1009
|
isBusy: !1,
|
|
1007
1010
|
sentimentSelectionLocked: !1,
|
|
1008
1011
|
isCompleting: !1,
|
|
@@ -1021,13 +1024,7 @@ var Ae = class {
|
|
|
1021
1024
|
}
|
|
1022
1025
|
async closeSurvey() {
|
|
1023
1026
|
let e = this.snapshot.state;
|
|
1024
|
-
|
|
1025
|
-
if (this.clearSurveyTransitionTimeouts(), e.sentimentPresentation === "bar" && e.barBehavior === "dismiss" && Object.keys(e.answers).length > 0) {
|
|
1026
|
-
await this.completeTerminal(e, e.answers);
|
|
1027
|
-
return;
|
|
1028
|
-
}
|
|
1029
|
-
await this.dismiss(e);
|
|
1030
|
-
}
|
|
1027
|
+
!e || e.isBusy || await this.dismissOrPartial(e, e.answers);
|
|
1031
1028
|
}
|
|
1032
1029
|
async selectChoice(e) {
|
|
1033
1030
|
let t = this.snapshot.state, n = this.currentQuestion();
|
|
@@ -1036,7 +1033,7 @@ var Ae = class {
|
|
|
1036
1033
|
if (!r) return;
|
|
1037
1034
|
let i = t.drafts[n.node_id], a = {
|
|
1038
1035
|
answer_key: r.id,
|
|
1039
|
-
...
|
|
1036
|
+
...K(r) && i?.answer_key === r.id && i.value ? { value: i.value } : {}
|
|
1040
1037
|
}, o = {
|
|
1041
1038
|
...t,
|
|
1042
1039
|
drafts: {
|
|
@@ -1045,13 +1042,13 @@ var Ae = class {
|
|
|
1045
1042
|
},
|
|
1046
1043
|
sentimentSelectionLocked: this.isSentimentStep()
|
|
1047
1044
|
};
|
|
1048
|
-
if (this.publish(o, "select"), this.isSentimentStep() && !
|
|
1045
|
+
if (this.publish(o, "select"), this.isSentimentStep() && !K(r)) {
|
|
1049
1046
|
this.sentimentAdvanceTimeoutId !== null && clearTimeout(this.sentimentAdvanceTimeoutId);
|
|
1050
|
-
let e = r.comment?.trim() ? 1400 : J(r) ? 700 : 500, i =
|
|
1047
|
+
let e = r.comment?.trim() ? 1400 : J(r) ? 700 : 500, i = H(t.survey);
|
|
1051
1048
|
this.sentimentAdvanceTimeoutId = setTimeout(() => {
|
|
1052
1049
|
this.sentimentAdvanceTimeoutId = null;
|
|
1053
1050
|
let e = this.snapshot.state;
|
|
1054
|
-
e &&
|
|
1051
|
+
e && H(e.survey) === i && e.currentNodeId === n.node_id && e.drafts[n.node_id]?.answer_key === r.id && this.advance();
|
|
1055
1052
|
}, e);
|
|
1056
1053
|
}
|
|
1057
1054
|
}
|
|
@@ -1080,7 +1077,7 @@ var Ae = class {
|
|
|
1080
1077
|
let n = {
|
|
1081
1078
|
pulse_id: t.survey.pulse_id,
|
|
1082
1079
|
pulse_version: t.survey.version,
|
|
1083
|
-
...
|
|
1080
|
+
...U(t.survey),
|
|
1084
1081
|
action: "completed",
|
|
1085
1082
|
responded_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1086
1083
|
answers: t.answers,
|
|
@@ -1126,12 +1123,12 @@ var Ae = class {
|
|
|
1126
1123
|
}, "transition");
|
|
1127
1124
|
}
|
|
1128
1125
|
answerSnackbar(e, t) {
|
|
1129
|
-
let n = this.snapshot.state, r = n?.snackbar, i = this.currentQuestion(), a = i?.answers?.find((e) => e.id === t && !
|
|
1126
|
+
let n = this.snapshot.state, r = n?.snackbar, i = this.currentQuestion(), a = i?.answers?.find((e) => e.id === t && !K(e)), o = Date.now();
|
|
1130
1127
|
if (!n || !r || !i || !a || n.presentationId !== e || n.isOpen || !n.fabEntranceCompleted || r.phase !== "question" || r.deadline !== null && o >= r.deadline) return !1;
|
|
1131
1128
|
let s = {
|
|
1132
1129
|
answer_key: a.id,
|
|
1133
1130
|
answered_at: new Date(o).toISOString()
|
|
1134
|
-
}, c = r.pausedRemainingMs === null ? r.deadline !== null && r.startedAt !== null ? Math.max(0, Math.min(1, (r.deadline - o) / Math.max(1, r.deadline - r.startedAt))) : 1 : r.pausedRemainingMs / Math.max(1, n.survey.fab?.expandedTimeout ?? 1)
|
|
1131
|
+
}, c = r.pausedRemainingMs === null ? r.deadline !== null && r.startedAt !== null ? Math.max(0, Math.min(1, (r.deadline - o) / Math.max(1, r.deadline - r.startedAt))) : 1 : r.pausedRemainingMs / Math.max(1, n.survey.fab?.expandedTimeout ?? 1);
|
|
1135
1132
|
return this.publish({
|
|
1136
1133
|
...n,
|
|
1137
1134
|
answers: {
|
|
@@ -1155,8 +1152,16 @@ var Ae = class {
|
|
|
1155
1152
|
this.sentimentAdvanceTimeoutId = null;
|
|
1156
1153
|
let t = this.snapshot.state;
|
|
1157
1154
|
if (!(t?.presentationId !== e || t.snackbar?.phase !== "feedback")) {
|
|
1158
|
-
if (
|
|
1159
|
-
this.
|
|
1155
|
+
if (t.sentimentPresentation === "bar") {
|
|
1156
|
+
this.advanceFrom({
|
|
1157
|
+
...t,
|
|
1158
|
+
isOpen: !0,
|
|
1159
|
+
fabState: "hidden",
|
|
1160
|
+
snackbar: {
|
|
1161
|
+
...t.snackbar,
|
|
1162
|
+
phase: "journey"
|
|
1163
|
+
}
|
|
1164
|
+
}, i, t.answers);
|
|
1160
1165
|
return;
|
|
1161
1166
|
}
|
|
1162
1167
|
this.publish({
|
|
@@ -1169,7 +1174,7 @@ var Ae = class {
|
|
|
1169
1174
|
}
|
|
1170
1175
|
}, "transition");
|
|
1171
1176
|
}
|
|
1172
|
-
},
|
|
1177
|
+
}, n.sentimentPresentation === "bar" ? q : 500), !0;
|
|
1173
1178
|
}
|
|
1174
1179
|
setBarTimerPaused(e, t) {
|
|
1175
1180
|
let n = this.snapshot.state, r = n?.snackbar, i = n?.survey.fab?.expandedTimeout;
|
|
@@ -1244,7 +1249,7 @@ var Ae = class {
|
|
|
1244
1249
|
await this.queueInteraction({
|
|
1245
1250
|
pulse_id: e.pulse_id,
|
|
1246
1251
|
pulse_version: e.version,
|
|
1247
|
-
...
|
|
1252
|
+
...U(e),
|
|
1248
1253
|
action: t === "never" ? "never" : "not_now",
|
|
1249
1254
|
responded_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1250
1255
|
});
|
|
@@ -1268,7 +1273,7 @@ var Ae = class {
|
|
|
1268
1273
|
let r = t.answers?.find((e) => e.id === n.answer_key);
|
|
1269
1274
|
if (!r) return e.answers;
|
|
1270
1275
|
let i = n.value?.trim();
|
|
1271
|
-
return
|
|
1276
|
+
return K(r) && !t.required && !i ? {
|
|
1272
1277
|
...e.answers,
|
|
1273
1278
|
[t.node_id]: { answered_at: (/* @__PURE__ */ new Date()).toISOString() }
|
|
1274
1279
|
} : {
|
|
@@ -1276,7 +1281,7 @@ var Ae = class {
|
|
|
1276
1281
|
[t.node_id]: {
|
|
1277
1282
|
answered_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1278
1283
|
answer_key: r.id,
|
|
1279
|
-
...
|
|
1284
|
+
...K(r) && i ? { value: i } : {}
|
|
1280
1285
|
}
|
|
1281
1286
|
};
|
|
1282
1287
|
}
|
|
@@ -1286,7 +1291,7 @@ var Ae = class {
|
|
|
1286
1291
|
await this.completeTerminal(e, n);
|
|
1287
1292
|
return;
|
|
1288
1293
|
}
|
|
1289
|
-
let i =
|
|
1294
|
+
let i = W(e.survey, r);
|
|
1290
1295
|
if (i) {
|
|
1291
1296
|
if (e.history.includes(i.node_id)) {
|
|
1292
1297
|
this.reportError(/* @__PURE__ */ Error(`Pulse graph cycle detected at ${i.node_id}.`)), await this.dismissOrPartial(e, n);
|
|
@@ -1304,7 +1309,7 @@ var Ae = class {
|
|
|
1304
1309
|
}, "transition");
|
|
1305
1310
|
return;
|
|
1306
1311
|
}
|
|
1307
|
-
let a =
|
|
1312
|
+
let a = G(e.survey, r);
|
|
1308
1313
|
if (a) {
|
|
1309
1314
|
if (!(!this.rendersAsSentiment(e, t) && this.progress() < 1)) {
|
|
1310
1315
|
this.publish({
|
|
@@ -1327,11 +1332,11 @@ var Ae = class {
|
|
|
1327
1332
|
fabState: "hidden",
|
|
1328
1333
|
isOpen: !0
|
|
1329
1334
|
}, "transition");
|
|
1330
|
-
let r =
|
|
1335
|
+
let r = H(e.survey);
|
|
1331
1336
|
this.completionTransitionTimeoutId = setTimeout(() => {
|
|
1332
1337
|
this.completionTransitionTimeoutId = null;
|
|
1333
1338
|
let e = this.snapshot.state;
|
|
1334
|
-
!e ||
|
|
1339
|
+
!e || H(e.survey) !== r || !e.isCompleting || this.publish({
|
|
1335
1340
|
...e,
|
|
1336
1341
|
completion: a,
|
|
1337
1342
|
currentNodeId: null,
|
|
@@ -1346,29 +1351,26 @@ var Ae = class {
|
|
|
1346
1351
|
this.publish(null, "transition"), await this.queueInteraction({
|
|
1347
1352
|
pulse_id: e.survey.pulse_id,
|
|
1348
1353
|
pulse_version: e.survey.version,
|
|
1349
|
-
...
|
|
1354
|
+
...U(e.survey),
|
|
1350
1355
|
action: "completed",
|
|
1351
1356
|
responded_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1352
1357
|
answers: t
|
|
1353
1358
|
}, e.isSimulated);
|
|
1354
1359
|
}
|
|
1355
|
-
async dismiss(e) {
|
|
1356
|
-
await this.dismissOrPartial(e, e.answers);
|
|
1357
|
-
}
|
|
1358
1360
|
async dismissOrPartial(e, t) {
|
|
1359
1361
|
this.clearSurveyTransitionTimeouts();
|
|
1360
1362
|
let n = Object.keys(t).length > 0;
|
|
1361
1363
|
this.publish(null, "transition"), await this.queueInteraction(n ? {
|
|
1362
1364
|
pulse_id: e.survey.pulse_id,
|
|
1363
1365
|
pulse_version: e.survey.version,
|
|
1364
|
-
...
|
|
1366
|
+
...U(e.survey),
|
|
1365
1367
|
action: "partial",
|
|
1366
1368
|
responded_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1367
1369
|
answers: t
|
|
1368
1370
|
} : {
|
|
1369
1371
|
pulse_id: e.survey.pulse_id,
|
|
1370
1372
|
pulse_version: e.survey.version,
|
|
1371
|
-
...
|
|
1373
|
+
...U(e.survey),
|
|
1372
1374
|
action: "not_now",
|
|
1373
1375
|
responded_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1374
1376
|
}, e.isSimulated);
|
|
@@ -1382,22 +1384,22 @@ var Ae = class {
|
|
|
1382
1384
|
}
|
|
1383
1385
|
emitPresentationEvent(e, t) {
|
|
1384
1386
|
if (e.isSimulated) return;
|
|
1385
|
-
let n = `${
|
|
1387
|
+
let n = `${H(e.survey)}:${t}`;
|
|
1386
1388
|
this.presentedKeys.has(n) || (this.presentedKeys.add(n), this.deps.trackEvent?.("system_did_present_pulse", {
|
|
1387
|
-
kind:
|
|
1389
|
+
kind: Ne(e, t),
|
|
1388
1390
|
pulse_id: e.survey.pulse_id,
|
|
1389
1391
|
pulse_version: String(e.survey.version),
|
|
1390
|
-
...
|
|
1392
|
+
...U(e.survey)
|
|
1391
1393
|
}));
|
|
1392
1394
|
}
|
|
1393
1395
|
scheduleFabTimeout(e) {
|
|
1394
1396
|
if (this.clearFabTimeout(), !e || e.fabState !== "expanded" || !e.presentationReported || !e.fabEntranceCompleted || e.snackbar && e.snackbar.phase !== "question" || e.snackbar?.pausedRemainingMs != null) return;
|
|
1395
1397
|
let t = e.survey.fab?.expandedTimeout;
|
|
1396
1398
|
if (typeof t != "number" || !Number.isFinite(t) || t < 0) return;
|
|
1397
|
-
let n =
|
|
1399
|
+
let n = H(e.survey);
|
|
1398
1400
|
this.fabTimeoutId = setTimeout(() => {
|
|
1399
1401
|
let e = this.snapshot.state;
|
|
1400
|
-
this.destroyed || !e ||
|
|
1402
|
+
this.destroyed || !e || H(e.survey) !== n || e.fabState !== "expanded" || this.dismissOrPartial(e, e.answers);
|
|
1401
1403
|
}, e.snackbar?.deadline !== null && e.snackbar?.deadline !== void 0 ? Math.max(0, e.snackbar.deadline - Date.now()) : t);
|
|
1402
1404
|
}
|
|
1403
1405
|
clearFabTimeout() {
|
|
@@ -1410,9 +1412,9 @@ var Ae = class {
|
|
|
1410
1412
|
return t.node_id === e.survey.root_node_id && t.type === "yes_no" && t.answers?.length === 2;
|
|
1411
1413
|
}
|
|
1412
1414
|
projectedQuestionIds(e) {
|
|
1413
|
-
let t = [], n = /* @__PURE__ */ new Set(), r =
|
|
1415
|
+
let t = [], n = /* @__PURE__ */ new Set(), r = W(e.survey, e.survey.root_node_id)?.node_id ?? null;
|
|
1414
1416
|
for (; r;) {
|
|
1415
|
-
let i =
|
|
1417
|
+
let i = W(e.survey, r);
|
|
1416
1418
|
if (!i || n.has(r)) break;
|
|
1417
1419
|
t.push(r), n.add(r), r = this.projectedNextQuestionId(e, i);
|
|
1418
1420
|
}
|
|
@@ -1422,14 +1424,14 @@ var Ae = class {
|
|
|
1422
1424
|
let n = e.answers[t.node_id];
|
|
1423
1425
|
if (n) {
|
|
1424
1426
|
let r = Q(t, n);
|
|
1425
|
-
return r &&
|
|
1427
|
+
return r && W(e.survey, r) ? r : null;
|
|
1426
1428
|
}
|
|
1427
1429
|
if (!t.required) {
|
|
1428
1430
|
let n = t.next_node_id ?? null;
|
|
1429
|
-
return n &&
|
|
1431
|
+
return n && W(e.survey, n) ? n : null;
|
|
1430
1432
|
}
|
|
1431
1433
|
let r = new Set((t.answers ?? []).map((e) => e.next_node_id).filter(Boolean)), i = r.size === 0 ? t.next_node_id ?? null : r.size === 1 ? [...r][0] ?? t.next_node_id ?? null : null;
|
|
1432
|
-
return i &&
|
|
1434
|
+
return i && W(e.survey, i) ? i : null;
|
|
1433
1435
|
}
|
|
1434
1436
|
publish(e, t, n = !1) {
|
|
1435
1437
|
this.clearFabTimeout(), this.snapshot = {
|
|
@@ -1449,7 +1451,7 @@ var Ae = class {
|
|
|
1449
1451
|
}
|
|
1450
1452
|
isSystemOtherDraft(e) {
|
|
1451
1453
|
let t = this.snapshot.state?.drafts[e.node_id];
|
|
1452
|
-
return !!(t?.answer_key && e.answers?.some((e) => e.id === t.answer_key &&
|
|
1454
|
+
return !!(t?.answer_key && e.answers?.some((e) => e.id === t.answer_key && K(e)));
|
|
1453
1455
|
}
|
|
1454
1456
|
};
|
|
1455
1457
|
function $(e, t) {
|
|
@@ -1458,8 +1460,8 @@ function $(e, t) {
|
|
|
1458
1460
|
deadline: typeof t == "number" && Number.isFinite(t) && t >= 0 ? e + t : null
|
|
1459
1461
|
};
|
|
1460
1462
|
}
|
|
1461
|
-
function
|
|
1463
|
+
function Ne(e, t) {
|
|
1462
1464
|
return t !== "expanded_fab" || !e.snackbar ? t : e.sentimentPresentation === "bar" ? "toolbar" : "snackbar";
|
|
1463
1465
|
}
|
|
1464
1466
|
//#endregion
|
|
1465
|
-
export {
|
|
1467
|
+
export { q as BAR_ACKNOWLEDGEMENT_MS, w as PendingInteractionStorageError, S as SidebandApiError, Me as SurveySessionStore, B as SyncEngine, ke as buildFabTitle, p as createContextResolver, C as createSidebandClient, we as createSidebandRuntime, Ae as getChoiceValue, s as getDeviceId, c as getSessionId, J as isPositiveSentimentChoice, K as isSystemOtherChoice, De as resolveSnackbarPresentation };
|
package/dist/types.d.ts
CHANGED
|
@@ -112,9 +112,11 @@ export type TimerStyle = 'none' | 'bar' | 'fill';
|
|
|
112
112
|
/** Initial sentiment presentation from the PendingPulse API. */
|
|
113
113
|
export type SentimentPresentation = 'sheet' | 'snackbar' | 'toolbar';
|
|
114
114
|
export type BarPosition = 'bottom' | 'top';
|
|
115
|
-
export type BarBehavior = 'dismiss' | 'follow-up';
|
|
116
115
|
export type SentimentPresentationOptions = {
|
|
117
|
-
|
|
116
|
+
/** Fallback for a pulse without an API presentation or a root isSnackBar flag. */
|
|
117
|
+
sentimentPresentation?: 'sheet' | 'snackbar' | 'bar';
|
|
118
|
+
/** Edge for the compact bar and its follow-up card. Defaults to bottom. */
|
|
119
|
+
barPosition?: BarPosition;
|
|
118
120
|
};
|
|
119
121
|
export type SimulatedPulseDefinition = SentimentPresentationOptions & {
|
|
120
122
|
pulse: Pulse;
|
|
@@ -197,7 +199,7 @@ export type SidebandClientConfig = {
|
|
|
197
199
|
headers?: HeadersInit | (() => HeadersInit | Promise<HeadersInit>);
|
|
198
200
|
fetch?: typeof fetch;
|
|
199
201
|
};
|
|
200
|
-
export type SidebandCoreConfig = {
|
|
202
|
+
export type SidebandCoreConfig = SentimentPresentationOptions & {
|
|
201
203
|
baseUrl?: string;
|
|
202
204
|
syncEndpoint?: SyncEndpoint;
|
|
203
205
|
apiKey: string;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,SAAS,GAAG,KAAK,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