@thoughtspot/visual-embed-sdk 1.42.1-alpha.6 → 1.42.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 (202) hide show
  1. package/cjs/package.json +3 -2
  2. package/cjs/src/css-variables.d.ts +0 -48
  3. package/cjs/src/css-variables.d.ts.map +1 -1
  4. package/cjs/src/embed/app.d.ts +20 -0
  5. package/cjs/src/embed/app.d.ts.map +1 -1
  6. package/cjs/src/embed/app.js +9 -4
  7. package/cjs/src/embed/app.js.map +1 -1
  8. package/cjs/src/embed/app.spec.js +62 -0
  9. package/cjs/src/embed/app.spec.js.map +1 -1
  10. package/cjs/src/embed/bodyless-conversation.d.ts +1 -1
  11. package/cjs/src/embed/conversation.d.ts +16 -0
  12. package/cjs/src/embed/conversation.d.ts.map +1 -1
  13. package/cjs/src/embed/conversation.js +5 -2
  14. package/cjs/src/embed/conversation.js.map +1 -1
  15. package/cjs/src/embed/conversation.spec.js +25 -1
  16. package/cjs/src/embed/conversation.spec.js.map +1 -1
  17. package/cjs/src/embed/hostEventClient/contracts.d.ts +1 -11
  18. package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  19. package/cjs/src/embed/hostEventClient/contracts.js +0 -1
  20. package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
  21. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  22. package/cjs/src/embed/liveboard.js +5 -1
  23. package/cjs/src/embed/liveboard.js.map +1 -1
  24. package/cjs/src/embed/liveboard.spec.js +46 -0
  25. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  26. package/cjs/src/embed/sage.d.ts +4 -4
  27. package/cjs/src/embed/search.d.ts.map +1 -1
  28. package/cjs/src/embed/search.js +1 -3
  29. package/cjs/src/embed/search.js.map +1 -1
  30. package/cjs/src/embed/ts-embed.d.ts +0 -2
  31. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  32. package/cjs/src/embed/ts-embed.js +14 -42
  33. package/cjs/src/embed/ts-embed.js.map +1 -1
  34. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  35. package/cjs/src/errors.js +1 -1
  36. package/cjs/src/errors.js.map +1 -1
  37. package/cjs/src/index.d.ts +2 -2
  38. package/cjs/src/index.d.ts.map +1 -1
  39. package/cjs/src/index.js +1 -2
  40. package/cjs/src/index.js.map +1 -1
  41. package/cjs/src/react/all-types-export.d.ts +1 -1
  42. package/cjs/src/react/all-types-export.d.ts.map +1 -1
  43. package/cjs/src/react/all-types-export.js +3 -2
  44. package/cjs/src/react/all-types-export.js.map +1 -1
  45. package/cjs/src/react/util.d.ts +1 -0
  46. package/cjs/src/react/util.d.ts.map +1 -1
  47. package/cjs/src/types.d.ts +58 -93
  48. package/cjs/src/types.d.ts.map +1 -1
  49. package/cjs/src/types.js +21 -46
  50. package/cjs/src/types.js.map +1 -1
  51. package/cjs/src/utils/custom-actions.d.ts.map +1 -1
  52. package/cjs/src/utils/custom-actions.js +9 -0
  53. package/cjs/src/utils/custom-actions.js.map +1 -1
  54. package/cjs/src/utils/custom-actions.spec.js +20 -0
  55. package/cjs/src/utils/custom-actions.spec.js.map +1 -1
  56. package/cjs/src/utils/processData.d.ts +1 -1
  57. package/cjs/src/utils/processData.d.ts.map +1 -1
  58. package/cjs/src/utils/processData.js +8 -8
  59. package/cjs/src/utils/processData.js.map +1 -1
  60. package/cjs/src/utils/processData.spec.js.map +1 -1
  61. package/dist/{index-DvNA626T.js → index-CjbriUI0.js} +1 -1
  62. package/dist/src/css-variables.d.ts +0 -48
  63. package/dist/src/css-variables.d.ts.map +1 -1
  64. package/dist/src/embed/app.d.ts +20 -0
  65. package/dist/src/embed/app.d.ts.map +1 -1
  66. package/dist/src/embed/bodyless-conversation.d.ts +1 -1
  67. package/dist/src/embed/conversation.d.ts +16 -0
  68. package/dist/src/embed/conversation.d.ts.map +1 -1
  69. package/dist/src/embed/hostEventClient/contracts.d.ts +1 -11
  70. package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  71. package/dist/src/embed/liveboard.d.ts.map +1 -1
  72. package/dist/src/embed/sage.d.ts +4 -4
  73. package/dist/src/embed/search.d.ts.map +1 -1
  74. package/dist/src/embed/ts-embed.d.ts +0 -2
  75. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  76. package/dist/src/index.d.ts +2 -2
  77. package/dist/src/index.d.ts.map +1 -1
  78. package/dist/src/react/all-types-export.d.ts +1 -1
  79. package/dist/src/react/all-types-export.d.ts.map +1 -1
  80. package/dist/src/react/util.d.ts +1 -0
  81. package/dist/src/react/util.d.ts.map +1 -1
  82. package/dist/src/types.d.ts +58 -93
  83. package/dist/src/types.d.ts.map +1 -1
  84. package/dist/src/utils/custom-actions.d.ts.map +1 -1
  85. package/dist/src/utils/processData.d.ts +1 -1
  86. package/dist/src/utils/processData.d.ts.map +1 -1
  87. package/dist/tsembed-react.es.js +84 -219
  88. package/dist/tsembed-react.js +228 -439
  89. package/dist/tsembed.es.js +85 -220
  90. package/dist/tsembed.js +228 -439
  91. package/dist/visual-embed-sdk-react-full.d.ts +104 -160
  92. package/dist/visual-embed-sdk-react.d.ts +95 -155
  93. package/dist/visual-embed-sdk.d.ts +95 -158
  94. package/lib/package.json +3 -2
  95. package/lib/src/css-variables.d.ts +0 -48
  96. package/lib/src/css-variables.d.ts.map +1 -1
  97. package/lib/src/embed/app.d.ts +20 -0
  98. package/lib/src/embed/app.d.ts.map +1 -1
  99. package/lib/src/embed/app.js +9 -4
  100. package/lib/src/embed/app.js.map +1 -1
  101. package/lib/src/embed/app.spec.js +62 -0
  102. package/lib/src/embed/app.spec.js.map +1 -1
  103. package/lib/src/embed/bodyless-conversation.d.ts +1 -1
  104. package/lib/src/embed/conversation.d.ts +16 -0
  105. package/lib/src/embed/conversation.d.ts.map +1 -1
  106. package/lib/src/embed/conversation.js +5 -2
  107. package/lib/src/embed/conversation.js.map +1 -1
  108. package/lib/src/embed/conversation.spec.js +25 -1
  109. package/lib/src/embed/conversation.spec.js.map +1 -1
  110. package/lib/src/embed/hostEventClient/contracts.d.ts +1 -11
  111. package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  112. package/lib/src/embed/hostEventClient/contracts.js +0 -1
  113. package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
  114. package/lib/src/embed/liveboard.d.ts.map +1 -1
  115. package/lib/src/embed/liveboard.js +5 -1
  116. package/lib/src/embed/liveboard.js.map +1 -1
  117. package/lib/src/embed/liveboard.spec.js +47 -1
  118. package/lib/src/embed/liveboard.spec.js.map +1 -1
  119. package/lib/src/embed/sage.d.ts +4 -4
  120. package/lib/src/embed/search.d.ts.map +1 -1
  121. package/lib/src/embed/search.js +1 -3
  122. package/lib/src/embed/search.js.map +1 -1
  123. package/lib/src/embed/ts-embed.d.ts +0 -2
  124. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  125. package/lib/src/embed/ts-embed.js +14 -42
  126. package/lib/src/embed/ts-embed.js.map +1 -1
  127. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  128. package/lib/src/errors.js +1 -1
  129. package/lib/src/errors.js.map +1 -1
  130. package/lib/src/index.d.ts +2 -2
  131. package/lib/src/index.d.ts.map +1 -1
  132. package/lib/src/index.js +2 -2
  133. package/lib/src/index.js.map +1 -1
  134. package/lib/src/react/all-types-export.d.ts +1 -1
  135. package/lib/src/react/all-types-export.d.ts.map +1 -1
  136. package/lib/src/react/all-types-export.js +1 -1
  137. package/lib/src/react/all-types-export.js.map +1 -1
  138. package/lib/src/react/util.d.ts +1 -0
  139. package/lib/src/react/util.d.ts.map +1 -1
  140. package/lib/src/types.d.ts +58 -93
  141. package/lib/src/types.d.ts.map +1 -1
  142. package/lib/src/types.js +20 -45
  143. package/lib/src/types.js.map +1 -1
  144. package/lib/src/utils/custom-actions.d.ts.map +1 -1
  145. package/lib/src/utils/custom-actions.js +9 -0
  146. package/lib/src/utils/custom-actions.js.map +1 -1
  147. package/lib/src/utils/custom-actions.spec.js +20 -0
  148. package/lib/src/utils/custom-actions.spec.js.map +1 -1
  149. package/lib/src/utils/processData.d.ts +1 -1
  150. package/lib/src/utils/processData.d.ts.map +1 -1
  151. package/lib/src/utils/processData.js +8 -8
  152. package/lib/src/utils/processData.js.map +1 -1
  153. package/lib/src/utils/processData.spec.js.map +1 -1
  154. package/package.json +3 -2
  155. package/src/css-variables.ts +0 -58
  156. package/src/embed/app.spec.ts +87 -0
  157. package/src/embed/app.ts +35 -4
  158. package/src/embed/bodyless-conversation.ts +1 -1
  159. package/src/embed/conversation.spec.ts +35 -1
  160. package/src/embed/conversation.ts +22 -0
  161. package/src/embed/hostEventClient/contracts.ts +0 -10
  162. package/src/embed/liveboard.spec.ts +60 -0
  163. package/src/embed/liveboard.ts +9 -0
  164. package/src/embed/sage.ts +4 -4
  165. package/src/embed/search.ts +1 -3
  166. package/src/embed/ts-embed.spec.ts +7 -7
  167. package/src/embed/ts-embed.ts +31 -67
  168. package/src/errors.ts +1 -1
  169. package/src/index.ts +0 -2
  170. package/src/react/all-types-export.ts +2 -1
  171. package/src/types.ts +56 -94
  172. package/src/utils/custom-actions.spec.ts +22 -0
  173. package/src/utils/custom-actions.ts +11 -0
  174. package/src/utils/processData.spec.ts +1 -0
  175. package/src/utils/processData.ts +11 -11
  176. package/cjs/src/api-intercept.d.ts +0 -31
  177. package/cjs/src/api-intercept.d.ts.map +0 -1
  178. package/cjs/src/api-intercept.js +0 -117
  179. package/cjs/src/api-intercept.js.map +0 -1
  180. package/cjs/src/api-intercept.spec.d.ts +0 -2
  181. package/cjs/src/api-intercept.spec.d.ts.map +0 -1
  182. package/cjs/src/api-intercept.spec.js +0 -122
  183. package/cjs/src/api-intercept.spec.js.map +0 -1
  184. package/dist/index-BCC3Z072.js +0 -7371
  185. package/dist/index-BEzW4MDA.js +0 -7371
  186. package/dist/index-BaESA9rq.js +0 -7371
  187. package/dist/index-CFNZIcKr.js +0 -7447
  188. package/dist/index-DFnPKcjZ.js +0 -7447
  189. package/dist/index-DhFH7b7U.js +0 -7447
  190. package/dist/src/api-intercept.d.ts +0 -31
  191. package/dist/src/api-intercept.d.ts.map +0 -1
  192. package/dist/src/api-intercept.spec.d.ts +0 -2
  193. package/dist/src/api-intercept.spec.d.ts.map +0 -1
  194. package/lib/src/api-intercept.d.ts +0 -31
  195. package/lib/src/api-intercept.d.ts.map +0 -1
  196. package/lib/src/api-intercept.js +0 -110
  197. package/lib/src/api-intercept.js.map +0 -1
  198. package/lib/src/api-intercept.spec.d.ts +0 -2
  199. package/lib/src/api-intercept.spec.d.ts.map +0 -1
  200. package/lib/src/api-intercept.spec.js +0 -119
  201. package/lib/src/api-intercept.spec.js.map +0 -1
  202. package/src/api-intercept.ts +0 -136
