@thoughtspot/visual-embed-sdk 1.45.1 → 1.45.3

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/cjs/package.json +1 -1
  2. package/cjs/src/authToken.d.ts +1 -1
  3. package/cjs/src/authToken.d.ts.map +1 -1
  4. package/cjs/src/authToken.js +2 -2
  5. package/cjs/src/authToken.js.map +1 -1
  6. package/cjs/src/authToken.spec.js +71 -0
  7. package/cjs/src/authToken.spec.js.map +1 -1
  8. package/cjs/src/css-variables.d.ts +48 -0
  9. package/cjs/src/css-variables.d.ts.map +1 -1
  10. package/cjs/src/embed/app.d.ts +37 -0
  11. package/cjs/src/embed/app.d.ts.map +1 -1
  12. package/cjs/src/embed/app.js +37 -1
  13. package/cjs/src/embed/app.js.map +1 -1
  14. package/cjs/src/embed/app.spec.js +24 -0
  15. package/cjs/src/embed/app.spec.js.map +1 -1
  16. package/cjs/src/embed/conversation.d.ts +127 -9
  17. package/cjs/src/embed/conversation.d.ts.map +1 -1
  18. package/cjs/src/embed/conversation.js +41 -18
  19. package/cjs/src/embed/conversation.js.map +1 -1
  20. package/cjs/src/embed/conversation.spec.js +96 -3
  21. package/cjs/src/embed/conversation.spec.js.map +1 -1
  22. package/cjs/src/embed/hostEventClient/contracts.d.ts +3 -3
  23. package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  24. package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
  25. package/cjs/src/embed/hostEventClient/host-event-client.d.ts +8 -8
  26. package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  27. package/cjs/src/embed/hostEventClient/host-event-client.js +18 -18
  28. package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
  29. package/cjs/src/embed/hostEventClient/host-event-client.spec.js +7 -7
  30. package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  31. package/cjs/src/embed/liveboard.d.ts +40 -3
  32. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  33. package/cjs/src/embed/liveboard.js +40 -12
  34. package/cjs/src/embed/liveboard.js.map +1 -1
  35. package/cjs/src/embed/liveboard.spec.js +180 -8
  36. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  37. package/cjs/src/embed/ts-embed.d.ts +23 -2
  38. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  39. package/cjs/src/embed/ts-embed.js +64 -22
  40. package/cjs/src/embed/ts-embed.js.map +1 -1
  41. package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
  42. package/cjs/src/embed/ts-embed.spec.js +138 -19
  43. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  44. package/cjs/src/errors.d.ts +1 -0
  45. package/cjs/src/errors.d.ts.map +1 -1
  46. package/cjs/src/errors.js +1 -0
  47. package/cjs/src/errors.js.map +1 -1
  48. package/cjs/src/index.d.ts +3 -3
  49. package/cjs/src/index.d.ts.map +1 -1
  50. package/cjs/src/index.js +3 -2
  51. package/cjs/src/index.js.map +1 -1
  52. package/cjs/src/types.d.ts +356 -42
  53. package/cjs/src/types.d.ts.map +1 -1
  54. package/cjs/src/types.js +227 -20
  55. package/cjs/src/types.js.map +1 -1
  56. package/cjs/src/utils/graphql/answerService/answer-queries.d.ts +1 -0
  57. package/cjs/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -1
  58. package/cjs/src/utils/graphql/answerService/answer-queries.js +23 -1
  59. package/cjs/src/utils/graphql/answerService/answer-queries.js.map +1 -1
  60. package/cjs/src/utils/graphql/answerService/answerService.d.ts +2 -1
  61. package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  62. package/cjs/src/utils/graphql/answerService/answerService.js +9 -1
  63. package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
  64. package/cjs/src/utils/graphql/answerService/answerService.spec.js +73 -0
  65. package/cjs/src/utils/graphql/answerService/answerService.spec.js.map +1 -1
  66. package/cjs/src/utils/processTrigger.d.ts +3 -2
  67. package/cjs/src/utils/processTrigger.d.ts.map +1 -1
  68. package/cjs/src/utils/processTrigger.js +4 -2
  69. package/cjs/src/utils/processTrigger.js.map +1 -1
  70. package/cjs/src/utils.d.ts +20 -1
  71. package/cjs/src/utils.d.ts.map +1 -1
  72. package/cjs/src/utils.js +40 -1
  73. package/cjs/src/utils.js.map +1 -1
  74. package/cjs/src/utils.spec.js +49 -0
  75. package/cjs/src/utils.spec.js.map +1 -1
  76. package/dist/{index-Dgzjq7qH.js → index-BuwECGdm.js} +1 -1
  77. package/dist/src/authToken.d.ts +1 -1
  78. package/dist/src/authToken.d.ts.map +1 -1
  79. package/dist/src/css-variables.d.ts +48 -0
  80. package/dist/src/css-variables.d.ts.map +1 -1
  81. package/dist/src/embed/app.d.ts +37 -0
  82. package/dist/src/embed/app.d.ts.map +1 -1
  83. package/dist/src/embed/conversation.d.ts +127 -9
  84. package/dist/src/embed/conversation.d.ts.map +1 -1
  85. package/dist/src/embed/hostEventClient/contracts.d.ts +3 -3
  86. package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  87. package/dist/src/embed/hostEventClient/host-event-client.d.ts +8 -8
  88. package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  89. package/dist/src/embed/liveboard.d.ts +40 -3
  90. package/dist/src/embed/liveboard.d.ts.map +1 -1
  91. package/dist/src/embed/ts-embed.d.ts +23 -2
  92. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  93. package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
  94. package/dist/src/errors.d.ts +1 -0
  95. package/dist/src/errors.d.ts.map +1 -1
  96. package/dist/src/index.d.ts +3 -3
  97. package/dist/src/index.d.ts.map +1 -1
  98. package/dist/src/types.d.ts +356 -42
  99. package/dist/src/types.d.ts.map +1 -1
  100. package/dist/src/utils/graphql/answerService/answer-queries.d.ts +1 -0
  101. package/dist/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -1
  102. package/dist/src/utils/graphql/answerService/answerService.d.ts +2 -1
  103. package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  104. package/dist/src/utils/processTrigger.d.ts +3 -2
  105. package/dist/src/utils/processTrigger.d.ts.map +1 -1
  106. package/dist/src/utils.d.ts +20 -1
  107. package/dist/src/utils.d.ts.map +1 -1
  108. package/dist/tsembed-react.es.js +501 -98
  109. package/dist/tsembed-react.js +500 -97
  110. package/dist/tsembed.es.js +516 -113
  111. package/dist/tsembed.js +29956 -29553
  112. package/dist/visual-embed-sdk-react-full.d.ts +819 -282
  113. package/dist/visual-embed-sdk-react.d.ts +818 -281
  114. package/dist/visual-embed-sdk.d.ts +882 -321
  115. package/lib/package.json +1 -1
  116. package/lib/src/authToken.d.ts +1 -1
  117. package/lib/src/authToken.d.ts.map +1 -1
  118. package/lib/src/authToken.js +2 -2
  119. package/lib/src/authToken.js.map +1 -1
  120. package/lib/src/authToken.spec.js +72 -1
  121. package/lib/src/authToken.spec.js.map +1 -1
  122. package/lib/src/css-variables.d.ts +48 -0
  123. package/lib/src/css-variables.d.ts.map +1 -1
  124. package/lib/src/embed/app.d.ts +37 -0
  125. package/lib/src/embed/app.d.ts.map +1 -1
  126. package/lib/src/embed/app.js +39 -3
  127. package/lib/src/embed/app.js.map +1 -1
  128. package/lib/src/embed/app.spec.js +24 -0
  129. package/lib/src/embed/app.spec.js.map +1 -1
  130. package/lib/src/embed/conversation.d.ts +127 -9
  131. package/lib/src/embed/conversation.d.ts.map +1 -1
  132. package/lib/src/embed/conversation.js +42 -19
  133. package/lib/src/embed/conversation.js.map +1 -1
  134. package/lib/src/embed/conversation.spec.js +96 -3
  135. package/lib/src/embed/conversation.spec.js.map +1 -1
  136. package/lib/src/embed/hostEventClient/contracts.d.ts +3 -3
  137. package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  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 +40 -3
  146. package/lib/src/embed/liveboard.d.ts.map +1 -1
  147. package/lib/src/embed/liveboard.js +41 -13
  148. package/lib/src/embed/liveboard.js.map +1 -1
  149. package/lib/src/embed/liveboard.spec.js +180 -8
  150. package/lib/src/embed/liveboard.spec.js.map +1 -1
  151. package/lib/src/embed/ts-embed.d.ts +23 -2
  152. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  153. package/lib/src/embed/ts-embed.js +64 -22
  154. package/lib/src/embed/ts-embed.js.map +1 -1
  155. package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
  156. package/lib/src/embed/ts-embed.spec.js +139 -20
  157. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  158. package/lib/src/errors.d.ts +1 -0
  159. package/lib/src/errors.d.ts.map +1 -1
  160. package/lib/src/errors.js +1 -0
  161. package/lib/src/errors.js.map +1 -1
  162. package/lib/src/index.d.ts +3 -3
  163. package/lib/src/index.d.ts.map +1 -1
  164. package/lib/src/index.js +2 -2
  165. package/lib/src/index.js.map +1 -1
  166. package/lib/src/types.d.ts +356 -42
  167. package/lib/src/types.d.ts.map +1 -1
  168. package/lib/src/types.js +226 -19
  169. package/lib/src/types.js.map +1 -1
  170. package/lib/src/utils/graphql/answerService/answer-queries.d.ts +1 -0
  171. package/lib/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -1
  172. package/lib/src/utils/graphql/answerService/answer-queries.js +22 -0
  173. package/lib/src/utils/graphql/answerService/answer-queries.js.map +1 -1
  174. package/lib/src/utils/graphql/answerService/answerService.d.ts +2 -1
  175. package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  176. package/lib/src/utils/graphql/answerService/answerService.js +9 -1
  177. package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
  178. package/lib/src/utils/graphql/answerService/answerService.spec.js +73 -0
  179. package/lib/src/utils/graphql/answerService/answerService.spec.js.map +1 -1
  180. package/lib/src/utils/processTrigger.d.ts +3 -2
  181. package/lib/src/utils/processTrigger.d.ts.map +1 -1
  182. package/lib/src/utils/processTrigger.js +4 -2
  183. package/lib/src/utils/processTrigger.js.map +1 -1
  184. package/lib/src/utils.d.ts +20 -1
  185. package/lib/src/utils.d.ts.map +1 -1
  186. package/lib/src/utils.js +36 -0
  187. package/lib/src/utils.js.map +1 -1
  188. package/lib/src/utils.spec.js +50 -1
  189. package/lib/src/utils.spec.js.map +1 -1
  190. package/package.json +1 -1
  191. package/src/authToken.spec.ts +91 -2
  192. package/src/authToken.ts +2 -2
  193. package/src/css-variables.ts +60 -0
  194. package/src/embed/app.spec.ts +32 -0
  195. package/src/embed/app.ts +97 -1
  196. package/src/embed/conversation.spec.ts +117 -3
  197. package/src/embed/conversation.ts +188 -29
  198. package/src/embed/hostEventClient/contracts.ts +4 -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 +264 -10
  202. package/src/embed/liveboard.ts +105 -14
  203. package/src/embed/ts-embed.spec.ts +184 -8
  204. package/src/embed/ts-embed.ts +81 -24
  205. package/src/errors.ts +1 -0
  206. package/src/index.ts +7 -1
  207. package/src/types.ts +364 -40
  208. package/src/utils/graphql/answerService/answer-queries.ts +23 -0
  209. package/src/utils/graphql/answerService/answerService.spec.ts +87 -0
  210. package/src/utils/graphql/answerService/answerService.ts +13 -1
  211. package/src/utils/processTrigger.ts +6 -3
  212. package/src/utils.spec.ts +56 -0
  213. package/src/utils.ts +44 -0
