@thoughtspot/visual-embed-sdk 1.40.0 → 1.40.1-alpha.2

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 (111) hide show
  1. package/cjs/package.json +1 -1
  2. package/cjs/src/embed/bodyless-conversation.d.ts +1 -0
  3. package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
  4. package/cjs/src/embed/bodyless-conversation.js +7 -3
  5. package/cjs/src/embed/bodyless-conversation.js.map +1 -1
  6. package/cjs/src/embed/conversation.d.ts +1 -0
  7. package/cjs/src/embed/conversation.d.ts.map +1 -1
  8. package/cjs/src/embed/conversation.js +7 -2
  9. package/cjs/src/embed/conversation.js.map +1 -1
  10. package/cjs/src/embed/liveboard.d.ts +3 -1
  11. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  12. package/cjs/src/embed/liveboard.js +35 -14
  13. package/cjs/src/embed/liveboard.js.map +1 -1
  14. package/cjs/src/embed/liveboard.spec.js +29 -4
  15. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  16. package/cjs/src/embed/sage.d.ts +1 -0
  17. package/cjs/src/embed/sage.d.ts.map +1 -1
  18. package/cjs/src/embed/sage.js +10 -6
  19. package/cjs/src/embed/sage.js.map +1 -1
  20. package/cjs/src/embed/search-bar.d.ts +1 -0
  21. package/cjs/src/embed/search-bar.d.ts.map +1 -1
  22. package/cjs/src/embed/search-bar.js +11 -7
  23. package/cjs/src/embed/search-bar.js.map +1 -1
  24. package/cjs/src/embed/search.d.ts +1 -0
  25. package/cjs/src/embed/search.d.ts.map +1 -1
  26. package/cjs/src/embed/search.js +7 -8
  27. package/cjs/src/embed/search.js.map +1 -1
  28. package/cjs/src/embed/ts-embed.d.ts +9 -0
  29. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  30. package/cjs/src/embed/ts-embed.js +65 -10
  31. package/cjs/src/embed/ts-embed.js.map +1 -1
  32. package/cjs/src/types.d.ts +33 -64
  33. package/cjs/src/types.d.ts.map +1 -1
  34. package/cjs/src/types.js +33 -64
  35. package/cjs/src/types.js.map +1 -1
  36. package/dist/{index-CAEHQGLc.js → index-CmEQfuE3.js} +1 -1
  37. package/dist/index-D1pyb7RG.js +7371 -0
  38. package/dist/index-DeFzsyFF.js +7371 -0
  39. package/dist/index-Dpf0rd6w.js +7371 -0
  40. package/dist/index-UuEbsISo.js +7447 -0
  41. package/dist/index-e3Uw3YFO.js +7371 -0
  42. package/dist/index-k7pkZMhx.js +7371 -0
  43. package/dist/src/embed/bodyless-conversation.d.ts +1 -0
  44. package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
  45. package/dist/src/embed/conversation.d.ts +1 -0
  46. package/dist/src/embed/conversation.d.ts.map +1 -1
  47. package/dist/src/embed/liveboard.d.ts +3 -1
  48. package/dist/src/embed/liveboard.d.ts.map +1 -1
  49. package/dist/src/embed/sage.d.ts +1 -0
  50. package/dist/src/embed/sage.d.ts.map +1 -1
  51. package/dist/src/embed/search-bar.d.ts +1 -0
  52. package/dist/src/embed/search-bar.d.ts.map +1 -1
  53. package/dist/src/embed/search.d.ts +1 -0
  54. package/dist/src/embed/search.d.ts.map +1 -1
  55. package/dist/src/embed/ts-embed.d.ts +9 -0
  56. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  57. package/dist/src/types.d.ts +33 -64
  58. package/dist/src/types.d.ts.map +1 -1
  59. package/dist/tsembed-react.es.js +178 -117
  60. package/dist/tsembed-react.js +177 -116
  61. package/dist/tsembed.es.js +178 -117
  62. package/dist/tsembed.js +177 -116
  63. package/dist/visual-embed-sdk-react-full.d.ts +47 -65
  64. package/dist/visual-embed-sdk-react.d.ts +47 -65
  65. package/dist/visual-embed-sdk.d.ts +47 -65
  66. package/lib/package.json +1 -1
  67. package/lib/src/embed/bodyless-conversation.d.ts +1 -0
  68. package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
  69. package/lib/src/embed/bodyless-conversation.js +7 -3
  70. package/lib/src/embed/bodyless-conversation.js.map +1 -1
  71. package/lib/src/embed/conversation.d.ts +1 -0
  72. package/lib/src/embed/conversation.d.ts.map +1 -1
  73. package/lib/src/embed/conversation.js +7 -2
  74. package/lib/src/embed/conversation.js.map +1 -1
  75. package/lib/src/embed/liveboard.d.ts +3 -1
  76. package/lib/src/embed/liveboard.d.ts.map +1 -1
  77. package/lib/src/embed/liveboard.js +35 -14
  78. package/lib/src/embed/liveboard.js.map +1 -1
  79. package/lib/src/embed/liveboard.spec.js +29 -4
  80. package/lib/src/embed/liveboard.spec.js.map +1 -1
  81. package/lib/src/embed/sage.d.ts +1 -0
  82. package/lib/src/embed/sage.d.ts.map +1 -1
  83. package/lib/src/embed/sage.js +10 -6
  84. package/lib/src/embed/sage.js.map +1 -1
  85. package/lib/src/embed/search-bar.d.ts +1 -0
  86. package/lib/src/embed/search-bar.d.ts.map +1 -1
  87. package/lib/src/embed/search-bar.js +11 -7
  88. package/lib/src/embed/search-bar.js.map +1 -1
  89. package/lib/src/embed/search.d.ts +1 -0
  90. package/lib/src/embed/search.d.ts.map +1 -1
  91. package/lib/src/embed/search.js +7 -8
  92. package/lib/src/embed/search.js.map +1 -1
  93. package/lib/src/embed/ts-embed.d.ts +9 -0
  94. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  95. package/lib/src/embed/ts-embed.js +65 -10
  96. package/lib/src/embed/ts-embed.js.map +1 -1
  97. package/lib/src/types.d.ts +33 -64
  98. package/lib/src/types.d.ts.map +1 -1
  99. package/lib/src/types.js +33 -64
  100. package/lib/src/types.js.map +1 -1
  101. package/lib/src/visual-embed-sdk.d.ts +47 -65
  102. package/package.json +1 -1
  103. package/src/embed/bodyless-conversation.ts +9 -3
  104. package/src/embed/conversation.ts +13 -2
  105. package/src/embed/liveboard.spec.ts +32 -4
  106. package/src/embed/liveboard.ts +41 -14
  107. package/src/embed/sage.ts +11 -6
  108. package/src/embed/search-bar.tsx +14 -7
  109. package/src/embed/search.ts +18 -7
  110. package/src/embed/ts-embed.ts +90 -24
  111. package/src/types.ts +34 -64
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.40.0 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.40.1-alpha.2 */
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.LiveboardInfo, payload => {
1226
+ * liveboardEmbed.on(EmbedEvent.AnswerChartSwitcher, payload => {
1227
1227
  * console.log('Liveboard details', payload);
1228
1228
  * })
1229
1229
  *```
@@ -1598,58 +1598,58 @@ var EmbedEvent;
1598
1598
  */
1599
1599
  EmbedEvent["RequestVisibleEmbedCoordinates"] = "requestVisibleEmbedCoordinates";
1600
1600
  /**
1601
- * Emitted when Spotter response is text data
1601
+ * Emitted when spotter response is text data
1602
1602
  * @example
1603
1603
  * ```js
1604
1604
  * spotterEmbed.on(EmbedEvent.SpotterData, (payload) => {
1605
1605
  * console.log('payload', payload);
1606
1606
  * })
1607
1607
  *```
1608
- * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1608
+ * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1609
1609
  */
1610
1610
  EmbedEvent["SpotterData"] = "SpotterData";
1611
1611
  /**
1612
- * Emitted when user opens up the worksheet preview modal in Spotter embed.
1612
+ * Emitted when user opens up the worksheet preview modal in spotter embed.
1613
1613
  * @example
1614
1614
  * ```js
1615
1615
  * spotterEmbed.on(EmbedEvent.PreviewSpotterData, (payload) => {
1616
1616
  * console.log('payload', payload);
1617
1617
  * })
1618
1618
  *```
1619
- * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1619
+ * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1620
1620
  */
1621
1621
  EmbedEvent["PreviewSpotterData"] = "PreviewSpotterData";
1622
1622
  /**
1623
- * Emitted when the Spotter query is triggered in Spotter embed.
1623
+ * Emitted when the spotter query is triggered in spotter embed.
1624
1624
  * @example
1625
1625
  * ```js
1626
1626
  * spotterEmbed.on(EmbedEvent.SpotterQueryTriggered, (payload) => {
1627
1627
  * console.log('payload', payload);
1628
1628
  * })
1629
1629
  *```
1630
- * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1630
+ * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1631
1631
  */
1632
1632
  EmbedEvent["SpotterQueryTriggered"] = "SpotterQueryTriggered";
1633
1633
  /**
1634
- * Emitted when the last Spotter query is edited in Spotter embed.
1634
+ * Emitted when the last spotter query is edited in spotter embed.
1635
1635
  * @example
1636
1636
  * ```js
1637
1637
  * spotterEmbed.on(EmbedEvent.LastPromptEdited, (payload) => {
1638
1638
  * console.log('payload', payload);
1639
1639
  * })
1640
1640
  *```
1641
- * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1641
+ * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1642
1642
  */
1643
1643
  EmbedEvent["LastPromptEdited"] = "LastPromptEdited";
1644
1644
  /**
1645
- * Emitted when the last Spotter query is deleted in Spotter embed.
1645
+ * Emitted when the last spotter query is deleted in spotter embed.
1646
1646
  * @example
1647
1647
  * ```js
1648
1648
  * spotterEmbed.on(EmbedEvent.LastPromptDeleted, (payload) => {
1649
1649
  * console.log('payload', payload);
1650
1650
  * })
1651
1651
  *```
1652
- * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1652
+ * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1653
1653
  */
1654
1654
  EmbedEvent["LastPromptDeleted"] = "LastPromptDeleted";
1655
1655
  /**
@@ -1660,7 +1660,7 @@ var EmbedEvent;
1660
1660
  * console.log('payload', payload);
1661
1661
  * })
1662
1662
  *```
1663
- * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1663
+ * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1664
1664
  */
1665
1665
  EmbedEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
1666
1666
  /**
@@ -1673,7 +1673,7 @@ var EmbedEvent;
1673
1673
  *```
1674
1674
  * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1675
1675
  */
1676
- EmbedEvent["SpotterInit"] = "spotterInit";
1676
+ EmbedEvent["SpotterInit"] = "SpotterInit";
1677
1677
  })(EmbedEvent || (EmbedEvent = {}));
