@thoughtspot/visual-embed-sdk 1.40.1-alpha.1 → 1.41.0-pre-render-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 (150) hide show
  1. package/cjs/package.json +5 -4
  2. package/cjs/src/css-variables.d.ts +316 -0
  3. package/cjs/src/css-variables.d.ts.map +1 -1
  4. package/cjs/src/embed/app.d.ts.map +1 -1
  5. package/cjs/src/embed/app.js +8 -0
  6. package/cjs/src/embed/app.js.map +1 -1
  7. package/cjs/src/embed/app.spec.js +12 -2
  8. package/cjs/src/embed/app.spec.js.map +1 -1
  9. package/cjs/src/embed/bodyless-conversation.d.ts +1 -0
  10. package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
  11. package/cjs/src/embed/bodyless-conversation.js +7 -3
  12. package/cjs/src/embed/bodyless-conversation.js.map +1 -1
  13. package/cjs/src/embed/conversation.d.ts +64 -2
  14. package/cjs/src/embed/conversation.d.ts.map +1 -1
  15. package/cjs/src/embed/conversation.js +16 -3
  16. package/cjs/src/embed/conversation.js.map +1 -1
  17. package/cjs/src/embed/conversation.spec.js +102 -0
  18. package/cjs/src/embed/conversation.spec.js.map +1 -1
  19. package/cjs/src/embed/liveboard.d.ts +12 -2
  20. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  21. package/cjs/src/embed/liveboard.js +48 -18
  22. package/cjs/src/embed/liveboard.js.map +1 -1
  23. package/cjs/src/embed/liveboard.spec.js +211 -5
  24. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  25. package/cjs/src/embed/sage.d.ts +1 -0
  26. package/cjs/src/embed/sage.d.ts.map +1 -1
  27. package/cjs/src/embed/sage.js +10 -6
  28. package/cjs/src/embed/sage.js.map +1 -1
  29. package/cjs/src/embed/search-bar.d.ts +1 -0
  30. package/cjs/src/embed/search-bar.d.ts.map +1 -1
  31. package/cjs/src/embed/search-bar.js +11 -7
  32. package/cjs/src/embed/search-bar.js.map +1 -1
  33. package/cjs/src/embed/search.d.ts +1 -0
  34. package/cjs/src/embed/search.d.ts.map +1 -1
  35. package/cjs/src/embed/search.js +7 -8
  36. package/cjs/src/embed/search.js.map +1 -1
  37. package/cjs/src/embed/ts-embed.d.ts +24 -7
  38. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  39. package/cjs/src/embed/ts-embed.js +87 -57
  40. package/cjs/src/embed/ts-embed.js.map +1 -1
  41. package/cjs/src/embed/ts-embed.spec.js +173 -1
  42. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  43. package/cjs/src/types.d.ts +152 -44
  44. package/cjs/src/types.d.ts.map +1 -1
  45. package/cjs/src/types.js +139 -42
  46. package/cjs/src/types.js.map +1 -1
  47. package/cjs/src/utils/liveboardService/liveboardService.d.ts +21 -6
  48. package/cjs/src/utils/liveboardService/liveboardService.d.ts.map +1 -1
  49. package/cjs/src/utils/liveboardService/liveboardService.js +21 -6
  50. package/cjs/src/utils/liveboardService/liveboardService.js.map +1 -1
  51. package/dist/index-BDlM0f0T.js +7371 -0
  52. package/dist/index-k7pkZMhx.js +7371 -0
  53. package/dist/src/css-variables.d.ts +316 -0
  54. package/dist/src/css-variables.d.ts.map +1 -1
  55. package/dist/src/embed/app.d.ts.map +1 -1
  56. package/dist/src/embed/bodyless-conversation.d.ts +5 -0
  57. package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
  58. package/dist/src/embed/conversation.d.ts +64 -2
  59. package/dist/src/embed/conversation.d.ts.map +1 -1
  60. package/dist/src/embed/liveboard.d.ts +11 -0
  61. package/dist/src/embed/liveboard.d.ts.map +1 -1
  62. package/dist/src/embed/sage.d.ts +1 -0
  63. package/dist/src/embed/sage.d.ts.map +1 -1
  64. package/dist/src/embed/search-bar.d.ts +1 -0
  65. package/dist/src/embed/search-bar.d.ts.map +1 -1
  66. package/dist/src/embed/search.d.ts +1 -0
  67. package/dist/src/embed/search.d.ts.map +1 -1
  68. package/dist/src/embed/ts-embed.d.ts +24 -0
  69. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  70. package/dist/src/react/index.d.ts +2 -0
  71. package/dist/src/react/index.d.ts.map +1 -1
  72. package/dist/src/types.d.ts +351 -30
  73. package/dist/src/types.d.ts.map +1 -1
  74. package/dist/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
  75. package/dist/src/utils/liveboardService/liveboardService.d.ts +21 -6
  76. package/dist/src/utils/liveboardService/liveboardService.d.ts.map +1 -1
  77. package/dist/tsembed-react.es.js +551 -80
  78. package/dist/tsembed-react.js +550 -79
  79. package/dist/tsembed.es.js +572 -86
  80. package/dist/tsembed.js +571 -85
  81. package/dist/visual-embed-sdk-react-full.d.ts +787 -37
  82. package/dist/visual-embed-sdk-react.d.ts +787 -37
  83. package/dist/visual-embed-sdk.d.ts +785 -37
  84. package/lib/package.json +5 -4
  85. package/lib/src/css-variables.d.ts +316 -0
  86. package/lib/src/css-variables.d.ts.map +1 -1
  87. package/lib/src/embed/app.d.ts.map +1 -1
  88. package/lib/src/embed/app.js +8 -0
  89. package/lib/src/embed/app.js.map +1 -1
  90. package/lib/src/embed/app.spec.js +12 -2
  91. package/lib/src/embed/app.spec.js.map +1 -1
  92. package/lib/src/embed/bodyless-conversation.d.ts +1 -0
  93. package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
  94. package/lib/src/embed/bodyless-conversation.js +7 -3
  95. package/lib/src/embed/bodyless-conversation.js.map +1 -1
  96. package/lib/src/embed/conversation.d.ts +64 -2
  97. package/lib/src/embed/conversation.d.ts.map +1 -1
  98. package/lib/src/embed/conversation.js +17 -4
  99. package/lib/src/embed/conversation.js.map +1 -1
  100. package/lib/src/embed/conversation.spec.js +104 -2
  101. package/lib/src/embed/conversation.spec.js.map +1 -1
  102. package/lib/src/embed/liveboard.d.ts +12 -2
  103. package/lib/src/embed/liveboard.d.ts.map +1 -1
  104. package/lib/src/embed/liveboard.js +48 -18
  105. package/lib/src/embed/liveboard.js.map +1 -1
  106. package/lib/src/embed/liveboard.spec.js +211 -5
  107. package/lib/src/embed/liveboard.spec.js.map +1 -1
  108. package/lib/src/embed/sage.d.ts +1 -0
  109. package/lib/src/embed/sage.d.ts.map +1 -1
  110. package/lib/src/embed/sage.js +10 -6
  111. package/lib/src/embed/sage.js.map +1 -1
  112. package/lib/src/embed/search-bar.d.ts +1 -0
  113. package/lib/src/embed/search-bar.d.ts.map +1 -1
  114. package/lib/src/embed/search-bar.js +11 -7
  115. package/lib/src/embed/search-bar.js.map +1 -1
  116. package/lib/src/embed/search.d.ts +1 -0
  117. package/lib/src/embed/search.d.ts.map +1 -1
  118. package/lib/src/embed/search.js +7 -8
  119. package/lib/src/embed/search.js.map +1 -1
  120. package/lib/src/embed/ts-embed.d.ts +24 -7
  121. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  122. package/lib/src/embed/ts-embed.js +87 -57
  123. package/lib/src/embed/ts-embed.js.map +1 -1
  124. package/lib/src/embed/ts-embed.spec.js +173 -1
  125. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  126. package/lib/src/types.d.ts +152 -44
  127. package/lib/src/types.d.ts.map +1 -1
  128. package/lib/src/types.js +139 -42
  129. package/lib/src/types.js.map +1 -1
  130. package/lib/src/utils/liveboardService/liveboardService.d.ts +21 -6
  131. package/lib/src/utils/liveboardService/liveboardService.d.ts.map +1 -1
  132. package/lib/src/utils/liveboardService/liveboardService.js +21 -6
  133. package/lib/src/utils/liveboardService/liveboardService.js.map +1 -1
  134. package/lib/src/visual-embed-sdk.d.ts +786 -38
  135. package/package.json +6 -4
  136. package/src/css-variables.ts +396 -1
  137. package/src/embed/app.spec.ts +17 -2
  138. package/src/embed/app.ts +8 -0
  139. package/src/embed/bodyless-conversation.ts +8 -3
  140. package/src/embed/conversation.spec.ts +131 -5
  141. package/src/embed/conversation.ts +102 -12
  142. package/src/embed/liveboard.spec.ts +264 -5
  143. package/src/embed/liveboard.ts +55 -20
  144. package/src/embed/sage.ts +12 -7
  145. package/src/embed/search-bar.tsx +14 -7
  146. package/src/embed/search.ts +18 -7
  147. package/src/embed/ts-embed.spec.ts +345 -113
  148. package/src/embed/ts-embed.ts +97 -67
  149. package/src/types.ts +199 -91
  150. package/src/utils/liveboardService/liveboardService.ts +21 -6
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.39.2-alpha.3 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.41.0-pre-render-1 */
2
2
  'use client';