@@ -1,18 +1,18 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.45.1 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.45.3 */
2
2
  'use client';
3
3
  function _mergeNamespaces(n, m) {
4
- m.forEach(function (e) {
5
- e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
6
- if (k !== 'default' && !(k in n)) {
7
- var d = Object.getOwnPropertyDescriptor(e, k);
8
- Object.defineProperty(n, k, d.get ? d : {
9
- enumerable: true,
10
- get: function () { return e[k]; }
11
- });
12
- }
13
- });
14
- });
15
- return Object.freeze(n);
4
+ m.forEach(function (e) {
5
+ e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
6
+ if (k !== 'default' && !(k in n)) {
7
+ var d = Object.getOwnPropertyDescriptor(e, k);
8
+ Object.defineProperty(n, k, d.get ? d : {
9
+ enumerable: true,
10
+ get: function () { return e[k]; }
11
+ });
12
+ }
13
+ });
14
+ });
15
+ return Object.freeze(n);
16
16
  }
17
17
 
18
18
  /**
@@ -1677,6 +1677,54 @@ var EmbedEvent;
1677
1677
  * @version SDK: 1.43.0 | ThoughtSpot: 10.15.0.cl
1678
1678
  */
1679
1679
  EmbedEvent["ApiIntercept"] = "ApiIntercept";
1680
+ /**
1681
+ * Emitted when a Spotter conversation is renamed.
1682
+ * @example
1683
+ * ```js
1684
+ * spotterEmbed.on(EmbedEvent.SpotterConversationRenamed, (payload) => {
1685
+ * console.log('Conversation renamed', payload);
1686
+ * // payload: { convId: string, oldTitle: string, newTitle: string }
1687
+ * })
1688
+ * ```
1689
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
1690
+ */
1691
+ EmbedEvent["SpotterConversationRenamed"] = "spotterConversationRenamed";
1692
+ /**
1693
+ * Emitted when a Spotter conversation is deleted.
1694
+ * @example
1695
+ * ```js
1696
+ * spotterEmbed.on(EmbedEvent.SpotterConversationDeleted, (payload) => {
1697
+ * console.log('Conversation deleted', payload);
1698
+ * // payload: { convId: string, title: string }
1699
+ * })
1700
+ * ```
1701
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
1702
+ */
1703
+ EmbedEvent["SpotterConversationDeleted"] = "spotterConversationDeleted";
1704
+ /**
1705
+ * Emitted when a Spotter conversation is selected/clicked.
1706
+ * @example
1707
+ * ```js
1708
+ * spotterEmbed.on(EmbedEvent.SpotterConversationSelected, (payload) => {
1709
+ * console.log('Conversation selected', payload);
1710
+ * // payload: { convId: string, title: string, worksheetId: string }
1711
+ * })
1712
+ * ```
1713
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
1714
+ */
1715
+ EmbedEvent["SpotterConversationSelected"] = "spotterConversationSelected";
1716
+ /**
1717
+ * @hidden
1718
+ * Emitted when the auth token is about to get expired and needs to be refreshed.
1719
+ * @example
1720
+ * ```js
1721
+ * embed.on(EmbedEvent.RefreshAuthToken, (payload) => {
1722
+ * console.log('payload', payload);
1723
+ * })
1724
+ * ```
1725
+ * @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl
1726
+ */
1727
+ EmbedEvent["RefreshAuthToken"] = "RefreshAuthToken";
1680
1728
  })(EmbedEvent || (EmbedEvent = {}));
1681
1729
  /**
1682
1730
  * Event types that can be triggered by the host application
@@ -3060,6 +3108,17 @@ var HostEvent;
3060
3108
  * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
3061
3109
  */
3062
3110
  HostEvent["StartNewSpotterConversation"] = "StartNewSpotterConversation";
3111
+ /**
3112
+ * @hidden
3113
+ * Get the current context of the embedded page.
3114
+ *
3115
+ * @example
3116
+ * ```js
3117
+ * const context = await liveboardEmbed.trigger(HostEvent.GetPageContext);
3118
+ * ```
3119
+ * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
3120
+ */
3121
+ HostEvent["GetPageContext"] = "GetPageContext";
3063
3122
  })(HostEvent || (HostEvent = {}));
3064
3123
  /**
3065
3124
  * The different visual modes that the data sources panel within
@@ -3216,7 +3275,19 @@ var Param;
3216
3275
  Param["isLinkParametersEnabled"] = "isLinkParametersEnabled";
3217
3276
  Param["EnablePastConversationsSidebar"] = "enablePastConversationsSidebar";
3218
3277
  Param["UpdatedSpotterChatPrompt"] = "updatedSpotterChatPrompt";
3278
+ Param["SpotterSidebarTitle"] = "spotterSidebarTitle";
3279
+ Param["SpotterSidebarDefaultExpanded"] = "spotterSidebarDefaultExpanded";
3280
+ Param["SpotterChatRenameLabel"] = "spotterChatRenameLabel";
3281
+ Param["SpotterChatDeleteLabel"] = "spotterChatDeleteLabel";
3282
+ Param["SpotterDeleteConversationModalTitle"] = "spotterDeleteConversationModalTitle";
3283
+ Param["SpotterPastConversationAlertMessage"] = "spotterPastConversationAlertMessage";
3284
+ Param["SpotterDocumentationUrl"] = "spotterDocumentationUrl";
3285
+ Param["SpotterBestPracticesLabel"] = "spotterBestPracticesLabel";
3286
+ Param["SpotterConversationsBatchSize"] = "spotterConversationsBatchSize";
3287
+ Param["SpotterNewChatButtonTitle"] = "spotterNewChatButtonTitle";
3219
3288
  Param["IsThisPeriodInDateFiltersEnabled"] = "isThisPeriodInDateFiltersEnabled";
3289
+ Param["HideToolResponseCardBranding"] = "hideToolResponseCardBranding";
3290
+ Param["ToolResponseCardBrandingLabel"] = "toolResponseCardBrandingLabel";
3220
3291
  })(Param || (Param = {}));
3221
3292
  /**
3222
3293
  * ThoughtSpot application pages include actions and menu commands
@@ -4642,6 +4713,96 @@ var Action;
4642
4713
  * @version SDK: 1.44.0 | ThoughtSpot Cloud: 26.2.0.cl
4643
4714
  */