package/dist/tsembed.js CHANGED
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.42.1-alpha.6 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.42.2 */
2
2
  'use client';
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
@@ -32,7 +32,7 @@
32
32
  }
33
33
  return false;
34
34
  };
35
- const merge$1 = (...objects) => objects.reduce((result, current) => {
35
+ const merge = (...objects) => objects.reduce((result, current) => {
36
36
  if (Array.isArray(current)) {
37
37
  throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");
38
38
  }
@@ -41,19 +41,19 @@
41
41
  return;
42
42
  }
43
43
  if (Array.isArray(result[key]) && Array.isArray(current[key])) {
44
- result[key] = merge$1.options.mergeArrays
45
- ? merge$1.options.uniqueArrayItems
44
+ result[key] = merge.options.mergeArrays
45
+ ? merge.options.uniqueArrayItems
46
46
  ? Array.from(new Set(result[key].concat(current[key])))
47
47
  : [...result[key], ...current[key]]
48
48
  : current[key];
49
49
  }
50
50
  else if (isObject$1(result[key]) && isObject$1(current[key])) {
51
- result[key] = merge$1(result[key], current[key]);
51
+ result[key] = merge(result[key], current[key]);
52
52
  }
53
53
  else {
54
54
  result[key] =
55
55
  current[key] === undefined
56
- ? merge$1.options.allowUndefinedOverrides
56
+ ? merge.options.allowUndefinedOverrides
57
57
  ? current[key]
58
58
  : result[key]
59
59
  : current[key];
@@ -66,11 +66,11 @@
66
66
  mergeArrays: true,
67
67
  uniqueArrayItems: true,
68
68
  };
69
- merge$1.options = defaultOptions;
70
- merge$1.withOptions = (options, ...objects) => {
71
- merge$1.options = Object.assign(Object.assign({}, defaultOptions), options);
72
- const result = merge$1(...objects);
73
- merge$1.options = defaultOptions;
69
+ merge.options = defaultOptions;
70
+ merge.withOptions = (options, ...objects) => {
71
+ merge.options = Object.assign(Object.assign({}, defaultOptions), options);
72
+ const result = merge(...objects);
73
+ merge.options = defaultOptions;
74
74
  return result;
75
75
  };
76
76
 
@@ -271,7 +271,7 @@
271
271
  function getDOMNode(domSelector) {
272
272
  return typeof domSelector === 'string' ? document.querySelector(domSelector) : domSelector;
273
273
  }
274
- const deepMerge = (target, source) => merge$1(target, source);
274
+ const deepMerge = (target, source) => merge(target, source);
275
275
  const getOperationNameFromQuery = (query) => {
276
276
  const regex = /(?:query|mutation)\s+(\w+)/;
277
277
  const matches = query.match(regex);
@@ -1859,7 +1859,7 @@
1859
1859
  * the table visualization.
1860
1860
  *
1861
1861
  * If the Row-Level Security (RLS) rules are applied on the
1862
- * Worksheet or Model, exercise caution when changing column
1862
+ * Model, exercise caution when changing column
1863
1863
  * or table cell values to maintain data security.
1864
1864
  *
1865
1865
  * @example
@@ -1917,7 +1917,7 @@
1917
1917
  */
1918
1918
  EmbedEvent["SpotterData"] = "SpotterData";
1919
1919
  /**
1920
- * Emitted when user opens up the worksheet preview modal in Spotter embed.
1920
+ * Emitted when user opens up the data source preview modal in Spotter embed.
1921
1921
  * @example
1922
1922
  * ```js
1923
1923
  * spotterEmbed.on(EmbedEvent.PreviewSpotterData, (payload) => {
@@ -2005,21 +2005,6 @@
2005
2005
  * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
2006
2006
  */
2007
2007
  EmbedEvent["OrgSwitched"] = "orgSwitched";
2008
- /**
2009
- * Emitted when the user intercepts a URL.
2010
- *
2011
- * Supported on all embed types.
2012
- *
2013
- * @example
2014
- * ```js
2015
- * embed.on(EmbedEvent.ApiIntercept, (payload) => {
2016
- * console.log('payload', payload);
2017
- * })
2018
- * ```
2019
- *
2020
- * @version SDK: 1.42.0 | ThoughtSpot: 10.14.0.cl
2021
- */
2022
- EmbedEvent["ApiIntercept"] = "ApiIntercept";
2023
2008
  })(exports.EmbedEvent || (exports.EmbedEvent = {}));
2024
2009
  /**
2025
2010
  * Event types that can be triggered by the host application
@@ -2158,9 +2143,7 @@
2158
2143
  */
2159
2144
  HostEvent["Reload"] = "reload";
2160
2145
  /**
2161
- * Get iframe URL for the current embed view on the playground.
2162
- * Developers can use this URL to embed a ThoughtSpot object
2163
- * in apps like Salesforce or Sharepoint.
2146
+ * Get iframe URL for the current embed view.
2164
2147
  * @example
2165
2148
  * ```js
2166
2149
  * const url = embed.trigger(HostEvent.GetIframeUrl);
@@ -3232,7 +3215,7 @@
3232
3215
  */
3233
3216
  HostEvent["EditLastPrompt"] = "EditLastPrompt";
3234
3217
  /**
3235
- * Opens the Worksheet preview modal in Spotter Embed.
3218
+ * Opens the data source preview modal in Spotter Embed.
3236
3219
  * @example
3237
3220
  * ```js
3238
3221
  * spotterEmbed.trigger(HostEvent.PreviewSpotterData);
@@ -3357,6 +3340,7 @@
3357
3340
  Param["HideResult"] = "hideResult";
3358
3341
  Param["UseLastSelectedDataSource"] = "useLastSelectedSources";
3359
3342
  Param["Tag"] = "tag";
3343
+ Param["HideTagFilterChips"] = "hideTagFilterChips";
3360
3344
  Param["AutoLogin"] = "autoLogin";
3361
3345
  Param["searchTokenString"] = "searchTokenString";
3362
3346
  Param["executeSearch"] = "executeSearch";
@@ -3445,6 +3429,7 @@
3445
3429
  Param["ShowLiveboardReverifyBanner"] = "showLiveboardReverifyBanner";
3446
3430
  Param["LiveboardHeaderV2"] = "isLiveboardHeaderV2Enabled";
3447
3431
  Param["HideIrrelevantFiltersInTab"] = "hideIrrelevantFiltersAtTabLevel";
3432
+ Param["IsEnhancedFilterInteractivityEnabled"] = "isLiveboardPermissionV2Enabled";
3448
3433
  Param["SpotterEnabled"] = "isSpotterExperienceEnabled";
3449
3434
  Param["IsUnifiedSearchExperienceEnabled"] = "isUnifiedSearchExperienceEnabled";
3450
3435
  Param["OverrideOrgId"] = "orgId";
@@ -3461,7 +3446,9 @@
3461
3446
  Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
3462
3447
  Param["LiveboardXLSXCSVDownload"] = "isLiveboardXLSXCSVDownloadEnabled";
3463
3448
  Param["isPNGInScheduledEmailsEnabled"] = "isPNGInScheduledEmailsEnabled";
3449
+ Param["isCentralizedLiveboardFilterUXEnabled"] = "isCentralizedLiveboardFilterUXEnabled";
3464
3450
  Param["isLinkParametersEnabled"] = "isLinkParametersEnabled";
3451
+ Param["EnablePastConversationsSidebar"] = "enablePastConversationsSidebar";
3465
3452
  })(Param || (Param = {}));
3466
3453
  /**
3467
3454
  * ThoughtSpot application pages include actions and menu commands
@@ -3574,7 +3561,7 @@
3574
3561
  */
3575
3562
  Action["SchedulesList"] = "schedule-list";
3576
3563
  /**
3577
- * The **Share** action on a Liveboard, Answer, or Worksheet.
3564
+ * The **Share** action on a Liveboard, Answer, or Model.
3578
3565
  * Allows users to share an object with other users and groups.
3579
3566
  * @example
3580
3567
  * ```js
@@ -4032,7 +4019,7 @@
4032
4019
  Action["AnswerChartSwitcher"] = "answerChartSwitcher";
4033
4020
  /**
4034
4021
  * The Favorites icon (*) for Answers,
4035
- * Liveboard, and data objects like Worksheet, Model,
4022
+ * Liveboard, and data objects like Model,
4036
4023
  * Tables and Views.
4037
4024
  * Allows adding an object to the user's favorites list.
4038
4025
  * @example
@@ -4766,6 +4753,16 @@
4766
4753
  * @version SDK: 1.42.0 | ThoughtSpot Cloud: 10.14.0.cl
4767
4754
  */
4768
4755
  Action["RemoveAttachment"] = "removeAttachment";
4756
+ /**
4757
+ * The **Style panel** on a Liveboard.
4758
+ * Controls the visibility of the Liveboard style panel.
4759
+ * @example
4760
+ * ```js
4761
+ * hiddenActions: [Action.LiveboardStylePanel]
4762
+ * ```
4763
+ * @version SDK: 1.43.0 | ThoughtSpot Cloud: 10.15.0.cl
4764
+ */
4765
+ Action["LiveboardStylePanel"] = "liveboardStylePanel";
4769
4766
  })(exports.Action || (exports.Action = {}));
4770
4767
  exports.PrefetchFeatures = void 0;
4771
4768
  (function (PrefetchFeatures) {
@@ -4887,29 +4884,7 @@
4887
4884
  * @version SDK: 1.26.7 | ThoughtSpot Cloud: 9.10.0.cl
4888
4885
  */
4889
4886
  LogLevel["TRACE"] = "TRACE";
4890
- })(exports.LogLevel || (exports.LogLevel = {}));
4891
- /**
4892
- * Enum for the type of API intercepted
4893
- */
4894
- exports.InterceptedApiType = void 0;
4895
- (function (InterceptedApiType) {
4896
- /**
4897
- * The apis that are use to get the metadata for the embed
4898
- */
4899
- InterceptedApiType["METADATA"] = "METADATA";
4900
- /**
4901
- * The apis that are use to get the data for the embed
4902
- */
4903
- InterceptedApiType["ANSWER_DATA"] = "ANSWER_DATA";
4904
- /**
4905
- * This will intercept all the apis
4906
- */
4907
- InterceptedApiType["ALL"] = "ALL";
4908
- /**
4909
- * The apis that are use to get the data for the liveboard
4910
- */
4911
- InterceptedApiType["LIVEBOARD_DATA"] = "LIVEBOARD_DATA";
4912
- })(exports.InterceptedApiType || (exports.InterceptedApiType = {}));
4887
+ })(exports.LogLevel || (exports.LogLevel = {}));
4913
4888
 
