@sprig-technologies/sprig-browser 2.26.4 → 2.26.6

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/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-rCLyJyii.cjs");exports.DismissReason=e.DismissReason;exports.SprigAPI=e.SprigAPI;exports.SprigEvent=e.SprigEvent;exports.default=e.index;exports.sprig=e.sprig;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-CqSba42x.cjs");exports.DismissReason=e.DismissReason;exports.SprigAPI=e.SprigAPI;exports.SprigEvent=e.SprigEvent;exports.default=e.index;exports.sprig=e.sprig;
package/dist/index.d.ts CHANGED
@@ -1467,6 +1467,11 @@ declare class ChunkedStreamIterable implements AsyncIterable<Blob> {
1467
1467
  get chunkByteSize(): number;
1468
1468
  [Symbol.asyncIterator](): AsyncIterator<Blob>;
1469
1469
  }
1470
+ /**
1471
+ * Checks if an upload chunk was partially received (HTTP 308) and needs a retry.
1472
+ * Validates against the 'Range' header to ensure the full chunk was processed.
1473
+ */
1474
+ declare const isIncompleteChunkUploadNeedingRetry: (res: XhrResponse | undefined, _options?: any) => res is XhrResponse;
1470
1475
  declare type EventName = 'attempt' | 'attemptFailure' | 'chunkSuccess' | 'error' | 'offline' | 'online' | 'progress' | 'success';
1471
1476
  declare type AllowedMethods = 'PUT' | 'POST' | 'PATCH';
