@thoughtspot/visual-embed-sdk 1.44.1 → 1.44.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/cjs/package.json +6 -5
  2. package/cjs/src/api-intercept.d.ts.map +1 -1
  3. package/cjs/src/api-intercept.js +8 -3
  4. package/cjs/src/api-intercept.js.map +1 -1
  5. package/cjs/src/api-intercept.spec.js +19 -3
  6. package/cjs/src/api-intercept.spec.js.map +1 -1
  7. package/cjs/src/auth.spec.js +43 -42
  8. package/cjs/src/auth.spec.js.map +1 -1
  9. package/cjs/src/authToken.spec.js +3 -3
  10. package/cjs/src/authToken.spec.js.map +1 -1
  11. package/cjs/src/embed/app.d.ts +17 -0
  12. package/cjs/src/embed/app.d.ts.map +1 -1
  13. package/cjs/src/embed/app.js +9 -5
  14. package/cjs/src/embed/app.js.map +1 -1
  15. package/cjs/src/embed/app.spec.js +96 -6
  16. package/cjs/src/embed/app.spec.js.map +1 -1
  17. package/cjs/src/embed/base.spec.js +11 -15
  18. package/cjs/src/embed/base.spec.js.map +1 -1
  19. package/cjs/src/embed/bodyless-conversation.spec.js +2 -2
  20. package/cjs/src/embed/bodyless-conversation.spec.js.map +1 -1
  21. package/cjs/src/embed/conversation.d.ts.map +1 -1
  22. package/cjs/src/embed/conversation.js +6 -1
  23. package/cjs/src/embed/conversation.js.map +1 -1
  24. package/cjs/src/embed/conversation.spec.js +8 -3
  25. package/cjs/src/embed/conversation.spec.js.map +1 -1
  26. package/cjs/src/embed/embed.spec.js +101 -2
  27. package/cjs/src/embed/embed.spec.js.map +1 -1
  28. package/cjs/src/embed/events.spec.js +2 -2
  29. package/cjs/src/embed/events.spec.js.map +1 -1
  30. package/cjs/src/embed/hostEventClient/host-event-client.spec.js +1 -1
  31. package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  32. package/cjs/src/embed/liveboard.d.ts +18 -0
  33. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  34. package/cjs/src/embed/liveboard.js +13 -6
  35. package/cjs/src/embed/liveboard.js.map +1 -1
  36. package/cjs/src/embed/liveboard.spec.js +114 -26
  37. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  38. package/cjs/src/embed/pinboard.spec.js +1 -1
  39. package/cjs/src/embed/pinboard.spec.js.map +1 -1
  40. package/cjs/src/embed/sage.spec.js +2 -2
  41. package/cjs/src/embed/sage.spec.js.map +1 -1
  42. package/cjs/src/embed/search.spec.js +118 -2
  43. package/cjs/src/embed/search.spec.js.map +1 -1
  44. package/cjs/src/embed/ts-embed-trigger.spec.js +2 -3
  45. package/cjs/src/embed/ts-embed-trigger.spec.js.map +1 -1
  46. package/cjs/src/embed/ts-embed.d.ts +3 -2
  47. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  48. package/cjs/src/embed/ts-embed.js +51 -17
  49. package/cjs/src/embed/ts-embed.js.map +1 -1
  50. package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
  51. package/cjs/src/embed/ts-embed.spec.js +335 -71
  52. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  53. package/cjs/src/errors.d.ts +7 -0
  54. package/cjs/src/errors.d.ts.map +1 -1
  55. package/cjs/src/errors.js +7 -0
  56. package/cjs/src/errors.js.map +1 -1
  57. package/cjs/src/mixpanel-service.spec.js +1 -1
  58. package/cjs/src/mixpanel-service.spec.js.map +1 -1
  59. package/cjs/src/react/index.spec.js +3 -4
  60. package/cjs/src/react/index.spec.js.map +1 -1
  61. package/cjs/src/test/test-utils.js +1 -1
  62. package/cjs/src/test/test-utils.js.map +1 -1
  63. package/cjs/src/types.d.ts +194 -1
  64. package/cjs/src/types.d.ts.map +1 -1
  65. package/cjs/src/types.js +94 -2
  66. package/cjs/src/types.js.map +1 -1
  67. package/cjs/src/utils/authService/authService.spec.js +8 -8
  68. package/cjs/src/utils/authService/authService.spec.js.map +1 -1
  69. package/cjs/src/utils/authService/tokenizedAuthService.spec.js.map +1 -1
  70. package/cjs/src/utils/graphql/answerService/answerService.spec.js +1 -1
  71. package/cjs/src/utils/graphql/answerService/answerService.spec.js.map +1 -1
  72. package/cjs/src/utils/graphql/graphql-request.spec.js +1 -1
  73. package/cjs/src/utils/graphql/graphql-request.spec.js.map +1 -1
  74. package/cjs/src/utils/graphql/sourceService.spec.js +1 -1
  75. package/cjs/src/utils/graphql/sourceService.spec.js.map +1 -1
  76. package/cjs/src/utils/logger.spec.d.ts +5 -20
  77. package/cjs/src/utils/logger.spec.d.ts.map +1 -1
  78. package/cjs/src/utils/processData.spec.js +17 -17
  79. package/cjs/src/utils/processData.spec.js.map +1 -1
  80. package/cjs/src/utils/processTrigger.spec.js +8 -8
  81. package/cjs/src/utils/processTrigger.spec.js.map +1 -1
  82. package/cjs/src/utils.d.ts +6 -0
  83. package/cjs/src/utils.d.ts.map +1 -1
  84. package/cjs/src/utils.js +32 -1
  85. package/cjs/src/utils.js.map +1 -1
  86. package/cjs/src/utils.spec.js +19 -10
  87. package/cjs/src/utils.spec.js.map +1 -1
  88. package/dist/{index-BE9gGzRX.js → index-CSFjfTVk.js} +1 -1
  89. package/dist/src/api-intercept.d.ts.map +1 -1
  90. package/dist/src/embed/app.d.ts +17 -0
  91. package/dist/src/embed/app.d.ts.map +1 -1
  92. package/dist/src/embed/conversation.d.ts.map +1 -1
  93. package/dist/src/embed/liveboard.d.ts +18 -0
  94. package/dist/src/embed/liveboard.d.ts.map +1 -1
  95. package/dist/src/embed/ts-embed.d.ts +3 -2
  96. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  97. package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
  98. package/dist/src/errors.d.ts +7 -0
  99. package/dist/src/errors.d.ts.map +1 -1
  100. package/dist/src/types.d.ts +194 -1
  101. package/dist/src/types.d.ts.map +1 -1
  102. package/dist/src/utils/logger.spec.d.ts +5 -20
  103. package/dist/src/utils/logger.spec.d.ts.map +1 -1
  104. package/dist/src/utils.d.ts +6 -0
  105. package/dist/src/utils.d.ts.map +1 -1
  106. package/dist/tsembed-react.es.js +219 -36
  107. package/dist/tsembed-react.js +218 -35
  108. package/dist/tsembed.es.js +219 -36
  109. package/dist/tsembed.js +218 -35
  110. package/dist/visual-embed-sdk-react-full.d.ts +184 -2
  111. package/dist/visual-embed-sdk-react.d.ts +184 -2
  112. package/dist/visual-embed-sdk.d.ts +184 -2
  113. package/lib/package.json +6 -5
  114. package/lib/src/api-intercept.d.ts.map +1 -1
  115. package/lib/src/api-intercept.js +9 -4
  116. package/lib/src/api-intercept.js.map +1 -1
  117. package/lib/src/api-intercept.spec.js +20 -4
  118. package/lib/src/api-intercept.spec.js.map +1 -1
  119. package/lib/src/auth.spec.js +43 -42
  120. package/lib/src/auth.spec.js.map +1 -1
  121. package/lib/src/authToken.spec.js +3 -3
  122. package/lib/src/authToken.spec.js.map +1 -1
  123. package/lib/src/embed/app.d.ts +17 -0
  124. package/lib/src/embed/app.d.ts.map +1 -1
  125. package/lib/src/embed/app.js +10 -6
  126. package/lib/src/embed/app.js.map +1 -1
  127. package/lib/src/embed/app.spec.js +96 -6
  128. package/lib/src/embed/app.spec.js.map +1 -1
  129. package/lib/src/embed/base.spec.js +11 -15
  130. package/lib/src/embed/base.spec.js.map +1 -1
  131. package/lib/src/embed/bodyless-conversation.spec.js +2 -2
  132. package/lib/src/embed/bodyless-conversation.spec.js.map +1 -1
  133. package/lib/src/embed/conversation.d.ts.map +1 -1
  134. package/lib/src/embed/conversation.js +7 -2
  135. package/lib/src/embed/conversation.js.map +1 -1
  136. package/lib/src/embed/conversation.spec.js +9 -4
  137. package/lib/src/embed/conversation.spec.js.map +1 -1
  138. package/lib/src/embed/embed.spec.js +103 -4
  139. package/lib/src/embed/embed.spec.js.map +1 -1
  140. package/lib/src/embed/events.spec.js +2 -2
  141. package/lib/src/embed/events.spec.js.map +1 -1
  142. package/lib/src/embed/hostEventClient/host-event-client.spec.js +2 -2
  143. package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  144. package/lib/src/embed/liveboard.d.ts +18 -0
  145. package/lib/src/embed/liveboard.d.ts.map +1 -1
  146. package/lib/src/embed/liveboard.js +15 -8
  147. package/lib/src/embed/liveboard.js.map +1 -1
  148. package/lib/src/embed/liveboard.spec.js +114 -26
  149. package/lib/src/embed/liveboard.spec.js.map +1 -1
  150. package/lib/src/embed/pinboard.spec.js +1 -1
  151. package/lib/src/embed/pinboard.spec.js.map +1 -1
  152. package/lib/src/embed/sage.spec.js +2 -2
  153. package/lib/src/embed/sage.spec.js.map +1 -1
  154. package/lib/src/embed/search.spec.js +118 -2
  155. package/lib/src/embed/search.spec.js.map +1 -1
  156. package/lib/src/embed/ts-embed-trigger.spec.js +2 -3
  157. package/lib/src/embed/ts-embed-trigger.spec.js.map +1 -1
  158. package/lib/src/embed/ts-embed.d.ts +3 -2
  159. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  160. package/lib/src/embed/ts-embed.js +52 -18
  161. package/lib/src/embed/ts-embed.js.map +1 -1
  162. package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
  163. package/lib/src/embed/ts-embed.spec.js +336 -72
  164. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  165. package/lib/src/errors.d.ts +7 -0
  166. package/lib/src/errors.d.ts.map +1 -1
  167. package/lib/src/errors.js +7 -0
  168. package/lib/src/errors.js.map +1 -1
  169. package/lib/src/mixpanel-service.spec.js +1 -1
  170. package/lib/src/mixpanel-service.spec.js.map +1 -1
  171. package/lib/src/react/index.spec.js +3 -4
  172. package/lib/src/react/index.spec.js.map +1 -1
  173. package/lib/src/test/test-utils.js +1 -1
  174. package/lib/src/test/test-utils.js.map +1 -1
  175. package/lib/src/types.d.ts +194 -1
  176. package/lib/src/types.d.ts.map +1 -1
  177. package/lib/src/types.js +93 -1
  178. package/lib/src/types.js.map +1 -1
  179. package/lib/src/utils/authService/authService.spec.js +8 -8
  180. package/lib/src/utils/authService/authService.spec.js.map +1 -1
  181. package/lib/src/utils/authService/tokenizedAuthService.spec.js.map +1 -1
  182. package/lib/src/utils/graphql/answerService/answerService.spec.js +1 -1
  183. package/lib/src/utils/graphql/answerService/answerService.spec.js.map +1 -1
  184. package/lib/src/utils/graphql/graphql-request.spec.js +1 -1
  185. package/lib/src/utils/graphql/graphql-request.spec.js.map +1 -1
  186. package/lib/src/utils/graphql/sourceService.spec.js +1 -1
  187. package/lib/src/utils/graphql/sourceService.spec.js.map +1 -1
  188. package/lib/src/utils/logger.spec.d.ts +5 -20
  189. package/lib/src/utils/logger.spec.d.ts.map +1 -1
  190. package/lib/src/utils/processData.spec.js +17 -17
  191. package/lib/src/utils/processData.spec.js.map +1 -1
  192. package/lib/src/utils/processTrigger.spec.js +8 -8
  193. package/lib/src/utils/processTrigger.spec.js.map +1 -1
  194. package/lib/src/utils.d.ts +6 -0
  195. package/lib/src/utils.d.ts.map +1 -1
  196. package/lib/src/utils.js +30 -0
  197. package/lib/src/utils.js.map +1 -1
  198. package/lib/src/utils.spec.js +20 -11
  199. package/lib/src/utils.spec.js.map +1 -1
  200. package/package.json +6 -5
  201. package/src/api-intercept.spec.ts +23 -10
  202. package/src/api-intercept.ts +9 -4
  203. package/src/auth.spec.ts +53 -51
  204. package/src/authToken.spec.ts +3 -3
  205. package/src/embed/app.spec.ts +128 -7
  206. package/src/embed/app.ts +30 -4
  207. package/src/embed/base.spec.ts +16 -20
  208. package/src/embed/bodyless-conversation.spec.ts +2 -2
  209. package/src/embed/conversation.spec.ts +9 -4
  210. package/src/embed/conversation.ts +7 -2
  211. package/src/embed/embed.spec.ts +122 -2
  212. package/src/embed/events.spec.ts +2 -2
  213. package/src/embed/hostEventClient/host-event-client.spec.ts +2 -2
  214. package/src/embed/liveboard.spec.ts +137 -29
  215. package/src/embed/liveboard.ts +36 -6
  216. package/src/embed/pinboard.spec.ts +1 -1
  217. package/src/embed/sage.spec.ts +2 -2
  218. package/src/embed/search.spec.ts +133 -2
  219. package/src/embed/ts-embed-trigger.spec.ts +2 -3
  220. package/src/embed/ts-embed.spec.ts +424 -91
  221. package/src/embed/ts-embed.ts +56 -19
  222. package/src/errors.ts +7 -0
  223. package/src/mixpanel-service.spec.ts +1 -1
  224. package/src/react/index.spec.tsx +4 -5
  225. package/src/test/test-utils.ts +2 -2
  226. package/src/types.ts +206 -1
  227. package/src/utils/authService/authService.spec.ts +17 -17
  228. package/src/utils/authService/tokenizedAuthService.spec.ts +4 -4
  229. package/src/utils/graphql/answerService/answerService.spec.ts +3 -3
  230. package/src/utils/graphql/graphql-request.spec.ts +2 -2
  231. package/src/utils/graphql/sourceService.spec.ts +1 -1
  232. package/src/utils/processData.spec.ts +26 -26
  233. package/src/utils/processTrigger.spec.ts +8 -8
  234. package/src/utils.spec.ts +22 -11
  235. package/src/utils.ts +34 -0
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.44.1 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.44.2 */
2
2
  'use client';