4914
4889
  const logFunctions = {
4915
4890
  [exports.LogLevel.SILENT]: () => undefined,
@@ -7255,20 +7230,9 @@
7255
7230
 
7256
7231
  var isEmpty_1 = isEmpty$1;
7257
7232
 
7258
- exports.UIPassthroughEvent = void 0;
7259
- (function (UIPassthroughEvent) {
7260
- UIPassthroughEvent["PinAnswerToLiveboard"] = "addVizToPinboard";
7261
- UIPassthroughEvent["SaveAnswer"] = "saveAnswer";
7262
- UIPassthroughEvent["GetDiscoverabilityStatus"] = "getDiscoverabilityStatus";
7263
- UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUiPassthroughs";
7264
- UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
7265
- UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
7266
- UIPassthroughEvent["GetUnsavedAnswerTML"] = "getUnsavedAnswerTML";
7267
- })(exports.UIPassthroughEvent || (exports.UIPassthroughEvent = {}));
7268
-
7269
7233
  const ERROR_MESSAGE = {
7270
7234
  INVALID_THOUGHTSPOT_HOST: 'Error parsing ThoughtSpot host. Please provide a valid URL.',
7271
- SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND: 'Please select a worksheet to get started',
7235
+ SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND: 'Please select a Model to get started',
7272
7236
  LIVEBOARD_VIZ_ID_VALIDATION: 'Please select a Liveboard to embed.',
7273
7237
  TRIGGER_TIMED_OUT: 'Trigger timed-out in getting a response',
7274
7238
  SEARCHEMBED_BETA_WRANING_MESSAGE: 'SearchEmbed is in Beta in this release.',
@@ -9718,6 +9682,14 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
9718
9682
  finalValidActions.push(action);
9719
9683
  }
9720
9684
  });
9685
+ // Step 4: Collect warnings for long custom action names
9686
+ const MAX_ACTION_NAME_LENGTH = 30;
9687
+ const warnings = finalValidActions
9688
+ .filter(action => action.name.length > MAX_ACTION_NAME_LENGTH)
9689
+ .map(action => `Custom action name '${action.name}' exceeds ${MAX_ACTION_NAME_LENGTH} characters. This may cause display or truncation issues in the UI.`);
9690
+ if (warnings.length > 0) {
9691
+ logger$3.warn(warnings);
9692
+ }
9721
9693
  const sortedActions = sortBy_1(finalValidActions, (a) => a.name.toLocaleLowerCase());
