@thoughtspot/visual-embed-sdk 1.53.0 → 1.53.2-beta

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 (203) hide show
  1. package/cjs/package.json +1 -1
  2. package/cjs/src/auth.d.ts.map +1 -1
  3. package/cjs/src/auth.js +25 -6
  4. package/cjs/src/auth.js.map +1 -1
  5. package/cjs/src/auth.spec.js +40 -8
  6. package/cjs/src/auth.spec.js.map +1 -1
  7. package/cjs/src/contracts/contracts.spec.js +169 -2
  8. package/cjs/src/contracts/contracts.spec.js.map +1 -1
  9. package/cjs/src/contracts/embed-event-payloads.d.ts +212 -14
  10. package/cjs/src/contracts/embed-event-payloads.d.ts.map +1 -1
  11. package/cjs/src/contracts/host-event-contracts.d.ts +11 -0
  12. package/cjs/src/contracts/host-event-contracts.d.ts.map +1 -1
  13. package/cjs/src/css-variables.d.ts +140 -0
  14. package/cjs/src/css-variables.d.ts.map +1 -1
  15. package/cjs/src/embed/app.d.ts +1 -0
  16. package/cjs/src/embed/app.d.ts.map +1 -1
  17. package/cjs/src/embed/app.js.map +1 -1
  18. package/cjs/src/embed/auto-frame-renderer.d.ts +14 -1
  19. package/cjs/src/embed/auto-frame-renderer.d.ts.map +1 -1
  20. package/cjs/src/embed/auto-frame-renderer.js +91 -2
  21. package/cjs/src/embed/auto-frame-renderer.js.map +1 -1
  22. package/cjs/src/embed/auto-frame-renderer.spec.js +112 -7
  23. package/cjs/src/embed/auto-frame-renderer.spec.js.map +1 -1
  24. package/cjs/src/embed/conversation.d.ts +14 -0
  25. package/cjs/src/embed/conversation.d.ts.map +1 -1
  26. package/cjs/src/embed/conversation.js.map +1 -1
  27. package/cjs/src/embed/conversation.spec.js +22 -0
  28. package/cjs/src/embed/conversation.spec.js.map +1 -1
  29. package/cjs/src/embed/host-events.spec.js +50 -0
  30. package/cjs/src/embed/host-events.spec.js.map +1 -1
  31. package/cjs/src/embed/liveboard.d.ts +2 -16
  32. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  33. package/cjs/src/embed/liveboard.js +29 -10
  34. package/cjs/src/embed/liveboard.js.map +1 -1
  35. package/cjs/src/embed/liveboard.spec.js +139 -0
  36. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  37. package/cjs/src/embed/spotter-utils.d.ts +1 -0
  38. package/cjs/src/embed/spotter-utils.d.ts.map +1 -1
  39. package/cjs/src/embed/spotter-utils.js +7 -1
  40. package/cjs/src/embed/spotter-utils.js.map +1 -1
  41. package/cjs/src/embed/spotter-utils.spec.js +19 -0
  42. package/cjs/src/embed/spotter-utils.spec.js.map +1 -1
  43. package/cjs/src/embed/ts-embed.d.ts +21 -16
  44. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  45. package/cjs/src/embed/ts-embed.js +77 -63
  46. package/cjs/src/embed/ts-embed.js.map +1 -1
  47. package/cjs/src/embed/ts-embed.spec.js +240 -7
  48. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  49. package/cjs/src/index.d.ts +2 -2
  50. package/cjs/src/index.d.ts.map +1 -1
  51. package/cjs/src/index.js.map +1 -1
  52. package/cjs/src/react/all-types-export.d.ts +1 -1
  53. package/cjs/src/react/all-types-export.d.ts.map +1 -1
  54. package/cjs/src/react/all-types-export.js.map +1 -1
  55. package/cjs/src/react/util.d.ts +8 -1
  56. package/cjs/src/react/util.d.ts.map +1 -1
  57. package/cjs/src/react/util.js.map +1 -1
  58. package/cjs/src/types.d.ts +249 -2
  59. package/cjs/src/types.d.ts.map +1 -1
  60. package/cjs/src/types.js +247 -0
  61. package/cjs/src/types.js.map +1 -1
  62. package/cjs/src/utils/runtimeTelemetry.d.ts +11 -0
  63. package/cjs/src/utils/runtimeTelemetry.d.ts.map +1 -0
  64. package/cjs/src/utils/runtimeTelemetry.js +34 -0
  65. package/cjs/src/utils/runtimeTelemetry.js.map +1 -0
  66. package/cjs/src/utils/runtimeTelemetry.spec.d.ts +2 -0
  67. package/cjs/src/utils/runtimeTelemetry.spec.d.ts.map +1 -0
  68. package/cjs/src/utils/runtimeTelemetry.spec.js +124 -0
  69. package/cjs/src/utils/runtimeTelemetry.spec.js.map +1 -0
  70. package/dist/{index-CyDR8j_0.js → index-DQ7r5f1z.js} +1 -1
  71. package/dist/src/auth.d.ts.map +1 -1
  72. package/dist/src/contracts/embed-event-payloads.d.ts +212 -14
  73. package/dist/src/contracts/embed-event-payloads.d.ts.map +1 -1
  74. package/dist/src/contracts/host-event-contracts.d.ts +11 -0
  75. package/dist/src/contracts/host-event-contracts.d.ts.map +1 -1
  76. package/dist/src/css-variables.d.ts +140 -0
  77. package/dist/src/css-variables.d.ts.map +1 -1
  78. package/dist/src/embed/app.d.ts +1 -0
  79. package/dist/src/embed/app.d.ts.map +1 -1
  80. package/dist/src/embed/auto-frame-renderer.d.ts +14 -1
  81. package/dist/src/embed/auto-frame-renderer.d.ts.map +1 -1
  82. package/dist/src/embed/conversation.d.ts +14 -0
  83. package/dist/src/embed/conversation.d.ts.map +1 -1
  84. package/dist/src/embed/liveboard.d.ts +2 -16
  85. package/dist/src/embed/liveboard.d.ts.map +1 -1
  86. package/dist/src/embed/spotter-utils.d.ts +1 -0
  87. package/dist/src/embed/spotter-utils.d.ts.map +1 -1
  88. package/dist/src/embed/ts-embed.d.ts +21 -16
  89. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  90. package/dist/src/index.d.ts +2 -2
  91. package/dist/src/index.d.ts.map +1 -1
  92. package/dist/src/react/all-types-export.d.ts +1 -1
  93. package/dist/src/react/all-types-export.d.ts.map +1 -1
  94. package/dist/src/react/util.d.ts +8 -1
  95. package/dist/src/react/util.d.ts.map +1 -1
  96. package/dist/src/types.d.ts +249 -2
  97. package/dist/src/types.d.ts.map +1 -1
  98. package/dist/src/utils/runtimeTelemetry.d.ts +11 -0
  99. package/dist/src/utils/runtimeTelemetry.d.ts.map +1 -0
  100. package/dist/src/utils/runtimeTelemetry.spec.d.ts +2 -0
  101. package/dist/src/utils/runtimeTelemetry.spec.d.ts.map +1 -0
  102. package/dist/tsembed-react.es.js +474 -84
  103. package/dist/tsembed-react.js +473 -83
  104. package/dist/tsembed.es.js +542 -85
  105. package/dist/tsembed.js +541 -84
  106. package/dist/visual-embed-sdk-react-full.d.ts +649 -30
  107. package/dist/visual-embed-sdk-react.d.ts +646 -28
  108. package/dist/visual-embed-sdk.d.ts +642 -44
  109. package/lib/package.json +1 -1
  110. package/lib/src/auth.d.ts.map +1 -1
  111. package/lib/src/auth.js +25 -6
  112. package/lib/src/auth.js.map +1 -1
  113. package/lib/src/auth.spec.js +40 -8
  114. package/lib/src/auth.spec.js.map +1 -1
  115. package/lib/src/contracts/contracts.spec.js +169 -2
  116. package/lib/src/contracts/contracts.spec.js.map +1 -1
  117. package/lib/src/contracts/embed-event-payloads.d.ts +212 -14
  118. package/lib/src/contracts/embed-event-payloads.d.ts.map +1 -1
  119. package/lib/src/contracts/host-event-contracts.d.ts +11 -0
  120. package/lib/src/contracts/host-event-contracts.d.ts.map +1 -1
  121. package/lib/src/css-variables.d.ts +140 -0
  122. package/lib/src/css-variables.d.ts.map +1 -1
  123. package/lib/src/embed/app.d.ts +1 -0
  124. package/lib/src/embed/app.d.ts.map +1 -1
  125. package/lib/src/embed/app.js.map +1 -1
  126. package/lib/src/embed/auto-frame-renderer.d.ts +14 -1
  127. package/lib/src/embed/auto-frame-renderer.d.ts.map +1 -1
  128. package/lib/src/embed/auto-frame-renderer.js +91 -2
  129. package/lib/src/embed/auto-frame-renderer.js.map +1 -1
  130. package/lib/src/embed/auto-frame-renderer.spec.js +113 -8
  131. package/lib/src/embed/auto-frame-renderer.spec.js.map +1 -1
  132. package/lib/src/embed/conversation.d.ts +14 -0
  133. package/lib/src/embed/conversation.d.ts.map +1 -1
  134. package/lib/src/embed/conversation.js.map +1 -1
  135. package/lib/src/embed/conversation.spec.js +22 -0
  136. package/lib/src/embed/conversation.spec.js.map +1 -1
  137. package/lib/src/embed/host-events.spec.js +50 -0
  138. package/lib/src/embed/host-events.spec.js.map +1 -1
  139. package/lib/src/embed/liveboard.d.ts +2 -16
  140. package/lib/src/embed/liveboard.d.ts.map +1 -1
  141. package/lib/src/embed/liveboard.js +28 -10
  142. package/lib/src/embed/liveboard.js.map +1 -1
  143. package/lib/src/embed/liveboard.spec.js +139 -0
  144. package/lib/src/embed/liveboard.spec.js.map +1 -1
  145. package/lib/src/embed/spotter-utils.d.ts +1 -0
  146. package/lib/src/embed/spotter-utils.d.ts.map +1 -1
  147. package/lib/src/embed/spotter-utils.js +7 -1
  148. package/lib/src/embed/spotter-utils.js.map +1 -1
  149. package/lib/src/embed/spotter-utils.spec.js +19 -0
  150. package/lib/src/embed/spotter-utils.spec.js.map +1 -1
  151. package/lib/src/embed/ts-embed.d.ts +21 -16
  152. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  153. package/lib/src/embed/ts-embed.js +78 -64
  154. package/lib/src/embed/ts-embed.js.map +1 -1
  155. package/lib/src/embed/ts-embed.spec.js +240 -7
  156. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  157. package/lib/src/index.d.ts +2 -2
  158. package/lib/src/index.d.ts.map +1 -1
  159. package/lib/src/index.js.map +1 -1
  160. package/lib/src/react/all-types-export.d.ts +1 -1
  161. package/lib/src/react/all-types-export.d.ts.map +1 -1
  162. package/lib/src/react/all-types-export.js.map +1 -1
  163. package/lib/src/react/util.d.ts +8 -1
  164. package/lib/src/react/util.d.ts.map +1 -1
  165. package/lib/src/react/util.js.map +1 -1
  166. package/lib/src/types.d.ts +249 -2
  167. package/lib/src/types.d.ts.map +1 -1
  168. package/lib/src/types.js +247 -0
  169. package/lib/src/types.js.map +1 -1
  170. package/lib/src/utils/runtimeTelemetry.d.ts +11 -0
  171. package/lib/src/utils/runtimeTelemetry.d.ts.map +1 -0
  172. package/lib/src/utils/runtimeTelemetry.js +28 -0
  173. package/lib/src/utils/runtimeTelemetry.js.map +1 -0
  174. package/lib/src/utils/runtimeTelemetry.spec.d.ts +2 -0
  175. package/lib/src/utils/runtimeTelemetry.spec.d.ts.map +1 -0
  176. package/lib/src/utils/runtimeTelemetry.spec.js +122 -0
  177. package/lib/src/utils/runtimeTelemetry.spec.js.map +1 -0
  178. package/lib/src/visual-embed-sdk.d.ts +642 -44
  179. package/package.json +1 -1
  180. package/src/auth.spec.ts +47 -11
  181. package/src/auth.ts +35 -6
  182. package/src/contracts/contracts.spec.ts +186 -3
  183. package/src/contracts/embed-event-payloads.ts +281 -14
  184. package/src/contracts/host-event-contracts.ts +14 -0
  185. package/src/css-variables.ts +168 -0
  186. package/src/embed/app.ts +1 -0
  187. package/src/embed/auto-frame-renderer.spec.ts +134 -8
  188. package/src/embed/auto-frame-renderer.ts +103 -2
  189. package/src/embed/conversation.spec.ts +24 -0
  190. package/src/embed/conversation.ts +14 -0
  191. package/src/embed/host-events.spec.ts +68 -0
  192. package/src/embed/liveboard.spec.ts +156 -0
  193. package/src/embed/liveboard.ts +34 -10
  194. package/src/embed/spotter-utils.spec.ts +20 -0
  195. package/src/embed/spotter-utils.ts +12 -1
  196. package/src/embed/ts-embed.spec.ts +297 -8
  197. package/src/embed/ts-embed.ts +79 -64
  198. package/src/index.ts +2 -0
  199. package/src/react/all-types-export.ts +1 -0
  200. package/src/react/util.ts +13 -1
  201. package/src/types.ts +249 -0
  202. package/src/utils/runtimeTelemetry.spec.ts +148 -0
  203. package/src/utils/runtimeTelemetry.ts +50 -0