1678
1678
  /**
1679
1679
  * Event types that can be triggered by the host application
@@ -1763,7 +1763,6 @@ var HostEvent;
1763
1763
  * done automatically on the most popular column.
1764
1764
  * @param - vizId [TS >= 9.8.0] - Optional. The GUID of the visualization to drill
1765
1765
  * in case of a Liveboard.
1766
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
1767
1766
  * @example
1768
1767
  * ```js
1769
1768
  * searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
@@ -2083,21 +2082,12 @@ var HostEvent;
2083
2082
  * Trigger the **Download PDF** action on an embedded Liveboard,
2084
2083
  * visualization or Answer.
2085
2084
  *
2086
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2087
- *
2088
2085
  * **NOTE**: The **Download** > **PDF** action is available on
2089
2086
  * visualizations and Answers if the data is in tabular format.
2090
2087
  * @example
2091
2088
  * ```js
2092
2089
  * liveboardEmbed.trigger(HostEvent.DownloadAsPdf)
2093
2090
  * ```
2094
- * @example
2095
- * ```js
2096
- * spotterEmbed.trigger(HostEvent.DownloadAsPdf, {
2097
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2098
- * });
2099
- * ```
2100
- *
2101
2091
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2102
2092
  */
2103
2093
  HostEvent["DownloadAsPdf"] = "downloadAsPdf";
