@thoughtspot/visual-embed-sdk 1.42.0 → 1.42.1-HE2.0

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 (116) hide show
  1. package/cjs/package.json +2 -2
  2. package/cjs/src/embed/app.d.ts +20 -0
  3. package/cjs/src/embed/app.d.ts.map +1 -1
  4. package/cjs/src/embed/app.js +7 -1
  5. package/cjs/src/embed/app.js.map +1 -1
  6. package/cjs/src/embed/app.spec.js +52 -0
  7. package/cjs/src/embed/app.spec.js.map +1 -1
  8. package/cjs/src/embed/hostEventClient/contracts.d.ts +9 -2
  9. package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  10. package/cjs/src/embed/hostEventClient/contracts.js +9 -1
  11. package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
  12. package/cjs/src/embed/hostEventClient/host-event-client.d.ts +5 -5
  13. package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  14. package/cjs/src/embed/hostEventClient/host-event-client.js +6 -6
  15. package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
  16. package/cjs/src/embed/liveboard.d.ts +2 -2
  17. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  18. package/cjs/src/embed/liveboard.js +6 -3
  19. package/cjs/src/embed/liveboard.js.map +1 -1
  20. package/cjs/src/embed/liveboard.spec.js +22 -0
  21. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  22. package/cjs/src/embed/ts-embed.d.ts +15 -2
  23. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  24. package/cjs/src/embed/ts-embed.js +63 -23
  25. package/cjs/src/embed/ts-embed.js.map +1 -1
  26. package/cjs/src/embed/ts-embed.spec.js +83 -0
  27. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  28. package/cjs/src/errors.d.ts +1 -0
  29. package/cjs/src/errors.d.ts.map +1 -1
  30. package/cjs/src/errors.js +1 -0
  31. package/cjs/src/errors.js.map +1 -1
  32. package/cjs/src/types.d.ts +119 -61
  33. package/cjs/src/types.d.ts.map +1 -1
  34. package/cjs/src/types.js +103 -60
  35. package/cjs/src/types.js.map +1 -1
  36. package/cjs/src/utils/processTrigger.d.ts +3 -1
  37. package/cjs/src/utils/processTrigger.d.ts.map +1 -1
  38. package/cjs/src/utils/processTrigger.js +4 -2
  39. package/cjs/src/utils/processTrigger.js.map +1 -1
  40. package/dist/{index-BpSohedu.js → index-CWQnMX2L.js} +1 -1
  41. package/dist/index-Djtv-y7A.js +7371 -0
  42. package/dist/index-UY-4yjBN.js +7371 -0
  43. package/dist/src/embed/app.d.ts +20 -0
  44. package/dist/src/embed/app.d.ts.map +1 -1
  45. package/dist/src/embed/hostEventClient/contracts.d.ts +9 -2
  46. package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  47. package/dist/src/embed/hostEventClient/host-event-client.d.ts +5 -5
  48. package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  49. package/dist/src/embed/liveboard.d.ts +2 -2
  50. package/dist/src/embed/liveboard.d.ts.map +1 -1
  51. package/dist/src/embed/ts-embed.d.ts +15 -2
  52. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  53. package/dist/src/errors.d.ts +1 -0
  54. package/dist/src/errors.d.ts.map +1 -1
  55. package/dist/src/types.d.ts +119 -61
  56. package/dist/src/types.d.ts.map +1 -1
  57. package/dist/src/utils/processTrigger.d.ts +3 -1
  58. package/dist/src/utils/processTrigger.d.ts.map +1 -1
  59. package/dist/tsembed-react.es.js +202 -99
  60. package/dist/tsembed-react.js +201 -98
  61. package/dist/tsembed.es.js +202 -99
  62. package/dist/tsembed.js +201 -98
  63. package/dist/visual-embed-sdk-react-full.d.ts +164 -68
  64. package/dist/visual-embed-sdk-react.d.ts +164 -68
  65. package/dist/visual-embed-sdk.d.ts +164 -68
  66. package/lib/package.json +2 -2
  67. package/lib/src/embed/app.d.ts +20 -0
  68. package/lib/src/embed/app.d.ts.map +1 -1
  69. package/lib/src/embed/app.js +7 -1
  70. package/lib/src/embed/app.js.map +1 -1
  71. package/lib/src/embed/app.spec.js +52 -0
  72. package/lib/src/embed/app.spec.js.map +1 -1
  73. package/lib/src/embed/hostEventClient/contracts.d.ts +9 -2
  74. package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  75. package/lib/src/embed/hostEventClient/contracts.js +8 -0
  76. package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
  77. package/lib/src/embed/hostEventClient/host-event-client.d.ts +5 -5
  78. package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  79. package/lib/src/embed/hostEventClient/host-event-client.js +6 -6
  80. package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
  81. package/lib/src/embed/liveboard.d.ts +2 -2
  82. package/lib/src/embed/liveboard.d.ts.map +1 -1
  83. package/lib/src/embed/liveboard.js +6 -3
  84. package/lib/src/embed/liveboard.js.map +1 -1
  85. package/lib/src/embed/liveboard.spec.js +22 -0
  86. package/lib/src/embed/liveboard.spec.js.map +1 -1
  87. package/lib/src/embed/ts-embed.d.ts +15 -2
  88. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  89. package/lib/src/embed/ts-embed.js +63 -23
  90. package/lib/src/embed/ts-embed.js.map +1 -1
  91. package/lib/src/embed/ts-embed.spec.js +83 -0
  92. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  93. package/lib/src/errors.d.ts +1 -0
  94. package/lib/src/errors.d.ts.map +1 -1
  95. package/lib/src/errors.js +1 -0
  96. package/lib/src/errors.js.map +1 -1
  97. package/lib/src/types.d.ts +119 -61
  98. package/lib/src/types.d.ts.map +1 -1
  99. package/lib/src/types.js +103 -60
  100. package/lib/src/types.js.map +1 -1
  101. package/lib/src/utils/processTrigger.d.ts +3 -1
  102. package/lib/src/utils/processTrigger.d.ts.map +1 -1
  103. package/lib/src/utils/processTrigger.js +4 -2
  104. package/lib/src/utils/processTrigger.js.map +1 -1
  105. package/package.json +2 -2
  106. package/src/embed/app.spec.ts +73 -0
  107. package/src/embed/app.ts +30 -0
  108. package/src/embed/hostEventClient/contracts.ts +11 -3
  109. package/src/embed/hostEventClient/host-event-client.ts +10 -5
  110. package/src/embed/liveboard.spec.ts +30 -0
  111. package/src/embed/liveboard.ts +10 -4
  112. package/src/embed/ts-embed.spec.ts +111 -0
  113. package/src/embed/ts-embed.ts +79 -27
  114. package/src/errors.ts +1 -0
  115. package/src/types.ts +119 -61
  116. package/src/utils/processTrigger.ts +6 -2
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.42.0 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.42.1-HE2.0 */
2
2
  'use client';