1472
1477
  interface UpChunkOptions {
@@ -1564,9 +1569,10 @@ type _mux_upchunk_UpChunk = UpChunk;
1564
1569
  declare const _mux_upchunk_UpChunk: typeof UpChunk;
1565
1570
  type _mux_upchunk_UpChunkOptions = UpChunkOptions;
1566
1571
  declare const _mux_upchunk_getChunkSizeError: typeof getChunkSizeError;
1572
+ declare const _mux_upchunk_isIncompleteChunkUploadNeedingRetry: typeof isIncompleteChunkUploadNeedingRetry;
1567
1573
  declare const _mux_upchunk_isValidChunkSize: typeof isValidChunkSize;
1568
1574
  declare namespace _mux_upchunk {
1569
- export { _mux_upchunk_ChunkedStreamIterable as ChunkedStreamIterable, type _mux_upchunk_ChunkedStreamIterableOptions as ChunkedStreamIterableOptions, _mux_upchunk_UpChunk as UpChunk, type _mux_upchunk_UpChunkOptions as UpChunkOptions, createUpload$1 as createUpload, _mux_upchunk_getChunkSizeError as getChunkSizeError, _mux_upchunk_isValidChunkSize as isValidChunkSize };
1575
+ export { _mux_upchunk_ChunkedStreamIterable as ChunkedStreamIterable, type _mux_upchunk_ChunkedStreamIterableOptions as ChunkedStreamIterableOptions, _mux_upchunk_UpChunk as UpChunk, type _mux_upchunk_UpChunkOptions as UpChunkOptions, createUpload$1 as createUpload, _mux_upchunk_getChunkSizeError as getChunkSizeError, _mux_upchunk_isIncompleteChunkUploadNeedingRetry as isIncompleteChunkUploadNeedingRetry, _mux_upchunk_isValidChunkSize as isValidChunkSize };
1570
1576
  }
1571
1577
 
1572
1578
  declare enum NOTIFICATION_TYPES {
@@ -2746,7 +2752,10 @@ declare namespace sprigConfig {
2746
2752
  ) => Promise<void>;
2747
2753
  removeSurveyListener: (listener: SprigListener) => Promise<void>;
2748
2754
  reviewSurvey: (surveyId: number) => void;
2749
- setAttribute: (attribute: string, value: string | number) => IdentifyResult;
2755
+ setAttribute: (
2756
+ attribute: string,
2757
+ value: string | number | boolean,
2758
+ ) => IdentifyResult;
2750
2759
  setAttributes: (attributes?: SprigAttributes) => IdentifyResult;
2751
2760
  setPartnerAnonymousId: (
2752
2761
  partnerAnonymousId: string,
@@ -2838,7 +2847,7 @@ declare global {
2838
2847
  };
2839
2848
  Intercom: { ul_wasVisible?: boolean } & ((
2840
2849
  method: string,
2841
- data: unknown,
2850
+ data?: unknown,
2842
2851
  ) => void);
2843
2852
  optimizely?: optimizely.Optimizely;
2844
2853
  optimizelyDatafile?: object;
@@ -2887,18 +2896,13 @@ declare class SprigAPI {
2887
2896
  SURVEY_HEIGHT: SprigEvent;
2888
2897
  SURVEY_WIDTH: SprigEvent;
2889
2898
  SURVEY_PRESENTED: SprigEvent;
2890
- /**
2891
- * Remove all listeners set on Sprig
2892
- */
2893
2899
  SURVEY_LIFE_CYCLE: SprigEvent;
2894
2900
  SURVEY_WILL_CLOSE: SprigEvent;
2895
2901
  SURVEY_WILL_PRESENT: SprigEvent;
2896
2902
  QUESTION_ANSWERED: SprigEvent;
2897
2903
  REPLAY_CAPTURE: SprigEvent;
2898
2904
  CLOSE_SURVEY_ON_OVERLAY_CLICK: SprigEvent;
2899
- VISITOR_ID_UPDATED: SprigEvent; /**
2900
- * Set a partner anonymous id for future requests.
2901
- */
2905
+ VISITOR_ID_UPDATED: SprigEvent;
2902
2906
  DATA: {
2903
2907
  DISMISS_REASONS: {
2904
2908
  API: DismissReason;
@@ -2929,7 +2933,7 @@ declare class SprigAPI {
2929
2933
  /**
2930
2934
  * Set an arbitrary attribute on the visitor
2931
2935
  */
2932
- setAttribute(attribute: string, value: string): void;
2936
+ setAttribute(attribute: string, value: string | number | boolean): void;
2933
2937
  /**
2934
2938
  * Set attributes on visitor
2935
2939
  */
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { D as i, w as r, S as e, y as p, x as g } from "./index-GurVf9fu.js";
1
+ import { D as i, w as r, S as e, y as p, x as g } from "./index-Dc62vWMo.js";
2
2
  export {
3
3
  i as DismissReason,
4
4
  r as SprigAPI,
@@ -1,4 +1,4 @@
1
- import { g as zo, a as qo, T as X, i as ot, C as Vt, D as $t, A as ke, I as ce, e as $e, s as We, S as he, b as Re, P as pt, c as wn, R as Wo, u as ht, d as Go, f as Zo, h as Yo, j as E, E as Qo, k as B, l as Ie, m as wt, n as q, o as U, M as re, v as mt, p as Ko, q as Jo, r as Xo, t as er } from "./index-GurVf9fu.js";
1
+ import { g as zo, a as qo, T as X, i as ot, C as Vt, D as $t, A as ke, I as ce, e as $e, s as We, S as he, b as Re, P as pt, c as wn, R as Wo, u as ht, d as Go, f as Zo, h as Yo, j as E, E as Qo, k as B, l as Ie, m as wt, n as q, o as U, M as re, v as mt, p as Ko, q as Jo, r as Xo, t as er } from "./index-Dc62vWMo.js";
2
2
  var b = /* @__PURE__ */ ((e) => (e.ConsentLegal = "consentlegal", e.Likert = "likert", e.Matrix = "matrix", e.MultipleChoice = "multiplechoice", e.MultipleSelect = "multipleselect", e.NPS = "nps", e.Open = "open", e.RecordedTask = "recordedtask", e.TextUrlPrompt = "texturlprompt", e.Thanks = "thanks", e.Uploading = "uploading", e.VideoVoice = "videovoice", e))(b || {}), J = /* @__PURE__ */ ((e) => (e.Answered = "answered", e.Contains = "contains", e.DoesNotContain = "notcontains", e.DoesNotInclude = "list_dni", e.Equal = "eq", e.GivenUp = "given_up", e.GreaterThan = "gt", e.GreaterThanOrEqual = "gte", e.LessThan = "lt", e.LessThanOrEqual = "lte", e.ListAll = "list_all", e.ListAtLeastOne = "list_alo", e.ListExact = "list_exact", e.NotEqual = "neq", e.Partial = "partial", e.Skipped = "skipped", e))(J || {}), we = /* @__PURE__ */ ((e) => (e.Camera = "camera", e.Microphone = "microphone", e.Screen = "screen", e))(we || {}), Y = /* @__PURE__ */ ((e) => (e.AvPermission = "av_permission", e.ScreenPermission = "screen_permission", e.StartTask = "start_task", e.CompleteTask = "complete_task", e))(Y || {}), be = /* @__PURE__ */ ((e) => (e.Number = "number", e.Smiley = "smiley", e.Star = "star", e))(be || {}), Oe, S, Sn, ve, Ht, En, ft, Tn, Ne = {}, Pn = [], tr = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, Qe = Array.isArray;
3
3
  function ae(e, t) {
4
4
  for (var n in t)
@@ -1522,7 +1522,8 @@ const cn = 1, Lt = {
1522
1522
  previewKey: s.previewKey
1523
1523
  };
1524
1524
  ot(`Submitting response: ${JSON.stringify(r.value, null, 2)} for survey: ${s.surveyId}`), n && (ot("Survey complete"), Wo({
1525
- id: s.surveyId
1525
+ id: s.surveyId,
1526
+ userAgent: window.navigator.userAgent
1526
1527
  }));
1527
1528
  const d = await s.trackPromise(ht(`${s.apiURL}/sdk/1/environments/${s.envId}/visitors/${s.userId}/responses/submit`, {
1528
1529
  body: JSON.stringify(a),
@@ -5319,7 +5320,7 @@ function is(e, t = !0) {
5319
5320
  }, _.appendChild(C);
5320
5321
  } else
5321
5322
  console.warn("[Sprig] - recording functionality not configured due to missing UpChunk dependency");
5322
- const k = "2.26.4", T = s || ((w = d.eventEmitter) == null ? void 0 : w.emit);
5323
+ const k = "2.26.6", T = s || ((w = d.eventEmitter) == null ? void 0 : w.emit);
5323
5324
  T == null || T(ce.VerifyViewVersion, {
5324
5325
  [Re.ViewVersion]: k
5325
5326
  }), m && t && Ee(u(Ki, {}), m);