@@ -2199,8 +2189,7 @@ var HostEvent;
2199
2189
  * This event is not supported in visualization embed and search embed.
2200
2190
  * @param - object - To trigger the action for a specific visualization
2201
2191
  * in Liveboard embed, pass in `vizId` as a key.
2202
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2203
- *
2192
+ * **Required** in Spotter embed.
2204
2193
  * @example
2205
2194
  * ```js
2206
2195
  * liveboardEmbed.trigger(HostEvent.Edit)
@@ -2215,12 +2204,6 @@ var HostEvent;
2215
2204
  * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2216
2205
  * });
2217
2206
  * ```
2218
- * @example
2219
- * ```js
2220
- * const editResponse = await spotterEmbed.trigger(HostEvent.Edit, {
2221
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2222
- * });
2223
- * ```
2224
2207
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2225
2208
  */
2226
2209
  HostEvent["Edit"] = "edit";
@@ -2341,7 +2324,6 @@ var HostEvent;
2341
2324
  /**
2342
2325
  * Trigger the **Download** action on charts in
2343
2326
  * the embedded view.
2344
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2345
2327
  * @example
2346
2328
  * ```js
2347
2329
  * liveboardEmbed.trigger(HostEvent.Download, {vizId:
@@ -2350,11 +2332,6 @@ var HostEvent;
2350
2332
  * ```js
2351
2333
  * embed.trigger(HostEvent.Download)
2352
2334
  * ```
2353
- * ```js
2354
- * spotterEmbed.trigger(HostEvent.Download, {
2355
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2356
- * });
2357
- * ```
2358
2335
  * @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw
2359
2336
  * Use {@link DownloadAsPng}
2360
2337
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
@@ -2383,7 +2360,6 @@ var HostEvent;
2383
2360
  /**
2384
2361
  * Trigger the **Download** > **CSV** action on tables in
2385
2362
  * the embedded view.
2386
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2387
2363
  * @example
2388
2364
  * ```js
2389
2365
  * liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:
@@ -2406,7 +2382,6 @@ var HostEvent;
2406
2382
  /**
2407
2383
  * Trigger the **Download** > **XLSX** action on tables
2408
2384
  * in the embedded view.
2409
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2410
2385
  * @example
2411
2386
  * ```js
2412
2387
  * liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:
@@ -2442,7 +2417,7 @@ var HostEvent;
2442
2417
  /**
2443
2418
  * Trigger the **Save** action on a Liveboard or Answer.
2444
2419
  * Saves the changes.
2445
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2420
+ * @param - `vizId` is required in Spotter Embed.
2446
2421
  * @example
2447
2422
  * ```js
2448
2423
  * liveboardEmbed.trigger(HostEvent.Save)
@@ -2752,7 +2727,6 @@ var HostEvent;
2752
2727
  HostEvent["UpdateParameters"] = "UpdateParameters";
2753
2728
  /**
2754
2729
  * Triggers GetParameters to fetch the runtime Parameters.
2755
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2756
2730
  * ```js
2757
2731
  * liveboardEmbed.trigger(HostEvent.GetParameters).then((parameter) => {
2758
2732
  * console.log('parameters', parameter);
@@ -2796,7 +2770,7 @@ var HostEvent;
2796
2770
  * @param - optional attributes to set Answer properties.
2797
2771
  * `name` - Name string for the Answer.
2798
2772
  * `description` - Description text for the Answer.
2799
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2773
+ *
2800
2774
  * @example
2801
2775
  * ```js
2802
2776
  * const saveAnswerResponse = await searchEmbed.trigger(HostEvent.SaveAnswer, {
@@ -2804,14 +2778,6 @@ var HostEvent;
2804
2778
  * description: "Total sales by states in MidWest"
2805
2779
  * });
2806
2780
  * ```
2807
- * @example
2808
- * ```js
2809
- * const saveAnswerResponse = await spotterEmbed.trigger(HostEvent.SaveAnswer, {
2810
- * vizId: '730496d6-6903-4601-937e-2c691821af3c',
2811
- * name: "Sales by states",
2812
- * description: "Total sales by states in MidWest"
2813
- * });
2814
- * ```
2815
2781
  * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
2816
2782
  */