package/dist/tsembed.js CHANGED
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.53.0 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.53.2-beta */
2
2
  'use client';
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
@@ -477,6 +477,7 @@
477
477
  * })
478
478
  * ```
479
479
  * @returns isLoggedIn - A Boolean specifying whether authentication was successful.
480
+ * Payload: {@link AuthInitPayload}.
480
481
  */
481
482
  EmbedEvent["AuthInit"] = "authInit";
482
483
  /**
@@ -496,6 +497,7 @@
496
497
  /**
497
498
  * Data pertaining to an Answer, Liveboard or Spotter visualization is received.
498
499
  * The event payload includes the raw data of the object.
500
+ * Payload: {@link DataEventPayload}.
499
501
  * @return data - Answer of Liveboard data
500
502
  * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
501
503
  * @example
@@ -509,6 +511,7 @@
509
511
  EmbedEvent["Data"] = "data";
510
512
  /**
511
513
  * Search query has been updated by the user.
514
+ * Payload: {@link QueryChangedPayload} or a string.
512
515
  * @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 8.4.1.sw
513
516
  * @example
514
517
  * ```js
@@ -551,6 +554,7 @@
551
554
  * })
552
555
  * })
553
556
  * ```
557
+ * Payload: {@link DrilldownPayload}.
554
558
  */
555
559
  EmbedEvent["Drilldown"] = "drillDown";
556
560
  /**
@@ -563,6 +567,7 @@
563
567
  * console.log('DataSourceSelected', payload);
564
568
  * })
565
569
  * ```
570
+ * Payload: {@link DataSourceSelectedPayload} or string[].
566
571
  */
567
572
  EmbedEvent["DataSourceSelected"] = "dataSourceSelected";
568
573
  /**
@@ -575,6 +580,7 @@
575
580
  * console.log('AddRemoveColumns', payload);
576
581
  * })
577
582
  * ```
583
+ * Payload: string[].
578
584
  */
579
585
  EmbedEvent["AddRemoveColumns"] = "addRemoveColumns";
580
586
  /**
@@ -592,6 +598,7 @@
592
598
  * }
593
599
  * })
594
600
  * ```
601
+ * Payload: {@link CustomActionPayload} (on() enriches it to {@link CustomActionEventPayload}).
595
602
  */
596
603
  EmbedEvent["CustomAction"] = "customAction";
597
604
  /**
@@ -604,6 +611,7 @@
604
611
  * console.log('VizPointDoubleClick', payload);
605
612
  * })
606
613
  * ```
614
+ * Payload: {@link VizInteractionPayload}.
607
615
  */
608
616
  EmbedEvent["VizPointDoubleClick"] = "vizPointDoubleClick";
609
617
  /**
@@ -623,6 +631,7 @@
623
631
  * )
624
632
  * });
625
633
  * ```
634
+ * Payload: {@link VizInteractionPayload}.
626
635
  */
627
636
  EmbedEvent["VizPointClick"] = "vizPointClick";
628
637
  /**
@@ -675,6 +684,7 @@
675
684
  * // { errorType: "API", message: '...', code: '...' }
676
685
  * });
677
686
  * ```
687
+ * Payload: {@link EmbedErrorPayload} or a string.
678
688
  */
679
689
  EmbedEvent["Error"] = "Error";
680
690
  /**
@@ -725,6 +735,7 @@
725
735
  * The center of visible iframe viewport is calculated.
726
736
  * @returns data - The center of the visible Iframe viewport.
727
737
  * @hidden
738
+ * Payload: none.
728
739
  */
729
740
  EmbedEvent["EmbedIframeCenter"] = "EmbedIframeCenter";
730
741
  /**
@@ -781,6 +792,7 @@
781
792
  * console.log('dialog open', payload);
782
793
  * })
783
794
  * ```
795
+ * Payload: none.
784
796
  */
785
797
  EmbedEvent["DialogOpen"] = "dialog-open";
786
798
  /**
@@ -792,6 +804,7 @@
792
804
  * console.log('dialog close', payload);
793
805
  * })
794
806
  * ```
807
+ * Payload: none.
795
808
  */
796
809
  EmbedEvent["DialogClose"] = "dialog-close";
797
810
  /**
@@ -814,6 +827,7 @@
814
827
  * embed.trigger(HostEvent.SetVisibleVizs, ['viz1', 'viz2']);
815
828
  * };
816
829
  * ```
830
+ * Payload: none.
817
831
  */
818
832
  EmbedEvent["LiveboardRendered"] = "PinboardRendered";
819
833
  /**
@@ -844,6 +858,7 @@
844
858
  * console.log('Save', payload)
845
859
  * })
846
860
  * ```
861
+ * Payload: {@link SaveEventPayload}.
847
862
  */
848
863
  EmbedEvent["Save"] = "save";
849
864
  /**
@@ -860,6 +875,7 @@
860
875
  * vizId: '730496d6-6903-4601-937e-2c691821af3c'
861
876
  * })
862
877
  * ```
878
+ * Payload: {@link VizScope}.
863
879
  */
864
880
  EmbedEvent["Download"] = "download";
865
881
  /**
@@ -879,6 +895,7 @@
879
895
  * searchEmbed.on(EmbedEvent.DownloadAsPng, payload => {
880
896
  * console.log('download PNG', payload)})
881
897
  * ```
898
+ * Payload: {@link DownloadEventPayload}.
882
899
  */
883
900
  EmbedEvent["DownloadAsPng"] = "downloadAsPng";
884
901
  /**
@@ -898,6 +915,7 @@
898
915
  * searchEmbed.on(EmbedEvent.DownloadAsPdf, payload => {
899
916
  * console.log('download PDF', payload)})
900
917
  * ```
918
+ * Payload: {@link DownloadEventPayload}.
901
919
  */
902
920
  EmbedEvent["DownloadAsPdf"] = "downloadAsPdf";
903
921
  /**
@@ -917,6 +935,7 @@
917
935
  * searchEmbed.on(EmbedEvent.DownloadAsCsv, payload => {
918
936
  * console.log('download CSV', payload)})
919
937
  * ```
938
+ * Payload: {@link DownloadEventPayload}.
920
939
  */
921
940
  EmbedEvent["DownloadAsCsv"] = "downloadAsCsv";
922
941
  /**
@@ -936,6 +955,7 @@
936
955
  * searchEmbed.on(EmbedEvent.DownloadAsXlsx, payload => {
937
956
  * console.log('download Xlsx', payload)})
938
957
  * ```
958
+ * Payload: {@link DownloadEventPayload}.
939
959
  */
