@thoughtspot/visual-embed-sdk 1.44.2 → 1.44.4-HE-beta.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.
Files changed (213) hide show
  1. package/README.md +1 -1
  2. package/cjs/package.json +1 -1
  3. package/cjs/src/embed/app.d.ts +44 -32
  4. package/cjs/src/embed/app.d.ts.map +1 -1
  5. package/cjs/src/embed/app.js.map +1 -1
  6. package/cjs/src/embed/base.d.ts +1 -1
  7. package/cjs/src/embed/base.d.ts.map +1 -1
  8. package/cjs/src/embed/base.js +4 -0
  9. package/cjs/src/embed/base.js.map +1 -1
  10. package/cjs/src/embed/base.spec.js +60 -0
  11. package/cjs/src/embed/base.spec.js.map +1 -1
  12. package/cjs/src/embed/conversation.d.ts +7 -0
  13. package/cjs/src/embed/conversation.d.ts.map +1 -1
  14. package/cjs/src/embed/conversation.js +9 -0
  15. package/cjs/src/embed/conversation.js.map +1 -1
  16. package/cjs/src/embed/hostEventClient/contracts.d.ts +20 -3
  17. package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  18. package/cjs/src/embed/hostEventClient/contracts.js +6 -1
  19. package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
  20. package/cjs/src/embed/hostEventClient/host-event-client.d.ts +8 -8
  21. package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  22. package/cjs/src/embed/hostEventClient/host-event-client.js +18 -18
  23. package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
  24. package/cjs/src/embed/hostEventClient/host-event-client.spec.js +7 -7
  25. package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  26. package/cjs/src/embed/liveboard.d.ts +10 -4
  27. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  28. package/cjs/src/embed/liveboard.js +12 -2
  29. package/cjs/src/embed/liveboard.js.map +1 -1
  30. package/cjs/src/embed/liveboard.spec.js +1 -1
  31. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  32. package/cjs/src/embed/sage.d.ts +7 -0
  33. package/cjs/src/embed/sage.d.ts.map +1 -1
  34. package/cjs/src/embed/sage.js +9 -0
  35. package/cjs/src/embed/sage.js.map +1 -1
  36. package/cjs/src/embed/search-bar.d.ts +7 -0
  37. package/cjs/src/embed/search-bar.d.ts.map +1 -1
  38. package/cjs/src/embed/search-bar.js +9 -0
  39. package/cjs/src/embed/search-bar.js.map +1 -1
  40. package/cjs/src/embed/search.d.ts +7 -0
  41. package/cjs/src/embed/search.d.ts.map +1 -1
  42. package/cjs/src/embed/search.js +9 -0
  43. package/cjs/src/embed/search.js.map +1 -1
  44. package/cjs/src/embed/ts-embed.d.ts +9 -3
  45. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  46. package/cjs/src/embed/ts-embed.js +41 -8
  47. package/cjs/src/embed/ts-embed.js.map +1 -1
  48. package/cjs/src/embed/ts-embed.spec.js +156 -24
  49. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  50. package/cjs/src/errors.d.ts +2 -0
  51. package/cjs/src/errors.d.ts.map +1 -1
  52. package/cjs/src/errors.js +2 -0
  53. package/cjs/src/errors.js.map +1 -1
  54. package/cjs/src/index.d.ts +2 -2
  55. package/cjs/src/index.d.ts.map +1 -1
  56. package/cjs/src/index.js +5 -1
  57. package/cjs/src/index.js.map +1 -1
  58. package/cjs/src/types.d.ts +142 -45
  59. package/cjs/src/types.d.ts.map +1 -1
  60. package/cjs/src/types.js +91 -16
  61. package/cjs/src/types.js.map +1 -1
  62. package/cjs/src/utils/logger.spec.d.ts +20 -5
  63. package/cjs/src/utils/logger.spec.d.ts.map +1 -1
  64. package/cjs/src/utils/processTrigger.d.ts +3 -2
  65. package/cjs/src/utils/processTrigger.d.ts.map +1 -1
  66. package/cjs/src/utils/processTrigger.js +4 -2
  67. package/cjs/src/utils/processTrigger.js.map +1 -1
  68. package/cjs/src/utils.d.ts +15 -4
  69. package/cjs/src/utils.d.ts.map +1 -1
  70. package/cjs/src/utils.js +38 -6
  71. package/cjs/src/utils.js.map +1 -1
  72. package/cjs/src/utils.spec.js +53 -0
  73. package/cjs/src/utils.spec.js.map +1 -1
  74. package/dist/index-BFdRRz03.js +7371 -0
  75. package/dist/index-BUfrYJ3w.js +7371 -0
  76. package/dist/index-CI6s4VMY.js +7371 -0
  77. package/dist/{index-CSFjfTVk.js → index-CWQnMX2L.js} +1 -1
  78. package/dist/index-CaW-1mu5.js +7371 -0
  79. package/dist/index-CcSgNJVi.js +7371 -0
  80. package/dist/index-Djtv-y7A.js +7371 -0
  81. package/dist/index-UY-4yjBN.js +7371 -0
  82. package/dist/src/embed/app.d.ts +44 -32
  83. package/dist/src/embed/app.d.ts.map +1 -1
  84. package/dist/src/embed/base.d.ts +1 -1
  85. package/dist/src/embed/base.d.ts.map +1 -1
  86. package/dist/src/embed/conversation.d.ts +7 -0
  87. package/dist/src/embed/conversation.d.ts.map +1 -1
  88. package/dist/src/embed/hostEventClient/contracts.d.ts +20 -3
  89. package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  90. package/dist/src/embed/hostEventClient/host-event-client.d.ts +8 -8
  91. package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  92. package/dist/src/embed/liveboard.d.ts +10 -4
  93. package/dist/src/embed/liveboard.d.ts.map +1 -1
  94. package/dist/src/embed/sage.d.ts +7 -0
  95. package/dist/src/embed/sage.d.ts.map +1 -1
  96. package/dist/src/embed/search-bar.d.ts +7 -0
  97. package/dist/src/embed/search-bar.d.ts.map +1 -1
  98. package/dist/src/embed/search.d.ts +7 -0
  99. package/dist/src/embed/search.d.ts.map +1 -1
  100. package/dist/src/embed/ts-embed.d.ts +9 -3
  101. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  102. package/dist/src/errors.d.ts +2 -0
  103. package/dist/src/errors.d.ts.map +1 -1
  104. package/dist/src/index.d.ts +2 -2
  105. package/dist/src/index.d.ts.map +1 -1
  106. package/dist/src/types.d.ts +142 -45
  107. package/dist/src/types.d.ts.map +1 -1
  108. package/dist/src/utils/logger.spec.d.ts +20 -5
  109. package/dist/src/utils/logger.spec.d.ts.map +1 -1
  110. package/dist/src/utils/processTrigger.d.ts +3 -2
  111. package/dist/src/utils/processTrigger.d.ts.map +1 -1
  112. package/dist/src/utils.d.ts +15 -4
  113. package/dist/src/utils.d.ts.map +1 -1
  114. package/dist/tsembed-react.es.js +288 -95
  115. package/dist/tsembed-react.js +287 -94
  116. package/dist/tsembed.es.js +289 -96
  117. package/dist/tsembed.js +314 -121
  118. package/dist/visual-embed-sdk-react-full.d.ts +246 -83
  119. package/dist/visual-embed-sdk-react.d.ts +251 -90
  120. package/dist/visual-embed-sdk.d.ts +299 -93
  121. package/lib/package.json +1 -1
  122. package/lib/src/embed/app.d.ts +44 -32
  123. package/lib/src/embed/app.d.ts.map +1 -1
  124. package/lib/src/embed/app.js.map +1 -1
  125. package/lib/src/embed/base.d.ts +1 -1
  126. package/lib/src/embed/base.d.ts.map +1 -1
  127. package/lib/src/embed/base.js +5 -1
  128. package/lib/src/embed/base.js.map +1 -1
  129. package/lib/src/embed/base.spec.js +61 -1
  130. package/lib/src/embed/base.spec.js.map +1 -1
  131. package/lib/src/embed/conversation.d.ts +7 -0
  132. package/lib/src/embed/conversation.d.ts.map +1 -1
  133. package/lib/src/embed/conversation.js +9 -0
  134. package/lib/src/embed/conversation.js.map +1 -1
  135. package/lib/src/embed/hostEventClient/contracts.d.ts +20 -3
  136. package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  137. package/lib/src/embed/hostEventClient/contracts.js +5 -0
  138. package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
  139. package/lib/src/embed/hostEventClient/host-event-client.d.ts +8 -8
  140. package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  141. package/lib/src/embed/hostEventClient/host-event-client.js +18 -18
  142. package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
  143. package/lib/src/embed/hostEventClient/host-event-client.spec.js +7 -7
  144. package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  145. package/lib/src/embed/liveboard.d.ts +10 -4
  146. package/lib/src/embed/liveboard.d.ts.map +1 -1
  147. package/lib/src/embed/liveboard.js +12 -2
  148. package/lib/src/embed/liveboard.js.map +1 -1
  149. package/lib/src/embed/liveboard.spec.js +1 -1
  150. package/lib/src/embed/liveboard.spec.js.map +1 -1
  151. package/lib/src/embed/sage.d.ts +7 -0
  152. package/lib/src/embed/sage.d.ts.map +1 -1
  153. package/lib/src/embed/sage.js +9 -0
  154. package/lib/src/embed/sage.js.map +1 -1
  155. package/lib/src/embed/search-bar.d.ts +7 -0
  156. package/lib/src/embed/search-bar.d.ts.map +1 -1
  157. package/lib/src/embed/search-bar.js +9 -0
  158. package/lib/src/embed/search-bar.js.map +1 -1
  159. package/lib/src/embed/search.d.ts +7 -0
  160. package/lib/src/embed/search.d.ts.map +1 -1
  161. package/lib/src/embed/search.js +9 -0
  162. package/lib/src/embed/search.js.map +1 -1
  163. package/lib/src/embed/ts-embed.d.ts +9 -3
  164. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  165. package/lib/src/embed/ts-embed.js +41 -8
  166. package/lib/src/embed/ts-embed.js.map +1 -1
  167. package/lib/src/embed/ts-embed.spec.js +156 -24
  168. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  169. package/lib/src/errors.d.ts +2 -0
  170. package/lib/src/errors.d.ts.map +1 -1
  171. package/lib/src/errors.js +2 -0
  172. package/lib/src/errors.js.map +1 -1
  173. package/lib/src/index.d.ts +2 -2
  174. package/lib/src/index.d.ts.map +1 -1
  175. package/lib/src/index.js +2 -2
  176. package/lib/src/index.js.map +1 -1
  177. package/lib/src/types.d.ts +142 -45
  178. package/lib/src/types.d.ts.map +1 -1
  179. package/lib/src/types.js +90 -15
  180. package/lib/src/types.js.map +1 -1
  181. package/lib/src/utils/logger.spec.d.ts +20 -5
  182. package/lib/src/utils/logger.spec.d.ts.map +1 -1
  183. package/lib/src/utils/processTrigger.d.ts +3 -2
  184. package/lib/src/utils/processTrigger.d.ts.map +1 -1
  185. package/lib/src/utils/processTrigger.js +4 -2
  186. package/lib/src/utils/processTrigger.js.map +1 -1
  187. package/lib/src/utils.d.ts +15 -4
  188. package/lib/src/utils.d.ts.map +1 -1
  189. package/lib/src/utils.js +35 -5
  190. package/lib/src/utils.js.map +1 -1
  191. package/lib/src/utils.spec.js +54 -1
  192. package/lib/src/utils.spec.js.map +1 -1
  193. package/package.json +1 -1
  194. package/src/embed/app.ts +45 -32
  195. package/src/embed/base.spec.ts +79 -1
  196. package/src/embed/base.ts +5 -2
  197. package/src/embed/conversation.ts +11 -0
  198. package/src/embed/hostEventClient/contracts.ts +23 -4
  199. package/src/embed/hostEventClient/host-event-client.spec.ts +7 -1
  200. package/src/embed/hostEventClient/host-event-client.ts +22 -11
  201. package/src/embed/liveboard.spec.ts +1 -1
  202. package/src/embed/liveboard.ts +18 -5
  203. package/src/embed/sage.ts +11 -0
  204. package/src/embed/search-bar.tsx +11 -0
  205. package/src/embed/search.ts +11 -0
  206. package/src/embed/ts-embed.spec.ts +205 -18
  207. package/src/embed/ts-embed.ts +45 -9
  208. package/src/errors.ts +2 -0
  209. package/src/index.ts +6 -0
  210. package/src/types.ts +146 -43
  211. package/src/utils/processTrigger.ts +6 -3
  212. package/src/utils.spec.ts +78 -0
  213. package/src/utils.ts +35 -8
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.44.2 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.44.4-HE-beta.1 */
2
2
  'use client';
