@thoughtspot/visual-embed-sdk 1.37.0-temp-nav → 1.37.1-spotter-embed

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 (128) hide show
  1. package/cjs/package.json +3 -3
  2. package/cjs/src/auth.d.ts +7 -3
  3. package/cjs/src/auth.d.ts.map +1 -1
  4. package/cjs/src/auth.js +20 -0
  5. package/cjs/src/auth.js.map +1 -1
  6. package/cjs/src/auth.spec.js +48 -0
  7. package/cjs/src/auth.spec.js.map +1 -1
  8. package/cjs/src/embed/app.d.ts +2 -19
  9. package/cjs/src/embed/app.d.ts.map +1 -1
  10. package/cjs/src/embed/app.js +3 -8
  11. package/cjs/src/embed/app.js.map +1 -1
  12. package/cjs/src/embed/app.spec.js +4 -10
  13. package/cjs/src/embed/app.spec.js.map +1 -1
  14. package/cjs/src/embed/bodyless-conversation.d.ts +39 -9
  15. package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
  16. package/cjs/src/embed/bodyless-conversation.js +32 -5
  17. package/cjs/src/embed/bodyless-conversation.js.map +1 -1
  18. package/cjs/src/embed/bodyless-conversation.spec.js +4 -4
  19. package/cjs/src/embed/bodyless-conversation.spec.js.map +1 -1
  20. package/cjs/src/embed/conversation.d.ts +38 -11
  21. package/cjs/src/embed/conversation.d.ts.map +1 -1
  22. package/cjs/src/embed/conversation.js +28 -4
  23. package/cjs/src/embed/conversation.js.map +1 -1
  24. package/cjs/src/embed/conversation.spec.js +7 -7
  25. package/cjs/src/embed/conversation.spec.js.map +1 -1
  26. package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
  27. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  28. package/cjs/src/index.d.ts +3 -3
  29. package/cjs/src/index.d.ts.map +1 -1
  30. package/cjs/src/index.js +5 -3
  31. package/cjs/src/index.js.map +1 -1
  32. package/cjs/src/react/all-types-export.d.ts +1 -1
  33. package/cjs/src/react/all-types-export.d.ts.map +1 -1
  34. package/cjs/src/react/all-types-export.js +2 -1
  35. package/cjs/src/react/all-types-export.js.map +1 -1
  36. package/cjs/src/react/index.d.ts +24 -5
  37. package/cjs/src/react/index.d.ts.map +1 -1
  38. package/cjs/src/react/index.js +21 -4
  39. package/cjs/src/react/index.js.map +1 -1
  40. package/cjs/src/types.d.ts +51 -2
  41. package/cjs/src/types.d.ts.map +1 -1
  42. package/cjs/src/types.js +49 -0
  43. package/cjs/src/types.js.map +1 -1
  44. package/dist/index-DUaG1OG2.js +7447 -0
  45. package/dist/index-DnIvX1FR.js +7371 -0
  46. package/dist/index-OuiZF3zE.js +7371 -0
  47. package/dist/src/auth.d.ts +7 -3
  48. package/dist/src/auth.d.ts.map +1 -1
  49. package/dist/src/embed/app.d.ts +2 -19
  50. package/dist/src/embed/app.d.ts.map +1 -1
  51. package/dist/src/embed/bodyless-conversation.d.ts +39 -9
  52. package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
  53. package/dist/src/embed/conversation.d.ts +38 -11
  54. package/dist/src/embed/conversation.d.ts.map +1 -1
  55. package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
  56. package/dist/src/index.d.ts +3 -3
  57. package/dist/src/index.d.ts.map +1 -1
  58. package/dist/src/react/all-types-export.d.ts +1 -1
  59. package/dist/src/react/all-types-export.d.ts.map +1 -1
  60. package/dist/src/react/index.d.ts +24 -5
  61. package/dist/src/react/index.d.ts.map +1 -1
  62. package/dist/src/types.d.ts +51 -2
  63. package/dist/src/types.d.ts.map +1 -1
  64. package/dist/tsembed-react.es.js +122 -18
  65. package/dist/tsembed-react.js +342 -161
  66. package/dist/tsembed.es.js +84 -19
  67. package/dist/tsembed.js +306 -163
  68. package/dist/visual-embed-sdk-react-full.d.ts +161 -49
  69. package/dist/visual-embed-sdk-react.d.ts +161 -49
  70. package/dist/visual-embed-sdk.d.ts +138 -45
  71. package/lib/package.json +3 -3
  72. package/lib/src/auth.d.ts +7 -3
  73. package/lib/src/auth.d.ts.map +1 -1
  74. package/lib/src/auth.js +20 -0
  75. package/lib/src/auth.js.map +1 -1
  76. package/lib/src/auth.spec.js +48 -0
  77. package/lib/src/auth.spec.js.map +1 -1
  78. package/lib/src/embed/app.d.ts +2 -19
  79. package/lib/src/embed/app.d.ts.map +1 -1
  80. package/lib/src/embed/app.js +3 -8
  81. package/lib/src/embed/app.js.map +1 -1
  82. package/lib/src/embed/app.spec.js +4 -10
  83. package/lib/src/embed/app.spec.js.map +1 -1
  84. package/lib/src/embed/bodyless-conversation.d.ts +39 -9
  85. package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
  86. package/lib/src/embed/bodyless-conversation.js +30 -4
  87. package/lib/src/embed/bodyless-conversation.js.map +1 -1
  88. package/lib/src/embed/bodyless-conversation.spec.js +5 -5
  89. package/lib/src/embed/bodyless-conversation.spec.js.map +1 -1
  90. package/lib/src/embed/conversation.d.ts +38 -11
  91. package/lib/src/embed/conversation.d.ts.map +1 -1
  92. package/lib/src/embed/conversation.js +26 -3
  93. package/lib/src/embed/conversation.js.map +1 -1
  94. package/lib/src/embed/conversation.spec.js +8 -8
  95. package/lib/src/embed/conversation.spec.js.map +1 -1
  96. package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
  97. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  98. package/lib/src/index.d.ts +3 -3
  99. package/lib/src/index.d.ts.map +1 -1
  100. package/lib/src/index.js +3 -3
  101. package/lib/src/index.js.map +1 -1
  102. package/lib/src/react/all-types-export.d.ts +1 -1
  103. package/lib/src/react/all-types-export.d.ts.map +1 -1
  104. package/lib/src/react/all-types-export.js +1 -1
  105. package/lib/src/react/all-types-export.js.map +1 -1
  106. package/lib/src/react/index.d.ts +24 -5
  107. package/lib/src/react/index.d.ts.map +1 -1
  108. package/lib/src/react/index.js +21 -4
  109. package/lib/src/react/index.js.map +1 -1
  110. package/lib/src/types.d.ts +51 -2
  111. package/lib/src/types.d.ts.map +1 -1
  112. package/lib/src/types.js +49 -0
  113. package/lib/src/types.js.map +1 -1
  114. package/lib/src/visual-embed-sdk.d.ts +140 -47
  115. package/package.json +3 -3
  116. package/src/auth.spec.ts +52 -0
  117. package/src/auth.ts +23 -2
  118. package/src/embed/app.spec.ts +4 -10
  119. package/src/embed/app.ts +6 -30
  120. package/src/embed/bodyless-conversation.spec.ts +6 -6
  121. package/src/embed/bodyless-conversation.ts +43 -8
  122. package/src/embed/conversation.spec.ts +16 -16
  123. package/src/embed/conversation.ts +42 -11
  124. package/src/embed/ts-embed.spec.ts +0 -2
  125. package/src/index.ts +8 -4
  126. package/src/react/all-types-export.ts +1 -0
  127. package/src/react/index.tsx +36 -10
  128. package/src/types.ts +55 -0
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.37.0-temp-nav */
1
+ /* @thoughtspot/visual-embed-sdk version 1.37.1-spotter-embed */
2
2
  'use client';
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
@@ -163,7 +163,7 @@
163
163
  }
