@thoughtspot/visual-embed-sdk 1.52.1 → 1.52.2-beta.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 (217) hide show
  1. package/cjs/package.json +10 -3
  2. package/cjs/src/contracts/host-event-contracts.d.ts +49 -11
  3. package/cjs/src/contracts/host-event-contracts.d.ts.map +1 -1
  4. package/cjs/src/embed/app.d.ts +4 -3
  5. package/cjs/src/embed/app.d.ts.map +1 -1
  6. package/cjs/src/embed/app.js.map +1 -1
  7. package/cjs/src/embed/app.spec.js +10 -0
  8. package/cjs/src/embed/app.spec.js.map +1 -1
  9. package/cjs/src/embed/auto-frame-renderer.spec.js +24 -13
  10. package/cjs/src/embed/auto-frame-renderer.spec.js.map +1 -1
  11. package/cjs/src/embed/conversation.d.ts +1 -0
  12. package/cjs/src/embed/conversation.d.ts.map +1 -1
  13. package/cjs/src/embed/conversation.js +3 -3
  14. package/cjs/src/embed/conversation.js.map +1 -1
  15. package/cjs/src/embed/conversation.spec.js +35 -24
  16. package/cjs/src/embed/conversation.spec.js.map +1 -1
  17. package/cjs/src/embed/embedConfig.spec.js +2 -1
  18. package/cjs/src/embed/embedConfig.spec.js.map +1 -1
  19. package/cjs/src/embed/hostEventClient/host-event-client.d.ts +2 -2
  20. package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  21. package/cjs/src/embed/hostEventClient/host-event-client.js +16 -10
  22. package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
  23. package/cjs/src/embed/hostEventClient/host-event-client.spec.js +14 -8
  24. package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  25. package/cjs/src/embed/hostEventClient/utils.d.ts +9 -0
  26. package/cjs/src/embed/hostEventClient/utils.d.ts.map +1 -1
  27. package/cjs/src/embed/hostEventClient/utils.js +49 -3
  28. package/cjs/src/embed/hostEventClient/utils.js.map +1 -1
  29. package/cjs/src/embed/hostEventClient/utils.spec.js +151 -0
  30. package/cjs/src/embed/hostEventClient/utils.spec.js.map +1 -1
  31. package/cjs/src/embed/liveboard.d.ts +4 -3
  32. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  33. package/cjs/src/embed/liveboard.js +17 -12
  34. package/cjs/src/embed/liveboard.js.map +1 -1
  35. package/cjs/src/embed/liveboard.spec.js +2 -1
  36. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  37. package/cjs/src/embed/spotter-utils.d.ts +8 -1
  38. package/cjs/src/embed/spotter-utils.d.ts.map +1 -1
  39. package/cjs/src/embed/spotter-utils.js +14 -1
  40. package/cjs/src/embed/spotter-utils.js.map +1 -1
  41. package/cjs/src/embed/spotter-utils.spec.js +26 -0
  42. package/cjs/src/embed/spotter-utils.spec.js.map +1 -1
  43. package/cjs/src/embed/ts-embed.d.ts +35 -10
  44. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  45. package/cjs/src/embed/ts-embed.js +108 -73
  46. package/cjs/src/embed/ts-embed.js.map +1 -1
  47. package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
  48. package/cjs/src/embed/ts-embed.spec.js +203 -30
  49. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  50. package/cjs/src/errors.js +1 -1
  51. package/cjs/src/errors.js.map +1 -1
  52. package/cjs/src/index.d.ts +2 -1
  53. package/cjs/src/index.d.ts.map +1 -1
  54. package/cjs/src/index.js +3 -1
  55. package/cjs/src/index.js.map +1 -1
  56. package/cjs/src/react/all-types-export.d.ts +1 -1
  57. package/cjs/src/react/all-types-export.d.ts.map +1 -1
  58. package/cjs/src/react/all-types-export.js +2 -1
  59. package/cjs/src/react/all-types-export.js.map +1 -1
  60. package/cjs/src/types.d.ts +45 -22
  61. package/cjs/src/types.d.ts.map +1 -1
  62. package/cjs/src/types.js +44 -21
  63. package/cjs/src/types.js.map +1 -1
  64. package/cjs/src/utils/authService/tokenizedAuthService.spec.js +2 -1
  65. package/cjs/src/utils/authService/tokenizedAuthService.spec.js.map +1 -1
  66. package/cjs/src/utils/custom-actions.spec.js +4 -2
  67. package/cjs/src/utils/custom-actions.spec.js.map +1 -1
  68. package/cjs/src/utils/filterConverter.d.ts +106 -0
  69. package/cjs/src/utils/filterConverter.d.ts.map +1 -0
  70. package/cjs/src/utils/filterConverter.js +215 -0
  71. package/cjs/src/utils/filterConverter.js.map +1 -0
  72. package/cjs/src/utils/filterConverter.spec.d.ts +2 -0
  73. package/cjs/src/utils/filterConverter.spec.d.ts.map +1 -0
  74. package/cjs/src/utils/filterConverter.spec.js +709 -0
  75. package/cjs/src/utils/filterConverter.spec.js.map +1 -0
  76. package/cjs/src/utils/processData.spec.js +2 -1
  77. package/cjs/src/utils/processData.spec.js.map +1 -1
  78. package/dist/{index-C1pmYb5H.js → index-BrJMbt8r.js} +1 -1
  79. package/dist/src/contracts/host-event-contracts.d.ts +49 -11
  80. package/dist/src/contracts/host-event-contracts.d.ts.map +1 -1
  81. package/dist/src/embed/app.d.ts +4 -3
  82. package/dist/src/embed/app.d.ts.map +1 -1
  83. package/dist/src/embed/conversation.d.ts +1 -0
  84. package/dist/src/embed/conversation.d.ts.map +1 -1
  85. package/dist/src/embed/hostEventClient/host-event-client.d.ts +2 -2
  86. package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  87. package/dist/src/embed/hostEventClient/utils.d.ts +9 -0
  88. package/dist/src/embed/hostEventClient/utils.d.ts.map +1 -1
  89. package/dist/src/embed/liveboard.d.ts +4 -3
  90. package/dist/src/embed/liveboard.d.ts.map +1 -1
  91. package/dist/src/embed/spotter-utils.d.ts +8 -1
  92. package/dist/src/embed/spotter-utils.d.ts.map +1 -1
  93. package/dist/src/embed/ts-embed.d.ts +35 -10
  94. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  95. package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
  96. package/dist/src/index.d.ts +2 -1
  97. package/dist/src/index.d.ts.map +1 -1
  98. package/dist/src/react/all-types-export.d.ts +1 -1
  99. package/dist/src/react/all-types-export.d.ts.map +1 -1
  100. package/dist/src/types.d.ts +45 -22
  101. package/dist/src/types.d.ts.map +1 -1
  102. package/dist/src/utils/filterConverter.d.ts +106 -0
  103. package/dist/src/utils/filterConverter.d.ts.map +1 -0
  104. package/dist/src/utils/filterConverter.spec.d.ts +2 -0
  105. package/dist/src/utils/filterConverter.spec.d.ts.map +1 -0
  106. package/dist/tsembed-react.es.js +252 -126
  107. package/dist/tsembed-react.js +251 -125
  108. package/dist/tsembed.es.js +460 -127
  109. package/dist/tsembed.js +459 -125
  110. package/dist/visual-embed-sdk-react-full.d.ts +233 -49
  111. package/dist/visual-embed-sdk-react.d.ts +139 -49
  112. package/dist/visual-embed-sdk.d.ts +233 -49
  113. package/lib/package.json +10 -3
  114. package/lib/src/contracts/host-event-contracts.d.ts +49 -11
  115. package/lib/src/contracts/host-event-contracts.d.ts.map +1 -1
  116. package/lib/src/embed/app.d.ts +4 -3
  117. package/lib/src/embed/app.d.ts.map +1 -1
  118. package/lib/src/embed/app.js.map +1 -1
  119. package/lib/src/embed/app.spec.js +10 -0
  120. package/lib/src/embed/app.spec.js.map +1 -1
  121. package/lib/src/embed/auto-frame-renderer.spec.js +24 -13
  122. package/lib/src/embed/auto-frame-renderer.spec.js.map +1 -1
  123. package/lib/src/embed/conversation.d.ts +1 -0
  124. package/lib/src/embed/conversation.d.ts.map +1 -1
  125. package/lib/src/embed/conversation.js +4 -4
  126. package/lib/src/embed/conversation.js.map +1 -1
  127. package/lib/src/embed/conversation.spec.js +35 -24
  128. package/lib/src/embed/conversation.spec.js.map +1 -1
  129. package/lib/src/embed/embedConfig.spec.js +2 -1
  130. package/lib/src/embed/embedConfig.spec.js.map +1 -1
  131. package/lib/src/embed/hostEventClient/host-event-client.d.ts +2 -2
  132. package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  133. package/lib/src/embed/hostEventClient/host-event-client.js +17 -11
  134. package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
  135. package/lib/src/embed/hostEventClient/host-event-client.spec.js +14 -8
  136. package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  137. package/lib/src/embed/hostEventClient/utils.d.ts +9 -0
  138. package/lib/src/embed/hostEventClient/utils.d.ts.map +1 -1
  139. package/lib/src/embed/hostEventClient/utils.js +47 -2
  140. package/lib/src/embed/hostEventClient/utils.js.map +1 -1
  141. package/lib/src/embed/hostEventClient/utils.spec.js +152 -1
  142. package/lib/src/embed/hostEventClient/utils.spec.js.map +1 -1
  143. package/lib/src/embed/liveboard.d.ts +4 -3
  144. package/lib/src/embed/liveboard.d.ts.map +1 -1
  145. package/lib/src/embed/liveboard.js +17 -12
  146. package/lib/src/embed/liveboard.js.map +1 -1
  147. package/lib/src/embed/liveboard.spec.js +2 -1
  148. package/lib/src/embed/liveboard.spec.js.map +1 -1
  149. package/lib/src/embed/spotter-utils.d.ts +8 -1
  150. package/lib/src/embed/spotter-utils.d.ts.map +1 -1
  151. package/lib/src/embed/spotter-utils.js +12 -0
  152. package/lib/src/embed/spotter-utils.js.map +1 -1
  153. package/lib/src/embed/spotter-utils.spec.js +27 -1
  154. package/lib/src/embed/spotter-utils.spec.js.map +1 -1
  155. package/lib/src/embed/ts-embed.d.ts +35 -10
  156. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  157. package/lib/src/embed/ts-embed.js +109 -74
  158. package/lib/src/embed/ts-embed.js.map +1 -1
  159. package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
  160. package/lib/src/embed/ts-embed.spec.js +203 -30
  161. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  162. package/lib/src/errors.js +1 -1
  163. package/lib/src/errors.js.map +1 -1
  164. package/lib/src/index.d.ts +2 -1
  165. package/lib/src/index.d.ts.map +1 -1
  166. package/lib/src/index.js +2 -1
  167. package/lib/src/index.js.map +1 -1
  168. package/lib/src/react/all-types-export.d.ts +1 -1
  169. package/lib/src/react/all-types-export.d.ts.map +1 -1
  170. package/lib/src/react/all-types-export.js +1 -1
  171. package/lib/src/react/all-types-export.js.map +1 -1
  172. package/lib/src/types.d.ts +45 -22
  173. package/lib/src/types.d.ts.map +1 -1
  174. package/lib/src/types.js +44 -21
  175. package/lib/src/types.js.map +1 -1
  176. package/lib/src/utils/authService/tokenizedAuthService.spec.js +2 -1
  177. package/lib/src/utils/authService/tokenizedAuthService.spec.js.map +1 -1
  178. package/lib/src/utils/custom-actions.spec.js +4 -2
  179. package/lib/src/utils/custom-actions.spec.js.map +1 -1
  180. package/lib/src/utils/filterConverter.d.ts +106 -0
  181. package/lib/src/utils/filterConverter.d.ts.map +1 -0
  182. package/lib/src/utils/filterConverter.js +210 -0
  183. package/lib/src/utils/filterConverter.js.map +1 -0
  184. package/lib/src/utils/filterConverter.spec.d.ts +2 -0
  185. package/lib/src/utils/filterConverter.spec.d.ts.map +1 -0
  186. package/lib/src/utils/filterConverter.spec.js +707 -0
  187. package/lib/src/utils/filterConverter.spec.js.map +1 -0
  188. package/lib/src/utils/processData.spec.js +2 -1
  189. package/lib/src/utils/processData.spec.js.map +1 -1
  190. package/lib/src/visual-embed-sdk.d.ts +233 -49
  191. package/package.json +10 -3
  192. package/src/contracts/host-event-contracts.ts +55 -11
  193. package/src/embed/app.spec.ts +15 -0
  194. package/src/embed/app.ts +4 -3
  195. package/src/embed/auto-frame-renderer.spec.ts +24 -13
  196. package/src/embed/conversation.spec.ts +38 -27
  197. package/src/embed/conversation.ts +4 -4
  198. package/src/embed/embedConfig.spec.ts +2 -1
  199. package/src/embed/hostEventClient/host-event-client.spec.ts +14 -8
  200. package/src/embed/hostEventClient/host-event-client.ts +18 -10
  201. package/src/embed/hostEventClient/utils.spec.ts +176 -1
  202. package/src/embed/hostEventClient/utils.ts +51 -2
  203. package/src/embed/liveboard.spec.ts +4 -3
  204. package/src/embed/liveboard.ts +21 -15
  205. package/src/embed/spotter-utils.spec.ts +29 -0
  206. package/src/embed/spotter-utils.ts +16 -0
  207. package/src/embed/ts-embed.spec.ts +245 -30
  208. package/src/embed/ts-embed.ts +107 -74
  209. package/src/errors.ts +1 -1
  210. package/src/index.ts +10 -0
  211. package/src/react/all-types-export.ts +4 -0
  212. package/src/types.ts +44 -21
  213. package/src/utils/authService/tokenizedAuthService.spec.ts +2 -1
  214. package/src/utils/custom-actions.spec.ts +4 -2
  215. package/src/utils/filterConverter.spec.ts +801 -0
  216. package/src/utils/filterConverter.ts +304 -0
  217. package/src/utils/processData.spec.ts +2 -1
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.52.1 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.52.2-beta.0 */
2
2
  'use client';