940
960
  EmbedEvent["DownloadAsXlsx"] = "downloadAsXlsx";
941
961
  /**
@@ -947,6 +967,7 @@
947
967
  * liveboardEmbed.on(EmbedEvent.DownloadLiveboardAsContinuousPDF, payload => {
948
968
  * console.log('download liveboard as continuous PDF', payload)})
949
969
  * ```
970
+ * Payload: {@link LiveboardScope}.
950
971
  */
951
972
  EmbedEvent["DownloadLiveboardAsContinuousPDF"] = "downloadLiveboardAsContinuousPDF";
952
973
  /**
@@ -963,6 +984,7 @@
963
984
  * appEmbed.on(EmbedEvent.AnswerDelete, payload => {
964
985
  * console.log('delete answer', payload)})
965
986
  * ```
987
+ * Payload: {@link AnswerScope}.
966
988
  */
967
989
  EmbedEvent["AnswerDelete"] = "answerDelete";
968
990
  /**
@@ -974,6 +996,7 @@
974
996
  * console.log('AI Highlights', payload);
975
997
  * })
976
998
  * ```
999
+ * Payload: {@link LiveboardScope}.
977
1000
  */
978
1001
  EmbedEvent["AIHighlights"] = "AIHighlights";
979
1002
  /**
@@ -995,6 +1018,7 @@
995
1018
  * console.log('pin', payload)
996
1019
  * })
997
1020
  * ```
1021
+ * Payload: {@link PinEventPayload}.
998
1022
  */
999
1023
  EmbedEvent["Pin"] = "pin";
1000
1024
  /**
@@ -1013,6 +1037,7 @@
1013
1037
  * console.log('SpotIQ analyze', payload)
1014
1038
  * })
1015
1039
  * ```
1040
+ * Payload: {@link AnswerScope}.
1016
1041
  */
1017
1042
  EmbedEvent["SpotIQAnalyze"] = "spotIQAnalyze";
1018
1043
  /**
@@ -1066,6 +1091,7 @@
1066
1091
  * console.log('copy to clipboard', payload);
1067
1092
  * })
1068
1093
  * ```
1094
+ * Payload: {@link CopyToClipboardPayload}.
1069
1095
  */
1070
1096
  EmbedEvent["CopyToClipboard"] = "context-menu-item-copy-to-clipboard";
1071
1097
  /**
@@ -1077,6 +1103,7 @@
1077
1103
  * liveboardEmbed.on(EmbedEvent.UpdateTML)
1078
1104
  * })
1079
1105
  * ```
1106
+ * Payload: {@link TmlEventPayload}.
1080
1107
  */
1081
1108
  EmbedEvent["UpdateTML"] = "updateTSL";
1082
1109
  /**
@@ -1089,6 +1116,7 @@
1089
1116
  * console.log('Edit TML', payload);
1090
1117
  * })
1091
1118
  * ```
1119
+ * Payload: {@link TmlEventPayload}.
1092
1120
  */
1093
1121
  EmbedEvent["EditTML"] = "editTSL";
1094
1122
  /**
@@ -1106,6 +1134,7 @@
1106
1134
  * searchEmbed.on(EmbedEvent.ExportTML, payload => {
1107
1135
  * console.log('Export TML', payload)})
1108
1136
  * ```
1137
+ * Payload: {@link TmlEventPayload}.
1109
1138
  */
1110
1139
  EmbedEvent["ExportTML"] = "exportTSL";
1111
1140
  /**
@@ -1144,6 +1173,7 @@
1144
1173
  * console.log('show data', payload);
1145
1174
  * })
1146
1175
  * ```
1176
+ * Payload: {@link AnswerScope}.
1147
1177
  */
1148
1178
  EmbedEvent["ShowUnderlyingData"] = "showUnderlyingData";
1149
1179
  /**
@@ -1155,6 +1185,7 @@
1155
1185
  * console.log('switch view', payload);
1156
1186
  * })
1157
1187
  * ```
1188
+ * Payload: {@link AnswerChartSwitcherPayload}.
1158
1189
  */
1159
1190
  EmbedEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
1160
1191
  /**
@@ -1176,6 +1207,7 @@
1176
1207
  * console.log('Liveboard details', payload);
1177
1208
  * })
1178
1209
  * ```
1210
+ * Payload: {@link LiveboardScope}.
1179
1211
  */
1180
1212
  EmbedEvent["LiveboardInfo"] = "pinboardInfo";
1181
1213
  /**
@@ -1187,6 +1219,7 @@
1187
1219
  * console.log('favorites', payload);
1188
1220
  * })
1189
1221
  * ```
1222
+ * Payload: {@link FavoritePayload}.
1190
1223
  */
1191
1224
  EmbedEvent["AddToFavorites"] = "addToFavorites";
1192
1225
  /**
@@ -1198,6 +1231,7 @@
1198
1231
  * console.log('Liveboard schedule', payload);
1199
1232
  * })
1200
1233
  * ```
1234
+ * Payload: {@link LiveboardScope}.
1201
1235
  */
1202
1236
  EmbedEvent["Schedule"] = "subscription";
1203
1237
  /**
@@ -1212,6 +1246,7 @@
1212
1246
  * console.log('Liveboard edit', payload);
1213
1247
  * })
1214
1248
  * ```
1249
+ * Payload: {@link LiveboardVizScope}.
1215
1250
  */
1216
1251
  EmbedEvent["Edit"] = "edit";
1217
1252
  /**
@@ -1253,6 +1288,7 @@
1253
1288
  * console.log('Copy', payload);
1254
1289
  * })
1255
1290
  * ```
1291
+ * Payload: {@link MakeACopyPayload}.
1256
1292
  */
1257
1293
  EmbedEvent["MakeACopy"] = "makeACopy";
1258
1294
  /**
@@ -1268,6 +1304,7 @@
1268
1304
  * vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1269
1305
  * })
1270
1306
  * ```
1307
+ * Payload: {@link LiveboardVizScope}.
1271
1308
  */
1272
1309
  EmbedEvent["Present"] = "present";
1273
1310
  /**
@@ -1278,6 +1315,7 @@
1278
1315
  * liveboardEmbed.on(EmbedEvent.Delete,
1279
1316
  * {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1280
1317
  * ```
1318
+ * Payload: {@link LiveboardScope}.
1281
1319
  */
1282
1320
  EmbedEvent["Delete"] = "delete";
1283
1321
  /**
@@ -1287,6 +1325,7 @@
1287
1325
  * ```js
1288
1326
  * liveboardEmbed.on(EmbedEvent.SchedulesList)
1289
1327
  * ```
1328
+ * Payload: {@link LiveboardScope}.
1290
1329
  */
1291
1330
  EmbedEvent["SchedulesList"] = "schedule-list";
1292
1331
  /**
@@ -1296,6 +1335,7 @@
1296
1335
  * ```js
1297
1336
  * liveboardEmbed.on(EmbedEvent.Cancel)
1298
1337
  * ```
1338
+ * Payload: {@link LiveboardScope}.
1299
1339
  */
1300
1340
  EmbedEvent["Cancel"] = "cancel";
1301
1341
  /**
@@ -1306,6 +1346,7 @@
1306
1346
  * liveboardEmbed.on(EmbedEvent.Explore, {
1307
1347
  * vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1308
1348
  * ```
1349
+ * Payload: {@link LiveboardVizScope}.
1309
1350
  */
1310
1351
  EmbedEvent["Explore"] = "explore";
1311
1352
  /**
@@ -1316,6 +1357,7 @@
1316
1357
  * liveboardEmbed.on(EmbedEvent.CopyLink, {
1317
1358
  * vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1318
1359
  * ```
1360
+ * Payload: {@link CopyLinkPayload}.
1319
1361
  */
1320
1362
  EmbedEvent["CopyLink"] = "embedDocument";
1321
1363
  /**
@@ -1327,6 +1369,7 @@
1327
1369
  * liveboardEmbed.on(EmbedEvent.CrossFilterChanged, {
1328
1370
  * vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1329
1371
  * ```
1372
+ * Payload: {@link CrossFilterChangedPayload}.
1330
1373
  */
1331
1374
  EmbedEvent["CrossFilterChanged"] = "cross-filter-changed";
1332
1375
  /**
@@ -1338,6 +1381,7 @@
1338
1381
  * console.log('VizPointClick', payload)
1339
1382
  * })
1340
1383
  * ```
1384
+ * Payload: {@link VizInteractionPayload}.
1341
1385
  */
1342
1386
  EmbedEvent["VizPointRightClick"] = "vizPointRightClick";
1343
1387
  /**
@@ -1365,6 +1409,7 @@
1365
1409
  * })
1366
1410
  * ```
1367
1411
  * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl, 9.5.0.sw
1412
+ * Payload: {@link FilterChangedPayload}.
1368
1413
  */
1369
1414
  EmbedEvent["FilterChanged"] = "filterChanged";
1370
1415
  /**
@@ -1387,6 +1432,7 @@
1387
1432
  * @returns isPublic: boolean
1388
1433
  * @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw
1389
1434
  * @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
1435
+ * Payload: {@link PersonalisedViewPayload}.
1390
1436
  */
1391
1437
  EmbedEvent["UpdatePersonalisedView"] = "updatePersonalisedView";
1392
1438
  /**
@@ -1408,6 +1454,7 @@
1408
1454
  * @returns isPublic: boolean
1409
1455
  * @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw
1410
1456
  * @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
1457
+ * Payload: {@link PersonalisedViewPayload}.
1411
1458
  */
1412
1459
  EmbedEvent["SavePersonalisedView"] = "savePersonalisedView";
1413
1460
  /**
@@ -1482,6 +1529,7 @@
1482
1529
  /**
1483
1530
  * Emitted when a Liveboard or visualization is renamed.
1484
1531
  * @version SDK: 1.28.0 | ThoughtSpot: 9.10.5.cl, 10.1.0.sw
1532
+ * Payload: {@link RenamePayload}.
1485
1533
  */
1486
1534
  EmbedEvent["Rename"] = "rename";