3
3
  import * as React from 'react';
4
4
  import React__default, { useRef, useCallback } from 'react';
@@ -614,7 +614,7 @@ var EmbedEvent;
614
614
  */
615
615
  EmbedEvent["Load"] = "load";
616
616
  /**
617
- * Data pertaining to an Answer or Liveboard is received.
617
+ * Data pertaining to an Answer, Liveboard or Spotter visualization is received.
618
618
  * The event payload includes the raw data of the object.
619
619
  * @return data - Answer of Liveboard data
620
620
  * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
@@ -1985,7 +1985,7 @@ var HostEvent;
1985
1985
  * the following parameters:
1986
1986
  *
1987
1987
  * @param
1988
- * `vizId`- GUID of the saved Answer or visualization to pin to a Liveboard.
1988
+ * `vizId`- GUID of the saved Answer or Spotter visualization ID to pin to a Liveboard.
1989
1989
  * Optional when pinning a new chart or table generated from a Search query.
1990
1990
  * **Required** in Spotter Embed.
1991
1991
  * @param
@@ -2037,10 +2037,16 @@ var HostEvent;
2037
2037
  * ```
2038
2038
  * @example
2039
2039
  * ```js
2040
- * const pinResponse = await spotterEmbed.trigger(HostEvent.Pin, {
2041
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2042
- * });
2043
- * ```
2040
+
2041
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in Pin host event.
2042
+ * let latestSpotterVizId = '';
2043
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
2044
+ * latestSpotterVizId = payload.data.id;
2045
+ * });
2046
+ *
2047
+ * spotterEmbed.trigger(HostEvent.Pin, { vizId: latestSpotterVizId });
2048
+ * ```
2049
+ *
2044
2050
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2045
2051
  */
2046
2052
  HostEvent["Pin"] = "pin";
@@ -2115,10 +2121,15 @@ var HostEvent;
2115
2121
  * ```
2116
2122
  * @example
2117
2123
  * ```js