3
3
  function _mergeNamespaces(n, m) {
4
4
  m.forEach(function (e) {
@@ -596,6 +596,7 @@ var EmbedEvent;
596
596
  * SearchEmbed.on(EmbedEvent.Error, (error) => {
597
597
  * console.log(error);
598
598
  * // { type: "Error", data: { errorType: "API", error: { message: '...', error: '...' } } }
599
+ * // { errorType: "API", message: '...', code: '...' } new format
599
600
  * });
600
601
  * ```
601
602
  * @example
@@ -607,6 +608,7 @@ var EmbedEvent;
607
608
  * // message: "Fullscreen API is not enabled",
608
609
  * // stack: "..."
609
610
  * // } }}
611
+ * // { errorType: "FULLSCREEN", message: "Fullscreen API is not enabled", code: '...' } new format
610
612
  * })
611
613
  * ```
612
614
  */
@@ -762,7 +764,8 @@ var EmbedEvent;
762
764
  */
763
765
  EmbedEvent["ALL"] = "*";
764
766
  /**
765
- * Emitted when an Answer is saved in the app
767
+ * Emitted when an Answer is saved in the app.
768
+ * Use start:true to subscribe to when save is initiated, or end:true to subscribe to when save is completed. Default is end:true.
766
769
  * @Version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
767
770
  * @example
768
771
  *```js
@@ -797,6 +800,7 @@ var EmbedEvent;
797
800
  EmbedEvent["Download"] = "download";
798
801
  /**
799
802
  * Emitted when the download action is triggered on an Answer.
803
+ * Use start:true to subscribe to when download is initiated, or end:true to subscribe to when download is completed. Default is end:true.
800
804
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.0.sw
801
805
  * @example
802
806
  *```js
@@ -811,6 +815,7 @@ var EmbedEvent;
811
815
  EmbedEvent["DownloadAsPng"] = "downloadAsPng";
812
816
  /**
813
817
  * Emitted when the Download as PDF action is triggered on an Answer
818
+ * Use start:true to subscribe to when download as PDF is initiated, or end:true to subscribe to when download as PDF is completed. Default is end:true.
814
819
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
815
820
  * @example
816
821
  *```js
@@ -825,6 +830,7 @@ var EmbedEvent;
825
830
  EmbedEvent["DownloadAsPdf"] = "downloadAsPdf";
826
831
  /**
827
832
  * Emitted when the Download as CSV action is triggered on an Answer.
833
+ * Use start:true to subscribe to when download as CSV is initiated, or end:true to subscribe to when download as CSV is completed. Default is end:true.
828
834
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
829
835
  * @example
830
836
  *```js
@@ -839,6 +845,7 @@ var EmbedEvent;
839
845
  EmbedEvent["DownloadAsCsv"] = "downloadAsCsv";
840
846
  /**
841
847
  * Emitted when the Download as XLSX action is triggered on an Answer.
848
+ * Use start:true to subscribe to when download as XLSX is initiated, or end:true to subscribe to when download as XLSX is completed. Default is end:true.
842
849
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
843
850
  * @example
844
851
  *```js
@@ -853,6 +860,7 @@ var EmbedEvent;
853
860
  EmbedEvent["DownloadAsXlsx"] = "downloadAsXlsx";
854
861
  /**
855
862
  * Emitted when an Answer is deleted in the app
863
+ * Use start:true to subscribe to when delete is initiated, or end:true to subscribe to when delete is completed. Default is end:true.
856
864
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
857
865
  * @example
858
866
  *```js
@@ -879,6 +887,7 @@ var EmbedEvent;
879
887
  /**
880
888
  * Emitted when a user initiates the Pin action to
881
889
  * add an Answer to a Liveboard.
890
+ * Use start:true to subscribe to when pin is initiated, or end:true to subscribe to when pin is completed. Default is end:true.
882
891
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
883
892
  * @example
884
893
  *```js
@@ -992,6 +1001,7 @@ var EmbedEvent;
992
1001
  /**
993
1002
  * Emitted when the **Export TML** action is triggered on an
994
1003
  * an embedded object in the app
1004
+ * Use start:true to subscribe to when export is initiated, or end:true to subscribe to when export is completed. Default is end:true.
995
1005
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
996
1006
  * @example
997
1007
  *```js
@@ -1017,6 +1027,7 @@ var EmbedEvent;
1017
1027
  EmbedEvent["SaveAsView"] = "saveAsView";
1018
1028
  /**
1019
1029
  * Emitted when the user creates a copy of an Answer.
1030
+ * Use start:true to subscribe to when copy and edit is initiated, or end:true to subscribe to when copy and edit is completed. Default is end:true.
1020
1031
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1021
1032
  * @example
1022
1033
  *```js
@@ -3088,6 +3099,8 @@ var Param;
3088
3099
  Param["HideLiveboardHeader"] = "hideLiveboardHeader";
3089
3100
  Param["ShowLiveboardDescription"] = "showLiveboardDescription";
3090
3101
  Param["ShowLiveboardTitle"] = "showLiveboardTitle";
3102
+ Param["ShowMaskedFilterChip"] = "showMaskedFilterChip";
3103
+ Param["IsLiveboardMasterpiecesEnabled"] = "isLiveboardMasterpiecesEnabled";
3091
3104
  Param["HiddenTabs"] = "hideTabs";
3092
3105
  Param["VisibleTabs"] = "visibleTabs";
3093
3106
  Param["HideTabPanel"] = "hideTabPanel";
@@ -4621,6 +4634,85 @@ var LogLevel;
4621
4634
  */
4622
4635
  LogLevel["TRACE"] = "TRACE";
4623
4636
  })(LogLevel || (LogLevel = {}));
4637
+ /**
4638
+ * Error types emitted by embedded components.
4639
+ *
4640
+ * These enum values categorize different types of errors that can occur during
4641
+ * the lifecycle of an embedded ThoughtSpot component. Use these values to implement
4642
+ * specific error handling logic based on the error category.
4643
+ *
4644
+ * @see {@link EmbedErrorDetailsEvent} - The error event object structure
4645
+ * @see {@link EmbedEvent.Error} - The event that emits these errors
4646
+ * @version SDK: 1.44.2 | ThoughtSpot: 26.2.0.cl
4647
+ * @group Error Handling
4648
+ */
4649
+ var ErrorDetailsTypes;
4650
+ (function (ErrorDetailsTypes) {
4651
+ /** API call failure */
4652
+ ErrorDetailsTypes["API"] = "API";
4653
+ /** General validation error */
4654
+ ErrorDetailsTypes["VALIDATION_ERROR"] = "VALIDATION_ERROR";
4655
+ /** Network connectivity or request error */
4656
+ ErrorDetailsTypes["NETWORK"] = "NETWORK";
4657
+ })(ErrorDetailsTypes || (ErrorDetailsTypes = {}));
4658
+ /**
4659
+ * Specific error codes for embedded component errors.
4660
+ *
4661
+ * These codes provide granular identification of errors that occur in embedded components.
4662
+ * They are returned in the {@link EmbedErrorDetailsEvent.code} property and allow for
4663
+ * precise error handling and debugging.
4664
+ *
4665
+ * The codes are organized into categories:
4666
+ * - **Worksheet ID not found or does not exist**: Errors related to applying or updating filters
4667
+ * - **Liveboard ID missing**: Errors related to missing liveboard ID
4668
+ * - **Conflicting actions configuration**: Errors related to conflicting actions configuration
4669
+ * - **Conflicting tabs configuration**: Errors related to conflicting tabs configuration
4670
+ * - **Initialization error**: Errors related to initialization error
4671
+ * - **Network error**: Errors related to network error
4672
+ * - **Custom action validation**: Errors related to custom action validation
4673
+ * - **Login failed**: Errors related to login failed
4674
+ * - **Render not called**: Errors related to render not called
4675
+ * - **Host event type undefined or invalid**: Errors related to host event type undefined or invalid
4676
+ *
4677
+ * @version SDK: 1.44.2 | ThoughtSpot: 26.2.0.cl
4678
+ * @group Error Handling
4679
+ * @see {@link EmbedErrorDetailsEvent} - The error event object that includes these codes
4680
+ * @see {@link ErrorDetailsTypes} - General error type categories
4681
+ *
4682
+ * @example
4683
+ * Handle specific error codes
4684
+ *
4685
+ * embed.on(EmbedEvent.Error, (error) => {
4686
+ * if (error.code === EmbedErrorCodes.WORKSHEET_ID_NOT_FOUND) {
4687
+ * console.error('Worksheet ID not found:', error.message);
4688
+ * }
4689
+ * });
4690
+ * */
4691
+ var EmbedErrorCodes;
4692
+ (function (EmbedErrorCodes) {
4693
+ /** Worksheet ID not found or does not exist */
4694
+ EmbedErrorCodes["WORKSHEET_ID_NOT_FOUND"] = "WORKSHEET_ID_NOT_FOUND";
4695
+ /** Required Liveboard ID is missing from configuration */
4696
+ EmbedErrorCodes["LIVEBOARD_ID_MISSING"] = "LIVEBOARD_ID_MISSING";
4697
+ /** Conflicting action configuration detected (e.g., both hiddenActions and visibleActions specified) */
4698
+ EmbedErrorCodes["CONFLICTING_ACTIONS_CONFIG"] = "CONFLICTING_ACTIONS_CONFIG";
4699
+ /** Conflicting tab configuration detected (e.g., both hiddenTabs and visibleTabs specified) */
4700
+ EmbedErrorCodes["CONFLICTING_TABS_CONFIG"] = "CONFLICTING_TABS_CONFIG";
4701
+ /** Error during component initialization */
4702
+ EmbedErrorCodes["INIT_ERROR"] = "INIT_ERROR";
4703
+ /** Network connectivity or request error */
4704
+ EmbedErrorCodes["NETWORK_ERROR"] = "NETWORK_ERROR";
4705
+ /** Custom action validation failed */
4706
+ EmbedErrorCodes["CUSTOM_ACTION_VALIDATION"] = "CUSTOM_ACTION_VALIDATION";
4707
+ /** Authentication/login failed */
4708
+ EmbedErrorCodes["LOGIN_FAILED"] = "LOGIN_FAILED";
4709
+ /** Render method was not called before attempting to use the component */
4710
+ EmbedErrorCodes["RENDER_NOT_CALLED"] = "RENDER_NOT_CALLED";
4711
+ /** Host event type is undefined or invalid */
4712
+ EmbedErrorCodes["HOST_EVENT_TYPE_UNDEFINED"] = "HOST_EVENT_TYPE_UNDEFINED";
4713
+ /** Error parsing api intercept body */
4714
+ EmbedErrorCodes["PARSING_API_INTERCEPT_BODY_ERROR"] = "PARSING_API_INTERCEPT_BODY_ERROR";
4715
+ })(EmbedErrorCodes || (EmbedErrorCodes = {}));
4624
4716
  /**
4625
4717
  * Enum for the type of API intercepted
4626
4718
  */
@@ -4863,6 +4955,36 @@ const getCssDimension = (value) => {
4863
4955
  }
4864
4956
  return value;
4865
4957
  };