4644
4715
  Action["UngroupLiveboardGroup"] = "ungroupLiveboardGroup";
4716
+ /**
4717
+ * Controls visibility of the sidebar header (title and toggle button)
4718
+ * in the Spotter past conversations sidebar.
4719
+ * @example
4720
+ * ```js
4721
+ * hiddenActions: [Action.SpotterSidebarHeader]
4722
+ * ```
4723
+ * @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
4724
+ */
4725
+ Action["SpotterSidebarHeader"] = "spotterSidebarHeader";
4726
+ /**
4727
+ * Controls visibility of the sidebar footer (documentation link)
4728
+ * in the Spotter past conversations sidebar.
4729
+ * @example
4730
+ * ```js
4731
+ * hiddenActions: [Action.SpotterSidebarFooter]
4732
+ * ```
4733
+ * @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
4734
+ */
4735
+ Action["SpotterSidebarFooter"] = "spotterSidebarFooter";
4736
+ /**
4737
+ * Controls visibility and disable state of the sidebar toggle/expand button
4738
+ * in the Spotter past conversations sidebar.
4739
+ * @example
4740
+ * ```js
4741
+ * disabledActions: [Action.SpotterSidebarToggle]
4742
+ * ```
4743
+ * @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
4744
+ */
4745
+ Action["SpotterSidebarToggle"] = "spotterSidebarToggle";
4746
+ /**
4747
+ * Controls visibility and disable state of the "New Chat" button
4748
+ * in the Spotter past conversations sidebar.
4749
+ * @example
4750
+ * ```js
4751
+ * disabledActions: [Action.SpotterNewChat]
4752
+ * ```
4753
+ * @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
4754
+ */
4755
+ Action["SpotterNewChat"] = "spotterNewChat";
4756
+ /**
4757
+ * Controls visibility of the past conversation banner alert
4758
+ * in the Spotter interface.
4759
+ * @example
4760
+ * ```js
4761
+ * hiddenActions: [Action.SpotterPastChatBanner]
4762
+ * ```
4763
+ * @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
4764
+ */
4765
+ Action["SpotterPastChatBanner"] = "spotterPastChatBanner";
4766
+ /**
4767
+ * Controls visibility and disable state of the conversation edit menu
4768
+ * (three-dot menu) in the Spotter past conversations sidebar.
4769
+ * @example
4770
+ * ```js
4771
+ * disabledActions: [Action.SpotterChatMenu]
4772
+ * ```
4773
+ * @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
4774
+ */
4775
+ Action["SpotterChatMenu"] = "spotterChatMenu";
4776
+ /**
4777
+ * Controls visibility and disable state of the rename action
4778
+ * in the Spotter conversation edit menu.
4779
+ * @example
4780
+ * ```js
4781
+ * disabledActions: [Action.SpotterChatRename]
4782
+ * ```
4783
+ * @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
4784
+ */
4785
+ Action["SpotterChatRename"] = "spotterChatRename";
4786
+ /**
4787
+ * Controls visibility and disable state of the delete action
4788
+ * in the Spotter conversation edit menu.
4789
+ * @example
4790
+ * ```js
4791
+ * disabledActions: [Action.SpotterChatDelete]
4792
+ * ```
4793
+ * @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
4794
+ */
4795
+ Action["SpotterChatDelete"] = "spotterChatDelete";
4796
+ /**
4797
+ * Controls visibility and disable state of the documentation/best practices
4798
+ * link in the Spotter sidebar footer.
4799
+ * @example
4800
+ * ```js
4801
+ * disabledActions: [Action.SpotterDocs]
4802
+ * ```
4803
+ * @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
4804
+ */
4805
+ Action["SpotterDocs"] = "spotterDocs";
4645
4806
  /**
4646
4807
  * The **Include current period** checkbox for date filters.
4647
4808
  * Controls the visibility and availability of the option to include
@@ -4780,13 +4941,30 @@ var LogLevel;
4780
4941
  * Error types emitted by embedded components.
4781
4942
  *
4782
4943
  * These enum values categorize different types of errors that can occur during
4783
- * the lifecycle of an embedded ThoughtSpot component. Use these values to implement
4784
- * specific error handling logic based on the error category.
4785
- *
4786
- * @see {@link EmbedErrorDetailsEvent} - The error event object structure
4787
- * @see {@link EmbedEvent.Error} - The event that emits these errors
4944
+ * the lifecycle of an embedded ThoughtSpot component.
4945
+ * Use {@link EmbedErrorDetailsEvent} and {@link EmbedErrorCodes} to handle specific errors.
4788
4946
  * @version SDK: 1.44.2 | ThoughtSpot: 26.2.0.cl
4789
4947
  * @group Error Handling
4948
+ *
4949
+ * @example
4950
+ * Handle specific error types
4951
+ * ```js
4952
+ * embed.on(EmbedEvent.Error, (error) => {
4953
+ * switch (error.errorType) {
4954
+ * case ErrorDetailsTypes.API:
4955
+ * console.error('API error:', error.message);
4956
+ * break;
4957
+ * case ErrorDetailsTypes.VALIDATION_ERROR:
4958
+ * console.error('Validation error:', error.message);
4959
+ * break;
4960
+ * case ErrorDetailsTypes.NETWORK:
4961
+ * console.error('Network error:', error.message);
4962
+ * break;
4963
+ * default:
4964
+ * console.error('Unknown error:', error);
4965
+ * }
4966
+ * });
4967
+ * ```
4790
4968
  */
4791
4969
  var ErrorDetailsTypes;
4792
4970
  (function (ErrorDetailsTypes) {
@@ -4798,35 +4976,43 @@ var ErrorDetailsTypes;
4798
4976
  ErrorDetailsTypes["NETWORK"] = "NETWORK";
4799
4977
  })(ErrorDetailsTypes || (ErrorDetailsTypes = {}));