2118
- * spotterEmbed.trigger(HostEvent.DownloadAsPdf, {
2119
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2120
- * });
2121
- * ```
2124
+
2125
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsPdf host event.
2126
+ * let latestSpotterVizId = '';
2127
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
2128
+ * latestSpotterVizId = payload.data.id;
2129
+ * });
2130
+ *
2131
+ * spotterEmbed.trigger(HostEvent.DownloadAsPdf, { vizId: latestSpotterVizId });
2132
+ * ```
2122
2133
  *
2123
2134
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2124
2135
  */
@@ -2145,10 +2156,14 @@ var HostEvent;
2145
2156
  * ```
2146
2157
  * @example
2147
2158
  * ```js
2148
- * const pinResponse = await spotterEmbed.trigger(HostEvent.MakeACopy, {
2149
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2150
- * });
2151
- * ```
2159
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in MakeACopy host event.
2160
+ * let latestSpotterVizId = '';
2161
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
2162
+ * latestSpotterVizId = payload.data.id;
2163
+ * });
2164
+ *
2165
+ * spotterEmbed.trigger(HostEvent.MakeACopy, { vizId: latestSpotterVizId });
2166
+ * ```
2152
2167
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2153
2168
  */
2154
2169
  HostEvent["MakeACopy"] = "makeACopy";
@@ -2233,15 +2248,7 @@ var HostEvent;
2233
2248
  * ```
2234
2249
  * @example
2235
2250
  * ```js
2236
- * const pinResponse = await spotterEmbed.trigger(HostEvent.Edit, {
2237
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2238
- * });
2239
- * ```
2240
- * @example
2241
- * ```js
2242
- * const editResponse = await spotterEmbed.trigger(HostEvent.Edit, {
2243
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2244
- * });
2251
+ * spotterEmbed.trigger(HostEvent.Edit);
2245
2252
  * ```
2246
2253
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2247
2254
  */
@@ -2290,16 +2297,23 @@ var HostEvent;
2290
2297
  * );
2291
2298
  * })
2292
2299
  * ```
2293
- * @example
2300
+ * * @example
2294
2301
  * ```js
2295
- * spotterEmbed.trigger(HostEvent.GetTML, {
2296
- * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2302
+
2303
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in Pin host event.
2304
+ * let latestSpotterVizId = '';
2305
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
2306
+ * latestSpotterVizId = payload.data.id;
2307
+ * });
2308
+ *
2309
+ * spotterEmbed.trigger(HostEvent.GetTML, {
2310
+ * vizId: latestSpotterVizId
2297
2311
  * }).then((tml) => {
2298
2312
  * console.log(
2299
2313
  * tml.answer.search_query // TML representation of the search query
2300
2314
  * );
2301
2315
  * })
2302
- * ```
2316
+ * ```
2303
2317
  * @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
2304
2318
  * @important
2305
2319
  */
@@ -2363,7 +2377,7 @@ var HostEvent;
2363
2377
  /**
2364
2378
  * Trigger the **Download** action on charts in
2365
2379
  * the embedded view.
2366
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2380
+ * @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
2367
2381
  * @example
2368
2382
  * ```js
2369
2383
  * liveboardEmbed.trigger(HostEvent.Download, {vizId:
@@ -2373,10 +2387,14 @@ var HostEvent;
2373
2387
  * embed.trigger(HostEvent.Download)
2374
2388
  * ```
2375
2389
  * ```js
2376
- * spotterEmbed.trigger(HostEvent.Download, {
2377
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2378
- * });
2379
- * ```
2390
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in Download host event.
2391
+ * let latestSpotterVizId = '';
2392
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
2393
+ * latestSpotterVizId = payload.data.id;
2394
+ * });
2395
+ *
2396
+ * spotterEmbed.trigger(HostEvent.Download, { vizId: latestSpotterVizId });
2397
+ * ```
2380
2398
  * @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw
2381
2399
  * Use {@link DownloadAsPng}
2382
2400
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
@@ -2394,9 +2412,13 @@ var HostEvent;
2394
2412
  *
2395
2413
  * searchEmbed.trigger(HostEvent.DownloadAsPng)
2396
2414
  *
2397
- * spotterEmbed.trigger(HostEvent.DownloadAsPng, {
2398
- * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2399
- * })
2415
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsPng host event.
2416
+ * let latestSpotterVizId = '';
2417
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
2418
+ * latestSpotterVizId = payload.data.id;
2419
+ * });
2420
+ *
2421
+ * spotterEmbed.trigger(HostEvent.DownloadAsPng, { vizId: latestSpotterVizId });
2400
2422
  * ```
2401
2423
  *
2402
2424
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
@@ -2405,7 +2427,7 @@ var HostEvent;
2405
2427
  /**
2406
2428
  * Trigger the **Download** > **CSV** action on tables in
2407
2429
  * the embedded view.
2408
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2430
+ * @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
2409
2431
  * @example
2410
2432
  * ```js