4958
+ /**
4959
+ * Validates if a string is a valid CSS margin value.
4960
+ * @param value - The string to validate
4961
+ * @returns true if the value is a valid CSS margin value, false otherwise
4962
+ */
4963
+ const isValidCssMargin = (value) => {
4964
+ if (isUndefined$1(value)) {
4965
+ return false;
4966
+ }
4967
+ if (typeof value !== 'string') {
4968
+ logger$3.error('Please provide a valid lazyLoadingMargin value (e.g., "10px")');
4969
+ return false;
4970
+ }
4971
+ // This pattern allows for an optional negative sign, and numbers that can be integers or decimals (including leading dot).
4972
+ const cssUnitPattern = /^-?(\d+(\.\d*)?|\.\d+)(px|em|rem|%|vh|vw)$/i;
4973
+ const parts = value.trim().split(/\s+/);
4974
+ if (parts.length > 4) {
4975
+ logger$3.error('Please provide a valid lazyLoadingMargin value (e.g., "10px")');
4976
+ return false;
4977
+ }
4978
+ const isValid = parts.every(part => {
4979
+ const trimmedPart = part.trim();
4980
+ return trimmedPart.toLowerCase() === 'auto' || trimmedPart === '0' || cssUnitPattern.test(trimmedPart);
4981
+ });
4982
+ if (!isValid) {
4983
+ logger$3.error('Please provide a valid lazyLoadingMargin value (e.g., "10px")');
4984
+ return false;
4985
+ }
4986
+ return true;
4987
+ };
4866
4988
  const getSSOMarker = (markerId) => {
4867
4989
  const encStringToAppend = encodeURIComponent(markerId);
4868
4990
  return `tsSSOMarker=${encStringToAppend}`;
@@ -7487,6 +7609,13 @@ const ERROR_MESSAGE = {
7487
7609
  RENDER_CALLED_BEFORE_INIT: 'Looks like render was called before calling init, the render won\'t start until init is called.\nFor more info check\n1. https://developers.thoughtspot.com/docs/Function_init#_init\n2.https://developers.thoughtspot.com/docs/getting-started#initSdk',
7488
7610
  SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
7489
7611
  OFFLINE_WARNING: 'Network not Detected. Embed is offline. Please reconnect and refresh',
7612
+ INIT_SDK_REQUIRED: 'You need to init the ThoughtSpot SDK module first',
7613
+ CONFLICTING_ACTIONS_CONFIG: 'You cannot have both hidden actions and visible actions',
7614
+ CONFLICTING_TABS_CONFIG: 'You cannot have both hidden Tabs and visible Tabs',
7615
+ RENDER_BEFORE_EVENTS_REQUIRED: 'Please call render before triggering events',
7616
+ HOST_EVENT_TYPE_UNDEFINED: 'Host event type is undefined',
7617
+ LOGIN_FAILED: 'Login failed',
7618
+ ERROR_PARSING_API_INTERCEPT_BODY: 'Error parsing api intercept body',
7490
7619
  };
7491
7620
  const CUSTOM_ACTIONS_ERROR_MESSAGE = {
7492
7621
  INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
@@ -8396,7 +8525,7 @@ class AnswerService {
8396
8525
  async getTML() {
8397
8526
  const { object } = await this.executeQuery(getAnswerTML, {});
8398
8527
  const edoc = object[0].edoc;
8399
- const YAML = await import('./index-BE9gGzRX.js');
8528
+ const YAML = await import('./index-CSFjfTVk.js');
8400
8529
  const parsedDoc = YAML.parse(edoc);
8401
8530
  return {
8402
8531
  answer: {
@@ -17828,7 +17957,7 @@ function processEventData(type, eventData, thoughtSpotHost, containerEl) {
17828
17957
  return eventData;
17829
17958
  }
17830
17959
 
17831
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.44.1";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^11.2.0","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"32 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
17960
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.44.2";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^11.2.0","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^30.0.0","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^30.2.0","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^30.2.0","jest-environment-jsdom":"^29.7.0","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^29.4.6","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"32 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
17832
17961
 
17833
17962
  class HostEventClient {
17834
17963
  constructor(iFrame) {
@@ -18026,9 +18155,13 @@ const handleInterceptEvent = async (params) => {
18026
18155
  const { eventData, executeEvent, viewConfig, getUnsavedAnswerTml } = params;
18027
18156
  const [interceptData, bodyParseError] = parseInterceptData(eventData.data);
18028
18157
  if (bodyParseError) {
18029
- executeEvent(EmbedEvent.Error, {
18030
- error: 'Error parsing api intercept body',
18031
- });
18158
+ const errorDetails = {
18159
+ errorType: ErrorDetailsTypes.API,
18160
+ message: ERROR_MESSAGE.ERROR_PARSING_API_INTERCEPT_BODY,
18161
+ code: EmbedErrorCodes.PARSING_API_INTERCEPT_BODY_ERROR,
18162
+ error: ERROR_MESSAGE.ERROR_PARSING_API_INTERCEPT_BODY,
18163
+ };
18164
+ executeEvent(EmbedEvent.Error, errorDetails);
18032
18165
  logger$3.error('Error parsing request body', bodyParseError);
18033
18166
  return;
18034
18167
  }
@@ -18340,19 +18473,23 @@ class TsEmbed {
18340
18473
  * Throws error encountered during initialization.
18341
18474
  */
18342
18475
  throwInitError() {
18343
- this.handleError('You need to init the ThoughtSpot SDK module first');
18476
+ this.handleError({
18477
+ errorType: ErrorDetailsTypes.VALIDATION_ERROR,
18478
+ message: ERROR_MESSAGE.INIT_SDK_REQUIRED,
18479
+ code: EmbedErrorCodes.INIT_ERROR,
18480
+ error: ERROR_MESSAGE.INIT_SDK_REQUIRED,
18481
+ });
18344
18482
  }
18345
18483
  /**
18346
18484
  * Handles errors within the SDK
18347
18485
  * @param error The error message or object
18486
+ * @param errorDetails The error details
18348
18487
  */
18349
- handleError(error) {
18488
+ handleError(errorDetails) {
18350
18489
  this.isError = true;
18351
- this.executeCallbacks(EmbedEvent.Error, {
18352
- error,
18353
- });
18490
+ this.executeCallbacks(EmbedEvent.Error, errorDetails);
18354
18491
  // Log error
18355
- logger$3.error(error);
18492
+ logger$3.error(errorDetails);
18356
18493
  }
18357
18494
  /**
18358
18495
  * Extracts the type field from the event payload
@@ -18431,11 +18568,14 @@ class TsEmbed {
18431
18568
  };
18432
18569
  window.addEventListener('online', onlineEventListener);
18433
18570
  const offlineEventListener = (e) => {
18434
- const offlineWarning = ERROR_MESSAGE.OFFLINE_WARNING;
18435
- this.executeCallbacks(EmbedEvent.Error, {
18436
- offlineWarning,
18437
- });
18438
- logger$3.warn(offlineWarning);
18571
+ const errorDetails = {
18572
+ errorType: ErrorDetailsTypes.NETWORK,
18573
+ message: ERROR_MESSAGE.OFFLINE_WARNING,
18574
+ code: EmbedErrorCodes.NETWORK_ERROR,
18575
+ offlineWarning: ERROR_MESSAGE.OFFLINE_WARNING,
18576
+ };
18577
+ this.executeCallbacks(EmbedEvent.Error, errorDetails);
18578
+ logger$3.warn(errorDetails);
18439
18579
  };
18440
18580
  window.addEventListener('offline', offlineEventListener);
18441
18581
  this.subscribedListeners.online = onlineEventListener;
@@ -18515,8 +18655,10 @@ class TsEmbed {
18515
18655
  ]);
18516
18656
  if (customActionsResult.errors.length > 0) {
18517
18657
  this.handleError({
18518
- type: 'CUSTOM_ACTION_VALIDATION',
18658
+ errorType: ErrorDetailsTypes.VALIDATION_ERROR,
18519
18659
  message: customActionsResult.errors,
18660
+ code: EmbedErrorCodes.CUSTOM_ACTION_VALIDATION,
18661
+ error: { type: EmbedErrorCodes.CUSTOM_ACTION_VALIDATION, message: customActionsResult.errors }
18520
18662
  });
18521
18663
  }
18522
18664
  const baseInitData = {
@@ -18613,11 +18755,21 @@ class TsEmbed {
18613
18755
  ...additionalFlagsFromView,
18614
18756
  };
18615
18757
  if (Array.isArray(visibleActions) && Array.isArray(hiddenActions)) {
18616
- this.handleError('You cannot have both hidden actions and visible actions');
18758
+ this.handleError({
18759
+ errorType: ErrorDetailsTypes.VALIDATION_ERROR,
18760
+ message: ERROR_MESSAGE.CONFLICTING_ACTIONS_CONFIG,
18761
+ code: EmbedErrorCodes.CONFLICTING_ACTIONS_CONFIG,
18762
+ error: ERROR_MESSAGE.CONFLICTING_ACTIONS_CONFIG,
18763
+ });
18617
18764
  return queryParams;
18618
18765
  }
18619
18766
  if (Array.isArray(visibleTabs) && Array.isArray(hiddenTabs)) {
18620
- this.handleError('You cannot have both hidden Tabs and visible Tabs');
18767
+ this.handleError({
18768
+ errorType: ErrorDetailsTypes.VALIDATION_ERROR,
18769
+ message: ERROR_MESSAGE.CONFLICTING_TABS_CONFIG,
18770
+ code: EmbedErrorCodes.CONFLICTING_TABS_CONFIG,
18771
+ error: ERROR_MESSAGE.CONFLICTING_TABS_CONFIG,
18772
+ });
18621
18773
  return queryParams;
18622
18774
  }
18623
18775
  if (primaryAction) {
@@ -18842,7 +18994,12 @@ class TsEmbed {
18842
18994
  error: JSON.stringify(error),
18843
18995
  });
18844
18996
  this.handleInsertionIntoDOM(this.embedConfig.loginFailedMessage);
18845
- this.handleError(error);
18997
+ this.handleError({
18998
+ errorType: ErrorDetailsTypes.API,
18999
+ message: error.message || ERROR_MESSAGE.LOGIN_FAILED,
19000
+ code: EmbedErrorCodes.LOGIN_FAILED,
19001
+ error: error,
19002
+ });
18846
19003
  });
18847
19004
  });
18848
19005
  }
@@ -19147,11 +19304,21 @@ class TsEmbed {
19147
19304
  async trigger(messageType, data = {}) {
19148
19305
  uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
19149
19306
  if (!this.isRendered) {
19150
- this.handleError('Please call render before triggering events');
19307
+ this.handleError({
19308
+ errorType: ErrorDetailsTypes.VALIDATION_ERROR,
19309
+ message: ERROR_MESSAGE.RENDER_BEFORE_EVENTS_REQUIRED,
19310
+ code: EmbedErrorCodes.RENDER_NOT_CALLED,
19311
+ error: ERROR_MESSAGE.RENDER_BEFORE_EVENTS_REQUIRED,
19312
+ });
19151
19313
  return null;
19152
19314
  }
19153
19315
  if (!messageType) {
19154
- this.handleError('Host event type is undefined');
19316
+ this.handleError({
19317
+ errorType: ErrorDetailsTypes.VALIDATION_ERROR,
19318
+ message: ERROR_MESSAGE.HOST_EVENT_TYPE_UNDEFINED,
19319
+ code: EmbedErrorCodes.HOST_EVENT_TYPE_UNDEFINED,
19320
+ error: ERROR_MESSAGE.HOST_EVENT_TYPE_UNDEFINED,
19321
+ });
19155
19322
  return null;
19156
19323
  }
19157
19324
  // Check if iframe exists before triggering -
@@ -19632,7 +19799,7 @@ class AppEmbed extends V1Embed {
19632
19799
  constructor(domSelector, viewConfig) {
19633
19800
  viewConfig.embedComponentType = 'AppEmbed';
19634
19801
  super(domSelector, viewConfig);
19635
- this.defaultHeight = '100%';
19802
+ this.defaultHeight = 500;
19636
19803
  this.sendFullHeightLazyLoadData = () => {
19637
19804
  const data = calculateVisibleElementData(this.iFrame);
19638
19805
  this.trigger(HostEvent.VisibleEmbedCoordinates, data);
@@ -19654,8 +19821,7 @@ class AppEmbed extends V1Embed {
19654
19821
  * @param data The event payload
19655
19822
  */
19656
19823
  this.updateIFrameHeight = (data) => {
19657
- var _a;
19658
- this.setIFrameHeight(Math.max(data.data, (_a = this.iFrame) === null || _a === void 0 ? void 0 : _a.scrollHeight));
19824
+ this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
19659
19825
  this.sendFullHeightLazyLoadData();
19660
19826
  };
19661
19827
  this.embedIframeCenter = (data, responder) => {
@@ -19694,7 +19860,7 @@ class AppEmbed extends V1Embed {
19694
19860
  * embedded Liveboard or visualization.
19695
19861
  */
19696
19862
  getEmbedParams() {
19697
- const { tag, hideTagFilterChips, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, isEnhancedFilterInteractivityEnabled = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, } = this.viewConfig;
19863
+ const { tag, hideTagFilterChips, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled = false, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, isEnhancedFilterInteractivityEnabled = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, minimumHeight, } = this.viewConfig;
19698
19864
  let params = {};
19699
19865
  params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
19700
19866
  params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
@@ -19703,6 +19869,8 @@ class AppEmbed extends V1Embed {
19703
19869
  params[Param.HideLiveboardHeader] = hideLiveboardHeader;
19704
19870
  params[Param.ShowLiveboardTitle] = showLiveboardTitle;
19705
19871
  params[Param.ShowLiveboardDescription] = !!showLiveboardDescription;
19872
+ params[Param.ShowMaskedFilterChip] = showMaskedFilterChip;
19873
+ params[Param.IsLiveboardMasterpiecesEnabled] = isLiveboardMasterpiecesEnabled;
19706
19874
  params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
19707
19875
  params[Param.IsFullAppEmbed] = true;
19708
19876
  params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
@@ -19729,7 +19897,9 @@ class AppEmbed extends V1Embed {
19729
19897
  params[Param.fullHeight] = true;
19730
19898
  if (this.viewConfig.lazyLoadingForFullHeight) {
19731
19899
  params[Param.IsLazyLoadingForEmbedEnabled] = true;
19732
- params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
19900
+ if (isValidCssMargin(this.viewConfig.lazyLoadingMargin)) {
19901
+ params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
19902
+ }
19733
19903
  }
19734
19904
  }
19735
19905
  if (tag) {
@@ -19774,6 +19944,7 @@ class AppEmbed extends V1Embed {
19774
19944
  if (isCentralizedLiveboardFilterUXEnabled != undefined) {
19775
19945
  params[Param.isCentralizedLiveboardFilterUXEnabled] = isCentralizedLiveboardFilterUXEnabled;
19776
19946
  }
19947
+ this.defaultHeight = minimumHeight || this.defaultHeight;
19777
19948
  params[Param.DataPanelV2Enabled] = dataPanelV2;
19778
19949
  params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
19779
19950
  params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
@@ -20128,19 +20299,19 @@ class LiveboardEmbed extends V1Embed {
20128
20299
  getEmbedParamsObject() {
20129
20300
  let params = {};
20130
20301
  params = this.getBaseQueryParams(params);
20131
- const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, isEnhancedFilterInteractivityEnabled = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, showSpotterLimitations, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, } = this.viewConfig;
20302
+ const { enableVizTransformations, fullHeight, defaultHeight, minimumHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled = false, isEnhancedFilterInteractivityEnabled = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, showSpotterLimitations, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, } = this.viewConfig;
20132
20303
  const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
20133
20304
  || this.viewConfig.preventPinboardFilterRemoval;
20134
20305
  if (fullHeight === true) {
20135
20306
  params[Param.fullHeight] = true;
20136
20307
  if (this.viewConfig.lazyLoadingForFullHeight) {
20137
20308
  params[Param.IsLazyLoadingForEmbedEnabled] = true;
20138
- params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
20309
+ if (isValidCssMargin(this.viewConfig.lazyLoadingMargin)) {
20310
+ params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
20311
+ }
20139
20312
  }
20140
20313
  }
20141
- if (defaultHeight) {
20142
- this.defaultHeight = defaultHeight;
20143
- }
20314
+ this.defaultHeight = minimumHeight || defaultHeight || this.defaultHeight;
20144
20315
  if (enableVizTransformations !== undefined) {
20145
20316
  params[Param.EnableVizTransformations] = enableVizTransformations.toString();
20146
20317
  }
@@ -20207,6 +20378,8 @@ class LiveboardEmbed extends V1Embed {
20207
20378
  params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
20208
20379
  params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
20209
20380
  params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
20381
+ params[Param.ShowMaskedFilterChip] = showMaskedFilterChip;
20382
+ params[Param.IsLiveboardMasterpiecesEnabled] = isLiveboardMasterpiecesEnabled;
20210
20383
  params[Param.IsEnhancedFilterInteractivityEnabled] = isEnhancedFilterInteractivityEnabled;
20211
20384
  params[Param.DataPanelV2Enabled] = dataPanelV2;
20212
20385
  params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
@@ -20238,7 +20411,12 @@ class LiveboardEmbed extends V1Embed {
20238
20411
  const { vizId, activeTabId } = this.viewConfig;
20239
20412
  const liveboardId = (_a = this.viewConfig.liveboardId) !== null && _a !== void 0 ? _a : this.viewConfig.pinboardId;
20240
20413
  if (!liveboardId) {
20241
- this.handleError(ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION);
20414
+ this.handleError({
20415
+ errorType: ErrorDetailsTypes.VALIDATION_ERROR,
20416
+ message: ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION,
20417
+ code: EmbedErrorCodes.LIVEBOARD_ID_MISSING,
20418
+ error: ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION,
20419
+ });
20242
20420
  }
20243
20421
  return `${this.getRootIframeSrc()}${this.getIframeSuffixSrc(liveboardId, vizId, activeTabId)}`;
20244
20422
  }
@@ -21202,7 +21380,12 @@ class SpotterEmbed extends TsEmbed {
21202
21380
  getEmbedParamsObject() {
21203
21381
  const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, enablePastConversationsSidebar, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, updatedSpotterChatPrompt, } = this.viewConfig;
21204
21382
  if (!worksheetId) {
21205
- this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
21383
+ this.handleError({
21384
+ errorType: ErrorDetailsTypes.VALIDATION_ERROR,
21385
+ message: ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND,
21386
+ code: EmbedErrorCodes.WORKSHEET_ID_NOT_FOUND,
21387
+ error: ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND,
21388
+ });
21206
21389
  }
21207
21390
  const queryParams = this.getBaseQueryParams();
21208
21391
  queryParams[Param.SpotterEnabled] = true;