3
3
  import * as React from 'react';
4
4
  import React__default, { useRef, useCallback } from 'react';
@@ -1223,7 +1223,7 @@ var EmbedEvent;
1223
1223
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1224
1224
  * @example
1225
1225
  *```js
1226
- * liveboardEmbed.on(EmbedEvent.AnswerChartSwitcher, payload => {
1226
+ * liveboardEmbed.on(EmbedEvent.LiveboardInfo, payload => {
1227
1227
  * console.log('Liveboard details', payload);
1228
1228
  * })
1229
1229
  *```
@@ -1597,6 +1597,95 @@ var EmbedEvent;
1597
1597
  * @hidden
1598
1598
  */
1599
1599
  EmbedEvent["RequestVisibleEmbedCoordinates"] = "requestVisibleEmbedCoordinates";
1600
+ /**
1601
+ * Emitted when Spotter response is text data
1602
+ * @example
1603
+ * ```js
1604
+ * spotterEmbed.on(EmbedEvent.SpotterData, (payload) => {
1605
+ * console.log('payload', payload);
1606
+ * })
1607
+ *```
1608
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1609
+ */
1610
+ EmbedEvent["SpotterData"] = "SpotterData";
1611
+ /**
1612
+ * Emitted when user opens up the worksheet preview modal in Spotter embed.
1613
+ * @example
1614
+ * ```js
1615
+ * spotterEmbed.on(EmbedEvent.PreviewSpotterData, (payload) => {
1616
+ * console.log('payload', payload);
1617
+ * })
1618
+ *```
1619
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1620
+ */
1621
+ EmbedEvent["PreviewSpotterData"] = "PreviewSpotterData";
1622
+ /**
1623
+ * Emitted when the Spotter query is triggered in Spotter embed.
1624
+ * @example
1625
+ * ```js
1626
+ * spotterEmbed.on(EmbedEvent.SpotterQueryTriggered, (payload) => {
1627
+ * console.log('payload', payload);
1628
+ * })
1629
+ *```
1630
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1631
+ */
1632
+ EmbedEvent["SpotterQueryTriggered"] = "SpotterQueryTriggered";
1633
+ /**
1634
+ * Emitted when the last Spotter query is edited in Spotter embed.
1635
+ * @example
1636
+ * ```js
1637
+ * spotterEmbed.on(EmbedEvent.LastPromptEdited, (payload) => {
1638
+ * console.log('payload', payload);
1639
+ * })
1640
+ *```
1641
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1642
+ */
1643
+ EmbedEvent["LastPromptEdited"] = "LastPromptEdited";
1644
+ /**
1645
+ * Emitted when the last Spotter query is deleted in Spotter embed.
1646
+ * @example
1647
+ * ```js
1648
+ * spotterEmbed.on(EmbedEvent.LastPromptDeleted, (payload) => {
1649
+ * console.log('payload', payload);
1650
+ * })
1651
+ *```
1652
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1653
+ */
1654
+ EmbedEvent["LastPromptDeleted"] = "LastPromptDeleted";
1655
+ /**
1656
+ * Emitted when the coversation is reset in spotter embed.
1657
+ * @example
1658
+ * ```js
1659
+ * spotterEmbed.on(EmbedEvent.ResetSpotterConversation, (payload) => {
1660
+ * console.log('payload', payload);
1661
+ * })
1662
+ *```
1663
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1664
+ */
1665
+ EmbedEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
1666
+ /**
1667
+ * Emitted when the *Spotter* is initialized.
1668
+ * @example
1669
+ * ```js
1670
+ * spotterEmbed.on(EmbedEvent.SpotterInit, (payload) => {
1671
+ * console.log('payload', payload);
1672
+ * })
1673
+ *```
1674
+ * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1675
+ */
1676
+ EmbedEvent["SpotterInit"] = "spotterInit";
1677
+ /**
1678
+ * @hidden
1679
+ * Triggers when the embed listener is ready to receive events.
1680
+ * This is used to trigger events after the embed container is loaded.
1681
+ * @example
1682
+ * ```js
1683
+ * liveboardEmbed.on(EmbedEvent.EmbedListenerReady, () => {
1684
+ * console.log('EmbedListenerReady');
1685
+ * })
1686
+ * ```
1687
+ */
1688
+ EmbedEvent["EmbedListenerReady"] = "EmbedListenerReady";
1600
1689
  })(EmbedEvent || (EmbedEvent = {}));
1601
1690
  /**
1602
1691
  * Event types that can be triggered by the host application
@@ -1614,7 +1703,7 @@ var EmbedEvent;
1614
1703
  * // create the liveboard embed.
1615
1704
  *
1616
1705
  * liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
1617
- * { columnName: 'state, operator: RuntimeFilterOp.EQ, values: ['california']}
1706
+ * { columnName: 'state', operator: RuntimeFilterOp.EQ, values: ["california"]}
1618
1707
  * ]);
1619
1708
  * ```
1620
1709
  * @example
@@ -1686,6 +1775,7 @@ var HostEvent;
1686
1775
  * done automatically on the most popular column.
1687
1776
  * @param - vizId [TS >= 9.8.0] - Optional. The GUID of the visualization to drill
1688
1777
  * in case of a Liveboard.
1778
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
1689
1779
  * @example
1690
1780
  * ```js
1691
1781
  * searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
@@ -1824,12 +1914,12 @@ var HostEvent;
1824
1914
  * Works with Search and Liveboard embed.
1825
1915
  * @param - { columnId: string,
1826
1916
  * name: string,
1827
- * type: INT64/CHAR/DATE,
1828
- * dataType: ATTRIBUTE/MEASURE }
1917
+ * type: ATTRIBUTE/MEASURE,
1918
+ * dataType: INT64/CHAR/DATE }
1829
1919
  * @example
1830
1920
  * ```js
1831
1921
  * searchEmbed.trigger(HostEvent.OpenFilter,
1832
- * {column: { columnId: '<column-GUID>', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE'}})
1922
+ * {column: { columnId: '<column-GUID>', name: 'column name', type: 'ATTRIBUTE', dataType: 'INT64'}})
1833
1923
  * ```
1834
1924
  * @example
1835
1925
  * ```js
@@ -1887,6 +1977,7 @@ var HostEvent;
1887
1977
  * @param
1888
1978
  * `vizId`- GUID of the saved Answer or visualization to pin to a Liveboard.
1889
1979
  * Optional when pinning a new chart or table generated from a Search query.
1980
+ * **Required** in Spotter Embed.
1890
1981
  * @param
1891
1982
  * `liveboardID` - GUID of the Liveboard to pin an Answer. If there is no Liveboard,
1892
1983
  * specify the `newLiveboardName` parameter to create a new Liveboard.
@@ -1934,6 +2025,12 @@ var HostEvent;
1934
2025
  * ```js
1935
2026
  * appEmbed.trigger(HostEvent.Pin)
1936
2027
  * ```
2028
+ * @example
2029
+ * ```js
2030
+ * const pinResponse = await spotterEmbed.trigger(HostEvent.Pin, {
2031
+ * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2032
+ * });
2033
+ * ```
1937
2034
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1938
2035
  */