1487
1535
  /**
@@ -1567,6 +1615,7 @@
1567
1615
  * })
1568
1616
  * ```
1569
1617
  * @version SDK: 1.29.0 | ThoughtSpot: 10.3.0.cl
1618
+ * Payload: {@link ParameterChangedPayload}.
1570
1619
  */
1571
1620
  EmbedEvent["ParameterChanged"] = "parameterChanged";
1572
1621
  /**
@@ -1610,6 +1659,7 @@
1610
1659
  * })
1611
1660
  * ```
1612
1661
  * @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
1662
+ * Payload: {@link TableVizRenderedPayload}.
1613
1663
  */
1614
1664
  EmbedEvent["TableVizRendered"] = "TableVizRendered";
1615
1665
  /**
@@ -1634,12 +1684,14 @@
1634
1684
  * @hidden
1635
1685
  * Emitted when a user exits present mode.
1636
1686
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
1687
+ * Payload: {@link ExitPresentModePayload}.
1637
1688
  */
1638
1689
  EmbedEvent["ExitPresentMode"] = "exitPresentMode";
1639
1690
  /**
1640
1691
  * Emitted when a user requests the full height lazy load data.
1641
1692
  * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1642
1693
  * @hidden
1694
+ * Payload: none.
1643
1695
  */
1644
1696
  EmbedEvent["RequestVisibleEmbedCoordinates"] = "requestVisibleEmbedCoordinates";
1645
1697
  /**
@@ -1673,6 +1725,7 @@
1673
1725
  * })
1674
1726
  * ```
1675
1727
  * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
1728
+ * Payload: {@link VizScope}.
1676
1729
  */
1677
1730
  EmbedEvent["AddToCoaching"] = "addToCoaching";
1678
1731
  /**
@@ -1762,6 +1815,7 @@
1762
1815
  * console.log('EmbedListenerReady');
1763
1816
  * })
1764
1817
  * ```
1818
+ * Payload: none.
1765
1819
  */
1766
1820
  EmbedEvent["EmbedListenerReady"] = "EmbedListenerReady";
1767
1821
  /**
@@ -2136,6 +2190,7 @@
2136
2190
  * })
2137
2191
  * ```
2138
2192
  * @version SDK: 1.48.0 | ThoughtSpot Cloud: 26.5.0.cl
2193
+ * Payload: {@link TestScheduleEmailPayload}.
2139
2194
  */
2140
2195
  EmbedEvent["SendTestScheduleEmail"] = "sendTestScheduleEmail";
2141
2196
  /**
@@ -2647,6 +2702,19 @@
2647
2702
  * ```
2648
2703
  */
2649
2704
  HostEvent["OpenAddParameterModal"] = "openAddParameterModal";
2705
+ /**
2706
+ * Add a tab to the Liveboard, the same action as the *Tab* option in the
2707
+ * *Add* dropdown in the Liveboard edit header.
2708
+ *
2709
+ * The Liveboard must be in edit mode; the event is ignored otherwise.
2710
+ *
2711
+ * @version SDK: 1.56.0 | ThoughtSpot Cloud: 27.1.0.cl
2712
+ * @example
2713
+ * ```js
2714
+ * liveboardEmbed.trigger(HostEvent.OpenAddTabModal);
2715
+ * ```
2716
+ */
2717
+ HostEvent["OpenAddTabModal"] = "openAddTabModal";
2650
2718
  /**
2651
2719
  * Open the parameter panel for a particular parameter on a Liveboard.
2652
2720
  * Mirrors {@link HostEvent.OpenFilter} for parameters.
@@ -3244,6 +3312,17 @@
3244
3312
  * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
3245
3313
  */
3246
3314
  HostEvent["EditVisualization"] = "editVisualization";
3315
+ /**
3316
+ * Exits Liveboard edit mode , equivalent to clicking the
3317
+ * *Cancel* button in the Liveboard edit header. The Liveboard returns to
3318
+ * view mode and the embedded app emits the {@link EmbedEvent.Cancel} event.
3319
+ * @version SDK: 1.55.0 | ThoughtSpot Cloud: 26.12.0.cl
3320
+ * @example
3321
+ * ```js
3322
+ * liveboardEmbed.trigger(HostEvent.ExitEditMode);
3323
+ * ```
3324
+ */
3325
+ HostEvent["ExitEditMode"] = "exitEditMode";
3247
3326
  /**
3248
3327
  * Trigger the **Copy link** action on a Liveboard or visualization
3249
3328
  * Payload: {@link VizScopedRequest}.
@@ -4779,6 +4858,39 @@
4779
4858
  * @version SDK: 1.49.0 | ThoughtSpot Cloud: 26.6.0.cl
4780
4859
  */
4781
4860
  HostEvent["RefreshLiveboardBrowserCache"] = "refreshLiveboardBrowserCache";
4861
+ /**
4862
+ * Switch the embed between dark appearance and its default appearance
4863
+ * while it is open, without reloading it.
4864
+ * Payload: {@link UpdateThemeRequest}.
4865
+ *
4866
+ * Use it to keep the embed in step with a theme switch in your
4867
+ * application; the appearance the embed loads with is set by `isDarkMode`.
4868
+ * The event resolves with the applied value, such as `{ isDarkMode: true }`.
4869
+ * When dark appearance is not available in the embed, the embed does not
4870
+ * change and the event rejects with an error message instead.
4871
+ * @version SDK: 1.55.0 | ThoughtSpot Cloud: 26.12.0.cl
4872
+ * @param - `isDarkMode` - `true` for dark appearance, `false` for the
4873
+ * default appearance.
4874
+ * @example
4875
+ * ```js
4876
+ * appEmbed.trigger(HostEvent.UpdateTheme, { isDarkMode: true });
4877
+ * ```
4878
+ * @example
4879
+ * ```js
4880
+ * // Follow a theme switch in your application
4881
+ * const themeSwitch = document.querySelector('#theme-switch');
4882
+ * themeSwitch.addEventListener('change', async (event) => {
4883
+ * try {
4884
+ * await appEmbed.trigger(HostEvent.UpdateTheme, {
4885
+ * isDarkMode: event.target.checked,
4886
+ * });
4887
+ * } catch (error) {
4888
+ * console.warn(error);
4889
+ * }
4890
+ * });
4891
+ * ```
4892
+ */
4893
+ HostEvent["UpdateTheme"] = "UpdateTheme";
4782
4894
  })(exports.HostEvent || (exports.HostEvent = {}));
4783
4895
  /**
4784
4896
  * The different visual modes that the data sources panel within
@@ -4822,6 +4934,7 @@
4822
4934
  * @version SDK: 1.52.2 | ThoughtSpot Cloud: 26.9.0.cl
4823
4935
  */
4824
4936
  Param["TsmcpAnswerIndex"] = "tsmcpAnswerIndex";
4937
+ Param["IsMcpAnswerEmbed"] = "isMcpAnswerEmbed";
4825
4938
  Param["EmbedApp"] = "embedApp";
4826
4939
  Param["DataSources"] = "dataSources";
4827
4940
  Param["DataSourceMode"] = "dataSourceMode";
@@ -5024,6 +5137,21 @@
5024
5137
  exports.Action = void 0;