3
3
  import * as React from 'react';
4
4
  import React__default, { useRef, useCallback } from 'react';
@@ -3951,6 +3951,12 @@ var HostEvent;
3951
3951
  * ```js
3952
3952
  * const data = await liveboardEmbed.trigger(HostEvent.GetFilters);
3953
3953
  * console.log('data', data);
3954
+ * // {
3955
+ * // liveboardFilters: [ ... ],
3956
+ * // runtimeFilters: [
3957
+ * // { columnName: "Region", operator: "IN", values: ["West"] }
3958
+ * // ]
3959
+ * // }
3954
3960
  * ```
3955
3961
  * @example
3956
3962
  * ```js
@@ -3975,9 +3981,9 @@ var HostEvent;
3975
3981
  *
3976
3982
  * Each filter object must include the following attributes:
3977
3983
  *
3978
- * `column` - Name of the column to filter on.
3984
+ * `columnName` - Name of the column to filter on.
3979
3985
  *
3980
- * `oper` - Filter operator, for example, EQ, IN, CONTAINS.
3986
+ * `operator` - Filter operator, for example, EQ, IN, CONTAINS.
3981
3987
  * For information about the supported filter operators,
3982
3988
  * see link:https://developers.thoughtspot.com/docs/runtime-filters#rtOperator[Developer Documentation].
3983
3989
  *
@@ -4004,8 +4010,8 @@ var HostEvent;
4004
4010
  *
4005
4011
  * liveboardEmbed.trigger(HostEvent.UpdateFilters, {
4006
4012
  * filter: {
4007
- * column: "item type",
4008
- * oper: "IN",
4013
+ * columnName: "item type",
4014
+ * operator: "IN",
4009
4015
  * values: ["bags","shirts"]
4010
4016
  * }
4011
4017
  * });
@@ -4015,8 +4021,8 @@ var HostEvent;
4015
4021
  *
4016
4022
  * liveboardEmbed.trigger(HostEvent.UpdateFilters, {
4017
4023
  * filter: {
4018
- * column: "date",
4019
- * oper: "EQ",
4024
+ * columnName: "date",
4025
+ * operator: "EQ",
4020
4026
  * values: ["JULY","2023"],
4021
4027
  * type: "MONTH_YEAR"
4022
4028
  * }
@@ -4027,18 +4033,18 @@ var HostEvent;
4027
4033
  * ```js