4800
4978
  /**
4801
- * Error codes for identifying specific issues in embedded ThoughtSpot components.
4802
- *
4803
- * Use these codes for precise error handling and debugging. Each code maps to a
4804
- * distinct failure scenario, enabling targeted recovery strategies.
4979
+ * Error codes for identifying specific issues in embedded ThoughtSpot components. Use {@link EmbedErrorDetailsEvent} and {@link ErrorDetailsTypes} codes for precise error handling and debugging.
4805
4980
  *
4806
4981
  * @version SDK: 1.44.2 | ThoughtSpot: 26.2.0.cl
4807
4982
  * @group Error Handling
4808
- *
4809
- * @see {@link EmbedErrorDetailsEvent} - The error event object that includes these codes
4810
- * @see {@link ErrorDetailsTypes} - General error type categories
4811
- *
4983
+
4812
4984
  * @example
4813
4985
  * Handle specific error codes in the error event handler
4814
- *
4986
+ * ```js
4815
4987
  * embed.on(EmbedEvent.Error, (error) => {
4816
- * if (error.code === EmbedErrorCodes.WORKSHEET_ID_NOT_FOUND) {
4817
- * console.error('Worksheet ID not found:', error.message);
4988
+ * switch (error.code) {
4989
+ * case EmbedErrorCodes.WORKSHEET_ID_NOT_FOUND:
4990
+ * console.error('Worksheet ID not found:', error.message);
4991
+ * break;
4992
+ * case EmbedErrorCodes.LIVEBOARD_ID_MISSING:
4993
+ * console.error('Liveboard ID is missing:', error.message);
4994
+ * break;
4995
+ * case EmbedErrorCodes.CONFLICTING_ACTIONS_CONFIG:
4996
+ * console.error('Conflicting actions configuration:', error.message);
4997
+ * break;
4998
+ * case EmbedErrorCodes.CONFLICTING_TABS_CONFIG:
4999
+ * console.error('Conflicting tabs configuration:', error.message);
5000
+ * break;
5001
+ * default:
5002
+ * console.error('Unknown error:', error);
4818
5003
  * }
4819
5004
  * });
4820
- * */
5005
+ * ```
5006
+ * */
4821
5007
  var EmbedErrorCodes;
4822
5008
  (function (EmbedErrorCodes) {
4823
5009
  /** Worksheet ID not found or does not exist */
4824
5010
  EmbedErrorCodes["WORKSHEET_ID_NOT_FOUND"] = "WORKSHEET_ID_NOT_FOUND";
4825
5011
  /** Required Liveboard ID is missing from configuration */
4826
5012
  EmbedErrorCodes["LIVEBOARD_ID_MISSING"] = "LIVEBOARD_ID_MISSING";
4827
- /** Conflicting action configuration detected (e.g., both hiddenActions and visibleActions specified) */
5013
+ /** Conflicting action configuration detected */
4828
5014
  EmbedErrorCodes["CONFLICTING_ACTIONS_CONFIG"] = "CONFLICTING_ACTIONS_CONFIG";
4829
- /** Conflicting tab configuration detected (e.g., both hiddenTabs and visibleTabs specified) */
5015
+ /** Conflicting tab configuration detected */
4830
5016
  EmbedErrorCodes["CONFLICTING_TABS_CONFIG"] = "CONFLICTING_TABS_CONFIG";
4831
5017
  /** Error during component initialization */
4832
5018
  EmbedErrorCodes["INIT_ERROR"] = "INIT_ERROR";
@@ -4844,7 +5030,28 @@ var EmbedErrorCodes;
4844
5030
  EmbedErrorCodes["PARSING_API_INTERCEPT_BODY_ERROR"] = "PARSING_API_INTERCEPT_BODY_ERROR";
4845
5031
  /** Failed to update embed parameters during pre-render */
4846
5032
  EmbedErrorCodes["UPDATE_PARAMS_FAILED"] = "UPDATE_PARAMS_FAILED";
5033
+ /** Invalid URL provided in configuration */
5034
+ EmbedErrorCodes["INVALID_URL"] = "INVALID_URL";
4847
5035
  })(EmbedErrorCodes || (EmbedErrorCodes = {}));
5036
+ var ContextType;
5037
+ (function (ContextType) {
5038
+ /**
5039
+ * Search answer context for search page or edit viz dialog on liveboard page.
5040
+ */
5041
+ ContextType["Search"] = "search-answer";
5042
+ /**
5043
+ * Liveboard context for liveboard page.
5044
+ */
5045
+ ContextType["Liveboard"] = "liveboard";
5046
+ /**
5047
+ * Answer context for explore modal/page on liveboard page.
5048
+ */
5049
+ ContextType["Answer"] = "answer";
5050
+ /**
5051
+ * Spotter context for spotter modal/page.
5052
+ */
5053
+ ContextType["Spotter"] = "spotter";
5054
+ })(ContextType || (ContextType = {}));
4848
5055
  /**
4849
5056
  * Enum for the type of API intercepted
4850
5057
  */
@@ -5018,6 +5225,7 @@ const ERROR_MESSAGE = {
5018
5225
  ERROR_PARSING_API_INTERCEPT_BODY: 'Error parsing api intercept body',
5019
5226
  SSR_ENVIRONMENT_ERROR: 'SSR environment detected. This function cannot be called in SSR environment.',
5020
5227
  UPDATE_PARAMS_FAILED: 'Failed to update embed parameters',
5228
+ INVALID_SPOTTER_DOCUMENTATION_URL: 'Invalid spotterDocumentationUrl. Please provide a valid http or https URL.',
5021
5229
  };
5022
5230
  const CUSTOM_ACTIONS_ERROR_MESSAGE = {
5023
5231
  INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
@@ -5484,6 +5692,12 @@ const formatTemplate = (template, values) => {
5484
5692
  return values[key] !== undefined ? String(values[key]) : match;
5485
5693
  });
5486
5694
  };
5695
+ const getHostEventsConfig = (viewConfig) => {
5696
+ return {
5697
+ shouldBypassPayloadValidation: viewConfig.shouldBypassPayloadValidation,
5698
+ useHostEventsV2: viewConfig.useHostEventsV2,
5699
+ };
5700
+ };
5487
5701
  /**
5488
5702
  * Check if the window is undefined
5489
5703
  * If the window is undefined, it means the code is running in a SSR environment.
@@ -5496,6 +5710,36 @@ const isWindowUndefined = () => {
5496
5710
  return true;
5497
5711
  }
5498
5712
  return false;
5713
+ };
5714
+ /**
5715
+ * Validates that a URL uses only http: or https: protocols.
5716
+ * Returns a tuple of [isValid, error] so the caller can handle validation errors.
5717
+ * @param url - The URL string to validate
5718
+ * @returns [true, null] if valid, [false, Error] if invalid
5719
+ */
5720
+ const validateHttpUrl = (url) => {
5721
+ try {
5722
+ const parsedUrl = new URL(url);
5723
+ if (parsedUrl.protocol !== 'http:' && parsedUrl.protocol !== 'https:') {
5724
+ return [false, new Error(`Invalid protocol: ${parsedUrl.protocol}. Only http: and https: are allowed.`)];
5725
+ }
5726
+ return [true, null];
5727
+ }
5728
+ catch (error) {
5729
+ return [false, error instanceof Error ? error : new Error(String(error))];
5730
+ }
5731
+ };
5732
+ /**
5733
+ * Sets a query parameter if the value is defined.
5734
+ * @param queryParams - The query params object to modify
5735
+ * @param param - The parameter key
5736
+ * @param value - The value to set
5737
+ * @param asBoolean - If true, coerces value to boolean
5738
+ */
5739
+ const setParamIfDefined = (queryParams, param, value, asBoolean = false) => {
5740
+ if (value !== undefined) {
5741
+ queryParams[param] = asBoolean ? !!value : value;
5742
+ }
5499
5743
  };
5500
5744
 
5501
5745
  /**
@@ -7907,11 +8151,11 @@ const storeAuthTokenInCache = (token) => {
7907
8151
  *
7908
8152
  * @param embedConfig
7909
8153
  */
7910
- async function getAuthenticationToken(embedConfig) {
8154
+ async function getAuthenticationToken(embedConfig, skipvalidation = false) {
7911
8155
  const cachedAuthToken = getCacheAuthToken();
7912
8156
  // Since we don't have token validation enabled , we cannot tell if the
7913
8157
  // cached token is valid or not. So we will always fetch a new token.
7914
- if (cachedAuthToken && !embedConfig.disableTokenVerification) {
8158
+ if (cachedAuthToken && !embedConfig.disableTokenVerification && !skipvalidation) {
7915
8159
  let isCachedTokenStillValid;
7916
8160
  try {
7917
8161
  isCachedTokenStillValid = await validateAuthToken(embedConfig, cachedAuthToken, true);
@@ -8356,6 +8600,28 @@ const getSQLQuery = `
8356
8600
  }
8357
8601
  }
8358
8602
  `;
8603
+ const updateDisplayMode = `
8604
+ mutation UpdateDisplayMode(
8605
+ $session: BachSessionIdInput!
8606
+ $displayMode: DisplayMode
8607
+ ) {
8608
+ Answer__updateProperties(session: $session, displayMode: $displayMode) {
8609
+ id {
8610
+ sessionId
8611
+ genNo
8612
+ acSession {
8613
+ sessionId
8614
+ genNo
8615
+ }
8616
+ }
8617
+ answer {
8618
+ id
8619
+ displayMode
8620
+ suggestedDisplayMode
8621
+ }
8622
+ }
8623
+ }
8624
+ `;
8359
8625
  const getAnswerTML = `
8360
8626
  mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies: Boolean, $formatType: EDocFormatType, $exportPermissions: Boolean, $exportFqn: Boolean) {
8361
8627
  UnsavedAnswer_getTML(
@@ -8523,7 +8789,15 @@ class AnswerService {
8523
8789
  },
8524
8790
  });
8525
8791
  }