3
3
  import * as React from 'react';
4
4
  import React__default, { useRef, useCallback } from 'react';
@@ -350,57 +350,71 @@ var AuthType;
350
350
  })(AuthType || (AuthType = {}));
351
351
  /**
352
352
  *
353
- * This option does not apply to the classic homepage experience.
354
- * To access the updated modular homepage,
355
- * set `modularHomeExperience` to `true`
356
- * (available as Early Access feature in 9.12.5.cl).
353
+ * **Note**: This attribute is not supported in the classic (V1) homepage experience.
357
354
  *
358
355
  */
359
356
  var HomeLeftNavItem;
360
357
  (function (HomeLeftNavItem) {
361
358
  /**
359
+ * The *Search data* option in
360
+ * the *Insights* left navigation panel.
362
361
  * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
363
362
  */
364
363
  HomeLeftNavItem["SearchData"] = "search-data";
365
364
  /**
365
+ * The *Home* menu option in
366
+ * the *Insights* left navigation panel.
366
367
  * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
367
368
  */
368
369
  HomeLeftNavItem["Home"] = "insights-home";
369
370
  /**
371
+ * The *Liveboards* menu option in
372
+ * the *Insights* left navigation panel.
370
373
  * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
371
374
  */
372
375
  HomeLeftNavItem["Liveboards"] = "liveboards";
373
376
  /**
377
+ * The *Answers* menu option in
378
+ * the *Insights* left navigation panel.
374
379
  * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
375
380
  */
376
381
  HomeLeftNavItem["Answers"] = "answers";
377
382
  /**
383
+ * The *Monitor subscriptions* menu option in
384
+ * the *Insights* left navigation panel.
378
385
  * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
379
386
  */
380
387
  HomeLeftNavItem["MonitorSubscription"] = "monitor-alerts";
381
388
  /**
389
+ * The *SpotIQ analysis* menu option in
390
+ * the *Insights* left navigation panel.
382
391
  * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
383
392
  */
384
393
  HomeLeftNavItem["SpotIQAnalysis"] = "spotiq-analysis";
385
394
  /**
395
+ * The *Liveboard schedules* menu option in
396
+ * the *Insights* left navigation panel.
386
397
  * @version SDK: 1.34.0| ThoughtSpot: 10.3.0.cl
387
398
  */
388
399
  HomeLeftNavItem["LiveboardSchedules"] = "liveboard-schedules";
389
400
  /**
390
- * Create new options in the insights left navigation,
391
- * available when new navigation V3 is enabled.
401
+ * The create option in the *Insights*
402
+ * left navigation panel.
403
+ * Available in the V3 navigation experience.
392
404
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
393
405
  */
394
406
  HomeLeftNavItem["Create"] = "create";
395
407
  /**
396
- * Spotter option in the insights left navigation,
397
- * available when new navigation V3 is enabled.
408
+ * The *Spotter* menu option in the *Insights*
409
+ * left navigation panel.
410
+ * Available in the V3 navigation experience.
398
411
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
399
412
  */
400
413
  HomeLeftNavItem["Spotter"] = "spotter";
401
414
  /**
402
- * Favorites option in the insights left navigation,
403
- * available when new navigation V3 is enabled.
415
+ * The *Favorites* section in the *Insights*
416
+ * left navigation panel.
417
+ * Available in the V3 navigation experience.
404
418
  * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
405
419
  */
406
420
  HomeLeftNavItem["Favorites"] = "favorites";
@@ -472,10 +486,11 @@ var RuntimeFilterOp;
472
486
  RuntimeFilterOp["NOT_IN"] = "NOT_IN";
473
487
  })(RuntimeFilterOp || (RuntimeFilterOp = {}));