9722
9694
  return {
9723
9695
  actions: sortedActions,
@@ -17516,27 +17488,27 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17516
17488
  * @param thoughtSpotHost
17517
17489
  * @param containerEl
17518
17490
  */
17519
- function processEventData(type, eventData, thoughtSpotHost, containerEl) {
17491
+ function processEventData(type, e, thoughtSpotHost, containerEl) {
17520
17492
  switch (type) {
17521
17493
  case exports.EmbedEvent.CustomAction:
17522
- return processCustomAction(eventData, thoughtSpotHost);
17494
+ return processCustomAction(e, thoughtSpotHost);
17523
17495
  case exports.EmbedEvent.AuthInit:
17524
- return processAuthInit(eventData);
17496
+ return processAuthInit(e);
17525
17497
  case exports.EmbedEvent.NoCookieAccess:
17526
- return processNoCookieAccess(eventData, containerEl);
17498
+ return processNoCookieAccess(e, containerEl);
17527
17499
  case exports.EmbedEvent.AuthFailure:
17528
- return processAuthFailure(eventData, containerEl);
17500
+ return processAuthFailure(e, containerEl);
17529
17501
  case exports.EmbedEvent.AuthLogout:
17530
- return processAuthLogout(eventData, containerEl);
17502
+ return processAuthLogout(e, containerEl);
17531
17503
  case exports.EmbedEvent.ExitPresentMode:
17532
17504
  return processExitPresentMode();
17533
17505
  case exports.EmbedEvent.CLEAR_INFO_CACHE:
17534
17506
  return processClearInfoCache();
17535
17507
  }
17536
- return eventData;
17508
+ return e;
17537
17509
  }
17538
17510
 
17539
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.1-alpha.6";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 tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run 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/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports$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};
17511
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.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 tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^11.2.0","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports$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};
17540
17512
 
17541
17513
  /**
17542
17514
  * Reloads the ThoughtSpot iframe.
@@ -17608,6 +17580,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17608
17580
  });
17609
17581
  }
17610
17582
 
17583
+ exports.UIPassthroughEvent = void 0;
17584
+ (function (UIPassthroughEvent) {
17585
+ UIPassthroughEvent["PinAnswerToLiveboard"] = "addVizToPinboard";
17586
+ UIPassthroughEvent["SaveAnswer"] = "saveAnswer";
17587
+ UIPassthroughEvent["GetDiscoverabilityStatus"] = "getDiscoverabilityStatus";
17588
+ UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUiPassthroughs";
17589
+ UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
17590
+ UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
17591
+ })(exports.UIPassthroughEvent || (exports.UIPassthroughEvent = {}));
17592
+
17611
17593
  class HostEventClient {
17612
17594
  constructor(iFrame) {
17613
17595
  this.iFrame = iFrame;
@@ -17699,109 +17681,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17699
17681
  }
17700
17682
  }
17701
17683
 
17702
- const defaultUrls = {
17703
- [exports.InterceptedApiType.METADATA]: [
17704
- '/prism/?op=CreateAnswerSession',
17705
- '/prism/?op=GetV2SourceDetail',
17706
- ],
17707
- [exports.InterceptedApiType.ANSWER_DATA]: [
17708
- '/prism/?op=GetChartWithData',
17709
- '/prism/?op=GetTableWithHeadlineData',
17710
- ],
17711
- [exports.InterceptedApiType.LIVEBOARD_DATA]: [
17712
- '/prism/?op=LoadContextBook'
17713
- ],
17714
- };
17715
- const formatInterceptUrl = (url) => {
17716
- const host = getThoughtSpotHost(getEmbedConfig());
17717
- if (url.startsWith('/'))
17718
- return `${host}${url}`;
17719
- return url;
17720
- };
17721
- const processInterceptUrls = (interceptUrls) => {
17722
- let processedUrls = [...interceptUrls];
17723
- Object.entries(defaultUrls).forEach(([apiType, apiTypeUrls]) => {
17724
- if (!processedUrls.includes(apiType))
17725
- return;
17726
- processedUrls = processedUrls.filter(url => url !== apiType);
17727
- processedUrls = [...processedUrls, ...apiTypeUrls];
17728
- });
17729
- return processedUrls.map(url => formatInterceptUrl(url));
17730
- };
17731
- const getInterceptInitData = (embedConfig, viewConfig) => {
17732
- const enableApiIntercept = (embedConfig.enableApiIntercept || viewConfig.enableApiIntercept) && (viewConfig.enableApiIntercept !== false);
17733
- if (!enableApiIntercept)
17734
- return {
17735
- enableApiIntercept: false,
17736
- };
17737
- const combinedUrls = [...(embedConfig.interceptUrls || []), ...(viewConfig.interceptUrls || [])];
17738
- if (viewConfig.isOnBeforeGetVizDataInterceptEnabled) {
17739
- combinedUrls.push(exports.InterceptedApiType.ANSWER_DATA);
17740
- }
17741
- const shouldInterceptAll = combinedUrls.includes(exports.InterceptedApiType.ALL);
17742
- const interceptUrls = shouldInterceptAll ? [exports.InterceptedApiType.ALL] : processInterceptUrls(combinedUrls);
17743
- const interceptTimeout = embedConfig.interceptTimeout || viewConfig.interceptTimeout;
17744
- return {
17745
- interceptUrls,
17746
- interceptTimeout,
17747
- enableApiIntercept,
17748
- };
17749
- };
17750
- /**
17751
- *
17752
- * @param fetchInit
17753
- */
17754
- const parseInterceptData = (eventDataString) => {
17755
- try {
17756
- const { input, init } = JSON.parse(eventDataString);
17757
- init.body = JSON.parse(init.body);
17758
- const parsedInit = { input, init };
17759
- return [parsedInit, null];
17760
- }
17761
- catch (error) {
17762
- return [null, error];
17763
- }
17764
- };
17765
- const handleInterceptEvent = async (params) => {
17766
- var _a, _b, _c, _d, _e;
17767
- const { eventData, executeEvent, viewConfig, getUnsavedAnswerTml } = params;
17768
- const [interceptData, bodyParseError] = parseInterceptData(eventData.data);
17769
- if (bodyParseError) {
17770
- executeEvent(exports.EmbedEvent.Error, {
17771
- error: 'Error parsing api intercept body',
17772
- });
17773
- logger$3.error('Error parsing request body', bodyParseError);
17774
- return;
17775
- }
17776
- const { input: requestUrl, init } = interceptData;
17777
- const sessionId = (_c = (_b = (_a = init === null || init === void 0 ? void 0 : init.body) === null || _a === void 0 ? void 0 : _a.variables) === null || _b === void 0 ? void 0 : _b.session) === null || _c === void 0 ? void 0 : _c.sessionId;
17778
- const vizId = (_e = (_d = init === null || init === void 0 ? void 0 : init.body) === null || _d === void 0 ? void 0 : _d.variables) === null || _e === void 0 ? void 0 : _e.contextBookId;
17779
- if (defaultUrls.ANSWER_DATA.includes(requestUrl) && viewConfig.isOnBeforeGetVizDataInterceptEnabled) {
17780
- const answerTml = await getUnsavedAnswerTml({ sessionId, vizId });
17781
- executeEvent(exports.EmbedEvent.OnBeforeGetVizDataIntercept, { data: { data: answerTml } });
17782
- }
17783
- executeEvent(exports.EmbedEvent.ApiIntercept, interceptData);
17784
- };
17785
- const processLegacyInterceptResponse = (payload) => {
17786
- var _a, _b, _c;
17787
- const payloadToSend = {
17788
- execute: (_a = payload === null || payload === void 0 ? void 0 : payload.data) === null || _a === void 0 ? void 0 : _a.execute,
17789
- response: {
17790
- body: {
17791
- errors: [
17792
- {
17793
- title: (_b = payload === null || payload === void 0 ? void 0 : payload.data) === null || _b === void 0 ? void 0 : _b.errorText,
17794
- message: (_c = payload === null || payload === void 0 ? void 0 : payload.data) === null || _c === void 0 ? void 0 : _c.errorDescription,
17795
- isUserError: true,
17796
- },
17797
- ],
17798
- data: {},
17799
- },
17800
- },
17801
- };
17802
- return { data: payloadToSend };
17803
- };
17804
-
17805
17684
  /**
17806
17685
  * Copyright (c) 2022
17807
17686
  *
@@ -17855,27 +17734,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17855
17734
  */
17856
17735
  this.fullscreenChangeHandler = null;
17857
17736
  this.subscribedListeners = {};
17858
- this.messageEventListener = async (event) => {
17859
- const eventType = this.getEventType(event);
17860
- const eventPort = this.getEventPort(event);
17861
- const eventData = this.formatEventData(event, eventType);
17862
- if (event.source === this.iFrame.contentWindow) {
17863
- const processedEventData = await processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el);
17864
- const executeEvent = (_eventType, data) => {
17865
- this.executeCallbacks(_eventType, data, eventPort);
17866
- };
17867
- if (eventType === exports.EmbedEvent.ApiIntercept && this.viewConfig.enableApiIntercept) {
17868
- const getUnsavedAnswerTml = async (props) => {
17869
- var _a;
17870
- const response = await this.triggerUIPassThrough(exports.UIPassthroughEvent.GetUnsavedAnswerTML, props);
17871
- return (_a = response[0]) === null || _a === void 0 ? void 0 : _a.value;
17872
- };
17873
- handleInterceptEvent({ eventData: processedEventData, executeEvent, embedConfig: this.embedConfig, viewConfig: this.viewConfig, getUnsavedAnswerTml });
17874
- return;
17875
- }
17876
- this.executeCallbacks(eventType, processedEventData, eventPort);
17877
- }
17878
- };
17879
17737
  /**
17880
17738
  * Send Custom style as part of payload of APP_INIT
17881
17739
  * @param _
@@ -17960,18 +17818,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17960
17818
  this.on(exports.EmbedEvent.AuthInit, authInitHandler, { start: false }, true);
17961
17819
  };
17962
17820
  this.showPreRenderByDefault = false;
17963
- this.createEmbedEventResponder = (eventPort, eventType) => {
17964
- const { enableApiIntercept } = getInterceptInitData(this.embedConfig, this.viewConfig);
17965
- if (eventType === exports.EmbedEvent.OnBeforeGetVizDataIntercept && enableApiIntercept) {
17966
- return (payload) => {
17967
- const payloadToSend = processLegacyInterceptResponse(payload);
17968
- this.triggerEventOnPort(eventPort, payloadToSend);
17969
- };
17970
- }
17971
- return (payload) => {
17972
- this.triggerEventOnPort(eventPort, payload);
17973
- };
17974
- };
17975
17821
  /**
17976
17822
  * @hidden
17977
17823
  * Internal state to track if the embed container is loaded.
@@ -18157,8 +18003,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
18157
18003
  */
18158
18004
  subscribeToMessageEvents() {
18159
18005
  this.unsubscribeToMessageEvents();
18160
- window.addEventListener('message', this.messageEventListener);
18161
- this.subscribedListeners.message = this.messageEventListener;
18006
+ const messageEventListener = (event) => {
18007
+ const eventType = this.getEventType(event);
18008
+ const eventPort = this.getEventPort(event);
18009
+ const eventData = this.formatEventData(event, eventType);
18010
+ if (event.source === this.iFrame.contentWindow) {
18011
+ this.executeCallbacks(eventType, processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el), eventPort);
18012
+ }
18013
+ };
18014
+ window.addEventListener('message', messageEventListener);
18015
+ this.subscribedListeners.message = messageEventListener;
18162
18016
  }