2817
2783
  HostEvent["SaveAnswer"] = "saveAnswer";
@@ -2843,7 +2809,7 @@ var HostEvent;
2843
2809
  /**
2844
2810
  * Triggers a search operation with the search tokens specified in
2845
2811
  * the search query string in spotter embed.
2846
- * @param - `query`: Text string in Natural Language format
2812
+ * @param - `queryString`: Text string in Natural Language format
2847
2813
  * @param - `executeSearch`: Boolean to execute search and update search query
2848
2814
  * @example
2849
2815
  * ```js
@@ -2852,7 +2818,6 @@ var HostEvent;
2852
2818
  * executeSearch: true,
2853
2819
  * })
2854
2820
  * ```
2855
- * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
2856
2821
  */
2857
2822
  HostEvent["SpotterSearch"] = "SpotterSearch";
2858
2823
  /**
@@ -2862,7 +2827,6 @@ var HostEvent;
2862
2827
  * ```js
2863
2828
  * spotterEmbed.trigger(HostEvent.EditLastPrompt, "revenue per year");
2864
2829
  * ```
2865
- * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
2866
2830
  */
2867
2831
  HostEvent["EditLastPrompt"] = "EditLastPrompt";
2868
2832
  /**
@@ -2871,7 +2835,6 @@ var HostEvent;
2871
2835
  * ```js
2872
2836
  * spotterEmbed.trigger(HostEvent.PreviewSpotterData);
2873
2837
  * ```
2874
- * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
2875
2838
  */
2876
2839
  HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
2877
2840
  /**
@@ -2880,7 +2843,6 @@ var HostEvent;
2880
2843
  * ```js
2881
2844
  * spotterEmbed.trigger(HostEvent.ResetSpotterConversation);
2882
2845
  * ```
2883
- * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
2884
2846
  */
2885
2847
  HostEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
2886
2848
  /**
@@ -2889,19 +2851,17 @@ var HostEvent;
2889
2851
  * ```js
2890
2852
  * spotterEmbed.trigger(HostEvent.DeleteLastPrompt);
2891
2853
  * ```
2892
- * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
2893
2854
  */
2894
2855
  HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
2895
2856
  /**
2896
2857
  * Toggle the visualization to chart or table view.
2897
- * @param - `vizId ` refers to the answer id in spotter Embed, it is required in spotter Embed.
2858
+ * @param - `vizId ` In Spotter Embed, vizId is required.
2898
2859
  * @example
2899
2860
  * ```js
2900
2861
  * spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, {
2901
- * vizId:'b535c760-8bbe-4e6f-bb26-af56b4129a1e'
2862
+ * vizId:"'b535c760-8bbe-4e6f-bb26-af56b4129a1e'"
2902
2863
  * });
2903
2864
  *```
2904
- * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
2905
2865
  */
2906
2866
  HostEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
2907
2867
  /**
@@ -2928,16 +2888,25 @@ var HostEvent;
2928
2888
  */
2929
2889
  HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
2930
2890
  /**
2931
- * Trigger the *Ask Spotter* action for visualizations
2932
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2891
+ * Trigger the *Ask Sage* action for visualizations
2933
2892
  * @example
2934
2893
  * ```js
2935
- * spotterEmbed.trigger(HostEvent.AskSpotter,
2936
- * {vizId:'730496d6-6903-4601-937e-2c691821af3c'})
2894
+ * liveboardEmbed.trigger(HostEvent.AskSpotter,
2895
+ * {containerId:'730496d6-6903-4601-937e-2c691821af3c'})
2937
2896
  * ```
2938
2897
  * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
2939
2898
  */
2940
- HostEvent["AskSpotter"] = "AskSpotter";
2899
+ HostEvent["AskSpotter"] = "askSpotter";
2900
+ /**
2901
+ * @hidden
2902
+ * Triggers the update of the embed params.
2903
+ *
2904
+ * @example
2905
+ * ```js
2906
+ * liveboardEmbed.trigger(HostEvent.UpdateEmbedParams, viewConfig);
2907
+ * ```
2908
+ */
2909
+ HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
2941
2910
  })(HostEvent || (HostEvent = {}));
2942
2911
  /**
2943
2912
  * The different visual modes that the data sources panel within
@@ -8067,7 +8036,7 @@ class AnswerService {
8067
8036
  async getTML() {
8068
8037
  const { object } = await this.executeQuery(getAnswerTML, {});
8069
8038
  const edoc = object[0].edoc;
8070
- const YAML = await import('./index-CAEHQGLc.js');
8039
+ const YAML = await import('./index-k7pkZMhx.js');
8071
8040
  const parsedDoc = YAML.parse(edoc);
8072
8041
  return {
8073
8042
  answer: {
@@ -15801,7 +15770,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
15801
15770
  return e;
15802
15771
  }
15803
15772
 
15804
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.40.0";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};
15773
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.40.1-alpha.2";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --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};
15805
15774
 
15806
15775
  /**
15807
15776
  * Reloads the ThoughtSpot iframe.
@@ -16027,6 +15996,7 @@ class TsEmbed {
16027
15996
  */
16028
15997
  this.fullscreenChangeHandler = null;
16029
15998
  this.subscribedListeners = {};