474
488
  /**
475
- * Home page module that can be hidden.
476
- * **Note**: This option does not apply to the classic homepage.
477
- * To access the updated modular homepage, set
478
- * `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl).
489
+ * Home page modules that can be hidden
490
+ * via `hiddenHomepageModules` and reordered via
491
+ * `reorderedHomepageModules`.
492
+ *
493
+ * **Note**: This option is not supported in the classic (v1) experience.
479
494
  * @version SDK: 1.28.0 | ThoughtSpot: 9.12.5.cl, 10.1.0.sw
480
495
  */
481
496
  var HomepageModule;
@@ -489,7 +504,7 @@ var HomepageModule;
489
504
  */
490
505
  HomepageModule["Watchlist"] = "WATCHLIST";
491
506
  /**
492
- * favorite objects
507
+ * Favorite module
493
508
  */
494
509
  HomepageModule["Favorite"] = "FAVORITE";
495
510
  /**
@@ -1645,6 +1660,28 @@ var EmbedEvent;
1645
1660
  * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1646
1661
  */
1647
1662
  EmbedEvent["PreviewSpotterData"] = "PreviewSpotterData";
1663
+ /**
1664
+ * Emitted when user opens up the Add to Coaching modal on any visualization in Spotter Embed.
1665
+ * @example
1666
+ * ```js
1667
+ * spotterEmbed.on(EmbedEvent.AddToCoaching, (payload) => {
1668
+ * console.log('payload', payload);
1669
+ * })
1670
+ *```
1671
+ * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
1672
+ */
1673
+ EmbedEvent["AddToCoaching"] = "addToCoaching";
1674
+ /**
1675
+ * Emitted when user opens up the data model instructions modal in Spotter embed.
1676
+ * @example
1677
+ * ```js
1678
+ * spotterEmbed.on(EmbedEvent.DataModelInstructions, (payload) => {
1679
+ * console.log('payload', payload);
1680
+ * })
1681
+ * ```
1682
+ * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
1683
+ */
1684
+ EmbedEvent["DataModelInstructions"] = "DataModelInstructions";
1648
1685
  /**
1649
1686
  * Emitted when the Spotter query is triggered in Spotter embed.
1650
1687
  * @example
@@ -3069,6 +3106,26 @@ var HostEvent;
3069
3106
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
3070
3107
  */
3071
3108
  HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
3109
+ /**
3110
+ * Opens the Add to Coaching modal from a visualization in Spotter Embed.
3111
+ * @param - `vizId ` refers to the Visualization ID in Spotter embed and is required.
3112
+ * @example
3113
+ * ```js
3114
+ * spotterEmbed.trigger(HostEvent.AddToCoaching, { vizId: '730496d6-6903-4601-937e-2c691821af3c' });
3115
+ *
3116
+ *```
3117
+ * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
3118
+ */
3119
+ HostEvent["AddToCoaching"] = "addToCoaching";
3120
+ /**
3121
+ * Opens the data model instructions modal in Spotter Embed.
3122
+ * @example
3123
+ * ```js
3124
+ * spotterEmbed.trigger(HostEvent.DataModelInstructions);
3125
+ * ```
3126
+ * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
3127
+ */
3128
+ HostEvent["DataModelInstructions"] = "DataModelInstructions";
3072
3129
  /**
3073
3130
  * Resets the Spotter Embed Conversation.
3074
3131
  * @example
@@ -3171,6 +3228,15 @@ var HostEvent;
3171
3228
  * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
3172
3229
  */
3173
3230
  HostEvent["StartNewSpotterConversation"] = "StartNewSpotterConversation";
3231
+ /**
3232
+ * Get the current context of the embedded page.
3233
+ * @example
3234
+ * ```js
3235
+ * const context = await liveboardEmbed.trigger(HostEvent.GetPageContext);
3236
+ * ```
3237
+ * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
3238
+ */
3239
+ HostEvent["GetPageContext"] = "GetPageContext";
3174
3240
  })(HostEvent || (HostEvent = {}));