1939
2036
  HostEvent["Pin"] = "pin";
@@ -1998,12 +2095,21 @@ var HostEvent;
1998
2095
  * Trigger the **Download PDF** action on an embedded Liveboard,
1999
2096
  * visualization or Answer.
2000
2097
  *
2098
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2099
+ *
2001
2100
  * **NOTE**: The **Download** > **PDF** action is available on
2002
2101
  * visualizations and Answers if the data is in tabular format.
2003
2102
  * @example
2004
2103
  * ```js
2005
2104
  * liveboardEmbed.trigger(HostEvent.DownloadAsPdf)
2006
2105
  * ```
2106
+ * @example
2107
+ * ```js
2108
+ * spotterEmbed.trigger(HostEvent.DownloadAsPdf, {
2109
+ * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2110
+ * });
2111
+ * ```
2112
+ *
2007
2113
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2008
2114
  */
2009
2115
  HostEvent["DownloadAsPdf"] = "downloadAsPdf";
@@ -2027,6 +2133,12 @@ var HostEvent;
2027
2133
  * ```js
2028
2134
  * searchEmbed.trigger(HostEvent.MakeACopy)
2029
2135
  * ```
2136
+ * @example
2137
+ * ```js
2138
+ * const pinResponse = await spotterEmbed.trigger(HostEvent.MakeACopy, {
2139
+ * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2140
+ * });
2141
+ * ```
2030
2142
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2031
2143
  */
2032
2144
  HostEvent["MakeACopy"] = "makeACopy";
@@ -2099,6 +2211,8 @@ var HostEvent;
2099
2211
  * This event is not supported in visualization embed and search embed.
2100
2212
  * @param - object - To trigger the action for a specific visualization
2101
2213
  * in Liveboard embed, pass in `vizId` as a key.
2214
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2215
+ *
2102
2216
  * @example
2103
2217
  * ```js
2104
2218
  * liveboardEmbed.trigger(HostEvent.Edit)
@@ -2107,6 +2221,18 @@ var HostEvent;
2107
2221
  * liveboardEmbed.trigger(HostEvent.Edit, {vizId:
2108
2222
  * '730496d6-6903-4601-937e-2c691821af3c'})
2109
2223
  * ```
2224
+ * @example
2225
+ * ```js
2226
+ * const pinResponse = await spotterEmbed.trigger(HostEvent.Edit, {
2227
+ * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2228
+ * });
2229
+ * ```
2230
+ * @example
2231
+ * ```js
2232
+ * const editResponse = await spotterEmbed.trigger(HostEvent.Edit, {
2233
+ * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2234
+ * });
2235
+ * ```
2110
2236
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2111
2237
  */
2112
2238
  HostEvent["Edit"] = "edit";
@@ -2154,6 +2280,16 @@ var HostEvent;
2154
2280
  * );
2155
2281
  * })
2156
2282
  * ```
2283
+ * @example
2284
+ * ```js
2285
+ * spotterEmbed.trigger(HostEvent.GetTML, {
2286
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2287
+ * }).then((tml) => {
2288
+ * console.log(
2289
+ * tml.answer.search_query // TML representation of the search query
2290
+ * );
2291
+ * })
2292
+ * ```
2157
2293
  * @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
2158
2294
  * @important
2159
2295
  */
@@ -2217,6 +2353,7 @@ var HostEvent;
2217
2353
  /**
2218
2354
  * Trigger the **Download** action on charts in
2219
2355
  * the embedded view.
2356
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2220
2357
  * @example
2221
2358
  * ```js