2411
2433
  * liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:
@@ -2418,9 +2440,13 @@ var HostEvent;
2418
2440
  * searchEmbed.trigger(HostEvent.DownloadAsCsv)
2419
2441
  * ```
2420
2442
  * ```js
2421
- * spotterEmbed.trigger(HostEvent.DownloadAsCsv, {
2422
- * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2423
- * })
2443
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsCsv host event.
2444
+ * let latestSpotterVizId = '';
2445
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
2446
+ * latestSpotterVizId = payload.data.id;
2447
+ * });
2448
+ *
2449
+ * spotterEmbed.trigger(HostEvent.DownloadAsCsv, { vizId: latestSpotterVizId });
2424
2450
  * ```
2425
2451
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2426
2452
  */
@@ -2428,7 +2454,7 @@ var HostEvent;
2428
2454
  /**
2429
2455
  * Trigger the **Download** > **XLSX** action on tables
2430
2456
  * in the embedded view.
2431
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2457
+ * @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
2432
2458
  * @example
2433
2459
  * ```js
2434
2460
  * liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:
@@ -2441,9 +2467,13 @@ var HostEvent;
2441
2467
  * searchEmbed.trigger(HostEvent.DownloadAsXlsx)
2442
2468
  * ```
2443
2469
  * ```js
2444
- * spotterEmbed.trigger(HostEvent.downloadAsXLSX, {
2445
- * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2446
- * })
2470
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsXlsx host event.
2471
+ * let latestSpotterVizId = '';
2472
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
2473
+ * latestSpotterVizId = payload.data.id;
2474
+ * });
2475
+ *
2476
+ * spotterEmbed.trigger(HostEvent.DownloadAsXlsx, { vizId: latestSpotterVizId });
2447
2477
  * ```
2448
2478
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2449
2479
  */
@@ -2480,7 +2510,7 @@ var HostEvent;
2480
2510
  * ```
2481
2511
  *
2482
2512
  * ```js
2483
- * // Save an Answer in Spotter (requires vizId)
2513
+ * // Save a Visualization in Spotter (requires vizId)
2484
2514
  * spotterEmbed.trigger(HostEvent.Save, {
2485
2515
  * vizId: "730496d6-6903-4601-937e-2c691821af3c"
2486
2516
  * })
@@ -2802,11 +2832,13 @@ var HostEvent;
2802
2832
  * });
2803
2833
  *```
2804
2834
  *```js
2805
- * spotterEmbed.trigger(HostEvent.GetParameters, {
2806
- * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2807
- * }).then((parameter) => {
2808
- * console.log('parameters', parameter);
2809
- * });
2835
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in GetParameters host event.
2836
+ * let latestSpotterVizId = '';
2837
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
2838
+ * latestSpotterVizId = payload.data.id;
2839
+ * });
2840
+ *
2841
+ * spotterEmbed.trigger(HostEvent.GetParameters, { vizId: latestSpotterVizId });
2810
2842
  *```
2811
2843
  * @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
2812
2844
  */
@@ -2849,11 +2881,13 @@ var HostEvent;
2849
2881
  * ```
2850
2882
  * @example
2851
2883
  * ```js
2852
- * const saveAnswerResponse = await spotterEmbed.trigger(HostEvent.SaveAnswer, {
2853
- * vizId: '730496d6-6903-4601-937e-2c691821af3c',
2854
- * name: "Sales by states",
2855
- * description: "Total sales by states in MidWest"
2884
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in SaveAnswer host event.
2885
+ * let latestSpotterVizId = '';
2886
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
2887
+ * latestSpotterVizId = payload.data.id;
2856
2888
  * });
2889
+ *
2890
+ * spotterEmbed.trigger(HostEvent.SaveAnswer, { vizId: latestSpotterVizId });
2857
2891
  * ```
2858
2892
  * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
2859
2893
  */
@@ -2937,12 +2971,15 @@ var HostEvent;
2937
2971
  HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
2938
2972
  /**
2939
2973
  * Toggle the visualization to chart or table view.
2940
- * @param - `vizId ` refers to the answer id in spotter Embed, it is required in spotter Embed.
2974
+ * @param - `vizId ` refers to the Visualization ID in Spotter embed and is required.
2941
2975
  * @example
2942
2976
  * ```js