3175
3241
  /**
3176
3242
  * The different visual modes that the data sources panel within
@@ -4880,7 +4946,16 @@ var EmbedErrorCodes;
4880
4946
  EmbedErrorCodes["HOST_EVENT_TYPE_UNDEFINED"] = "HOST_EVENT_TYPE_UNDEFINED";
4881
4947
  /** Error parsing api intercept body */
4882
4948
  EmbedErrorCodes["PARSING_API_INTERCEPT_BODY_ERROR"] = "PARSING_API_INTERCEPT_BODY_ERROR";
4949
+ /** Failed to update embed parameters during pre-render */
4950
+ EmbedErrorCodes["UPDATE_PARAMS_FAILED"] = "UPDATE_PARAMS_FAILED";
4883
4951
  })(EmbedErrorCodes || (EmbedErrorCodes = {}));
4952
+ var ContextType;
4953
+ (function (ContextType) {
4954
+ ContextType["Search"] = "search-answer";
4955
+ ContextType["Liveboard"] = "liveboard";
4956
+ ContextType["Answer"] = "answer";
4957
+ ContextType["Spotter"] = "spotter";
4958
+ })(ContextType || (ContextType = {}));
4884
4959
  /**
4885
4960
  * Enum for the type of API intercepted
4886
4961
  */
@@ -4970,6 +5045,49 @@ class Logger {
4970
5045
  }
4971
5046
  const logger$3 = new Logger();
4972
5047
 
5048
+ const ERROR_MESSAGE = {
5049
+ INVALID_THOUGHTSPOT_HOST: 'Error parsing ThoughtSpot host. Please provide a valid URL.',
5050
+ SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND: 'Please select a Model to get started',
5051
+ LIVEBOARD_VIZ_ID_VALIDATION: 'Please select a Liveboard to embed.',
5052
+ TRIGGER_TIMED_OUT: 'Trigger timed-out in getting a response',
5053
+ SEARCHEMBED_BETA_WRANING_MESSAGE: 'SearchEmbed is in Beta in this release.',
5054
+ SAGE_EMBED_BETA_WARNING_MESSAGE: 'SageEmbed is in Beta in this release.',
5055
+ THIRD_PARTY_COOKIE_BLOCKED_ALERT: 'Third-party cookie access is blocked on this browser. Please allow third-party cookies for this to work properly. \nYou can use `suppressNoCookieAccessAlert` to suppress this message.',
5056
+ DUPLICATE_TOKEN_ERR: 'Duplicate token. Please issue a new token every time getAuthToken callback is called. See https://developers.thoughtspot.com/docs/?pageid=embed-auth#trusted-auth-embed for more details.',
5057
+ SDK_NOT_INITIALIZED: 'SDK not initialized',
5058
+ SESSION_INFO_FAILED: 'Failed to get session information',
5059
+ INVALID_TOKEN_ERROR: 'Received invalid token from getAuthToken callback or authToken endpoint.',
5060
+ INVALID_TOKEN_TYPE_ERROR: 'Expected getAuthToken to return a string, but received a {invalidType}.',
5061
+ MIXPANEL_TOKEN_NOT_FOUND: 'Mixpanel token not found in session info',
5062
+ PRERENDER_ID_MISSING: 'PreRender ID is required for preRender',
5063
+ SYNC_STYLE_CALLED_BEFORE_RENDER: 'PreRender should be called before using syncPreRenderStyle',
5064
+ CSP_VIOLATION_ALERT: 'CSP violation detected. Please check the console errors for more details.',
5065
+ CSP_FRAME_HOST_VIOLATION_LOG_MESSAGE: 'Please set up CSP correctly for the application to start working. For more information, see https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts. \n If the issue persists, refer to https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts',
5066
+ MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
5067
+ RENDER_CALLED_BEFORE_INIT: 'Looks like render was called before calling init, the render won\'t start until init is called.\nFor more info check\n1. https://developers.thoughtspot.com/docs/Function_init#_init\n2.https://developers.thoughtspot.com/docs/getting-started#initSdk',
5068
+ SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
5069
+ OFFLINE_WARNING: 'Network not Detected. Embed is offline. Please reconnect and refresh',
5070
+ INIT_SDK_REQUIRED: 'You need to init the ThoughtSpot SDK module first',
5071
+ CONFLICTING_ACTIONS_CONFIG: 'You cannot have both hidden actions and visible actions',
5072
+ CONFLICTING_TABS_CONFIG: 'You cannot have both hidden Tabs and visible Tabs',
5073
+ RENDER_BEFORE_EVENTS_REQUIRED: 'Please call render before triggering events',
5074
+ HOST_EVENT_TYPE_UNDEFINED: 'Host event type is undefined',
5075
+ LOGIN_FAILED: 'Login failed',
5076
+ ERROR_PARSING_API_INTERCEPT_BODY: 'Error parsing api intercept body',
5077
+ SSR_ENVIRONMENT_ERROR: 'SSR environment detected. This function cannot be called in SSR environment.',
5078
+ UPDATE_PARAMS_FAILED: 'Failed to update embed parameters',
5079
+ };
5080
+ const CUSTOM_ACTIONS_ERROR_MESSAGE = {
5081
+ INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
5082
+ MISSING_REQUIRED_FIELDS: (id, missingFields) => `Custom Action Validation Error for '${id}': Missing required fields: ${missingFields.join(', ')}`,
5083
+ UNSUPPORTED_TARGET: (id, targetType) => `Custom Action Validation Error for '${id}': Target type '${targetType}' is not supported`,
5084
+ INVALID_POSITION: (position, targetType, supportedPositions) => `Position '${position}' is not supported for ${targetType.toLowerCase()}-level custom actions. Supported positions: ${supportedPositions}`,
5085
+ INVALID_METADATA_IDS: (targetType, invalidIds, supportedIds) => `Invalid metadata IDs for ${targetType.toLowerCase()}-level custom actions: ${invalidIds.join(', ')}. Supported metadata IDs: ${supportedIds}`,
5086
+ INVALID_DATA_MODEL_IDS: (targetType, invalidIds, supportedIds) => `Invalid data model IDs for ${targetType.toLowerCase()}-level custom actions: ${invalidIds.join(', ')}. Supported data model IDs: ${supportedIds}`,
5087
+ INVALID_FIELDS: (targetType, invalidFields, supportedFields) => `Invalid fields for ${targetType.toLowerCase()}-level custom actions: ${invalidFields.join(', ')}. Supported fields: ${supportedFields}`,
5088
+ DUPLICATE_IDS: (id, duplicateNames, keptName) => `Duplicate custom action ID '${id}' found. Actions with names '${duplicateNames.join("', '")}' will be ignored. Keeping '${keptName}'.`,
5089
+ };
5090
+
4973
5091
  /**
4974
5092
  * Copyright (c) 2023
4975
5093
  *
@@ -5083,7 +5201,8 @@ const isValidCssMargin = (value) => {
5083
5201
  logger$3.error('Please provide a valid lazyLoadingMargin value (e.g., "10px")');
5084
5202
  return false;
5085
5203
  }
5086
- // This pattern allows for an optional negative sign, and numbers that can be integers or decimals (including leading dot).
5204
+ // This pattern allows for an optional negative sign, and numbers
5205
+ // that can be integers or decimals (including leading dot).
5087
5206
  const cssUnitPattern = /^-?(\d+(\.\d*)?|\.\d+)(px|em|rem|%|vh|vw)$/i;
5088
5207
  const parts = value.trim().split(/\s+/);
5089
5208
  if (parts.length > 4) {
@@ -5290,6 +5409,8 @@ const sdkWindowKey = '_tsEmbedSDK';
5290
5409
  * @version SDK: 1.36.2 | ThoughtSpot: *
5291
5410
  */
