@thoughtspot/visual-embed-sdk 1.40.1-alpha.3 → 1.40.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 (413) hide show
  1. package/cjs/package.json +2 -2
  2. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  3. package/cjs/src/embed/ts-embed.js +13 -2
  4. package/cjs/src/embed/ts-embed.js.map +1 -1
  5. package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
  6. package/cjs/src/embed/ts-embed.spec.js +124 -2
  7. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  8. package/cjs/src/errors.d.ts +11 -0
  9. package/cjs/src/errors.d.ts.map +1 -1
  10. package/cjs/src/errors.js +12 -1
  11. package/cjs/src/errors.js.map +1 -1
  12. package/cjs/src/index.d.ts +2 -2
  13. package/cjs/src/index.d.ts.map +1 -1
  14. package/cjs/src/index.js +3 -1
  15. package/cjs/src/index.js.map +1 -1
  16. package/cjs/src/react/index.d.ts +1 -1
  17. package/cjs/src/react/index.d.ts.map +1 -1
  18. package/cjs/src/react/index.js +2 -1
  19. package/cjs/src/react/index.js.map +1 -1
  20. package/cjs/src/types.d.ts +94 -3
  21. package/cjs/src/types.d.ts.map +1 -1
  22. package/cjs/src/types.js +22 -11
  23. package/cjs/src/types.js.map +1 -1
  24. package/cjs/src/utils/custom-actions.d.ts +12 -0
  25. package/cjs/src/utils/custom-actions.d.ts.map +1 -0
  26. package/cjs/src/utils/custom-actions.js +191 -0
  27. package/cjs/src/utils/custom-actions.js.map +1 -0
  28. package/cjs/src/utils/custom-actions.spec.d.ts +2 -0
  29. package/cjs/src/utils/custom-actions.spec.d.ts.map +1 -0
  30. package/cjs/src/utils/custom-actions.spec.js +437 -0
  31. package/cjs/src/utils/custom-actions.spec.js.map +1 -0
  32. package/cjs/src/utils.d.ts +7 -0
  33. package/cjs/src/utils.d.ts.map +1 -1
  34. package/cjs/src/utils.js +11 -1
  35. package/cjs/src/utils.js.map +1 -1
  36. package/cjs/src/utils.spec.js +28 -0
  37. package/cjs/src/utils.spec.js.map +1 -1
  38. package/dist/{index-B0uCTBbm.js → index-Dx5UP5Ip.js} +1 -1
  39. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  40. package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
  41. package/dist/src/errors.d.ts +11 -0
  42. package/dist/src/errors.d.ts.map +1 -1
  43. package/dist/src/index.d.ts +2 -2
  44. package/dist/src/index.d.ts.map +1 -1
  45. package/dist/src/react/index.d.ts +1 -1
  46. package/dist/src/react/index.d.ts.map +1 -1
  47. package/dist/src/types.d.ts +94 -3
  48. package/dist/src/types.d.ts.map +1 -1
  49. package/dist/src/utils/custom-actions.d.ts +12 -0
  50. package/dist/src/utils/custom-actions.d.ts.map +1 -0
  51. package/dist/src/utils/custom-actions.spec.d.ts +2 -0
  52. package/dist/src/utils/custom-actions.spec.d.ts.map +1 -0
  53. package/dist/src/utils.d.ts +7 -0
  54. package/dist/src/utils.d.ts.map +1 -1
  55. package/dist/tsembed-react.es.js +1684 -201
  56. package/dist/tsembed-react.js +1683 -200
  57. package/dist/tsembed.es.js +1636 -153
  58. package/dist/tsembed.js +1635 -152
  59. package/dist/visual-embed-sdk-react-full.d.ts +95 -4
  60. package/dist/visual-embed-sdk-react.d.ts +95 -4
  61. package/dist/visual-embed-sdk.d.ts +95 -4
  62. package/lib/package.json +2 -2
  63. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  64. package/lib/src/embed/ts-embed.js +13 -2
  65. package/lib/src/embed/ts-embed.js.map +1 -1
  66. package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
  67. package/lib/src/embed/ts-embed.spec.js +125 -3
  68. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  69. package/lib/src/errors.d.ts +11 -0
  70. package/lib/src/errors.d.ts.map +1 -1
  71. package/lib/src/errors.js +11 -0
  72. package/lib/src/errors.js.map +1 -1
  73. package/lib/src/index.d.ts +2 -2
  74. package/lib/src/index.d.ts.map +1 -1
  75. package/lib/src/index.js +2 -2
  76. package/lib/src/index.js.map +1 -1
  77. package/lib/src/react/index.d.ts +1 -1
  78. package/lib/src/react/index.d.ts.map +1 -1
  79. package/lib/src/react/index.js +1 -1
  80. package/lib/src/react/index.js.map +1 -1
  81. package/lib/src/types.d.ts +94 -3
  82. package/lib/src/types.d.ts.map +1 -1
  83. package/lib/src/types.js +21 -10
  84. package/lib/src/types.js.map +1 -1
  85. package/lib/src/utils/custom-actions.d.ts +12 -0
  86. package/lib/src/utils/custom-actions.d.ts.map +1 -0
  87. package/lib/src/utils/custom-actions.js +186 -0
  88. package/lib/src/utils/custom-actions.js.map +1 -0
  89. package/lib/src/utils/custom-actions.spec.d.ts +2 -0
  90. package/lib/src/utils/custom-actions.spec.d.ts.map +1 -0
  91. package/lib/src/utils/custom-actions.spec.js +435 -0
  92. package/lib/src/utils/custom-actions.spec.js.map +1 -0
  93. package/lib/src/utils.d.ts +7 -0
  94. package/lib/src/utils.d.ts.map +1 -1
  95. package/lib/src/utils.js +9 -0
  96. package/lib/src/utils.js.map +1 -1
  97. package/lib/src/utils.spec.js +29 -1
  98. package/lib/src/utils.spec.js.map +1 -1
  99. package/lib/src/visual-embed-sdk.d.ts +96 -5
  100. package/package.json +2 -2
  101. package/src/embed/ts-embed.spec.ts +137 -3
  102. package/src/embed/ts-embed.ts +13 -1
  103. package/src/errors.ts +12 -0
  104. package/src/index.ts +4 -0
  105. package/src/react/index.tsx +1 -0
  106. package/src/types.ts +110 -15
  107. package/src/utils/custom-actions.spec.ts +471 -0
  108. package/src/utils/custom-actions.ts +228 -0
  109. package/src/utils.spec.ts +34 -0
  110. package/src/utils.ts +10 -0
  111. package/dist/es/index-BwesxE_h.js +0 -7369
  112. package/dist/es/index.js +0 -17539
  113. package/dist/es/react/index.js +0 -24039
  114. package/dist/es/react/src/auth.d.ts +0 -171
  115. package/dist/es/react/src/auth.d.ts.map +0 -1
  116. package/dist/es/react/src/auth.spec.d.ts +0 -15
  117. package/dist/es/react/src/auth.spec.d.ts.map +0 -1
  118. package/dist/es/react/src/authToken.d.ts +0 -17
  119. package/dist/es/react/src/authToken.d.ts.map +0 -1
  120. package/dist/es/react/src/authToken.spec.d.ts +0 -2
  121. package/dist/es/react/src/authToken.spec.d.ts.map +0 -1
  122. package/dist/es/react/src/config.d.ts +0 -21
  123. package/dist/es/react/src/config.d.ts.map +0 -1
  124. package/dist/es/react/src/config.spec.d.ts +0 -5
  125. package/dist/es/react/src/config.spec.d.ts.map +0 -1
  126. package/dist/es/react/src/css-variables.d.ts +0 -384
  127. package/dist/es/react/src/css-variables.d.ts.map +0 -1
  128. package/dist/es/react/src/embed/app.d.ts +0 -478
  129. package/dist/es/react/src/embed/app.d.ts.map +0 -1
  130. package/dist/es/react/src/embed/app.spec.d.ts +0 -2
  131. package/dist/es/react/src/embed/app.spec.d.ts.map +0 -1
  132. package/dist/es/react/src/embed/base.d.ts +0 -136
  133. package/dist/es/react/src/embed/base.d.ts.map +0 -1
  134. package/dist/es/react/src/embed/base.spec.d.ts +0 -2
  135. package/dist/es/react/src/embed/base.spec.d.ts.map +0 -1
  136. package/dist/es/react/src/embed/bodyless-conversation.d.ts +0 -26
  137. package/dist/es/react/src/embed/bodyless-conversation.d.ts.map +0 -1
  138. package/dist/es/react/src/embed/bodyless-conversation.spec.d.ts +0 -2
  139. package/dist/es/react/src/embed/bodyless-conversation.spec.d.ts.map +0 -1
  140. package/dist/es/react/src/embed/conversation.d.ts +0 -43
  141. package/dist/es/react/src/embed/conversation.d.ts.map +0 -1
  142. package/dist/es/react/src/embed/conversation.spec.d.ts +0 -2
  143. package/dist/es/react/src/embed/conversation.spec.d.ts.map +0 -1
  144. package/dist/es/react/src/embed/embed.spec.d.ts +0 -2
  145. package/dist/es/react/src/embed/embed.spec.d.ts.map +0 -1
  146. package/dist/es/react/src/embed/embedConfig.d.ts +0 -17
  147. package/dist/es/react/src/embed/embedConfig.d.ts.map +0 -1
  148. package/dist/es/react/src/embed/events.spec.d.ts +0 -2
  149. package/dist/es/react/src/embed/events.spec.d.ts.map +0 -1
  150. package/dist/es/react/src/embed/liveboard.d.ts +0 -379
  151. package/dist/es/react/src/embed/liveboard.d.ts.map +0 -1
  152. package/dist/es/react/src/embed/liveboard.spec.d.ts +0 -2
  153. package/dist/es/react/src/embed/liveboard.spec.d.ts.map +0 -1
  154. package/dist/es/react/src/embed/pinboard.spec.d.ts +0 -2
  155. package/dist/es/react/src/embed/pinboard.spec.d.ts.map +0 -1
  156. package/dist/es/react/src/embed/sage.d.ts +0 -148
  157. package/dist/es/react/src/embed/sage.d.ts.map +0 -1
  158. package/dist/es/react/src/embed/sage.spec.d.ts +0 -2
  159. package/dist/es/react/src/embed/sage.spec.d.ts.map +0 -1
  160. package/dist/es/react/src/embed/search-bar.d.ts +0 -93
  161. package/dist/es/react/src/embed/search-bar.d.ts.map +0 -1
  162. package/dist/es/react/src/embed/search.d.ts +0 -282
  163. package/dist/es/react/src/embed/search.d.ts.map +0 -1
  164. package/dist/es/react/src/embed/search.spec.d.ts +0 -2
  165. package/dist/es/react/src/embed/search.spec.d.ts.map +0 -1
  166. package/dist/es/react/src/embed/ts-embed-trigger.spec.d.ts +0 -2
  167. package/dist/es/react/src/embed/ts-embed-trigger.spec.d.ts.map +0 -1
  168. package/dist/es/react/src/embed/ts-embed.d.ts +0 -374
  169. package/dist/es/react/src/embed/ts-embed.d.ts.map +0 -1
  170. package/dist/es/react/src/embed/ts-embed.spec.d.ts +0 -2
  171. package/dist/es/react/src/embed/ts-embed.spec.d.ts.map +0 -1
  172. package/dist/es/react/src/errors.d.ts +0 -19
  173. package/dist/es/react/src/errors.d.ts.map +0 -1
  174. package/dist/es/react/src/index.d.ts +0 -29
  175. package/dist/es/react/src/index.d.ts.map +0 -1
  176. package/dist/es/react/src/mixpanel-service.d.ts +0 -35
  177. package/dist/es/react/src/mixpanel-service.d.ts.map +0 -1
  178. package/dist/es/react/src/mixpanel-service.spec.d.ts +0 -2
  179. package/dist/es/react/src/mixpanel-service.spec.d.ts.map +0 -1
  180. package/dist/es/react/src/react/all-types-export.d.ts +0 -3
  181. package/dist/es/react/src/react/all-types-export.d.ts.map +0 -1
  182. package/dist/es/react/src/react/all-types-export.spec.d.ts +0 -2
  183. package/dist/es/react/src/react/all-types-export.spec.d.ts.map +0 -1
  184. package/dist/es/react/src/react/index.d.ts +0 -254
  185. package/dist/es/react/src/react/index.d.ts.map +0 -1
  186. package/dist/es/react/src/react/index.spec.d.ts +0 -3
  187. package/dist/es/react/src/react/index.spec.d.ts.map +0 -1
  188. package/dist/es/react/src/react/util.d.ts +0 -19
  189. package/dist/es/react/src/react/util.d.ts.map +0 -1
  190. package/dist/es/react/src/test/test-utils.d.ts +0 -61
  191. package/dist/es/react/src/test/test-utils.d.ts.map +0 -1
  192. package/dist/es/react/src/tokenizedFetch.d.ts +0 -18
  193. package/dist/es/react/src/tokenizedFetch.d.ts.map +0 -1
  194. package/dist/es/react/src/types.d.ts +0 -4363
  195. package/dist/es/react/src/types.d.ts.map +0 -1
  196. package/dist/es/react/src/utils/authService/authService.d.ts +0 -45
  197. package/dist/es/react/src/utils/authService/authService.d.ts.map +0 -1
  198. package/dist/es/react/src/utils/authService/authService.spec.d.ts +0 -2
  199. package/dist/es/react/src/utils/authService/authService.spec.d.ts.map +0 -1
  200. package/dist/es/react/src/utils/authService/index.d.ts +0 -3
  201. package/dist/es/react/src/utils/authService/index.d.ts.map +0 -1
  202. package/dist/es/react/src/utils/authService/tokenizedAuthService.d.ts +0 -22
  203. package/dist/es/react/src/utils/authService/tokenizedAuthService.d.ts.map +0 -1
  204. package/dist/es/react/src/utils/authService/tokenizedAuthService.spec.d.ts +0 -2
  205. package/dist/es/react/src/utils/authService/tokenizedAuthService.spec.d.ts.map +0 -1
  206. package/dist/es/react/src/utils/global-styles.d.ts +0 -2
  207. package/dist/es/react/src/utils/global-styles.d.ts.map +0 -1
  208. package/dist/es/react/src/utils/global-styles.spec.d.ts +0 -2
  209. package/dist/es/react/src/utils/global-styles.spec.d.ts.map +0 -1
  210. package/dist/es/react/src/utils/graphql/answerService/answer-queries.d.ts +0 -10
  211. package/dist/es/react/src/utils/graphql/answerService/answer-queries.d.ts.map +0 -1
  212. package/dist/es/react/src/utils/graphql/answerService/answerService.d.ts +0 -180
  213. package/dist/es/react/src/utils/graphql/answerService/answerService.d.ts.map +0 -1
  214. package/dist/es/react/src/utils/graphql/answerService/answerService.spec.d.ts +0 -2
  215. package/dist/es/react/src/utils/graphql/answerService/answerService.spec.d.ts.map +0 -1
  216. package/dist/es/react/src/utils/graphql/graphql-request.d.ts +0 -15
  217. package/dist/es/react/src/utils/graphql/graphql-request.d.ts.map +0 -1
  218. package/dist/es/react/src/utils/graphql/graphql-request.spec.d.ts +0 -2
  219. package/dist/es/react/src/utils/graphql/graphql-request.spec.d.ts.map +0 -1
  220. package/dist/es/react/src/utils/graphql/nlsService/conversation-queries.d.ts +0 -3
  221. package/dist/es/react/src/utils/graphql/nlsService/conversation-queries.d.ts.map +0 -1
  222. package/dist/es/react/src/utils/graphql/nlsService/conversation-service.d.ts +0 -12
  223. package/dist/es/react/src/utils/graphql/nlsService/conversation-service.d.ts.map +0 -1
  224. package/dist/es/react/src/utils/graphql/nlsService/nls-answer-queries.d.ts +0 -2
  225. package/dist/es/react/src/utils/graphql/nlsService/nls-answer-queries.d.ts.map +0 -1
  226. package/dist/es/react/src/utils/graphql/nlsService/nls-answer-service.d.ts +0 -17
  227. package/dist/es/react/src/utils/graphql/nlsService/nls-answer-service.d.ts.map +0 -1
  228. package/dist/es/react/src/utils/graphql/nlsService/nls-answer-service.spec.d.ts +0 -2
  229. package/dist/es/react/src/utils/graphql/nlsService/nls-answer-service.spec.d.ts.map +0 -1
  230. package/dist/es/react/src/utils/graphql/preview-service.d.ts +0 -9
  231. package/dist/es/react/src/utils/graphql/preview-service.d.ts.map +0 -1
  232. package/dist/es/react/src/utils/graphql/preview-service.spec.d.ts +0 -2
  233. package/dist/es/react/src/utils/graphql/preview-service.spec.d.ts.map +0 -1
  234. package/dist/es/react/src/utils/graphql/sourceService.d.ts +0 -8
  235. package/dist/es/react/src/utils/graphql/sourceService.d.ts.map +0 -1
  236. package/dist/es/react/src/utils/graphql/sourceService.spec.d.ts +0 -2
  237. package/dist/es/react/src/utils/graphql/sourceService.spec.d.ts.map +0 -1
  238. package/dist/es/react/src/utils/liveboardService/liveboardService.d.ts +0 -16
  239. package/dist/es/react/src/utils/liveboardService/liveboardService.d.ts.map +0 -1
  240. package/dist/es/react/src/utils/liveboardService/liveboardService.spec.d.ts +0 -2
  241. package/dist/es/react/src/utils/liveboardService/liveboardService.spec.d.ts.map +0 -1
  242. package/dist/es/react/src/utils/logger.d.ts +0 -18
  243. package/dist/es/react/src/utils/logger.d.ts.map +0 -1
  244. package/dist/es/react/src/utils/logger.spec.d.ts +0 -25
  245. package/dist/es/react/src/utils/logger.spec.d.ts.map +0 -1
  246. package/dist/es/react/src/utils/processData.d.ts +0 -22
  247. package/dist/es/react/src/utils/processData.d.ts.map +0 -1
  248. package/dist/es/react/src/utils/processData.spec.d.ts +0 -2
  249. package/dist/es/react/src/utils/processData.spec.d.ts.map +0 -1
  250. package/dist/es/react/src/utils/processTrigger.d.ts +0 -16
  251. package/dist/es/react/src/utils/processTrigger.d.ts.map +0 -1
  252. package/dist/es/react/src/utils/processTrigger.spec.d.ts +0 -2
  253. package/dist/es/react/src/utils/processTrigger.spec.d.ts.map +0 -1
  254. package/dist/es/react/src/utils/reporting.d.ts +0 -16
  255. package/dist/es/react/src/utils/reporting.d.ts.map +0 -1
  256. package/dist/es/react/src/utils/reporting.spec.d.ts +0 -2
  257. package/dist/es/react/src/utils/reporting.spec.d.ts.map +0 -1
  258. package/dist/es/react/src/utils/sessionInfoService.d.ts +0 -66
  259. package/dist/es/react/src/utils/sessionInfoService.d.ts.map +0 -1
  260. package/dist/es/react/src/utils.d.ts +0 -104
  261. package/dist/es/react/src/utils.d.ts.map +0 -1
  262. package/dist/es/react/src/utils.spec.d.ts +0 -2
  263. package/dist/es/react/src/utils.spec.d.ts.map +0 -1
  264. package/dist/es/src/auth.d.ts +0 -171
  265. package/dist/es/src/auth.d.ts.map +0 -1
  266. package/dist/es/src/auth.spec.d.ts +0 -15
  267. package/dist/es/src/auth.spec.d.ts.map +0 -1
  268. package/dist/es/src/authToken.d.ts +0 -17
  269. package/dist/es/src/authToken.d.ts.map +0 -1
  270. package/dist/es/src/authToken.spec.d.ts +0 -2
  271. package/dist/es/src/authToken.spec.d.ts.map +0 -1
  272. package/dist/es/src/config.d.ts +0 -21
  273. package/dist/es/src/config.d.ts.map +0 -1
  274. package/dist/es/src/config.spec.d.ts +0 -5
  275. package/dist/es/src/config.spec.d.ts.map +0 -1
  276. package/dist/es/src/css-variables.d.ts +0 -384
  277. package/dist/es/src/css-variables.d.ts.map +0 -1
  278. package/dist/es/src/embed/app.d.ts +0 -478
  279. package/dist/es/src/embed/app.d.ts.map +0 -1
  280. package/dist/es/src/embed/app.spec.d.ts +0 -2
  281. package/dist/es/src/embed/app.spec.d.ts.map +0 -1
  282. package/dist/es/src/embed/base.d.ts +0 -136
  283. package/dist/es/src/embed/base.d.ts.map +0 -1
  284. package/dist/es/src/embed/base.spec.d.ts +0 -2
  285. package/dist/es/src/embed/base.spec.d.ts.map +0 -1
  286. package/dist/es/src/embed/bodyless-conversation.d.ts +0 -26
  287. package/dist/es/src/embed/bodyless-conversation.d.ts.map +0 -1
  288. package/dist/es/src/embed/bodyless-conversation.spec.d.ts +0 -2
  289. package/dist/es/src/embed/bodyless-conversation.spec.d.ts.map +0 -1
  290. package/dist/es/src/embed/conversation.d.ts +0 -43
  291. package/dist/es/src/embed/conversation.d.ts.map +0 -1
  292. package/dist/es/src/embed/conversation.spec.d.ts +0 -2
  293. package/dist/es/src/embed/conversation.spec.d.ts.map +0 -1
  294. package/dist/es/src/embed/embed.spec.d.ts +0 -2
  295. package/dist/es/src/embed/embed.spec.d.ts.map +0 -1
  296. package/dist/es/src/embed/embedConfig.d.ts +0 -17
  297. package/dist/es/src/embed/embedConfig.d.ts.map +0 -1
  298. package/dist/es/src/embed/events.spec.d.ts +0 -2
  299. package/dist/es/src/embed/events.spec.d.ts.map +0 -1
  300. package/dist/es/src/embed/liveboard.d.ts +0 -379
  301. package/dist/es/src/embed/liveboard.d.ts.map +0 -1
  302. package/dist/es/src/embed/liveboard.spec.d.ts +0 -2
  303. package/dist/es/src/embed/liveboard.spec.d.ts.map +0 -1
  304. package/dist/es/src/embed/pinboard.spec.d.ts +0 -2
  305. package/dist/es/src/embed/pinboard.spec.d.ts.map +0 -1
  306. package/dist/es/src/embed/sage.d.ts +0 -148
  307. package/dist/es/src/embed/sage.d.ts.map +0 -1
  308. package/dist/es/src/embed/sage.spec.d.ts +0 -2
  309. package/dist/es/src/embed/sage.spec.d.ts.map +0 -1
  310. package/dist/es/src/embed/search-bar.d.ts +0 -93
  311. package/dist/es/src/embed/search-bar.d.ts.map +0 -1
  312. package/dist/es/src/embed/search.d.ts +0 -282
  313. package/dist/es/src/embed/search.d.ts.map +0 -1
  314. package/dist/es/src/embed/search.spec.d.ts +0 -2
  315. package/dist/es/src/embed/search.spec.d.ts.map +0 -1
  316. package/dist/es/src/embed/ts-embed-trigger.spec.d.ts +0 -2
  317. package/dist/es/src/embed/ts-embed-trigger.spec.d.ts.map +0 -1
  318. package/dist/es/src/embed/ts-embed.d.ts +0 -374
  319. package/dist/es/src/embed/ts-embed.d.ts.map +0 -1
  320. package/dist/es/src/embed/ts-embed.spec.d.ts +0 -2
  321. package/dist/es/src/embed/ts-embed.spec.d.ts.map +0 -1
  322. package/dist/es/src/errors.d.ts +0 -19
  323. package/dist/es/src/errors.d.ts.map +0 -1
  324. package/dist/es/src/index.d.ts +0 -29
  325. package/dist/es/src/index.d.ts.map +0 -1
  326. package/dist/es/src/mixpanel-service.d.ts +0 -35
  327. package/dist/es/src/mixpanel-service.d.ts.map +0 -1
  328. package/dist/es/src/mixpanel-service.spec.d.ts +0 -2
  329. package/dist/es/src/mixpanel-service.spec.d.ts.map +0 -1
  330. package/dist/es/src/react/all-types-export.d.ts +0 -3
  331. package/dist/es/src/react/all-types-export.d.ts.map +0 -1
  332. package/dist/es/src/react/all-types-export.spec.d.ts +0 -2
  333. package/dist/es/src/react/all-types-export.spec.d.ts.map +0 -1
  334. package/dist/es/src/react/index.d.ts +0 -254
  335. package/dist/es/src/react/index.d.ts.map +0 -1
  336. package/dist/es/src/react/index.spec.d.ts +0 -3
  337. package/dist/es/src/react/index.spec.d.ts.map +0 -1
  338. package/dist/es/src/react/util.d.ts +0 -19
  339. package/dist/es/src/react/util.d.ts.map +0 -1
  340. package/dist/es/src/test/test-utils.d.ts +0 -61
  341. package/dist/es/src/test/test-utils.d.ts.map +0 -1
  342. package/dist/es/src/tokenizedFetch.d.ts +0 -18
  343. package/dist/es/src/tokenizedFetch.d.ts.map +0 -1
  344. package/dist/es/src/types.d.ts +0 -4363
  345. package/dist/es/src/types.d.ts.map +0 -1
  346. package/dist/es/src/utils/authService/authService.d.ts +0 -45
  347. package/dist/es/src/utils/authService/authService.d.ts.map +0 -1
  348. package/dist/es/src/utils/authService/authService.spec.d.ts +0 -2
  349. package/dist/es/src/utils/authService/authService.spec.d.ts.map +0 -1
  350. package/dist/es/src/utils/authService/index.d.ts +0 -3
  351. package/dist/es/src/utils/authService/index.d.ts.map +0 -1
  352. package/dist/es/src/utils/authService/tokenizedAuthService.d.ts +0 -22
  353. package/dist/es/src/utils/authService/tokenizedAuthService.d.ts.map +0 -1
  354. package/dist/es/src/utils/authService/tokenizedAuthService.spec.d.ts +0 -2
  355. package/dist/es/src/utils/authService/tokenizedAuthService.spec.d.ts.map +0 -1
  356. package/dist/es/src/utils/global-styles.d.ts +0 -2
  357. package/dist/es/src/utils/global-styles.d.ts.map +0 -1
  358. package/dist/es/src/utils/global-styles.spec.d.ts +0 -2
  359. package/dist/es/src/utils/global-styles.spec.d.ts.map +0 -1
  360. package/dist/es/src/utils/graphql/answerService/answer-queries.d.ts +0 -10
  361. package/dist/es/src/utils/graphql/answerService/answer-queries.d.ts.map +0 -1
  362. package/dist/es/src/utils/graphql/answerService/answerService.d.ts +0 -180
  363. package/dist/es/src/utils/graphql/answerService/answerService.d.ts.map +0 -1
  364. package/dist/es/src/utils/graphql/answerService/answerService.spec.d.ts +0 -2
  365. package/dist/es/src/utils/graphql/answerService/answerService.spec.d.ts.map +0 -1
  366. package/dist/es/src/utils/graphql/graphql-request.d.ts +0 -15
  367. package/dist/es/src/utils/graphql/graphql-request.d.ts.map +0 -1
  368. package/dist/es/src/utils/graphql/graphql-request.spec.d.ts +0 -2
  369. package/dist/es/src/utils/graphql/graphql-request.spec.d.ts.map +0 -1
  370. package/dist/es/src/utils/graphql/nlsService/conversation-queries.d.ts +0 -3
  371. package/dist/es/src/utils/graphql/nlsService/conversation-queries.d.ts.map +0 -1
  372. package/dist/es/src/utils/graphql/nlsService/conversation-service.d.ts +0 -12
  373. package/dist/es/src/utils/graphql/nlsService/conversation-service.d.ts.map +0 -1
  374. package/dist/es/src/utils/graphql/nlsService/nls-answer-queries.d.ts +0 -2
  375. package/dist/es/src/utils/graphql/nlsService/nls-answer-queries.d.ts.map +0 -1
  376. package/dist/es/src/utils/graphql/nlsService/nls-answer-service.d.ts +0 -17
  377. package/dist/es/src/utils/graphql/nlsService/nls-answer-service.d.ts.map +0 -1
  378. package/dist/es/src/utils/graphql/nlsService/nls-answer-service.spec.d.ts +0 -2
  379. package/dist/es/src/utils/graphql/nlsService/nls-answer-service.spec.d.ts.map +0 -1
  380. package/dist/es/src/utils/graphql/preview-service.d.ts +0 -9
  381. package/dist/es/src/utils/graphql/preview-service.d.ts.map +0 -1
  382. package/dist/es/src/utils/graphql/preview-service.spec.d.ts +0 -2
  383. package/dist/es/src/utils/graphql/preview-service.spec.d.ts.map +0 -1
  384. package/dist/es/src/utils/graphql/sourceService.d.ts +0 -8
  385. package/dist/es/src/utils/graphql/sourceService.d.ts.map +0 -1
  386. package/dist/es/src/utils/graphql/sourceService.spec.d.ts +0 -2
  387. package/dist/es/src/utils/graphql/sourceService.spec.d.ts.map +0 -1
  388. package/dist/es/src/utils/liveboardService/liveboardService.d.ts +0 -16
  389. package/dist/es/src/utils/liveboardService/liveboardService.d.ts.map +0 -1
  390. package/dist/es/src/utils/liveboardService/liveboardService.spec.d.ts +0 -2
  391. package/dist/es/src/utils/liveboardService/liveboardService.spec.d.ts.map +0 -1
  392. package/dist/es/src/utils/logger.d.ts +0 -18
  393. package/dist/es/src/utils/logger.d.ts.map +0 -1
  394. package/dist/es/src/utils/logger.spec.d.ts +0 -25
  395. package/dist/es/src/utils/logger.spec.d.ts.map +0 -1
  396. package/dist/es/src/utils/processData.d.ts +0 -22
  397. package/dist/es/src/utils/processData.d.ts.map +0 -1
  398. package/dist/es/src/utils/processData.spec.d.ts +0 -2
  399. package/dist/es/src/utils/processData.spec.d.ts.map +0 -1
  400. package/dist/es/src/utils/processTrigger.d.ts +0 -16
  401. package/dist/es/src/utils/processTrigger.d.ts.map +0 -1
  402. package/dist/es/src/utils/processTrigger.spec.d.ts +0 -2
  403. package/dist/es/src/utils/processTrigger.spec.d.ts.map +0 -1
  404. package/dist/es/src/utils/reporting.d.ts +0 -16
  405. package/dist/es/src/utils/reporting.d.ts.map +0 -1
  406. package/dist/es/src/utils/reporting.spec.d.ts +0 -2
  407. package/dist/es/src/utils/reporting.spec.d.ts.map +0 -1
  408. package/dist/es/src/utils/sessionInfoService.d.ts +0 -66
  409. package/dist/es/src/utils/sessionInfoService.d.ts.map +0 -1
  410. package/dist/es/src/utils.d.ts +0 -104
  411. package/dist/es/src/utils.d.ts.map +0 -1
  412. package/dist/es/src/utils.spec.d.ts +0 -2
  413. package/dist/es/src/utils.spec.d.ts.map +0 -1