18163
18017
  /**
18164
18018
  * Adds event listeners for both network and message events.
@@ -18219,7 +18073,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
18219
18073
  message: customActionsResult.errors,
18220
18074
  });
18221
18075
  }
18222
- const baseInitData = {
18076
+ return {
18223
18077
  customisations: getCustomisations(this.embedConfig, this.viewConfig),
18224
18078
  authToken,
18225
18079
  runtimeFilterParams: this.viewConfig.excludeRuntimeFiltersfromURL
@@ -18237,9 +18091,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
18237
18091
  customVariablesForThirdPartyTools: this.embedConfig.customVariablesForThirdPartyTools || {},
18238
18092
  hiddenListColumns: this.viewConfig.hiddenListColumns || [],
18239
18093
  customActions: customActionsResult.actions,
18240
- ...getInterceptInitData(this.embedConfig, this.viewConfig),
18241
18094
  };
18242
- return baseInitData;
18243
18095
  }
18244
18096
  async getAppInitData() {
18245
18097
  return this.getDefaultAppInitData();
@@ -18668,8 +18520,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
18668
18520
  // When start status is false it trigger only end releated
18669
18521
  // payload
18670
18522
  || (!callbackObj.options.start && dataStatus === embedEventStatus.END)) {
18671
- const responder = this.createEmbedEventResponder(eventPort, eventType);
18672
- callbackObj.callback(data, responder);
18523
+ callbackObj.callback(data, (payload) => {
18524
+ this.triggerEventOnPort(eventPort, payload);
18525
+ });
18673
18526
  }
18674
18527
  });
18675
18528
  }
@@ -19379,7 +19232,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
19379
19232
  * embedded Liveboard or visualization.
19380
19233
  */
19381
19234
  getEmbedParams() {
19382
- const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = exports.DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isLinkParametersEnabled, } = this.viewConfig;
19235
+ const { tag, hideTagFilterChips, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = exports.DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, isEnhancedFilterInteractivityEnabled = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, } = this.viewConfig;
19383
19236
  let params = {};
19384
19237
  params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
19385
19238
  params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
@@ -19391,6 +19244,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
19391
19244
  params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
19392
19245
  params[Param.IsFullAppEmbed] = true;
19393
19246
  params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
19247
+ params[Param.IsEnhancedFilterInteractivityEnabled] = isEnhancedFilterInteractivityEnabled;
19394
19248
  params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
19395
19249
  params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
19396
19250
  params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
@@ -19432,8 +19286,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
19432
19286
  if (enableAskSage) {
19433
19287
  params[Param.enableAskSage] = enableAskSage;
19434
19288
  }