15999
+ this.isEmbedContainerLoaded = false;
16030
16000
  /**
16031
16001
  * Send Custom style as part of payload of APP_INIT
16032
16002
  * @param _
@@ -16053,7 +16023,8 @@ class TsEmbed {
16053
16023
  this.updateAuthToken = async (_, responder) => {
16054
16024
  const { authType } = this.embedConfig;
16055
16025
  let { autoLogin } = this.embedConfig;
16056
- // Default autoLogin: true for cookieless if undefined/null, otherwise false
16026
+ // Default autoLogin: true for cookieless if undefined/null, otherwise
16027
+ // false
16057
16028
  autoLogin = autoLogin !== null && autoLogin !== void 0 ? autoLogin : (authType === AuthType.TrustedAuthTokenCookieless);
16058
16029
  if (autoLogin && authType === AuthType.TrustedAuthTokenCookieless) {
16059
16030
  try {
@@ -16097,11 +16068,16 @@ class TsEmbed {
16097
16068
  });
16098
16069
  notifyAuthFailure(AuthFailureType.IDLE_SESSION_TIMEOUT);
16099
16070
  };
16071
+ this.pendingEvents = [];
16100
16072
  /**
16101
16073
  * Register APP_INIT event and sendback init payload
16102
16074
  */
16103
16075
  this.registerAppInit = () => {
16104
16076
  this.on(EmbedEvent.APP_INIT, this.appInitCb, { start: false }, true);
16077
+ this.on(EmbedEvent.AuthInit, () => {
16078
+ this.isEmbedContainerLoaded = true;
16079
+ this.executePendingEvents();
16080
+ }, { start: false }, true);
16105
16081
  this.on(EmbedEvent.AuthExpire, this.updateAuthToken, { start: false }, true);
16106
16082
  this.on(EmbedEvent.IdleSessionTimeout, this.idleSessionTimeout, { start: false }, true);
16107
16083
  };
@@ -16127,6 +16103,7 @@ class TsEmbed {
16127
16103
  });
16128
16104
  }
16129
16105
  };
16106
+ this.id = Date.now().toString();
16130
16107
  this.el = getDOMNode(domSelector);
16131
16108
  this.eventHandlerMap = new Map();
16132
16109
  this.isError = false;
@@ -16140,9 +16117,9 @@ class TsEmbed {
16140
16117
  ...viewConfig,
16141
16118
  });
16142
16119
  this.hostEventClient = new HostEventClient(this.iFrame);