5292
5411
  function storeValueInWindow(key, value, options = {}) {
5412
+ if (isWindowUndefined())
5413
+ return value;
5293
5414
  if (!window[sdkWindowKey]) {
5294
5415
  window[sdkWindowKey] = {};
5295
5416
  }
@@ -5300,11 +5421,16 @@ function storeValueInWindow(key, value, options = {}) {
5300
5421
  return value;
5301
5422
  }
5302
5423
  /**
5303
- * Retrieves a stored value from the global `window` object under the `_tsEmbedSDK` namespace.
5304
- * @param key - The key whose value needs to be retrieved.
5305
- * @returns The stored value or `undefined` if the key is not found.
5424
+ * Retrieves a stored value from the global
5425
+ * `window` object under the `_tsEmbedSDK` namespace.
5426
+ * Returns undefined in SSR environment.
5306
5427
  */
5307
- const getValueFromWindow = (key) => { var _a; return (_a = window === null || window === void 0 ? void 0 : window[sdkWindowKey]) === null || _a === void 0 ? void 0 : _a[key]; };
5428
+ const getValueFromWindow = (key) => {
5429
+ var _a;
5430
+ if (isWindowUndefined())
5431
+ return undefined;
5432
+ return (_a = window === null || window === void 0 ? void 0 : window[sdkWindowKey]) === null || _a === void 0 ? void 0 : _a[key];
5433
+ };
5308
5434
  /**
5309
5435
  * Check if an array includes a string value
5310
5436
  * @param arr - The array to check
@@ -5415,6 +5541,25 @@ const formatTemplate = (template, values) => {
5415
5541
  return template.replace(/\{(\w+)\}/g, (match, key) => {
5416
5542
  return values[key] !== undefined ? String(values[key]) : match;
5417
5543
  });
5544
+ };
5545
+ const getHostEventsConfig = (viewConfig) => {
5546
+ return {
5547
+ shouldBypassPayloadValidation: viewConfig.shouldBypassPayloadValidation,
5548
+ useHostEventsV2: viewConfig.useHostEventsV2,
5549
+ };
5550
+ };
5551
+ /**
5552
+ * Check if the window is undefined
5553
+ * If the window is undefined, it means the code is running in a SSR environment.
5554
+ * @returns true if the window is undefined, false otherwise
5555
+ *
5556
+ */
5557
+ const isWindowUndefined = () => {
5558
+ if (typeof window === 'undefined') {
5559
+ logger$3.error(ERROR_MESSAGE.SSR_ENVIRONMENT_ERROR);
5560
+ return true;
5561
+ }
5562
+ return false;
5418
5563
  };
5419
5564
 
5420
5565
  /**
@@ -7700,48 +7845,12 @@ var UIPassthroughEvent;
7700
7845
  UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
7701
7846
  UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
7702
7847
  UIPassthroughEvent["GetUnsavedAnswerTML"] = "getUnsavedAnswerTML";
7703
- })(UIPassthroughEvent || (UIPassthroughEvent = {}));
7704
-
7705
- const ERROR_MESSAGE = {
7706
- INVALID_THOUGHTSPOT_HOST: 'Error parsing ThoughtSpot host. Please provide a valid URL.',
7707
- SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND: 'Please select a Model to get started',
7708
- LIVEBOARD_VIZ_ID_VALIDATION: 'Please select a Liveboard to embed.',
7709
- TRIGGER_TIMED_OUT: 'Trigger timed-out in getting a response',
7710
- SEARCHEMBED_BETA_WRANING_MESSAGE: 'SearchEmbed is in Beta in this release.',
7711
- SAGE_EMBED_BETA_WARNING_MESSAGE: 'SageEmbed is in Beta in this release.',
7712
- THIRD_PARTY_COOKIE_BLOCKED_ALERT: 'Third-party cookie access is blocked on this browser. Please allow third-party cookies for this to work properly. \nYou can use `suppressNoCookieAccessAlert` to suppress this message.',
7713
- DUPLICATE_TOKEN_ERR: 'Duplicate token. Please issue a new token every time getAuthToken callback is called. See https://developers.thoughtspot.com/docs/?pageid=embed-auth#trusted-auth-embed for more details.',
7714
- SDK_NOT_INITIALIZED: 'SDK not initialized',
7715
- SESSION_INFO_FAILED: 'Failed to get session information',
7716
- INVALID_TOKEN_ERROR: 'Received invalid token from getAuthToken callback or authToken endpoint.',
7717
- INVALID_TOKEN_TYPE_ERROR: 'Expected getAuthToken to return a string, but received a {invalidType}.',
7718
- MIXPANEL_TOKEN_NOT_FOUND: 'Mixpanel token not found in session info',
7719
- PRERENDER_ID_MISSING: 'PreRender ID is required for preRender',
7720
- SYNC_STYLE_CALLED_BEFORE_RENDER: 'PreRender should be called before using syncPreRenderStyle',
7721
- CSP_VIOLATION_ALERT: 'CSP violation detected. Please check the console errors for more details.',
7722
- CSP_FRAME_HOST_VIOLATION_LOG_MESSAGE: 'Please set up CSP correctly for the application to start working. For more information, see https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts. \n If the issue persists, refer to https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts',
7723
- MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
7724
- RENDER_CALLED_BEFORE_INIT: 'Looks like render was called before calling init, the render won\'t start until init is called.\nFor more info check\n1. https://developers.thoughtspot.com/docs/Function_init#_init\n2.https://developers.thoughtspot.com/docs/getting-started#initSdk',
7725
- SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
7726
- OFFLINE_WARNING: 'Network not Detected. Embed is offline. Please reconnect and refresh',
7727
- INIT_SDK_REQUIRED: 'You need to init the ThoughtSpot SDK module first',
7728
- CONFLICTING_ACTIONS_CONFIG: 'You cannot have both hidden actions and visible actions',
7729
- CONFLICTING_TABS_CONFIG: 'You cannot have both hidden Tabs and visible Tabs',
7730
- RENDER_BEFORE_EVENTS_REQUIRED: 'Please call render before triggering events',
7731
- HOST_EVENT_TYPE_UNDEFINED: 'Host event type is undefined',
7732
- LOGIN_FAILED: 'Login failed',
7733
- ERROR_PARSING_API_INTERCEPT_BODY: 'Error parsing api intercept body',
7734
- };
7735
- const CUSTOM_ACTIONS_ERROR_MESSAGE = {
7736
- INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
7737
- MISSING_REQUIRED_FIELDS: (id, missingFields) => `Custom Action Validation Error for '${id}': Missing required fields: ${missingFields.join(', ')}`,
7738
- UNSUPPORTED_TARGET: (id, targetType) => `Custom Action Validation Error for '${id}': Target type '${targetType}' is not supported`,
7739
- INVALID_POSITION: (position, targetType, supportedPositions) => `Position '${position}' is not supported for ${targetType.toLowerCase()}-level custom actions. Supported positions: ${supportedPositions}`,
7740
- INVALID_METADATA_IDS: (targetType, invalidIds, supportedIds) => `Invalid metadata IDs for ${targetType.toLowerCase()}-level custom actions: ${invalidIds.join(', ')}. Supported metadata IDs: ${supportedIds}`,
7741
- INVALID_DATA_MODEL_IDS: (targetType, invalidIds, supportedIds) => `Invalid data model IDs for ${targetType.toLowerCase()}-level custom actions: ${invalidIds.join(', ')}. Supported data model IDs: ${supportedIds}`,
7742
- INVALID_FIELDS: (targetType, invalidFields, supportedFields) => `Invalid fields for ${targetType.toLowerCase()}-level custom actions: ${invalidFields.join(', ')}. Supported fields: ${supportedFields}`,
7743
- DUPLICATE_IDS: (id, duplicateNames, keptName) => `Duplicate custom action ID '${id}' found. Actions with names '${duplicateNames.join("', '")}' will be ignored. Keeping '${keptName}'.`,
7744
- };
7848
+ })(UIPassthroughEvent || (UIPassthroughEvent = {}));
7849
+ var PageType;
7850
+ (function (PageType) {
7851
+ PageType["PAGE"] = "page";
7852
+ PageType["DIALOG"] = "dialog";
7853
+ })(PageType || (PageType = {}));
7745
7854
 
7746
7855
  const EndPoints = {
7747
7856
  AUTH_VERIFICATION: '/callosum/v1/session/info',
@@ -8640,7 +8749,7 @@ class AnswerService {
8640
8749
  async getTML() {
8641
8750
  const { object } = await this.executeQuery(getAnswerTML, {});
8642
8751
  const edoc = object[0].edoc;
8643
- const YAML = await import('./index-CSFjfTVk.js');
8752
+ const YAML = await import('./index-CI6s4VMY.js');
8644
8753
  const parsedDoc = YAML.parse(edoc);
8645
8754
  return {
8646
8755
  answer: {
@@ -17502,6 +17611,7 @@ const reload = (iFrame) => {
17502
17611
  * @param message
17503
17612
  * @param message.type
17504
17613
  * @param message.data
17614
+ * @param message.context
17505
17615
  * @param thoughtSpotHost
17506
17616
  * @param channel
17507
17617
  */
@@ -17516,8 +17626,9 @@ const TRIGGER_TIMEOUT = 30000;
17516
17626
  * @param messageType
17517
17627
  * @param thoughtSpotHost
17518
17628
  * @param data
17629
+ * @param context
17519
17630
  */
17520
- function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
17631
+ function processTrigger(iFrame, messageType, thoughtSpotHost, data, context) {
17521
17632
  return new Promise((res, rej) => {
17522
17633
  var _a;
17523
17634
  if (messageType === HostEvent.Reload) {
@@ -17551,7 +17662,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
17551
17662
  channel.port1.close();
17552
17663
  res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
17553
17664
  }, TRIGGER_TIMEOUT);
17554
- return postIframeMessage(iFrame, { type: messageType, data }, thoughtSpotHost, channel);
17665
+ return postIframeMessage(iFrame, { type: messageType, data, context }, thoughtSpotHost, channel);
17555
17666
  });
17556
17667
  }