2222
2359
  * liveboardEmbed.trigger(HostEvent.Download, {vizId:
@@ -2225,6 +2362,11 @@ var HostEvent;
2225
2362
  * ```js
2226
2363
  * embed.trigger(HostEvent.Download)
2227
2364
  * ```
2365
+ * ```js
2366
+ * spotterEmbed.trigger(HostEvent.Download, {
2367
+ * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2368
+ * });
2369
+ * ```
2228
2370
  * @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw
2229
2371
  * Use {@link DownloadAsPng}
2230
2372
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
@@ -2241,13 +2383,19 @@ var HostEvent;
2241
2383
  * vizEmbed.trigger(HostEvent.DownloadAsPng)
2242
2384
  *
2243
2385
  * searchEmbed.trigger(HostEvent.DownloadAsPng)
2386
+ *
2387
+ * spotterEmbed.trigger(HostEvent.DownloadAsPng, {
2388
+ * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2389
+ * })
2244
2390
  * ```
2391
+ *
2245
2392
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
2246
2393
  */
2247
2394
  HostEvent["DownloadAsPng"] = "downloadAsPng";
2248
2395
  /**
2249
2396
  * Trigger the **Download** > **CSV** action on tables in
2250
2397
  * the embedded view.
2398
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2251
2399
  * @example
2252
2400
  * ```js
2253
2401
  * liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:
@@ -2259,12 +2407,18 @@ var HostEvent;
2259
2407
  * ```js
2260
2408
  * searchEmbed.trigger(HostEvent.DownloadAsCsv)
2261
2409
  * ```
2410
+ * ```js
2411
+ * spotterEmbed.trigger(HostEvent.DownloadAsCsv, {
2412
+ * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2413
+ * })
2414
+ * ```
2262
2415
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2263
2416
  */
2264
2417
  HostEvent["DownloadAsCsv"] = "downloadAsCSV";
2265
2418
  /**
2266
2419
  * Trigger the **Download** > **XLSX** action on tables
2267
2420
  * in the embedded view.
2421
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2268
2422
  * @example
2269
2423
  * ```js
2270
2424
  * liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:
@@ -2276,6 +2430,11 @@ var HostEvent;
2276
2430
  * ```js
2277
2431
  * searchEmbed.trigger(HostEvent.DownloadAsXlsx)
2278
2432
  * ```
2433
+ * ```js
2434
+ * spotterEmbed.trigger(HostEvent.downloadAsXLSX, {
2435
+ * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2436
+ * })
2437
+ * ```
2279
2438
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2280
2439
  */
2281
2440
  HostEvent["DownloadAsXlsx"] = "downloadAsXLSX";
@@ -2295,6 +2454,7 @@ var HostEvent;
2295
2454
  /**
2296
2455
  * Trigger the **Save** action on a Liveboard or Answer.
2297
2456
  * Saves the changes.
2457
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2298
2458
  * @example
2299
2459
  * ```js
2300
2460
  * liveboardEmbed.trigger(HostEvent.Save)
@@ -2302,6 +2462,11 @@ var HostEvent;
2302
2462
  * ```js
2303
2463
  * searchEmbed.trigger(HostEvent.Save)
2304
2464
  * ```
2465
+ * ```js
2466
+ * spotterEmbed.trigger(HostEvent.Save, {
2467
+ * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2468
+ * })
2469
+ * ```
2305
2470
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2306
2471
  */
2307
2472
  HostEvent["Save"] = "save";
@@ -2585,7 +2750,7 @@ var HostEvent;
2585
2750
  HostEvent["ResetLiveboardPersonalisedView"] = "ResetLiveboardPersonalisedView";
2586
2751
  /**
2587
2752
  * Triggers an action to update Parameter values on embedded
2588
- * Answers and Liveboard.
2753
+ * Answers, Liveboard and Spotter answer in Edit mode.
2589
2754
  *
2590
2755
  * @example
2591
2756
  * ```js
@@ -2599,11 +2764,19 @@ var HostEvent;
2599
2764
  HostEvent["UpdateParameters"] = "UpdateParameters";
2600
2765
  /**
2601
2766
  * Triggers GetParameters to fetch the runtime Parameters.
2767
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2602
2768
  * ```js
2603
2769
  * liveboardEmbed.trigger(HostEvent.GetParameters).then((parameter) => {
2604
2770
  * console.log('parameters', parameter);
2605
2771
  * });
2606
2772
  *```
2773
+ *```js
2774
+ * spotterEmbed.trigger(HostEvent.GetParameters, {
2775
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2776
+ * }).then((parameter) => {
2777
+ * console.log('parameters', parameter);
2778
+ * });
2779
+ *```
2607
2780
  * @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
2608
2781
  */
2609
2782
  HostEvent["GetParameters"] = "GetParameters";
@@ -2635,7 +2808,7 @@ var HostEvent;
2635
2808
  * @param - optional attributes to set Answer properties.
2636
2809
  * `name` - Name string for the Answer.
2637
2810
  * `description` - Description text for the Answer.
2638
- *
2811
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2639
2812
  * @example
2640
2813
  * ```js
2641
2814
  * const saveAnswerResponse = await searchEmbed.trigger(HostEvent.SaveAnswer, {
@@ -2643,6 +2816,14 @@ var HostEvent;
2643
2816
  * description: "Total sales by states in MidWest"
2644
2817
  * });
2645
2818
  * ```
2819
+ * @example
2820
+ * ```js
2821
+ * const saveAnswerResponse = await spotterEmbed.trigger(HostEvent.SaveAnswer, {
2822
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c',
2823
+ * name: "Sales by states",
2824
+ * description: "Total sales by states in MidWest"
2825
+ * });
2826
+ * ```
2646
2827
  * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
2647
2828
  */
2648
2829
  HostEvent["SaveAnswer"] = "saveAnswer";
@@ -2671,6 +2852,70 @@ var HostEvent;
2671
2852
  * @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
2672
2853
  */
2673
2854
  HostEvent["TransformTableVizData"] = "TransformTableVizData";
2855
+ /**
2856
+ * Triggers a search operation with the search tokens specified in
2857
+ * the search query string in spotter embed.
2858
+ * @param - `query`: Text string in Natural Language format
2859
+ * @param - `executeSearch`: Boolean to execute search and update search query
2860
+ * @example
2861
+ * ```js
2862
+ * spotterEmbed.trigger(HostEvent.SpotterSearch, {
2863
+ * query: 'revenue per year',
2864
+ * executeSearch: true,
2865
+ * })
2866
+ * ```
2867
+ * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
2868
+ */
2869
+ HostEvent["SpotterSearch"] = "SpotterSearch";
2870
+ /**
2871
+ * Edits the last prompt in spotter embed.
2872
+ * @param - `query`: Text string
2873
+ * @example
2874
+ * ```js
2875
+ * spotterEmbed.trigger(HostEvent.EditLastPrompt, "revenue per year");
2876
+ * ```
2877
+ * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
2878
+ */
2879
+ HostEvent["EditLastPrompt"] = "EditLastPrompt";
2880
+ /**
2881
+ * Opens the Worksheet preview modal in Spotter Embed.
2882
+ * @example
2883
+ * ```js
2884
+ * spotterEmbed.trigger(HostEvent.PreviewSpotterData);
2885
+ * ```
2886
+ * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
2887
+ */
2888
+ HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
2889
+ /**
2890
+ * Resets the Spotter Embed Conversation.
2891
+ * @example
2892
+ * ```js
2893
+ * spotterEmbed.trigger(HostEvent.ResetSpotterConversation);
2894
+ * ```
2895
+ * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
2896
+ */
2897
+ HostEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
2898
+ /**
2899
+ * Deletes the last prompt in spotter embed.
2900
+ * @example
2901
+ * ```js
2902
+ * spotterEmbed.trigger(HostEvent.DeleteLastPrompt);
2903
+ * ```
2904
+ * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
2905
+ */
2906
+ HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
2907
+ /**
2908
+ * Toggle the visualization to chart or table view.
2909
+ * @param - `vizId ` refers to the answer id in spotter Embed, it is required in spotter Embed.
2910
+ * @example
2911
+ * ```js
2912
+ * spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, {
2913
+ * vizId:'b535c760-8bbe-4e6f-bb26-af56b4129a1e'
2914
+ * });
2915
+ *```
2916
+ * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
2917
+ */
2918
+ HostEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
2674
2919
  /**
2675
2920
  * @hidden
2676
2921
  * Trigger exit from presentation mode when user exits fullscreen.
@@ -2694,6 +2939,27 @@ var HostEvent;
2694
2939
  * @hidden
2695
2940
  */
2696
2941
  HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
2942
+ /**
2943
+ * Trigger the *Ask Spotter* action for visualizations
2944
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2945
+ * @example
2946
+ * ```js
2947
+ * spotterEmbed.trigger(HostEvent.AskSpotter,
2948
+ * {vizId:'730496d6-6903-4601-937e-2c691821af3c'})
2949
+ * ```
2950
+ * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
2951
+ */
2952
+ HostEvent["AskSpotter"] = "AskSpotter";
2953
+ /**
2954
+ * @hidden
2955
+ * Triggers the update of the embed params.
2956
+ *
2957
+ * @example
2958
+ * ```js
2959
+ * liveboardEmbed.trigger(HostEvent.UpdateEmbedParams, viewConfig);
2960
+ * ```
2961
+ */
2962
+ HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
2697
2963
  })(HostEvent || (HostEvent = {}));
2698
2964
  /**
2699
2965
  * The different visual modes that the data sources panel within
@@ -2993,27 +3259,27 @@ var Action;
2993
3259
  */
2994
3260
  Action["ConfigureFilter"] = "configureFilter";
2995
3261
  /**
2996
- * The **Collapse data sources** icon on the Search page.
2997
- * Collapses the panel showing data sources.
2998
- *
2999
- * @example
3000
- * ```js
3001
- * disabledActions: [Action.CollapseDataPanel]
3002
- * ```
3003
- * @version: SDK: 1.1.0 | ThoughtSpot Cloud: ts7.may.cl, 8.4.1.sw
3004
- */
3262
+ * The **Collapse data sources** icon on the Search page.
3263
+ * Collapses the panel showing data sources.
3264
+ *
3265
+ * @example
3266
+ * ```js
3267
+ * disabledActions: [Action.CollapseDataPanel]
3268
+ * ```
3269
+ * @version: SDK: 1.1.0 | ThoughtSpot Cloud: ts7.may.cl, 8.4.1.sw
3270
+ */
3005
3271
  Action["CollapseDataSources"] = "collapseDataSources";
3006
3272
  /**
3007
- * The **Collapse data panel** icon on the Search page.
3008
- * Collapses the data panel view.
3009
- *
3010
- * @version: SDK: 1.34.0 | ThoughtSpot Cloud: 10.3.0.cl
3011
- *
3012
- * @example
3013
- * ```js
3014
- * disabledActions: [Action.CollapseDataPanel]
3015
- * ```
3016
- */
3273
+ * The **Collapse data panel** icon on the Search page.
3274
+ * Collapses the data panel view.
3275
+ *
3276
+ * @version: SDK: 1.34.0 | ThoughtSpot Cloud: 10.3.0.cl
3277
+ *
3278
+ * @example
3279
+ * ```js
3280
+ * disabledActions: [Action.CollapseDataPanel]
3281
+ * ```
3282
+ */
3017
3283
  Action["CollapseDataPanel"] = "collapseDataPanel";