5025
5138
  (function (Action) {
5026
5139
  /**
5140
+ * The **Add** button on a Liveboard in edit mode.
5141
+ * Controls the visibility and disabled state of the Add panel button
5142
+ * in the Liveboard edit toolbar, which allows users to add
5143
+ * visualizations, filters, parameters, and tabs.
5144
+ * @example
5145
+ * ```js
5146
+ * hiddenActions: [Action.LiveboardAddPanel]
5147
+ * // or
5148
+ * disabledActions: [Action.LiveboardAddPanel]
5149
+ * ```
5150
+ * @version SDK: 1.56.0 | ThoughtSpot Cloud: 27.1.0.cl
5151
+ */
5152
+ Action["LiveboardAddPanel"] = "liveboardAddPanel";
5153
+ /**
5154
+ *
5027
5155
  * The **Save** action on an Answer or Liveboard.
5028
5156
  * Allows users to save the changes.
5029
5157
  * @example
@@ -7254,6 +7382,125 @@
7254
7382
  * ```
7255
7383
  */
7256
7384
  Action["CustomizeHomepage"] = "customizeHomepage";
7385
+ /**
7386
+ * Controls the visibility and disabled state of the *Cancel* button in the
7387
+ * Liveboard edit header, the button that discards the changes made in edit
7388
+ * mode and returns the Liveboard to view mode. The button is shown only
7389
+ * while the Liveboard is in edit mode.
7390
+ * @version SDK: 1.55.0 | ThoughtSpot Cloud: 26.12.0.cl
7391
+ * @example
7392
+ * ```js
7393
+ * const liveboardEmbed = new LiveboardEmbed('#tsEmbed', {
7394
+ * ... // other embed view config
7395
+ * hiddenActions: [Action.Cancel],
7396
+ * });
7397
+ * ```
7398
+ * @example
7399
+ * ```js
7400
+ * const liveboardEmbed = new LiveboardEmbed('#tsEmbed', {
7401
+ * ... // other embed view config
7402
+ * disabledActions: [Action.Cancel],
7403
+ * disabledActionReason: 'Save your changes to leave edit mode',
7404
+ * });
7405
+ * ```
7406
+ */
7407
+ Action["Cancel"] = "cancel";
7408
+ /**
7409
+ * Controls the visibility and disabled state of the "Version history" menu item for a Liveboard or Answer.
7410
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 9.8.0.cl
7411
+ * @example
7412
+ * ```js
7413
+ * {
7414
+ * hiddenActions: [Action.ShowVersionHistory],
7415
+ * disabledActions: [Action.ShowVersionHistory],
7416
+ * }
7417
+ * ```
7418
+ */
7419
+ Action["ShowVersionHistory"] = "showVersionHistory";
7420
+ /**
7421
+ * Controls the visibility and disabled state of the "Enable version control" menu item for a Liveboard or Answer.
7422
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 9.10.0.cl
7423
+ * @example
7424
+ * ```js
7425
+ * {
7426
+ * hiddenActions: [Action.EnableVersionControl],
7427
+ * disabledActions: [Action.EnableVersionControl],
7428
+ * }
7429
+ * ```
7430
+ */
7431
+ Action["EnableVersionControl"] = "enableVersionControl";
7432
+ /**
7433
+ * Controls the visibility and disabled state of the "Disable version control" menu item for a Liveboard or Answer.
7434
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 9.10.0.cl
7435
+ * @example
7436
+ * ```js
7437
+ * {
7438
+ * hiddenActions: [Action.DisableVersionControl],
7439
+ * disabledActions: [Action.DisableVersionControl],
7440
+ * }
7441
+ * ```
7442
+ */
7443
+ Action["DisableVersionControl"] = "disableVersionControl";
7444
+ /**
7445
+ * Controls the visibility and disabled state of the "Withdraw verification" menu item for a verified Liveboard.
7446
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 9.8.0.cl
7447
+ * @example
7448
+ * ```js
7449
+ * {
7450
+ * hiddenActions: [Action.WithdrawVerification],
7451
+ * disabledActions: [Action.WithdrawVerification],
7452
+ * }
7453
+ * ```
7454
+ */
7455
+ Action["WithdrawVerification"] = "withdrawVerification";
7456
+ /**
7457
+ * Controls the visibility and disabled state of the "Switch to new chart experience" menu item on an Answer.
7458
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 10.10.0.cl
7459
+ * @example
7460
+ * ```js
7461
+ * {
7462
+ * hiddenActions: [Action.SwitchToNewChartExperience],
7463
+ * disabledActions: [Action.SwitchToNewChartExperience],
7464
+ * }
7465
+ * ```
7466
+ */
7467
+ Action["SwitchToNewChartExperience"] = "switchToNewChartExperience";
7468
+ /**
7469
+ * Controls the visibility and disabled state of the "Switch to classic chart experience" menu item on an Answer.
7470
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 10.10.0.cl
7471
+ * @example
7472
+ * ```js
7473
+ * {
7474
+ * hiddenActions: [Action.SwitchToClassicChartExperience],
7475
+ * disabledActions: [Action.SwitchToClassicChartExperience],
7476
+ * }
7477
+ * ```
7478
+ */
7479
+ Action["SwitchToClassicChartExperience"] = "switchToClassicChartExperience";
7480
+ /**
7481
+ * Controls the visibility and disabled state of the "Monitor" menu item on an Answer, which includes the alert options.
7482
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 10.5.0.cl
7483
+ * @example
7484
+ * ```js
7485
+ * {
7486
+ * hiddenActions: [Action.Monitor],
7487
+ * disabledActions: [Action.Monitor],
7488
+ * }
7489
+ * ```
7490
+ */
7491
+ Action["Monitor"] = "monitor";
7492
+ /**
7493
+ * Controls the visibility and disabled state of the "View explanation" button in the footer of a Spotter answer, which opens the explanation and verification details.
7494
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
7495
+ * @example
7496
+ * ```js
7497
+ * {
7498
+ * hiddenActions: [Action.SpotterViewExplanation],
7499
+ * disabledActions: [Action.SpotterViewExplanation],
7500
+ * }
7501
+ * ```
7502
+ */
7503
+ Action["SpotterViewExplanation"] = "spotterViewExplanation";
7257
7504
  })(exports.Action || (exports.Action = {}));
7258
7505
  exports.PrefetchFeatures = void 0;
7259
7506
  (function (PrefetchFeatures) {
@@ -7758,7 +8005,7 @@
7758
8005
  TableContentDensity["Compact"] = "COMPACT";
7759
8006
  })(exports.TableContentDensity || (exports.TableContentDensity = {}));
7760
8007
 
7761
- var version$1="1.53.0";var pkg = {version:version$1};
8008
+ var version$1="1.53.2-beta";var pkg = {version:version$1};
7762
8009
 
7763
8010
  const { version } = pkg;
7764
8011
 
@@ -20046,6 +20293,32 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
20046
20293
  }
20047
20294
  }
20048
20295
 