17557
17668
 
@@ -17672,6 +17783,8 @@ function backwardCompat(embedConfig) {
17672
17783
  }
17673
17784
  const initFlagKey = 'initFlagKey';
17674
17785
  const createAndSetInitPromise = () => {
17786
+ if (isWindowUndefined())
17787
+ return;
17675
17788
  const { promise: initPromise, resolve: initPromiseResolve,
17676
17789
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
17677
17790
  // @ts-ignore
@@ -17711,6 +17824,8 @@ const getIsInitCalled = () => { var _a; return !!((_a = getValueFromWindow(initF
17711
17824
  */
17712
17825
  const init = (embedConfig) => {
17713
17826
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
17827
+ if (isWindowUndefined())
17828
+ return null;
17714
17829
  sanity(embedConfig);
17715
17830
  resetAllCachedServices();
17716
17831
  embedConfig = setEmbedConfig(backwardCompat({
@@ -17893,7 +18008,7 @@ function processEventData(type, eventData, thoughtSpotHost, containerEl) {
17893
18008
  return eventData;
17894
18009
  }
17895
18010
 
17896
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.44.2";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^11.2.0","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^30.0.0","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^30.2.0","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^30.2.0","jest-environment-jsdom":"^29.7.0","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^29.4.6","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"32 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
18011
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.44.4-HE-beta.1";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^11.2.0","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^30.0.0","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^30.2.0","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^30.2.0","jest-environment-jsdom":"^29.7.0","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^29.4.6","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"32 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
17897
18012
 
17898
18013
  class HostEventClient {
17899
18014
  constructor(iFrame) {
@@ -17905,16 +18020,16 @@ class HostEventClient {
17905
18020
  * @param {any} data Data to send with the host event
17906
18021
  * @returns {Promise<any>} - the response from the process trigger
17907
18022
  */
17908
- async processTrigger(message, data) {
18023
+ async processTrigger(message, data, context) {
17909
18024
  if (!this.iFrame) {
17910
18025
  throw new Error('Iframe element is not set');
17911
18026
  }
17912
18027
  const thoughtspotHost = getEmbedConfig().thoughtSpotHost;
17913
- return processTrigger(this.iFrame, message, thoughtspotHost, data);
18028
+ return processTrigger(this.iFrame, message, thoughtspotHost, data, context);
17914
18029
  }
17915
- async handleHostEventWithParam(apiName, parameters) {
18030
+ async handleHostEventWithParam(apiName, parameters, context) {
17916
18031
  var _a, _b, _c, _d;
17917
- const response = (_b = (_a = (await this.triggerUIPassthroughApi(apiName, parameters))) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.call(_a, (r) => r.error || r.value)[0];
18032
+ const response = (_b = (_a = (await this.triggerUIPassthroughApi(apiName, parameters, context))) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.call(_a, (r) => r.error || r.value)[0];
17918
18033
  if (!response) {
17919
18034
  const error = `No answer found${parameters.vizId ? ` for vizId: ${parameters.vizId}` : ''}.`;
17920
18035
  // eslint-disable-next-line no-throw-literal
@@ -17929,8 +18044,8 @@ class HostEventClient {
17929
18044
  }
17930
18045
  return { ...response.value };
17931
18046
  }
17932
- async hostEventFallback(hostEvent, data) {
17933
- return this.processTrigger(hostEvent, data);
18047
+ async hostEventFallback(hostEvent, data, context) {
18048
+ return this.processTrigger(hostEvent, data, context);
17934
18049
  }
17935
18050
  /**
17936
18051
  * Setter for the iframe element used for host events
@@ -17939,49 +18054,49 @@ class HostEventClient {
17939
18054
  setIframeElement(iFrame) {
17940
18055
  this.iFrame = iFrame;
17941
18056
  }
17942
- async triggerUIPassthroughApi(apiName, parameters) {
18057
+ async triggerUIPassthroughApi(apiName, parameters, context) {
17943
18058
  const res = await this.processTrigger(HostEvent.UIPassthrough, {
17944
18059
  type: apiName,
17945
18060
  parameters,
17946
- });
18061
+ }, context);
17947
18062
  return res;
17948
18063
  }
17949
- async handlePinEvent(payload) {
18064
+ async handlePinEvent(payload, context) {
17950
18065
  var _a, _b;
17951
18066
  if (!payload || !('newVizName' in payload)) {
17952
- return this.hostEventFallback(HostEvent.Pin, payload);
18067
+ return this.hostEventFallback(HostEvent.Pin, payload, context);
17953
18068
  }
17954
18069
  const formattedPayload = {
17955
18070
  ...payload,
17956
18071
  pinboardId: (_a = payload.liveboardId) !== null && _a !== void 0 ? _a : payload.pinboardId,
17957
18072
  newPinboardName: (_b = payload.newLiveboardName) !== null && _b !== void 0 ? _b : payload.newPinboardName,
17958
18073
  };
17959
- const data = await this.handleHostEventWithParam(UIPassthroughEvent.PinAnswerToLiveboard, formattedPayload);
18074
+ const data = await this.handleHostEventWithParam(UIPassthroughEvent.PinAnswerToLiveboard, formattedPayload, context);
17960
18075
  return {
17961
18076
  ...data,
17962
18077
  liveboardId: data.pinboardId,
17963
18078
  };
17964
18079
  }
17965
- async handleSaveAnswerEvent(payload) {
18080
+ async handleSaveAnswerEvent(payload, context) {
17966
18081
  var _a, _b, _c, _d;
17967
18082
  if (!payload || !('name' in payload) || !('description' in payload)) {
17968
18083
  // Save is the fallback for SaveAnswer
17969
- return this.hostEventFallback(HostEvent.Save, payload);
18084
+ return this.hostEventFallback(HostEvent.Save, payload, context);
17970
18085
  }
17971
- const data = await this.handleHostEventWithParam(UIPassthroughEvent.SaveAnswer, payload);
18086
+ const data = await this.handleHostEventWithParam(UIPassthroughEvent.SaveAnswer, payload, context);
17972
18087
  return {
17973
18088
  ...data,
17974
18089
  answerId: (_d = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.saveResponse) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.Answer__save) === null || _c === void 0 ? void 0 : _c.answer) === null || _d === void 0 ? void 0 : _d.id,
17975
18090
  };
17976
18091
  }
17977
- async triggerHostEvent(hostEvent, payload) {
18092
+ async triggerHostEvent(hostEvent, payload, context) {
17978
18093
  switch (hostEvent) {
17979
18094
  case HostEvent.Pin:
17980
- return this.handlePinEvent(payload);
18095
+ return this.handlePinEvent(payload, context);
17981
18096
  case HostEvent.SaveAnswer:
17982
- return this.handleSaveAnswerEvent(payload);
18097
+ return this.handleSaveAnswerEvent(payload, context);
17983
18098
  default:
17984
- return this.hostEventFallback(hostEvent, payload);
18099
+ return this.hostEventFallback(hostEvent, payload, context);
17985
18100
  }
17986
18101
  }
17987
18102
  }
@@ -18616,6 +18731,7 @@ class TsEmbed {
18616
18731
  hiddenListColumns: this.viewConfig.hiddenListColumns || [],
18617
18732
  customActions: customActionsResult.actions,
18618
18733
  ...getInterceptInitData(this.viewConfig),
18734
+ ...getHostEventsConfig(this.viewConfig),
18619
18735
  };
18620
18736
  return baseInitData;
18621
18737
  }
@@ -18636,9 +18752,10 @@ class TsEmbed {
18636
18752
  .join('/');
18637
18753
  return `${basePath}#`;
18638
18754
  }
18639
- getUpdateEmbedParamsObject() {
18755
+ async getUpdateEmbedParamsObject() {
18640
18756
  let queryParams = this.getEmbedParamsObject();
18641
- queryParams = { ...this.viewConfig, ...queryParams, ...this.getAppInitData() };
18757
+ const appInitData = await this.getAppInitData();
18758
+ queryParams = { ...this.viewConfig, ...queryParams, ...appInitData };
18642
18759
  return queryParams;
18643
18760
  }
18644
18761
  /**
@@ -18947,6 +19064,8 @@ class TsEmbed {
18947
19064
  preRenderWrapper.id = preRenderIds.wrapper;
18948
19065
  const initialPreRenderWrapperStyle = {
18949
19066
  position: 'absolute',
19067
+ top: '0',
19068
+ left: '0',
18950
19069
  width: '100vw',
18951
19070
  height: '100vh',
18952
19071
  };
@@ -19237,7 +19356,7 @@ class TsEmbed {
19237
19356
  * @param {any} data The payload to send with the message
19238
19357
  * @returns A promise that resolves with the response from the embedded app
19239
19358
  */
19240
- async trigger(messageType, data = {}) {
19359
+ async trigger(messageType, data = {}, context) {
19241
19360
  uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
19242
19361
  if (!this.isRendered) {
19243
19362
  this.handleError({
@@ -19264,7 +19383,7 @@ class TsEmbed {
19264
19383
  return null;
19265
19384
  }
19266
19385
  // send an empty object, this is needed for liveboard default handlers
19267
- return this.hostEventClient.triggerHostEvent(messageType, data);
19386
+ return this.hostEventClient.triggerHostEvent(messageType, data, context);
19268
19387
  }
19269
19388
  /**
19270
19389
  * Triggers an event to the embedded app, skipping the UI flow.
@@ -19297,6 +19416,19 @@ class TsEmbed {
19297
19416
  handleRenderForPrerender() {
19298
19417
  return this.render();
19299
19418
  }
19419
+ /**
19420
+ * Get the current context of the embedded TS component.
19421
+ * @returns The current context object containing the page type and object ids.
19422
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
19423
+ */
19424
+ async getCurrentContext() {
19425
+ return new Promise((resolve) => {
19426
+ this.executeAfterEmbedContainerLoaded(async () => {
19427
+ const context = await this.trigger(HostEvent.GetPageContext, {});
19428
+ resolve(context);
19429
+ });
19430
+ });
19431
+ }
19300
19432
  /**
19301
19433
  * Creates the preRender shell
19302
19434
  * @param showPreRenderByDefault - Show the preRender after render, hidden by default
@@ -19411,8 +19543,20 @@ class TsEmbed {
19411
19543
  }
19412
19544
  this.validatePreRenderViewConfig(this.viewConfig);
19413
19545
  logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
19414
- this.executeAfterEmbedContainerLoaded(() => {
19415
- this.trigger(HostEvent.UpdateEmbedParams, this.getUpdateEmbedParamsObject());
19546
+ this.executeAfterEmbedContainerLoaded(async () => {
19547
+ try {
19548
+ const params = await this.getUpdateEmbedParamsObject();
19549
+ this.trigger(HostEvent.UpdateEmbedParams, params);
19550
+ }
19551
+ catch (error) {
19552
+ logger$3.error(ERROR_MESSAGE.UPDATE_PARAMS_FAILED, error);
19553
+ this.handleError({
19554
+ errorType: ErrorDetailsTypes.API,
19555
+ message: (error === null || error === void 0 ? void 0 : error.message) || ERROR_MESSAGE.UPDATE_PARAMS_FAILED,
19556
+ code: EmbedErrorCodes.UPDATE_PARAMS_FAILED,
19557
+ error: (error === null || error === void 0 ? void 0 : error.message) || error,
19558
+ });
19559
+ }
19416
19560
  });
19417
19561
  }
19418
19562
  this.beforePrerenderVisible();
@@ -19432,7 +19576,7 @@ class TsEmbed {
19432
19576
  this.resizeObserver.observe(this.el);
19433
19577
  }
19434
19578
  }
19435
- removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events']);
19579
+ removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events', 'overflow']);
19436
19580
  this.subscribeToEvents();
19437
19581
  // Setup fullscreen change handler for prerendered components
19438
19582
  if (this.iFrame) {
@@ -19475,7 +19619,10 @@ class TsEmbed {
19475
19619
  opacity: '0',
19476
19620
  pointerEvents: 'none',
19477
19621
  zIndex: '-1000',
19478
- position: 'absolute ',
19622
+ position: 'absolute',
19623
+ top: '0',
19624
+ left: '0',
19625
+ overflow: 'hidden',
19479
19626
  };
19480
19627
  setStyleProperties(this.preRenderWrapper, preRenderHideStyles);
19481
19628
  if (this.resizeObserver) {
@@ -19682,6 +19829,15 @@ let SearchBarEmbed$1 = class SearchBarEmbed extends TsEmbed {
19682
19829
  const defaultAppInitData = await super.getAppInitData();
19683
19830
  return { ...defaultAppInitData, ...this.getSearchInitData() };
19684
19831
  }
19832
+ /**
19833
+ * Get the current context of the embedded search bar.
19834
+ * @returns The current context object containing the page type and object ids.
19835
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
19836
+ */
19837
+ async getCurrentContext() {
19838
+ const context = await super.getCurrentContext();
19839
+ return context;
19840
+ }
19685
19841
  };
19686
19842
 
19687
19843
  /**
@@ -19764,6 +19920,15 @@ let SageEmbed$1 = class SageEmbed extends V1Embed {
19764
19920
  await this.renderV1Embed(src);
19765
19921
  return this;
19766
19922
  }
19923
+ /**
19924
+ * Get the current context of the embedded SageEmbed.
19925
+ * @returns The current context object containing the page type and object ids.
19926
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
19927
+ */
19928
+ async getCurrentContext() {
19929
+ const context = await super.getCurrentContext();
19930
+ return context;
19931
+ }
19767
19932
  };
19768
19933
 
19769
19934
  /**
@@ -19939,6 +20104,15 @@ let SearchEmbed$1 = class SearchEmbed extends TsEmbed {
19939
20104
  });
19940
20105
  return this;
19941
20106
  }
20107
+ /**
20108
+ * Get the current context of the embedded search.
20109
+ * @returns The current context object containing the page type and object ids.
20110
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
20111
+ */
20112
+ async getCurrentContext() {
20113
+ const context = await super.getCurrentContext();
20114
+ return context;
20115
+ }
19942
20116
  };
19943
20117
 
19944
20118
  /**
@@ -20487,6 +20661,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
20487
20661
  super(domSelector, viewConfig);
20488
20662
  this.defaultHeight = 500;
20489
20663
  this.sendFullHeightLazyLoadData = () => {
20664
+ console.log('sendFullHeightLazyLoadData', this.iFrame);
20490
20665
  const data = calculateVisibleElementData(this.iFrame);
20491
20666
  this.trigger(HostEvent.VisibleEmbedCoordinates, data);
20492
20667
  };
@@ -20747,7 +20922,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
20747
20922
  * @param {any} data The payload to send with the message
20748
20923
  * @returns A promise that resolves with the response from the embedded app
20749
20924
  */
20750
- trigger(messageType, data = {}) {
20925
+ trigger(messageType, data = {}, context) {
20751
20926
  const dataWithVizId = data;
20752
20927
  if (messageType === HostEvent.SetActiveTab) {
20753
20928
  this.setActiveTab(data);
@@ -20756,7 +20931,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
20756
20931
  if (typeof dataWithVizId === 'object' && this.viewConfig.vizId) {
20757
20932
  dataWithVizId.vizId = this.viewConfig.vizId;
20758
20933
  }
20759
- return super.trigger(messageType, dataWithVizId);
20934
+ return super.trigger(messageType, dataWithVizId, context);
20760
20935
  }
20761
20936
  /**
20762
20937
  * Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
@@ -20825,6 +21000,15 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
20825
21000
  }
20826
21001
  return url;
20827
21002
  }
21003
+ /**
21004
+ * Get the current context of the embedded liveboard.
21005
+ * @returns The current context object containing the page type and object ids.
21006
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
21007
+ */
21008
+ async getCurrentContext() {
21009
+ const context = await super.getCurrentContext();
21010
+ return context;
21011
+ }
20828
21012
  };
20829
21013
 
20830
21014
  const createConversation = `
@@ -21449,6 +21633,15 @@ let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
21449
21633
  await this.renderIFrame(src);
21450
21634
  return this;
21451
21635
  }
21636
+ /**
21637
+ * Get the current context of the embedded SpotterEmbed.
21638
+ * @returns The current context object containing the page type and object ids.
21639
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
21640
+ */
21641
+ async getCurrentContext() {
21642
+ const context = await super.getCurrentContext();
21643
+ return context;
21644
+ }
21452
21645
  };
21453
21646
  /**
21454
21647
  * Embed ThoughtSpot AI Conversation.