19435
- const { enableApiIntercept } = getInterceptInitData(this.embedConfig, this.viewConfig);
19436
- if (isOnBeforeGetVizDataInterceptEnabled && !enableApiIntercept) {
19289
+ if (isOnBeforeGetVizDataInterceptEnabled) {
19437
19290
  params[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
19438
19291
  }
19439
19292
  if (homePageSearchBarMode) {
@@ -19448,9 +19301,15 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
19448
19301
  if (isPNGInScheduledEmailsEnabled !== undefined) {
19449
19302
  params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
19450
19303
  }
19304
+ if (hideTagFilterChips !== undefined) {
19305
+ params[Param.HideTagFilterChips] = hideTagFilterChips;
19306
+ }
19451
19307
  if (isLinkParametersEnabled !== undefined) {
19452
19308
  params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
19453
19309
  }
19310
+ if (isCentralizedLiveboardFilterUXEnabled != undefined) {
19311
+ params[Param.isCentralizedLiveboardFilterUXEnabled] = isCentralizedLiveboardFilterUXEnabled;
19312
+ }
19454
19313
  params[Param.DataPanelV2Enabled] = dataPanelV2;
19455
19314
  params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
19456
19315
  params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
@@ -19805,7 +19664,7 @@ query GetEurekaVizSnapshots(
19805
19664
  getEmbedParamsObject() {
19806
19665
  let params = {};
19807
19666
  params = this.getBaseQueryParams(params);
19808
- const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, showSpotterLimitations, isLinkParametersEnabled, } = this.viewConfig;
19667
+ const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, isEnhancedFilterInteractivityEnabled = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, showSpotterLimitations, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, } = this.viewConfig;
19809
19668
  const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
19810
19669
  || this.viewConfig.preventPinboardFilterRemoval;
19811
19670
  if (fullHeight === true) {
@@ -19873,11 +19732,15 @@ query GetEurekaVizSnapshots(
19873
19732
  if (isLinkParametersEnabled !== undefined) {
19874
19733
  params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
19875
19734
  }
19735
+ if (isCentralizedLiveboardFilterUXEnabled !== undefined) {
19736
+ params[Param.isCentralizedLiveboardFilterUXEnabled] = isCentralizedLiveboardFilterUXEnabled;
19737
+ }
19876
19738
  params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
19877
19739
  params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
19878
19740
  params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
19879
19741
  params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
19880
19742
  params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
19743
+ params[Param.IsEnhancedFilterInteractivityEnabled] = isEnhancedFilterInteractivityEnabled;
19881
19744
  params[Param.DataPanelV2Enabled] = dataPanelV2;
19882
19745
  params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
19883
19746
  params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
@@ -20159,8 +20022,7 @@ query GetEurekaVizSnapshots(
20159
20022
  if (hideSearchBar) {
20160
20023
  queryParams[Param.HideSearchBar] = true;
20161
20024
  }
20162
- const { enableApiIntercept } = getInterceptInitData(this.embedConfig, this.viewConfig);
20163
- if (isOnBeforeGetVizDataInterceptEnabled && !enableApiIntercept) {
20025
+ if (isOnBeforeGetVizDataInterceptEnabled) {
20164
20026
  queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
20165
20027
  }
20166
20028
  if (!focusSearchBarOnRender) {
@@ -20872,7 +20734,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
20872
20734
  this.viewConfig = viewConfig;
20873
20735
  }
20874
20736
  getEmbedParamsObject() {
20875
- const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
20737
+ const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, enablePastConversationsSidebar, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
20876
20738
  if (!worksheetId) {
20877
20739
  this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
20878
20740
  }
@@ -20896,9 +20758,12 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
20896
20758
  return queryParams;
20897
20759
  }
20898
20760
  getIframeSrc() {
20899
- const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
20761
+ const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, enablePastConversationsSidebar } = this.viewConfig;
20900
20762
  const path = 'insights/conv-assist';
20901
20763
  const queryParams = this.getEmbedParamsObject();
20764
+ if (!isUndefined_1(enablePastConversationsSidebar)) {
20765
+ queryParams[Param.EnablePastConversationsSidebar] = !!enablePastConversationsSidebar;
20766
+ }
20902
20767
  let query = '';
20903
20768
  const queryParamsString = getQueryParamString(queryParams, true);
20904
20769
  if (queryParamsString) {
@@ -22029,7 +21894,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22029
21894
  return {
22030
21895
  onAnchor: (source) => {
22031
21896
  aliasObjects.push(source);
22032
- prevAnchors ?? (prevAnchors = anchorNames(doc));
21897
+ if (!prevAnchors)
21898
+ prevAnchors = anchorNames(doc);
22033
21899
  const anchor = findNewAnchor(prefix, prevAnchors);
22034
21900
  prevAnchors.add(anchor);
22035
21901
  return anchor;
@@ -22193,36 +22059,23 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22193
22059
  * Resolve the value of this alias within `doc`, finding the last
22194
22060
  * instance of the `source` anchor before this node.
22195
22061
  */
22196
- resolve(doc, ctx) {
22197
- let nodes;
22198
- if (ctx?.aliasResolveCache) {
22199
- nodes = ctx.aliasResolveCache;
22200
- }
22201
- else {
22202
- nodes = [];
22203
- visit$1(doc, {
22204
- Node: (_key, node) => {
22205
- if (isAlias(node) || hasAnchor(node))
22206
- nodes.push(node);
22207
- }
22208
- });
22209
- if (ctx)
22210
- ctx.aliasResolveCache = nodes;
22211
- }
22062
+ resolve(doc) {
22212
22063
  let found = undefined;
22213
- for (const node of nodes) {
22214
- if (node === this)
22215
- break;
22216
- if (node.anchor === this.source)
22217
- found = node;
22218
- }
22064
+ visit$1(doc, {
22065
+ Node: (_key, node) => {
22066
+ if (node === this)
22067
+ return visit$1.BREAK;
22068
+ if (node.anchor === this.source)
22069
+ found = node;
22070
+ }
22071
+ });
22219
22072
  return found;
22220
22073
  }
22221
22074
  toJSON(_arg, ctx) {
22222
22075
  if (!ctx)
22223
22076
  return { source: this.source };
22224
22077
  const { anchors, doc, maxAliasCount } = ctx;
22225
- const source = this.resolve(doc, ctx);
22078
+ const source = this.resolve(doc);
22226
22079
  if (!source) {
22227
22080
  const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
22228
22081
  throw new ReferenceError(msg);
@@ -22341,7 +22194,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22341
22194
  if (aliasDuplicateObjects && value && typeof value === 'object') {
22342
22195
  ref = sourceObjects.get(value);
22343
22196
  if (ref) {
22344
- ref.anchor ?? (ref.anchor = onAnchor(value));
22197
+ if (!ref.anchor)
22198
+ ref.anchor = onAnchor(value);
22345
22199
  return new Alias(ref.anchor);
22346
22200
  }
22347
22201
  else {
@@ -22852,7 +22706,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22852
22706
  const { blockQuote, commentString, lineWidth } = ctx.options;
22853
22707
  // 1. Block can't end in whitespace unless the last line is non-empty.
22854
22708
  // 2. Strings consisting of only whitespace are best rendered explicitly.
22855
- if (!blockQuote || /\n[\t ]+$/.test(value)) {
22709
+ if (!blockQuote || /\n[\t ]+$/.test(value) || /^\s*$/.test(value)) {
22856
22710
  return quotedString(value, ctx);
22857
22711
  }
22858
22712
  const indent = ctx.indent ||
@@ -22912,32 +22766,23 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22912
22766
  start = start.replace(/\n+/g, `$&${indent}`);
22913
22767
  }
22914
22768
  const indentSize = indent ? '2' : '1'; // root is at -1
22915
- // Leading | or > is added later
22916
- let header = (startWithSpace ? indentSize : '') + chomp;
22769
+ let header = (literal ? '|' : '>') + (startWithSpace ? indentSize : '') + chomp;
22917
22770
  if (comment) {
22918
22771
  header += ' ' + commentString(comment.replace(/ ?[\r\n]+/g, ' '));
22919
22772
  if (onComment)
22920
22773
  onComment();
22921
22774
  }
22922
- if (!literal) {
22923
- const foldedValue = value
22924
- .replace(/\n+/g, '\n$&')
22925
- .replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
22926
- // ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
22927
- .replace(/\n+/g, `$&${indent}`);
22928
- let literalFallback = false;
22929
- const foldOptions = getFoldOptions(ctx, true);
22930
- if (blockQuote !== 'folded' && type !== Scalar.BLOCK_FOLDED) {
22931
- foldOptions.onOverflow = () => {
22932
- literalFallback = true;
22933
- };
22934
- }
22935
- const body = foldFlowLines(`${start}${foldedValue}${end}`, indent, FOLD_BLOCK, foldOptions);
22936
- if (!literalFallback)
22937
- return `>${header}\n${indent}${body}`;
22775
+ if (literal) {
22776
+ value = value.replace(/\n+/g, `$&${indent}`);
22777
+ return `${header}\n${indent}${start}${value}${end}`;
22938
22778
  }
22939
- value = value.replace(/\n+/g, `$&${indent}`);
22940
- return `|${header}\n${indent}${start}${value}${end}`;
22779
+ value = value
22780
+ .replace(/\n+/g, '\n$&')
22781
+ .replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
22782
+ // ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
22783
+ .replace(/\n+/g, `$&${indent}`);
22784
+ const body = foldFlowLines(`${start}${value}${end}`, indent, FOLD_BLOCK, getFoldOptions(ctx, true));
22785
+ return `${header}\n${indent}${body}`;
22941
22786
  }
22942
22787
  function plainString(item, ctx, onComment, onChompKeep) {
22943
22788
  const { type, value } = item;
@@ -22946,9 +22791,10 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22946
22791
  (inFlow && /[[\]{},]/.test(value))) {
22947
22792
  return quotedString(value, ctx);
22948
22793
  }
22949
- if (/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) {
22794
+ if (!value ||
22795
+ /^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) {
22950
22796
  // not allowed:
22951
- // - '-' or '?'
22797
+ // - empty string, '-' or '?'
22952
22798
  // - start with an indicator character (except [?:-]) or /[?-] /
22953
22799
  // - '\n ', ': ' or ' \n' anywhere
22954
22800
  // - '#' not preceded by a non-space char
@@ -23077,12 +22923,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
23077
22923
  let obj;
23078
22924
  if (isScalar$1(item)) {
23079
22925
  obj = item.value;
23080
- let match = tags.filter(t => t.identify?.(obj));
23081
- if (match.length > 1) {
23082
- const testMatch = match.filter(t => t.test);
23083
- if (testMatch.length > 0)
23084
- match = testMatch;
23085
- }
22926
+ const match = tags.filter(t => t.identify?.(obj));
23086
22927
  tagObj =
23087
22928
  match.find(t => t.format === item.format) ?? match.find(t => !t.format);
23088
22929
  }
@@ -23091,7 +22932,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
23091
22932
  tagObj = tags.find(t => t.nodeClass && obj instanceof t.nodeClass);
23092
22933
  }
23093
22934
  if (!tagObj) {
23094
- const name = obj?.constructor?.name ?? (obj === null ? 'null' : typeof obj);
22935
+ const name = obj?.constructor?.name ?? typeof obj;
23095
22936
  throw new Error(`Tag not resolved for ${name} value`);
23096
22937
  }
23097
22938
  return tagObj;
@@ -23106,7 +22947,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
23106
22947
  anchors.add(anchor);
23107
22948
  props.push(`&${anchor}`);
23108
22949
  }
23109
- const tag = node.tag ?? (tagObj.default ? null : tagObj.tag);
22950
+ const tag = node.tag ? node.tag : tagObj.default ? null : tagObj.tag;
23110
22951
  if (tag)
23111
22952
  props.push(doc.directives.tagString(tag));
23112
22953
  return props.join(' ');
@@ -23132,7 +22973,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
23132
22973
  const node = isNode(item)
23133
22974
  ? item
23134
22975
  : ctx.doc.createNode(item, { onTagObj: o => (tagObj = o) });
23135
- tagObj ?? (tagObj = getTagObject(ctx.doc.schema.tags, node));
22976
+ if (!tagObj)
22977
+ tagObj = getTagObject(ctx.doc.schema.tags, node);
23136
22978
  const props = stringifyProps(node, tagObj, ctx);
23137
22979
  if (props.length > 0)
23138
22980
  ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1;
@@ -23294,10 +23136,54 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
23294
23136
 
23295
23137
  function warn(logLevel, warning) {
23296
23138
  if (logLevel === 'debug' || logLevel === 'warn') {
23297
- console.warn(warning);
23139
+ if (typeof process !== 'undefined' && process.emitWarning)
23140
+ process.emitWarning(warning);
23141
+ else
23142
+ console.warn(warning);
23298
23143
  }
23299
23144
  }
23300
23145
 
23146
+ const MERGE_KEY = '<<';
23147
+ function addPairToJSMap(ctx, map, { key, value }) {
23148
+ if (ctx?.doc.schema.merge && isMergeKey(key)) {
23149
+ value = isAlias(value) ? value.resolve(ctx.doc) : value;
23150
+ if (isSeq(value))
23151
+ for (const it of value.items)
23152
+ mergeToJSMap(ctx, map, it);
23153
+ else if (Array.isArray(value))
23154
+ for (const it of value)
23155
+ mergeToJSMap(ctx, map, it);
23156
+ else
23157
+ mergeToJSMap(ctx, map, value);
23158
+ }
23159
+ else {
23160
+ const jsKey = toJS(key, '', ctx);
23161
+ if (map instanceof Map) {
23162
+ map.set(jsKey, toJS(value, jsKey, ctx));
23163
+ }
23164
+ else if (map instanceof Set) {
23165
+ map.add(jsKey);
23166
+ }
23167
+ else {
23168
+ const stringKey = stringifyKey(key, jsKey, ctx);
23169
+ const jsValue = toJS(value, stringKey, ctx);
23170
+ if (stringKey in map)
23171
+ Object.defineProperty(map, stringKey, {
23172
+ value: jsValue,
23173
+ writable: true,
23174
+ enumerable: true,
23175
+ configurable: true
23176
+ });
23177
+ else
23178
+ map[stringKey] = jsValue;
23179
+ }
23180
+ }
23181
+ return map;
23182
+ }
23183
+ const isMergeKey = (key) => key === MERGE_KEY ||
23184
+ (isScalar$1(key) &&
23185
+ key.value === MERGE_KEY &&
23186
+ (!key.type || key.type === Scalar.PLAIN));
23301
23187
  // If the value associated with a merge key is a single mapping node, each of
23302
23188
  // its key/value pairs is inserted into the current mapping, unless the key
23303
23189
  // already exists in it. If the value associated with the merge key is a
@@ -23305,35 +23191,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
23305
23191
  // of these nodes is merged in turn according to its order in the sequence.
23306
23192
  // Keys in mapping nodes earlier in the sequence override keys specified in
23307
23193
  // later mapping nodes. -- http://yaml.org/type/merge.html
23308
- const MERGE_KEY = '<<';
23309
- const merge = {
23310
- identify: value => value === MERGE_KEY ||
23311
- (typeof value === 'symbol' && value.description === MERGE_KEY),
23312
- default: 'key',
23313
- tag: 'tag:yaml.org,2002:merge',
23314
- test: /^<<$/,
23315
- resolve: () => Object.assign(new Scalar(Symbol(MERGE_KEY)), {
23316
- addToJSMap: addMergeToJSMap
23317
- }),
23318
- stringify: () => MERGE_KEY
23319
- };
23320
- const isMergeKey = (ctx, key) => (merge.identify(key) ||
23321
- (isScalar$1(key) &&
23322
- (!key.type || key.type === Scalar.PLAIN) &&
23323
- merge.identify(key.value))) &&
23324
- ctx?.doc.schema.tags.some(tag => tag.tag === merge.tag && tag.default);
23325
- function addMergeToJSMap(ctx, map, value) {
23326
- value = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
23327
- if (isSeq(value))
23328
- for (const it of value.items)
23329
- mergeValue(ctx, map, it);
23330
- else if (Array.isArray(value))
23331
- for (const it of value)
23332
- mergeValue(ctx, map, it);
23333
- else
23334
- mergeValue(ctx, map, value);
23335
- }
23336
- function mergeValue(ctx, map, value) {
23194
+ function mergeToJSMap(ctx, map, value) {
23337
23195
  const source = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
23338
23196
  if (!isMap(source))
23339
23197
  throw new Error('Merge sources must be maps or map aliases');
@@ -23357,41 +23215,9 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
23357
23215
  }
23358
23216
  return map;
23359
23217
  }
23360
-
23361
- function addPairToJSMap(ctx, map, { key, value }) {
23362
- if (isNode(key) && key.addToJSMap)
23363
- key.addToJSMap(ctx, map, value);
23364
- // TODO: Should drop this special case for bare << handling
23365
- else if (isMergeKey(ctx, key))
23366
- addMergeToJSMap(ctx, map, value);
23367
- else {
23368
- const jsKey = toJS(key, '', ctx);
23369
- if (map instanceof Map) {
23370
- map.set(jsKey, toJS(value, jsKey, ctx));
23371
- }
23372
- else if (map instanceof Set) {
23373
- map.add(jsKey);
23374
- }
23375
- else {
23376
- const stringKey = stringifyKey(key, jsKey, ctx);
23377
- const jsValue = toJS(value, stringKey, ctx);
23378
- if (stringKey in map)
23379
- Object.defineProperty(map, stringKey, {
23380
- value: jsValue,
23381
- writable: true,
23382
- enumerable: true,
23383
- configurable: true
23384
- });
23385
- else
23386
- map[stringKey] = jsValue;
23387
- }
23388
- }
23389
- return map;
23390
- }
23391
23218
  function stringifyKey(key, jsKey, ctx) {
23392
23219
  if (jsKey === null)
23393
23220
  return '';
23394
- // eslint-disable-next-line @typescript-eslint/no-base-to-string
23395
23221
  if (typeof jsKey !== 'object')
23396
23222
  return String(jsKey);
23397
23223
  if (isNode(key) && ctx?.doc) {
@@ -24024,7 +23850,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
24024
23850
  identify: value => typeof value === 'boolean',
24025
23851
  default: true,
24026
23852
  tag: 'tag:yaml.org,2002:bool',
24027
- test: /^true$|^false$/,
23853
+ test: /^true|false$/,
24028
23854
  resolve: str => str === 'true',
24029
23855
  stringify: stringifyJSON
24030
23856
  },
@@ -24069,7 +23895,10 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
24069
23895
  * document.querySelector('#photo').src = URL.createObjectURL(blob)
24070
23896
  */
24071
23897
  resolve(src, onError) {
24072
- if (typeof atob === 'function') {
23898
+ if (typeof Buffer === 'function') {
23899
+ return Buffer.from(src, 'base64');
23900
+ }
23901
+ else if (typeof atob === 'function') {
24073
23902
  // On IE 11, atob() can't handle newlines
24074
23903
  const str = atob(src.replace(/[\n\r]/g, ''));
24075
23904
  const buffer = new Uint8Array(str.length);
@@ -24083,11 +23912,15 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
24083
23912
  }
24084
23913
  },
24085
23914
  stringify({ comment, type, value }, ctx, onComment, onChompKeep) {
24086
- if (!value)
24087
- return '';
24088
23915
  const buf = value; // checked earlier by binary.identify()
24089
23916
  let str;
24090
- if (typeof btoa === 'function') {
23917
+ if (typeof Buffer === 'function') {
23918
+ str =
23919
+ buf instanceof Buffer
23920
+ ? buf.toString('base64')
23921
+ : Buffer.from(buf.buffer).toString('base64');
23922
+ }
23923
+ else if (typeof btoa === 'function') {
24091
23924
  let s = '';
24092
23925
  for (let i = 0; i < buf.length; ++i)
24093
23926
  s += String.fromCharCode(buf[i]);
@@ -24096,7 +23929,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
24096
23929
  else {
24097
23930
  throw new Error('This environment does not support writing binary tags; either Buffer or btoa is required');
24098
23931
  }
24099
- type ?? (type = Scalar.BLOCK_LITERAL);
23932
+ if (!type)
23933
+ type = Scalar.BLOCK_LITERAL;
24100
23934
  if (type !== Scalar.QUOTE_DOUBLE) {
24101
23935
  const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth);
24102
23936
  const n = Math.ceil(str.length / lineWidth);
@@ -24565,7 +24399,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
24565
24399
  }
24566
24400
  return new Date(date);
24567
24401
  },
24568
- stringify: ({ value }) => value?.toISOString().replace(/(T00:00:00)?\.000Z$/, '') ?? ''
24402
+ stringify: ({ value }) => value.toISOString().replace(/((T00:00)?:00)?\.000Z$/, '')
24569
24403
  };
24570
24404
 
24571
24405
  const schema = [
@@ -24583,7 +24417,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
24583
24417
  floatExp,
24584
24418
  float,
24585
24419
  binary,
24586
- merge,
24587
24420
  omap,
24588
24421
  pairs,
24589
24422
  set,
@@ -24611,7 +24444,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
24611
24444
  intOct: intOct$1,
24612
24445
  intTime,
24613
24446
  map,
24614
- merge,
24615
24447
  null: nullTag,
24616
24448
  omap,
24617
24449
  pairs,
@@ -24621,20 +24453,13 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
24621
24453
  };
24622
24454
  const coreKnownTags = {
24623
24455
  'tag:yaml.org,2002:binary': binary,
24624
- 'tag:yaml.org,2002:merge': merge,
24625
24456
  'tag:yaml.org,2002:omap': omap,
24626
24457
  'tag:yaml.org,2002:pairs': pairs,
24627
24458
  'tag:yaml.org,2002:set': set,
24628
24459
  'tag:yaml.org,2002:timestamp': timestamp
24629
24460
  };
24630
- function getTags(customTags, schemaName, addMergeTag) {
24631
- const schemaTags = schemas.get(schemaName);
24632
- if (schemaTags && !customTags) {
24633
- return addMergeTag && !schemaTags.includes(merge)
24634
- ? schemaTags.concat(merge)
24635
- : schemaTags.slice();
24636
- }
24637
- let tags = schemaTags;
24461
+ function getTags(customTags, schemaName) {
24462
+ let tags = schemas.get(schemaName);
24638
24463
  if (!tags) {
24639
24464
  if (Array.isArray(customTags))
24640
24465
  tags = [];
@@ -24653,21 +24478,17 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
24653
24478
  else if (typeof customTags === 'function') {
24654
24479
  tags = customTags(tags.slice());
24655
24480
  }
24656
- if (addMergeTag)
24657
- tags = tags.concat(merge);
24658
- return tags.reduce((tags, tag) => {
24659
- const tagObj = typeof tag === 'string' ? tagsByName[tag] : tag;
24660
- if (!tagObj) {
24661
- const tagName = JSON.stringify(tag);
24662
- const keys = Object.keys(tagsByName)
24663
- .map(key => JSON.stringify(key))
24664
- .join(', ');
24665
- throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`);
24666
- }
24667
- if (!tags.includes(tagObj))
24668
- tags.push(tagObj);
24669
- return tags;
24670
- }, []);
24481
+ return tags.map(tag => {
24482
+ if (typeof tag !== 'string')
24483
+ return tag;
24484
+ const tagObj = tagsByName[tag];
24485
+ if (tagObj)
24486
+ return tagObj;
24487
+ const keys = Object.keys(tagsByName)
24488
+ .map(key => JSON.stringify(key))
24489
+ .join(', ');
24490
+ throw new Error(`Unknown custom tag "${tag}"; use one of ${keys}`);
24491
+ });
24671
24492
  }
24672
24493
 
24673
24494
  const sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0;
@@ -24678,9 +24499,10 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
24678
24499
  : compat
24679
24500
  ? getTags(null, compat)
24680
24501
  : null;
24502
+ this.merge = !!merge;
24681
24503
  this.name = (typeof schema === 'string' && schema) || 'core';
24682
24504
  this.knownTags = resolveKnownTags ? coreKnownTags : {};
24683
- this.tags = getTags(customTags, this.name, merge);
24505
+ this.tags = getTags(customTags, this.name);
24684
24506
  this.toStringOptions = toStringDefaults ?? null;
24685
24507
  Object.defineProperty(this, MAP, { value: map });
24686
24508
  Object.defineProperty(this, SCALAR$1, { value: string });
@@ -24805,7 +24627,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
24805
24627
  logLevel: 'warn',
24806
24628
  prettyErrors: true,
24807
24629
  strict: true,
24808
- stringKeys: false,
24809
24630
  uniqueKeys: true,
24810
24631
  version: '1.2'
24811
24632
  }, options);
@@ -25029,7 +24850,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
25029
24850
  this.directives.yaml.version = '1.1';
25030
24851
  else
25031
24852
  this.directives = new Directives({ version: '1.1' });
25032
- opt = { resolveKnownTags: false, schema: 'yaml-1.1' };
24853
+ opt = { merge: true, resolveKnownTags: false, schema: 'yaml-1.1' };
25033
24854
  break;
25034
24855
  case '1.2':
25035
24856
  case 'next':
@@ -25037,7 +24858,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
25037
24858
  this.directives.yaml.version = version;
25038
24859
  else
25039
24860
  this.directives = new Directives({ version });
25040
- opt = { resolveKnownTags: true, schema: 'core' };
24861
+ opt = { merge: false, resolveKnownTags: true, schema: 'core' };
25041
24862
  break;
25042
24863
  case null:
25043
24864
  if (this.directives)
@@ -25215,7 +25036,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
25215
25036
  if (atNewline) {
25216
25037
  if (comment)
25217
25038
  comment += token.source;
25218
- else if (!found || indicator !== 'seq-item-ind')
25039
+ else
25219
25040
  spaceBefore = true;
25220
25041
  }
25221
25042
  else
@@ -25232,7 +25053,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
25232
25053
  if (token.source.endsWith(':'))
25233
25054
  onError(token.offset + token.source.length - 1, 'BAD_ALIAS', 'Anchor ending in : is ambiguous', true);
25234
25055
  anchor = token;
25235
- start ?? (start = token.offset);
25056
+ if (start === null)
25057
+ start = token.offset;
25236
25058
  atNewline = false;
25237
25059
  hasSpace = false;
25238
25060
  reqSpace = true;
@@ -25241,7 +25063,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
25241
25063
  if (tag)
25242
25064
  onError(token, 'MULTIPLE_TAGS', 'A node can have at most one tag');
25243
25065
  tag = token;
25244
- start ?? (start = token.offset);
25066
+ if (start === null)
25067
+ start = token.offset;
25245
25068
  atNewline = false;
25246
25069
  hasSpace = false;
25247
25070
  reqSpace = true;
@@ -25354,7 +25177,11 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
25354
25177
  return false;
25355
25178
  const isEqual = typeof uniqueKeys === 'function'
25356
25179
  ? uniqueKeys
25357
- : (a, b) => a === b || (isScalar$1(a) && isScalar$1(b) && a.value === b.value);
25180
+ : (a, b) => a === b ||
25181
+ (isScalar$1(a) &&
25182
+ isScalar$1(b) &&
25183
+ a.value === b.value &&
25184
+ !(a.value === '<<' && ctx.schema.merge));
25358
25185
  return items.some(pair => isEqual(pair.key, search));
25359
25186
  }
25360
25187
 
@@ -25403,14 +25230,12 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
25403
25230
  onError(offset, 'BAD_INDENT', startColMsg);
25404
25231
  }
25405
25232
  // key value
25406
- ctx.atKey = true;
25407
25233
  const keyStart = keyProps.end;
25408
25234
  const keyNode = key
25409
25235
  ? composeNode(ctx, key, keyProps, onError)
25410
25236
  : composeEmptyNode(ctx, keyStart, start, null, keyProps, onError);
25411
25237
  if (ctx.schema.compat)
25412
25238
  flowIndentCheck(bm.indent, key, onError);
25413
- ctx.atKey = false;
25414
25239
  if (mapIncludes(ctx, map.items, keyNode))
25415
25240
  onError(keyStart, 'DUPLICATE_KEY', 'Map keys must be unique');
25416
25241
  // value properties
@@ -25470,8 +25295,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
25470
25295
  const seq = new NodeClass(ctx.schema);
25471
25296
  if (ctx.atRoot)
25472
25297
  ctx.atRoot = false;
25473
- if (ctx.atKey)
25474
- ctx.atKey = false;
25475
25298
  let offset = bs.offset;
25476
25299
  let commentEnd = null;
25477
25300
  for (const { start, value } of bs.items) {
@@ -25556,8 +25379,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
25556
25379
  const atRoot = ctx.atRoot;
25557
25380
  if (atRoot)
25558
25381
  ctx.atRoot = false;
25559
- if (ctx.atKey)
25560
- ctx.atKey = false;
25561
25382
  let offset = fc.offset + fc.start.source.length;
25562
25383
  for (let i = 0; i < fc.items.length; ++i) {
25563
25384
  const collItem = fc.items[i];
@@ -25637,14 +25458,12 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
25637
25458
  else {
25638
25459
  // item is a key+value pair
25639
25460
  // key value
25640
- ctx.atKey = true;
25641
25461
  const keyStart = props.end;
25642
25462
  const keyNode = key
25643
25463
  ? composeNode(ctx, key, props, onError)
25644
25464
  : composeEmptyNode(ctx, keyStart, start, null, props, onError);
25645
25465
  if (isBlock(key))
25646
25466
  onError(keyNode.range, 'BLOCK_IN_FLOW', blockMsg);
25647
- ctx.atKey = false;
25648
25467
  // value properties
25649
25468
  const valueProps = resolveProps(sep ?? [], {
25650
25469
  flow: fcName,
@@ -25800,8 +25619,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
25800
25619
  tag = kt;
25801
25620
  }
25802
25621
  else {
25803
- if (kt) {
25804
- onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection ?? 'scalar'}`, true);
25622
+ if (kt?.collection) {
25623
+ onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection}`, true);
25805
25624
  }
25806
25625
  else {
25807
25626
  onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, true);
@@ -26242,16 +26061,11 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
26242
26061
  const tagName = tagToken
26243
26062
  ? ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg))
26244
26063
  : null;
26245
- let tag;
26246
- if (ctx.options.stringKeys && ctx.atKey) {
26247
- tag = ctx.schema[SCALAR$1];
26248
- }
26249
- else if (tagName)
26250
- tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);
26251
- else if (token.type === 'scalar')
26252
- tag = findScalarTagByTest(ctx, value, token, onError);
26253
- else
26254
- tag = ctx.schema[SCALAR$1];
26064
+ const tag = tagToken && tagName
26065
+ ? findScalarTagByName(ctx.schema, value, tagName, tagToken, onError)
26066
+ : token.type === 'scalar'
26067
+ ? findScalarTagByTest(ctx, value, token, onError)
26068
+ : ctx.schema[SCALAR$1];
26255
26069
  let scalar;
26256
26070
  try {
26257
26071
  const res = tag.resolve(value, msg => onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg), ctx.options);
@@ -26299,9 +26113,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
26299
26113
  onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, tagName !== 'tag:yaml.org,2002:str');
26300
26114
  return schema[SCALAR$1];
26301
26115
  }
26302
- function findScalarTagByTest({ atKey, directives, schema }, value, token, onError) {
26303
- const tag = schema.tags.find(tag => (tag.default === true || (atKey && tag.default === 'key')) &&
26304
- tag.test?.test(value)) || schema[SCALAR$1];
26116
+ function findScalarTagByTest({ directives, schema }, value, token, onError) {
26117
+ const tag = schema.tags.find(tag => tag.default && tag.test?.test(value)) || schema[SCALAR$1];
26305
26118
  if (schema.compat) {
26306
26119
  const compat = schema.compat.find(tag => tag.default && tag.test?.test(value)) ??
26307
26120
  schema[SCALAR$1];
@@ -26317,7 +26130,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
26317
26130
 
26318
26131
  function emptyScalarPosition(offset, before, pos) {
26319
26132
  if (before) {
26320
- pos ?? (pos = before.length);
26133
+ if (pos === null)
26134
+ pos = before.length;
26321
26135
  for (let i = pos - 1; i >= 0; --i) {
26322
26136
  let st = before[i];
26323
26137
  switch (st.type) {
@@ -26342,7 +26156,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
26342
26156
 
26343
26157
  const CN = { composeNode, composeEmptyNode };
26344
26158
  function composeNode(ctx, token, props, onError) {
26345
- const atKey = ctx.atKey;
26346
26159
  const { spaceBefore, comment, anchor, tag } = props;
26347
26160
  let node;
26348
26161
  let isSrcToken = true;
@@ -26378,14 +26191,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
26378
26191
  }
26379
26192
  if (anchor && node.anchor === '')
26380
26193
  onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');
26381
- if (atKey &&
26382
- ctx.options.stringKeys &&
26383
- (!isScalar$1(node) ||
26384
- typeof node.value !== 'string' ||
26385
- (node.tag && node.tag !== 'tag:yaml.org,2002:str'))) {
26386
- const msg = 'With stringKeys, all keys must be strings';
26387
- onError(tag ?? token, 'NON_STRING_KEY', msg);
26388
- }
26389
26194
  if (spaceBefore)
26390
26195
  node.spaceBefore = true;
26391
26196
  if (comment) {
@@ -26438,7 +26243,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
26438
26243
  const opts = Object.assign({ _directives: directives }, options);
26439
26244
  const doc = new Document(undefined, opts);
26440
26245
  const ctx = {
26441
- atKey: false,
26442
26246
  atRoot: true,
26443
26247
  directives: doc.directives,
26444
26248
  options: doc.options,
@@ -28573,20 +28377,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
28573
28377
  default: {
28574
28378
  const bv = this.startBlockValue(map);
28575
28379
  if (bv) {
28576
- if (bv.type === 'block-seq') {
28577
- if (!it.explicitKey &&
28578
- it.sep &&
28579
- !includesToken(it.sep, 'newline')) {
28580
- yield* this.pop({
28581
- type: 'error',
28582
- offset: this.offset,
28583
- message: 'Unexpected block-seq-ind on same line with key',
28584
- source: this.source
28585
- });
28586
- return;
28587
- }
28588
- }
28589
- else if (atMapIndent) {
28380
+ if (atMapIndent && bv.type !== 'block-seq') {
28590
28381
  map.items.push({ start });
28591
28382
  }
28592
28383
  this.stack.push(bv);
@@ -28957,8 +28748,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
28957
28748
  if (!keepUndefined)
28958
28749
  return undefined;
28959
28750
  }
28960
- if (isDocument(value) && !_replacer)
28961
- return value.toString(options);
28962
28751
  return new Document(value, _replacer, options).toString(options);
28963
28752
  }
28964
28753