164
164
  return false;
165
165
  };
166
- const merge = (...objects) => objects.reduce((result, current) => {
166
+ const merge$1 = (...objects) => objects.reduce((result, current) => {
167
167
  if (Array.isArray(current)) {
168
168
  throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");
169
169
  }
@@ -172,19 +172,19 @@
172
172
  return;
173
173
  }
174
174
  if (Array.isArray(result[key]) && Array.isArray(current[key])) {
175
- result[key] = merge.options.mergeArrays
176
- ? merge.options.uniqueArrayItems
175
+ result[key] = merge$1.options.mergeArrays
176
+ ? merge$1.options.uniqueArrayItems
177
177
  ? Array.from(new Set(result[key].concat(current[key])))
178
178
  : [...result[key], ...current[key]]
179
179
  : current[key];
180
180
  }
181
181
  else if (isObject$1(result[key]) && isObject$1(current[key])) {
182
- result[key] = merge(result[key], current[key]);
182
+ result[key] = merge$1(result[key], current[key]);
183
183
  }
184
184
  else {
185
185
  result[key] =
186
186
  current[key] === undefined
187
- ? merge.options.allowUndefinedOverrides
187
+ ? merge$1.options.allowUndefinedOverrides
188
188
  ? current[key]
189
189
  : result[key]
190
190
  : current[key];
@@ -197,11 +197,11 @@
197
197
  mergeArrays: true,
198
198
  uniqueArrayItems: true,
199
199
  };
200
- merge.options = defaultOptions;
201
- merge.withOptions = (options, ...objects) => {
202
- merge.options = Object.assign(Object.assign({}, defaultOptions), options);
203
- const result = merge(...objects);
204
- merge.options = defaultOptions;
200
+ merge$1.options = defaultOptions;
201
+ merge$1.withOptions = (options, ...objects) => {
202
+ merge$1.options = Object.assign(Object.assign({}, defaultOptions), options);
203
+ const result = merge$1(...objects);
204
+ merge$1.options = defaultOptions;
205
205
  return result;
206
206
  };
207
207
 
@@ -402,7 +402,7 @@
402
402
  function getDOMNode(domSelector) {
403
403
  return typeof domSelector === 'string' ? document.querySelector(domSelector) : domSelector;
404
404
  }
405
- const deepMerge = (target, source) => merge(target, source);
405
+ const deepMerge = (target, source) => merge$1(target, source);
406
406
  const getOperationNameFromQuery = (query) => {
407
407
  const regex = /(?:query|mutation)\s+(\w+)/;
408
408
  const matches = query.match(regex);
@@ -2956,6 +2956,54 @@
2956
2956
  * @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
2957
2957
  */
2958
2958
  HostEvent["TransformTableVizData"] = "TransformTableVizData";
2959
+ /**
2960
+ * Triggers the table visualization re-render with the updated data.
2961
+ * Includes the following properties:
2962
+ * @param - `columnDataLite` - an array of object containing the
2963
+ * data value modifications retrieved from the `EmbedEvent.TableVizRendered`
2964
+ * payload.For example, { columnDataLite: []}`.
2965
+ */
2966
+ HostEvent["SpotterSearch"] = "SpotterSearch";
2967
+ /**
2968
+ * Triggers the table visualization re-render with the updated data.
2969
+ * Includes the following properties:
2970
+ * @param - `columnDataLite` - an array of object containing the
2971
+ * data value modifications retrieved from the `EmbedEvent.TableVizRendered`
2972
+ * payload.For example, { columnDataLite: []}`.
2973
+ */
2974
+ HostEvent["EditLastPrompt"] = "EditLastPrompt";
2975
+ /**
2976
+ * Triggers the table visualization re-render with the updated data.
2977
+ * Includes the following properties:
2978
+ * @param - `columnDataLite` - an array of object containing the
2979
+ * data value modifications retrieved from the `EmbedEvent.TableVizRendered`
2980
+ * payload.For example, { columnDataLite: []}`.
2981
+ */
2982
+ HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
2983
+ /**
2984
+ * Triggers the table visualization re-render with the updated data.
2985
+ * Includes the following properties:
2986
+ * @param - `columnDataLite` - an array of object containing the
2987
+ * data value modifications retrieved from the `EmbedEvent.TableVizRendered`
2988
+ * payload.For example, { columnDataLite: []}`.
2989
+ */
2990
+ HostEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
2991
+ /**
2992
+ * Triggers the table visualization re-render with the updated data.
2993
+ * Includes the following properties:
2994
+ * @param - `columnDataLite` - an array of object containing the
2995
+ * data value modifications retrieved from the `EmbedEvent.TableVizRendered`
2996
+ * payload.For example, { columnDataLite: []}`.
2997
+ */
2998
+ HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
2999
+ /**
3000
+ * Triggers the table visualization re-render with the updated data.
3001
+ * Includes the following properties:
3002
+ * @param - `columnDataLite` - an array of object containing the
3003
+ * data value modifications retrieved from the `EmbedEvent.TableVizRendered`
3004
+ * payload.For example, { columnDataLite: []}`.
3005
+ */
3006
+ HostEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
2959
3007
  })(exports.HostEvent || (exports.HostEvent = {}));
2960
3008
  /**
2961
3009
  * The different visual modes that the data sources panel within
@@ -3097,6 +3145,7 @@
3097
3145
  Param["ShowSpotterLimitations"] = "showSpotterLimitations";
3098
3146
  Param["CoverAndFilterOptionInPDF"] = "coverAndFilterOptionInPDF";
3099
3147
  Param["PrimaryAction"] = "primaryAction";
3148
+ Param["isSpotterAgentEmbed"] = "isSpotterAgentEmbed";
3100
3149
  })(Param || (Param = {}));
3101
3150
  /**
3102
3151
  * ThoughtSpot application pages include actions and menu commands
@@ -14675,6 +14724,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14675
14724
  * @version SDK: 1.19.0
14676
14725
  */
14677
14726
  AuthStatus["WAITING_FOR_POPUP"] = "WAITING_FOR_POPUP";
14727
+ /**
14728
+ * Emitted when the SAML popup is closed without authentication
14729
+ */
14730
+ AuthStatus["SAML_POPUP_CLOSED_NO_AUTH"] = "SAML_POPUP_CLOSED_NO_AUTH";
14678
14731
  })(AuthStatus || (AuthStatus = {}));
14679
14732
  /**
14680
14733
  * Events which can be triggered on the emitter returned from {@link init}.
@@ -14895,14 +14948,26 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14895
14948
  * @param triggerText
14896
14949
  */
14897
14950
  async function samlPopupFlow(ssoURL, triggerContainer, triggerText) {
14951
+ let popupClosedCheck;
14898
14952
  const openPopup = () => {
14899
14953
  if (samlAuthWindow === null || samlAuthWindow.closed) {
14900
14954
  samlAuthWindow = window.open(ssoURL, '_blank', 'location=no,height=570,width=520,scrollbars=yes,status=yes');
14955
+ if (samlAuthWindow) {
14956
+ popupClosedCheck = setInterval(() => {
14957
+ if (samlAuthWindow.closed) {
14958
+ clearInterval(popupClosedCheck);
14959
+ if (samlCompletionPromise && !samlCompletionResolved) {
14960
+ authEE === null || authEE === void 0 ? void 0 : authEE.emit(AuthStatus.SAML_POPUP_CLOSED_NO_AUTH);
14961
+ }
14962
+ }
14963
+ }, 500);
14964
+ }
14901
14965
  }
14902
14966
  else {
14903
14967
  samlAuthWindow.focus();
14904
14968
  }
14905
14969
  };
14970
+ let samlCompletionResolved = false;
14906
14971
  authEE === null || authEE === void 0 ? void 0 : authEE.emit(AuthStatus.WAITING_FOR_POPUP);
14907
14972
  const containerEl = getDOMNode(triggerContainer);
14908
14973
  if (containerEl) {
@@ -14914,6 +14979,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14914
14979
  samlCompletionPromise = samlCompletionPromise || new Promise((resolve, reject) => {
14915
14980
  window.addEventListener('message', (e) => {
14916
14981
  if (e.data.type === exports.EmbedEvent.SAMLComplete) {
14982
+ samlCompletionResolved = true;
14983
+ if (popupClosedCheck) {
14984
+ clearInterval(popupClosedCheck);
14985
+ }
14917
14986
  e.source.close();
14918
14987
  resolve();
14919
14988
  }
@@ -15321,7 +15390,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15321
15390
  return e;
15322
15391
  }
15323
15392
 
15324
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.37.0-temp-nav";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 | coveralls","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":"^8.2.6","@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",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.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":"^1.1.1",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:"^5.3.4"};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:"31 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};
15393
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.37.1-spotter-embed";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 | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && 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":"^8.2.6","@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",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.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":"^1.1.1",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:"31 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};
15325
15394
 
15326
15395
  /**
15327
15396
  * Reloads the ThoughtSpot iframe.
@@ -17112,6 +17181,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17112
17181
  params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
17113
17182
  params[Param.IsUnifiedSearchExperienceEnabled] = isUnifiedSearchExperienceEnabled;
17114
17183
  params = this.getBaseQueryParams(params);
17184
+ if (modularHomeExperienceV3) {
17185
+ params[Param.NavigationVersion] = 'v3';
17186
+ }
17115
17187
  if (hideObjectSearch) {
17116
17188
  params[Param.HideObjectSearch] = !!hideObjectSearch;
17117
17189
  }
@@ -17168,14 +17240,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17168
17240
  /* eslint-disable-next-line max-len */
17169
17241
  params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
17170
17242
  }
17171
- if (modularHomeExperienceV3) {
17172
- if (modularHomeExperienceV3.enabled) {
17173
- params[Param.NavigationVersion] = 'v3';
17174
- }
17175
- if (modularHomeExperienceV3.homePage === 'v2') {
17176
- params[Param.ModularHomeExperienceEnabled] = true;
17177
- }
17178
- }
17179
17243
  const queryParams = getQueryParamString(params, true);
17180
17244
  return queryParams;
17181
17245
  }
@@ -17665,7 +17729,7 @@ query GetEurekaVizSnapshots(
17665
17729
  * @group Embed components
17666
17730
  * @example
17667
17731
  * ```js
17668
- * const conversation = new ConversationEmbed('#tsEmbed', {
17732
+ * const conversation = new SpotterEmbed('#tsEmbed', {
17669
17733
  * worksheetId: 'worksheetId',
17670
17734
  * searchOptions: {
17671
17735
  * searchQuery: 'searchQuery',
@@ -17673,9 +17737,9 @@ query GetEurekaVizSnapshots(
17673
17737
  * });
17674
17738
  * conversation.render();
17675
17739
  * ```
17676
- * @version SDK: 1.33.1 | ThoughtSpot: 10.5.0.cl
17740
+ * @version SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
17677
17741
  */
17678
- let ConversationEmbed$1 = class ConversationEmbed extends TsEmbed {
17742
+ let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
17679
17743
  constructor(container, viewConfig) {
17680
17744
  viewConfig.embedComponentType = 'conversation';
17681
17745
  super(container, viewConfig);
@@ -17721,6 +17785,29 @@ query GetEurekaVizSnapshots(
17721
17785
  await this.renderIFrame(src);
17722
17786
  return this;
17723
17787
  }
17788
+ };
17789
+ /**
17790
+ * Embed ThoughtSpot AI Conversation.
17791
+ * @deprecated Renamed to SpotterEmbed
17792
+ * @group Embed components
17793
+ * @example
17794
+ * ```js
17795
+ * const conversation = new SpotterEmbed('#tsEmbed', {
17796
+ * worksheetId: 'worksheetId',
17797
+ * searchOptions: {
17798
+ * searchQuery: 'searchQuery',
17799
+ * },
17800
+ * });
17801
+ * conversation.render();
17802
+ * ```
17803
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
17804
+ */
17805
+ let ConversationEmbed$1 = class ConversationEmbed extends SpotterEmbed$1 {
17806
+ constructor(container, viewConfig) {
17807
+ viewConfig.embedComponentType = 'conversation';
17808
+ super(container, viewConfig);
17809
+ this.viewConfig = viewConfig;
17810
+ }
17724
17811
  };
17725
17812
 
17726
17813
  const componentFactory = (EmbedConstructor,
@@ -17937,6 +18024,23 @@ query GetEurekaVizSnapshots(
17937
18024
  * @example
17938
18025
  * ```tsx
17939
18026
  * function Sage() {
18027
+ * return <SpotterEmbed
18028
+ * worksheetId="<worksheet-id-here>"
18029
+ * searchOptions={{
18030
+ * searchQuery: "<search query to start with>"
18031
+ * }}
18032
+ * ... other view config props or event listeners.
18033
+ * />
18034
+ * }
18035
+ * ```
18036
+ */
18037
+ const SpotterEmbed = componentFactory(SpotterEmbed$1);
18038
+ /**
18039
+ * React component for LLM based conversation BI.
18040
+ * @deprecated This component is renamed to SpotterEmbed. Use {@link SpotterEmbed} instead.
18041
+ * @example
18042
+ * ```tsx
18043
+ * function Sage() {
17940
18044
  * return <ConversationEmbed
17941
18045
  * worksheetId="<worksheet-id-here>"
17942
18046
  * searchOptions={{
@@ -17951,7 +18055,7 @@ query GetEurekaVizSnapshots(
17951
18055
  /**
17952
18056
  * React component for PreRendered Conversation embed.
17953
18057
  *
17954
- * PreRenderedConversationEmbed will preRender the ConversationEmbed and will be hidden by
18058
+ * PreRenderedConversationEmbed will preRender the SpotterEmbed and will be hidden by
17955
18059
  * default.
17956
18060
  *
17957
18061
  * SageEmbed with preRenderId passed will call showPreRender on the embed.
@@ -17962,11 +18066,11 @@ query GetEurekaVizSnapshots(
17962
18066
  * }
17963
18067
  * ```
17964
18068
  * function MyComponent() {
17965
- * return <ConversationEmbed preRenderId="someId" worksheetId="id" />
18069
+ * return <SpotterEmbed preRenderId="someId" worksheetId="id" />
17966
18070
  * }
17967
18071
  * ```
17968
18072
  */
17969
- const PreRenderedConversationEmbed = componentFactory(ConversationEmbed$1, true);
18073
+ const PreRenderedConversationEmbed = componentFactory(SpotterEmbed$1, true);
17970
18074
  /**
17971
18075
  * Get a reference to the embed component to trigger events on the component.
17972
18076
  * @example
@@ -18483,8 +18587,7 @@ query GetEurekaVizSnapshots(
18483
18587
  return {
18484
18588
  onAnchor: (source) => {
18485
18589
  aliasObjects.push(source);
18486
- if (!prevAnchors)
18487
- prevAnchors = anchorNames(doc);
18590
+ prevAnchors ?? (prevAnchors = anchorNames(doc));
18488
18591
  const anchor = findNewAnchor(prefix, prevAnchors);
18489
18592
  prevAnchors.add(anchor);
18490
18593
  return anchor;
@@ -18648,23 +18751,36 @@ query GetEurekaVizSnapshots(
18648
18751
  * Resolve the value of this alias within `doc`, finding the last
18649
18752
  * instance of the `source` anchor before this node.
18650
18753
  */
18651
- resolve(doc) {
18754
+ resolve(doc, ctx) {
18755
+ let nodes;
18756
+ if (ctx?.aliasResolveCache) {
18757
+ nodes = ctx.aliasResolveCache;
18758
+ }
18759
+ else {
18760
+ nodes = [];
18761
+ visit$1(doc, {
18762
+ Node: (_key, node) => {
18763
+ if (isAlias(node) || hasAnchor(node))
18764
+ nodes.push(node);
18765
+ }
18766
+ });
18767
+ if (ctx)
18768
+ ctx.aliasResolveCache = nodes;
18769
+ }
18652
18770
  let found = undefined;
18653
- visit$1(doc, {
18654
- Node: (_key, node) => {
18655
- if (node === this)
18656
- return visit$1.BREAK;
18657
- if (node.anchor === this.source)
18658
- found = node;
18659
- }
18660
- });
18771
+ for (const node of nodes) {
18772
+ if (node === this)
18773
+ break;
18774
+ if (node.anchor === this.source)
18775
+ found = node;
18776
+ }
18661
18777
  return found;
18662
18778
  }
18663
18779
  toJSON(_arg, ctx) {
18664
18780
  if (!ctx)
18665
18781
  return { source: this.source };
18666
18782
  const { anchors, doc, maxAliasCount } = ctx;
18667
- const source = this.resolve(doc);
18783
+ const source = this.resolve(doc, ctx);
18668
18784
  if (!source) {
18669
18785
  const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
18670
18786
  throw new ReferenceError(msg);
@@ -18783,8 +18899,7 @@ query GetEurekaVizSnapshots(
18783
18899
  if (aliasDuplicateObjects && value && typeof value === 'object') {
18784
18900
  ref = sourceObjects.get(value);
18785
18901
  if (ref) {
18786
- if (!ref.anchor)
18787
- ref.anchor = onAnchor(value);
18902
+ ref.anchor ?? (ref.anchor = onAnchor(value));
18788
18903
  return new Alias(ref.anchor);
18789
18904
  }
18790
18905
  else {
@@ -19355,23 +19470,32 @@ query GetEurekaVizSnapshots(
19355
19470
  start = start.replace(/\n+/g, `$&${indent}`);
19356
19471
  }
19357
19472
  const indentSize = indent ? '2' : '1'; // root is at -1
19358
- let header = (literal ? '|' : '>') + (startWithSpace ? indentSize : '') + chomp;
19473
+ // Leading | or > is added later
19474
+ let header = (startWithSpace ? indentSize : '') + chomp;
19359
19475
  if (comment) {
19360
19476
  header += ' ' + commentString(comment.replace(/ ?[\r\n]+/g, ' '));
19361
19477
  if (onComment)
19362
19478
  onComment();
19363
19479
  }
19364
- if (literal) {
19365
- value = value.replace(/\n+/g, `$&${indent}`);
19366
- return `${header}\n${indent}${start}${value}${end}`;
19367
- }
19368
- value = value
19369
- .replace(/\n+/g, '\n$&')
19370
- .replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
19371
- // ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
19372
- .replace(/\n+/g, `$&${indent}`);
19373
- const body = foldFlowLines(`${start}${value}${end}`, indent, FOLD_BLOCK, getFoldOptions(ctx, true));
19374
- return `${header}\n${indent}${body}`;
19480
+ if (!literal) {
19481
+ const foldedValue = value
19482
+ .replace(/\n+/g, '\n$&')
19483
+ .replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
19484
+ // ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
19485
+ .replace(/\n+/g, `$&${indent}`);
19486
+ let literalFallback = false;
19487
+ const foldOptions = getFoldOptions(ctx, true);
19488
+ if (blockQuote !== 'folded' && type !== Scalar.BLOCK_FOLDED) {
19489
+ foldOptions.onOverflow = () => {
19490
+ literalFallback = true;
19491
+ };
19492
+ }
19493
+ const body = foldFlowLines(`${start}${foldedValue}${end}`, indent, FOLD_BLOCK, foldOptions);
19494
+ if (!literalFallback)
19495
+ return `>${header}\n${indent}${body}`;
19496
+ }
19497
+ value = value.replace(/\n+/g, `$&${indent}`);
19498
+ return `|${header}\n${indent}${start}${value}${end}`;
19375
19499
  }
19376
19500
  function plainString(item, ctx, onComment, onChompKeep) {
19377
19501
  const { type, value } = item;
@@ -19380,10 +19504,9 @@ query GetEurekaVizSnapshots(
19380
19504
  (inFlow && /[[\]{},]/.test(value))) {
19381
19505
  return quotedString(value, ctx);
19382
19506
  }
19383
- if (!value ||
19384
- /^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) {
19507
+ if (/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) {
19385
19508
  // not allowed:
19386
- // - empty string, '-' or '?'
19509
+ // - '-' or '?'
19387
19510
  // - start with an indicator character (except [?:-]) or /[?-] /
19388
19511
  // - '\n ', ': ' or ' \n' anywhere
19389
19512
  // - '#' not preceded by a non-space char
@@ -19512,7 +19635,12 @@ query GetEurekaVizSnapshots(
19512
19635
  let obj;
19513
19636
  if (isScalar$1(item)) {
19514
19637
  obj = item.value;
19515
- const match = tags.filter(t => t.identify?.(obj));
19638
+ let match = tags.filter(t => t.identify?.(obj));
19639
+ if (match.length > 1) {
19640
+ const testMatch = match.filter(t => t.test);
19641
+ if (testMatch.length > 0)
19642
+ match = testMatch;
19643
+ }
19516
19644
  tagObj =
19517
19645
  match.find(t => t.format === item.format) ?? match.find(t => !t.format);
19518
19646
  }
@@ -19521,7 +19649,7 @@ query GetEurekaVizSnapshots(
19521
19649
  tagObj = tags.find(t => t.nodeClass && obj instanceof t.nodeClass);
19522
19650
  }
19523
19651
  if (!tagObj) {
19524
- const name = obj?.constructor?.name ?? typeof obj;
19652
+ const name = obj?.constructor?.name ?? (obj === null ? 'null' : typeof obj);
19525
19653
  throw new Error(`Tag not resolved for ${name} value`);
19526
19654
  }
19527
19655
  return tagObj;
@@ -19536,7 +19664,7 @@ query GetEurekaVizSnapshots(
19536
19664
  anchors.add(anchor);
19537
19665
  props.push(`&${anchor}`);
19538
19666
  }
19539
- const tag = node.tag ? node.tag : tagObj.default ? null : tagObj.tag;
19667
+ const tag = node.tag ?? (tagObj.default ? null : tagObj.tag);
19540
19668
  if (tag)
19541
19669
  props.push(doc.directives.tagString(tag));
19542
19670
  return props.join(' ');
@@ -19562,8 +19690,7 @@ query GetEurekaVizSnapshots(
19562
19690
  const node = isNode(item)
19563
19691
  ? item
19564
19692
  : ctx.doc.createNode(item, { onTagObj: o => (tagObj = o) });
19565
- if (!tagObj)
19566
- tagObj = getTagObject(ctx.doc.schema.tags, node);
19693
+ tagObj ?? (tagObj = getTagObject(ctx.doc.schema.tags, node));
19567
19694
  const props = stringifyProps(node, tagObj, ctx);
19568
19695
  if (props.length > 0)
19569
19696
  ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1;
@@ -19725,54 +19852,10 @@ query GetEurekaVizSnapshots(
19725
19852
 
19726
19853
  function warn(logLevel, warning) {
19727
19854
  if (logLevel === 'debug' || logLevel === 'warn') {
19728
- if (typeof process !== 'undefined' && process.emitWarning)
19729
- process.emitWarning(warning);
19730
- else
19731
- console.warn(warning);
19855
+ console.warn(warning);
19732
19856
  }
19733
19857
  }
19734
19858
 
19735
- const MERGE_KEY = '<<';
19736
- function addPairToJSMap(ctx, map, { key, value }) {
19737
- if (ctx?.doc.schema.merge && isMergeKey(key)) {
19738
- value = isAlias(value) ? value.resolve(ctx.doc) : value;
19739
- if (isSeq(value))
19740
- for (const it of value.items)
19741
- mergeToJSMap(ctx, map, it);
19742
- else if (Array.isArray(value))
19743
- for (const it of value)
19744
- mergeToJSMap(ctx, map, it);
19745
- else
19746
- mergeToJSMap(ctx, map, value);
19747
- }
19748
- else {
19749
- const jsKey = toJS(key, '', ctx);
19750
- if (map instanceof Map) {
19751
- map.set(jsKey, toJS(value, jsKey, ctx));
19752
- }
19753
- else if (map instanceof Set) {
19754
- map.add(jsKey);
19755
- }
19756
- else {
19757
- const stringKey = stringifyKey(key, jsKey, ctx);
19758
- const jsValue = toJS(value, stringKey, ctx);
19759
- if (stringKey in map)
19760
- Object.defineProperty(map, stringKey, {
19761
- value: jsValue,
19762
- writable: true,
19763
- enumerable: true,
19764
- configurable: true
19765
- });
19766
- else
19767
- map[stringKey] = jsValue;
19768
- }
19769
- }
19770
- return map;
19771
- }
19772
- const isMergeKey = (key) => key === MERGE_KEY ||
19773
- (isScalar$1(key) &&
19774
- key.value === MERGE_KEY &&
19775
- (!key.type || key.type === Scalar.PLAIN));
19776
19859
  // If the value associated with a merge key is a single mapping node, each of
19777
19860
  // its key/value pairs is inserted into the current mapping, unless the key
19778
19861
  // already exists in it. If the value associated with the merge key is a
@@ -19780,7 +19863,35 @@ query GetEurekaVizSnapshots(
19780
19863
  // of these nodes is merged in turn according to its order in the sequence.
19781
19864
  // Keys in mapping nodes earlier in the sequence override keys specified in
19782
19865
  // later mapping nodes. -- http://yaml.org/type/merge.html
19783
- function mergeToJSMap(ctx, map, value) {
19866
+ const MERGE_KEY = '<<';
19867
+ const merge = {
19868
+ identify: value => value === MERGE_KEY ||
19869
+ (typeof value === 'symbol' && value.description === MERGE_KEY),
19870
+ default: 'key',
19871
+ tag: 'tag:yaml.org,2002:merge',
19872
+ test: /^<<$/,
19873
+ resolve: () => Object.assign(new Scalar(Symbol(MERGE_KEY)), {
19874
+ addToJSMap: addMergeToJSMap
19875
+ }),
19876
+ stringify: () => MERGE_KEY
19877
+ };
19878
+ const isMergeKey = (ctx, key) => (merge.identify(key) ||
19879
+ (isScalar$1(key) &&
19880
+ (!key.type || key.type === Scalar.PLAIN) &&
19881
+ merge.identify(key.value))) &&
19882
+ ctx?.doc.schema.tags.some(tag => tag.tag === merge.tag && tag.default);
19883
+ function addMergeToJSMap(ctx, map, value) {
19884
+ value = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
19885
+ if (isSeq(value))
19886
+ for (const it of value.items)
19887
+ mergeValue(ctx, map, it);
19888
+ else if (Array.isArray(value))
19889
+ for (const it of value)
19890
+ mergeValue(ctx, map, it);
19891
+ else
19892
+ mergeValue(ctx, map, value);
19893
+ }
19894
+ function mergeValue(ctx, map, value) {
19784
19895
  const source = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
19785
19896
  if (!isMap(source))
19786
19897
  throw new Error('Merge sources must be maps or map aliases');
@@ -19804,9 +19915,41 @@ query GetEurekaVizSnapshots(
19804
19915
  }
19805
19916
  return map;
19806
19917
  }
19918
+
19919
+ function addPairToJSMap(ctx, map, { key, value }) {
19920
+ if (isNode(key) && key.addToJSMap)
19921
+ key.addToJSMap(ctx, map, value);
19922
+ // TODO: Should drop this special case for bare << handling
19923
+ else if (isMergeKey(ctx, key))
19924
+ addMergeToJSMap(ctx, map, value);
19925
+ else {
19926
+ const jsKey = toJS(key, '', ctx);
19927
+ if (map instanceof Map) {
19928
+ map.set(jsKey, toJS(value, jsKey, ctx));
19929
+ }
19930
+ else if (map instanceof Set) {
19931
+ map.add(jsKey);
19932
+ }
19933
+ else {
19934
+ const stringKey = stringifyKey(key, jsKey, ctx);
19935
+ const jsValue = toJS(value, stringKey, ctx);
19936
+ if (stringKey in map)
19937
+ Object.defineProperty(map, stringKey, {
19938
+ value: jsValue,
19939
+ writable: true,
19940
+ enumerable: true,
19941
+ configurable: true
19942
+ });
19943
+ else
19944
+ map[stringKey] = jsValue;
19945
+ }
19946
+ }
19947
+ return map;
19948
+ }
19807
19949
  function stringifyKey(key, jsKey, ctx) {
19808
19950
  if (jsKey === null)
19809
19951
  return '';
19952
+ // eslint-disable-next-line @typescript-eslint/no-base-to-string
19810
19953
  if (typeof jsKey !== 'object')
19811
19954
  return String(jsKey);
19812
19955
  if (isNode(key) && ctx?.doc) {
@@ -20439,7 +20582,7 @@ query GetEurekaVizSnapshots(
20439
20582
  identify: value => typeof value === 'boolean',
20440
20583
  default: true,
20441
20584
  tag: 'tag:yaml.org,2002:bool',
20442
- test: /^true|false$/,
20585
+ test: /^true$|^false$/,
20443
20586
  resolve: str => str === 'true',
20444
20587
  stringify: stringifyJSON
20445
20588
  },
@@ -20484,10 +20627,7 @@ query GetEurekaVizSnapshots(
20484
20627
  * document.querySelector('#photo').src = URL.createObjectURL(blob)
20485
20628
  */
20486
20629
  resolve(src, onError) {
20487
- if (typeof Buffer === 'function') {
20488
- return Buffer.from(src, 'base64');
20489
- }
20490
- else if (typeof atob === 'function') {
20630
+ if (typeof atob === 'function') {
20491
20631
  // On IE 11, atob() can't handle newlines
20492
20632
  const str = atob(src.replace(/[\n\r]/g, ''));
20493
20633
  const buffer = new Uint8Array(str.length);
@@ -20501,15 +20641,11 @@ query GetEurekaVizSnapshots(
20501
20641
  }
20502
20642
  },
20503
20643
  stringify({ comment, type, value }, ctx, onComment, onChompKeep) {
20644
+ if (!value)
20645
+ return '';
20504
20646
  const buf = value; // checked earlier by binary.identify()
20505
20647
  let str;
20506
- if (typeof Buffer === 'function') {
20507
- str =
20508
- buf instanceof Buffer
20509
- ? buf.toString('base64')
20510
- : Buffer.from(buf.buffer).toString('base64');
20511
- }
20512
- else if (typeof btoa === 'function') {
20648
+ if (typeof btoa === 'function') {
20513
20649
  let s = '';
20514
20650
  for (let i = 0; i < buf.length; ++i)
20515
20651
  s += String.fromCharCode(buf[i]);
@@ -20518,8 +20654,7 @@ query GetEurekaVizSnapshots(
20518
20654
  else {
20519
20655
  throw new Error('This environment does not support writing binary tags; either Buffer or btoa is required');
20520
20656
  }
20521
- if (!type)
20522
- type = Scalar.BLOCK_LITERAL;
20657
+ type ?? (type = Scalar.BLOCK_LITERAL);
20523
20658
  if (type !== Scalar.QUOTE_DOUBLE) {
20524
20659
  const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth);
20525
20660
  const n = Math.ceil(str.length / lineWidth);
@@ -20988,7 +21123,7 @@ query GetEurekaVizSnapshots(
20988
21123
  }
20989
21124
  return new Date(date);
20990
21125
  },
20991
- stringify: ({ value }) => value.toISOString().replace(/((T00:00)?:00)?\.000Z$/, '')
21126
+ stringify: ({ value }) => value?.toISOString().replace(/(T00:00:00)?\.000Z$/, '') ?? ''
20992
21127
  };
20993
21128
 
20994
21129
  const schema = [
@@ -21006,6 +21141,7 @@ query GetEurekaVizSnapshots(
21006
21141
  floatExp,
21007
21142
  float,
21008
21143
  binary,
21144
+ merge,
21009
21145
  omap,
21010
21146
  pairs,
21011
21147
  set,
@@ -21033,6 +21169,7 @@ query GetEurekaVizSnapshots(
21033
21169
  intOct: intOct$1,
21034
21170
  intTime,
21035
21171
  map,
21172
+ merge,
21036
21173
  null: nullTag,
21037
21174
  omap,
21038
21175
  pairs,
@@ -21042,13 +21179,20 @@ query GetEurekaVizSnapshots(
21042
21179
  };
21043
21180
  const coreKnownTags = {
21044
21181
  'tag:yaml.org,2002:binary': binary,
21182
+ 'tag:yaml.org,2002:merge': merge,
21045
21183
  'tag:yaml.org,2002:omap': omap,
21046
21184
  'tag:yaml.org,2002:pairs': pairs,
21047
21185
  'tag:yaml.org,2002:set': set,
21048
21186
  'tag:yaml.org,2002:timestamp': timestamp
21049
21187
  };
21050
- function getTags(customTags, schemaName) {
21051
- let tags = schemas.get(schemaName);
21188
+ function getTags(customTags, schemaName, addMergeTag) {
21189
+ const schemaTags = schemas.get(schemaName);
21190
+ if (schemaTags && !customTags) {
21191
+ return addMergeTag && !schemaTags.includes(merge)
21192
+ ? schemaTags.concat(merge)
21193
+ : schemaTags.slice();
21194
+ }
21195
+ let tags = schemaTags;
21052
21196
  if (!tags) {
21053
21197
  if (Array.isArray(customTags))
21054
21198
  tags = [];
@@ -21067,17 +21211,21 @@ query GetEurekaVizSnapshots(
21067
21211
  else if (typeof customTags === 'function') {
21068
21212
  tags = customTags(tags.slice());
21069
21213
  }
21070
- return tags.map(tag => {
21071
- if (typeof tag !== 'string')
21072
- return tag;
21073
- const tagObj = tagsByName[tag];
21074
- if (tagObj)
21075
- return tagObj;
21076
- const keys = Object.keys(tagsByName)
21077
- .map(key => JSON.stringify(key))
21078
- .join(', ');
21079
- throw new Error(`Unknown custom tag "${tag}"; use one of ${keys}`);
21080
- });
21214
+ if (addMergeTag)
21215
+ tags = tags.concat(merge);
21216
+ return tags.reduce((tags, tag) => {
21217
+ const tagObj = typeof tag === 'string' ? tagsByName[tag] : tag;
21218
+ if (!tagObj) {
21219
+ const tagName = JSON.stringify(tag);
21220
+ const keys = Object.keys(tagsByName)
21221
+ .map(key => JSON.stringify(key))
21222
+ .join(', ');
21223
+ throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`);
21224
+ }
21225
+ if (!tags.includes(tagObj))
21226
+ tags.push(tagObj);
21227
+ return tags;
21228
+ }, []);
21081
21229
  }
21082
21230
 
21083
21231
  const sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0;
@@ -21088,10 +21236,9 @@ query GetEurekaVizSnapshots(
21088
21236
  : compat
21089
21237
  ? getTags(null, compat)
21090
21238
  : null;
21091
- this.merge = !!merge;
21092
21239
  this.name = (typeof schema === 'string' && schema) || 'core';
21093
21240
  this.knownTags = resolveKnownTags ? coreKnownTags : {};
21094
- this.tags = getTags(customTags, this.name);
21241
+ this.tags = getTags(customTags, this.name, merge);
21095
21242
  this.toStringOptions = toStringDefaults ?? null;
21096
21243
  Object.defineProperty(this, MAP, { value: map });
21097
21244
  Object.defineProperty(this, SCALAR$1, { value: string });
@@ -21216,6 +21363,7 @@ query GetEurekaVizSnapshots(
21216
21363
  logLevel: 'warn',
21217
21364
  prettyErrors: true,
21218
21365
  strict: true,
21366
+ stringKeys: false,
21219
21367
  uniqueKeys: true,
21220
21368
  version: '1.2'
21221
21369
  }, options);
@@ -21439,7 +21587,7 @@ query GetEurekaVizSnapshots(
21439
21587
  this.directives.yaml.version = '1.1';
21440
21588
  else
21441
21589
  this.directives = new Directives({ version: '1.1' });
21442
- opt = { merge: true, resolveKnownTags: false, schema: 'yaml-1.1' };
21590
+ opt = { resolveKnownTags: false, schema: 'yaml-1.1' };
21443
21591
  break;
21444
21592
  case '1.2':
21445
21593
  case 'next':
@@ -21447,7 +21595,7 @@ query GetEurekaVizSnapshots(
21447
21595
  this.directives.yaml.version = version;
21448
21596
  else
21449
21597
  this.directives = new Directives({ version });
21450
- opt = { merge: false, resolveKnownTags: true, schema: 'core' };
21598
+ opt = { resolveKnownTags: true, schema: 'core' };
21451
21599
  break;
21452
21600
  case null:
21453
21601
  if (this.directives)
@@ -21625,7 +21773,7 @@ query GetEurekaVizSnapshots(
21625
21773
  if (atNewline) {
21626
21774
  if (comment)
21627
21775
  comment += token.source;
21628
- else
21776
+ else if (!found || indicator !== 'seq-item-ind')
21629
21777
  spaceBefore = true;
21630
21778
  }
21631
21779
  else
@@ -21642,8 +21790,7 @@ query GetEurekaVizSnapshots(
21642
21790
  if (token.source.endsWith(':'))
21643
21791
  onError(token.offset + token.source.length - 1, 'BAD_ALIAS', 'Anchor ending in : is ambiguous', true);
21644
21792
  anchor = token;
21645
- if (start === null)
21646
- start = token.offset;
21793
+ start ?? (start = token.offset);
21647
21794
  atNewline = false;
21648
21795
  hasSpace = false;
21649
21796
  reqSpace = true;
@@ -21652,8 +21799,7 @@ query GetEurekaVizSnapshots(
21652
21799
  if (tag)
21653
21800
  onError(token, 'MULTIPLE_TAGS', 'A node can have at most one tag');
21654
21801
  tag = token;
21655
- if (start === null)
21656
- start = token.offset;
21802
+ start ?? (start = token.offset);
21657
21803
  atNewline = false;
21658
21804
  hasSpace = false;
21659
21805
  reqSpace = true;
@@ -21766,11 +21912,7 @@ query GetEurekaVizSnapshots(
21766
21912
  return false;
21767
21913
  const isEqual = typeof uniqueKeys === 'function'
21768
21914
  ? uniqueKeys
21769
- : (a, b) => a === b ||
21770
- (isScalar$1(a) &&
21771
- isScalar$1(b) &&
21772
- a.value === b.value &&
21773
- !(a.value === '<<' && ctx.schema.merge));
21915
+ : (a, b) => a === b || (isScalar$1(a) && isScalar$1(b) && a.value === b.value);
21774
21916
  return items.some(pair => isEqual(pair.key, search));
21775
21917
  }
21776
21918
 
@@ -21819,12 +21961,14 @@ query GetEurekaVizSnapshots(
21819
21961
  onError(offset, 'BAD_INDENT', startColMsg);
21820
21962
  }
21821
21963
  // key value
21964
+ ctx.atKey = true;
21822
21965
  const keyStart = keyProps.end;
21823
21966
  const keyNode = key
21824
21967
  ? composeNode(ctx, key, keyProps, onError)
21825
21968
  : composeEmptyNode(ctx, keyStart, start, null, keyProps, onError);
21826
21969
  if (ctx.schema.compat)
21827
21970
  flowIndentCheck(bm.indent, key, onError);
21971
+ ctx.atKey = false;
21828
21972
  if (mapIncludes(ctx, map.items, keyNode))
21829
21973
  onError(keyStart, 'DUPLICATE_KEY', 'Map keys must be unique');
21830
21974
  // value properties
@@ -21884,6 +22028,8 @@ query GetEurekaVizSnapshots(
21884
22028
  const seq = new NodeClass(ctx.schema);
21885
22029
  if (ctx.atRoot)
21886
22030
  ctx.atRoot = false;
22031
+ if (ctx.atKey)
22032
+ ctx.atKey = false;
21887
22033
  let offset = bs.offset;
21888
22034
  let commentEnd = null;
21889
22035
  for (const { start, value } of bs.items) {
@@ -21968,6 +22114,8 @@ query GetEurekaVizSnapshots(
21968
22114
  const atRoot = ctx.atRoot;
21969
22115
  if (atRoot)
21970
22116
  ctx.atRoot = false;
22117
+ if (ctx.atKey)
22118
+ ctx.atKey = false;
21971
22119
  let offset = fc.offset + fc.start.source.length;
21972
22120
  for (let i = 0; i < fc.items.length; ++i) {
21973
22121
  const collItem = fc.items[i];
@@ -22047,12 +22195,14 @@ query GetEurekaVizSnapshots(
22047
22195
  else {
22048
22196
  // item is a key+value pair
22049
22197
  // key value
22198
+ ctx.atKey = true;
22050
22199
  const keyStart = props.end;
22051
22200
  const keyNode = key
22052
22201
  ? composeNode(ctx, key, props, onError)
22053
22202
  : composeEmptyNode(ctx, keyStart, start, null, props, onError);
22054
22203
  if (isBlock(key))
22055
22204
  onError(keyNode.range, 'BLOCK_IN_FLOW', blockMsg);
22205
+ ctx.atKey = false;
22056
22206
  // value properties
22057
22207
  const valueProps = resolveProps(sep ?? [], {
22058
22208
  flow: fcName,
@@ -22208,8 +22358,8 @@ query GetEurekaVizSnapshots(
22208
22358
  tag = kt;
22209
22359
  }
22210
22360
  else {
22211
- if (kt?.collection) {
22212
- onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection}`, true);
22361
+ if (kt) {
22362
+ onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection ?? 'scalar'}`, true);
22213
22363
  }
22214
22364
  else {
22215
22365
  onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, true);
@@ -22650,11 +22800,16 @@ query GetEurekaVizSnapshots(
22650
22800
  const tagName = tagToken
22651
22801
  ? ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg))
22652
22802
  : null;
22653
- const tag = tagToken && tagName
22654
- ? findScalarTagByName(ctx.schema, value, tagName, tagToken, onError)
22655
- : token.type === 'scalar'
22656
- ? findScalarTagByTest(ctx, value, token, onError)
22657
- : ctx.schema[SCALAR$1];
22803
+ let tag;
22804
+ if (ctx.options.stringKeys && ctx.atKey) {
22805
+ tag = ctx.schema[SCALAR$1];
22806
+ }
22807
+ else if (tagName)
22808
+ tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);
22809
+ else if (token.type === 'scalar')
22810
+ tag = findScalarTagByTest(ctx, value, token, onError);
22811
+ else
22812
+ tag = ctx.schema[SCALAR$1];
22658
22813
  let scalar;
22659
22814
  try {
22660
22815
  const res = tag.resolve(value, msg => onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg), ctx.options);
@@ -22702,8 +22857,9 @@ query GetEurekaVizSnapshots(
22702
22857
  onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, tagName !== 'tag:yaml.org,2002:str');
22703
22858
  return schema[SCALAR$1];
22704
22859
  }
22705
- function findScalarTagByTest({ directives, schema }, value, token, onError) {
22706
- const tag = schema.tags.find(tag => tag.default && tag.test?.test(value)) || schema[SCALAR$1];
22860
+ function findScalarTagByTest({ atKey, directives, schema }, value, token, onError) {
22861
+ const tag = schema.tags.find(tag => (tag.default === true || (atKey && tag.default === 'key')) &&
22862
+ tag.test?.test(value)) || schema[SCALAR$1];
22707
22863
  if (schema.compat) {
22708
22864
  const compat = schema.compat.find(tag => tag.default && tag.test?.test(value)) ??
22709
22865
  schema[SCALAR$1];
@@ -22719,8 +22875,7 @@ query GetEurekaVizSnapshots(
22719
22875
 
22720
22876
  function emptyScalarPosition(offset, before, pos) {
22721
22877
  if (before) {
22722
- if (pos === null)
22723
- pos = before.length;
22878
+ pos ?? (pos = before.length);
22724
22879
  for (let i = pos - 1; i >= 0; --i) {
22725
22880
  let st = before[i];
22726
22881
  switch (st.type) {
@@ -22745,6 +22900,7 @@ query GetEurekaVizSnapshots(
22745
22900
 
22746
22901
  const CN = { composeNode, composeEmptyNode };
22747
22902
  function composeNode(ctx, token, props, onError) {
22903
+ const atKey = ctx.atKey;
22748
22904
  const { spaceBefore, comment, anchor, tag } = props;
22749
22905
  let node;
22750
22906
  let isSrcToken = true;
@@ -22780,6 +22936,14 @@ query GetEurekaVizSnapshots(
22780
22936
  }
22781
22937
  if (anchor && node.anchor === '')
22782
22938
  onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');
22939
+ if (atKey &&
22940
+ ctx.options.stringKeys &&
22941
+ (!isScalar$1(node) ||
22942
+ typeof node.value !== 'string' ||
22943
+ (node.tag && node.tag !== 'tag:yaml.org,2002:str'))) {
22944
+ const msg = 'With stringKeys, all keys must be strings';
22945
+ onError(tag ?? token, 'NON_STRING_KEY', msg);
22946
+ }
22783
22947
  if (spaceBefore)
22784
22948
  node.spaceBefore = true;
22785
22949
  if (comment) {
@@ -22832,6 +22996,7 @@ query GetEurekaVizSnapshots(
22832
22996
  const opts = Object.assign({ _directives: directives }, options);
22833
22997
  const doc = new Document(undefined, opts);
22834
22998
  const ctx = {
22999
+ atKey: false,
22835
23000
  atRoot: true,
22836
23001
  directives: doc.directives,
22837
23002
  options: doc.options,
@@ -24966,7 +25131,20 @@ query GetEurekaVizSnapshots(
24966
25131
  default: {
24967
25132
  const bv = this.startBlockValue(map);
24968
25133
  if (bv) {
24969
- if (atMapIndent && bv.type !== 'block-seq') {
25134
+ if (bv.type === 'block-seq') {
25135
+ if (!it.explicitKey &&
25136
+ it.sep &&
25137
+ !includesToken(it.sep, 'newline')) {
25138
+ yield* this.pop({
25139
+ type: 'error',
25140
+ offset: this.offset,
25141
+ message: 'Unexpected block-seq-ind on same line with key',
25142
+ source: this.source
25143
+ });
25144
+ return;
25145
+ }
25146
+ }
25147
+ else if (atMapIndent) {
24970
25148
  map.items.push({ start });
24971
25149
  }
24972
25150
  this.stack.push(bv);
@@ -25337,6 +25515,8 @@ query GetEurekaVizSnapshots(
25337
25515
  if (!keepUndefined)
25338
25516
  return undefined;
25339
25517
  }
25518
+ if (isDocument(value) && !_replacer)
25519
+ return value.toString(options);
25340
25520
  return new Document(value, _replacer, options).toString(options);
25341
25521
  }
25342
25522
 
@@ -25424,6 +25604,7 @@ query GetEurekaVizSnapshots(
25424
25604
  exports.SageEmbed = SageEmbed;
25425
25605
  exports.SearchBarEmbed = SearchBarEmbed;
25426
25606
  exports.SearchEmbed = SearchEmbed;
25607
+ exports.SpotterEmbed = SpotterEmbed;
25427
25608
  exports.getSessionInfo = getSessionInfo;
25428
25609
  exports.useEmbedRef = useEmbedRef;
25429
25610
  exports.useInit = useInit;