3018
3284
  /**
3019
3285
  * The **Choose sources** button on Search page.
@@ -3709,6 +3975,17 @@ var Action;
3709
3975
  * @version SDK: 1.25.0 | ThoughtSpot Cloud: 9.6.0.cl
3710
3976
  */
3711
3977
  Action["EnableContextualChangeAnalysis"] = "enableContextualChangeAnalysis";
3978
+ /**
3979
+ * Action ID to hide or disable Iterative Change Analysis option
3980
+ * on contextual change analysis Inisght charts context menu
3981
+ *
3982
+ * @example
3983
+ * ```js
3984
+ * disabledActions: [Action.EnableIterativeChangeAnalysis]
3985
+ * ```
3986
+ * @version SDK: 1.41.0 | ThoughtSpot Cloud: 9.12.0.cl
3987
+ */
3988
+ Action["EnableIterativeChangeAnalysis"] = "enableIterativeChangeAnalysis";
3712
3989
  /**
3713
3990
  * Action ID to hide or disable Natural Language Search query.
3714
3991
  *
@@ -4078,6 +4355,39 @@ var Action;
4078
4355
  * @version SDK: 1.39.0 | ThoughtSpot Cloud: 10.10.0.cl
4079
4356
  */
4080
4357
  Action["InConversationTraining"] = "InConversationTraining";
4358
+ /**
4359
+ * Action ID to hide the warnings banner in
4360
+ * Spotter results. It's an EA feature and
4361
+ * handled by LD.
4362
+ * @example
4363
+ * ```js
4364
+ * hiddenAction: [Action.SpotterWarningsBanner]
4365
+ * ```
4366
+ * @version SDK: 1.41.0 | ThoughtSpot Cloud: 10.13.0.cl
4367
+ */
4368
+ Action["SpotterWarningsBanner"] = "SpotterWarningsBanner";
4369
+ /**
4370
+ * Action ID to hide the warnings border on the knowledge
4371
+ * card in Spotter results. It's an EA feature and
4372
+ * handled by LD.
4373
+ * @example
4374
+ * ```js
4375
+ * hiddenAction: [Action.SpotterWarningsOnTokens]
4376
+ * ```
4377
+ * @version SDK: 1.41.0 | ThoughtSpot Cloud: 10.13.0.cl
4378
+ */
4379
+ Action["SpotterWarningsOnTokens"] = "SpotterWarningsOnTokens";
4380
+ /**
4381
+ * Action ID to disable the click event handler on knowledge
4382
+ * card in Spotter results. It's an EA feature and
4383
+ * handled by LD.
4384
+ * @example
4385
+ * ```js
4386
+ * hiddenAction: [Action.SpotterTokenQuickEdit]
4387
+ * ```
4388
+ * @version SDK: 1.41.0 | ThoughtSpot Cloud: 10.13.0.cl
4389
+ */
4390
+ Action["SpotterTokenQuickEdit"] = "SpotterTokenQuickEdit";
4081
4391
  })(Action || (Action = {}));
4082
4392
  var PrefetchFeatures;