4028
4034
  * liveboardEmbed.trigger(HostEvent.UpdateFilters, {
4029
4035
  * filters: [{
4030
- * column: "Item Type",
4031
- * oper: 'IN',
4036
+ * columnName: "Item Type",
4037
+ * operator: 'IN',
4032
4038
  * values: ["bags","shirts"]
4033
4039
  * },
4034
4040
  * {
4035
- * column: "Region",
4036
- * oper: 'IN',
4041
+ * columnName: "Region",
4042
+ * operator: 'IN',
4037
4043
  * values: ["West","Midwest"]
4038
4044
  * },
4039
4045
  * {
4040
- * column: "Date",
4041
- * oper: 'EQ',
4046
+ * columnName: "Date",
4047
+ * operator: 'EQ',
4042
4048
  * values: ["2023-07-31"],
4043
4049
  * type: "EXACT_DATE"
4044
4050
  * }]
@@ -4052,13 +4058,13 @@ var HostEvent;
4052
4058
  * ```js
4053
4059
  * liveboardEmbed.trigger(HostEvent.UpdateFilters, {
4054
4060
  * filters: [{
4055
- * column: "(Sample) Retail - Apparel::city",
4056
- * oper: 'IN',
4061
+ * columnName: "(Sample) Retail - Apparel::city",
4062
+ * operator: 'IN',
4057
4063
  * values: ["atlanta"]
4058
4064
  * },
4059
4065
  * {
4060
- * column: "(Sample) Retail - Apparel::Region",
4061
- * oper: 'IN',
4066
+ * columnName: "(Sample) Retail - Apparel::Region",
4067
+ * operator: 'IN',
4062
4068
  * values: ["West","Midwest"]
4063
4069
  * }]
4064
4070
  * });
@@ -4069,8 +4075,8 @@ var HostEvent;
4069
4075
  * import { ContextType } from '@thoughtspot/visual-embed-sdk';
4070
4076
  * liveboardEmbed.trigger(HostEvent.UpdateFilters, {
4071
4077
  * filter: {
4072
- * column: "item type",
4073
- * oper: "IN",
4078
+ * columnName: "item type",
4079
+ * operator: "IN",
4074
4080
  * values: ["shoes", "boots"]
4075
4081
  * }
4076
4082
  * }, ContextType.Liveboard);
@@ -4080,8 +4086,8 @@ var HostEvent;
4080
4086
  * // Scope the filter to a specific Liveboard tab
4081
4087
  * liveboardEmbed.trigger(HostEvent.UpdateFilters, {
4082
4088
  * filter: {
4083
- * column: "item type",
4084
- * oper: "IN",
4089
+ * columnName: "item type",
4090
+ * operator: "IN",
4085
4091
  * values: ["bags", "shirts"],
4086
4092
  * applicability: {
4087
4093
  * level: "TAB",
@@ -4090,6 +4096,12 @@ var HostEvent;
4090
4096
  * }
4091
4097
  * });
4092
4098
  * ```
4099
+ * Use `columnName` and `operator` - the same spelling as
4100
+ * {@link RuntimeFilter}. The older `column` and `oper` spellings are
4101
+ * deprecated; they are still accepted, but pass only one spelling of each
4102
+ * field, never both. To reapply the filter state captured from
4103
+ * {@link EmbedEvent.FilterChanged}, use `convertFilterChangedToUpdateFiltersPayload`
4104
+ * to convert its payload into the shape expected here.
4093
4105
  * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
4094
4106
  */
4095
4107
  HostEvent["UpdateFilters"] = "updateFilters";
@@ -5075,7 +5087,6 @@ var Param;
5075
5087
  Param["IsStarterPromptsEnabled"] = "enableStarterPrompts";
5076
5088
  Param["UpdatedSpotterExperience"] = "updatedSpotterExperience";
5077
5089
  Param["SpotterDataSources"] = "spotterDataSources";
5078
- Param["AnalystId"] = "analystId";
5079
5090
  Param["OpenSpotterOnLiveboardByDefault"] = "openSpotterOnLiveboardByDefault";
5080
5091
  Param["ShowAnswerEditPanel"] = "showAnswerEditPanel";
5081
5092
  })(Param || (Param = {}));