2943
- * spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, {
2944
- * vizId:'b535c760-8bbe-4e6f-bb26-af56b4129a1e'
2977
+ * let latestSpotterVizId = '';
2978
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
2979
+ * latestSpotterVizId = payload.data.id;
2945
2980
  * });
2981
+ *
2982
+ * spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, { vizId: latestSpotterVizId });
2946
2983
  *```
2947
2984
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
2948
2985
  */
@@ -2971,12 +3008,16 @@ var HostEvent;
2971
3008
  */
2972
3009
  HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
2973
3010
  /**
2974
- * Trigger the *Ask Spotter* action for visualizations
2975
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
3011
+ * Trigger the *Spotter* action for visualizations present on the liveboard's vizzes.
3012
+ * @param - `vizId` refers to the Visualization ID in Spotter embed and is required.
2976
3013
  * @example
2977
3014
  * ```js
2978
- * spotterEmbed.trigger(HostEvent.AskSpotter,
2979
- * {vizId:'730496d6-6903-4601-937e-2c691821af3c'})
3015
+ * let latestSpotterVizId = '';
3016
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
3017
+ * latestSpotterVizId = payload.data.id;
3018
+ * });
3019
+ *
3020
+ * spotterEmbed.trigger(HostEvent.AskSpotter, { vizId: latestSpotterVizId });
2980
3021
  * ```
2981
3022
  * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
2982
3023
  */
@@ -3034,6 +3075,7 @@ var Param;
3034
3075
  Param["HideResult"] = "hideResult";
3035
3076
  Param["UseLastSelectedDataSource"] = "useLastSelectedSources";
3036
3077
  Param["Tag"] = "tag";
3078
+ Param["HideTagFilterChips"] = "hideTagFilterChips";
3037
3079
  Param["AutoLogin"] = "autoLogin";
3038
3080
  Param["searchTokenString"] = "searchTokenString";
3039
3081
  Param["executeSearch"] = "executeSearch";
@@ -3138,6 +3180,7 @@ var Param;
3138
3180
  Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
3139
3181
  Param["LiveboardXLSXCSVDownload"] = "isLiveboardXLSXCSVDownloadEnabled";
3140
3182
  Param["isPNGInScheduledEmailsEnabled"] = "isPNGInScheduledEmailsEnabled";
3183
+ Param["isLinkParametersEnabled"] = "isLinkParametersEnabled";
3141
3184
  })(Param || (Param = {}));
3142
3185
  /**
3143
3186
  * ThoughtSpot application pages include actions and menu commands
@@ -7347,6 +7390,7 @@ const ERROR_MESSAGE = {
7347
7390
  MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
7348
7391
  RENDER_CALLED_BEFORE_INIT: 'Looks like render was called before calling init, the render won\'t start until init is called.\nFor more info check\n1. https://developers.thoughtspot.com/docs/Function_init#_init\n2.https://developers.thoughtspot.com/docs/getting-started#initSdk',
7349
7392
  SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
7393
+ OFFLINE_WARNING: 'Network not Detected. Embed is offline. Please reconnect and refresh',
7350
7394
  };
7351
7395
  const CUSTOM_ACTIONS_ERROR_MESSAGE = {
7352
7396
  INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
@@ -8256,7 +8300,7 @@ class AnswerService {
8256
8300
  async getTML() {
8257
8301
  const { object } = await this.executeQuery(getAnswerTML, {});
8258
8302
  const edoc = object[0].edoc;
8259
- const YAML = await import('./index-BpSohedu.js');
8303
+ const YAML = await import('./index-UY-4yjBN.js');
8260
8304
  const parsedDoc = YAML.parse(edoc);
8261
8305
  return {
8262
8306
  answer: {
@@ -17429,7 +17473,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
17429
17473
  return e;
17430
17474
  }
17431
17475
 
17432
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.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 tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^11.2.0","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^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-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^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};
17476
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.1-HE2.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 tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run 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-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^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};
17433
17477
 
17434
17478
  /**
17435
17479
  * Reloads the ThoughtSpot iframe.
@@ -17448,6 +17492,7 @@ const reload = (iFrame) => {
17448
17492
  * @param message
17449
17493
  * @param message.type
17450
17494
  * @param message.data
17495
+ * @param message.context
17451
17496
  * @param thoughtSpotHost
17452
17497
  * @param channel
17453
17498
  */
@@ -17462,8 +17507,9 @@ const TRIGGER_TIMEOUT = 30000;
17462
17507
  * @param messageType
17463
17508
  * @param thoughtSpotHost
17464
17509
  * @param data
17510
+ * @param context
17465
17511
  */
17466
- function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
17512
+ function processTrigger(iFrame, messageType, thoughtSpotHost, data, context) {
17467
17513
  return new Promise((res, rej) => {
17468
17514
  var _a;
17469
17515
  if (messageType === HostEvent.Reload) {
@@ -17497,7 +17543,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
17497
17543
  channel.port1.close();
17498
17544
  res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
17499
17545
  }, TRIGGER_TIMEOUT);
17500
- return postIframeMessage(iFrame, { type: messageType, data }, thoughtSpotHost, channel);
17546
+ return postIframeMessage(iFrame, { type: messageType, data, context }, thoughtSpotHost, channel);
17501
17547
  });
17502
17548
  }
17503
17549
 
@@ -17509,7 +17555,15 @@ var UIPassthroughEvent;
17509
17555
  UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUiPassthroughs";
17510
17556
  UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
17511
17557
  UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
17512
- })(UIPassthroughEvent || (UIPassthroughEvent = {}));
17558
+ })(UIPassthroughEvent || (UIPassthroughEvent = {}));
17559
+ var ContextType;
17560
+ (function (ContextType) {
17561
+ ContextType["Search"] = "search";
17562
+ ContextType["Liveboard"] = "liveboard";
17563
+ ContextType["Answer"] = "answer";
17564
+ ContextType["Spotter"] = "spotter";
17565
+ ContextType["None"] = "";
17566
+ })(ContextType || (ContextType = {}));
17513
17567
 
17514
17568
  class HostEventClient {
17515
17569
  constructor(iFrame) {
@@ -17521,12 +17575,12 @@ class HostEventClient {
17521
17575
  * @param {any} data Data to send with the host event
17522
17576
  * @returns {Promise<any>} - the response from the process trigger
17523
17577
  */
17524
- async processTrigger(message, data) {
17578
+ async processTrigger(message, data, context) {
17525
17579
  if (!this.iFrame) {
17526
17580
  throw new Error('Iframe element is not set');
17527
17581
  }
17528
17582
  const thoughtspotHost = getEmbedConfig().thoughtSpotHost;
17529
- return processTrigger(this.iFrame, message, thoughtspotHost, data);
17583
+ return processTrigger(this.iFrame, message, thoughtspotHost, data, context);
17530
17584
  }
17531
17585
  async handleHostEventWithParam(apiName, parameters) {
17532
17586
  var _a, _b, _c, _d;
@@ -17545,8 +17599,8 @@ class HostEventClient {
17545
17599
  }
17546
17600
  return { ...response.value };
17547
17601
  }
17548
- async hostEventFallback(hostEvent, data) {
17549
- return this.processTrigger(hostEvent, data);
17602
+ async hostEventFallback(hostEvent, data, context) {
17603
+ return this.processTrigger(hostEvent, data, context);
17550
17604
  }
17551
17605
  /**
17552
17606
  * Setter for the iframe element used for host events
@@ -17590,14 +17644,14 @@ class HostEventClient {
17590
17644
  answerId: (_d = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.saveResponse) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.Answer__save) === null || _c === void 0 ? void 0 : _c.answer) === null || _d === void 0 ? void 0 : _d.id,
17591
17645
  };
17592
17646
  }
17593
- async triggerHostEvent(hostEvent, payload) {
17647
+ async triggerHostEvent(hostEvent, payload, context) {
17594
17648
  switch (hostEvent) {
17595
17649
  case HostEvent.Pin:
17596
17650
  return this.handlePinEvent(payload);
17597
17651
  case HostEvent.SaveAnswer:
17598
17652
  return this.handleSaveAnswerEvent(payload);
17599
17653
  default:
17600
- return this.hostEventFallback(hostEvent, payload);
17654
+ return this.hostEventFallback(hostEvent, payload, context);
17601
17655
  }
17602
17656
  }
17603
17657
  }
@@ -17899,39 +17953,69 @@ class TsEmbed {
17899
17953
  return eventData;
17900
17954
  }
17901
17955
  /**
17902
- * Adds a global event listener to window for "message" events.
17903
- * ThoughtSpot detects if a particular event is targeted to this
17904
- * embed instance through an identifier contained in the payload,
17905
- * and executes the registered callbacks accordingly.
17956
+ * Subscribe to network events (online/offline) that should
17957
+ * work regardless of auth status
17906
17958
  */
17907
- subscribeToEvents() {
17908
- this.unsubscribeToEvents();
17909
- const messageEventListener = (event) => {
17910
- const eventType = this.getEventType(event);
17911
- const eventPort = this.getEventPort(event);
17912
- const eventData = this.formatEventData(event, eventType);
17913
- if (event.source === this.iFrame.contentWindow) {
17914
- this.executeCallbacks(eventType, processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el), eventPort);
17915
- }
17916
- };
17917
- window.addEventListener('message', messageEventListener);
17959
+ subscribeToNetworkEvents() {
17960
+ this.unsubscribeToNetworkEvents();
17918
17961
  const onlineEventListener = (e) => {
17919
17962
  this.trigger(HostEvent.Reload);
17920
17963
  };
17921
17964
  window.addEventListener('online', onlineEventListener);
17922
17965
  const offlineEventListener = (e) => {
17923
- const offlineWarning = 'Network not Detected. Embed is offline. Please reconnect and refresh';
17966
+ const offlineWarning = ERROR_MESSAGE.OFFLINE_WARNING;
17924
17967
  this.executeCallbacks(EmbedEvent.Error, {
17925
17968
  offlineWarning,
17926
17969
  });
17927
17970
  logger$3.warn(offlineWarning);
17928
17971
  };
17929
17972
  window.addEventListener('offline', offlineEventListener);
17930
- this.subscribedListeners = {
17931
- message: messageEventListener,
17932
- online: onlineEventListener,
17933
- offline: offlineEventListener,
17973
+ this.subscribedListeners.online = onlineEventListener;
17974
+ this.subscribedListeners.offline = offlineEventListener;
17975
+ }
17976
+ /**
17977
+ * Subscribe to message events that depend on successful iframe setup
17978
+ */
17979
+ subscribeToMessageEvents() {
17980
+ this.unsubscribeToMessageEvents();
17981
+ const messageEventListener = (event) => {
17982
+ const eventType = this.getEventType(event);
17983
+ const eventPort = this.getEventPort(event);
17984
+ const eventData = this.formatEventData(event, eventType);
17985
+ if (event.source === this.iFrame.contentWindow) {
17986
+ this.executeCallbacks(eventType, processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el), eventPort);
17987
+ }
17934
17988
  };
17989
+ window.addEventListener('message', messageEventListener);
17990
+ this.subscribedListeners.message = messageEventListener;
17991
+ }
17992
+ /**
17993
+ * Adds event listeners for both network and message events.
17994
+ * This maintains backward compatibility with the existing method.
17995
+ * Adds a global event listener to window for "message" events.
17996
+ * ThoughtSpot detects if a particular event is targeted to this
17997
+ * embed instance through an identifier contained in the payload,
17998
+ * and executes the registered callbacks accordingly.
17999
+ */
18000
+ subscribeToEvents() {
18001
+ this.subscribeToNetworkEvents();
18002
+ this.subscribeToMessageEvents();
18003
+ }
18004
+ unsubscribeToNetworkEvents() {
18005
+ if (this.subscribedListeners.online) {
18006
+ window.removeEventListener('online', this.subscribedListeners.online);
18007
+ delete this.subscribedListeners.online;
18008
+ }
18009
+ if (this.subscribedListeners.offline) {
18010
+ window.removeEventListener('offline', this.subscribedListeners.offline);
18011
+ delete this.subscribedListeners.offline;
18012
+ }
18013
+ }
18014
+ unsubscribeToMessageEvents() {
18015
+ if (this.subscribedListeners.message) {
18016
+ window.removeEventListener('message', this.subscribedListeners.message);
18017
+ delete this.subscribedListeners.message;
18018
+ }
17935
18019
  }
17936
18020
  unsubscribeToEvents() {
17937
18021
  Object.keys(this.subscribedListeners).forEach((key) => {
@@ -18232,6 +18316,8 @@ class TsEmbed {
18232
18316
  type: EmbedEvent.Init,
18233
18317
  });
18234
18318
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_START);
18319
+ // Always subscribe to network events, regardless of auth status
18320
+ this.subscribeToNetworkEvents();
18235
18321
  return (_a = getAuthPromise()) === null || _a === void 0 ? void 0 : _a.then((isLoggedIn) => {
18236
18322
  if (!isLoggedIn) {
18237
18323
  this.handleInsertionIntoDOM(this.embedConfig.loginFailedMessage);
@@ -18274,7 +18360,9 @@ class TsEmbed {
18274
18360
  el.remove();
18275
18361
  });
18276
18362
  }
18277
- this.subscribeToEvents();
18363
+ // Subscribe to message events only after successful
18364
+ // auth and iframe setup
18365
+ this.subscribeToMessageEvents();
18278
18366
  }).catch((error) => {
18279
18367
  nextInQueue();
18280
18368
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_FAILED, {
@@ -18584,7 +18672,7 @@ class TsEmbed {
18584
18672
  * @param {any} data The payload to send with the message
18585
18673
  * @returns A promise that resolves with the response from the embedded app
18586
18674
  */
18587
- async trigger(messageType, data = {}) {
18675
+ async trigger(messageType, data = {}, context) {
18588
18676
  uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
18589
18677
  if (!this.isRendered) {
18590
18678
  this.handleError('Please call render before triggering events');
@@ -18594,8 +18682,14 @@ class TsEmbed {
18594
18682
  this.handleError('Host event type is undefined');
18595
18683
  return null;
18596
18684
  }
18685
+ // Check if iframe exists before triggering -
18686
+ // this prevents the error when auth fails
18687
+ if (!this.iFrame) {
18688
+ logger$3.debug(`Cannot trigger ${messageType} - iframe not available (likely due to auth failure)`);
18689
+ return null;
18690
+ }
18597
18691
  // send an empty object, this is needed for liveboard default handlers
18598
- return this.hostEventClient.triggerHostEvent(messageType, data);
18692
+ return this.hostEventClient.triggerHostEvent(messageType, data, context);
18599
18693
  }
18600
18694
  /**
18601
18695
  * Triggers an event to the embedded app, skipping the UI flow.
@@ -19448,7 +19542,7 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
19448
19542
  * embedded Liveboard or visualization.
19449
19543
  */
19450
19544
  getEmbedParams() {
19451
- const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, } = this.viewConfig;
19545
+ const { tag, hideTagFilterChips, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isLinkParametersEnabled, } = this.viewConfig;
19452
19546
  let params = {};
19453
19547
  params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
19454
19548
  params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
@@ -19516,6 +19610,12 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
19516
19610
  if (isPNGInScheduledEmailsEnabled !== undefined) {
19517
19611
  params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
19518
19612
  }
19613
+ if (hideTagFilterChips !== undefined) {
19614
+ params[Param.HideTagFilterChips] = hideTagFilterChips;
19615
+ }
19616
+ if (isLinkParametersEnabled !== undefined) {
19617
+ params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
19618
+ }
19519
19619
  params[Param.DataPanelV2Enabled] = dataPanelV2;
19520
19620
  params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
19521
19621
  params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
@@ -19870,7 +19970,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
19870
19970
  getEmbedParamsObject() {
19871
19971
  let params = {};
19872
19972
  params = this.getBaseQueryParams(params);
19873
- 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 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, showSpotterLimitations, } = this.viewConfig;
19973
+ 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 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, showSpotterLimitations, isLinkParametersEnabled, } = this.viewConfig;
19874
19974
  const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
19875
19975
  || this.viewConfig.preventPinboardFilterRemoval;
19876
19976
  if (fullHeight === true) {
@@ -19935,6 +20035,9 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
19935
20035
  if (showSpotterLimitations !== undefined) {
19936
20036
  params[Param.ShowSpotterLimitations] = showSpotterLimitations;
19937
20037
  }
20038
+ if (isLinkParametersEnabled !== undefined) {
20039
+ params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
20040
+ }
19938
20041
  params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
19939
20042
  params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
19940
20043
  params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
@@ -20031,7 +20134,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
20031
20134
  * @param {any} data The payload to send with the message
20032
20135
  * @returns A promise that resolves with the response from the embedded app
20033
20136
  */
20034
- trigger(messageType, data = {}) {
20137
+ trigger(messageType, data = {}, context) {
20035
20138
  const dataWithVizId = data;
20036
20139
  if (messageType === HostEvent.SetActiveTab) {
20037
20140
  this.setActiveTab(data);
@@ -20040,7 +20143,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
20040
20143
  if (typeof dataWithVizId === 'object' && this.viewConfig.vizId) {
20041
20144
  dataWithVizId.vizId = this.viewConfig.vizId;
20042
20145
  }
20043
- return super.trigger(messageType, dataWithVizId);
20146
+ return super.trigger(messageType, dataWithVizId, context);
20044
20147
  }
20045
20148
  /**
20046
20149
  * Destroys the ThoughtSpot embed, and remove any nodes from the DOM.