package/dist/tsembed.js CHANGED
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.40.1-alpha.3 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.40.2 */
2
2
  'use client';
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
@@ -379,6 +379,15 @@
379
379
  * @returns The stored value or `undefined` if the key is not found.
380
380
  */
381
381
  const getValueFromWindow = (key) => { var _a; return (_a = window === null || window === void 0 ? void 0 : window[sdkWindowKey]) === null || _a === void 0 ? void 0 : _a[key]; };
382
+ /**
383
+ * Check if an array includes a string value
384
+ * @param arr - The array to check
385
+ * @param key - The string to search for
386
+ * @returns boolean indicating if the string is found in the array
387
+ */
388
+ const arrayIncludesString = (arr, key) => {
389
+ return arr.some(item => typeof item === 'string' && item === key);
390
+ };
382
391
  /**
383
392
  * Check if the document is currently in fullscreen mode
384
393
  */
@@ -474,7 +483,6 @@
474
483
  * the embedded app
475
484
  * @group Authentication / Init
476
485
  */
477
- // eslint-disable-next-line no-shadow
478
486
  exports.AuthType = void 0;
479
487
  (function (AuthType) {
480
488
  /**
@@ -688,7 +696,6 @@
688
696
  /**
689
697
  * A map of the supported runtime filter operations
690
698
  */
691
- // eslint-disable-next-line no-shadow
692
699
  exports.RuntimeFilterOp = void 0;
693
700
  (function (RuntimeFilterOp) {
694
701
  /**
@@ -759,7 +766,6 @@
759
766
  * `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl).
760
767
  * @version SDK: 1.28.0 | ThoughtSpot: 9.12.5.cl, 10.1.0.sw
761
768
  */
762
- // eslint-disable-next-line no-shadow
763
769
  exports.HomepageModule = void 0;
764
770
  (function (HomepageModule) {
765
771
  /**
@@ -792,7 +798,6 @@
792
798
  * **Note**: This option is applicable to full app embedding only.
793
799
  * @version SDK: 1.38.0 | ThoughtSpot: 10.9.0.cl
794
800
  */
795
- // eslint-disable-next-line no-shadow
796
801
  exports.ListPageColumns = void 0;
797
802
  (function (ListPageColumns) {
798
803
  /**
@@ -855,7 +860,6 @@
855
860
  * ```
856
861
  * @group Events
857
862
  */
858
- // eslint-disable-next-line no-shadow
859
863
  exports.EmbedEvent = void 0;
860
864
  (function (EmbedEvent) {
861
865
  /**
@@ -2035,7 +2039,6 @@
2035
2039
  * ```
2036
2040
  * @group Events
2037
2041
  */
2038
- // eslint-disable-next-line no-shadow
2039
2042
  exports.HostEvent = void 0;
2040
2043
  (function (HostEvent) {
2041
2044
  /**
@@ -3250,7 +3253,6 @@
3250
3253
  * The different visual modes that the data sources panel within
3251
3254
  * search could appear in, such as hidden, collapsed, or expanded.
3252
3255
  */
3253
- // eslint-disable-next-line no-shadow
3254
3256
  exports.DataSourceVisualMode = void 0;
3255
3257
  (function (DataSourceVisualMode) {
3256
3258
  /**
@@ -3270,7 +3272,6 @@
3270
3272
  * The query params passed down to the embedded ThoughtSpot app
3271
3273
  * containing configuration and/or visual information.
3272
3274
  */
3273
- // eslint-disable-next-line no-shadow
3274
3275
  var Param;
3275
3276
  (function (Param) {
3276
3277
  Param["EmbedApp"] = "embedApp";
@@ -3421,7 +3422,6 @@
3421
3422
  * ```
3422
3423
  * See also link:https://developers.thoughtspot.com/docs/actions[Action IDs in the SDK]
3423
3424
  */
3424
- // eslint-disable-next-line no-shadow
3425
3425
  exports.Action = void 0;
3426
3426
  (function (Action) {
3427
3427
  /**
@@ -3966,7 +3966,7 @@
3966
3966
  * The Favorites icon (*) for Answers,
3967
3967
  * Liveboard, and data objects like Worksheet, Model,
3968
3968
  * Tables and Views.
3969
- * Allows adding an object to the users favorites list.
3969
+ * Allows adding an object to the user's favorites list.
3970
3970
  * @example
3971
3971
  * ```js
3972
3972
  * disabledActions: [Action.AddToFavorites]
@@ -4693,6 +4693,26 @@
4693
4693
  ContextMenuTriggerOptions["RIGHT_CLICK"] = "right-click";
4694
4694
  ContextMenuTriggerOptions["BOTH_CLICKS"] = "both-clicks";
4695
4695
  })(exports.ContextMenuTriggerOptions || (exports.ContextMenuTriggerOptions = {}));
4696
+ /**
4697
+ * Enum options to show custom actions at different
4698
+ * positions in the application.
4699
+ */
4700
+ exports.CustomActionsPosition = void 0;
4701
+ (function (CustomActionsPosition) {
4702
+ CustomActionsPosition["PRIMARY"] = "PRIMARY";
4703
+ CustomActionsPosition["MENU"] = "MENU";
4704
+ CustomActionsPosition["CONTEXTMENU"] = "CONTEXTMENU";
4705
+ })(exports.CustomActionsPosition || (exports.CustomActionsPosition = {}));
4706
+ /**
4707
+ * Enum options to mention the target of the custom action.
4708
+ */
4709
+ exports.CustomActionTarget = void 0;
4710
+ (function (CustomActionTarget) {
4711
+ CustomActionTarget["LIVEBOARD"] = "LIVEBOARD";
4712
+ CustomActionTarget["VIZ"] = "VIZ";
4713
+ CustomActionTarget["ANSWER"] = "ANSWER";
4714
+ CustomActionTarget["SPOTTER"] = "SPOTTER";
4715
+ })(exports.CustomActionTarget || (exports.CustomActionTarget = {}));
4696
4716
  /**
4697
4717
  * Enum options to show or suppress Visual Embed SDK and
4698
4718
  * ThoughtSpot application logs in the console output.
@@ -5849,8 +5869,8 @@
5849
5869
  var _cacheHas = cacheHas;
5850
5870
 
5851
5871
  /** Used to compose bitmasks for value comparisons. */
5852
- var COMPARE_PARTIAL_FLAG$3 = 1,
5853
- COMPARE_UNORDERED_FLAG$1 = 2;
5872
+ var COMPARE_PARTIAL_FLAG$5 = 1,
5873
+ COMPARE_UNORDERED_FLAG$3 = 2;
5854
5874
 
5855
5875
  /**
5856
5876
  * A specialized version of `baseIsEqualDeep` for arrays with support for
@@ -5866,7 +5886,7 @@
5866
5886
  * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
5867
5887
  */
5868
5888
  function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
5869
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3,
5889
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$5,
5870
5890
  arrLength = array.length,
5871
5891
  othLength = other.length;
5872
5892
 
@@ -5881,7 +5901,7 @@
5881
5901
  }
5882
5902
  var index = -1,
5883
5903
  result = true,
5884
- seen = (bitmask & COMPARE_UNORDERED_FLAG$1) ? new _SetCache : undefined;
5904
+ seen = (bitmask & COMPARE_UNORDERED_FLAG$3) ? new _SetCache : undefined;
5885
5905
 
5886
5906
  stack.set(array, other);
5887
5907
  stack.set(other, array);
@@ -5973,8 +5993,8 @@
5973
5993
  var _setToArray = setToArray;
5974
5994
 
5975
5995
  /** Used to compose bitmasks for value comparisons. */
5976
- var COMPARE_PARTIAL_FLAG$2 = 1,
5977
- COMPARE_UNORDERED_FLAG = 2;
5996
+ var COMPARE_PARTIAL_FLAG$4 = 1,
5997
+ COMPARE_UNORDERED_FLAG$2 = 2;
5978
5998
 
5979
5999
  /** `Object#toString` result references. */
5980
6000
  var boolTag$2 = '[object Boolean]',
@@ -5985,14 +6005,14 @@
5985
6005
  regexpTag$1 = '[object RegExp]',
5986
6006
  setTag$3 = '[object Set]',
5987
6007
  stringTag$1 = '[object String]',
5988
- symbolTag = '[object Symbol]';
6008
+ symbolTag$1 = '[object Symbol]';
5989
6009
 
5990
6010
  var arrayBufferTag$1 = '[object ArrayBuffer]',
5991
6011
  dataViewTag$2 = '[object DataView]';
5992
6012
 
5993
6013
  /** Used to convert symbols to primitives and strings. */
5994
- var symbolProto = _Symbol ? _Symbol.prototype : undefined,
5995
- symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
6014
+ var symbolProto$1 = _Symbol ? _Symbol.prototype : undefined,
6015
+ symbolValueOf = symbolProto$1 ? symbolProto$1.valueOf : undefined;
5996
6016
 
5997
6017
  /**
5998
6018
  * A specialized version of `baseIsEqualDeep` for comparing objects of
@@ -6049,7 +6069,7 @@
6049
6069
  var convert = _mapToArray;
6050
6070
 
6051
6071
  case setTag$3:
6052
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG$2;
6072
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$4;
6053
6073
  convert || (convert = _setToArray);
6054
6074
 
6055
6075
  if (object.size != other.size && !isPartial) {
@@ -6060,7 +6080,7 @@
6060
6080
  if (stacked) {
6061
6081
  return stacked == other;
6062
6082
  }
6063
- bitmask |= COMPARE_UNORDERED_FLAG;
6083
+ bitmask |= COMPARE_UNORDERED_FLAG$2;
6064
6084
 
6065
6085
  // Recursively compare objects (susceptible to call stack limits).
6066
6086
  stack.set(object, other);
@@ -6068,7 +6088,7 @@
6068
6088
  stack['delete'](object);
6069
6089
  return result;
6070
6090
 
6071
- case symbolTag:
6091
+ case symbolTag$1:
6072
6092
  if (symbolValueOf) {
6073
6093
  return symbolValueOf.call(object) == symbolValueOf.call(other);
6074
6094
  }
@@ -6759,7 +6779,7 @@
6759
6779
  var _getAllKeys = getAllKeys;
6760
6780
 
6761
6781
  /** Used to compose bitmasks for value comparisons. */
6762
- var COMPARE_PARTIAL_FLAG$1 = 1;
6782
+ var COMPARE_PARTIAL_FLAG$3 = 1;
6763
6783
 
6764
6784
  /** Used for built-in method references. */
6765
6785
  var objectProto$2 = Object.prototype;
@@ -6781,7 +6801,7 @@
6781
6801
  * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
6782
6802
  */
6783
6803
  function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
6784
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG$1,
6804
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3,
6785
6805
  objProps = _getAllKeys(object),
6786
6806
  objLength = objProps.length,
6787
6807
  othProps = _getAllKeys(other),
@@ -6919,7 +6939,7 @@
6919
6939
  var _getTag = getTag;
6920
6940
 
6921
6941
  /** Used to compose bitmasks for value comparisons. */
6922
- var COMPARE_PARTIAL_FLAG = 1;
6942
+ var COMPARE_PARTIAL_FLAG$2 = 1;
6923
6943
 
6924
6944
  /** `Object#toString` result references. */
6925
6945
  var argsTag = '[object Arguments]',
@@ -6972,7 +6992,7 @@
6972
6992
  ? _equalArrays(object, other, bitmask, customizer, equalFunc, stack)
6973
6993
  : _equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
6974
6994
  }
6975
- if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
6995
+ if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
6976
6996
  var objIsWrapped = objIsObj && hasOwnProperty$2.call(object, '__wrapped__'),
6977
6997
  othIsWrapped = othIsObj && hasOwnProperty$2.call(other, '__wrapped__');
6978
6998
 
@@ -7142,6 +7162,17 @@
7142
7162
  MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
7143
7163
  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',
7144
7164
  SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
7165
+ };
7166
+ const CUSTOM_ACTIONS_ERROR_MESSAGE = {
7167
+ INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
7168
+ MISSING_REQUIRED_FIELDS: (id, missingFields) => `Custom Action Validation Error for '${id}': Missing required fields: ${missingFields.join(', ')}`,
7169
+ UNSUPPORTED_TARGET: (id, targetType) => `Custom Action Validation Error for '${id}': Target type '${targetType}' is not supported`,
7170
+ INVALID_POSITION: (position, targetType, supportedPositions) => `Position '${position}' is not supported for ${targetType.toLowerCase()}-level custom actions. Supported positions: ${supportedPositions}`,
7171
+ MULTIPLE_PRIMARY_ACTIONS: (targetType, existingName, newName) => `Multiple primary actions found for ${targetType.toLowerCase()}-level custom actions: '${existingName}' and '${newName}'. Only the first action will be shown.`,
7172
+ INVALID_METADATA_IDS: (targetType, invalidIds, supportedIds) => `Invalid metadata IDs for ${targetType.toLowerCase()}-level custom actions: ${invalidIds.join(', ')}. Supported metadata IDs: ${supportedIds}`,
7173
+ INVALID_DATA_MODEL_IDS: (targetType, invalidIds, supportedIds) => `Invalid data model IDs for ${targetType.toLowerCase()}-level custom actions: ${invalidIds.join(', ')}. Supported data model IDs: ${supportedIds}`,
7174
+ INVALID_FIELDS: (targetType, invalidFields, supportedFields) => `Invalid fields for ${targetType.toLowerCase()}-level custom actions: ${invalidFields.join(', ')}. Supported fields: ${supportedFields}`,
7175
+ DUPLICATE_IDS: (id, duplicateNames, keptName) => `Duplicate custom action ID '${id}' found. Actions with names '${duplicateNames.join("', '")}' will be ignored. Keeping '${keptName}'.`,
7145
7176
  };
7146
7177
 
7147
7178
  const EndPoints = {
@@ -7990,145 +8021,1587 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
7990
8021
  if (columnsToAdd.length) {
7991
8022
  await unaggAnswerSession.addColumns(columnsToAdd);
7992
8023
  }
7993
- const columnsToRemove = [...currentColumns].filter((col) => !ouputColumnGuids.has(col));
7994
- if (columnsToRemove.length) {
7995
- await unaggAnswerSession.removeColumns(columnsToRemove);
8024
+ const columnsToRemove = [...currentColumns].filter((col) => !ouputColumnGuids.has(col));
8025
+ if (columnsToRemove.length) {
8026
+ await unaggAnswerSession.removeColumns(columnsToRemove);
8027
+ }
8028
+ return unaggAnswerSession;
8029
+ }
8030
+ /**
8031
+ * Execute a custom graphql query in the context of the answer.
8032
+ * @param query graphql query
8033
+ * @param variables graphql variables
8034
+ * @returns
8035
+ */
8036
+ async executeQuery(query, variables) {
8037
+ const data = await graphqlQuery({
8038
+ query,
8039
+ variables: {
8040
+ session: this.session,
8041
+ ...variables,
8042
+ },
8043
+ thoughtSpotHost: this.thoughtSpotHost,
8044
+ isCompositeQuery: false,
8045
+ });
8046
+ this.session = deepMerge(this.session, (data === null || data === void 0 ? void 0 : data.id) || {});
8047
+ return data;
8048
+ }
8049
+ /**
8050
+ * Get the internal session details for the answer.
8051
+ * @returns
8052
+ */
8053
+ getSession() {
8054
+ return this.session;
8055
+ }
8056
+ async getAnswer() {
8057
+ if (this.answer) {
8058
+ return this.answer;
8059
+ }
8060
+ this.answer = this.executeQuery(getAnswer, {}).then((data) => data === null || data === void 0 ? void 0 : data.answer);
8061
+ return this.answer;
8062
+ }
8063
+ async getTML() {
8064
+ const { object } = await this.executeQuery(getAnswerTML, {});
8065
+ const edoc = object[0].edoc;
8066
+ const YAML = await Promise.resolve().then(function () { return index; });
8067
+ const parsedDoc = YAML.parse(edoc);
8068
+ return {
8069
+ answer: {
8070
+ ...parsedDoc.answer,
8071
+ ...this.tmlOverride,
8072
+ },
8073
+ };
8074
+ }
8075
+ async addDisplayedVizToLiveboard(liveboardId) {
8076
+ const { displayMode, visualizations } = await this.getAnswer();
8077
+ const viz = getDisplayedViz(visualizations, displayMode);
8078
+ return this.executeQuery(addVizToLiveboard, {
8079
+ liveboardId,
8080
+ vizId: viz.id,
8081
+ });
8082
+ }
8083
+ setTMLOverride(override) {
8084
+ this.tmlOverride = override;
8085
+ }
8086
+ }
8087
+ /**
8088
+ *
8089
+ * @param sourceDetail
8090
+ * @param colNames
8091
+ */
8092
+ function getGuidsFromColumnNames(sourceDetail, colNames) {
8093
+ const cols = sourceDetail.columns.reduce((colSet, col) => {
8094
+ colSet[col.name.toLowerCase()] = col;
8095
+ return colSet;
8096
+ }, {});
8097
+ return new Set(colNames.map((colName) => {
8098
+ const col = cols[colName.toLowerCase()];
8099
+ return col.id;
8100
+ }));
8101
+ }
8102
+ /**
8103
+ *
8104
+ * @param selectedPoints
8105
+ */
8106
+ function getSelectedPointsForUnderlyingDataQuery(selectedPoints) {
8107
+ const underlyingDataPoint = [];
8108
+ /**
8109
+ *
8110
+ * @param colVal
8111
+ */
8112
+ function addPointFromColVal(colVal) {
8113
+ var _a;
8114
+ const dataType = colVal.column.dataType;
8115
+ colVal.column.id;
8116
+ let dataValue;
8117
+ if (dataType === 'DATE') {
8118
+ if (Number.isFinite(colVal.value)) {
8119
+ dataValue = [{
8120
+ epochRange: {
8121
+ startEpoch: colVal.value,
8122
+ },
8123
+ }];
8124
+ // Case for custom calendar.
8125
+ }
8126
+ else if ((_a = colVal.value) === null || _a === void 0 ? void 0 : _a.v) {
8127
+ dataValue = [{
8128
+ epochRange: {
8129
+ startEpoch: colVal.value.v.s,
8130
+ endEpoch: colVal.value.v.e,
8131
+ },
8132
+ }];
8133
+ }
8134
+ }
8135
+ else {
8136
+ dataValue = [{ value: colVal.value }];
8137
+ }
8138
+ underlyingDataPoint.push({
8139
+ columnId: colVal.column.id,
8140
+ dataValue,
8141
+ });
8142
+ }
8143
+ selectedPoints.forEach((p) => {
8144
+ p.selectedAttributes.forEach(addPointFromColVal);
8145
+ });
8146
+ return underlyingDataPoint;
8147
+ }
8148
+ /**
8149
+ *
8150
+ * @param visualizations
8151
+ * @param displayMode
8152
+ */
8153
+ function getDisplayedViz(visualizations, displayMode) {
8154
+ if (displayMode === 'CHART_MODE') {
8155
+ return visualizations.find(
8156
+ // eslint-disable-next-line no-underscore-dangle
8157
+ (viz) => viz.__typename === 'ChartViz');
8158
+ }
8159
+ return visualizations.find(
8160
+ // eslint-disable-next-line no-underscore-dangle
8161
+ (viz) => viz.__typename === 'TableViz');
8162
+ }
8163
+
8164
+ /** Built-in value references. */
8165
+ var spreadableSymbol = _Symbol ? _Symbol.isConcatSpreadable : undefined;
8166
+
8167
+ /**
8168
+ * Checks if `value` is a flattenable `arguments` object or array.
8169
+ *
8170
+ * @private
8171
+ * @param {*} value The value to check.
8172
+ * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
8173
+ */
8174
+ function isFlattenable(value) {
8175
+ return isArray_1(value) || isArguments_1(value) ||
8176
+ !!(spreadableSymbol && value && value[spreadableSymbol]);
8177
+ }
8178
+
8179
+ var _isFlattenable = isFlattenable;
8180
+
8181
+ /**
8182
+ * The base implementation of `_.flatten` with support for restricting flattening.
8183
+ *
8184
+ * @private
8185
+ * @param {Array} array The array to flatten.
8186
+ * @param {number} depth The maximum recursion depth.
8187
+ * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
8188
+ * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
8189
+ * @param {Array} [result=[]] The initial result value.
8190
+ * @returns {Array} Returns the new flattened array.
8191
+ */
8192
+ function baseFlatten(array, depth, predicate, isStrict, result) {
8193
+ var index = -1,
8194
+ length = array.length;
8195
+
8196
+ predicate || (predicate = _isFlattenable);
8197
+ result || (result = []);
8198
+
8199
+ while (++index < length) {
8200
+ var value = array[index];
8201
+ if (depth > 0 && predicate(value)) {
8202
+ if (depth > 1) {
8203
+ // Recursively flatten arrays (susceptible to call stack limits).
8204
+ baseFlatten(value, depth - 1, predicate, isStrict, result);
8205
+ } else {
8206
+ _arrayPush(result, value);
8207
+ }
8208
+ } else if (!isStrict) {
8209
+ result[result.length] = value;
8210
+ }
8211
+ }
8212
+ return result;
8213
+ }
8214
+
8215
+ var _baseFlatten = baseFlatten;
8216
+
8217
+ /**
8218
+ * A specialized version of `_.map` for arrays without support for iteratee
8219
+ * shorthands.
8220
+ *
8221
+ * @private
8222
+ * @param {Array} [array] The array to iterate over.
8223
+ * @param {Function} iteratee The function invoked per iteration.
8224
+ * @returns {Array} Returns the new mapped array.
8225
+ */
8226
+ function arrayMap(array, iteratee) {
8227
+ var index = -1,
8228
+ length = array == null ? 0 : array.length,
8229
+ result = Array(length);
8230
+
8231
+ while (++index < length) {
8232
+ result[index] = iteratee(array[index], index, array);
8233
+ }
8234
+ return result;
8235
+ }
8236
+
8237
+ var _arrayMap = arrayMap;
8238
+
8239
+ /** `Object#toString` result references. */
8240
+ var symbolTag = '[object Symbol]';
8241
+
8242
+ /**
8243
+ * Checks if `value` is classified as a `Symbol` primitive or object.
8244
+ *
8245
+ * @static
8246
+ * @memberOf _
8247
+ * @since 4.0.0
8248
+ * @category Lang
8249
+ * @param {*} value The value to check.
8250
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
8251
+ * @example
8252
+ *
8253
+ * _.isSymbol(Symbol.iterator);
8254
+ * // => true
8255
+ *
8256
+ * _.isSymbol('abc');
8257
+ * // => false
8258
+ */
8259
+ function isSymbol(value) {
8260
+ return typeof value == 'symbol' ||
8261
+ (isObjectLike_1(value) && _baseGetTag(value) == symbolTag);
8262
+ }
8263
+
8264
+ var isSymbol_1 = isSymbol;
8265
+
8266
+ /** Used to match property names within property paths. */
8267
+ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
8268
+ reIsPlainProp = /^\w*$/;
8269
+
8270
+ /**
8271
+ * Checks if `value` is a property name and not a property path.
8272
+ *
8273
+ * @private
8274
+ * @param {*} value The value to check.
8275
+ * @param {Object} [object] The object to query keys on.
8276
+ * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
8277
+ */
8278
+ function isKey(value, object) {
8279
+ if (isArray_1(value)) {
8280
+ return false;
8281
+ }
8282
+ var type = typeof value;
8283
+ if (type == 'number' || type == 'symbol' || type == 'boolean' ||
8284
+ value == null || isSymbol_1(value)) {
8285
+ return true;
8286
+ }
8287
+ return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
8288
+ (object != null && value in Object(object));
8289
+ }
8290
+
8291
+ var _isKey = isKey;
8292
+
8293
+ /** Error message constants. */
8294
+ var FUNC_ERROR_TEXT = 'Expected a function';
8295
+
8296
+ /**
8297
+ * Creates a function that memoizes the result of `func`. If `resolver` is
8298
+ * provided, it determines the cache key for storing the result based on the
8299
+ * arguments provided to the memoized function. By default, the first argument
8300
+ * provided to the memoized function is used as the map cache key. The `func`
8301
+ * is invoked with the `this` binding of the memoized function.
8302
+ *
8303
+ * **Note:** The cache is exposed as the `cache` property on the memoized
8304
+ * function. Its creation may be customized by replacing the `_.memoize.Cache`
8305
+ * constructor with one whose instances implement the
8306
+ * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
8307
+ * method interface of `clear`, `delete`, `get`, `has`, and `set`.
8308
+ *
8309
+ * @static
8310
+ * @memberOf _
8311
+ * @since 0.1.0
8312
+ * @category Function
8313
+ * @param {Function} func The function to have its output memoized.
8314
+ * @param {Function} [resolver] The function to resolve the cache key.
8315
+ * @returns {Function} Returns the new memoized function.
8316
+ * @example
8317
+ *
8318
+ * var object = { 'a': 1, 'b': 2 };
8319
+ * var other = { 'c': 3, 'd': 4 };
8320
+ *
8321
+ * var values = _.memoize(_.values);
8322
+ * values(object);
8323
+ * // => [1, 2]
8324
+ *
8325
+ * values(other);
8326
+ * // => [3, 4]
8327
+ *
8328
+ * object.a = 2;
8329
+ * values(object);
8330
+ * // => [1, 2]
8331
+ *
8332
+ * // Modify the result cache.
8333
+ * values.cache.set(object, ['a', 'b']);
8334
+ * values(object);
8335
+ * // => ['a', 'b']
8336
+ *
8337
+ * // Replace `_.memoize.Cache`.
8338
+ * _.memoize.Cache = WeakMap;
8339
+ */
8340
+ function memoize(func, resolver) {
8341
+ if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
8342
+ throw new TypeError(FUNC_ERROR_TEXT);
8343
+ }
8344
+ var memoized = function() {
8345
+ var args = arguments,
8346
+ key = resolver ? resolver.apply(this, args) : args[0],
8347
+ cache = memoized.cache;
8348
+
8349
+ if (cache.has(key)) {
8350
+ return cache.get(key);
8351
+ }
8352
+ var result = func.apply(this, args);
8353
+ memoized.cache = cache.set(key, result) || cache;
8354
+ return result;
8355
+ };
8356
+ memoized.cache = new (memoize.Cache || _MapCache);
8357
+ return memoized;
8358
+ }
8359
+
8360
+ // Expose `MapCache`.
8361
+ memoize.Cache = _MapCache;
8362
+
8363
+ var memoize_1 = memoize;
8364
+
8365
+ /** Used as the maximum memoize cache size. */
8366
+ var MAX_MEMOIZE_SIZE = 500;
8367
+
8368
+ /**
8369
+ * A specialized version of `_.memoize` which clears the memoized function's
8370
+ * cache when it exceeds `MAX_MEMOIZE_SIZE`.
8371
+ *
8372
+ * @private
8373
+ * @param {Function} func The function to have its output memoized.
8374
+ * @returns {Function} Returns the new memoized function.
8375
+ */
8376
+ function memoizeCapped(func) {
8377
+ var result = memoize_1(func, function(key) {
8378
+ if (cache.size === MAX_MEMOIZE_SIZE) {
8379
+ cache.clear();
8380
+ }
8381
+ return key;
8382
+ });
8383
+
8384
+ var cache = result.cache;
8385
+ return result;
8386
+ }
8387
+
8388
+ var _memoizeCapped = memoizeCapped;
8389
+
8390
+ /** Used to match property names within property paths. */
8391
+ var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
8392
+
8393
+ /** Used to match backslashes in property paths. */
8394
+ var reEscapeChar = /\\(\\)?/g;
8395
+
8396
+ /**
8397
+ * Converts `string` to a property path array.
8398
+ *
8399
+ * @private
8400
+ * @param {string} string The string to convert.
8401
+ * @returns {Array} Returns the property path array.
8402
+ */
8403
+ var stringToPath = _memoizeCapped(function(string) {
8404
+ var result = [];
8405
+ if (string.charCodeAt(0) === 46 /* . */) {
8406
+ result.push('');
8407
+ }
8408
+ string.replace(rePropName, function(match, number, quote, subString) {
8409
+ result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
8410
+ });
8411
+ return result;
8412
+ });
8413
+
8414
+ var _stringToPath = stringToPath;
8415
+
8416
+ /** Used as references for various `Number` constants. */
8417
+ var INFINITY$1 = 1 / 0;
8418
+
8419
+ /** Used to convert symbols to primitives and strings. */
8420
+ var symbolProto = _Symbol ? _Symbol.prototype : undefined,
8421
+ symbolToString = symbolProto ? symbolProto.toString : undefined;
8422
+
8423
+ /**
8424
+ * The base implementation of `_.toString` which doesn't convert nullish
8425
+ * values to empty strings.
8426
+ *
8427
+ * @private
8428
+ * @param {*} value The value to process.
8429
+ * @returns {string} Returns the string.
8430
+ */
8431
+ function baseToString(value) {
8432
+ // Exit early for strings to avoid a performance hit in some environments.
8433
+ if (typeof value == 'string') {
8434
+ return value;
8435
+ }
8436
+ if (isArray_1(value)) {
8437
+ // Recursively convert values (susceptible to call stack limits).
8438
+ return _arrayMap(value, baseToString) + '';
8439
+ }
8440
+ if (isSymbol_1(value)) {
8441
+ return symbolToString ? symbolToString.call(value) : '';
8442
+ }
8443
+ var result = (value + '');
8444
+ return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result;
8445
+ }
8446
+
8447
+ var _baseToString = baseToString;
8448
+
8449
+ /**
8450
+ * Converts `value` to a string. An empty string is returned for `null`
8451
+ * and `undefined` values. The sign of `-0` is preserved.
8452
+ *
8453
+ * @static
8454
+ * @memberOf _
8455
+ * @since 4.0.0
8456
+ * @category Lang
8457
+ * @param {*} value The value to convert.
8458
+ * @returns {string} Returns the converted string.
8459
+ * @example
8460
+ *
8461
+ * _.toString(null);
8462
+ * // => ''
8463
+ *
8464
+ * _.toString(-0);
8465
+ * // => '-0'
8466
+ *
8467
+ * _.toString([1, 2, 3]);
8468
+ * // => '1,2,3'
8469
+ */
8470
+ function toString$1(value) {
8471
+ return value == null ? '' : _baseToString(value);
8472
+ }
8473
+
8474
+ var toString_1 = toString$1;
8475
+
8476
+ /**
8477
+ * Casts `value` to a path array if it's not one.
8478
+ *
8479
+ * @private
8480
+ * @param {*} value The value to inspect.
8481
+ * @param {Object} [object] The object to query keys on.
8482
+ * @returns {Array} Returns the cast property path array.
8483
+ */
8484
+ function castPath(value, object) {
8485
+ if (isArray_1(value)) {
8486
+ return value;
8487
+ }
8488
+ return _isKey(value, object) ? [value] : _stringToPath(toString_1(value));
8489
+ }
8490
+
8491
+ var _castPath = castPath;
8492
+
8493
+ /** Used as references for various `Number` constants. */
8494
+ var INFINITY = 1 / 0;
8495
+
8496
+ /**
8497
+ * Converts `value` to a string key if it's not a string or symbol.
8498
+ *
8499
+ * @private
8500
+ * @param {*} value The value to inspect.
8501
+ * @returns {string|symbol} Returns the key.
8502
+ */
8503
+ function toKey(value) {
8504
+ if (typeof value == 'string' || isSymbol_1(value)) {
8505
+ return value;
8506
+ }
8507
+ var result = (value + '');
8508
+ return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
8509
+ }
8510
+
8511
+ var _toKey = toKey;
8512
+
8513
+ /**
8514
+ * The base implementation of `_.get` without support for default values.
8515
+ *
8516
+ * @private
8517
+ * @param {Object} object The object to query.
8518
+ * @param {Array|string} path The path of the property to get.
8519
+ * @returns {*} Returns the resolved value.
8520
+ */
8521
+ function baseGet(object, path) {
8522
+ path = _castPath(path, object);
8523
+
8524
+ var index = 0,
8525
+ length = path.length;
8526
+
8527
+ while (object != null && index < length) {
8528
+ object = object[_toKey(path[index++])];
8529
+ }
8530
+ return (index && index == length) ? object : undefined;
8531
+ }
8532
+
8533
+ var _baseGet = baseGet;
8534
+
8535
+ /** Used to compose bitmasks for value comparisons. */
8536
+ var COMPARE_PARTIAL_FLAG$1 = 1,
8537
+ COMPARE_UNORDERED_FLAG$1 = 2;
8538
+
8539
+ /**
8540
+ * The base implementation of `_.isMatch` without support for iteratee shorthands.
8541
+ *
8542
+ * @private
8543
+ * @param {Object} object The object to inspect.
8544
+ * @param {Object} source The object of property values to match.
8545
+ * @param {Array} matchData The property names, values, and compare flags to match.
8546
+ * @param {Function} [customizer] The function to customize comparisons.
8547
+ * @returns {boolean} Returns `true` if `object` is a match, else `false`.
8548
+ */
8549
+ function baseIsMatch(object, source, matchData, customizer) {
8550
+ var index = matchData.length,
8551
+ length = index,
8552
+ noCustomizer = !customizer;
8553
+
8554
+ if (object == null) {
8555
+ return !length;
8556
+ }
8557
+ object = Object(object);
8558
+ while (index--) {
8559
+ var data = matchData[index];
8560
+ if ((noCustomizer && data[2])
8561
+ ? data[1] !== object[data[0]]
8562
+ : !(data[0] in object)
8563
+ ) {
8564
+ return false;
8565
+ }
8566
+ }
8567
+ while (++index < length) {
8568
+ data = matchData[index];
8569
+ var key = data[0],
8570
+ objValue = object[key],
8571
+ srcValue = data[1];
8572
+
8573
+ if (noCustomizer && data[2]) {
8574
+ if (objValue === undefined && !(key in object)) {
8575
+ return false;
8576
+ }
8577
+ } else {
8578
+ var stack = new _Stack;
8579
+ if (customizer) {
8580
+ var result = customizer(objValue, srcValue, key, object, source, stack);
8581
+ }
8582
+ if (!(result === undefined
8583
+ ? _baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, customizer, stack)
8584
+ : result
8585
+ )) {
8586
+ return false;
8587
+ }
8588
+ }
8589
+ }
8590
+ return true;
8591
+ }
8592
+
8593
+ var _baseIsMatch = baseIsMatch;
8594
+
8595
+ /**
8596
+ * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
8597
+ *
8598
+ * @private
8599
+ * @param {*} value The value to check.
8600
+ * @returns {boolean} Returns `true` if `value` if suitable for strict
8601
+ * equality comparisons, else `false`.
8602
+ */
8603
+ function isStrictComparable(value) {
8604
+ return value === value && !isObject_1(value);
8605
+ }
8606
+
8607
+ var _isStrictComparable = isStrictComparable;
8608
+
8609
+ /**
8610
+ * Gets the property names, values, and compare flags of `object`.
8611
+ *
8612
+ * @private
8613
+ * @param {Object} object The object to query.
8614
+ * @returns {Array} Returns the match data of `object`.
8615
+ */
8616
+ function getMatchData(object) {
8617
+ var result = keys_1(object),
8618
+ length = result.length;
8619
+
8620
+ while (length--) {
8621
+ var key = result[length],
8622
+ value = object[key];
8623
+
8624
+ result[length] = [key, value, _isStrictComparable(value)];
8625
+ }
8626
+ return result;
8627
+ }
8628
+
8629
+ var _getMatchData = getMatchData;
8630
+
8631
+ /**
8632
+ * A specialized version of `matchesProperty` for source values suitable
8633
+ * for strict equality comparisons, i.e. `===`.
8634
+ *
8635
+ * @private
8636
+ * @param {string} key The key of the property to get.
8637
+ * @param {*} srcValue The value to match.
8638
+ * @returns {Function} Returns the new spec function.
8639
+ */
8640
+ function matchesStrictComparable(key, srcValue) {
8641
+ return function(object) {
8642
+ if (object == null) {
8643
+ return false;
8644
+ }
8645
+ return object[key] === srcValue &&
8646
+ (srcValue !== undefined || (key in Object(object)));
8647
+ };
8648
+ }
8649
+
8650
+ var _matchesStrictComparable = matchesStrictComparable;
8651
+
8652
+ /**
8653
+ * The base implementation of `_.matches` which doesn't clone `source`.
8654
+ *
8655
+ * @private
8656
+ * @param {Object} source The object of property values to match.
8657
+ * @returns {Function} Returns the new spec function.
8658
+ */
8659
+ function baseMatches(source) {
8660
+ var matchData = _getMatchData(source);
8661
+ if (matchData.length == 1 && matchData[0][2]) {
8662
+ return _matchesStrictComparable(matchData[0][0], matchData[0][1]);
8663
+ }
8664
+ return function(object) {
8665
+ return object === source || _baseIsMatch(object, source, matchData);
8666
+ };
8667
+ }
8668
+
8669
+ var _baseMatches = baseMatches;
8670
+
8671
+ /**
8672
+ * Gets the value at `path` of `object`. If the resolved value is
8673
+ * `undefined`, the `defaultValue` is returned in its place.
8674
+ *
8675
+ * @static
8676
+ * @memberOf _
8677
+ * @since 3.7.0
8678
+ * @category Object
8679
+ * @param {Object} object The object to query.
8680
+ * @param {Array|string} path The path of the property to get.
8681
+ * @param {*} [defaultValue] The value returned for `undefined` resolved values.
8682
+ * @returns {*} Returns the resolved value.
8683
+ * @example
8684
+ *
8685
+ * var object = { 'a': [{ 'b': { 'c': 3 } }] };
8686
+ *
8687
+ * _.get(object, 'a[0].b.c');
8688
+ * // => 3
8689
+ *
8690
+ * _.get(object, ['a', '0', 'b', 'c']);
8691
+ * // => 3
8692
+ *
8693
+ * _.get(object, 'a.b.c', 'default');
8694
+ * // => 'default'
8695
+ */
8696
+ function get(object, path, defaultValue) {
8697
+ var result = object == null ? undefined : _baseGet(object, path);
8698
+ return result === undefined ? defaultValue : result;
8699
+ }
8700
+
8701
+ var get_1 = get;
8702
+
8703
+ /**
8704
+ * The base implementation of `_.hasIn` without support for deep paths.
8705
+ *
8706
+ * @private
8707
+ * @param {Object} [object] The object to query.
8708
+ * @param {Array|string} key The key to check.
8709
+ * @returns {boolean} Returns `true` if `key` exists, else `false`.
8710
+ */
8711
+ function baseHasIn(object, key) {
8712
+ return object != null && key in Object(object);
8713
+ }
8714
+
8715
+ var _baseHasIn = baseHasIn;
8716
+
8717
+ /**
8718
+ * Checks if `path` exists on `object`.
8719
+ *
8720
+ * @private
8721
+ * @param {Object} object The object to query.
8722
+ * @param {Array|string} path The path to check.
8723
+ * @param {Function} hasFunc The function to check properties.
8724
+ * @returns {boolean} Returns `true` if `path` exists, else `false`.
8725
+ */
8726
+ function hasPath(object, path, hasFunc) {
8727
+ path = _castPath(path, object);
8728
+
8729
+ var index = -1,
8730
+ length = path.length,
8731
+ result = false;
8732
+
8733
+ while (++index < length) {
8734
+ var key = _toKey(path[index]);
8735
+ if (!(result = object != null && hasFunc(object, key))) {
8736
+ break;
8737
+ }
8738
+ object = object[key];
8739
+ }
8740
+ if (result || ++index != length) {
8741
+ return result;
8742
+ }
8743
+ length = object == null ? 0 : object.length;
8744
+ return !!length && isLength_1(length) && _isIndex(key, length) &&
8745
+ (isArray_1(object) || isArguments_1(object));
8746
+ }
8747
+
8748
+ var _hasPath = hasPath;
8749
+
8750
+ /**
8751
+ * Checks if `path` is a direct or inherited property of `object`.
8752
+ *
8753
+ * @static
8754
+ * @memberOf _
8755
+ * @since 4.0.0
8756
+ * @category Object
8757
+ * @param {Object} object The object to query.
8758
+ * @param {Array|string} path The path to check.
8759
+ * @returns {boolean} Returns `true` if `path` exists, else `false`.
8760
+ * @example
8761
+ *
8762
+ * var object = _.create({ 'a': _.create({ 'b': 2 }) });
8763
+ *
8764
+ * _.hasIn(object, 'a');
8765
+ * // => true
8766
+ *
8767
+ * _.hasIn(object, 'a.b');
8768
+ * // => true
8769
+ *
8770
+ * _.hasIn(object, ['a', 'b']);
8771
+ * // => true
8772
+ *
8773
+ * _.hasIn(object, 'b');
8774
+ * // => false
8775
+ */
8776
+ function hasIn(object, path) {
8777
+ return object != null && _hasPath(object, path, _baseHasIn);
8778
+ }
8779
+
8780
+ var hasIn_1 = hasIn;
8781
+
8782
+ /** Used to compose bitmasks for value comparisons. */
8783
+ var COMPARE_PARTIAL_FLAG = 1,
8784
+ COMPARE_UNORDERED_FLAG = 2;
8785
+
8786
+ /**
8787
+ * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
8788
+ *
8789
+ * @private
8790
+ * @param {string} path The path of the property to get.
8791
+ * @param {*} srcValue The value to match.
8792
+ * @returns {Function} Returns the new spec function.
8793
+ */
8794
+ function baseMatchesProperty(path, srcValue) {
8795
+ if (_isKey(path) && _isStrictComparable(srcValue)) {
8796
+ return _matchesStrictComparable(_toKey(path), srcValue);
8797
+ }
8798
+ return function(object) {
8799
+ var objValue = get_1(object, path);
8800
+ return (objValue === undefined && objValue === srcValue)
8801
+ ? hasIn_1(object, path)
8802
+ : _baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
8803
+ };
8804
+ }
8805
+
8806
+ var _baseMatchesProperty = baseMatchesProperty;
8807
+
8808
+ /**
8809
+ * This method returns the first argument it receives.
8810
+ *
8811
+ * @static
8812
+ * @since 0.1.0
8813
+ * @memberOf _
8814
+ * @category Util
8815
+ * @param {*} value Any value.
8816
+ * @returns {*} Returns `value`.
8817
+ * @example
8818
+ *
8819
+ * var object = { 'a': 1 };
8820
+ *
8821
+ * console.log(_.identity(object) === object);
8822
+ * // => true
8823
+ */
8824
+ function identity(value) {
8825
+ return value;
8826
+ }
8827
+
8828
+ var identity_1 = identity;
8829
+
8830
+ /**
8831
+ * The base implementation of `_.property` without support for deep paths.
8832
+ *
8833
+ * @private
8834
+ * @param {string} key The key of the property to get.
8835
+ * @returns {Function} Returns the new accessor function.
8836
+ */
8837
+ function baseProperty(key) {
8838
+ return function(object) {
8839
+ return object == null ? undefined : object[key];
8840
+ };
8841
+ }
8842
+
8843
+ var _baseProperty = baseProperty;
8844
+
8845
+ /**
8846
+ * A specialized version of `baseProperty` which supports deep paths.
8847
+ *
8848
+ * @private
8849
+ * @param {Array|string} path The path of the property to get.
8850
+ * @returns {Function} Returns the new accessor function.
8851
+ */
8852
+ function basePropertyDeep(path) {
8853
+ return function(object) {
8854
+ return _baseGet(object, path);
8855
+ };
8856
+ }
8857
+
8858
+ var _basePropertyDeep = basePropertyDeep;
8859
+
8860
+ /**
8861
+ * Creates a function that returns the value at `path` of a given object.
8862
+ *
8863
+ * @static
8864
+ * @memberOf _
8865
+ * @since 2.4.0
8866
+ * @category Util
8867
+ * @param {Array|string} path The path of the property to get.
8868
+ * @returns {Function} Returns the new accessor function.
8869
+ * @example
8870
+ *
8871
+ * var objects = [
8872
+ * { 'a': { 'b': 2 } },
8873
+ * { 'a': { 'b': 1 } }
8874
+ * ];
8875
+ *
8876
+ * _.map(objects, _.property('a.b'));
8877
+ * // => [2, 1]
8878
+ *
8879
+ * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
8880
+ * // => [1, 2]
8881
+ */
8882
+ function property(path) {
8883
+ return _isKey(path) ? _baseProperty(_toKey(path)) : _basePropertyDeep(path);
8884
+ }
8885
+
8886
+ var property_1 = property;
8887
+
8888
+ /**
8889
+ * The base implementation of `_.iteratee`.
8890
+ *
8891
+ * @private
8892
+ * @param {*} [value=_.identity] The value to convert to an iteratee.
8893
+ * @returns {Function} Returns the iteratee.
8894
+ */
8895
+ function baseIteratee(value) {
8896
+ // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
8897
+ // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
8898
+ if (typeof value == 'function') {
8899
+ return value;
8900
+ }
8901
+ if (value == null) {
8902
+ return identity_1;
8903
+ }
8904
+ if (typeof value == 'object') {
8905
+ return isArray_1(value)
8906
+ ? _baseMatchesProperty(value[0], value[1])
8907
+ : _baseMatches(value);
8908
+ }
8909
+ return property_1(value);
8910
+ }
8911
+
8912
+ var _baseIteratee = baseIteratee;
8913
+
8914
+ /**
8915
+ * Creates a base function for methods like `_.forIn` and `_.forOwn`.
8916
+ *
8917
+ * @private
8918
+ * @param {boolean} [fromRight] Specify iterating from right to left.
8919
+ * @returns {Function} Returns the new base function.
8920
+ */
8921
+ function createBaseFor(fromRight) {
8922
+ return function(object, iteratee, keysFunc) {
8923
+ var index = -1,
8924
+ iterable = Object(object),
8925
+ props = keysFunc(object),
8926
+ length = props.length;
8927
+
8928
+ while (length--) {
8929
+ var key = props[fromRight ? length : ++index];
8930
+ if (iteratee(iterable[key], key, iterable) === false) {
8931
+ break;
8932
+ }
8933
+ }
8934
+ return object;
8935
+ };
8936
+ }
8937
+
8938
+ var _createBaseFor = createBaseFor;
8939
+
8940
+ /**
8941
+ * The base implementation of `baseForOwn` which iterates over `object`
8942
+ * properties returned by `keysFunc` and invokes `iteratee` for each property.
8943
+ * Iteratee functions may exit iteration early by explicitly returning `false`.
8944
+ *
8945
+ * @private
8946
+ * @param {Object} object The object to iterate over.
8947
+ * @param {Function} iteratee The function invoked per iteration.
8948
+ * @param {Function} keysFunc The function to get the keys of `object`.
8949
+ * @returns {Object} Returns `object`.
8950
+ */
8951
+ var baseFor = _createBaseFor();
8952
+
8953
+ var _baseFor = baseFor;
8954
+
8955
+ /**
8956
+ * The base implementation of `_.forOwn` without support for iteratee shorthands.
8957
+ *
8958
+ * @private
8959
+ * @param {Object} object The object to iterate over.
8960
+ * @param {Function} iteratee The function invoked per iteration.
8961
+ * @returns {Object} Returns `object`.
8962
+ */
8963
+ function baseForOwn(object, iteratee) {
8964
+ return object && _baseFor(object, iteratee, keys_1);
8965
+ }
8966
+
8967
+ var _baseForOwn = baseForOwn;
8968
+
8969
+ /**
8970
+ * Creates a `baseEach` or `baseEachRight` function.
8971
+ *
8972
+ * @private
8973
+ * @param {Function} eachFunc The function to iterate over a collection.
8974
+ * @param {boolean} [fromRight] Specify iterating from right to left.
8975
+ * @returns {Function} Returns the new base function.
8976
+ */
8977
+ function createBaseEach(eachFunc, fromRight) {
8978
+ return function(collection, iteratee) {
8979
+ if (collection == null) {
8980
+ return collection;
8981
+ }
8982
+ if (!isArrayLike_1(collection)) {
8983
+ return eachFunc(collection, iteratee);
8984
+ }
8985
+ var length = collection.length,
8986
+ index = fromRight ? length : -1,
8987
+ iterable = Object(collection);
8988
+
8989
+ while ((fromRight ? index-- : ++index < length)) {
8990
+ if (iteratee(iterable[index], index, iterable) === false) {
8991
+ break;
8992
+ }
8993
+ }
8994
+ return collection;
8995
+ };
8996
+ }
8997
+
8998
+ var _createBaseEach = createBaseEach;
8999
+
9000
+ /**
9001
+ * The base implementation of `_.forEach` without support for iteratee shorthands.
9002
+ *
9003
+ * @private
9004
+ * @param {Array|Object} collection The collection to iterate over.
9005
+ * @param {Function} iteratee The function invoked per iteration.
9006
+ * @returns {Array|Object} Returns `collection`.
9007
+ */
9008
+ var baseEach = _createBaseEach(_baseForOwn);
9009
+
9010
+ var _baseEach = baseEach;
9011
+
9012
+ /**
9013
+ * The base implementation of `_.map` without support for iteratee shorthands.
9014
+ *
9015
+ * @private
9016
+ * @param {Array|Object} collection The collection to iterate over.
9017
+ * @param {Function} iteratee The function invoked per iteration.
9018
+ * @returns {Array} Returns the new mapped array.
9019
+ */
9020
+ function baseMap(collection, iteratee) {
9021
+ var index = -1,
9022
+ result = isArrayLike_1(collection) ? Array(collection.length) : [];
9023
+
9024
+ _baseEach(collection, function(value, key, collection) {
9025
+ result[++index] = iteratee(value, key, collection);
9026
+ });
9027
+ return result;
9028
+ }
9029
+
9030
+ var _baseMap = baseMap;
9031
+
9032
+ /**
9033
+ * The base implementation of `_.sortBy` which uses `comparer` to define the
9034
+ * sort order of `array` and replaces criteria objects with their corresponding
9035
+ * values.
9036
+ *
9037
+ * @private
9038
+ * @param {Array} array The array to sort.
9039
+ * @param {Function} comparer The function to define sort order.
9040
+ * @returns {Array} Returns `array`.
9041
+ */
9042
+ function baseSortBy(array, comparer) {
9043
+ var length = array.length;
9044
+
9045
+ array.sort(comparer);
9046
+ while (length--) {
9047
+ array[length] = array[length].value;
9048
+ }
9049
+ return array;
9050
+ }
9051
+
9052
+ var _baseSortBy = baseSortBy;
9053
+
9054
+ /**
9055
+ * Compares values to sort them in ascending order.
9056
+ *
9057
+ * @private
9058
+ * @param {*} value The value to compare.
9059
+ * @param {*} other The other value to compare.
9060
+ * @returns {number} Returns the sort order indicator for `value`.
9061
+ */
9062
+ function compareAscending(value, other) {
9063
+ if (value !== other) {
9064
+ var valIsDefined = value !== undefined,
9065
+ valIsNull = value === null,
9066
+ valIsReflexive = value === value,
9067
+ valIsSymbol = isSymbol_1(value);
9068
+
9069
+ var othIsDefined = other !== undefined,
9070
+ othIsNull = other === null,
9071
+ othIsReflexive = other === other,
9072
+ othIsSymbol = isSymbol_1(other);
9073
+
9074
+ if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
9075
+ (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
9076
+ (valIsNull && othIsDefined && othIsReflexive) ||
9077
+ (!valIsDefined && othIsReflexive) ||
9078
+ !valIsReflexive) {
9079
+ return 1;
9080
+ }
9081
+ if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
9082
+ (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
9083
+ (othIsNull && valIsDefined && valIsReflexive) ||
9084
+ (!othIsDefined && valIsReflexive) ||
9085
+ !othIsReflexive) {
9086
+ return -1;
9087
+ }
9088
+ }
9089
+ return 0;
9090
+ }
9091
+
9092
+ var _compareAscending = compareAscending;
9093
+
9094
+ /**
9095
+ * Used by `_.orderBy` to compare multiple properties of a value to another
9096
+ * and stable sort them.
9097
+ *
9098
+ * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
9099
+ * specify an order of "desc" for descending or "asc" for ascending sort order
9100
+ * of corresponding values.
9101
+ *
9102
+ * @private
9103
+ * @param {Object} object The object to compare.
9104
+ * @param {Object} other The other object to compare.
9105
+ * @param {boolean[]|string[]} orders The order to sort by for each property.
9106
+ * @returns {number} Returns the sort order indicator for `object`.
9107
+ */
9108
+ function compareMultiple(object, other, orders) {
9109
+ var index = -1,
9110
+ objCriteria = object.criteria,
9111
+ othCriteria = other.criteria,
9112
+ length = objCriteria.length,
9113
+ ordersLength = orders.length;
9114
+
9115
+ while (++index < length) {
9116
+ var result = _compareAscending(objCriteria[index], othCriteria[index]);
9117
+ if (result) {
9118
+ if (index >= ordersLength) {
9119
+ return result;
9120
+ }
9121
+ var order = orders[index];
9122
+ return result * (order == 'desc' ? -1 : 1);
9123
+ }
9124
+ }
9125
+ // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
9126
+ // that causes it, under certain circumstances, to provide the same value for
9127
+ // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
9128
+ // for more details.
9129
+ //
9130
+ // This also ensures a stable sort in V8 and other engines.
9131
+ // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
9132
+ return object.index - other.index;
9133
+ }
9134
+
9135
+ var _compareMultiple = compareMultiple;
9136
+
9137
+ /**
9138
+ * The base implementation of `_.orderBy` without param guards.
9139
+ *
9140
+ * @private
9141
+ * @param {Array|Object} collection The collection to iterate over.
9142
+ * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
9143
+ * @param {string[]} orders The sort orders of `iteratees`.
9144
+ * @returns {Array} Returns the new sorted array.
9145
+ */
9146
+ function baseOrderBy(collection, iteratees, orders) {
9147
+ if (iteratees.length) {
9148
+ iteratees = _arrayMap(iteratees, function(iteratee) {
9149
+ if (isArray_1(iteratee)) {
9150
+ return function(value) {
9151
+ return _baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
9152
+ }
9153
+ }
9154
+ return iteratee;
9155
+ });
9156
+ } else {
9157
+ iteratees = [identity_1];
9158
+ }
9159
+
9160
+ var index = -1;
9161
+ iteratees = _arrayMap(iteratees, _baseUnary(_baseIteratee));
9162
+
9163
+ var result = _baseMap(collection, function(value, key, collection) {
9164
+ var criteria = _arrayMap(iteratees, function(iteratee) {
9165
+ return iteratee(value);
9166
+ });
9167
+ return { 'criteria': criteria, 'index': ++index, 'value': value };
9168
+ });
9169
+
9170
+ return _baseSortBy(result, function(object, other) {
9171
+ return _compareMultiple(object, other, orders);
9172
+ });
9173
+ }
9174
+
9175
+ var _baseOrderBy = baseOrderBy;
9176
+
9177
+ /**
9178
+ * A faster alternative to `Function#apply`, this function invokes `func`
9179
+ * with the `this` binding of `thisArg` and the arguments of `args`.
9180
+ *
9181
+ * @private
9182
+ * @param {Function} func The function to invoke.
9183
+ * @param {*} thisArg The `this` binding of `func`.
9184
+ * @param {Array} args The arguments to invoke `func` with.
9185
+ * @returns {*} Returns the result of `func`.
9186
+ */
9187
+ function apply(func, thisArg, args) {
9188
+ switch (args.length) {
9189
+ case 0: return func.call(thisArg);
9190
+ case 1: return func.call(thisArg, args[0]);
9191
+ case 2: return func.call(thisArg, args[0], args[1]);
9192
+ case 3: return func.call(thisArg, args[0], args[1], args[2]);
9193
+ }
9194
+ return func.apply(thisArg, args);
9195
+ }
9196
+
9197
+ var _apply = apply;
9198
+
9199
+ /* Built-in method references for those with the same name as other `lodash` methods. */
9200
+ var nativeMax = Math.max;
9201
+
9202
+ /**
9203
+ * A specialized version of `baseRest` which transforms the rest array.
9204
+ *
9205
+ * @private
9206
+ * @param {Function} func The function to apply a rest parameter to.
9207
+ * @param {number} [start=func.length-1] The start position of the rest parameter.
9208
+ * @param {Function} transform The rest array transform.
9209
+ * @returns {Function} Returns the new function.
9210
+ */
9211
+ function overRest(func, start, transform) {
9212
+ start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
9213
+ return function() {
9214
+ var args = arguments,
9215
+ index = -1,
9216
+ length = nativeMax(args.length - start, 0),
9217
+ array = Array(length);
9218
+
9219
+ while (++index < length) {
9220
+ array[index] = args[start + index];
9221
+ }
9222
+ index = -1;
9223
+ var otherArgs = Array(start + 1);
9224
+ while (++index < start) {
9225
+ otherArgs[index] = args[index];
9226
+ }
9227
+ otherArgs[start] = transform(array);
9228
+ return _apply(func, this, otherArgs);
9229
+ };
9230
+ }
9231
+
9232
+ var _overRest = overRest;
9233
+
9234
+ /**
9235
+ * Creates a function that returns `value`.
9236
+ *
9237
+ * @static
9238
+ * @memberOf _
9239
+ * @since 2.4.0
9240
+ * @category Util
9241
+ * @param {*} value The value to return from the new function.
9242
+ * @returns {Function} Returns the new constant function.
9243
+ * @example
9244
+ *
9245
+ * var objects = _.times(2, _.constant({ 'a': 1 }));
9246
+ *
9247
+ * console.log(objects);
9248
+ * // => [{ 'a': 1 }, { 'a': 1 }]
9249
+ *
9250
+ * console.log(objects[0] === objects[1]);
9251
+ * // => true
9252
+ */
9253
+ function constant(value) {
9254
+ return function() {
9255
+ return value;
9256
+ };
9257
+ }
9258
+
9259
+ var constant_1 = constant;
9260
+
9261
+ var defineProperty = (function() {
9262
+ try {
9263
+ var func = _getNative(Object, 'defineProperty');
9264
+ func({}, '', {});
9265
+ return func;
9266
+ } catch (e) {}
9267
+ }());
9268
+
9269
+ var _defineProperty = defineProperty;
9270
+
9271
+ /**
9272
+ * The base implementation of `setToString` without support for hot loop shorting.
9273
+ *
9274
+ * @private
9275
+ * @param {Function} func The function to modify.
9276
+ * @param {Function} string The `toString` result.
9277
+ * @returns {Function} Returns `func`.
9278
+ */
9279
+ var baseSetToString = !_defineProperty ? identity_1 : function(func, string) {
9280
+ return _defineProperty(func, 'toString', {
9281
+ 'configurable': true,
9282
+ 'enumerable': false,
9283
+ 'value': constant_1(string),
9284
+ 'writable': true
9285
+ });
9286
+ };
9287
+
9288
+ var _baseSetToString = baseSetToString;
9289
+
9290
+ /** Used to detect hot functions by number of calls within a span of milliseconds. */
9291
+ var HOT_COUNT = 800,
9292
+ HOT_SPAN = 16;
9293
+
9294
+ /* Built-in method references for those with the same name as other `lodash` methods. */
9295
+ var nativeNow = Date.now;
9296
+
9297
+ /**
9298
+ * Creates a function that'll short out and invoke `identity` instead
9299
+ * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
9300
+ * milliseconds.
9301
+ *
9302
+ * @private
9303
+ * @param {Function} func The function to restrict.
9304
+ * @returns {Function} Returns the new shortable function.
9305
+ */
9306
+ function shortOut(func) {
9307
+ var count = 0,
9308
+ lastCalled = 0;
9309
+
9310
+ return function() {
9311
+ var stamp = nativeNow(),
9312
+ remaining = HOT_SPAN - (stamp - lastCalled);
9313
+
9314
+ lastCalled = stamp;
9315
+ if (remaining > 0) {
9316
+ if (++count >= HOT_COUNT) {
9317
+ return arguments[0];
9318
+ }
9319
+ } else {
9320
+ count = 0;
9321
+ }
9322
+ return func.apply(undefined, arguments);
9323
+ };
9324
+ }
9325
+
9326
+ var _shortOut = shortOut;
9327
+
9328
+ /**
9329
+ * Sets the `toString` method of `func` to return `string`.
9330
+ *
9331
+ * @private
9332
+ * @param {Function} func The function to modify.
9333
+ * @param {Function} string The `toString` result.
9334
+ * @returns {Function} Returns `func`.
9335
+ */
9336
+ var setToString = _shortOut(_baseSetToString);
9337
+
9338
+ var _setToString = setToString;
9339
+
9340
+ /**
9341
+ * The base implementation of `_.rest` which doesn't validate or coerce arguments.
9342
+ *
9343
+ * @private
9344
+ * @param {Function} func The function to apply a rest parameter to.
9345
+ * @param {number} [start=func.length-1] The start position of the rest parameter.
9346
+ * @returns {Function} Returns the new function.
9347
+ */
9348
+ function baseRest(func, start) {
9349
+ return _setToString(_overRest(func, start, identity_1), func + '');
9350
+ }
9351
+
9352
+ var _baseRest = baseRest;
9353
+
9354
+ /**
9355
+ * Checks if the given arguments are from an iteratee call.
9356
+ *
9357
+ * @private
9358
+ * @param {*} value The potential iteratee value argument.
9359
+ * @param {*} index The potential iteratee index or key argument.
9360
+ * @param {*} object The potential iteratee object argument.
9361
+ * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
9362
+ * else `false`.
9363
+ */
9364
+ function isIterateeCall(value, index, object) {
9365
+ if (!isObject_1(object)) {
9366
+ return false;
9367
+ }
9368
+ var type = typeof index;
9369
+ if (type == 'number'
9370
+ ? (isArrayLike_1(object) && _isIndex(index, object.length))
9371
+ : (type == 'string' && index in object)
9372
+ ) {
9373
+ return eq_1(object[index], value);
9374
+ }
9375
+ return false;
9376
+ }
9377
+
9378
+ var _isIterateeCall = isIterateeCall;
9379
+
9380
+ /**
9381
+ * Creates an array of elements, sorted in ascending order by the results of
9382
+ * running each element in a collection thru each iteratee. This method
9383
+ * performs a stable sort, that is, it preserves the original sort order of
9384
+ * equal elements. The iteratees are invoked with one argument: (value).
9385
+ *
9386
+ * @static
9387
+ * @memberOf _
9388
+ * @since 0.1.0
9389
+ * @category Collection
9390
+ * @param {Array|Object} collection The collection to iterate over.
9391
+ * @param {...(Function|Function[])} [iteratees=[_.identity]]
9392
+ * The iteratees to sort by.
9393
+ * @returns {Array} Returns the new sorted array.
9394
+ * @example
9395
+ *
9396
+ * var users = [
9397
+ * { 'user': 'fred', 'age': 48 },
9398
+ * { 'user': 'barney', 'age': 36 },
9399
+ * { 'user': 'fred', 'age': 30 },
9400
+ * { 'user': 'barney', 'age': 34 }
9401
+ * ];
9402
+ *
9403
+ * _.sortBy(users, [function(o) { return o.user; }]);
9404
+ * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
9405
+ *
9406
+ * _.sortBy(users, ['user', 'age']);
9407
+ * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
9408
+ */
9409
+ var sortBy = _baseRest(function(collection, iteratees) {
9410
+ if (collection == null) {
9411
+ return [];
9412
+ }
9413
+ var length = iteratees.length;
9414
+ if (length > 1 && _isIterateeCall(collection, iteratees[0], iteratees[1])) {
9415
+ iteratees = [];
9416
+ } else if (length > 2 && _isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
9417
+ iteratees = [iteratees[0]];
9418
+ }
9419
+ return _baseOrderBy(collection, _baseFlatten(iteratees, 1), []);
9420
+ });
9421
+
9422
+ var sortBy_1 = sortBy;
9423
+
9424
+ /**
9425
+ * Configuration for custom action validation rules.
9426
+ * Defines allowed positions, metadata IDs, data model IDs, and fields for each target
9427
+ * type.
9428
+ *
9429
+ */
9430
+ const customActionValidationConfig = {
9431
+ [exports.CustomActionTarget.LIVEBOARD]: {
9432
+ positions: [exports.CustomActionsPosition.PRIMARY, exports.CustomActionsPosition.MENU],
9433
+ allowedMetadataIds: ['liveboardIds'],
9434
+ allowedDataModelIds: [],
9435
+ allowedFields: ['name', 'id', 'position', 'target', 'metadataIds', 'orgIds', 'groupIds'],
9436
+ },
9437
+ [exports.CustomActionTarget.VIZ]: {
9438
+ positions: [exports.CustomActionsPosition.MENU, exports.CustomActionsPosition.PRIMARY, exports.CustomActionsPosition.CONTEXTMENU],
9439
+ allowedMetadataIds: ['liveboardIds', 'vizIds', 'answerIds'],
9440
+ allowedDataModelIds: ['modelIds', 'modelColumnNames'],
9441
+ allowedFields: ['name', 'id', 'position', 'target', 'metadataIds', 'orgIds', 'groupIds', 'dataModelIds'],
9442
+ },
9443
+ [exports.CustomActionTarget.ANSWER]: {
9444
+ positions: [exports.CustomActionsPosition.MENU, exports.CustomActionsPosition.PRIMARY, exports.CustomActionsPosition.CONTEXTMENU],
9445
+ allowedMetadataIds: ['answerIds'],
9446
+ allowedDataModelIds: ['modelIds', 'modelColumnNames'],
9447
+ allowedFields: ['name', 'id', 'position', 'target', 'metadataIds', 'orgIds', 'groupIds', 'dataModelIds'],
9448
+ },
9449
+ [exports.CustomActionTarget.SPOTTER]: {
9450
+ positions: [exports.CustomActionsPosition.MENU, exports.CustomActionsPosition.CONTEXTMENU],
9451
+ allowedMetadataIds: [],
9452
+ allowedDataModelIds: ['modelIds'],
9453
+ allowedFields: ['name', 'id', 'position', 'target', 'orgIds', 'groupIds', 'dataModelIds'],
9454
+ },
9455
+ };
9456
+ /**
9457
+ * Validates a single custom action based on its target type
9458
+ * @param action - The custom action to validate
9459
+ * @param primaryActionsPerTarget - Map to track primary actions per target
9460
+ * @returns CustomActionValidation with isValid flag and reason string
9461
+ *
9462
+ * @hidden
9463
+ */
9464
+ const validateCustomAction = (action, primaryActionsPerTarget) => {
9465
+ const { id: actionId, target: targetType, position, metadataIds, dataModelIds } = action;
9466
+ // Check if target type is supported
9467
+ if (!customActionValidationConfig[targetType]) {
9468
+ const errorMessage = CUSTOM_ACTIONS_ERROR_MESSAGE.UNSUPPORTED_TARGET(actionId, targetType);
9469
+ return { isValid: false, errors: [errorMessage] };
9470
+ }
9471
+ const config = customActionValidationConfig[targetType];
9472
+ const errors = [];
9473
+ // Validate position
9474
+ if (!arrayIncludesString(config.positions, position)) {
9475
+ const supportedPositions = config.positions.join(', ');
9476
+ errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.INVALID_POSITION(position, targetType, supportedPositions));
9477
+ }
9478
+ // Check for primary action conflicts (this is a warning, not a validation
9479
+ // failure)
9480
+ if (position === exports.CustomActionsPosition.PRIMARY) {
9481
+ const existingPrimaryAction = primaryActionsPerTarget.get(targetType);
9482
+ if (existingPrimaryAction) {
9483
+ errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.MULTIPLE_PRIMARY_ACTIONS(targetType, existingPrimaryAction.name, action.name));
9484
+ }
9485
+ else {
9486
+ primaryActionsPerTarget.set(targetType, action);
7996
9487
  }
7997
- return unaggAnswerSession;
7998
- }
7999
- /**
8000
- * Execute a custom graphql query in the context of the answer.
8001
- * @param query graphql query
8002
- * @param variables graphql variables
8003
- * @returns
8004
- */
8005
- async executeQuery(query, variables) {
8006
- const data = await graphqlQuery({
8007
- query,
8008
- variables: {
8009
- session: this.session,
8010
- ...variables,
8011
- },
8012
- thoughtSpotHost: this.thoughtSpotHost,
8013
- isCompositeQuery: false,
8014
- });
8015
- this.session = deepMerge(this.session, (data === null || data === void 0 ? void 0 : data.id) || {});
8016
- return data;
8017
- }
8018
- /**
8019
- * Get the internal session details for the answer.
8020
- * @returns
8021
- */
8022
- getSession() {
8023
- return this.session;
8024
9488
  }
8025
- async getAnswer() {
8026
- if (this.answer) {
8027
- return this.answer;
9489
+ // Validate metadata IDs
9490
+ if (metadataIds) {
9491
+ const invalidMetadataIds = Object.keys(metadataIds).filter((key) => !arrayIncludesString(config.allowedMetadataIds, key));
9492
+ if (invalidMetadataIds.length > 0) {
9493
+ const supportedMetadataIds = config.allowedMetadataIds.length > 0 ? config.allowedMetadataIds.join(', ') : 'none';
9494
+ errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.INVALID_METADATA_IDS(targetType, invalidMetadataIds, supportedMetadataIds));
8028
9495
  }
8029
- this.answer = this.executeQuery(getAnswer, {}).then((data) => data === null || data === void 0 ? void 0 : data.answer);
8030
- return this.answer;
8031
- }
8032
- async getTML() {
8033
- const { object } = await this.executeQuery(getAnswerTML, {});
8034
- const edoc = object[0].edoc;
8035
- const YAML = await Promise.resolve().then(function () { return index; });
8036
- const parsedDoc = YAML.parse(edoc);
8037
- return {
8038
- answer: {
8039
- ...parsedDoc.answer,
8040
- ...this.tmlOverride,
8041
- },
8042
- };
8043
9496
  }
8044
- async addDisplayedVizToLiveboard(liveboardId) {
8045
- const { displayMode, visualizations } = await this.getAnswer();
8046
- const viz = getDisplayedViz(visualizations, displayMode);
8047
- return this.executeQuery(addVizToLiveboard, {
8048
- liveboardId,
8049
- vizId: viz.id,
8050
- });
9497
+ // Validate data model IDs
9498
+ if (dataModelIds) {
9499
+ const invalidDataModelIds = Object.keys(dataModelIds).filter((key) => !arrayIncludesString(config.allowedDataModelIds, key));
9500
+ if (invalidDataModelIds.length > 0) {
9501
+ const supportedDataModelIds = config.allowedDataModelIds.length > 0 ? config.allowedDataModelIds.join(', ') : 'none';
9502
+ errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.INVALID_DATA_MODEL_IDS(targetType, invalidDataModelIds, supportedDataModelIds));
9503
+ }
8051
9504
  }
8052
- setTMLOverride(override) {
8053
- this.tmlOverride = override;
9505
+ // Validate allowed fields
9506
+ const actionKeys = Object.keys(action);
9507
+ const invalidFields = actionKeys.filter((key) => !arrayIncludesString(config.allowedFields, key));
9508
+ if (invalidFields.length > 0) {
9509
+ const supportedFields = config.allowedFields.join(', ');
9510
+ errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.INVALID_FIELDS(targetType, invalidFields, supportedFields));
8054
9511
  }
8055
- }
9512
+ return {
9513
+ isValid: errors.length === 0,
9514
+ errors,
9515
+ };
9516
+ };
8056
9517
  /**
9518
+ * Validates basic action structure and required fields
9519
+ * @param action - The action to validate
9520
+ * @returns Object containing validation result and missing fields
8057
9521
  *
8058
- * @param sourceDetail
8059
- * @param colNames
9522
+ * @hidden
8060
9523
  */
8061
- function getGuidsFromColumnNames(sourceDetail, colNames) {
8062
- const cols = sourceDetail.columns.reduce((colSet, col) => {
8063
- colSet[col.name.toLowerCase()] = col;
8064
- return colSet;
8065
- }, {});
8066
- return new Set(colNames.map((colName) => {
8067
- const col = cols[colName.toLowerCase()];
8068
- return col.id;
8069
- }));
8070
- }
9524
+ const validateActionStructure = (action) => {
9525
+ if (!action || typeof action !== 'object') {
9526
+ return { isValid: false, missingFields: [] };
9527
+ }
9528
+ // Check for all missing required fields
9529
+ const missingFields = ['id', 'name', 'target', 'position'].filter(field => !action[field]);
9530
+ return { isValid: missingFields.length === 0, missingFields };
9531
+ };
8071
9532
  /**
9533
+ * Checks for duplicate IDs among actions
9534
+ * @param actions - Array of actions to check
9535
+ * @returns Object containing filtered actions and duplicate errors
8072
9536
  *
8073
- * @param selectedPoints
9537
+ * @hidden
8074
9538
  */
8075
- function getSelectedPointsForUnderlyingDataQuery(selectedPoints) {
8076
- const underlyingDataPoint = [];
8077
- /**
8078
- *
8079
- * @param colVal
8080
- */
8081
- function addPointFromColVal(colVal) {
8082
- var _a;
8083
- const dataType = colVal.column.dataType;
8084
- colVal.column.id;
8085
- let dataValue;
8086
- if (dataType === 'DATE') {
8087
- if (Number.isFinite(colVal.value)) {
8088
- dataValue = [{
8089
- epochRange: {
8090
- startEpoch: colVal.value,
8091
- },
8092
- }];
8093
- // Case for custom calendar.
8094
- }
8095
- else if ((_a = colVal.value) === null || _a === void 0 ? void 0 : _a.v) {
8096
- dataValue = [{
8097
- epochRange: {
8098
- startEpoch: colVal.value.v.s,
8099
- endEpoch: colVal.value.v.e,
8100
- },
8101
- }];
8102
- }
9539
+ const filterDuplicateIds = (actions) => {
9540
+ const idMap = actions.reduce((map, action) => {
9541
+ const list = map.get(action.id) || [];
9542
+ list.push(action);
9543
+ map.set(action.id, list);
9544
+ return map;
9545
+ }, new Map());
9546
+ const { actions: actionsWithUniqueIds, errors } = Array.from(idMap.entries()).reduce((acc, [id, actionsWithSameId]) => {
9547
+ if (actionsWithSameId.length === 1) {
9548
+ acc.actions.push(actionsWithSameId[0]);
8103
9549
  }
8104
9550
  else {
8105
- dataValue = [{ value: colVal.value }];
9551
+ // Keep the first action and add error for duplicates
9552
+ acc.actions.push(actionsWithSameId[0]);
9553
+ const duplicateNames = actionsWithSameId.slice(1).map(action => action.name);
9554
+ acc.errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.DUPLICATE_IDS(id, duplicateNames, actionsWithSameId[0].name));
8106
9555
  }
8107
- underlyingDataPoint.push({
8108
- columnId: colVal.column.id,
8109
- dataValue,
8110
- });
8111
- }
8112
- selectedPoints.forEach((p) => {
8113
- p.selectedAttributes.forEach(addPointFromColVal);
8114
- });
8115
- return underlyingDataPoint;
8116
- }
9556
+ return acc;
9557
+ }, { actions: [], errors: [] });
9558
+ return { actions: actionsWithUniqueIds, errors };
9559
+ };
8117
9560
  /**
8118
- *
8119
- * @param visualizations
8120
- * @param displayMode
9561
+ * Validates and processes custom actions
9562
+ * @param customActions - Array of custom actions to validate
9563
+ * @returns Object containing valid actions and any validation errors
8121
9564
  */
8122
- function getDisplayedViz(visualizations, displayMode) {
8123
- if (displayMode === 'CHART_MODE') {
8124
- return visualizations.find(
8125
- // eslint-disable-next-line no-underscore-dangle
8126
- (viz) => viz.__typename === 'ChartViz');
8127
- }
8128
- return visualizations.find(
8129
- // eslint-disable-next-line no-underscore-dangle
8130
- (viz) => viz.__typename === 'TableViz');
8131
- }
9565
+ const getCustomActions = (customActions) => {
9566
+ const errors = [];
9567
+ const primaryActionsPerTarget = new Map();
9568
+ if (!customActions || !Array.isArray(customActions)) {
9569
+ return { actions: [], errors: [] };
9570
+ }
9571
+ // Step 1: Handle invalid actions first (null, undefined, missing required
9572
+ // fields)
9573
+ const validActions = customActions.filter(action => {
9574
+ const validation = validateActionStructure(action);
9575
+ if (!validation.isValid) {
9576
+ if (!action || typeof action !== 'object') {
9577
+ errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.INVALID_ACTION_OBJECT);
9578
+ }
9579
+ else {
9580
+ errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.MISSING_REQUIRED_FIELDS(action.id, validation.missingFields));
9581
+ }
9582
+ return false;
9583
+ }
9584
+ return true;
9585
+ });
9586
+ // Step 2: Check for duplicate IDs among valid actions
9587
+ const { actions: actionsWithUniqueIds, errors: duplicateErrors } = filterDuplicateIds(validActions);
9588
+ // Add duplicate errors to the errors array
9589
+ duplicateErrors.forEach(error => errors.push(error));
9590
+ // Step 3: Validate actions with unique IDs
9591
+ const finalValidActions = [];
9592
+ actionsWithUniqueIds.forEach((action) => {
9593
+ const { isValid, errors: validationErrors } = validateCustomAction(action, primaryActionsPerTarget);
9594
+ validationErrors.forEach(error => errors.push(error));
9595
+ if (isValid) {
9596
+ finalValidActions.push(action);
9597
+ }
9598
+ });
9599
+ const sortedActions = sortBy_1(finalValidActions, (a) => a.name.toLocaleLowerCase());
9600
+ return {
9601
+ actions: sortedActions,
9602
+ errors: errors,
9603
+ };
9604
+ };
8132
9605
 
8133
9606
  /**
8134
9607
  * Copyright (c) 2023
@@ -15941,7 +17414,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15941
17414
  return e;
15942
17415
  }
15943
17416
 
15944
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.40.1-alpha.3";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$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info","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":"^0.7.3",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^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$1,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};
17417
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.40.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$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | 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":"^0.7.3",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^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$1,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};
15945
17418
 
15946
17419
  /**
15947
17420
  * Reloads the ThoughtSpot iframe.
@@ -16379,8 +17852,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16379
17852
  // - cached auth may not reflect current user permissions
16380
17853
  const isDisabled = (this.viewConfig.overrideOrgId !== undefined
16381
17854
  || this.embedConfig.disablePreauthCache === true
16382
- // || this.isFullAppEmbedWithVisiblePrimaryNavbar()
16383
- );
17855
+ || this.isFullAppEmbedWithVisiblePrimaryNavbar());
16384
17856
  return !isDisabled;
16385
17857
  }
16386
17858
  /**
@@ -16467,6 +17939,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16467
17939
  async getDefaultAppInitData() {
16468
17940
  var _a, _b;
16469
17941
  const authToken = await this.getAuthTokenForCookielessInit();
17942
+ const customActionsResult = getCustomActions([
17943
+ ...(this.viewConfig.customActions || []),
17944
+ ...(this.embedConfig.customActions || [])
17945
+ ]);
17946
+ if (customActionsResult.errors.length > 0) {
17947
+ this.handleError({
17948
+ type: 'CUSTOM_ACTION_VALIDATION',
17949
+ message: customActionsResult.errors,
17950
+ });
17951
+ }
16470
17952
  return {
16471
17953
  customisations: getCustomisations(this.embedConfig, this.viewConfig),
16472
17954
  authToken,
@@ -16484,6 +17966,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16484
17966
  : [],
16485
17967
  customVariablesForThirdPartyTools: this.embedConfig.customVariablesForThirdPartyTools || {},
16486
17968
  hiddenListColumns: this.viewConfig.hiddenListColumns || [],
17969
+ customActions: customActionsResult.actions,
16487
17970
  };
16488
17971
  }
16489
17972
  async getAppInitData() {