16120
+ const embedConfig = getEmbedConfig();
16121
+ this.embedConfig = embedConfig;
16143
16122
  this.isReadyForRenderPromise = getInitPromise().then(async () => {
16144
- const embedConfig = getEmbedConfig();
16145
- this.embedConfig = embedConfig;
16146
16123
  if (!embedConfig.authTriggerContainer && !embedConfig.useEventForSAMLPopup) {
16147
16124
  this.embedConfig.authTriggerContainer = domSelector;
16148
16125
  }
@@ -16175,7 +16152,6 @@ class TsEmbed {
16175
16152
  */
16176
16153
  getEventType(event) {
16177
16154
  var _a, _b;
16178
- // eslint-disable-next-line no-underscore-dangle
16179
16155
  return ((_a = event.data) === null || _a === void 0 ? void 0 : _a.type) || ((_b = event.data) === null || _b === void 0 ? void 0 : _b.__type);
16180
16156
  }
16181
16157
  /**
@@ -16314,6 +16290,43 @@ class TsEmbed {
16314
16290
  async getAppInitData() {
16315
16291
  return this.getDefaultAppInitData();
16316
16292
  }
16293
+ getPreRenderObj() {
16294
+ var _a;
16295
+ const embedObj = (_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a[this.embedNodeKey];
16296
+ if (embedObj === this) {
16297
+ logger$3.info('embedObj is same as this');
16298
+ }
16299
+ return embedObj;
16300
+ }
16301
+ checkEmbedContainerLoaded() {
16302
+ if (this.isEmbedContainerLoaded)
16303
+ return true;
16304
+ const preRenderObj = this.getPreRenderObj();
16305
+ if (preRenderObj && preRenderObj.isEmbedContainerLoaded) {
16306
+ this.isEmbedContainerLoaded = true;
16307
+ }
16308
+ return this.isEmbedContainerLoaded;
16309
+ }
16310
+ executePendingEvents() {
16311
+ logger$3.debug('executePendingEvents', this.pendingEvents);
16312
+ setTimeout(() => {
16313
+ this.pendingEvents.forEach((event) => {
16314
+ var _a;
16315
+ this.trigger(event.eventType, event.data);
16316
+ (_a = event.onEventTriggered) === null || _a === void 0 ? void 0 : _a.call(event);
16317
+ });
16318
+ this.pendingEvents = [];
16319
+ }, 1000);
16320
+ }
16321
+ triggerAfterLoad(eventType, data, onEventTriggered) {
16322
+ if (this.checkEmbedContainerLoaded()) {
16323
+ this.trigger(eventType, data);
16324
+ onEventTriggered === null || onEventTriggered === void 0 ? void 0 : onEventTriggered();
16325
+ }
16326
+ else {
16327
+ this.pendingEvents.push({ eventType, data, onEventTriggered });
16328
+ }
16329
+ }
16317
16330
  /**
16318
16331
  * Constructs the base URL string to load the ThoughtSpot app.
16319
16332
  * @param query
@@ -16328,6 +16341,11 @@ class TsEmbed {
16328
16341
  .join('/');
16329
16342
  return `${basePath}#`;
16330
16343
  }
16344
+ getUpdateEmbedParamsObject() {
16345
+ let queryParams = this.getEmbedParamsObject();
16346
+ queryParams = { ...this.viewConfig, ...queryParams };
16347
+ return queryParams;
16348
+ }
16331
16349
  /**
16332
16350
  * Common query params set for all the embed modes.
16333
16351
  * @param queryParams
@@ -16477,9 +16495,13 @@ class TsEmbed {
16477
16495
  return path;
16478
16496
  }
16479
16497
  getEmbedParams() {
16480
- const queryParams = this.getBaseQueryParams();
16498
+ const queryParams = this.getEmbedParamsObject();
16481
16499
  return getQueryParamString(queryParams);
16482
16500
  }
16501
+ getEmbedParamsObject() {
16502
+ const params = this.getBaseQueryParams();
16503
+ return params;
16504
+ }
16483
16505
  getRootIframeSrc() {
16484
16506
  const query = this.getEmbedParams();
16485
16507
  return this.getEmbedBasePath(query);
@@ -16578,7 +16600,8 @@ class TsEmbed {
16578
16600
  }
16579
16601
  });
16580
16602
  }
16581
- // Setup fullscreen change handler after iframe is loaded and ready
16603
+ // Setup fullscreen change handler after iframe is
16604
+ // loaded and ready
16582
16605
  this.setupFullscreenChangeHandler();
16583
16606
  });
16584
16607
  this.iFrame.addEventListener('error', () => {
@@ -16680,7 +16703,6 @@ class TsEmbed {
16680
16703
  const div = document.createElement('div');
16681
16704
  div.innerHTML = child;
16682
16705
  div.id = TS_EMBED_ID;
16683
- // eslint-disable-next-line no-param-reassign
16684
16706
  child = div;
16685
16707
  }
16686
16708
  if (((_a = this.el.nextElementSibling) === null || _a === void 0 ? void 0 : _a.id) === TS_EMBED_ID) {
@@ -17003,7 +17025,10 @@ class TsEmbed {
17003
17025
  return this.preRender(true);
17004
17026
  }
17005
17027
  this.validatePreRenderViewConfig(this.viewConfig);
17028
+ logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
17029
+ this.triggerAfterLoad(HostEvent.UpdateEmbedParams, this.getUpdateEmbedParamsObject());
17006
17030
  }
17031
+ this.beforePrerenderVisible();
17007
17032
  if (this.el) {
17008
17033
  this.syncPreRenderStyle();
17009
17034
  if (!this.viewConfig.doNotTrackPreRenderSize) {
@@ -17020,7 +17045,6 @@ class TsEmbed {
17020
17045
  this.resizeObserver.observe(this.el);
17021
17046
  }
17022
17047
  }
17023
- this.beforePrerenderVisible();
17024
17048
  removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events']);
17025
17049
  this.subscribeToEvents();
17026
17050
  // Setup fullscreen change handler for prerendered components
@@ -17113,7 +17137,8 @@ class TsEmbed {
17113
17137
  const isFullscreen = !!document.fullscreenElement;
17114
17138
  if (!isFullscreen) {
17115
17139
  logger$3.info('Exited fullscreen mode - triggering ExitPresentMode');
17116
- // Only trigger if iframe is available and contentWindow is accessible
17140
+ // Only trigger if iframe is available and contentWindow is
17141
+ // accessible
17117
17142
  if (this.iFrame && this.iFrame.contentWindow) {
17118
17143
  this.trigger(HostEvent.ExitPresentMode);
17119
17144
  }
@@ -17147,7 +17172,6 @@ class V1Embed extends TsEmbed {
17147
17172
  * Only for testing purposes.
17148
17173
  * @hidden
17149
17174
  */
17150
- // eslint-disable-next-line camelcase
17151
17175
  this.test__executeCallbacks = this.executeCallbacks;
17152
17176
  this.viewConfig = { excludeRuntimeFiltersfromURL: false, ...viewConfig };
17153
17177
  }
@@ -17209,15 +17233,9 @@ let SearchBarEmbed$1 = class SearchBarEmbed extends TsEmbed {
17209
17233
  this.embedComponentType = 'SearchBarEmbed';
17210
17234
  this.viewConfig = viewConfig;
17211
17235
  }
17212
- /**
17213
- * Construct the URL of the embedded ThoughtSpot search to be
17214
- * loaded in the iframe
17215
- * @param dataSources A list of data source GUIDs
17216
- */
17217
- getIFrameSrc() {
17236
+ getEmbedParamsObject() {
17218
17237
  var _a;
17219
17238
  const { searchOptions, dataSource, dataSources, useLastSelectedSources = false, excludeSearchTokenStringFromURL, } = this.viewConfig;
17220
- const path = 'search-bar-embed';
17221
17239
  const queryParams = this.getBaseQueryParams();
17222
17240
  queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
17223
17241
  if (dataSources && dataSources.length) {
@@ -17239,6 +17257,16 @@ let SearchBarEmbed$1 = class SearchBarEmbed extends TsEmbed {
17239
17257
  queryParams[Param.UseLastSelectedDataSource] = false;
17240
17258
  }
17241
17259
  queryParams[Param.searchEmbed] = true;
17260
+ return queryParams;
17261
+ }
17262
+ /**
17263
+ * Construct the URL of the embedded ThoughtSpot search to be
17264
+ * loaded in the iframe
17265
+ * @param dataSources A list of data source GUIDs
17266
+ */
17267
+ getIFrameSrc() {
17268
+ const queryParams = this.getEmbedParamsObject();
17269
+ const path = 'search-bar-embed';
17242
17270
  let query = '';
17243
17271
  const queryParamsString = getQueryParamString(queryParams, true);
17244
17272
  if (queryParamsString) {
@@ -17289,12 +17317,7 @@ let SageEmbed$1 = class SageEmbed extends V1Embed {
17289
17317
  viewConfig.embedComponentType = 'SageEmbed';
17290
17318
  super(domSelector, viewConfig);
17291
17319
  }
17292
- /**
17293
- * Constructs a map of parameters to be passed on to the
17294
- * embedded Eureka or Sage search page.
17295
- * @returns {string} query string
17296
- */
17297
- getEmbedParams() {
17320
+ getEmbedParamsObject() {
17298
17321
  const { disableWorksheetChange, hideWorksheetSelector, showObjectSuggestions, dataPanelV2, hideSampleQuestions, isProductTour, hideSageAnswerHeader, hideAutocompleteSuggestions, } = this.viewConfig;
17299
17322
  const params = this.getBaseQueryParams();
17300
17323
  params[Param.DataPanelV2Enabled] = !!dataPanelV2;
@@ -17309,6 +17332,15 @@ let SageEmbed$1 = class SageEmbed extends V1Embed {
17309
17332
  params[Param.HideSampleQuestions] = !!hideSampleQuestions;
17310
17333
  params[Param.IsProductTour] = !!isProductTour;
17311
17334
  params[Param.HideSageAnswerHeader] = !!hideSageAnswerHeader;
17335
+ return params;
17336
+ }
17337
+ /**
17338
+ * Constructs a map of parameters to be passed on to the
17339
+ * embedded Eureka or Sage search page.
17340
+ * @returns {string} query string
17341
+ */
17342
+ getEmbedParams() {
17343
+ const params = this.getEmbedParamsObject();
17312
17344
  return getQueryParamString(params, true);
17313
17345
  }
17314
17346
  /**
@@ -17418,11 +17450,9 @@ let SearchEmbed$1 = class SearchEmbed extends TsEmbed {
17418
17450
  const defaultAppInitData = await super.getAppInitData();
17419
17451
  return { ...defaultAppInitData, ...this.getSearchInitData() };
17420
17452
  }
17421
- getEmbedParams() {
17453
+ getEmbedParamsObject() {
17422
17454
  var _a;
17423
- const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = false, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
17424
- /* eslint-disable-next-line max-len */
17425
- dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
17455
+ 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;
17426
17456
  const queryParams = this.getBaseQueryParams();
17427
17457
  queryParams[Param.HideActions] = [
17428
17458
  ...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
@@ -17455,7 +17485,6 @@ let SearchEmbed$1 = class SearchEmbed extends TsEmbed {
17455
17485
  queryParams[Param.HideSearchBar] = true;
17456
17486
  }
17457
17487
  if (isOnBeforeGetVizDataInterceptEnabled) {
17458
- /* eslint-disable-next-line max-len */
17459
17488
  queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
17460
17489
  }
17461
17490
  if (!focusSearchBarOnRender) {
@@ -17468,20 +17497,22 @@ let SearchEmbed$1 = class SearchEmbed extends TsEmbed {
17468
17497
  queryParams[Param.UseLastSelectedDataSource] = false;
17469
17498
  }
17470
17499
  queryParams[Param.searchEmbed] = true;
17471
- /* eslint-disable-next-line max-len */
17472
17500
  queryParams[Param.CollapseSearchBarInitially] = collapseSearchBarInitially || collapseSearchBar;
17473
17501
  queryParams[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
17474
17502
  if (dataPanelCustomGroupsAccordionInitialState
17475
17503
  === DataPanelCustomColumnGroupsAccordionState$1.COLLAPSE_ALL
17476
17504
  || dataPanelCustomGroupsAccordionInitialState
17477
17505
  === DataPanelCustomColumnGroupsAccordionState$1.EXPAND_FIRST) {
17478
- /* eslint-disable-next-line max-len */
17479
17506
  queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
17480
17507
  }
17481
17508
  else {
17482
- /* eslint-disable-next-line max-len */
17483
17509
  queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL;
17484
17510
  }
17511
+ return queryParams;
17512
+ }
17513
+ getEmbedParams() {
17514
+ const { runtimeParameters, runtimeFilters, excludeRuntimeParametersfromURL, excludeRuntimeFiltersfromURL, } = this.viewConfig;
17515
+ const queryParams = this.getEmbedParamsObject();
17485
17516
  let query = '';
17486
17517
  const queryParamsString = getQueryParamString(queryParams, true);
17487
17518
  if (queryParamsString) {
@@ -18074,6 +18105,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
18074
18105
  }
18075
18106
  this.setIFrameHeight(frameHeight || this.defaultHeight);
18076
18107
  };
18108
+ this.currentLiveboardId = this.viewConfig.liveboardId;
18077
18109
  if (this.viewConfig.fullHeight === true) {
18078
18110
  if (this.viewConfig.vizId) {
18079
18111
  logger$3.warn('Full height is currently only supported for Liveboard embeds.' +
@@ -18090,6 +18122,11 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
18090
18122
  * embedded Liveboard or visualization.
18091
18123
  */
18092
18124
  getEmbedParams() {
18125
+ const params = this.getEmbedParamsObject();
18126
+ const queryParams = getQueryParamString(params, true);
18127
+ return queryParams;
18128
+ }
18129
+ getEmbedParamsObject() {
18093
18130
  let params = {};
18094
18131
  params = this.getBaseQueryParams(params);
18095
18132
  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;
@@ -18159,8 +18196,27 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
18159
18196
  params[Param.DataPanelV2Enabled] = dataPanelV2;
18160
18197
  params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
18161
18198
  params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
18162
- const queryParams = getQueryParamString(params, true);
18163
- return queryParams;
18199
+ if (oAuthPollingInterval !== undefined) {
18200
+ params[Param.OauthPollingInterval] = oAuthPollingInterval;
18201
+ }
18202
+ if (isForceRedirect) {
18203
+ params[Param.IsForceRedirect] = isForceRedirect;
18204
+ }
18205
+ if (dataSourceId !== undefined) {
18206
+ params[Param.DataSourceId] = dataSourceId;
18207
+ }
18208
+ if (isLiveboardStylingAndGroupingEnabled !== undefined) {
18209
+ params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
18210
+ }
18211
+ params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
18212
+ params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
18213
+ params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
18214
+ params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
18215
+ params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
18216
+ params[Param.DataPanelV2Enabled] = dataPanelV2;
18217
+ params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
18218
+ params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
18219
+ return params;
18164
18220
  }
18165
18221
  getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
18166
18222
  let suffix = `/embed/viz/${liveboardId}`;
@@ -18222,16 +18278,12 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
18222
18278
  }
18223
18279
  }
18224
18280
  beforePrerenderVisible() {
18225
- var _a;
18226
- const embedObj = (_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a[this.embedNodeKey];
18227
- if (isUndefined$1(embedObj))
18228
- return;
18229
- const showDifferentLib = this.viewConfig.liveboardId
18230
- && embedObj.viewConfig.liveboardId !== this.viewConfig.liveboardId;
18231
- if (showDifferentLib) {
18232
- const libId = this.viewConfig.liveboardId;
18233
- this.navigateToLiveboard(libId);
18234
- }
18281
+ const embedObj = this.getPreRenderObj();
18282
+ const libId = this.currentLiveboardId;
18283
+ this.navigateToLiveboard(libId, this.viewConfig.vizId, this.viewConfig.activeTabId, () => {
18284
+ if (embedObj)
18285
+ embedObj.currentLiveboardId = libId;
18286
+ });
18235
18287
  }
18236
18288
  async handleRenderForPrerender() {
18237
18289
  if (isUndefined$1(this.viewConfig.liveboardId)) {
@@ -18293,13 +18345,13 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
18293
18345
  this.postRender();
18294
18346
  return this;
18295
18347
  }
18296
- navigateToLiveboard(liveboardId, vizId, activeTabId) {
18348
+ navigateToLiveboard(liveboardId, vizId, activeTabId, onNavigateCalled) {
18297
18349
  const path = this.getIframeSuffixSrc(liveboardId, vizId, activeTabId);
18298
18350
  this.viewConfig.liveboardId = liveboardId;
18299
18351
  this.viewConfig.activeTabId = activeTabId;
18300
18352
  this.viewConfig.vizId = vizId;
18301
18353
  if (this.isRendered) {
18302
- this.trigger(HostEvent.Navigate, path.substring(1));
18354
+ this.triggerAfterLoad(HostEvent.Navigate, path.substring(1), onNavigateCalled);
18303
18355
  }
18304
18356
  else if (this.viewConfig.preRenderId) {
18305
18357
  this.preRender(true);
@@ -18717,13 +18769,17 @@ let ConversationMessage$1 = class ConversationMessage extends TsEmbed {
18717
18769
  super(container, viewConfig);
18718
18770
  this.viewConfig = viewConfig;
18719
18771
  }
18720
- getIframeSrc() {
18772
+ getEmbedParamsObject() {
18721
18773
  var _a;
18722
- const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
18723
- const path = 'conv-assist-answer';
18724
18774
  const queryParams = this.getBaseQueryParams();
18725
18775
  queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
18726
18776
  queryParams[Param.isSpotterAgentEmbed] = true;
18777
+ return queryParams;
18778
+ }
18779
+ getIframeSrc() {
18780
+ const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
18781
+ const path = 'conv-assist-answer';
18782
+ const queryParams = this.getEmbedParamsObject();
18727
18783
  let query = '';
18728
18784
  const queryParamsString = getQueryParamString(queryParams, true);
18729
18785
  if (queryParamsString) {
@@ -18879,9 +18935,8 @@ let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
18879
18935
  super(container, viewConfig);
18880
18936
  this.viewConfig = viewConfig;
18881
18937
  }
18882
- getIframeSrc() {
18938
+ getEmbedParamsObject() {
18883
18939
  const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, } = this.viewConfig;
18884
- const path = 'insights/conv-assist';
18885
18940
  if (!worksheetId) {
18886
18941
  this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
18887
18942
  }
@@ -18902,6 +18957,12 @@ let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
18902
18957
  if (!isUndefined_1(hideSampleQuestions)) {
18903
18958
  queryParams[Param.HideSampleQuestions] = !!hideSampleQuestions;
18904
18959
  }
18960
+ return queryParams;
18961
+ }
18962
+ getIframeSrc() {
18963
+ const { worksheetId, searchOptions, } = this.viewConfig;
18964
+ const path = 'insights/conv-assist';
18965
+ const queryParams = this.getEmbedParamsObject();
18905
18966
  let query = '';
18906
18967
  const queryParamsString = getQueryParamString(queryParams, true);
18907
18968
  if (queryParamsString) {