20296
+ // Membership is checked, not just the key: a bare key allowlist would upload an
20297
+ // arbitrary customer string sitting under `operator` verbatim.
20298
+ const isEnumMember = (enumObject, value) => typeof value === 'string' && Object.values(enumObject).includes(value);
20299
+ const uniqueEnumMembers = (enumObject, values) => Array.from(new Set(values.filter((v) => isEnumMember(enumObject, v))));
20300
+ const describeRuntimeFilters = (runtimeFilters) => ({
20301
+ count: runtimeFilters.length,
20302
+ operators: uniqueEnumMembers(exports.RuntimeFilterOp, runtimeFilters.map((filter) => filter === null || filter === void 0 ? void 0 : filter.operator)),
20303
+ });
20304
+ const describeRuntimeParameters = (runtimeParameters) => ({
20305
+ count: runtimeParameters.length,
20306
+ applicabilityLevels: uniqueEnumMembers(exports.ApplicabilityLevel, runtimeParameters.map((parameter) => { var _a; return (_a = parameter === null || parameter === void 0 ? void 0 : parameter.applicability) === null || _a === void 0 ? void 0 : _a.level; })),
20307
+ });
20308
+ // Column names, parameter names and operands are customer data and must never
20309
+ // reach Mixpanel; an unrecognized shape is dropped rather than forwarded.
20310
+ const summarizeRuntimeDataForTelemetry = (viewConfig) => {
20311
+ const { runtimeFilters, runtimeParameters, ...rest } = viewConfig !== null && viewConfig !== void 0 ? viewConfig : {};
20312
+ const telemetryProps = { ...rest };
20313
+ if (Array.isArray(runtimeFilters)) {
20314
+ telemetryProps.runtimeFilters = describeRuntimeFilters(runtimeFilters);
20315
+ }
20316
+ if (Array.isArray(runtimeParameters)) {
20317
+ telemetryProps.runtimeParameters = describeRuntimeParameters(runtimeParameters);
20318
+ }
20319
+ return telemetryProps;
20320
+ };
20321
+
20049
20322
  var eventemitter3 = createCommonjsModule(function (module) {
20050
20323
 
20051
20324
  var has = Object.prototype.hasOwnProperty
@@ -21003,11 +21276,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
21003
21276
  * @param ssoURL
21004
21277
  * @param triggerContainer
21005
21278
  * @param triggerText
21279
+ * @param thoughtSpotHost
21006
21280
  */
21007
- async function samlPopupFlow(ssoURL, triggerContainer, triggerText) {
21281
+ async function samlPopupFlow(ssoURL, triggerContainer, triggerText, thoughtSpotHost) {
21282
+ const thoughtSpotOrigin = new URL(thoughtSpotHost).origin;
21008
21283
  let popupClosedCheck;
21009
21284
  const openPopup = () => {
21010
- if (samlAuthWindow === null || samlAuthWindow.closed) {
21285
+ if (!samlAuthWindow || samlAuthWindow.closed) {
21011
21286
  samlAuthWindow = window.open(ssoURL, '_blank', 'location=no,height=570,width=520,scrollbars=yes,status=yes');
21012
21287
  if (samlAuthWindow) {
21013
21288
  popupClosedCheck = setInterval(() => {
@@ -21035,7 +21310,14 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
21035
21310
  }
21036
21311
  samlCompletionPromise = samlCompletionPromise || new Promise((resolve, reject) => {
21037
21312
  window.addEventListener('message', (e) => {
21038
- if (e.data.type === exports.EmbedEvent.SAMLComplete) {
21313
+ var _a;
21314
+ // Only the SSO popup we opened, on the ThoughtSpot origin, may
21315
+ // complete the flow or hand us a token; anything else could
21316
+ // inject an attacker's token into the auth cache.
21317
+ if (e.origin !== thoughtSpotOrigin || !samlAuthWindow || e.source !== samlAuthWindow) {
21318
+ return;
21319
+ }
21320
+ if (((_a = e.data) === null || _a === void 0 ? void 0 : _a.type) === exports.EmbedEvent.SAMLComplete) {
21039
21321
  if (e.data.accessToken) {
21040
21322
  const decodedToken = decodeURIComponent(e.data.accessToken);
21041
21323
  storeAuthTokenInCache(decodedToken);
@@ -21076,7 +21358,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
21076
21358
  }
21077
21359
  const ssoURL = `${thoughtSpotHost}${ssoEndPoint}`;
21078
21360
  if (embedConfig.inPopup) {
21079
- await samlPopupFlow(ssoURL, embedConfig.authTriggerContainer, embedConfig.authTriggerText);
21361
+ await samlPopupFlow(ssoURL, embedConfig.authTriggerContainer, embedConfig.authTriggerText, thoughtSpotHost);
21080
21362
  const cachedToken = getCacheAuthToken();
21081
21363
  if (cachedToken) {
21082
21364
  loggedInStatus = true;
@@ -21088,12 +21370,22 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
21088
21370
  }
21089
21371
  window.location.href = ssoURL;
21090
21372
  };
21373
+ /**
21374
+ * The popup's SSO completion page. hostAppOrigin tells ThoughtSpot which
21375
+ * origin opened the popup; the cluster only posts a token back to it if it
21376
+ * is an allowed redirect domain.
21377
+ * @param thoughtSpotHost
21378
+ */
21379
+ const getSSOCompletePageUrl = (thoughtSpotHost) => {
21380
+ const hostAppOrigin = encodeURIComponent(window.location.origin);
21381
+ return `${thoughtSpotHost}/v2/#/embed/saml-complete?hostAppOrigin=${hostAppOrigin}`;
21382
+ };
21091
21383
  const doSamlAuth = async (embedConfig) => {
21092
21384
  const { thoughtSpotHost } = embedConfig;
21093
21385
  // redirect for SSO, when the SSO authentication is done, this page will be
21094
21386
  // loaded again and the same JS will execute again.
21095
21387
  const ssoRedirectUrl = embedConfig.inPopup
21096
- ? `${thoughtSpotHost}/v2/#/embed/saml-complete`
21388
+ ? getSSOCompletePageUrl(thoughtSpotHost)
21097
21389
  : getRedirectUrl(window.location.href, SSO_REDIRECTION_MARKER_GUID, embedConfig.redirectPath);
21098
21390
  // bring back the page to the same URL
21099
21391
  const ssoEndPoint = `${EndPoints.SAML_LOGIN_TEMPLATE(encodeURIComponent(ssoRedirectUrl))}`;
@@ -21105,7 +21397,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
21105
21397
  // redirect for SSO, when the SSO authentication is done, this page will be
21106
21398
  // loaded again and the same JS will execute again.
21107
21399
  const ssoRedirectUrl = embedConfig.noRedirect || embedConfig.inPopup
21108
- ? `${thoughtSpotHost}/v2/#/embed/saml-complete`
21400
+ ? getSSOCompletePageUrl(thoughtSpotHost)
21109
21401
  : getRedirectUrl(window.location.href, SSO_REDIRECTION_MARKER_GUID, embedConfig.redirectPath);
21110
21402
  // bring back the page to the same URL
21111
21403
  const baseEndpoint = `${EndPoints.OIDC_LOGIN_TEMPLATE(encodeURIComponent(ssoRedirectUrl))}`;
@@ -22354,6 +22646,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
22354
22646
  */
22355
22647
  const PRERENDER_CONTAINER_ORIGINAL_POSITION_KEY = 'tsEmbedOriginalPosition';
22356
22648
  const PRERENDER_WRAPPER_ID_PREFIX = 'tsEmbed-pre-render-wrapper-';
22649
+ const PRERENDER_PARKED_TRANSFORM = 'translateY(-100%)';
22650
+ /** The height createPreRenderWrapper() seeds before anything is measured. */
22651
+ const UNMEASURED_WRAPPER_HEIGHT = '100vh';
22357
22652
  // The container applies UpdateEmbedParams through React state, so a delivered
22358
22653
  // post is not the same as the params being in effect.
22359
22654
  const UPDATE_EMBED_PARAMS_SETTLE_MS = 200;
@@ -22490,7 +22785,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
22490
22785
  this.shouldEncodeUrlQueryParams = false;
22491
22786
  this.defaultHiddenActions = [exports.Action.ReportError];
22492
22787
  this.preRenderContainerEl = document.body;
22493
- this.containerScrollListener = null;
22494
22788
  /**
22495
22789
  * Handler for fullscreen change events
22496
22790
  */
@@ -22670,9 +22964,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
22670
22964
  ...viewConfig,
22671
22965
  };
22672
22966
  this.registerAppInit();
22673
- uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
22674
- ...viewConfig,
22675
- });
22967
+ uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, summarizeRuntimeDataForTelemetry(viewConfig));
22676
22968
  const embedConfig = getEmbedConfig();
22677
22969
  if (embedConfig) {
22678
22970
  this.embedConfig = embedConfig;
@@ -23376,7 +23668,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
23376
23668
  top: '0',
23377
23669
  left: '0',
23378
23670
  width: '100vw',
23379
- height: '100vh',
23671
+ height: UNMEASURED_WRAPPER_HEIGHT,
23380
23672
  };
23381
23673
  setStyleProperties(preRenderWrapper, initialPreRenderWrapperStyle);
23382
23674
  return preRenderWrapper;
@@ -23444,10 +23736,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
23444
23736
  return placeholder;
23445
23737
  }
23446
23738
  /**
23447
- * Resolves the configured preRenderContainer to a live element, falling
23448
- * back to `document.body`. A string selector is re-queried on every call so
23449
- * a remounted container (E.g.: React replacing the node) resolves to the
23450
- * fresh element; an element passed directly cannot be re-resolved.
23739
+ * Resolves the configured preRenderContainer, or defaults to the host's
23740
+ * nearest scrolling ancestor (document.body if none). The absolutely
23741
+ * positioned wrapper only follows the page while it sits inside what
23742
+ * scrolls, so body is right only when the document itself scrolls — an inner
23743
+ * scroller left the frame pinned to the viewport (SCAL-338563). A string
23744
+ * selector is re-queried each call so a remounted container resolves fresh.
23451
23745
  */
23452
23746
  resolvePreRenderContainerTarget() {
23453
23747
  var _a;
@@ -23467,7 +23761,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
23467
23761
  else if (containerConfig) {
23468
23762
  container = containerConfig;
23469
23763
  }
23470
- return (_a = container) !== null && _a !== void 0 ? _a : document.body;
23764
+ if (container) {
23765
+ return container;
23766
+ }
23767
+ if (!this.hostElement) {
23768
+ return document.body;
23769
+ }
23770
+ return (_a = getScrollableAncestors(this.hostElement)[0]) !== null && _a !== void 0 ? _a : document.body;
23471
23771
  }
23472
23772
  inheritPreRenderContainer() {
23473
23773
  var _a;
@@ -23512,8 +23812,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
23512
23812
  * Re-attaches the wrapper to a live container when the previously resolved
23513
23813
  * one has been detached or no longer holds the wrapper — e.g. the host app
23514
23814
  * remounted a custom preRenderContainer, which would otherwise leave a stale
23515
- * reference and collapse the wrapper. Only string selectors can be
23516
- * re-resolved; a container passed as an element is left untouched.
23815
+ * reference and collapse the wrapper. Selectors and the auto-resolved
23816
+ * scrolling ancestor are both re-resolved; a container passed as an element
23817
+ * is left untouched, as there is nothing to re-query.
23517
23818
  */
23518
23819
  reconcilePreRenderContainer() {
23519
23820
  const wrapper = this.preRenderWrapper;
@@ -23532,14 +23833,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
23532
23833
  if (resolved === stored && stored.contains(wrapper)) {
23533
23834
  return;
23534
23835
  }
23535
- if (this.containerScrollListener && stored !== resolved) {
23536
- if (stored !== document.body) {
23537
- stored.removeEventListener('scroll', this.containerScrollListener);
23538
- }
23539
- if (resolved !== document.body) {
23540
- resolved.addEventListener('scroll', this.containerScrollListener);
23541
- }
23542
- }
23543
23836
  this.preRenderContainerEl = resolved;
23544
23837
  this.applyPreRenderContainerPositioning();
23545
23838
  if (wrapper.parentNode !== resolved) {
@@ -23601,11 +23894,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
23601
23894
  */
23602
23895
  setIFrameHeight(height) {
23603
23896
  if (this.isPreRendered) {
23897
+ const next = getCssDimension(height);
23604
23898
  if (this.insertedDomEl) {
23605
- this.insertedDomEl.style.height = getCssDimension(height);
23899
+ this.insertedDomEl.style.height = next;
23606
23900
  }
23607
23901
  else if (this.preRenderWrapper) {
23608
- this.preRenderWrapper.style.height = getCssDimension(height);
23902
+ this.preRenderWrapper.style.height = next;
23609
23903
  }
23610
23904
  }
23611
23905
  else {
@@ -24047,34 +24341,47 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
24047
24341
  delete container.dataset[PRERENDER_CONTAINER_ORIGINAL_POSITION_KEY];
24048
24342
  }
24049
24343
  /**
24050
- * Detaches and clears the container scroll listener, if one is attached.
24051
- */
24052
- removeContainerScrollListener() {
24053
- if (!this.containerScrollListener) {
24344
+ * Re-sizes the wrapper when its placeholder changes size.
24345
+ *
24346
+ * Position deliberately has no equivalent. An absolutely positioned wrapper
24347
+ * follows its containing block for free, so a correctly placed frame is the
24348
+ * browser's job and costs nothing; repositioning it on scroll would mean a
24349
+ * layout read and a style write per frame to compensate for placing it in
24350
+ * the wrong box. Size is the one thing the browser will not do for us: the
24351
+ * placeholder grows when the embedded app reports a new height, and the
24352
+ * wrapper has to be told.
24353
+ */
24354
+ observePreRenderSize() {
24355
+ var _a;
24356
+ if (this.getPreRenderConfig().doNotTrackSize || typeof ResizeObserver === 'undefined') {
24357
+ return;
24358
+ }
24359
+ const placeholder = this.getPreRenderPlaceHolderElement();
24360
+ if (!placeholder) {
24054
24361
  return;
24055
24362
  }
24056
- const customContainer = this.getCustomPreRenderContainer();
24057
- customContainer === null || customContainer === void 0 ? void 0 : customContainer.removeEventListener('scroll', this.containerScrollListener);
24058
- this.containerScrollListener = null;
24363
+ (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
24364
+ this.resizeObserver = new ResizeObserver(() => this.syncPreRenderStyle());
24365
+ this.resizeObserver.observe(placeholder);
24059
24366
  }
24060
24367
  /**
24061
24368
  * Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
24062
24369
  * @version SDK: 1.19.1 | ThoughtSpot: *
24063
24370
  */
24064
24371
  destroy() {
24065
- var _a, _b, _c;
24372
+ var _a, _b, _c, _d;
24066
24373
  try {
24067
24374
  this.removeFullscreenChangeHandler();
24068
- this.removeContainerScrollListener();
24375
+ (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
24069
24376
  this.unsubscribeToEvents();
24070
- (_a = this.preRenderWrapper) === null || _a === void 0 ? void 0 : _a.remove();
24377
+ (_b = this.preRenderWrapper) === null || _b === void 0 ? void 0 : _b.remove();
24071
24378
  this.restorePreRenderContainerPosition();
24072
24379
  if (!this.isRendered) {
24073
24380
  return;
24074
24381
  }
24075
24382
  if (!getEmbedConfig().waitForCleanupOnDestroy) {
24076
24383
  this.trigger(exports.HostEvent.DestroyEmbed);
24077
- (_c = (_b = this.insertedDomEl) === null || _b === void 0 ? void 0 : _b.parentNode) === null || _c === void 0 ? void 0 : _c.removeChild(this.insertedDomEl);
24384
+ (_d = (_c = this.insertedDomEl) === null || _c === void 0 ? void 0 : _c.parentNode) === null || _d === void 0 ? void 0 : _d.removeChild(this.insertedDomEl);
24078
24385
  }
24079
24386
  else {
24080
24387
  const cleanupTimeout = getEmbedConfig().cleanupTimeout;
@@ -24165,7 +24472,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
24165
24472
  * wrapper to overlay it.
24166
24473
  */
24167
24474
  async showPreRender() {
24168
- var _a, _b;
24475
+ var _a;
24169
24476
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_SHOW_PRE_RENDER, {
24170
24477
  preRenderId: this.getPreRenderConfig().id,
24171
24478
  embedComponentType: this.viewConfig.embedComponentType,
@@ -24184,14 +24491,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
24184
24491
  this.beforePrerenderVisible();
24185
24492
  if (this.hostElement) {
24186
24493
  this.insertedDomEl = this.createPreRenderPlaceholder();
24187
- if (this.viewConfig.fullHeight) {
24188
- // If fullHeight has already sized the wrapper, seed the
24189
- // placeholder with the same height so syncPreRenderStyle gets
24190
- // an accurate rect.
24191
- const existingHeight = this.preRenderWrapper.style.height;
24192
- if (existingHeight) {
24193
- this.insertedDomEl.style.height = existingHeight;
24194
- }
24494
+ // Carry a height fullHeight has already measured onto the fresh
24495
+ // placeholder, so a re-show does not flash at frameParams height.
24496
+ // UNMEASURED_WRAPPER_HEIGHT is what createPreRenderWrapper() seeds
24497
+ // before anything has been measured; treating that as a measurement
24498
+ // is what made a first reveal overshoot to a full viewport.
24499
+ const wrapperHeight = this.preRenderWrapper.style.height;
24500
+ if (this.viewConfig.fullHeight
24501
+ && wrapperHeight
24502
+ && wrapperHeight !== UNMEASURED_WRAPPER_HEIGHT) {
24503
+ this.insertedDomEl.style.height = wrapperHeight;
24195
24504
  }
24196
24505
  const placeHolderId = this.getPreRenderIds().placeHolder;
24197
24506
  // Remove any stale placeholder from a previous cycle. It is located
@@ -24205,29 +24514,19 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
24205
24514
  (_a = this.hostElement.querySelector(`#${placeHolderId}`)) === null || _a === void 0 ? void 0 : _a.remove();
24206
24515
  this.hostElement.appendChild(this.insertedDomEl);
24207
24516
  this.syncPreRenderStyle();
24208
- const customContainer = this.getCustomPreRenderContainer();
24209
- if (customContainer && !this.containerScrollListener) {
24210
- this.containerScrollListener = () => this.syncPreRenderStyle();
24211
- customContainer.addEventListener('scroll', this.containerScrollListener);
24212
- }
24213
- if (!this.getPreRenderConfig().doNotTrackSize) {
24214
- const observeTarget = (_b = this.insertedDomEl) !== null && _b !== void 0 ? _b : this.hostElement;
24215
- this.resizeObserver = new ResizeObserver((entries) => {
24216
- entries.forEach((entry) => {
24217
- if (entry.target === observeTarget) {
24218
- this.syncPreRenderStyle();
24219
- }
24220
- });
24221
- });
24222
- this.resizeObserver.observe(observeTarget);
24223
- }
24517
+ this.observePreRenderSize();
24224
24518
  }
24225
24519
  removeStyleProperties(this.preRenderWrapper, [
24226
24520
  'z-index',
24227
24521
  'opacity',
24228
- 'pointer-events',
24229
24522
  'overflow',
24523
+ 'transform',
24230
24524
  ]);
24525
+ // Set rather than removed: a container that carries `pointer-events:
24526
+ // none` — the usual styling for a parking root that must not swallow
24527
+ // clicks — passes it down, and dropping the property here would leave
24528
+ // the inherited `none` in force and the frame dead to input.
24529
+ setStyleProperties(this.preRenderWrapper, { pointerEvents: 'auto' });
24231
24530
  this.subscribeToEvents();
24232
24531
  // Setup fullscreen change handler for prerendered components
24233
24532
  if (this.iFrame) {
@@ -24280,6 +24579,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
24280
24579
  * If the component is not preRendered, it issues a warning.
24281
24580
  */
24282
24581
  hidePreRender() {
24582
+ var _a;
24283
24583
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_HIDE_PRE_RENDER, {
24284
24584
  preRenderId: this.getPreRenderConfig().id,
24285
24585
  embedComponentType: this.viewConfig.embedComponentType,
@@ -24291,20 +24591,25 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
24291
24591
  return;
24292
24592
  }
24293
24593
  const { zIndex } = this.getPreRenderConfig();
24594
+ // A hidden pre-render frame must add no scroll space to the host page.
24294
24595
  const preRenderHideStyles = {
24295
24596
  opacity: '0',
24296
24597
  pointerEvents: 'none',
24297
24598
  zIndex: zIndex !== undefined ? String(zIndex) : '-1000',
24298
- position: 'absolute',
24599
+ // Resolves to the viewport, so the hidden frame belongs to no
24600
+ // scroll container's overflow; syncPreRenderStyle restores absolute
24601
+ // on show.
24602
+ position: 'fixed',
24299
24603
  top: '0',
24300
24604
  left: '0',
24301
24605
  overflow: 'hidden',
24606
+ // The one exception: a transformed or contained ancestor captures
24607
+ // `fixed`; parking above the top edge keeps it out of that
24608
+ // overflow.
24609
+ transform: PRERENDER_PARKED_TRANSFORM,
24302
24610
  };
24303
24611
  setStyleProperties(this.preRenderWrapper, preRenderHideStyles);
24304
- this.removeContainerScrollListener();
24305
- if (this.resizeObserver) {
24306
- this.resizeObserver.disconnect();
24307
- }
24612
+ (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
24308
24613
  const placeHolderEle = this.getPreRenderPlaceHolderElement();
24309
24614
  if (placeHolderEle) {
24310
24615
  placeHolderEle.parentElement.removeChild(placeHolderEle);
@@ -24470,8 +24775,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
24470
24775
  embedParams: { visualOverridesParams: visualOverrides },
24471
24776
  };
24472
24777
  }
24778
+ // The app reads enableSpotterInstructionAndMoreSettings from the top level
24779
+ // of embedParams, so lift it out of the sidebar config.
24780
+ const { enableSpotterInstructionAndMoreSettings, ...sidebarConfigRest } = spotterSidebarConfig || {};
24473
24781
  const resolvedSidebarConfig = {
24474
- ...spotterSidebarConfig,
24782
+ ...sidebarConfigRest,
24475
24783
  ...(resolvedEnablePastConversations !== undefined && {
24476
24784
  enablePastConversationsSidebar: resolvedEnablePastConversations,
24477
24785
  }),
@@ -24493,6 +24801,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
24493
24801
  embedParams: {
24494
24802
  ...(defaultAppInitData.embedParams || {}),
24495
24803
  spotterSidebarConfig: resolvedSidebarConfig,
24804
+ ...(enableSpotterInstructionAndMoreSettings !== undefined
24805
+ ? { enableSpotterInstructionAndMoreSettings }
24806
+ : {}),
24496
24807
  ...(visualOverrides !== undefined ? { visualOverridesParams: visualOverrides } : {}),
24497
24808
  },
24498
24809
  };
@@ -25062,6 +25373,46 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
25062
25373
  }
25063
25374
  }
25064
25375
 
25376
+ /**
25377
+ * This method is like `_.isEqual` except that it accepts `customizer` which
25378
+ * is invoked to compare values. If `customizer` returns `undefined`, comparisons
25379
+ * are handled by the method instead. The `customizer` is invoked with up to
25380
+ * six arguments: (objValue, othValue [, index|key, object, other, stack]).
25381
+ *
25382
+ * @static
25383
+ * @memberOf _
25384
+ * @since 4.0.0
25385
+ * @category Lang
25386
+ * @param {*} value The value to compare.
25387
+ * @param {*} other The other value to compare.
25388
+ * @param {Function} [customizer] The function to customize comparisons.
25389
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
25390
+ * @example
25391
+ *
25392
+ * function isGreeting(value) {
25393
+ * return /^h(?:i|ello)$/.test(value);
25394
+ * }
25395
+ *
25396
+ * function customizer(objValue, othValue) {
25397
+ * if (isGreeting(objValue) && isGreeting(othValue)) {
25398
+ * return true;
25399
+ * }
25400
+ * }
25401
+ *
25402
+ * var array = ['hello', 'goodbye'];
25403
+ * var other = ['hi', 'goodbye'];
25404
+ *
25405
+ * _.isEqualWith(array, other, customizer);
25406
+ * // => true
25407
+ */
25408
+ function isEqualWith(value, other, customizer) {
25409
+ customizer = typeof customizer == 'function' ? customizer : undefined;
25410
+ var result = customizer ? customizer(value, other) : undefined;
25411
+ return result === undefined ? _baseIsEqual(value, other, undefined, customizer) : !!result;
25412
+ }
25413
+
25414
+ var isEqualWith_1 = isEqualWith;
25415
+
25065
25416
  const getPreviewQuery = `
25066
25417
  query GetEurekaVizSnapshots(
25067
25418
  $vizId: String!, $liveboardId: String!) {
@@ -25176,6 +25527,11 @@ query GetEurekaVizSnapshots(
25176
25527
  * })
25177
25528
  * ```
25178
25529
  */
25530
+ /**
25531
+ * A shallow copy without the keys whose value is `undefined`, so a key that was
25532
+ * assigned `undefined` compares equal to one that was never set.
25533
+ */
25534
+ const definedEntries = (config = {}) => Object.fromEntries(Object.entries(config).filter(([, value]) => value !== undefined));
25179
25535
  class LiveboardEmbed extends V1Embed {
25180
25536
  constructor(domSelector, viewConfig) {
25181
25537
  viewConfig.embedComponentType = 'LiveboardEmbed';
@@ -25461,16 +25817,18 @@ query GetEurekaVizSnapshots(
25461
25817
  beforePrerenderVisible() {
25462
25818
  super.beforePrerenderVisible();
25463
25819
  // Captured before showPreRender() hands the wrapper over to this
25464
- // instance. Itself means a hide/show, not a hand-over, so there is
25465
- // nothing stale to clear.
25820
+ // instance. React builds a new instance per mount, so an equal config
25821
+ // is a hide/show, not a hand-over: there is nothing stale to clear.
25466
25822
  const previous = this.getPreRenderObj();
25467
- const showing = previous === this ? undefined : previous === null || previous === void 0 ? void 0 : previous.currentLiveboardState;
25823
+ const previousRoute = this.isSameEmbedConfig(previous)
25824
+ ? undefined
25825
+ : previous === null || previous === void 0 ? void 0 : previous.currentLiveboardState;
25468
25826
  this.executeAfterEmbedContainerLoaded(async () => {
25469
25827
  // Without this the params callback suspends on its await and
25470
25828
  // Navigate goes out first, so the container loads with the previous
25471
25829
  // config's filters.
25472
25830
  await this.preRenderParamsApplied;
25473
- if (this.isShowingLiveboardRoute(showing)) {
25831
+ if (this.isAlreadyOnSameRoute(previousRoute)) {
25474
25832
  // Navigate to the route we are already on is a no-op, so the
25475
25833
  // liveboard keeps its state. Home unmounts the container, which
25476
25834
  // clears it.
@@ -25491,17 +25849,27 @@ query GetEurekaVizSnapshots(
25491
25849
  };
25492
25850
  });
25493
25851
  }
25852
+ // definedEntries drops undefined-valued keys: a shown instance carries
25853
+ // vizId/activeTabId/etc as undefined, so a raw isEqual never matches again.
25854
+ // Functions compare equal, since React passes a fresh closure per render.
25855
+ isSameEmbedConfig(previous) {
25856
+ if (!previous)
25857
+ return false;
25858
+ if (previous === this)
25859
+ return true;
25860
+ return isEqualWith_1(definedEntries(previous.viewConfig), definedEntries(this.viewConfig), (a, b) => (typeof a === 'function' && typeof b === 'function' ? true : undefined));
25861
+ }
25494
25862
  // The whole route, not just the liveboard id: the path is built from the
25495
25863
  // viz, tab and view too, so a same-liveboard show onto another tab is a
25496
25864
  // real navigation.
25497
- isShowingLiveboardRoute(showing) {
25498
- if (!(showing === null || showing === void 0 ? void 0 : showing.liveboardId))
25865
+ isAlreadyOnSameRoute(previousRoute) {
25866
+ if (!(previousRoute === null || previousRoute === void 0 ? void 0 : previousRoute.liveboardId))
25499
25867
  return false;
25500
25868
  const { liveboardId, vizId, activeTabId, personalizedViewId, } = this.viewConfig;
25501
- return showing.liveboardId === liveboardId
25502
- && showing.vizId === vizId
25503
- && showing.activeTabId === activeTabId
25504
- && showing.personalizedViewId === personalizedViewId;
25869
+ return previousRoute.liveboardId === liveboardId
25870
+ && previousRoute.vizId === vizId
25871
+ && previousRoute.activeTabId === activeTabId
25872
+ && previousRoute.personalizedViewId === personalizedViewId;
25505
25873
  }
25506
25874
  async handleRenderForPrerender() {
25507
25875
  if (isUndefined$1(this.viewConfig.liveboardId)) {
@@ -27291,6 +27659,27 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
27291
27659
  */
27292
27660
  const CONVERSATION_SERVICE_PATH = '/conversation/v2';
27293
27661
  const DEFAULT_STALE_ANSWER_NOTICE = 'This data may have changed since the last time you had a chat.';
27662
+ /**
27663
+ * Actions hidden by default on Answers rendered by the ThoughtSpot MCP server
27664
+ * (iframes carrying the `tsmcp=true` marker). Applied automatically by
27665
+ * {@link AutoFrameRenderer} so the auto-rendered answer exposes a curated set of
27666
+ * controls: Pin/Save/Download at the top level, Aggregate/Filter/Sort/Position in
27667
+ * the column menu, and Exclude/Only include/Drill down/Show underlying data in the
27668
+ * axis menu remain visible, while the actions below are removed.
27669
+ *
27670
+ * This is a denylist merged into {@link Param.HideActions}; anything not listed
27671
+ * here stays visible. It is skipped when the caller supplies a `visibleActions`
27672
+ * allowlist (see {@link AutoFrameRenderer.getEmbedParamsObject}).
27673
+ */
27674
+ const HiddenActionItemByDefaultForMCPAnswers = [
27675
+ exports.Action.Edit,
27676
+ exports.Action.InConversationTraining,
27677
+ exports.Action.AxisMenuConditionalFormat,
27678
+ exports.Action.AxisMenuRename,
27679
+ exports.Action.AxisMenuEdit,
27680
+ exports.Action.AxisMenuRemove,
27681
+ exports.Action.MakeACopy,
27682
+ ];
27294
27683
  /**
27295
27684
  * Starts an automatic renderer that watches the DOM for iframes containing
27296
27685
  * the `tsmcp=true` query parameter and replaces them with fully configured
@@ -27458,6 +27847,36 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
27458
27847
  request.then(release, release);
27459
27848
  return request;
27460
27849
  }
27850
+ /**
27851
+ * Normalizes a `hideAction` value into an array of action ids. The SDK-side value
27852
+ * is already an `Action[]`; a value coming off the source iframe URL is a string
27853
+ * that may be a JSON array (`["edit","save"]`) or a comma-separated list.
27854
+ */
27855
+ function parseHideActions(value) {
27856
+ if (Array.isArray(value)) {
27857
+ return value;
27858
+ }
27859
+ if (typeof value !== 'string' || value === '') {
27860
+ return [];
27861
+ }
27862
+ try {
27863
+ const parsed = JSON.parse(value);
27864
+ if (Array.isArray(parsed)) {
27865
+ return parsed.map(String);
27866
+ }
27867
+ }
27868
+ catch (e) {
27869
+ // Not JSON — fall back to a comma-separated list.
27870
+ }
27871
+ return value.split(',').map((s) => s.trim()).filter(Boolean);
27872
+ }
27873
+ /**
27874
+ * Unions two `hideAction` values (SDK-computed and source-iframe) into a single
27875
+ * de-duplicated array of action ids.
27876
+ */
27877
+ function unionHideActions(sdkValue, sourceValue) {
27878
+ return Array.from(new Set([...parseHideActions(sdkValue), ...parseHideActions(sourceValue)]));
27879
+ }
27461
27880
  function isTSMCPIframe(iframe) {
27462
27881
  try {
27463
27882
  const url = new URL(iframe.src);
@@ -27484,11 +27903,41 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
27484
27903
  super(container, viewConfig);
27485
27904
  this.viewConfig = viewConfig;
27486
27905
  }
27906
+ /**
27907
+ * Extends the base embed params with the curated MCP-answer denylist
27908
+ * ({@link HiddenActionItemByDefaultForMCPAnswers}) and a marker letting
27909
+ * the ThoughtSpot app detect this answer was rendered via the MCP
27910
+ * auto-frame-renderer ({@link Param.IsMcpAnswerEmbed}).
27911
+ *
27912
+ * Precedence — merge, allowlist wins:
27913
+ * - When the caller supplies a `visibleActions` allowlist, the base already
27914
+ * set {@link Param.VisibleActions}; the denylist is skipped so the allowlist
27915
+ * fully controls visibility.
27916
+ * - Otherwise the denylist is unioned onto {@link Param.HideActions}, which the
27917
+ * base has already populated with the default hidden actions plus any
27918
+ * caller-supplied `hiddenActions`.
27919
+ */
27920
+ getEmbedParamsObject() {
27921
+ const queryParams = super.getEmbedParamsObject();
27922
+ if (!queryParams[Param.VisibleActions]) {
27923
+ // `additionalFlags` can override this with a non-array value, so
27924
+ // normalize it rather than spreading it directly.
27925
+ queryParams[Param.HideActions] = unionHideActions(queryParams[Param.HideActions], HiddenActionItemByDefaultForMCPAnswers);
27926
+ }
27927
+ queryParams[Param.IsMcpAnswerEmbed] = true;
27928
+ return queryParams;
27929
+ }
27487
27930
  /**
27488
27931
  * Builds the final iframe `src` by merging the SDK embed parameters
27489
27932
  * with the query parameters already present on the source iframe URL.
27933
+ *
27490
27934
  * The `tsmcp` marker param is removed so it does not propagate to the
27491
- * ThoughtSpot application.
27935
+ * ThoughtSpot application. This is not just cosmetic: `tsmcp=true` is
27936
+ * also how {@link isTSMCPIframe} recognizes an iframe as one this
27937
+ * renderer must process. If the marker survived onto the iframe this
27938
+ * class inserts, the same {@link MutationObserver} would immediately
27939
+ * detect its own output as a new MCP iframe and re-process it, causing
27940
+ * infinite recursive replacement. Do not re-add `tsmcp` here.
27492
27941
  *
27493
27942
  * @param sourceSrc - The original iframe's `src` URL string.
27494
27943
  * @param preserveSourceUrl - When true, return the source URL unchanged.
@@ -27506,7 +27955,15 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
27506
27955
  // Replay markers address the SDK, not the ThoughtSpot application.
27507
27956
  delete existingQueryParamsObject[Param.TsmcpConversationId];
27508
27957
  delete existingQueryParamsObject[Param.TsmcpAnswerIndex];
27958
+ // Source-iframe params win over SDK params on merge. Hidden actions
27959
+ // are the exception: union them so a `hideAction` on the source iframe
27960
+ // does not clobber the SDK-computed denylist (and vice versa).
27961
+ const mergedHideActions = unionHideActions(queryParams[Param.HideActions], existingQueryParamsObject[Param.HideActions]);
27962
+ delete existingQueryParamsObject[Param.HideActions];
27509
27963
  const mergedQueryParams = { ...queryParams, ...existingQueryParamsObject };
27964
+ if (mergedHideActions.length) {
27965
+ mergedQueryParams[Param.HideActions] = mergedHideActions;
27966
+ }
27510
27967
  const mergedQueryParamsString = getQueryParamString(mergedQueryParams, true);
27511
27968
  const queryString = mergedQueryParamsString ? `?${mergedQueryParamsString}` : '';
27512
27969
  const hash = resolved