@@ -7301,6 +7312,18 @@ var Action;
7301
7312
  * ```
7302
7313
  */
7303
7314
  Action["DeleteCollection"] = "deleteCollection";
7315
+ /**
7316
+ * Controls the visibility of the "Customize homepage" button on the
7317
+ * embedded home page.
7318
+ * @version SDK: 1.55.0 | ThoughtSpot Cloud: 26.12.0.cl
7319
+ * @example
7320
+ * ```js
7321
+ * {
7322
+ * hiddenActions: [Action.CustomizeHomepage],
7323
+ * }
7324
+ * ```
7325
+ */
7326
+ Action["CustomizeHomepage"] = "customizeHomepage";
7304
7327
  })(Action || (Action = {}));
7305
7328
  var PrefetchFeatures;
7306
7329
  (function (PrefetchFeatures) {
@@ -7805,7 +7828,7 @@ var TableContentDensity;
7805
7828
  TableContentDensity["Compact"] = "COMPACT";
7806
7829
  })(TableContentDensity || (TableContentDensity = {}));
7807
7830
 
7808
- var version$1="1.52.1";var pkg = {version:version$1};
7831
+ var version$1="1.52.2-beta.0";var pkg = {version:version$1};
7809
7832
 
7810
7833
  const { version } = pkg;
7811
7834
 
@@ -7909,7 +7932,7 @@ const ERROR_MESSAGE = {
7909
7932
  SSR_ENVIRONMENT_ERROR: 'SSR environment detected. This function cannot be called in SSR environment.',
7910
7933
  UPDATE_PARAMS_FAILED: 'Failed to update embed parameters',
7911
7934
  INVALID_SPOTTER_DOCUMENTATION_URL: 'Invalid spotterDocumentationUrl. Please provide a valid http or https URL.',
7912
- UPDATEFILTERS_INVALID_PAYLOAD: 'UpdateFilters requires a valid filter or filters array. Expected: { filter: { column, oper, values } } or { filters: [{ column, oper, values }, ...] }',
7935
+ UPDATEFILTERS_INVALID_PAYLOAD: 'UpdateFilters requires a valid filter or filters array. Expected: { filter: { columnName, operator, values } } or { filters: [{ columnName, operator, values }, ...] }',
7913
7936
  DRILLDOWN_INVALID_PAYLOAD: 'DrillDown requires a valid points object. Expected: { points: { clickedPoint?, selectedPoints? }, autoDrillDown?, vizId? }',
7914
7937
  UPDATEPARAMETERS_INVALID_PAYLOAD: 'UpdateParameters received an invalid applicability. Expected: { level: LIVEBOARD | TAB | GROUP, targetId } where targetId is required for TAB and GROUP levels',
7915
7938
  };
@@ -10542,7 +10565,7 @@ class AnswerService {
10542
10565
  async getTML() {
10543
10566
  const { object } = await this.executeQuery(getAnswerTML, {});
10544
10567
  const edoc = object[0].edoc;
10545
- const YAML = await import('./index-C1pmYb5H.js');
10568
+ const YAML = await import('./index-BrJMbt8r.js');
10546
10569
  const parsedDoc = YAML.parse(edoc);
10547
10570
  return {
10548
10571
  answer: {
@@ -21336,7 +21359,8 @@ var isUndefined_1 = isUndefined;
21336
21359
  const isValidApplicability = (a) => {
21337
21360
  if (isUndefined_1(a))
21338
21361
  return true;
21339
- // targetId is not required at LIVEBOARD level, since the filter applies to the whole Liveboard
21362
+ // targetId is not required at LIVEBOARD level, since the filter applies to
21363
+ // the whole Liveboard
21340
21364
  return isPlainObject_1(a)
21341
21365
  && Object.values(ApplicabilityLevel).includes(a.level)
21342
21366
  && (a.level === ApplicabilityLevel.Liveboard || (isString_1(a.targetId) && a.targetId.trim().length > 0));
@@ -21355,8 +21379,52 @@ function isValidUpdateFiltersPayload(payload) {
21355
21379
  const hasValidFilters = Array.isArray(payload.filters) && payload.filters.length > 0 && payload.filters.every(isValidFilter);
21356
21380
  return !!(hasValidFilter || hasValidFilters);
21357
21381
  }
21382
+ /**
21383
+ * Rewrites one filter's `columnName`/`operator` to `column`/`oper`.
21384
+ *
21385
+ * Callers may use either spelling: `columnName`/`operator` match
21386
+ * {@link RuntimeFilter} and the `EmbedEvent.FilterChanged` payload, so a
21387
+ * converted payload can be replayed as-is. But the payload is forwarded to the
21388
+ * embedded app unchanged, and only `column`/`oper` are known to be understood
21389
+ * there - so the alias must be swapped here, or it would pass validation and
21390
+ * then be silently ignored.
21391
+ *
21392
+ * If a caller supplies both spellings of a field - which TypeScript rejects,
21393
+ * but JavaScript callers can still do - the documented `columnName`/`operator`
21394
+ * wins. Deferring to the deprecated spelling would quietly discard the value
21395
+ * the rest of the SDK tells people to use.
21396
+ * @param filter One entry from the UpdateFilters payload.
21397
+ */
21398
+ function resolveFilterAliases(filter) {
21399
+ var _a, _b;
21400
+ if (!isPlainObject_1(filter))
21401
+ return filter;
21402
+ const column = (_a = filter.columnName) !== null && _a !== void 0 ? _a : filter.column;
21403
+ const oper = (_b = filter.operator) !== null && _b !== void 0 ? _b : filter.oper;
21404
+ const { columnName, operator, ...rest } = filter;
21405
+ return {
21406
+ ...rest,
21407
+ ...(isUndefined_1(column) ? {} : { column }),
21408
+ ...(isUndefined_1(oper) ? {} : { oper }),
21409
+ };
21410
+ }
21411
+ /**
21412
+ * Rewrites every filter in an UpdateFilters payload to use `column`/`oper`,
21413
+ * whichever spelling the caller supplied. Call after validation.
21414
+ * @param payload The UpdateFilters host event payload.
21415
+ */
21416
+ function resolveUpdateFiltersAliases(payload) {
21417
+ if (!isPlainObject_1(payload))
21418
+ return payload;
21419
+ return {
21420
+ ...payload,
21421
+ ...(payload.filter ? { filter: resolveFilterAliases(payload.filter) } : {}),
21422
+ ...(Array.isArray(payload.filters) ? { filters: payload.filters.map(resolveFilterAliases) } : {}),
21423
+ };
21424
+ }
21358
21425
  function isValidUpdateParametersPayload(payload) {
21359
- // Only validates the applicability of each parameter (null treated as absent); the rest is forwarded as-is for backward compatibility.
21426
+ // Only validates the applicability of each parameter (null treated as
21427
+ // absent); the rest is forwarded as-is for backward compatibility.
21360
21428
  if (!Array.isArray(payload))
21361
21429
  return true;
21362
21430
  return payload.every((p) => {
@@ -21404,7 +21472,8 @@ function throwUpdateParametersValidationError() {
21404
21472
  /**
21405
21473
  * Maps HostEvent to its corresponding UIPassthroughEvent.
21406
21474
  * Includes both custom-handler events (Pin, SaveAnswer, UpdateFilters, DrillDown)
21407
- * and getter events (GetAnswerSession, GetFilters, etc.) that use getDataWithPassthroughFallback.
21475
+ * and getter events (GetAnswerSession, GetFilters, etc.) that use
21476
+ * getDataWithPassthroughFallback.
21408
21477
  */
21409
21478
  const PASSTHROUGH_MAP = {
21410
21479
  // Custom handlers (setters with special logic)
@@ -21555,17 +21624,21 @@ class HostEventClient {
21555
21624
  throwUpdateFiltersValidationError();
21556
21625
  }
21557
21626
  // The shared contract accepts both current (columnName/operator) and
21558
- // legacy (column/oper) filter field names — as does the validation
21559
- // above and the app at runtime. The UIPassthrough FilterUpdate type
21560
- // still requires the legacy names; bridge until that contract is
21561
- // audited.
21562
- return this.handleHostEventWithParam(UIPassthroughEvent.UpdateFilters, payload, context);
21627
+ // legacy (column/oper) filter field names, but only the legacy pair is
21628
+ // understood downstream, so the payload is rewritten before it is
21629
+ // forwarded — otherwise a columnName/operator filter passes validation
21630
+ // here and is then silently ignored by the app. The cast bridges the
21631
+ // UIPassthrough FilterUpdate type, which still declares only the legacy
21632
+ // names.
21633
+ const resolvedPayload = resolveUpdateFiltersAliases(payload);
21634
+ return this.handleHostEventWithParam(UIPassthroughEvent.UpdateFilters, resolvedPayload, context);
21563
21635
  }
21564
21636
  handleUpdateParametersEvent(payload, context) {
21565
21637
  if (!isValidUpdateParametersPayload(payload)) {
21566
21638
  throwUpdateParametersValidationError();
21567
21639
  }
21568
- // UpdateParameters has no UI passthrough contract; dispatch over the legacy channel
21640
+ // UpdateParameters has no UI passthrough contract; dispatch over the
21641
+ // legacy channel
21569
21642
  return this.hostEventFallback(HostEvent.UpdateParameters, payload, context);
21570
21643
  }
21571
21644
  handleDrillDownEvent(payload, context) {
@@ -21576,8 +21649,8 @@ class HostEventClient {
21576
21649
  }
21577
21650
  /**
21578
21651
  * Dispatches a host event using the appropriate channel:
21579
- * 1. If the embedded app supports UI passthrough for this event, use it (custom handler or getter).
21580
- * 2. Otherwise fall back to the legacy host event channel.
21652
+ * 1. If the embedded app supports UI passthrough for this event, use it (custom
21653
+ * handler or getter). 2. Otherwise fall back to the legacy host event channel.
21581
21654
  *
21582
21655
  * @param hostEvent - The host event to trigger
21583
21656
  * @param payload - Optional payload for the event
@@ -21586,7 +21659,8 @@ class HostEventClient {
21586
21659
  async triggerHostEvent(hostEvent, payload, context) {
21587
21660
  const customHandler = this.customHandlers[hostEvent];
21588
21661
  const passthroughEvent = PASSTHROUGH_MAP[hostEvent];
21589
- // If embedded app supports passthrough but not this event, use legacy channel
21662
+ // If embedded app supports passthrough but not this event, use legacy
21663
+ // channel
21590
21664
  const keys = passthroughEvent ? await this.getAvailableUIPassthroughKeys(context) : [];
21591
21665
  if (passthroughEvent && keys.length > 0 && !keys.includes(passthroughEvent)) {
21592
21666
  return this.hostEventFallback(hostEvent, payload, context);
@@ -21793,11 +21867,15 @@ const TS_EMBED_ID = '_thoughtspot-embed';
21793
21867
  */
21794
21868
  const PRERENDER_CONTAINER_ORIGINAL_POSITION_KEY = 'tsEmbedOriginalPosition';
21795
21869
  const PRERENDER_WRAPPER_ID_PREFIX = 'tsEmbed-pre-render-wrapper-';
21870
+ const PRERENDER_PARKED_TRANSFORM = 'translateY(-100%)';
21871
+ /** The height createPreRenderWrapper() seeds before anything is measured. */
21872
+ const UNMEASURED_WRAPPER_HEIGHT = '100vh';
21796
21873
  // The container applies UpdateEmbedParams through React state, so a delivered
21797
21874
  // post is not the same as the params being in effect.
21798
21875
  const UPDATE_EMBED_PARAMS_SETTLE_MS = 200;
21799
- // The container ignores runtimeFilterParams/runtimeParameterParams unless truthy, so
21800
- // null or '' leaves the previous embed's values in place. '&' is truthy and parses to {}.
21876
+ // The container ignores runtimeFilterParams/runtimeParameterParams unless
21877
+ // truthy, so null or '' leaves the previous embed's values in place. '&' is
21878
+ // truthy and parses to {}.
21801
21879
  const NO_RUNTIME_PARAMS = '&';
21802
21880
  /**
21803
21881
  * The event id map from v2 event names to v1 event id
@@ -21836,7 +21914,6 @@ class TsEmbed {
21836
21914
  this.shouldEncodeUrlQueryParams = false;
21837
21915
  this.defaultHiddenActions = [Action.ReportError];
21838
21916
  this.preRenderContainerEl = document.body;
21839
- this.containerScrollListener = null;
21840
21917
  /**
21841
21918
  * Handler for fullscreen change events
21842
21919
  */
@@ -21995,7 +22072,8 @@ class TsEmbed {
21995
22072
  const AUTH_INIT_FALLBACK_DELAY = 1000;
21996
22073
  // Wait for 1 second to ensure the embed container is loaded
21997
22074
  // This is a workaround to ensure the embed container is loaded
21998
- // this is needed until all clusters have EmbedListenerReady event
22075
+ // this is needed until all clusters have EmbedListenerReady
22076
+ // event
21999
22077
  setTimeout(processEmbedContainerReady, AUTH_INIT_FALLBACK_DELAY);
22000
22078
  }
22001
22079
  else if (source === EmbedEvent.EmbedListenerReady) {
@@ -22003,7 +22081,8 @@ class TsEmbed {
22003
22081
  }
22004
22082
  };
22005
22083
  // Subclasses that navigate the pre-render on show must await this before
22006
- // triggering Navigate. Resolves even on failure, so navigation is never blocked.
22084
+ // triggering Navigate. Resolves even on failure, so navigation is never
22085
+ // blocked.
22007
22086
  this.preRenderParamsApplied = Promise.resolve();
22008
22087
  this.hostElement = getDOMNode(domSelector);
22009
22088
  this.eventHandlerMap = new Map();
@@ -22333,8 +22412,9 @@ class TsEmbed {
22333
22412
  ...this.viewConfig,
22334
22413
  ...queryParams,
22335
22414
  ...appInitData,
22336
- // A show cycle has no URL to carry these, so the payload always states them
22337
- // — including "none", which is the case that leaks the previous filters.
22415
+ // A show cycle has no URL to carry these, so the payload always
22416
+ // states them — including "none", which is the case that leaks the
22417
+ // previous filters.
22338
22418
  runtimeFilterParams: getFilterQuery((_a = this.viewConfig.runtimeFilters) !== null && _a !== void 0 ? _a : []) || NO_RUNTIME_PARAMS,
22339
22419
  runtimeParameterParams: getRuntimeParameters((_b = this.viewConfig.runtimeParameters) !== null && _b !== void 0 ? _b : [])
22340
22420
  || NO_RUNTIME_PARAMS,
@@ -22679,7 +22759,7 @@ class TsEmbed {
22679
22759
  top: '0',
22680
22760
  left: '0',
22681
22761
  width: '100vw',
22682
- height: '100vh',
22762
+ height: UNMEASURED_WRAPPER_HEIGHT,
22683
22763
  };
22684
22764
  setStyleProperties(preRenderWrapper, initialPreRenderWrapperStyle);
22685
22765
  return preRenderWrapper;
@@ -22747,10 +22827,26 @@ class TsEmbed {
22747
22827
  return placeholder;
22748
22828
  }
22749
22829
  /**
22750
- * Resolves the configured preRenderContainer to a live element, falling
22751
- * back to `document.body`. A string selector is re-queried on every call so
22752
- * a remounted container (E.g.: React replacing the node) resolves to the
22753
- * fresh element; an element passed directly cannot be re-resolved.
22830
+ * Resolves the configured preRenderContainer to a live element. A string
22831
+ * selector is re-queried on every call so a remounted container (E.g.: React
22832
+ * replacing the node) resolves to the fresh element; an element passed
22833
+ * directly cannot be re-resolved.
22834
+ *
22835
+ * With nothing configured the frame goes into the host element's nearest
22836
+ * scrolling ancestor, falling back to `document.body`.
22837
+ *
22838
+ * The wrapper is absolutely positioned, so it follows the page for free —
22839
+ * but only while it sits inside whatever scrolls. `document.body` is right
22840
+ * only when the document itself is the scroller; an app that scrolls an
22841
+ * inner element instead left the frame pinned to the viewport while the page
22842
+ * moved under it (SCAL-338563). Being inside the scroller also lets wheel
22843
+ * events chain out of the frame into it, which they cannot do from
22844
+ * `document.body`.
22845
+ *
22846
+ * A scrolling ancestor is layout chrome rather than route content, so it
22847
+ * outlives the embed in practice; and if it does go, the host element goes
22848
+ * with it and this instance is remounting anyway.
22849
+ * `reconcilePreRenderContainer` re-runs this on a detached container.
22754
22850
  */
22755
22851
  resolvePreRenderContainerTarget() {
22756
22852
  var _a;
@@ -22770,7 +22866,13 @@ class TsEmbed {
22770
22866
  else if (containerConfig) {
22771
22867
  container = containerConfig;
22772
22868
  }
22773
- return (_a = container) !== null && _a !== void 0 ? _a : document.body;
22869
+ if (container) {
22870
+ return container;
22871
+ }
22872
+ if (!this.hostElement) {
22873
+ return document.body;
22874
+ }
22875
+ return (_a = getScrollableAncestors(this.hostElement)[0]) !== null && _a !== void 0 ? _a : document.body;
22774
22876
  }
22775
22877
  inheritPreRenderContainer() {
22776
22878
  var _a;
@@ -22815,8 +22917,9 @@ class TsEmbed {
22815
22917
  * Re-attaches the wrapper to a live container when the previously resolved
22816
22918
  * one has been detached or no longer holds the wrapper — e.g. the host app
22817
22919
  * remounted a custom preRenderContainer, which would otherwise leave a stale
22818
- * reference and collapse the wrapper. Only string selectors can be
22819
- * re-resolved; a container passed as an element is left untouched.
22920
+ * reference and collapse the wrapper. Selectors and the auto-resolved
22921
+ * scrolling ancestor are both re-resolved; a container passed as an element
22922
+ * is left untouched, as there is nothing to re-query.
22820
22923
  */
22821
22924
  reconcilePreRenderContainer() {
22822
22925
  const wrapper = this.preRenderWrapper;
@@ -22835,14 +22938,6 @@ class TsEmbed {
22835
22938
  if (resolved === stored && stored.contains(wrapper)) {
22836
22939
  return;
22837
22940
  }
22838
- if (this.containerScrollListener && stored !== resolved) {
22839
- if (stored !== document.body) {
22840
- stored.removeEventListener('scroll', this.containerScrollListener);
22841
- }
22842
- if (resolved !== document.body) {
22843
- resolved.addEventListener('scroll', this.containerScrollListener);
22844
- }
22845
- }
22846
22941
  this.preRenderContainerEl = resolved;
22847
22942
  this.applyPreRenderContainerPositioning();
22848
22943
  if (wrapper.parentNode !== resolved) {
@@ -22904,11 +22999,12 @@ class TsEmbed {
22904
22999
  */
22905
23000
  setIFrameHeight(height) {
22906
23001
  if (this.isPreRendered) {
23002
+ const next = getCssDimension(height);
22907
23003
  if (this.insertedDomEl) {
22908
- this.insertedDomEl.style.height = getCssDimension(height);
23004
+ this.insertedDomEl.style.height = next;
22909
23005
  }
22910
23006
  else if (this.preRenderWrapper) {
22911
- this.preRenderWrapper.style.height = getCssDimension(height);
23007
+ this.preRenderWrapper.style.height = next;
22912
23008
  }
22913
23009
  }
22914
23010
  else {
@@ -23061,8 +23157,9 @@ class TsEmbed {
23061
23157
  return;
23062
23158
  this.preRenderWrapper[this.embedNodeKey] = this;
23063
23159
  }
23064
- // The flag lives on the wrapper because it describes the iframe: an instance
23065
- // hidden when the container announced itself would otherwise report false forever.
23160
+ // The flag lives on the wrapper because it describes the iframe: an
23161
+ // instance hidden when the container announced itself would otherwise
23162
+ // report false forever.
23066
23163
  markEmbedContainerLoaded() {
23067
23164
  this.isEmbedContainerLoaded = true;
23068
23165
  if (this.preRenderWrapper) {
@@ -23342,34 +23439,47 @@ class TsEmbed {
23342
23439
  delete container.dataset[PRERENDER_CONTAINER_ORIGINAL_POSITION_KEY];
23343
23440
  }
23344
23441
  /**
23345
- * Detaches and clears the container scroll listener, if one is attached.
23346
- */
23347
- removeContainerScrollListener() {
23348
- if (!this.containerScrollListener) {
23442
+ * Re-sizes the wrapper when its placeholder changes size.
23443
+ *
23444
+ * Position deliberately has no equivalent. An absolutely positioned wrapper
23445
+ * follows its containing block for free, so a correctly placed frame is the
23446
+ * browser's job and costs nothing; repositioning it on scroll would mean a
23447
+ * layout read and a style write per frame to compensate for placing it in
23448
+ * the wrong box. Size is the one thing the browser will not do for us: the
23449
+ * placeholder grows when the embedded app reports a new height, and the
23450
+ * wrapper has to be told.
23451
+ */
23452
+ observePreRenderSize() {
23453
+ var _a;
23454
+ if (this.getPreRenderConfig().doNotTrackSize || typeof ResizeObserver === 'undefined') {
23349
23455
  return;
23350
23456
  }
23351
- const customContainer = this.getCustomPreRenderContainer();
23352
- customContainer === null || customContainer === void 0 ? void 0 : customContainer.removeEventListener('scroll', this.containerScrollListener);
23353
- this.containerScrollListener = null;
23457
+ const placeholder = this.getPreRenderPlaceHolderElement();
23458
+ if (!placeholder) {
23459
+ return;
23460
+ }
23461
+ (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
23462
+ this.resizeObserver = new ResizeObserver(() => this.syncPreRenderStyle());
23463
+ this.resizeObserver.observe(placeholder);
23354
23464
  }
23355
23465
  /**
23356
23466
  * Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
23357
23467
  * @version SDK: 1.19.1 | ThoughtSpot: *
23358
23468
  */
23359
23469
  destroy() {
23360
- var _a, _b, _c;
23470
+ var _a, _b, _c, _d;
23361
23471
  try {
23362
23472
  this.removeFullscreenChangeHandler();
23363
- this.removeContainerScrollListener();
23473
+ (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
23364
23474
  this.unsubscribeToEvents();
23365
- (_a = this.preRenderWrapper) === null || _a === void 0 ? void 0 : _a.remove();
23475
+ (_b = this.preRenderWrapper) === null || _b === void 0 ? void 0 : _b.remove();
23366
23476
  this.restorePreRenderContainerPosition();
23367
23477
  if (!this.isRendered) {
23368
23478
  return;
23369
23479
  }
23370
23480
  if (!getEmbedConfig().waitForCleanupOnDestroy) {
23371
23481
  this.trigger(HostEvent.DestroyEmbed);
23372
- (_c = (_b = this.insertedDomEl) === null || _b === void 0 ? void 0 : _b.parentNode) === null || _c === void 0 ? void 0 : _c.removeChild(this.insertedDomEl);
23482
+ (_d = (_c = this.insertedDomEl) === null || _c === void 0 ? void 0 : _c.parentNode) === null || _d === void 0 ? void 0 : _d.removeChild(this.insertedDomEl);
23373
23483
  }
23374
23484
  else {
23375
23485
  const cleanupTimeout = getEmbedConfig().cleanupTimeout;
@@ -23450,7 +23560,7 @@ class TsEmbed {
23450
23560
  * wrapper to overlay it.
23451
23561
  */
23452
23562
  async showPreRender() {
23453
- var _a, _b;
23563
+ var _a;
23454
23564
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_SHOW_PRE_RENDER, {
23455
23565
  preRenderId: this.getPreRenderConfig().id,
23456
23566
  embedComponentType: this.viewConfig.embedComponentType,
@@ -23469,54 +23579,49 @@ class TsEmbed {
23469
23579
  this.beforePrerenderVisible();
23470
23580
  if (this.hostElement) {
23471
23581
  this.insertedDomEl = this.createPreRenderPlaceholder();
23472
- if (this.viewConfig.fullHeight) {
23473
- // If fullHeight has already sized the wrapper, seed the placeholder
23474
- // with the same height so syncPreRenderStyle gets an accurate rect.
23475
- const existingHeight = this.preRenderWrapper.style.height;
23476
- if (existingHeight) {
23477
- this.insertedDomEl.style.height = existingHeight;
23478
- }
23582
+ // Carry a height fullHeight has already measured onto the fresh
23583
+ // placeholder, so a re-show does not flash at frameParams height.
23584
+ // UNMEASURED_WRAPPER_HEIGHT is what createPreRenderWrapper() seeds
23585
+ // before anything has been measured; treating that as a measurement
23586
+ // is what made a first reveal overshoot to a full viewport.
23587
+ const wrapperHeight = this.preRenderWrapper.style.height;
23588
+ if (this.viewConfig.fullHeight
23589
+ && wrapperHeight
23590
+ && wrapperHeight !== UNMEASURED_WRAPPER_HEIGHT) {
23591
+ this.insertedDomEl.style.height = wrapperHeight;
23479
23592
  }
23480
23593
  const placeHolderId = this.getPreRenderIds().placeHolder;
23481
23594
  // Remove any stale placeholder from a previous cycle. It is located
23482
- // via a subtree-wide querySelector, so it may be nested deeper than a
23483
- // direct child (E.g.: with fullHeight the host app can wrap it). Use
23484
- // Element.remove() — which detaches from whatever the real parent is —
23485
- // rather than hostElement.removeChild(), which throws NotFoundError
23486
- // when the match is not a direct child. Mirrors the wrapper/child
23487
- // cleanup in createPreRenderWrapper()/createPreRenderChild().
23595
+ // via a subtree-wide querySelector, so it may be nested deeper
23596
+ // than a direct child (E.g.: with fullHeight the host app can wrap
23597
+ // it). Use Element.remove() — which detaches from whatever the real
23598
+ // parent is — rather than hostElement.removeChild(), which throws
23599
+ // NotFoundError when the match is not a direct child. Mirrors the
23600
+ // wrapper/child cleanup in
23601
+ // createPreRenderWrapper()/createPreRenderChild().
23488
23602
  (_a = this.hostElement.querySelector(`#${placeHolderId}`)) === null || _a === void 0 ? void 0 : _a.remove();