8526
- async getSQLQuery() {
8792
+ async updateDisplayMode(displayMode = "TABLE_MODE") {
8793
+ return this.executeQuery(updateDisplayMode, {
8794
+ displayMode,
8795
+ });
8796
+ }
8797
+ async getSQLQuery(fetchSQLWithAllColumns = false) {
8798
+ if (fetchSQLWithAllColumns) {
8799
+ await this.updateDisplayMode("TABLE_MODE");
8800
+ }
8527
8801
  const { sql } = await this.executeQuery(getSQLQuery, {});
8528
8802
  return sql;
8529
8803
  }
@@ -8679,7 +8953,7 @@ class AnswerService {
8679
8953
  async getTML() {
8680
8954
  const { object } = await this.executeQuery(getAnswerTML, {});
8681
8955
  const edoc = object[0].edoc;
8682
- const YAML = await import('./index-Dgzjq7qH.js');
8956
+ const YAML = await import('./index-BuwECGdm.js');
8683
8957
  const parsedDoc = YAML.parse(edoc);
8684
8958
  return {
8685
8959
  answer: {
@@ -16415,8 +16689,8 @@ var mixpanel = init_as_module();
16415
16689
  var mixpanel_cjs = mixpanel;
16416
16690
 
16417
16691
  var mixpanel$1 = /*#__PURE__*/_mergeNamespaces({
16418
- __proto__: null,
16419
- default: mixpanel_cjs
16692
+ __proto__: null,
16693
+ default: mixpanel_cjs
16420
16694
  }, [mixpanel_cjs]);
16421
16695
 
16422
16696
  // Needed to avoid error in CJS builds on some bundlers.
@@ -17567,6 +17841,7 @@ const reload = (iFrame) => {
17567
17841
  * @param message
17568
17842
  * @param message.type
17569
17843
  * @param message.data
17844
+ * @param message.context
17570
17845
  * @param thoughtSpotHost
17571
17846
  * @param channel
17572
17847
  */
@@ -17581,8 +17856,9 @@ const TRIGGER_TIMEOUT = 30000;
17581
17856
  * @param messageType
17582
17857
  * @param thoughtSpotHost
17583
17858
  * @param data
17859
+ * @param context
17584
17860
  */
17585
- function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
17861
+ function processTrigger(iFrame, messageType, thoughtSpotHost, data, context) {
17586
17862
  return new Promise((res, rej) => {
17587
17863
  var _a;
17588
17864
  if (messageType === HostEvent.Reload) {
@@ -17616,7 +17892,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
17616
17892
  channel.port1.close();
17617
17893
  res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
17618
17894
  }, TRIGGER_TIMEOUT);
17619
- return postIframeMessage(iFrame, { type: messageType, data }, thoughtSpotHost, channel);
17895
+ return postIframeMessage(iFrame, { type: messageType, data, context }, thoughtSpotHost, channel);
17620
17896
  });
17621
17897
  }
17622
17898
 
@@ -18115,7 +18391,7 @@ function processEventData(type, eventData, thoughtSpotHost, containerEl) {
18115
18391
  return eventData;
18116
18392
  }
18117
18393
 
18118
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.45.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.23","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};
18394
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.45.3";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.23","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};
18119
18395
 
18120
18396
  class HostEventClient {
18121
18397
  constructor(iFrame) {
@@ -18127,16 +18403,16 @@ class HostEventClient {
18127
18403
  * @param {any} data Data to send with the host event
18128
18404
  * @returns {Promise<any>} - the response from the process trigger
18129
18405
  */
18130
- async processTrigger(message, data) {
18406
+ async processTrigger(message, data, context) {
18131
18407
  if (!this.iFrame) {
18132
18408
  throw new Error('Iframe element is not set');
18133
18409
  }
18134
18410
  const thoughtspotHost = getEmbedConfig().thoughtSpotHost;
18135
- return processTrigger(this.iFrame, message, thoughtspotHost, data);
18411
+ return processTrigger(this.iFrame, message, thoughtspotHost, data, context);
18136
18412
  }
18137
- async handleHostEventWithParam(apiName, parameters) {
18413
+ async handleHostEventWithParam(apiName, parameters, context) {
18138
18414
  var _a, _b, _c, _d;
18139
- 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];
18415
+ 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];
18140
18416
  if (!response) {
18141
18417
  const error = `No answer found${parameters.vizId ? ` for vizId: ${parameters.vizId}` : ''}.`;
18142
18418
  // eslint-disable-next-line no-throw-literal
@@ -18151,8 +18427,8 @@ class HostEventClient {
18151
18427
  }
18152
18428
  return { ...response.value };
18153
18429
  }
18154
- async hostEventFallback(hostEvent, data) {
18155
- return this.processTrigger(hostEvent, data);
18430
+ async hostEventFallback(hostEvent, data, context) {
18431
+ return this.processTrigger(hostEvent, data, context);
18156
18432
  }
18157
18433
  /**
18158
18434
  * Setter for the iframe element used for host events
@@ -18161,49 +18437,49 @@ class HostEventClient {
18161
18437
  setIframeElement(iFrame) {
18162
18438
  this.iFrame = iFrame;
18163
18439
  }
18164
- async triggerUIPassthroughApi(apiName, parameters) {
18440
+ async triggerUIPassthroughApi(apiName, parameters, context) {
18165
18441
  const res = await this.processTrigger(HostEvent.UIPassthrough, {
18166
18442
  type: apiName,
18167
18443
  parameters,
18168
- });
18444
+ }, context);
18169
18445
  return res;
18170
18446
  }
18171
- async handlePinEvent(payload) {
18447
+ async handlePinEvent(payload, context) {
18172
18448
  var _a, _b;
18173
18449
  if (!payload || !('newVizName' in payload)) {
18174
- return this.hostEventFallback(HostEvent.Pin, payload);
18450
+ return this.hostEventFallback(HostEvent.Pin, payload, context);
18175
18451
  }
18176
18452
  const formattedPayload = {
18177
18453
  ...payload,
18178
18454
  pinboardId: (_a = payload.liveboardId) !== null && _a !== void 0 ? _a : payload.pinboardId,
18179
18455
  newPinboardName: (_b = payload.newLiveboardName) !== null && _b !== void 0 ? _b : payload.newPinboardName,
18180
18456
  };
18181
- const data = await this.handleHostEventWithParam(UIPassthroughEvent.PinAnswerToLiveboard, formattedPayload);
18457
+ const data = await this.handleHostEventWithParam(UIPassthroughEvent.PinAnswerToLiveboard, formattedPayload, context);
18182
18458
  return {
18183
18459
  ...data,
18184
18460
  liveboardId: data.pinboardId,
18185
18461
  };
18186
18462
  }
18187
- async handleSaveAnswerEvent(payload) {
18463
+ async handleSaveAnswerEvent(payload, context) {
18188
18464
  var _a, _b, _c, _d;
18189
18465
  if (!payload || !('name' in payload) || !('description' in payload)) {
18190
18466
  // Save is the fallback for SaveAnswer
18191
- return this.hostEventFallback(HostEvent.Save, payload);
18467
+ return this.hostEventFallback(HostEvent.Save, payload, context);
18192
18468
  }
18193
- const data = await this.handleHostEventWithParam(UIPassthroughEvent.SaveAnswer, payload);
18469
+ const data = await this.handleHostEventWithParam(UIPassthroughEvent.SaveAnswer, payload, context);
18194
18470
  return {
18195
18471
  ...data,
18196
18472
  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,
18197
18473
  };
18198
18474
  }
18199
- async triggerHostEvent(hostEvent, payload) {
18475
+ async triggerHostEvent(hostEvent, payload, context) {
18200
18476
  switch (hostEvent) {
18201
18477
  case HostEvent.Pin:
18202
- return this.handlePinEvent(payload);
18478
+ return this.handlePinEvent(payload, context);
18203
18479
  case HostEvent.SaveAnswer:
18204
- return this.handleSaveAnswerEvent(payload);
18480
+ return this.handleSaveAnswerEvent(payload, context);
18205
18481
  default:
18206
- return this.hostEventFallback(hostEvent, payload);
18482
+ return this.hostEventFallback(hostEvent, payload, context);
18207
18483
  }
18208
18484
  }
18209
18485
  }
@@ -18464,31 +18740,39 @@ class TsEmbed {
18464
18740
  logger$3.error(`AppInit failed, Error : ${e === null || e === void 0 ? void 0 : e.message}`);
18465
18741
  }
18466
18742
  };
18743
+ this.handleAuthFailure = (error) => {
18744
+ logger$3.error(`${ERROR_MESSAGE.INVALID_TOKEN_ERROR} Error : ${error === null || error === void 0 ? void 0 : error.message}`);
18745
+ processAuthFailure(error, this.isPreRendered ? this.preRenderWrapper : this.el);
18746
+ };
18747
+ /**
18748
+ * Refresh the auth token if the autoLogin is true and the authType is TrustedAuthTokenCookieless
18749
+ * @param _
18750
+ * @param responder
18751
+ */
18752
+ this.tokenRefresh = async (_, responder) => {
18753
+ try {
18754
+ await this.refreshAuthTokenForCookieless(responder, EmbedEvent.RefreshAuthToken, true);
18755
+ }
18756
+ catch (e) {
18757
+ this.handleAuthFailure(e);
18758
+ }
18759
+ };
18467
18760
  /**
18468
18761
  * Sends updated auth token to the iFrame to avoid user logout
18469
18762
  * @param _
18470
18763
  * @param responder
18471
18764
  */
18472
18765
  this.updateAuthToken = async (_, responder) => {
18473
- const { authType } = this.embedConfig;
18474
- let { autoLogin } = this.embedConfig;
18475
- // Default autoLogin: true for cookieless if undefined/null, otherwise
18476
- // false
18477
- autoLogin = autoLogin !== null && autoLogin !== void 0 ? autoLogin : (authType === AuthType.TrustedAuthTokenCookieless);
18478
- if (autoLogin && authType === AuthType.TrustedAuthTokenCookieless) {
18479
- try {
18480
- const authToken = await getAuthenticationToken(this.embedConfig);
18481
- responder({
18482
- type: EmbedEvent.AuthExpire,
18483
- data: { authToken },
18484
- });
18485
- }
18486
- catch (e) {
18487
- logger$3.error(`${ERROR_MESSAGE.INVALID_TOKEN_ERROR} Error : ${e === null || e === void 0 ? void 0 : e.message}`);
18488
- processAuthFailure(e, this.isPreRendered ? this.preRenderWrapper : this.el);
18489
- }
18766
+ const { authType, autoLogin: autoLoginConfig } = this.embedConfig;
18767
+ // Default autoLogin: true for cookieless if undefined/null, otherwise false
18768
+ const autoLogin = autoLoginConfig !== null && autoLoginConfig !== void 0 ? autoLoginConfig : (authType === AuthType.TrustedAuthTokenCookieless);
18769
+ try {
18770
+ await this.refreshAuthTokenForCookieless(responder, EmbedEvent.AuthExpire, false);
18490
18771
  }
18491
- else if (autoLogin) {
18772
+ catch (e) {
18773
+ this.handleAuthFailure(e);
18774
+ }
18775
+ if (autoLogin && authType !== AuthType.TrustedAuthTokenCookieless) {
18492
18776
  handleAuth();
18493
18777
  }
18494
18778
  notifyAuthFailure(AuthFailureType.EXPIRY);
@@ -18509,8 +18793,7 @@ class TsEmbed {
18509
18793
  });
18510
18794
  }
18511
18795
  catch (e) {
18512
- logger$3.error(`${ERROR_MESSAGE.INVALID_TOKEN_ERROR} Error : ${e === null || e === void 0 ? void 0 : e.message}`);
18513
- processAuthFailure(e, this.isPreRendered ? this.preRenderWrapper : this.el);
18796
+ this.handleAuthFailure(e);
18514
18797
  }
18515
18798
  }).catch((e) => {
18516
18799
  logger$3.error(`Auto Login failed, Error : ${e === null || e === void 0 ? void 0 : e.message}`);
@@ -18528,6 +18811,7 @@ class TsEmbed {
18528
18811
  this.on(EmbedEvent.EmbedListenerReady, embedListenerReadyHandler, { start: false }, true);
18529
18812
  const authInitHandler = this.createEmbedContainerHandler(EmbedEvent.AuthInit);
18530
18813
  this.on(EmbedEvent.AuthInit, authInitHandler, { start: false }, true);
18814
+ this.on(EmbedEvent.RefreshAuthToken, this.tokenRefresh, { start: false }, true);
18531
18815
  };
18532
18816
  this.showPreRenderByDefault = false;
18533
18817
  /**
@@ -18837,13 +19121,33 @@ class TsEmbed {
18837
19121
  customVariablesForThirdPartyTools: this.embedConfig.customVariablesForThirdPartyTools || {},
18838
19122
  hiddenListColumns: this.viewConfig.hiddenListColumns || [],
18839
19123
  customActions: customActionsResult.actions,
19124
+ embedExpiryInAuthToken: this.viewConfig.refreshAuthTokenOnNearExpiry,
18840
19125
  ...getInterceptInitData(this.viewConfig),
19126
+ ...getHostEventsConfig(this.viewConfig),
18841
19127
  };
18842
19128
  return baseInitData;
18843
19129
  }
18844
19130
  async getAppInitData() {
18845
19131
  return this.getDefaultAppInitData();
18846
19132
  }
19133
+ /**
19134
+ * Helper method to refresh/update auth token for TrustedAuthTokenCookieless auth type
19135
+ * @param responder - Function to send response back
19136
+ * @param eventType - The embed event type to send
19137
+ * @param forceRefresh - Whether to force refresh the token
19138
+ * @returns Promise that resolves if token was refreshed, rejects otherwise
19139
+ */
19140
+ async refreshAuthTokenForCookieless(responder, eventType, forceRefresh = false) {
19141
+ const { authType, autoLogin } = this.embedConfig;
19142
+ const isAutoLoginTrue = autoLogin !== null && autoLogin !== void 0 ? autoLogin : (authType === AuthType.TrustedAuthTokenCookieless);
19143
+ if (isAutoLoginTrue && authType === AuthType.TrustedAuthTokenCookieless) {
19144
+ const authToken = await getAuthenticationToken(this.embedConfig, forceRefresh);
19145
+ responder({
19146
+ type: eventType,
19147
+ data: { authToken },
19148
+ });
19149
+ }
19150
+ }
18847
19151
  /**
18848
19152
  * Constructs the base URL string to load the ThoughtSpot app.
18849
19153
  * @param query
@@ -19462,7 +19766,7 @@ class TsEmbed {
19462
19766
  * @param {any} data The payload to send with the message
19463
19767
  * @returns A promise that resolves with the response from the embedded app
19464
19768
  */
19465
- async trigger(messageType, data = {}) {
19769
+ async trigger(messageType, data = {}, context) {
19466
19770
  uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
19467
19771
  if (!this.isRendered) {
19468
19772
  this.handleError({
@@ -19489,7 +19793,7 @@ class TsEmbed {
19489
19793
  return null;
19490
19794
  }
19491
19795
  // send an empty object, this is needed for liveboard default handlers
19492
- return this.hostEventClient.triggerHostEvent(messageType, data);
19796
+ return this.hostEventClient.triggerHostEvent(messageType, data, context);
19493
19797
  }
19494
19798
  /**
19495
19799
  * Triggers an event to the embedded app, skipping the UI flow.
@@ -19522,6 +19826,19 @@ class TsEmbed {
19522
19826
  handleRenderForPrerender() {
19523
19827
  return this.render();
19524
19828
  }
19829
+ /**
19830
+ * Get the current context of the embedded TS component.
19831
+ * @returns The current context object containing the page type and object ids.
19832
+ * @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl
19833
+ */
19834
+ async getCurrentContext() {
19835
+ return new Promise((resolve) => {
19836
+ this.executeAfterEmbedContainerLoaded(async () => {
19837
+ const context = await this.trigger(HostEvent.GetPageContext, {});
19838
+ resolve(context);
19839
+ });
19840
+ });
19841
+ }
19525
19842
  /**
19526
19843
  * Creates the preRender shell
19527
19844
  * @param showPreRenderByDefault - Show the preRender after render, hidden by default
@@ -20040,7 +20357,7 @@ class AppEmbed extends V1Embed {
20040
20357
  * embedded Liveboard or visualization.
20041
20358
  */
20042
20359
  getEmbedParams() {
20043
- const { tag, hideTagFilterChips, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled = false, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, isEnhancedFilterInteractivityEnabled = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled = false, isGranularXLSXCSVSchedulesEnabled = false, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, minimumHeight, isThisPeriodInDateFiltersEnabled, } = this.viewConfig;
20360
+ const { tag, hideTagFilterChips, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled = false, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, isEnhancedFilterInteractivityEnabled = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled = false, isGranularXLSXCSVSchedulesEnabled = false, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, spotterSidebarConfig, spotterChatConfig, minimumHeight, isThisPeriodInDateFiltersEnabled, } = this.viewConfig;
20044
20361
  let params = {};
20045
20362
  params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
20046
20363
  params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
@@ -20064,6 +20381,41 @@ class AppEmbed extends V1Embed {
20064
20381
  if (!isUndefined$1(updatedSpotterChatPrompt)) {
20065
20382
  params[Param.UpdatedSpotterChatPrompt] = !!updatedSpotterChatPrompt;
20066
20383
  }
20384
+ // Handle spotterSidebarConfig params
20385
+ if (spotterSidebarConfig) {
20386
+ const { enablePastConversationsSidebar, spotterSidebarTitle, spotterSidebarDefaultExpanded, spotterChatRenameLabel, spotterChatDeleteLabel, spotterDeleteConversationModalTitle, spotterPastConversationAlertMessage, spotterDocumentationUrl, spotterBestPracticesLabel, spotterConversationsBatchSize, spotterNewChatButtonTitle, } = spotterSidebarConfig;
20387
+ setParamIfDefined(params, Param.EnablePastConversationsSidebar, enablePastConversationsSidebar, true);
20388
+ setParamIfDefined(params, Param.SpotterSidebarDefaultExpanded, spotterSidebarDefaultExpanded, true);
20389
+ setParamIfDefined(params, Param.SpotterSidebarTitle, spotterSidebarTitle);
20390
+ setParamIfDefined(params, Param.SpotterChatRenameLabel, spotterChatRenameLabel);
20391
+ setParamIfDefined(params, Param.SpotterChatDeleteLabel, spotterChatDeleteLabel);
20392
+ setParamIfDefined(params, Param.SpotterDeleteConversationModalTitle, spotterDeleteConversationModalTitle);
20393
+ setParamIfDefined(params, Param.SpotterPastConversationAlertMessage, spotterPastConversationAlertMessage);
20394
+ setParamIfDefined(params, Param.SpotterBestPracticesLabel, spotterBestPracticesLabel);
20395
+ setParamIfDefined(params, Param.SpotterConversationsBatchSize, spotterConversationsBatchSize);
20396
+ setParamIfDefined(params, Param.SpotterNewChatButtonTitle, spotterNewChatButtonTitle);
20397
+ // URL param with validation
20398
+ if (spotterDocumentationUrl !== undefined) {
20399
+ const [isValid, validationError] = validateHttpUrl(spotterDocumentationUrl);
20400
+ if (isValid) {
20401
+ params[Param.SpotterDocumentationUrl] = spotterDocumentationUrl;
20402
+ }
20403
+ else {
20404
+ this.handleError({
20405
+ errorType: ErrorDetailsTypes.VALIDATION_ERROR,
20406
+ message: ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
20407
+ code: EmbedErrorCodes.INVALID_URL,
20408
+ error: (validationError === null || validationError === void 0 ? void 0 : validationError.message) || ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
20409
+ });
20410
+ }
20411
+ }
20412
+ }
20413
+ // Handle spotterChatConfig params
20414
+ if (spotterChatConfig) {
20415
+ const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, } = spotterChatConfig;
20416
+ setParamIfDefined(params, Param.HideToolResponseCardBranding, hideToolResponseCardBranding, true);
20417
+ setParamIfDefined(params, Param.ToolResponseCardBrandingLabel, toolResponseCardBrandingLabel);
20418
+ }
20067
20419
  if (hideObjectSearch) {
20068
20420
  params[Param.HideObjectSearch] = !!hideObjectSearch;
20069
20421
  }
@@ -20461,6 +20813,7 @@ class LiveboardEmbed extends V1Embed {
20461
20813
  liveboardId: this.viewConfig.liveboardId,
20462
20814
  vizId: this.viewConfig.vizId,
20463
20815
  activeTabId: this.viewConfig.activeTabId,
20816
+ personalizedViewId: this.viewConfig.personalizedViewId,
20464
20817
  };
20465
20818
  if (this.viewConfig.fullHeight === true) {
20466
20819
  if (this.viewConfig.vizId) {
@@ -20485,7 +20838,7 @@ class LiveboardEmbed extends V1Embed {
20485
20838
  getEmbedParamsObject() {
20486
20839
  let params = {};
20487
20840
  params = this.getBaseQueryParams(params);
20488
- const { enableVizTransformations, fullHeight, defaultHeight, minimumHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled = false, isEnhancedFilterInteractivityEnabled = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled = false, isGranularXLSXCSVSchedulesEnabled = false, showSpotterLimitations, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, isThisPeriodInDateFiltersEnabled, } = this.viewConfig;
20841
+ const { enableVizTransformations, fullHeight, defaultHeight, minimumHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled = false, isEnhancedFilterInteractivityEnabled = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled = false, isGranularXLSXCSVSchedulesEnabled = false, showSpotterLimitations, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, spotterChatConfig, isThisPeriodInDateFiltersEnabled, } = this.viewConfig;
20489
20842
  const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
20490
20843
  || this.viewConfig.preventPinboardFilterRemoval;
20491
20844
  if (fullHeight === true) {
@@ -20559,6 +20912,12 @@ class LiveboardEmbed extends V1Embed {
20559
20912
  if (showSpotterLimitations !== undefined) {
20560
20913
  params[Param.ShowSpotterLimitations] = showSpotterLimitations;
20561
20914
  }
20915
+ // Handle spotterChatConfig params
20916
+ if (spotterChatConfig) {
20917
+ const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, } = spotterChatConfig;
20918
+ setParamIfDefined(params, Param.HideToolResponseCardBranding, hideToolResponseCardBranding, true);
20919
+ setParamIfDefined(params, Param.ToolResponseCardBrandingLabel, toolResponseCardBrandingLabel);
20920
+ }
20562
20921
  if (isLinkParametersEnabled !== undefined) {
20563
20922
  params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
20564
20923
  }
@@ -20582,15 +20941,31 @@ class LiveboardEmbed extends V1Embed {
20582
20941
  getQueryParamString(params, true);
20583
20942
  return params;
20584
20943
  }
20585
- getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
20586
- let suffix = `/embed/viz/${liveboardId}`;
20944
+ getIframeSuffixSrc(liveboardId, vizId, activeTabId, personalizedViewId) {
20945
+ // Extract view from liveboardId if passed along with it (legacy approach)
20946
+ // View must be appended as query param at the end, not embedded in path
20947
+ let liveboardGuid = liveboardId;
20948
+ let legacyViewId;
20949
+ if (liveboardId === null || liveboardId === void 0 ? void 0 : liveboardId.includes('?')) {
20950
+ const [id, query] = liveboardId.split('?');
20951
+ liveboardGuid = id;
20952
+ const params = new URLSearchParams(query);
20953
+ legacyViewId = params.get('view') || undefined;
20954
+ }
20955
+ // personalizedViewId takes precedence over legacyViewId (when passed as part of liveboardId)
20956
+ const effectiveViewId = personalizedViewId || legacyViewId;
20957
+ let suffix = `/embed/viz/${liveboardGuid}`;
20587
20958
  if (activeTabId) {
20588
- suffix = `${suffix}/tab/${activeTabId} `;
20959
+ suffix = `${suffix}/tab/${activeTabId}`;
20589
20960
  }
20590
20961
  if (vizId) {
20591
20962
  suffix = `${suffix}/${vizId}`;
20592
20963
  }
20593
- const tsPostHashParams = this.getThoughtSpotPostUrlParams();
20964
+ const additionalParams = {};
20965
+ if (effectiveViewId) {
20966
+ additionalParams.view = effectiveViewId;
20967
+ }
20968
+ const tsPostHashParams = this.getThoughtSpotPostUrlParams(additionalParams);
20594
20969
  suffix = `${suffix}${tsPostHashParams}`;
20595
20970
  return suffix;
20596
20971
  }
@@ -20600,7 +20975,7 @@ class LiveboardEmbed extends V1Embed {
20600
20975
  */
20601
20976
  getIFrameSrc() {
20602
20977
  var _a;
20603
- const { vizId, activeTabId } = this.viewConfig;
20978
+ const { vizId, activeTabId, personalizedViewId } = this.viewConfig;
20604
20979
  const liveboardId = (_a = this.viewConfig.liveboardId) !== null && _a !== void 0 ? _a : this.viewConfig.pinboardId;
20605
20980
  if (!liveboardId) {
20606
20981
  this.handleError({
@@ -20610,7 +20985,7 @@ class LiveboardEmbed extends V1Embed {
20610
20985
  error: ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION,
20611
20986
  });
20612
20987
  }
20613
- return `${this.getRootIframeSrc()}${this.getIframeSuffixSrc(liveboardId, vizId, activeTabId)}`;
20988
+ return `${this.getRootIframeSrc()}${this.getIframeSuffixSrc(liveboardId, vizId, activeTabId, personalizedViewId)}`;
20614
20989
  }
20615
20990
  setActiveTab(data) {
20616
20991
  if (!this.viewConfig.vizId) {
@@ -20649,12 +21024,13 @@ class LiveboardEmbed extends V1Embed {
20649
21024
  beforePrerenderVisible() {
20650
21025
  const embedObj = this.getPreRenderObj();
20651
21026
  this.executeAfterEmbedContainerLoaded(() => {
20652
- this.navigateToLiveboard(this.viewConfig.liveboardId, this.viewConfig.vizId, this.viewConfig.activeTabId);
21027
+ this.navigateToLiveboard(this.viewConfig.liveboardId, this.viewConfig.vizId, this.viewConfig.activeTabId, this.viewConfig.personalizedViewId);
20653
21028
  if (embedObj) {
20654
21029
  embedObj.currentLiveboardState = {
20655
21030
  liveboardId: this.viewConfig.liveboardId,
20656
21031
  vizId: this.viewConfig.vizId,
20657
21032
  activeTabId: this.viewConfig.activeTabId,
21033
+ personalizedViewId: this.viewConfig.personalizedViewId,
20658
21034
  };
20659
21035
  }
20660
21036
  });
@@ -20671,7 +21047,7 @@ class LiveboardEmbed extends V1Embed {
20671
21047
  * @param {any} data The payload to send with the message
20672
21048
  * @returns A promise that resolves with the response from the embedded app
20673
21049
  */
20674
- trigger(messageType, data = {}) {
21050
+ trigger(messageType, data = {}, context) {
20675
21051
  const dataWithVizId = data;
20676
21052
  if (messageType === HostEvent.SetActiveTab) {
20677
21053
  this.setActiveTab(data);
@@ -20680,7 +21056,7 @@ class LiveboardEmbed extends V1Embed {
20680
21056
  if (typeof dataWithVizId === 'object' && this.viewConfig.vizId) {
20681
21057
  dataWithVizId.vizId = this.viewConfig.vizId;
20682
21058
  }
20683
- return super.trigger(messageType, dataWithVizId);
21059
+ return super.trigger(messageType, dataWithVizId, context);
20684
21060
  }
20685
21061
  /**
20686
21062
  * Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
@@ -20719,11 +21095,12 @@ class LiveboardEmbed extends V1Embed {
20719
21095
  this.postRender();
20720
21096
  return this;
20721
21097
  }
20722
- navigateToLiveboard(liveboardId, vizId, activeTabId) {
20723
- const path = this.getIframeSuffixSrc(liveboardId, vizId, activeTabId);
21098
+ navigateToLiveboard(liveboardId, vizId, activeTabId, personalizedViewId) {
21099
+ const path = this.getIframeSuffixSrc(liveboardId, vizId, activeTabId, personalizedViewId);
20724
21100
  this.viewConfig.liveboardId = liveboardId;
20725
21101
  this.viewConfig.activeTabId = activeTabId;
20726
21102
  this.viewConfig.vizId = vizId;
21103
+ this.viewConfig.personalizedViewId = personalizedViewId;
20727
21104
  if (this.isRendered) {
20728
21105
  this.trigger(HostEvent.Navigate, path.substring(1));
20729
21106
  }
@@ -20747,6 +21124,9 @@ class LiveboardEmbed extends V1Embed {
20747
21124
  if (this.viewConfig.vizId) {
20748
21125
  url = `${url}/${this.viewConfig.vizId}`;
20749
21126
  }
21127
+ if (this.viewConfig.personalizedViewId) {
21128
+ url = `${url}?view=${this.viewConfig.personalizedViewId}`;
21129
+ }
20750
21130
  return url;
20751
21131
  }
20752
21132
  }
@@ -21583,7 +21963,9 @@ class SpotterEmbed extends TsEmbed {
21583
21963
  this.viewConfig = viewConfig;
21584
21964
  }
21585
21965
  getEmbedParamsObject() {
21586
- const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, enablePastConversationsSidebar, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, updatedSpotterChatPrompt, } = this.viewConfig;
21966
+ const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, updatedSpotterChatPrompt, spotterSidebarConfig, spotterChatConfig, } = this.viewConfig;
21967
+ // Extract sidebar config properties
21968
+ const { enablePastConversationsSidebar, spotterSidebarTitle, spotterSidebarDefaultExpanded, spotterChatRenameLabel, spotterChatDeleteLabel, spotterDeleteConversationModalTitle, spotterPastConversationAlertMessage, spotterDocumentationUrl, spotterBestPracticesLabel, spotterConversationsBatchSize, spotterNewChatButtonTitle, } = spotterSidebarConfig || {};
21587
21969
  if (!worksheetId) {
21588
21970
  this.handleError({
21589
21971
  errorType: ErrorDetailsTypes.VALIDATION_ERROR,
@@ -21594,30 +21976,51 @@ class SpotterEmbed extends TsEmbed {
21594
21976
  }
21595
21977
  const queryParams = this.getBaseQueryParams();
21596
21978
  queryParams[Param.SpotterEnabled] = true;
21597
- if (!isUndefined_1(disableSourceSelection)) {
21598
- queryParams[Param.DisableSourceSelection] = !!disableSourceSelection;
21599
- }
21600
- if (!isUndefined_1(hideSourceSelection)) {
21601
- queryParams[Param.HideSourceSelection] = !!hideSourceSelection;
21602
- }
21603
- if (!isUndefined_1(dataPanelV2)) {
21604
- queryParams[Param.DataPanelV2Enabled] = !!dataPanelV2;
21605
- }
21606
- if (!isUndefined_1(showSpotterLimitations)) {
21607
- queryParams[Param.ShowSpotterLimitations] = !!showSpotterLimitations;
21608
- }
21609
- if (!isUndefined_1(hideSampleQuestions)) {
21610
- queryParams[Param.HideSampleQuestions] = !!hideSampleQuestions;
21979
+ // Boolean params
21980
+ setParamIfDefined(queryParams, Param.DisableSourceSelection, disableSourceSelection, true);
21981
+ setParamIfDefined(queryParams, Param.HideSourceSelection, hideSourceSelection, true);
21982
+ setParamIfDefined(queryParams, Param.DataPanelV2Enabled, dataPanelV2, true);
21983
+ setParamIfDefined(queryParams, Param.ShowSpotterLimitations, showSpotterLimitations, true);
21984
+ setParamIfDefined(queryParams, Param.HideSampleQuestions, hideSampleQuestions, true);
21985
+ setParamIfDefined(queryParams, Param.UpdatedSpotterChatPrompt, updatedSpotterChatPrompt, true);
21986
+ setParamIfDefined(queryParams, Param.SpotterSidebarDefaultExpanded, spotterSidebarDefaultExpanded, true);
21987
+ // String params
21988
+ setParamIfDefined(queryParams, Param.SpotterSidebarTitle, spotterSidebarTitle);
21989
+ setParamIfDefined(queryParams, Param.SpotterChatRenameLabel, spotterChatRenameLabel);
21990
+ setParamIfDefined(queryParams, Param.SpotterChatDeleteLabel, spotterChatDeleteLabel);
21991
+ setParamIfDefined(queryParams, Param.SpotterDeleteConversationModalTitle, spotterDeleteConversationModalTitle);
21992
+ setParamIfDefined(queryParams, Param.SpotterPastConversationAlertMessage, spotterPastConversationAlertMessage);
21993
+ setParamIfDefined(queryParams, Param.SpotterBestPracticesLabel, spotterBestPracticesLabel);
21994
+ setParamIfDefined(queryParams, Param.SpotterConversationsBatchSize, spotterConversationsBatchSize);
21995
+ setParamIfDefined(queryParams, Param.SpotterNewChatButtonTitle, spotterNewChatButtonTitle);
21996
+ // URL param with validation
21997
+ if (spotterDocumentationUrl !== undefined) {
21998
+ const [isValid, validationError] = validateHttpUrl(spotterDocumentationUrl);
21999
+ if (isValid) {
22000
+ queryParams[Param.SpotterDocumentationUrl] = spotterDocumentationUrl;
22001
+ }
22002
+ else {
22003
+ this.handleError({
22004
+ errorType: ErrorDetailsTypes.VALIDATION_ERROR,
22005
+ message: ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
22006
+ code: EmbedErrorCodes.INVALID_URL,
22007
+ error: (validationError === null || validationError === void 0 ? void 0 : validationError.message) || ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
22008
+ });
22009
+ }
21611
22010
  }
21612
- if (!isUndefined_1(updatedSpotterChatPrompt)) {
21613
- queryParams[Param.UpdatedSpotterChatPrompt] = !!updatedSpotterChatPrompt;
22011
+ // Handle spotterChatConfig params
22012
+ if (spotterChatConfig) {
22013
+ const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, } = spotterChatConfig;
22014
+ setParamIfDefined(queryParams, Param.HideToolResponseCardBranding, hideToolResponseCardBranding, true);
22015
+ setParamIfDefined(queryParams, Param.ToolResponseCardBrandingLabel, toolResponseCardBrandingLabel);
21614
22016
  }
21615
22017
  return queryParams;
21616
22018
  }
21617
22019
  getIframeSrc() {
21618
- const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, enablePastConversationsSidebar, } = this.viewConfig;
22020
+ const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, spotterSidebarConfig, } = this.viewConfig;
21619
22021
  const path = 'insights/conv-assist';
21620
22022
  const queryParams = this.getEmbedParamsObject();
22023
+ const enablePastConversationsSidebar = spotterSidebarConfig === null || spotterSidebarConfig === void 0 ? void 0 : spotterSidebarConfig.enablePastConversationsSidebar;
21621
22024
  if (!isUndefined_1(enablePastConversationsSidebar)) {
21622
22025
  queryParams[Param.EnablePastConversationsSidebar] = !!enablePastConversationsSidebar;
21623
22026
  }
@@ -22281,4 +22684,4 @@ const createLiveboardWithAnswers = async (answers, name) => {
22281
22684
  return result;
22282
22685
  };
22283
22686
 
22284
- export { Action, AnswerService, AppEmbed, AuthEvent, AuthFailureType, AuthStatus, AuthType, BodylessConversation, ContextMenuTriggerOptions, ConversationEmbed, CustomActionTarget, CustomActionsPosition, DataPanelCustomColumnGroupsAccordionState$1 as DataPanelCustomColumnGroupsAccordionState, DataSourceVisualMode, EmbedErrorCodes, EmbedEvent, ErrorDetailsTypes, HomeLeftNavItem, HomePage, HomePageSearchBarMode, HomepageModule, HostEvent, InterceptedApiType, ListPage, ListPageColumns, LiveboardEmbed, LogLevel, MIXPANEL_EVENT, Page, PinboardEmbed, PrefetchFeatures, PrimaryNavbarVersion, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed, SpotterAgentEmbed, SpotterEmbed, UIPassthroughEvent, createLiveboardWithAnswers, executeTML, exportTML, getAnswerFromQuery, getEmbedConfig as getInitConfig, getSessionInfo, init, logout, prefetch, reloadIframe, resetCachedAuthToken, tokenizedFetch, uploadMixpanelEvent };
22687
+ export { Action, AnswerService, AppEmbed, AuthEvent, AuthFailureType, AuthStatus, AuthType, BodylessConversation, ContextMenuTriggerOptions, ContextType, ConversationEmbed, CustomActionTarget, CustomActionsPosition, DataPanelCustomColumnGroupsAccordionState$1 as DataPanelCustomColumnGroupsAccordionState, DataSourceVisualMode, EmbedErrorCodes, EmbedEvent, ErrorDetailsTypes, HomeLeftNavItem, HomePage, HomePageSearchBarMode, HomepageModule, HostEvent, InterceptedApiType, ListPage, ListPageColumns, LiveboardEmbed, LogLevel, MIXPANEL_EVENT, Page, PinboardEmbed, PrefetchFeatures, PrimaryNavbarVersion, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed, SpotterAgentEmbed, SpotterEmbed, UIPassthroughEvent, createLiveboardWithAnswers, executeTML, exportTML, getAnswerFromQuery, getEmbedConfig as getInitConfig, getSessionInfo, init, logout, prefetch, reloadIframe, resetCachedAuthToken, tokenizedFetch, uploadMixpanelEvent };