4083
4393
  (function (PrefetchFeatures) {
@@ -7823,7 +8133,7 @@ class AnswerService {
7823
8133
  async getTML() {
7824
8134
  const { object } = await this.executeQuery(getAnswerTML, {});
7825
8135
  const edoc = object[0].edoc;
7826
- const YAML = await import('./index-D1pyb7RG.js');
8136
+ const YAML = await import('./index-BDlM0f0T.js');
7827
8137
  const parsedDoc = YAML.parse(edoc);
7828
8138
  return {
7829
8139
  answer: {
@@ -15557,7 +15867,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
15557
15867
  return e;
15558
15868
  }
15559
15869
 
15560
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.39.2-alpha.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 . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.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 | coveralls","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":"^8.2.6","@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":"^22.2.3","@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",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",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":"^1.1.1",jest:"^26.6.3","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":"^26.5.5","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:"31 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};
15870
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.41.0-pre-render-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 . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.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 | coveralls","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":"^22.2.3","@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":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",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:"^26.6.3","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":"^26.5.5","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};
15561
15871
 
15562
15872
  /**
15563
15873
  * Reloads the ThoughtSpot iframe.
@@ -15809,7 +16119,8 @@ class TsEmbed {
15809
16119
  this.updateAuthToken = async (_, responder) => {
15810
16120
  const { authType } = this.embedConfig;
15811
16121
  let { autoLogin } = this.embedConfig;
15812
- // Default autoLogin: true for cookieless if undefined/null, otherwise false
16122
+ // Default autoLogin: true for cookieless if undefined/null, otherwise
16123
+ // false
15813
16124
  autoLogin = autoLogin !== null && autoLogin !== void 0 ? autoLogin : (authType === AuthType.TrustedAuthTokenCookieless);
15814
16125
  if (autoLogin && authType === AuthType.TrustedAuthTokenCookieless) {
15815
16126
  try {
@@ -15860,8 +16171,42 @@ class TsEmbed {
15860
16171
  this.on(EmbedEvent.APP_INIT, this.appInitCb, { start: false }, true);
15861
16172
  this.on(EmbedEvent.AuthExpire, this.updateAuthToken, { start: false }, true);
15862
16173
  this.on(EmbedEvent.IdleSessionTimeout, this.idleSessionTimeout, { start: false }, true);
16174
+ const embedListenerReadyHandler = this.createEmbedContainerHandler(EmbedEvent.EmbedListenerReady);
16175
+ this.on(EmbedEvent.EmbedListenerReady, embedListenerReadyHandler, { start: false }, true);
16176
+ const authInitHandler = this.createEmbedContainerHandler(EmbedEvent.AuthInit);
16177
+ this.on(EmbedEvent.AuthInit, authInitHandler, { start: false }, true);
15863
16178
  };
15864
16179
  this.showPreRenderByDefault = false;
16180
+ /**
16181
+ * @hidden
16182
+ * Internal state to track if the embed container is loaded.
16183
+ * This is used to trigger events after the embed container is loaded.
16184
+ */
16185
+ this.isEmbedContainerLoaded = false;
16186
+ /**
16187
+ * @hidden
16188
+ * Internal state to track the callbacks to be executed after the embed container
16189
+ * is loaded.
16190
+ * This is used to trigger events after the embed container is loaded.
16191
+ */
16192
+ this.embedContainerReadyCallbacks = [];
16193
+ this.createEmbedContainerHandler = (source) => () => {
16194
+ const processEmbedContainerReady = () => {
16195
+ logger$3.debug('processEmbedContainerReady');
16196
+ this.isEmbedContainerLoaded = true;
16197
+ this.executeEmbedContainerReadyCallbacks();
16198
+ };
16199
+ if (source === EmbedEvent.AuthInit) {
16200
+ const AUTH_INIT_FALLBACK_DELAY = 1000;
16201
+ // Wait for 1 second to ensure the embed container is loaded
16202
+ // This is a workaround to ensure the embed container is loaded
16203
+ // this is needed until all clusters have EmbedListenerReady event
16204
+ setTimeout(processEmbedContainerReady, AUTH_INIT_FALLBACK_DELAY);
16205
+ }
16206
+ else if (source === EmbedEvent.EmbedListenerReady) {
16207
+ processEmbedContainerReady();
16208
+ }
16209
+ };
15865
16210
  this.validatePreRenderViewConfig = (viewConfig) => {
15866
16211
  var _a;
15867
16212
  const preRenderAllowedKeys = ['preRenderId', 'vizId', 'liveboardId'];
@@ -15895,10 +16240,10 @@ class TsEmbed {
15895
16240
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
15896
16241
  ...viewConfig,
15897
16242
  });
16243
+ const embedConfig = getEmbedConfig();
16244
+ this.embedConfig = embedConfig;
15898
16245
  this.hostEventClient = new HostEventClient(this.iFrame);
15899
16246
  this.isReadyForRenderPromise = getInitPromise().then(async () => {
15900
- const embedConfig = getEmbedConfig();
15901
- this.embedConfig = embedConfig;
15902
16247
  if (!embedConfig.authTriggerContainer && !embedConfig.useEventForSAMLPopup) {
15903
16248
  this.embedConfig.authTriggerContainer = domSelector;
15904
16249
  }
@@ -15931,7 +16276,6 @@ class TsEmbed {
15931
16276
  */
15932
16277
  getEventType(event) {
15933
16278
  var _a, _b;
15934
- // eslint-disable-next-line no-underscore-dangle
15935
16279
  return ((_a = event.data) === null || _a === void 0 ? void 0 : _a.type) || ((_b = event.data) === null || _b === void 0 ? void 0 : _b.__type);
15936
16280
  }
15937
16281
  /**
@@ -16084,6 +16428,11 @@ class TsEmbed {
16084
16428
  .join('/');
16085
16429
  return `${basePath}#`;
16086
16430
  }
16431
+ getUpdateEmbedParamsObject() {
16432
+ let queryParams = this.getEmbedParamsObject();
16433
+ queryParams = { ...this.viewConfig, ...queryParams };
16434
+ return queryParams;
16435
+ }
16087
16436
  /**
16088
16437
  * Common query params set for all the embed modes.
16089
16438
  * @param queryParams
@@ -16233,9 +16582,13 @@ class TsEmbed {
16233
16582
  return path;
16234
16583
  }
16235
16584
  getEmbedParams() {
16236
- const queryParams = this.getBaseQueryParams();
16585
+ const queryParams = this.getEmbedParamsObject();
16237
16586
  return getQueryParamString(queryParams);
16238
16587
  }
16588
+ getEmbedParamsObject() {
16589
+ const params = this.getBaseQueryParams();
16590
+ return params;
16591
+ }
16239
16592
  getRootIframeSrc() {
16240
16593
  const query = this.getEmbedParams();
16241
16594
  return this.getEmbedBasePath(query);
@@ -16334,7 +16687,8 @@ class TsEmbed {
16334
16687
  }
16335
16688
  });
16336
16689
  }
16337
- // Setup fullscreen change handler after iframe is loaded and ready
16690
+ // Setup fullscreen change handler after iframe is
16691
+ // loaded and ready
16338
16692
  this.setupFullscreenChangeHandler();
16339
16693
  });
16340
16694
  this.iFrame.addEventListener('error', () => {
@@ -16436,7 +16790,6 @@ class TsEmbed {
16436
16790
  const div = document.createElement('div');
16437
16791
  div.innerHTML = child;
16438
16792
  div.id = TS_EMBED_ID;
16439
- // eslint-disable-next-line no-param-reassign
16440
16793
  child = div;
16441
16794
  }
16442
16795
  if (((_a = this.el.nextElementSibling) === null || _a === void 0 ? void 0 : _a.id) === TS_EMBED_ID) {
@@ -16615,6 +16968,43 @@ class TsEmbed {
16615
16968
  logger$3.log('Event Port is not defined');
16616
16969
  }
16617
16970
  }
16971
+ getPreRenderObj() {
16972
+ var _a;
16973
+ const embedObj = (_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a[this.embedNodeKey];
16974
+ if (embedObj === this) {
16975
+ logger$3.info('embedObj is same as this');
16976
+ }
16977
+ return embedObj;
16978
+ }
16979
+ checkEmbedContainerLoaded() {
16980
+ if (this.isEmbedContainerLoaded)
16981
+ return true;
16982
+ const preRenderObj = this.getPreRenderObj();
16983
+ if (preRenderObj && preRenderObj.isEmbedContainerLoaded) {
16984
+ this.isEmbedContainerLoaded = true;
16985
+ }
16986
+ return this.isEmbedContainerLoaded;
16987
+ }
16988
+ executeEmbedContainerReadyCallbacks() {
16989
+ logger$3.debug('executePendingEvents', this.embedContainerReadyCallbacks);
16990
+ this.embedContainerReadyCallbacks.forEach((callback) => {
16991
+ callback === null || callback === void 0 ? void 0 : callback();
16992
+ });
16993
+ this.embedContainerReadyCallbacks = [];
16994
+ }
16995
+ /**
16996
+ * Executes a callback after the embed container is loaded.
16997
+ * @param callback The callback to execute
16998
+ */
16999
+ executeAfterEmbedContainerLoaded(callback) {
17000
+ if (this.checkEmbedContainerLoaded()) {
17001
+ callback === null || callback === void 0 ? void 0 : callback();
17002
+ }
17003
+ else {
17004
+ logger$3.debug('pushing callback to embedContainerReadyCallbacks', callback);
17005
+ this.embedContainerReadyCallbacks.push(callback);
17006
+ }
17007
+ }
16618
17008
  /**
16619
17009
  * Triggers an event to the embedded app
16620
17010
  * @param {HostEvent} messageType The event type
@@ -16759,7 +17149,12 @@ class TsEmbed {
16759
17149
  return this.preRender(true);
16760
17150
  }
16761
17151
  this.validatePreRenderViewConfig(this.viewConfig);
17152
+ logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
17153
+ this.executeAfterEmbedContainerLoaded(() => {
17154
+ this.trigger(HostEvent.UpdateEmbedParams, this.getUpdateEmbedParamsObject());
17155
+ });
16762
17156
  }
17157
+ this.beforePrerenderVisible();
16763
17158
  if (this.el) {
16764
17159
  this.syncPreRenderStyle();
16765
17160
  if (!this.viewConfig.doNotTrackPreRenderSize) {
@@ -16776,7 +17171,6 @@ class TsEmbed {
16776
17171
  this.resizeObserver.observe(this.el);
16777
17172
  }
16778
17173
  }
16779
- this.beforePrerenderVisible();
16780
17174
  removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events']);
16781
17175
  this.subscribeToEvents();
16782
17176
  // Setup fullscreen change handler for prerendered components
@@ -16869,7 +17263,8 @@ class TsEmbed {
16869
17263
  const isFullscreen = !!document.fullscreenElement;
16870
17264
  if (!isFullscreen) {
16871
17265
  logger$3.info('Exited fullscreen mode - triggering ExitPresentMode');
16872
- // Only trigger if iframe is available and contentWindow is accessible
17266
+ // Only trigger if iframe is available and contentWindow is
17267
+ // accessible
16873
17268
  if (this.iFrame && this.iFrame.contentWindow) {
16874
17269
  this.trigger(HostEvent.ExitPresentMode);
16875
17270
  }
@@ -16903,7 +17298,6 @@ class V1Embed extends TsEmbed {
16903
17298
  * Only for testing purposes.
16904
17299
  * @hidden
16905
17300
  */
16906
- // eslint-disable-next-line camelcase
16907
17301
  this.test__executeCallbacks = this.executeCallbacks;
16908
17302
  this.viewConfig = { excludeRuntimeFiltersfromURL: false, ...viewConfig };
16909
17303
  }
@@ -16965,15 +17359,9 @@ let SearchBarEmbed$1 = class SearchBarEmbed extends TsEmbed {
16965
17359
  this.embedComponentType = 'SearchBarEmbed';
16966
17360
  this.viewConfig = viewConfig;
16967
17361
  }
16968
- /**
16969
- * Construct the URL of the embedded ThoughtSpot search to be
16970
- * loaded in the iframe
16971
- * @param dataSources A list of data source GUIDs
16972
- */
16973
- getIFrameSrc() {
17362
+ getEmbedParamsObject() {
16974
17363
  var _a;
16975
17364
  const { searchOptions, dataSource, dataSources, useLastSelectedSources = false, excludeSearchTokenStringFromURL, } = this.viewConfig;
16976
- const path = 'search-bar-embed';
16977
17365
  const queryParams = this.getBaseQueryParams();
16978
17366
  queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
16979
17367
  if (dataSources && dataSources.length) {
@@ -16995,6 +17383,16 @@ let SearchBarEmbed$1 = class SearchBarEmbed extends TsEmbed {
16995
17383
  queryParams[Param.UseLastSelectedDataSource] = false;
16996
17384
  }
16997
17385
  queryParams[Param.searchEmbed] = true;
17386
+ return queryParams;
17387
+ }
17388
+ /**
17389
+ * Construct the URL of the embedded ThoughtSpot search to be
17390
+ * loaded in the iframe
17391
+ * @param dataSources A list of data source GUIDs
17392
+ */
17393
+ getIFrameSrc() {
17394
+ const queryParams = this.getEmbedParamsObject();
17395
+ const path = 'search-bar-embed';
16998
17396
  let query = '';
16999
17397
  const queryParamsString = getQueryParamString(queryParams, true);
17000
17398
  if (queryParamsString) {
@@ -17045,12 +17443,7 @@ let SageEmbed$1 = class SageEmbed extends V1Embed {
17045
17443
  viewConfig.embedComponentType = 'SageEmbed';
17046
17444
  super(domSelector, viewConfig);
17047
17445
  }
17048
- /**
17049
- * Constructs a map of parameters to be passed on to the
17050
- * embedded Eureka or Sage search page.
17051
- * @returns {string} query string
17052
- */
17053
- getEmbedParams() {
17446
+ getEmbedParamsObject() {
17054
17447
  const { disableWorksheetChange, hideWorksheetSelector, showObjectSuggestions, dataPanelV2, hideSampleQuestions, isProductTour, hideSageAnswerHeader, hideAutocompleteSuggestions, } = this.viewConfig;
17055
17448
  const params = this.getBaseQueryParams();
17056
17449
  params[Param.DataPanelV2Enabled] = !!dataPanelV2;
@@ -17065,6 +17458,15 @@ let SageEmbed$1 = class SageEmbed extends V1Embed {
17065
17458
  params[Param.HideSampleQuestions] = !!hideSampleQuestions;
17066
17459
  params[Param.IsProductTour] = !!isProductTour;
17067
17460
  params[Param.HideSageAnswerHeader] = !!hideSageAnswerHeader;
17461
+ return params;
17462
+ }
17463
+ /**
17464
+ * Constructs a map of parameters to be passed on to the
17465
+ * embedded Eureka or Sage search page.
17466
+ * @returns {string} query string
17467
+ */
17468
+ getEmbedParams() {
17469
+ const params = this.getEmbedParamsObject();
17068
17470
  return getQueryParamString(params, true);
17069
17471
  }
17070
17472
  /**
@@ -17174,11 +17576,9 @@ let SearchEmbed$1 = class SearchEmbed extends TsEmbed {
17174
17576
  const defaultAppInitData = await super.getAppInitData();
17175
17577
  return { ...defaultAppInitData, ...this.getSearchInitData() };
17176
17578
  }
17177
- getEmbedParams() {
17579
+ getEmbedParamsObject() {
17178
17580
  var _a;
17179
- const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = false, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
17180
- /* eslint-disable-next-line max-len */
17181
- dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
17581
+ const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = false, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
17182
17582
  const queryParams = this.getBaseQueryParams();
17183
17583
  queryParams[Param.HideActions] = [
17184
17584
  ...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
@@ -17211,7 +17611,6 @@ let SearchEmbed$1 = class SearchEmbed extends TsEmbed {
17211
17611
  queryParams[Param.HideSearchBar] = true;
17212
17612
  }
17213
17613
  if (isOnBeforeGetVizDataInterceptEnabled) {
17214
- /* eslint-disable-next-line max-len */
17215
17614
  queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
17216
17615
  }
17217
17616
  if (!focusSearchBarOnRender) {
@@ -17224,20 +17623,22 @@ let SearchEmbed$1 = class SearchEmbed extends TsEmbed {
17224
17623
  queryParams[Param.UseLastSelectedDataSource] = false;
17225
17624
  }
17226
17625
  queryParams[Param.searchEmbed] = true;
17227
- /* eslint-disable-next-line max-len */
17228
17626
  queryParams[Param.CollapseSearchBarInitially] = collapseSearchBarInitially || collapseSearchBar;
17229
17627
  queryParams[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
17230
17628
  if (dataPanelCustomGroupsAccordionInitialState
17231
17629
  === DataPanelCustomColumnGroupsAccordionState$1.COLLAPSE_ALL
17232
17630
  || dataPanelCustomGroupsAccordionInitialState
17233
17631
  === DataPanelCustomColumnGroupsAccordionState$1.EXPAND_FIRST) {
17234
- /* eslint-disable-next-line max-len */
17235
17632
  queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
17236
17633
  }
17237
17634
  else {
17238
- /* eslint-disable-next-line max-len */
17239
17635
  queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL;
17240
17636
  }
17637
+ return queryParams;
17638
+ }
17639
+ getEmbedParams() {
17640
+ const { runtimeParameters, runtimeFilters, excludeRuntimeParametersfromURL, excludeRuntimeFiltersfromURL, } = this.viewConfig;
17641
+ const queryParams = this.getEmbedParamsObject();
17241
17642
  let query = '';
17242
17643
  const queryParamsString = getQueryParamString(queryParams, true);
17243
17644
  if (queryParamsString) {
@@ -17543,10 +17944,18 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
17543
17944
  else {
17544
17945
  params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
17545
17946
  }
17947
+ // Set navigation to v2 by default to avoid problems like the app
17948
+ // switcher (9-dot menu) not showing when v3 navigation is turned on
17949
+ // at the cluster level.
17950
+ // To use v3 navigation, we must manually set the discoveryExperience
17951
+ // settings.
17952
+ params[Param.NavigationVersion] = 'v2';
17546
17953
  if (discoveryExperience) {
17547
17954
  // primaryNavbarVersion v3 will enabled the new left navigation
17548
17955
  if (discoveryExperience.primaryNavbarVersion === PrimaryNavbarVersion.Sliding) {
17549
17956
  params[Param.NavigationVersion] = discoveryExperience.primaryNavbarVersion;
17957
+ // Enable the modularHomeExperience when Sliding is enabled.
17958
+ params[Param.ModularHomeExperienceEnabled] = true;
17550
17959
  }
17551
17960
  // homePage v2 will enable the modular home page
17552
17961
  // and it will override the modularHomeExperience value
@@ -17719,7 +18128,7 @@ const addPreviewStylesIfNotPresent = () => {
17719
18128
  return;
17720
18129
  }
17721
18130
  const previewStyles = `
17722
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ag-grid-community@32.0.2/styles/ag-grid.min.css">
18131
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ag-grid-community@32.0.2/styles/ag-grid.min.css" integrity="sha384-PvEsKa6emq5KYa9mf+Q7eYF5C2OCacYzZ+hBngp21NA4o1A9iU9smnytEmqUFbEZ" crossorigin="anonymous">
17723
18132
  <style id="ts-preview-style">
17724
18133
  .ts-viz-preview-loader {
17725
18134
  position: absolute;
@@ -17830,6 +18239,16 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
17830
18239
  }
17831
18240
  this.setIFrameHeight(frameHeight || this.defaultHeight);
17832
18241
  };
18242
+ /**
18243
+ * @hidden
18244
+ * Internal state to track the current liveboard id.
18245
+ * This is used to navigate to the correct liveboard when the prerender is visible.
18246
+ */
18247
+ this.currentLiveboardState = {
18248
+ liveboardId: this.viewConfig.liveboardId,
18249
+ vizId: this.viewConfig.vizId,
18250
+ activeTabId: this.viewConfig.activeTabId,
18251
+ };
17833
18252
  if (this.viewConfig.fullHeight === true) {
17834
18253
  if (this.viewConfig.vizId) {
17835
18254
  logger$3.warn('Full height is currently only supported for Liveboard embeds.' +
@@ -17846,6 +18265,11 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
17846
18265
  * embedded Liveboard or visualization.
17847
18266
  */
17848
18267
  getEmbedParams() {
18268
+ const params = this.getEmbedParamsObject();
18269
+ const queryParams = getQueryParamString(params, true);
18270
+ return queryParams;
18271
+ }
18272
+ getEmbedParamsObject() {
17849
18273
  let params = {};
17850
18274
  params = this.getBaseQueryParams(params);
17851
18275
  const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = false, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
@@ -17915,8 +18339,27 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
17915
18339
  params[Param.DataPanelV2Enabled] = dataPanelV2;
17916
18340
  params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
17917
18341
  params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
17918
- const queryParams = getQueryParamString(params, true);
17919
- return queryParams;
18342
+ if (oAuthPollingInterval !== undefined) {
18343
+ params[Param.OauthPollingInterval] = oAuthPollingInterval;
18344
+ }
18345
+ if (isForceRedirect) {
18346
+ params[Param.IsForceRedirect] = isForceRedirect;
18347
+ }
18348
+ if (dataSourceId !== undefined) {
18349
+ params[Param.DataSourceId] = dataSourceId;
18350
+ }
18351
+ if (isLiveboardStylingAndGroupingEnabled !== undefined) {
18352
+ params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
18353
+ }
18354
+ params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
18355
+ params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
18356
+ params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
18357
+ params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
18358
+ params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
18359
+ params[Param.DataPanelV2Enabled] = dataPanelV2;
18360
+ params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
18361
+ params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
18362
+ return params;
17920
18363
  }
17921
18364
  getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
17922
18365
  let suffix = `/embed/viz/${liveboardId}`;
@@ -17978,16 +18421,17 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
17978
18421
  }
17979
18422
  }
17980
18423
  beforePrerenderVisible() {
17981
- var _a;
17982
- const embedObj = (_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a[this.embedNodeKey];
17983
- if (isUndefined$1(embedObj))
17984
- return;
17985
- const showDifferentLib = this.viewConfig.liveboardId
17986
- && embedObj.viewConfig.liveboardId !== this.viewConfig.liveboardId;
17987
- if (showDifferentLib) {
17988
- const libId = this.viewConfig.liveboardId;
17989
- this.navigateToLiveboard(libId);
17990
- }
18424
+ const embedObj = this.getPreRenderObj();
18425
+ this.executeAfterEmbedContainerLoaded(() => {
18426
+ this.navigateToLiveboard(this.viewConfig.liveboardId, this.viewConfig.vizId, this.viewConfig.activeTabId);
18427
+ if (embedObj) {
18428
+ embedObj.currentLiveboardState = {
18429
+ liveboardId: this.viewConfig.liveboardId,
18430
+ vizId: this.viewConfig.vizId,
18431
+ activeTabId: this.viewConfig.activeTabId,
18432
+ };
18433
+ }
18434
+ });
17991
18435
  }
17992
18436
  async handleRenderForPrerender() {
17993
18437
  if (isUndefined$1(this.viewConfig.liveboardId)) {
@@ -18445,7 +18889,11 @@ class Conversation {
18445
18889
  return {
18446
18890
  convId: this.conversationId,
18447
18891
  messageId: responses[0].msgId,
18448
- data: data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
18892
+ data: {
18893
+ ...data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
18894
+ convId: this.conversationId,
18895
+ messageId: responses[0].msgId,
18896
+ },
18449
18897
  error: null,
18450
18898
  };
18451
18899
  }
@@ -18469,13 +18917,17 @@ let ConversationMessage$1 = class ConversationMessage extends TsEmbed {
18469
18917
  super(container, viewConfig);
18470
18918
  this.viewConfig = viewConfig;
18471
18919
  }
18472
- getIframeSrc() {
18920
+ getEmbedParamsObject() {
18473
18921
  var _a;
18474
- const { sessionId, genNo, acSessionId, acGenNo, } = this.viewConfig;
18475
- const path = 'conv-assist-answer';
18476
18922
  const queryParams = this.getBaseQueryParams();
18477
18923
  queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
18478
18924
  queryParams[Param.isSpotterAgentEmbed] = true;
18925
+ return queryParams;
18926
+ }
18927
+ getIframeSrc() {
18928
+ const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
18929
+ const path = 'conv-assist-answer';
18930
+ const queryParams = this.getEmbedParamsObject();
18479
18931
  let query = '';
18480
18932
  const queryParamsString = getQueryParamString(queryParams, true);
18481
18933
  if (queryParamsString) {
@@ -18486,6 +18938,8 @@ let ConversationMessage$1 = class ConversationMessage extends TsEmbed {
18486
18938
  genNo,
18487
18939
  acSessionId,
18488
18940
  acGenNo,
18941
+ convId,
18942
+ messageId,
18489
18943
  });
18490
18944
  return `${this.getEmbedBasePath(query)}/embed/${path}${tsPostHashParams}`;
18491
18945
  }
@@ -18529,6 +18983,8 @@ class SpotterAgentEmbed {
18529
18983
  const container = document.createElement('div');
18530
18984
  const embed = new ConversationMessage$1(container, {
18531
18985
  ...this.viewConfig,
18986
+ convId: data.convId,
18987
+ messageId: data.messageId,
18532
18988
  sessionId: data.sessionId,
18533
18989
  genNo: data.genNo,
18534
18990
  acSessionId: data.stateKey.transactionId,
@@ -18549,6 +19005,8 @@ class SpotterAgentEmbed {
18549
19005
  return { error };
18550
19006
  }
18551
19007
  return { data: {
19008
+ convId: data.convId,
19009
+ messageId: data.messageId,
18552
19010
  sessionId: data.sessionId,
18553
19011
  genNo: data.genNo,
18554
19012
  acSessionId: data.stateKey.transactionId,
@@ -18625,9 +19083,8 @@ let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
18625
19083
  super(container, viewConfig);
18626
19084
  this.viewConfig = viewConfig;
18627
19085
  }
18628
- getIframeSrc() {
18629
- const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, } = this.viewConfig;
18630
- const path = 'insights/conv-assist';
19086
+ getEmbedParamsObject() {
19087
+ const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
18631
19088
  if (!worksheetId) {
18632
19089
  this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
18633
19090
  }
@@ -18648,11 +19105,25 @@ let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
18648
19105
  if (!isUndefined_1(hideSampleQuestions)) {
18649
19106
  queryParams[Param.HideSampleQuestions] = !!hideSampleQuestions;
18650
19107
  }
19108
+ return queryParams;
19109
+ }
19110
+ getIframeSrc() {
19111
+ const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
19112
+ const path = 'insights/conv-assist';
19113
+ const queryParams = this.getEmbedParamsObject();
18651
19114
  let query = '';
18652
19115
  const queryParamsString = getQueryParamString(queryParams, true);
18653
19116
  if (queryParamsString) {
18654
19117
  query = `?${queryParamsString}`;
18655
19118
  }
19119
+ const filterQuery = getFilterQuery(runtimeFilters || []);
19120
+ if (filterQuery && !excludeRuntimeFiltersfromURL) {
19121
+ query += `&${filterQuery}`;
19122
+ }
19123
+ const parameterQuery = getRuntimeParameters(runtimeParameters || []);
19124
+ if (parameterQuery && !excludeRuntimeParametersfromURL) {
19125
+ query += `&${parameterQuery}`;
19126
+ }
18656
19127
  const tsPostHashParams = this.getThoughtSpotPostUrlParams({
18657
19128
  worksheet: worksheetId,
18658
19129
  query: (searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.searchQuery) || '',