23489
23603
  this.hostElement.appendChild(this.insertedDomEl);
23490
23604
  this.syncPreRenderStyle();
23491
- const customContainer = this.getCustomPreRenderContainer();
23492
- if (customContainer && !this.containerScrollListener) {
23493
- this.containerScrollListener = () => this.syncPreRenderStyle();
23494
- customContainer.addEventListener('scroll', this.containerScrollListener);
23495
- }
23496
- if (!this.getPreRenderConfig().doNotTrackSize) {
23497
- const observeTarget = (_b = this.insertedDomEl) !== null && _b !== void 0 ? _b : this.hostElement;
23498
- this.resizeObserver = new ResizeObserver((entries) => {
23499
- entries.forEach((entry) => {
23500
- if (entry.target === observeTarget) {
23501
- this.syncPreRenderStyle();
23502
- }
23503
- });
23504
- });
23505
- this.resizeObserver.observe(observeTarget);
23506
- }
23605
+ this.observePreRenderSize();
23507
23606
  }
23508
23607
  removeStyleProperties(this.preRenderWrapper, [
23509
23608
  'z-index',
23510
23609
  'opacity',
23511
- 'pointer-events',
23512
23610
  'overflow',
23611
+ 'transform',
23513
23612
  ]);
23613
+ // Set rather than removed: a container that carries `pointer-events:
23614
+ // none` — the usual styling for a parking root that must not swallow
23615
+ // clicks — passes it down, and dropping the property here would leave
23616
+ // the inherited `none` in force and the frame dead to input.
23617
+ setStyleProperties(this.preRenderWrapper, { pointerEvents: 'auto' });
23514
23618
  this.subscribeToEvents();
23515
23619
  // Setup fullscreen change handler for prerendered components
23516
23620
  if (this.iFrame) {
23517
23621
  this.setupFullscreenChangeHandler();
23518
23622
  }
23519
- // Last, so everything above still sees the instance being taken over from.
23623
+ // Last, so everything above still sees the instance being taken over
23624
+ // from.
23520
23625
  this.takeOverPreRender();
23521
23626
  return this;
23522
23627
  }
@@ -23562,6 +23667,7 @@ class TsEmbed {
23562
23667
  * If the component is not preRendered, it issues a warning.
23563
23668
  */
23564
23669
  hidePreRender() {
23670
+ var _a;
23565
23671
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_HIDE_PRE_RENDER, {
23566
23672
  preRenderId: this.getPreRenderConfig().id,
23567
23673
  embedComponentType: this.viewConfig.embedComponentType,
@@ -23581,12 +23687,15 @@ class TsEmbed {
23581
23687
  top: '0',
23582
23688
  left: '0',
23583
23689
  overflow: 'hidden',
23690
+ // Keeps the measured size — so the next show needs no resize, which
23691
+ // is the point of pre-rendering — while lifting the box out of
23692
+ // the container's scrollable area. Overflow only extends
23693
+ // downwards, so a hidden frame parked above the top edge adds
23694
+ // none, where one left at full height shows as blank scroll space.
23695
+ transform: PRERENDER_PARKED_TRANSFORM,
23584
23696
  };
23585
23697
  setStyleProperties(this.preRenderWrapper, preRenderHideStyles);
23586
- this.removeContainerScrollListener();
23587
- if (this.resizeObserver) {
23588
- this.resizeObserver.disconnect();
23589
- }
23698
+ (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
23590
23699
  const placeHolderEle = this.getPreRenderPlaceHolderElement();
23591
23700
  if (placeHolderEle) {
23592
23701
  placeHolderEle.parentElement.removeChild(placeHolderEle);
@@ -24342,6 +24451,18 @@ function buildStarterPromptsAppInitData(initData, viewConfig) {
24342
24451
  starterPrompts,
24343
24452
  },
24344
24453
  };
24454
+ }
24455
+ function buildSpotterAnalystAppInitData(initData, viewConfig) {
24456
+ const { spotterAnalystConfig } = viewConfig;
24457
+ if (!(spotterAnalystConfig === null || spotterAnalystConfig === void 0 ? void 0 : spotterAnalystConfig.analystId))
24458
+ return initData;
24459
+ return {
24460
+ ...initData,
24461
+ embedParams: {
24462
+ ...(initData.embedParams || {}),
24463
+ spotterAnalystConfig,
24464
+ },
24465
+ };
24345
24466
  }
24346
24467
 
24347
24468
  function buildSpotterVizAppInitData(initData, viewConfig) {
@@ -24935,8 +25056,9 @@ const addPreviewStylesIfNotPresent = () => {
24935
25056
  * @summary Liveboard & visualization embed
24936
25057
  * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
24937
25058
  */
24938
- // Home unmounts the liveboard container, which is how its state gets cleared. The
24939
- // settle window gives the container time to do it before we ask for the liveboard back.
25059
+ // Home unmounts the liveboard container, which is how its state gets cleared.
25060
+ // The settle window gives the container time to do it before we ask for the
25061
+ // liveboard back.
24940
25062
  const HOME_ROUTE = 'home';
24941
25063
  const HOME_SETTLE_MS = 200;
24942
25064
  /**
@@ -25234,21 +25356,24 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
25234
25356
  }
25235
25357
  beforePrerenderVisible() {
25236
25358
  super.beforePrerenderVisible();
25237
- // Captured before showPreRender() hands the wrapper over to this instance.
25238
- // Itself means a hide/show, not a hand-over, so there is nothing stale to clear.
25359
+ // Captured before showPreRender() hands the wrapper over to this
25360
+ // instance. Itself means a hide/show, not a hand-over, so there is
25361
+ // nothing stale to clear.
25239
25362
  const previous = this.getPreRenderObj();
25240
25363
  const showing = previous === this ? undefined : previous === null || previous === void 0 ? void 0 : previous.currentLiveboardState;
25241
25364
  this.executeAfterEmbedContainerLoaded(async () => {
25242
- // Without this the params callback suspends on its await and Navigate
25243
- // goes out first, so the container loads with the previous config's filters.
25365
+ // Without this the params callback suspends on its await and
25366
+ // Navigate goes out first, so the container loads with the previous
25367
+ // config's filters.
25244
25368
  await this.preRenderParamsApplied;
25245
25369
  if (this.isShowingLiveboardRoute(showing)) {
25246
- // Navigate to the route we are already on is a no-op, so the liveboard
25247
- // keeps its state. Home unmounts the container, which clears it.
25370
+ // Navigate to the route we are already on is a no-op, so the
25371
+ // liveboard keeps its state. Home unmounts the container, which
25372
+ // clears it.
25248
25373
  this.trigger(HostEvent.Navigate, HOME_ROUTE)
25249
25374
  .catch((error) => logger$3.warn('Could not route via home', error));
25250
- // Not awaited above: the container never acks Navigate, so that promise
25251
- // only settles on the 30s trigger timeout.
25375
+ // Not awaited above: the container never acks Navigate, so
25376
+ // that promise only settles on the 30s trigger timeout.
25252
25377
  await new Promise((resolve) => {
25253
25378
  setTimeout(resolve, HOME_SETTLE_MS);
25254
25379
  });
@@ -25262,8 +25387,9 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
25262
25387
  };
25263
25388
  });
25264
25389
  }
25265
- // The whole route, not just the liveboard id: the path is built from the viz, tab
25266
- // and view too, so a same-liveboard show onto another tab is a real navigation.
25390
+ // The whole route, not just the liveboard id: the path is built from the
25391
+ // viz, tab and view too, so a same-liveboard show onto another tab is a
25392
+ // real navigation.
25267
25393
  isShowingLiveboardRoute(showing) {
25268
25394
  if (!(showing === null || showing === void 0 ? void 0 : showing.liveboardId))
25269
25395
  return false;
@@ -25928,10 +26054,11 @@ let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
25928
26054
  const defaultAppInitData = await super.getAppInitData();
25929
26055
  const sidebarInitData = buildSpotterSidebarAppInitData(defaultAppInitData, this.viewConfig, this.handleError.bind(this));
25930
26056
  const shareInitData = buildSpotterShareConversationAppInitData(sidebarInitData, this.viewConfig);
25931
- return buildStarterPromptsAppInitData(shareInitData, this.viewConfig);
26057
+ const starterPromptsInitData = buildStarterPromptsAppInitData(shareInitData, this.viewConfig);
26058
+ return buildSpotterAnalystAppInitData(starterPromptsInitData, this.viewConfig);
25932
26059
  }
25933
26060
  getEmbedParamsObject() {
25934
- const { searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, updatedSpotterExperience, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, updatedSpotterChatPrompt, showSpotterRadiance, defaultQueryMode, enableStopAnswerGenerationEmbed, spotterChatConfig, spotterAnalystConfig, } = this.viewConfig;
26061
+ const { searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, updatedSpotterExperience, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, updatedSpotterChatPrompt, showSpotterRadiance, defaultQueryMode, enableStopAnswerGenerationEmbed, spotterChatConfig, } = this.viewConfig;
25935
26062
  const queryParams = this.getBaseQueryParams();
25936
26063
  queryParams[Param.SpotterEnabled] = true;
25937
26064
  // Boolean params
@@ -25944,7 +26071,6 @@ let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
25944
26071
  setParamIfDefined(queryParams, Param.ShowSpotterRadiance, showSpotterRadiance, true);
25945
26072
  setParamIfDefined(queryParams, Param.DefaultQueryMode, defaultQueryMode);
25946
26073
  setParamIfDefined(queryParams, Param.EnableStopAnswerGenerationEmbed, enableStopAnswerGenerationEmbed, true);
25947
- setParamIfDefined(queryParams, Param.AnalystId, spotterAnalystConfig === null || spotterAnalystConfig === void 0 ? void 0 : spotterAnalystConfig.analystId);
25948
26074
  // Handle spotterChatConfig params
25949
26075
  if (spotterChatConfig) {
25950
26076
  const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, spotterFileUploadEnabled, spotterFileUploadFileTypes, enableStarterPrompts, } = spotterChatConfig;