@thoughtspot/visual-embed-sdk 1.41.0-pre-render-1 → 1.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/package.json +3 -3
- package/cjs/src/embed/app.d.ts +6 -1
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +19 -1
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +60 -3
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.d.ts +0 -1
- package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/cjs/src/embed/bodyless-conversation.js +3 -7
- package/cjs/src/embed/bodyless-conversation.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +0 -1
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +2 -7
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +0 -1
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +4 -27
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +25 -31
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/sage.d.ts +0 -1
- package/cjs/src/embed/sage.d.ts.map +1 -1
- package/cjs/src/embed/sage.js +6 -10
- package/cjs/src/embed/sage.js.map +1 -1
- package/cjs/src/embed/search-bar.d.ts +0 -1
- package/cjs/src/embed/search-bar.d.ts.map +1 -1
- package/cjs/src/embed/search-bar.js +7 -11
- package/cjs/src/embed/search-bar.js.map +1 -1
- package/cjs/src/embed/search.d.ts +0 -1
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js +8 -7
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +4 -6
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +20 -21
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +122 -0
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/errors.d.ts +10 -0
- package/cjs/src/errors.d.ts.map +1 -1
- package/cjs/src/errors.js +11 -1
- package/cjs/src/errors.js.map +1 -1
- package/cjs/src/index.d.ts +2 -2
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +3 -1
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/react/index.d.ts +1 -1
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +2 -1
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/types.d.ts +135 -17
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +40 -21
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/custom-actions.d.ts +12 -0
- package/cjs/src/utils/custom-actions.d.ts.map +1 -0
- package/cjs/src/utils/custom-actions.js +180 -0
- package/cjs/src/utils/custom-actions.js.map +1 -0
- package/cjs/src/utils/custom-actions.spec.d.ts +2 -0
- package/cjs/src/utils/custom-actions.spec.d.ts.map +1 -0
- package/cjs/src/utils/custom-actions.spec.js +399 -0
- package/cjs/src/utils/custom-actions.spec.js.map +1 -0
- package/cjs/src/utils/processData.d.ts.map +1 -1
- package/cjs/src/utils/processData.js +10 -0
- package/cjs/src/utils/processData.js.map +1 -1
- package/cjs/src/utils/processData.spec.js +11 -0
- package/cjs/src/utils/processData.spec.js.map +1 -1
- package/cjs/src/utils.d.ts +7 -0
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +11 -1
- package/cjs/src/utils.js.map +1 -1
- package/cjs/src/utils.spec.js +28 -0
- package/cjs/src/utils.spec.js.map +1 -1
- package/dist/{index-CmEQfuE3.js → index-B_mxAan8.js} +1 -1
- package/dist/src/embed/app.d.ts +6 -1
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/bodyless-conversation.d.ts +0 -1
- package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +0 -1
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +0 -1
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/sage.d.ts +0 -1
- package/dist/src/embed/sage.d.ts.map +1 -1
- package/dist/src/embed/search-bar.d.ts +0 -1
- package/dist/src/embed/search-bar.d.ts.map +1 -1
- package/dist/src/embed/search.d.ts +0 -1
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +4 -6
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/dist/src/errors.d.ts +10 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/react/index.d.ts +1 -1
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +135 -17
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/custom-actions.d.ts +12 -0
- package/dist/src/utils/custom-actions.d.ts.map +1 -0
- package/dist/src/utils/custom-actions.spec.d.ts +2 -0
- package/dist/src/utils/custom-actions.spec.d.ts.map +1 -0
- package/dist/src/utils/processData.d.ts.map +1 -1
- package/dist/src/utils.d.ts +7 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +1704 -250
- package/dist/tsembed-react.js +1703 -249
- package/dist/tsembed.es.js +1704 -250
- package/dist/tsembed.js +1703 -249
- package/dist/visual-embed-sdk-react-full.d.ts +146 -31
- package/dist/visual-embed-sdk-react.d.ts +146 -31
- package/dist/visual-embed-sdk.d.ts +146 -31
- package/lib/package.json +3 -3
- package/lib/src/embed/app.d.ts +6 -1
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +19 -1
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +60 -3
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.d.ts +0 -1
- package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/lib/src/embed/bodyless-conversation.js +3 -7
- package/lib/src/embed/bodyless-conversation.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +0 -1
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +2 -7
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +0 -1
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +4 -27
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +25 -31
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/sage.d.ts +0 -1
- package/lib/src/embed/sage.d.ts.map +1 -1
- package/lib/src/embed/sage.js +6 -10
- package/lib/src/embed/sage.js.map +1 -1
- package/lib/src/embed/search-bar.d.ts +0 -1
- package/lib/src/embed/search-bar.d.ts.map +1 -1
- package/lib/src/embed/search-bar.js +7 -11
- package/lib/src/embed/search-bar.js.map +1 -1
- package/lib/src/embed/search.d.ts +0 -1
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +8 -7
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +4 -6
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +20 -21
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +123 -1
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/errors.d.ts +10 -0
- package/lib/src/errors.d.ts.map +1 -1
- package/lib/src/errors.js +10 -0
- package/lib/src/errors.js.map +1 -1
- package/lib/src/index.d.ts +2 -2
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +2 -2
- package/lib/src/index.js.map +1 -1
- package/lib/src/react/index.d.ts +1 -1
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +1 -1
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/types.d.ts +135 -17
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +39 -20
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/custom-actions.d.ts +12 -0
- package/lib/src/utils/custom-actions.d.ts.map +1 -0
- package/lib/src/utils/custom-actions.js +175 -0
- package/lib/src/utils/custom-actions.js.map +1 -0
- package/lib/src/utils/custom-actions.spec.d.ts +2 -0
- package/lib/src/utils/custom-actions.spec.d.ts.map +1 -0
- package/lib/src/utils/custom-actions.spec.js +397 -0
- package/lib/src/utils/custom-actions.spec.js.map +1 -0
- package/lib/src/utils/processData.d.ts.map +1 -1
- package/lib/src/utils/processData.js +10 -0
- package/lib/src/utils/processData.js.map +1 -1
- package/lib/src/utils/processData.spec.js +11 -0
- package/lib/src/utils/processData.spec.js.map +1 -1
- package/lib/src/utils.d.ts +7 -0
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +9 -0
- package/lib/src/utils.js.map +1 -1
- package/lib/src/utils.spec.js +29 -1
- package/lib/src/utils.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +147 -32
- package/package.json +3 -3
- package/src/embed/app.spec.ts +85 -3
- package/src/embed/app.ts +21 -0
- package/src/embed/bodyless-conversation.ts +3 -8
- package/src/embed/conversation.ts +2 -17
- package/src/embed/liveboard.spec.ts +35 -35
- package/src/embed/liveboard.ts +4 -32
- package/src/embed/sage.ts +7 -12
- package/src/embed/search-bar.tsx +7 -14
- package/src/embed/search.ts +7 -18
- package/src/embed/ts-embed.spec.ts +136 -2
- package/src/embed/ts-embed.ts +25 -28
- package/src/errors.ts +11 -0
- package/src/index.ts +4 -0
- package/src/react/index.tsx +1 -0
- package/src/types.ts +198 -76
- package/src/utils/custom-actions.spec.ts +431 -0
- package/src/utils/custom-actions.ts +217 -0
- package/src/utils/processData.spec.ts +12 -0
- package/src/utils/processData.ts +10 -0
- package/src/utils.spec.ts +34 -0
- package/src/utils.ts +10 -0
- package/dist/index-BDlM0f0T.js +0 -7371
- package/dist/index-D1pyb7RG.js +0 -7371
- package/dist/index-DeFzsyFF.js +0 -7371
- package/dist/index-Dpf0rd6w.js +0 -7371
- package/dist/index-UuEbsISo.js +0 -7447
- package/dist/index-e3Uw3YFO.js +0 -7371
- package/dist/index-k7pkZMhx.js +0 -7371
package/dist/tsembed-react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.41.0
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.41.0 */
|
|
2
2
|
'use client';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
|
|
@@ -217,7 +217,6 @@
|
|
|
217
217
|
* the embedded app
|
|
218
218
|
* @group Authentication / Init
|
|
219
219
|
*/
|
|
220
|
-
// eslint-disable-next-line no-shadow
|
|
221
220
|
var AuthType;
|
|
222
221
|
(function (AuthType) {
|
|
223
222
|
/**
|
|
@@ -431,7 +430,6 @@
|
|
|
431
430
|
/**
|
|
432
431
|
* A map of the supported runtime filter operations
|
|
433
432
|
*/
|
|
434
|
-
// eslint-disable-next-line no-shadow
|
|
435
433
|
exports.RuntimeFilterOp = void 0;
|
|
436
434
|
(function (RuntimeFilterOp) {
|
|
437
435
|
/**
|
|
@@ -502,7 +500,6 @@
|
|
|
502
500
|
* `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl).
|
|
503
501
|
* @version SDK: 1.28.0 | ThoughtSpot: 9.12.5.cl, 10.1.0.sw
|
|
504
502
|
*/
|
|
505
|
-
// eslint-disable-next-line no-shadow
|
|
506
503
|
exports.HomepageModule = void 0;
|
|
507
504
|
(function (HomepageModule) {
|
|
508
505
|
/**
|
|
@@ -535,7 +532,6 @@
|
|
|
535
532
|
* **Note**: This option is applicable to full app embedding only.
|
|
536
533
|
* @version SDK: 1.38.0 | ThoughtSpot: 10.9.0.cl
|
|
537
534
|
*/
|
|
538
|
-
// eslint-disable-next-line no-shadow
|
|
539
535
|
exports.ListPageColumns = void 0;
|
|
540
536
|
(function (ListPageColumns) {
|
|
541
537
|
/**
|
|
@@ -598,7 +594,6 @@
|
|
|
598
594
|
* ```
|
|
599
595
|
* @group Events
|
|
600
596
|
*/
|
|
601
|
-
// eslint-disable-next-line no-shadow
|
|
602
597
|
exports.EmbedEvent = void 0;
|
|
603
598
|
(function (EmbedEvent) {
|
|
604
599
|
/**
|
|
@@ -1240,6 +1235,11 @@
|
|
|
1240
1235
|
* @hidden
|
|
1241
1236
|
*/
|
|
1242
1237
|
EmbedEvent["APP_INIT"] = "appInit";
|
|
1238
|
+
/**
|
|
1239
|
+
* Internal event to clear the cached info
|
|
1240
|
+
* @hidden
|
|
1241
|
+
*/
|
|
1242
|
+
EmbedEvent["CLEAR_INFO_CACHE"] = "clearInfoCache";
|
|
1243
1243
|
/**
|
|
1244
1244
|
* Emitted when a user clicks **Show Liveboard details** on a Liveboard
|
|
1245
1245
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
@@ -1708,6 +1708,17 @@
|
|
|
1708
1708
|
* ```
|
|
1709
1709
|
*/
|
|
1710
1710
|
EmbedEvent["EmbedListenerReady"] = "EmbedListenerReady";
|
|
1711
|
+
/**
|
|
1712
|
+
* Emitted when the organization is switched.
|
|
1713
|
+
* @example
|
|
1714
|
+
* ```js
|
|
1715
|
+
* appEmbed.on(EmbedEvent.OrgSwitched, (payload) => {
|
|
1716
|
+
* console.log('payload', payload);
|
|
1717
|
+
* })
|
|
1718
|
+
* ```
|
|
1719
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1720
|
+
*/
|
|
1721
|
+
EmbedEvent["OrgSwitched"] = "orgSwitched";
|
|
1711
1722
|
})(exports.EmbedEvent || (exports.EmbedEvent = {}));
|
|
1712
1723
|
/**
|
|
1713
1724
|
* Event types that can be triggered by the host application
|
|
@@ -1762,7 +1773,6 @@
|
|
|
1762
1773
|
* ```
|
|
1763
1774
|
* @group Events
|
|
1764
1775
|
*/
|
|
1765
|
-
// eslint-disable-next-line no-shadow
|
|
1766
1776
|
exports.HostEvent = void 0;
|
|
1767
1777
|
(function (HostEvent) {
|
|
1768
1778
|
/**
|
|
@@ -2972,22 +2982,11 @@
|
|
|
2972
2982
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
2973
2983
|
*/
|
|
2974
2984
|
HostEvent["AskSpotter"] = "AskSpotter";
|
|
2975
|
-
/**
|
|
2976
|
-
* @hidden
|
|
2977
|
-
* Triggers the update of the embed params.
|
|
2978
|
-
*
|
|
2979
|
-
* @example
|
|
2980
|
-
* ```js
|
|
2981
|
-
* liveboardEmbed.trigger(HostEvent.UpdateEmbedParams, viewConfig);
|
|
2982
|
-
* ```
|
|
2983
|
-
*/
|
|
2984
|
-
HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
|
|
2985
2985
|
})(exports.HostEvent || (exports.HostEvent = {}));
|
|
2986
2986
|
/**
|
|
2987
2987
|
* The different visual modes that the data sources panel within
|
|
2988
2988
|
* search could appear in, such as hidden, collapsed, or expanded.
|
|
2989
2989
|
*/
|
|
2990
|
-
// eslint-disable-next-line no-shadow
|
|
2991
2990
|
var DataSourceVisualMode;
|
|
2992
2991
|
(function (DataSourceVisualMode) {
|
|
2993
2992
|
/**
|
|
@@ -3007,7 +3006,6 @@
|
|
|
3007
3006
|
* The query params passed down to the embedded ThoughtSpot app
|
|
3008
3007
|
* containing configuration and/or visual information.
|
|
3009
3008
|
*/
|
|
3010
|
-
// eslint-disable-next-line no-shadow
|
|
3011
3009
|
var Param;
|
|
3012
3010
|
(function (Param) {
|
|
3013
3011
|
Param["EmbedApp"] = "embedApp";
|
|
@@ -3087,6 +3085,7 @@
|
|
|
3087
3085
|
Param["Query"] = "query";
|
|
3088
3086
|
Param["HideHomepageLeftNav"] = "hideHomepageLeftNav";
|
|
3089
3087
|
Param["ModularHomeExperienceEnabled"] = "modularHomeExperience";
|
|
3088
|
+
Param["HomepageVersion"] = "homepageVersion";
|
|
3090
3089
|
Param["ListPageVersion"] = "listpageVersion";
|
|
3091
3090
|
Param["PendoTrackingKey"] = "additionalPendoKey";
|
|
3092
3091
|
Param["LiveboardHeaderSticky"] = "isLiveboardHeaderSticky";
|
|
@@ -3128,6 +3127,7 @@
|
|
|
3128
3127
|
Param["IsLiveboardStylingAndGroupingEnabled"] = "isLiveboardStylingAndGroupingEnabled";
|
|
3129
3128
|
Param["IsLazyLoadingForEmbedEnabled"] = "isLazyLoadingForEmbedEnabled";
|
|
3130
3129
|
Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
|
|
3130
|
+
Param["LiveboardXLSXCSVDownload"] = "isLiveboardXLSXCSVDownloadEnabled";
|
|
3131
3131
|
})(Param || (Param = {}));
|
|
3132
3132
|
/**
|
|
3133
3133
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -3156,7 +3156,6 @@
|
|
|
3156
3156
|
* ```
|
|
3157
3157
|
* See also link:https://developers.thoughtspot.com/docs/actions[Action IDs in the SDK]
|
|
3158
3158
|
*/
|
|
3159
|
-
// eslint-disable-next-line no-shadow
|
|
3160
3159
|
exports.Action = void 0;
|
|
3161
3160
|
(function (Action) {
|
|
3162
3161
|
/**
|
|
@@ -3701,7 +3700,7 @@
|
|
|
3701
3700
|
* The Favorites icon (*) for Answers,
|
|
3702
3701
|
* Liveboard, and data objects like Worksheet, Model,
|
|
3703
3702
|
* Tables and Views.
|
|
3704
|
-
* Allows adding an object to the user
|
|
3703
|
+
* Allows adding an object to the user's favorites list.
|
|
3705
3704
|
* @example
|
|
3706
3705
|
* ```js
|
|
3707
3706
|
* disabledActions: [Action.AddToFavorites]
|
|
@@ -4428,6 +4427,26 @@
|
|
|
4428
4427
|
ContextMenuTriggerOptions["RIGHT_CLICK"] = "right-click";
|
|
4429
4428
|
ContextMenuTriggerOptions["BOTH_CLICKS"] = "both-clicks";
|
|
4430
4429
|
})(ContextMenuTriggerOptions || (ContextMenuTriggerOptions = {}));
|
|
4430
|
+
/**
|
|
4431
|
+
* Enum options to show custom actions at different
|
|
4432
|
+
* positions in the application.
|
|
4433
|
+
*/
|
|
4434
|
+
exports.CustomActionsPosition = void 0;
|
|
4435
|
+
(function (CustomActionsPosition) {
|
|
4436
|
+
CustomActionsPosition["PRIMARY"] = "PRIMARY";
|
|
4437
|
+
CustomActionsPosition["MENU"] = "MENU";
|
|
4438
|
+
CustomActionsPosition["CONTEXTMENU"] = "CONTEXTMENU";
|
|
4439
|
+
})(exports.CustomActionsPosition || (exports.CustomActionsPosition = {}));
|
|
4440
|
+
/**
|
|
4441
|
+
* Enum options to mention the target of the custom action.
|
|
4442
|
+
*/
|
|
4443
|
+
var CustomActionTarget;
|
|
4444
|
+
(function (CustomActionTarget) {
|
|
4445
|
+
CustomActionTarget["LIVEBOARD"] = "LIVEBOARD";
|
|
4446
|
+
CustomActionTarget["VIZ"] = "VIZ";
|
|
4447
|
+
CustomActionTarget["ANSWER"] = "ANSWER";
|
|
4448
|
+
CustomActionTarget["SPOTTER"] = "SPOTTER";
|
|
4449
|
+
})(CustomActionTarget || (CustomActionTarget = {}));
|
|
4431
4450
|
/**
|
|
4432
4451
|
* Enum options to show or suppress Visual Embed SDK and
|
|
4433
4452
|
* ThoughtSpot application logs in the console output.
|
|
@@ -4888,6 +4907,15 @@
|
|
|
4888
4907
|
* @returns The stored value or `undefined` if the key is not found.
|
|
4889
4908
|
*/
|
|
4890
4909
|
const getValueFromWindow = (key) => { var _a; return (_a = window === null || window === void 0 ? void 0 : window[sdkWindowKey]) === null || _a === void 0 ? void 0 : _a[key]; };
|
|
4910
|
+
/**
|
|
4911
|
+
* Check if an array includes a string value
|
|
4912
|
+
* @param arr - The array to check
|
|
4913
|
+
* @param key - The string to search for
|
|
4914
|
+
* @returns boolean indicating if the string is found in the array
|
|
4915
|
+
*/
|
|
4916
|
+
const arrayIncludesString = (arr, key) => {
|
|
4917
|
+
return arr.some(item => typeof item === 'string' && item === key);
|
|
4918
|
+
};
|
|
4891
4919
|
/**
|
|
4892
4920
|
* Check if the document is currently in fullscreen mode
|
|
4893
4921
|
*/
|
|
@@ -5972,8 +6000,8 @@
|
|
|
5972
6000
|
var _cacheHas = cacheHas;
|
|
5973
6001
|
|
|
5974
6002
|
/** Used to compose bitmasks for value comparisons. */
|
|
5975
|
-
var COMPARE_PARTIAL_FLAG$
|
|
5976
|
-
COMPARE_UNORDERED_FLAG$
|
|
6003
|
+
var COMPARE_PARTIAL_FLAG$5 = 1,
|
|
6004
|
+
COMPARE_UNORDERED_FLAG$3 = 2;
|
|
5977
6005
|
|
|
5978
6006
|
/**
|
|
5979
6007
|
* A specialized version of `baseIsEqualDeep` for arrays with support for
|
|
@@ -5989,7 +6017,7 @@
|
|
|
5989
6017
|
* @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
|
|
5990
6018
|
*/
|
|
5991
6019
|
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
|
|
5992
|
-
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$
|
|
6020
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$5,
|
|
5993
6021
|
arrLength = array.length,
|
|
5994
6022
|
othLength = other.length;
|
|
5995
6023
|
|
|
@@ -6004,7 +6032,7 @@
|
|
|
6004
6032
|
}
|
|
6005
6033
|
var index = -1,
|
|
6006
6034
|
result = true,
|
|
6007
|
-
seen = (bitmask & COMPARE_UNORDERED_FLAG$
|
|
6035
|
+
seen = (bitmask & COMPARE_UNORDERED_FLAG$3) ? new _SetCache : undefined;
|
|
6008
6036
|
|
|
6009
6037
|
stack.set(array, other);
|
|
6010
6038
|
stack.set(other, array);
|
|
@@ -6096,8 +6124,8 @@
|
|
|
6096
6124
|
var _setToArray = setToArray;
|
|
6097
6125
|
|
|
6098
6126
|
/** Used to compose bitmasks for value comparisons. */
|
|
6099
|
-
var COMPARE_PARTIAL_FLAG$
|
|
6100
|
-
COMPARE_UNORDERED_FLAG = 2;
|
|
6127
|
+
var COMPARE_PARTIAL_FLAG$4 = 1,
|
|
6128
|
+
COMPARE_UNORDERED_FLAG$2 = 2;
|
|
6101
6129
|
|
|
6102
6130
|
/** `Object#toString` result references. */
|
|
6103
6131
|
var boolTag$2 = '[object Boolean]',
|
|
@@ -6108,14 +6136,14 @@
|
|
|
6108
6136
|
regexpTag$1 = '[object RegExp]',
|
|
6109
6137
|
setTag$3 = '[object Set]',
|
|
6110
6138
|
stringTag$1 = '[object String]',
|
|
6111
|
-
symbolTag = '[object Symbol]';
|
|
6139
|
+
symbolTag$1 = '[object Symbol]';
|
|
6112
6140
|
|
|
6113
6141
|
var arrayBufferTag$1 = '[object ArrayBuffer]',
|
|
6114
6142
|
dataViewTag$2 = '[object DataView]';
|
|
6115
6143
|
|
|
6116
6144
|
/** Used to convert symbols to primitives and strings. */
|
|
6117
|
-
var symbolProto = _Symbol ? _Symbol.prototype : undefined,
|
|
6118
|
-
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
|
|
6145
|
+
var symbolProto$1 = _Symbol ? _Symbol.prototype : undefined,
|
|
6146
|
+
symbolValueOf = symbolProto$1 ? symbolProto$1.valueOf : undefined;
|
|
6119
6147
|
|
|
6120
6148
|
/**
|
|
6121
6149
|
* A specialized version of `baseIsEqualDeep` for comparing objects of
|
|
@@ -6172,7 +6200,7 @@
|
|
|
6172
6200
|
var convert = _mapToArray;
|
|
6173
6201
|
|
|
6174
6202
|
case setTag$3:
|
|
6175
|
-
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$
|
|
6203
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$4;
|
|
6176
6204
|
convert || (convert = _setToArray);
|
|
6177
6205
|
|
|
6178
6206
|
if (object.size != other.size && !isPartial) {
|
|
@@ -6183,7 +6211,7 @@
|
|
|
6183
6211
|
if (stacked) {
|
|
6184
6212
|
return stacked == other;
|
|
6185
6213
|
}
|
|
6186
|
-
bitmask |= COMPARE_UNORDERED_FLAG;
|
|
6214
|
+
bitmask |= COMPARE_UNORDERED_FLAG$2;
|
|
6187
6215
|
|
|
6188
6216
|
// Recursively compare objects (susceptible to call stack limits).
|
|
6189
6217
|
stack.set(object, other);
|
|
@@ -6191,7 +6219,7 @@
|
|
|
6191
6219
|
stack['delete'](object);
|
|
6192
6220
|
return result;
|
|
6193
6221
|
|
|
6194
|
-
case symbolTag:
|
|
6222
|
+
case symbolTag$1:
|
|
6195
6223
|
if (symbolValueOf) {
|
|
6196
6224
|
return symbolValueOf.call(object) == symbolValueOf.call(other);
|
|
6197
6225
|
}
|
|
@@ -6882,7 +6910,7 @@
|
|
|
6882
6910
|
var _getAllKeys = getAllKeys;
|
|
6883
6911
|
|
|
6884
6912
|
/** Used to compose bitmasks for value comparisons. */
|
|
6885
|
-
var COMPARE_PARTIAL_FLAG$
|
|
6913
|
+
var COMPARE_PARTIAL_FLAG$3 = 1;
|
|
6886
6914
|
|
|
6887
6915
|
/** Used for built-in method references. */
|
|
6888
6916
|
var objectProto$2 = Object.prototype;
|
|
@@ -6904,7 +6932,7 @@
|
|
|
6904
6932
|
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
|
6905
6933
|
*/
|
|
6906
6934
|
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
|
|
6907
|
-
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$
|
|
6935
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3,
|
|
6908
6936
|
objProps = _getAllKeys(object),
|
|
6909
6937
|
objLength = objProps.length,
|
|
6910
6938
|
othProps = _getAllKeys(other),
|
|
@@ -7042,7 +7070,7 @@
|
|
|
7042
7070
|
var _getTag = getTag;
|
|
7043
7071
|
|
|
7044
7072
|
/** Used to compose bitmasks for value comparisons. */
|
|
7045
|
-
var COMPARE_PARTIAL_FLAG = 1;
|
|
7073
|
+
var COMPARE_PARTIAL_FLAG$2 = 1;
|
|
7046
7074
|
|
|
7047
7075
|
/** `Object#toString` result references. */
|
|
7048
7076
|
var argsTag = '[object Arguments]',
|
|
@@ -7095,7 +7123,7 @@
|
|
|
7095
7123
|
? _equalArrays(object, other, bitmask, customizer, equalFunc, stack)
|
|
7096
7124
|
: _equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
|
|
7097
7125
|
}
|
|
7098
|
-
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
|
|
7126
|
+
if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
|
|
7099
7127
|
var objIsWrapped = objIsObj && hasOwnProperty$2.call(object, '__wrapped__'),
|
|
7100
7128
|
othIsWrapped = othIsObj && hasOwnProperty$2.call(other, '__wrapped__');
|
|
7101
7129
|
|
|
@@ -7265,6 +7293,16 @@
|
|
|
7265
7293
|
MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
|
|
7266
7294
|
RENDER_CALLED_BEFORE_INIT: 'Looks like render was called before calling init, the render won\'t start until init is called.\nFor more info check\n1. https://developers.thoughtspot.com/docs/Function_init#_init\n2.https://developers.thoughtspot.com/docs/getting-started#initSdk',
|
|
7267
7295
|
SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
|
|
7296
|
+
};
|
|
7297
|
+
const CUSTOM_ACTIONS_ERROR_MESSAGE = {
|
|
7298
|
+
INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
|
|
7299
|
+
MISSING_REQUIRED_FIELDS: (id, missingFields) => `Custom Action Validation Error for '${id}': Missing required fields: ${missingFields.join(', ')}`,
|
|
7300
|
+
UNSUPPORTED_TARGET: (id, targetType) => `Custom Action Validation Error for '${id}': Target type '${targetType}' is not supported`,
|
|
7301
|
+
INVALID_POSITION: (position, targetType, supportedPositions) => `Position '${position}' is not supported for ${targetType.toLowerCase()}-level custom actions. Supported positions: ${supportedPositions}`,
|
|
7302
|
+
INVALID_METADATA_IDS: (targetType, invalidIds, supportedIds) => `Invalid metadata IDs for ${targetType.toLowerCase()}-level custom actions: ${invalidIds.join(', ')}. Supported metadata IDs: ${supportedIds}`,
|
|
7303
|
+
INVALID_DATA_MODEL_IDS: (targetType, invalidIds, supportedIds) => `Invalid data model IDs for ${targetType.toLowerCase()}-level custom actions: ${invalidIds.join(', ')}. Supported data model IDs: ${supportedIds}`,
|
|
7304
|
+
INVALID_FIELDS: (targetType, invalidFields, supportedFields) => `Invalid fields for ${targetType.toLowerCase()}-level custom actions: ${invalidFields.join(', ')}. Supported fields: ${supportedFields}`,
|
|
7305
|
+
DUPLICATE_IDS: (id, duplicateNames, keptName) => `Duplicate custom action ID '${id}' found. Actions with names '${duplicateNames.join("', '")}' will be ignored. Keeping '${keptName}'.`,
|
|
7268
7306
|
};
|
|
7269
7307
|
|
|
7270
7308
|
const EndPoints = {
|
|
@@ -8117,141 +8155,1571 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
8117
8155
|
if (columnsToRemove.length) {
|
|
8118
8156
|
await unaggAnswerSession.removeColumns(columnsToRemove);
|
|
8119
8157
|
}
|
|
8120
|
-
return unaggAnswerSession;
|
|
8121
|
-
}
|
|
8122
|
-
/**
|
|
8123
|
-
* Execute a custom graphql query in the context of the answer.
|
|
8124
|
-
* @param query graphql query
|
|
8125
|
-
* @param variables graphql variables
|
|
8126
|
-
* @returns
|
|
8127
|
-
*/
|
|
8128
|
-
async executeQuery(query, variables) {
|
|
8129
|
-
const data = await graphqlQuery({
|
|
8130
|
-
query,
|
|
8131
|
-
variables: {
|
|
8132
|
-
session: this.session,
|
|
8133
|
-
...variables,
|
|
8134
|
-
},
|
|
8135
|
-
thoughtSpotHost: this.thoughtSpotHost,
|
|
8136
|
-
isCompositeQuery: false,
|
|
8137
|
-
});
|
|
8138
|
-
this.session = deepMerge(this.session, (data === null || data === void 0 ? void 0 : data.id) || {});
|
|
8139
|
-
return data;
|
|
8140
|
-
}
|
|
8141
|
-
/**
|
|
8142
|
-
* Get the internal session details for the answer.
|
|
8143
|
-
* @returns
|
|
8144
|
-
*/
|
|
8145
|
-
getSession() {
|
|
8146
|
-
return this.session;
|
|
8158
|
+
return unaggAnswerSession;
|
|
8159
|
+
}
|
|
8160
|
+
/**
|
|
8161
|
+
* Execute a custom graphql query in the context of the answer.
|
|
8162
|
+
* @param query graphql query
|
|
8163
|
+
* @param variables graphql variables
|
|
8164
|
+
* @returns
|
|
8165
|
+
*/
|
|
8166
|
+
async executeQuery(query, variables) {
|
|
8167
|
+
const data = await graphqlQuery({
|
|
8168
|
+
query,
|
|
8169
|
+
variables: {
|
|
8170
|
+
session: this.session,
|
|
8171
|
+
...variables,
|
|
8172
|
+
},
|
|
8173
|
+
thoughtSpotHost: this.thoughtSpotHost,
|
|
8174
|
+
isCompositeQuery: false,
|
|
8175
|
+
});
|
|
8176
|
+
this.session = deepMerge(this.session, (data === null || data === void 0 ? void 0 : data.id) || {});
|
|
8177
|
+
return data;
|
|
8178
|
+
}
|
|
8179
|
+
/**
|
|
8180
|
+
* Get the internal session details for the answer.
|
|
8181
|
+
* @returns
|
|
8182
|
+
*/
|
|
8183
|
+
getSession() {
|
|
8184
|
+
return this.session;
|
|
8185
|
+
}
|
|
8186
|
+
async getAnswer() {
|
|
8187
|
+
if (this.answer) {
|
|
8188
|
+
return this.answer;
|
|
8189
|
+
}
|
|
8190
|
+
this.answer = this.executeQuery(getAnswer, {}).then((data) => data === null || data === void 0 ? void 0 : data.answer);
|
|
8191
|
+
return this.answer;
|
|
8192
|
+
}
|
|
8193
|
+
async getTML() {
|
|
8194
|
+
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
8195
|
+
const edoc = object[0].edoc;
|
|
8196
|
+
const YAML = await Promise.resolve().then(function () { return index; });
|
|
8197
|
+
const parsedDoc = YAML.parse(edoc);
|
|
8198
|
+
return {
|
|
8199
|
+
answer: {
|
|
8200
|
+
...parsedDoc.answer,
|
|
8201
|
+
...this.tmlOverride,
|
|
8202
|
+
},
|
|
8203
|
+
};
|
|
8204
|
+
}
|
|
8205
|
+
async addDisplayedVizToLiveboard(liveboardId) {
|
|
8206
|
+
const { displayMode, visualizations } = await this.getAnswer();
|
|
8207
|
+
const viz = getDisplayedViz(visualizations, displayMode);
|
|
8208
|
+
return this.executeQuery(addVizToLiveboard, {
|
|
8209
|
+
liveboardId,
|
|
8210
|
+
vizId: viz.id,
|
|
8211
|
+
});
|
|
8212
|
+
}
|
|
8213
|
+
setTMLOverride(override) {
|
|
8214
|
+
this.tmlOverride = override;
|
|
8215
|
+
}
|
|
8216
|
+
}
|
|
8217
|
+
/**
|
|
8218
|
+
*
|
|
8219
|
+
* @param sourceDetail
|
|
8220
|
+
* @param colNames
|
|
8221
|
+
*/
|
|
8222
|
+
function getGuidsFromColumnNames(sourceDetail, colNames) {
|
|
8223
|
+
const cols = sourceDetail.columns.reduce((colSet, col) => {
|
|
8224
|
+
colSet[col.name.toLowerCase()] = col;
|
|
8225
|
+
return colSet;
|
|
8226
|
+
}, {});
|
|
8227
|
+
return new Set(colNames.map((colName) => {
|
|
8228
|
+
const col = cols[colName.toLowerCase()];
|
|
8229
|
+
return col.id;
|
|
8230
|
+
}));
|
|
8231
|
+
}
|
|
8232
|
+
/**
|
|
8233
|
+
*
|
|
8234
|
+
* @param selectedPoints
|
|
8235
|
+
*/
|
|
8236
|
+
function getSelectedPointsForUnderlyingDataQuery(selectedPoints) {
|
|
8237
|
+
const underlyingDataPoint = [];
|
|
8238
|
+
/**
|
|
8239
|
+
*
|
|
8240
|
+
* @param colVal
|
|
8241
|
+
*/
|
|
8242
|
+
function addPointFromColVal(colVal) {
|
|
8243
|
+
var _a;
|
|
8244
|
+
const dataType = colVal.column.dataType;
|
|
8245
|
+
colVal.column.id;
|
|
8246
|
+
let dataValue;
|
|
8247
|
+
if (dataType === 'DATE') {
|
|
8248
|
+
if (Number.isFinite(colVal.value)) {
|
|
8249
|
+
dataValue = [{
|
|
8250
|
+
epochRange: {
|
|
8251
|
+
startEpoch: colVal.value,
|
|
8252
|
+
},
|
|
8253
|
+
}];
|
|
8254
|
+
// Case for custom calendar.
|
|
8255
|
+
}
|
|
8256
|
+
else if ((_a = colVal.value) === null || _a === void 0 ? void 0 : _a.v) {
|
|
8257
|
+
dataValue = [{
|
|
8258
|
+
epochRange: {
|
|
8259
|
+
startEpoch: colVal.value.v.s,
|
|
8260
|
+
endEpoch: colVal.value.v.e,
|
|
8261
|
+
},
|
|
8262
|
+
}];
|
|
8263
|
+
}
|
|
8264
|
+
}
|
|
8265
|
+
else {
|
|
8266
|
+
dataValue = [{ value: colVal.value }];
|
|
8267
|
+
}
|
|
8268
|
+
underlyingDataPoint.push({
|
|
8269
|
+
columnId: colVal.column.id,
|
|
8270
|
+
dataValue,
|
|
8271
|
+
});
|
|
8272
|
+
}
|
|
8273
|
+
selectedPoints.forEach((p) => {
|
|
8274
|
+
p.selectedAttributes.forEach(addPointFromColVal);
|
|
8275
|
+
});
|
|
8276
|
+
return underlyingDataPoint;
|
|
8277
|
+
}
|
|
8278
|
+
/**
|
|
8279
|
+
*
|
|
8280
|
+
* @param visualizations
|
|
8281
|
+
* @param displayMode
|
|
8282
|
+
*/
|
|
8283
|
+
function getDisplayedViz(visualizations, displayMode) {
|
|
8284
|
+
if (displayMode === 'CHART_MODE') {
|
|
8285
|
+
return visualizations.find(
|
|
8286
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
8287
|
+
(viz) => viz.__typename === 'ChartViz');
|
|
8288
|
+
}
|
|
8289
|
+
return visualizations.find(
|
|
8290
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
8291
|
+
(viz) => viz.__typename === 'TableViz');
|
|
8292
|
+
}
|
|
8293
|
+
|
|
8294
|
+
/** Built-in value references. */
|
|
8295
|
+
var spreadableSymbol = _Symbol ? _Symbol.isConcatSpreadable : undefined;
|
|
8296
|
+
|
|
8297
|
+
/**
|
|
8298
|
+
* Checks if `value` is a flattenable `arguments` object or array.
|
|
8299
|
+
*
|
|
8300
|
+
* @private
|
|
8301
|
+
* @param {*} value The value to check.
|
|
8302
|
+
* @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
|
|
8303
|
+
*/
|
|
8304
|
+
function isFlattenable(value) {
|
|
8305
|
+
return isArray_1(value) || isArguments_1(value) ||
|
|
8306
|
+
!!(spreadableSymbol && value && value[spreadableSymbol]);
|
|
8307
|
+
}
|
|
8308
|
+
|
|
8309
|
+
var _isFlattenable = isFlattenable;
|
|
8310
|
+
|
|
8311
|
+
/**
|
|
8312
|
+
* The base implementation of `_.flatten` with support for restricting flattening.
|
|
8313
|
+
*
|
|
8314
|
+
* @private
|
|
8315
|
+
* @param {Array} array The array to flatten.
|
|
8316
|
+
* @param {number} depth The maximum recursion depth.
|
|
8317
|
+
* @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
|
|
8318
|
+
* @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
|
|
8319
|
+
* @param {Array} [result=[]] The initial result value.
|
|
8320
|
+
* @returns {Array} Returns the new flattened array.
|
|
8321
|
+
*/
|
|
8322
|
+
function baseFlatten(array, depth, predicate, isStrict, result) {
|
|
8323
|
+
var index = -1,
|
|
8324
|
+
length = array.length;
|
|
8325
|
+
|
|
8326
|
+
predicate || (predicate = _isFlattenable);
|
|
8327
|
+
result || (result = []);
|
|
8328
|
+
|
|
8329
|
+
while (++index < length) {
|
|
8330
|
+
var value = array[index];
|
|
8331
|
+
if (depth > 0 && predicate(value)) {
|
|
8332
|
+
if (depth > 1) {
|
|
8333
|
+
// Recursively flatten arrays (susceptible to call stack limits).
|
|
8334
|
+
baseFlatten(value, depth - 1, predicate, isStrict, result);
|
|
8335
|
+
} else {
|
|
8336
|
+
_arrayPush(result, value);
|
|
8337
|
+
}
|
|
8338
|
+
} else if (!isStrict) {
|
|
8339
|
+
result[result.length] = value;
|
|
8340
|
+
}
|
|
8341
|
+
}
|
|
8342
|
+
return result;
|
|
8343
|
+
}
|
|
8344
|
+
|
|
8345
|
+
var _baseFlatten = baseFlatten;
|
|
8346
|
+
|
|
8347
|
+
/**
|
|
8348
|
+
* A specialized version of `_.map` for arrays without support for iteratee
|
|
8349
|
+
* shorthands.
|
|
8350
|
+
*
|
|
8351
|
+
* @private
|
|
8352
|
+
* @param {Array} [array] The array to iterate over.
|
|
8353
|
+
* @param {Function} iteratee The function invoked per iteration.
|
|
8354
|
+
* @returns {Array} Returns the new mapped array.
|
|
8355
|
+
*/
|
|
8356
|
+
function arrayMap(array, iteratee) {
|
|
8357
|
+
var index = -1,
|
|
8358
|
+
length = array == null ? 0 : array.length,
|
|
8359
|
+
result = Array(length);
|
|
8360
|
+
|
|
8361
|
+
while (++index < length) {
|
|
8362
|
+
result[index] = iteratee(array[index], index, array);
|
|
8363
|
+
}
|
|
8364
|
+
return result;
|
|
8365
|
+
}
|
|
8366
|
+
|
|
8367
|
+
var _arrayMap = arrayMap;
|
|
8368
|
+
|
|
8369
|
+
/** `Object#toString` result references. */
|
|
8370
|
+
var symbolTag = '[object Symbol]';
|
|
8371
|
+
|
|
8372
|
+
/**
|
|
8373
|
+
* Checks if `value` is classified as a `Symbol` primitive or object.
|
|
8374
|
+
*
|
|
8375
|
+
* @static
|
|
8376
|
+
* @memberOf _
|
|
8377
|
+
* @since 4.0.0
|
|
8378
|
+
* @category Lang
|
|
8379
|
+
* @param {*} value The value to check.
|
|
8380
|
+
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
|
8381
|
+
* @example
|
|
8382
|
+
*
|
|
8383
|
+
* _.isSymbol(Symbol.iterator);
|
|
8384
|
+
* // => true
|
|
8385
|
+
*
|
|
8386
|
+
* _.isSymbol('abc');
|
|
8387
|
+
* // => false
|
|
8388
|
+
*/
|
|
8389
|
+
function isSymbol(value) {
|
|
8390
|
+
return typeof value == 'symbol' ||
|
|
8391
|
+
(isObjectLike_1(value) && _baseGetTag(value) == symbolTag);
|
|
8392
|
+
}
|
|
8393
|
+
|
|
8394
|
+
var isSymbol_1 = isSymbol;
|
|
8395
|
+
|
|
8396
|
+
/** Used to match property names within property paths. */
|
|
8397
|
+
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
|
|
8398
|
+
reIsPlainProp = /^\w*$/;
|
|
8399
|
+
|
|
8400
|
+
/**
|
|
8401
|
+
* Checks if `value` is a property name and not a property path.
|
|
8402
|
+
*
|
|
8403
|
+
* @private
|
|
8404
|
+
* @param {*} value The value to check.
|
|
8405
|
+
* @param {Object} [object] The object to query keys on.
|
|
8406
|
+
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
|
|
8407
|
+
*/
|
|
8408
|
+
function isKey(value, object) {
|
|
8409
|
+
if (isArray_1(value)) {
|
|
8410
|
+
return false;
|
|
8411
|
+
}
|
|
8412
|
+
var type = typeof value;
|
|
8413
|
+
if (type == 'number' || type == 'symbol' || type == 'boolean' ||
|
|
8414
|
+
value == null || isSymbol_1(value)) {
|
|
8415
|
+
return true;
|
|
8416
|
+
}
|
|
8417
|
+
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
|
|
8418
|
+
(object != null && value in Object(object));
|
|
8419
|
+
}
|
|
8420
|
+
|
|
8421
|
+
var _isKey = isKey;
|
|
8422
|
+
|
|
8423
|
+
/** Error message constants. */
|
|
8424
|
+
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
8425
|
+
|
|
8426
|
+
/**
|
|
8427
|
+
* Creates a function that memoizes the result of `func`. If `resolver` is
|
|
8428
|
+
* provided, it determines the cache key for storing the result based on the
|
|
8429
|
+
* arguments provided to the memoized function. By default, the first argument
|
|
8430
|
+
* provided to the memoized function is used as the map cache key. The `func`
|
|
8431
|
+
* is invoked with the `this` binding of the memoized function.
|
|
8432
|
+
*
|
|
8433
|
+
* **Note:** The cache is exposed as the `cache` property on the memoized
|
|
8434
|
+
* function. Its creation may be customized by replacing the `_.memoize.Cache`
|
|
8435
|
+
* constructor with one whose instances implement the
|
|
8436
|
+
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
|
|
8437
|
+
* method interface of `clear`, `delete`, `get`, `has`, and `set`.
|
|
8438
|
+
*
|
|
8439
|
+
* @static
|
|
8440
|
+
* @memberOf _
|
|
8441
|
+
* @since 0.1.0
|
|
8442
|
+
* @category Function
|
|
8443
|
+
* @param {Function} func The function to have its output memoized.
|
|
8444
|
+
* @param {Function} [resolver] The function to resolve the cache key.
|
|
8445
|
+
* @returns {Function} Returns the new memoized function.
|
|
8446
|
+
* @example
|
|
8447
|
+
*
|
|
8448
|
+
* var object = { 'a': 1, 'b': 2 };
|
|
8449
|
+
* var other = { 'c': 3, 'd': 4 };
|
|
8450
|
+
*
|
|
8451
|
+
* var values = _.memoize(_.values);
|
|
8452
|
+
* values(object);
|
|
8453
|
+
* // => [1, 2]
|
|
8454
|
+
*
|
|
8455
|
+
* values(other);
|
|
8456
|
+
* // => [3, 4]
|
|
8457
|
+
*
|
|
8458
|
+
* object.a = 2;
|
|
8459
|
+
* values(object);
|
|
8460
|
+
* // => [1, 2]
|
|
8461
|
+
*
|
|
8462
|
+
* // Modify the result cache.
|
|
8463
|
+
* values.cache.set(object, ['a', 'b']);
|
|
8464
|
+
* values(object);
|
|
8465
|
+
* // => ['a', 'b']
|
|
8466
|
+
*
|
|
8467
|
+
* // Replace `_.memoize.Cache`.
|
|
8468
|
+
* _.memoize.Cache = WeakMap;
|
|
8469
|
+
*/
|
|
8470
|
+
function memoize(func, resolver) {
|
|
8471
|
+
if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
|
|
8472
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
8473
|
+
}
|
|
8474
|
+
var memoized = function() {
|
|
8475
|
+
var args = arguments,
|
|
8476
|
+
key = resolver ? resolver.apply(this, args) : args[0],
|
|
8477
|
+
cache = memoized.cache;
|
|
8478
|
+
|
|
8479
|
+
if (cache.has(key)) {
|
|
8480
|
+
return cache.get(key);
|
|
8481
|
+
}
|
|
8482
|
+
var result = func.apply(this, args);
|
|
8483
|
+
memoized.cache = cache.set(key, result) || cache;
|
|
8484
|
+
return result;
|
|
8485
|
+
};
|
|
8486
|
+
memoized.cache = new (memoize.Cache || _MapCache);
|
|
8487
|
+
return memoized;
|
|
8488
|
+
}
|
|
8489
|
+
|
|
8490
|
+
// Expose `MapCache`.
|
|
8491
|
+
memoize.Cache = _MapCache;
|
|
8492
|
+
|
|
8493
|
+
var memoize_1 = memoize;
|
|
8494
|
+
|
|
8495
|
+
/** Used as the maximum memoize cache size. */
|
|
8496
|
+
var MAX_MEMOIZE_SIZE = 500;
|
|
8497
|
+
|
|
8498
|
+
/**
|
|
8499
|
+
* A specialized version of `_.memoize` which clears the memoized function's
|
|
8500
|
+
* cache when it exceeds `MAX_MEMOIZE_SIZE`.
|
|
8501
|
+
*
|
|
8502
|
+
* @private
|
|
8503
|
+
* @param {Function} func The function to have its output memoized.
|
|
8504
|
+
* @returns {Function} Returns the new memoized function.
|
|
8505
|
+
*/
|
|
8506
|
+
function memoizeCapped(func) {
|
|
8507
|
+
var result = memoize_1(func, function(key) {
|
|
8508
|
+
if (cache.size === MAX_MEMOIZE_SIZE) {
|
|
8509
|
+
cache.clear();
|
|
8510
|
+
}
|
|
8511
|
+
return key;
|
|
8512
|
+
});
|
|
8513
|
+
|
|
8514
|
+
var cache = result.cache;
|
|
8515
|
+
return result;
|
|
8516
|
+
}
|
|
8517
|
+
|
|
8518
|
+
var _memoizeCapped = memoizeCapped;
|
|
8519
|
+
|
|
8520
|
+
/** Used to match property names within property paths. */
|
|
8521
|
+
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
|
8522
|
+
|
|
8523
|
+
/** Used to match backslashes in property paths. */
|
|
8524
|
+
var reEscapeChar = /\\(\\)?/g;
|
|
8525
|
+
|
|
8526
|
+
/**
|
|
8527
|
+
* Converts `string` to a property path array.
|
|
8528
|
+
*
|
|
8529
|
+
* @private
|
|
8530
|
+
* @param {string} string The string to convert.
|
|
8531
|
+
* @returns {Array} Returns the property path array.
|
|
8532
|
+
*/
|
|
8533
|
+
var stringToPath = _memoizeCapped(function(string) {
|
|
8534
|
+
var result = [];
|
|
8535
|
+
if (string.charCodeAt(0) === 46 /* . */) {
|
|
8536
|
+
result.push('');
|
|
8537
|
+
}
|
|
8538
|
+
string.replace(rePropName, function(match, number, quote, subString) {
|
|
8539
|
+
result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
|
|
8540
|
+
});
|
|
8541
|
+
return result;
|
|
8542
|
+
});
|
|
8543
|
+
|
|
8544
|
+
var _stringToPath = stringToPath;
|
|
8545
|
+
|
|
8546
|
+
/** Used as references for various `Number` constants. */
|
|
8547
|
+
var INFINITY$1 = 1 / 0;
|
|
8548
|
+
|
|
8549
|
+
/** Used to convert symbols to primitives and strings. */
|
|
8550
|
+
var symbolProto = _Symbol ? _Symbol.prototype : undefined,
|
|
8551
|
+
symbolToString = symbolProto ? symbolProto.toString : undefined;
|
|
8552
|
+
|
|
8553
|
+
/**
|
|
8554
|
+
* The base implementation of `_.toString` which doesn't convert nullish
|
|
8555
|
+
* values to empty strings.
|
|
8556
|
+
*
|
|
8557
|
+
* @private
|
|
8558
|
+
* @param {*} value The value to process.
|
|
8559
|
+
* @returns {string} Returns the string.
|
|
8560
|
+
*/
|
|
8561
|
+
function baseToString(value) {
|
|
8562
|
+
// Exit early for strings to avoid a performance hit in some environments.
|
|
8563
|
+
if (typeof value == 'string') {
|
|
8564
|
+
return value;
|
|
8565
|
+
}
|
|
8566
|
+
if (isArray_1(value)) {
|
|
8567
|
+
// Recursively convert values (susceptible to call stack limits).
|
|
8568
|
+
return _arrayMap(value, baseToString) + '';
|
|
8569
|
+
}
|
|
8570
|
+
if (isSymbol_1(value)) {
|
|
8571
|
+
return symbolToString ? symbolToString.call(value) : '';
|
|
8572
|
+
}
|
|
8573
|
+
var result = (value + '');
|
|
8574
|
+
return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result;
|
|
8575
|
+
}
|
|
8576
|
+
|
|
8577
|
+
var _baseToString = baseToString;
|
|
8578
|
+
|
|
8579
|
+
/**
|
|
8580
|
+
* Converts `value` to a string. An empty string is returned for `null`
|
|
8581
|
+
* and `undefined` values. The sign of `-0` is preserved.
|
|
8582
|
+
*
|
|
8583
|
+
* @static
|
|
8584
|
+
* @memberOf _
|
|
8585
|
+
* @since 4.0.0
|
|
8586
|
+
* @category Lang
|
|
8587
|
+
* @param {*} value The value to convert.
|
|
8588
|
+
* @returns {string} Returns the converted string.
|
|
8589
|
+
* @example
|
|
8590
|
+
*
|
|
8591
|
+
* _.toString(null);
|
|
8592
|
+
* // => ''
|
|
8593
|
+
*
|
|
8594
|
+
* _.toString(-0);
|
|
8595
|
+
* // => '-0'
|
|
8596
|
+
*
|
|
8597
|
+
* _.toString([1, 2, 3]);
|
|
8598
|
+
* // => '1,2,3'
|
|
8599
|
+
*/
|
|
8600
|
+
function toString$1(value) {
|
|
8601
|
+
return value == null ? '' : _baseToString(value);
|
|
8602
|
+
}
|
|
8603
|
+
|
|
8604
|
+
var toString_1 = toString$1;
|
|
8605
|
+
|
|
8606
|
+
/**
|
|
8607
|
+
* Casts `value` to a path array if it's not one.
|
|
8608
|
+
*
|
|
8609
|
+
* @private
|
|
8610
|
+
* @param {*} value The value to inspect.
|
|
8611
|
+
* @param {Object} [object] The object to query keys on.
|
|
8612
|
+
* @returns {Array} Returns the cast property path array.
|
|
8613
|
+
*/
|
|
8614
|
+
function castPath(value, object) {
|
|
8615
|
+
if (isArray_1(value)) {
|
|
8616
|
+
return value;
|
|
8617
|
+
}
|
|
8618
|
+
return _isKey(value, object) ? [value] : _stringToPath(toString_1(value));
|
|
8619
|
+
}
|
|
8620
|
+
|
|
8621
|
+
var _castPath = castPath;
|
|
8622
|
+
|
|
8623
|
+
/** Used as references for various `Number` constants. */
|
|
8624
|
+
var INFINITY = 1 / 0;
|
|
8625
|
+
|
|
8626
|
+
/**
|
|
8627
|
+
* Converts `value` to a string key if it's not a string or symbol.
|
|
8628
|
+
*
|
|
8629
|
+
* @private
|
|
8630
|
+
* @param {*} value The value to inspect.
|
|
8631
|
+
* @returns {string|symbol} Returns the key.
|
|
8632
|
+
*/
|
|
8633
|
+
function toKey(value) {
|
|
8634
|
+
if (typeof value == 'string' || isSymbol_1(value)) {
|
|
8635
|
+
return value;
|
|
8636
|
+
}
|
|
8637
|
+
var result = (value + '');
|
|
8638
|
+
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
|
|
8639
|
+
}
|
|
8640
|
+
|
|
8641
|
+
var _toKey = toKey;
|
|
8642
|
+
|
|
8643
|
+
/**
|
|
8644
|
+
* The base implementation of `_.get` without support for default values.
|
|
8645
|
+
*
|
|
8646
|
+
* @private
|
|
8647
|
+
* @param {Object} object The object to query.
|
|
8648
|
+
* @param {Array|string} path The path of the property to get.
|
|
8649
|
+
* @returns {*} Returns the resolved value.
|
|
8650
|
+
*/
|
|
8651
|
+
function baseGet(object, path) {
|
|
8652
|
+
path = _castPath(path, object);
|
|
8653
|
+
|
|
8654
|
+
var index = 0,
|
|
8655
|
+
length = path.length;
|
|
8656
|
+
|
|
8657
|
+
while (object != null && index < length) {
|
|
8658
|
+
object = object[_toKey(path[index++])];
|
|
8659
|
+
}
|
|
8660
|
+
return (index && index == length) ? object : undefined;
|
|
8661
|
+
}
|
|
8662
|
+
|
|
8663
|
+
var _baseGet = baseGet;
|
|
8664
|
+
|
|
8665
|
+
/** Used to compose bitmasks for value comparisons. */
|
|
8666
|
+
var COMPARE_PARTIAL_FLAG$1 = 1,
|
|
8667
|
+
COMPARE_UNORDERED_FLAG$1 = 2;
|
|
8668
|
+
|
|
8669
|
+
/**
|
|
8670
|
+
* The base implementation of `_.isMatch` without support for iteratee shorthands.
|
|
8671
|
+
*
|
|
8672
|
+
* @private
|
|
8673
|
+
* @param {Object} object The object to inspect.
|
|
8674
|
+
* @param {Object} source The object of property values to match.
|
|
8675
|
+
* @param {Array} matchData The property names, values, and compare flags to match.
|
|
8676
|
+
* @param {Function} [customizer] The function to customize comparisons.
|
|
8677
|
+
* @returns {boolean} Returns `true` if `object` is a match, else `false`.
|
|
8678
|
+
*/
|
|
8679
|
+
function baseIsMatch(object, source, matchData, customizer) {
|
|
8680
|
+
var index = matchData.length,
|
|
8681
|
+
length = index,
|
|
8682
|
+
noCustomizer = !customizer;
|
|
8683
|
+
|
|
8684
|
+
if (object == null) {
|
|
8685
|
+
return !length;
|
|
8686
|
+
}
|
|
8687
|
+
object = Object(object);
|
|
8688
|
+
while (index--) {
|
|
8689
|
+
var data = matchData[index];
|
|
8690
|
+
if ((noCustomizer && data[2])
|
|
8691
|
+
? data[1] !== object[data[0]]
|
|
8692
|
+
: !(data[0] in object)
|
|
8693
|
+
) {
|
|
8694
|
+
return false;
|
|
8695
|
+
}
|
|
8696
|
+
}
|
|
8697
|
+
while (++index < length) {
|
|
8698
|
+
data = matchData[index];
|
|
8699
|
+
var key = data[0],
|
|
8700
|
+
objValue = object[key],
|
|
8701
|
+
srcValue = data[1];
|
|
8702
|
+
|
|
8703
|
+
if (noCustomizer && data[2]) {
|
|
8704
|
+
if (objValue === undefined && !(key in object)) {
|
|
8705
|
+
return false;
|
|
8706
|
+
}
|
|
8707
|
+
} else {
|
|
8708
|
+
var stack = new _Stack;
|
|
8709
|
+
if (customizer) {
|
|
8710
|
+
var result = customizer(objValue, srcValue, key, object, source, stack);
|
|
8711
|
+
}
|
|
8712
|
+
if (!(result === undefined
|
|
8713
|
+
? _baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, customizer, stack)
|
|
8714
|
+
: result
|
|
8715
|
+
)) {
|
|
8716
|
+
return false;
|
|
8717
|
+
}
|
|
8718
|
+
}
|
|
8719
|
+
}
|
|
8720
|
+
return true;
|
|
8721
|
+
}
|
|
8722
|
+
|
|
8723
|
+
var _baseIsMatch = baseIsMatch;
|
|
8724
|
+
|
|
8725
|
+
/**
|
|
8726
|
+
* Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
|
|
8727
|
+
*
|
|
8728
|
+
* @private
|
|
8729
|
+
* @param {*} value The value to check.
|
|
8730
|
+
* @returns {boolean} Returns `true` if `value` if suitable for strict
|
|
8731
|
+
* equality comparisons, else `false`.
|
|
8732
|
+
*/
|
|
8733
|
+
function isStrictComparable(value) {
|
|
8734
|
+
return value === value && !isObject_1(value);
|
|
8735
|
+
}
|
|
8736
|
+
|
|
8737
|
+
var _isStrictComparable = isStrictComparable;
|
|
8738
|
+
|
|
8739
|
+
/**
|
|
8740
|
+
* Gets the property names, values, and compare flags of `object`.
|
|
8741
|
+
*
|
|
8742
|
+
* @private
|
|
8743
|
+
* @param {Object} object The object to query.
|
|
8744
|
+
* @returns {Array} Returns the match data of `object`.
|
|
8745
|
+
*/
|
|
8746
|
+
function getMatchData(object) {
|
|
8747
|
+
var result = keys_1(object),
|
|
8748
|
+
length = result.length;
|
|
8749
|
+
|
|
8750
|
+
while (length--) {
|
|
8751
|
+
var key = result[length],
|
|
8752
|
+
value = object[key];
|
|
8753
|
+
|
|
8754
|
+
result[length] = [key, value, _isStrictComparable(value)];
|
|
8755
|
+
}
|
|
8756
|
+
return result;
|
|
8757
|
+
}
|
|
8758
|
+
|
|
8759
|
+
var _getMatchData = getMatchData;
|
|
8760
|
+
|
|
8761
|
+
/**
|
|
8762
|
+
* A specialized version of `matchesProperty` for source values suitable
|
|
8763
|
+
* for strict equality comparisons, i.e. `===`.
|
|
8764
|
+
*
|
|
8765
|
+
* @private
|
|
8766
|
+
* @param {string} key The key of the property to get.
|
|
8767
|
+
* @param {*} srcValue The value to match.
|
|
8768
|
+
* @returns {Function} Returns the new spec function.
|
|
8769
|
+
*/
|
|
8770
|
+
function matchesStrictComparable(key, srcValue) {
|
|
8771
|
+
return function(object) {
|
|
8772
|
+
if (object == null) {
|
|
8773
|
+
return false;
|
|
8774
|
+
}
|
|
8775
|
+
return object[key] === srcValue &&
|
|
8776
|
+
(srcValue !== undefined || (key in Object(object)));
|
|
8777
|
+
};
|
|
8778
|
+
}
|
|
8779
|
+
|
|
8780
|
+
var _matchesStrictComparable = matchesStrictComparable;
|
|
8781
|
+
|
|
8782
|
+
/**
|
|
8783
|
+
* The base implementation of `_.matches` which doesn't clone `source`.
|
|
8784
|
+
*
|
|
8785
|
+
* @private
|
|
8786
|
+
* @param {Object} source The object of property values to match.
|
|
8787
|
+
* @returns {Function} Returns the new spec function.
|
|
8788
|
+
*/
|
|
8789
|
+
function baseMatches(source) {
|
|
8790
|
+
var matchData = _getMatchData(source);
|
|
8791
|
+
if (matchData.length == 1 && matchData[0][2]) {
|
|
8792
|
+
return _matchesStrictComparable(matchData[0][0], matchData[0][1]);
|
|
8793
|
+
}
|
|
8794
|
+
return function(object) {
|
|
8795
|
+
return object === source || _baseIsMatch(object, source, matchData);
|
|
8796
|
+
};
|
|
8797
|
+
}
|
|
8798
|
+
|
|
8799
|
+
var _baseMatches = baseMatches;
|
|
8800
|
+
|
|
8801
|
+
/**
|
|
8802
|
+
* Gets the value at `path` of `object`. If the resolved value is
|
|
8803
|
+
* `undefined`, the `defaultValue` is returned in its place.
|
|
8804
|
+
*
|
|
8805
|
+
* @static
|
|
8806
|
+
* @memberOf _
|
|
8807
|
+
* @since 3.7.0
|
|
8808
|
+
* @category Object
|
|
8809
|
+
* @param {Object} object The object to query.
|
|
8810
|
+
* @param {Array|string} path The path of the property to get.
|
|
8811
|
+
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
|
|
8812
|
+
* @returns {*} Returns the resolved value.
|
|
8813
|
+
* @example
|
|
8814
|
+
*
|
|
8815
|
+
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
|
|
8816
|
+
*
|
|
8817
|
+
* _.get(object, 'a[0].b.c');
|
|
8818
|
+
* // => 3
|
|
8819
|
+
*
|
|
8820
|
+
* _.get(object, ['a', '0', 'b', 'c']);
|
|
8821
|
+
* // => 3
|
|
8822
|
+
*
|
|
8823
|
+
* _.get(object, 'a.b.c', 'default');
|
|
8824
|
+
* // => 'default'
|
|
8825
|
+
*/
|
|
8826
|
+
function get(object, path, defaultValue) {
|
|
8827
|
+
var result = object == null ? undefined : _baseGet(object, path);
|
|
8828
|
+
return result === undefined ? defaultValue : result;
|
|
8829
|
+
}
|
|
8830
|
+
|
|
8831
|
+
var get_1 = get;
|
|
8832
|
+
|
|
8833
|
+
/**
|
|
8834
|
+
* The base implementation of `_.hasIn` without support for deep paths.
|
|
8835
|
+
*
|
|
8836
|
+
* @private
|
|
8837
|
+
* @param {Object} [object] The object to query.
|
|
8838
|
+
* @param {Array|string} key The key to check.
|
|
8839
|
+
* @returns {boolean} Returns `true` if `key` exists, else `false`.
|
|
8840
|
+
*/
|
|
8841
|
+
function baseHasIn(object, key) {
|
|
8842
|
+
return object != null && key in Object(object);
|
|
8843
|
+
}
|
|
8844
|
+
|
|
8845
|
+
var _baseHasIn = baseHasIn;
|
|
8846
|
+
|
|
8847
|
+
/**
|
|
8848
|
+
* Checks if `path` exists on `object`.
|
|
8849
|
+
*
|
|
8850
|
+
* @private
|
|
8851
|
+
* @param {Object} object The object to query.
|
|
8852
|
+
* @param {Array|string} path The path to check.
|
|
8853
|
+
* @param {Function} hasFunc The function to check properties.
|
|
8854
|
+
* @returns {boolean} Returns `true` if `path` exists, else `false`.
|
|
8855
|
+
*/
|
|
8856
|
+
function hasPath(object, path, hasFunc) {
|
|
8857
|
+
path = _castPath(path, object);
|
|
8858
|
+
|
|
8859
|
+
var index = -1,
|
|
8860
|
+
length = path.length,
|
|
8861
|
+
result = false;
|
|
8862
|
+
|
|
8863
|
+
while (++index < length) {
|
|
8864
|
+
var key = _toKey(path[index]);
|
|
8865
|
+
if (!(result = object != null && hasFunc(object, key))) {
|
|
8866
|
+
break;
|
|
8867
|
+
}
|
|
8868
|
+
object = object[key];
|
|
8869
|
+
}
|
|
8870
|
+
if (result || ++index != length) {
|
|
8871
|
+
return result;
|
|
8872
|
+
}
|
|
8873
|
+
length = object == null ? 0 : object.length;
|
|
8874
|
+
return !!length && isLength_1(length) && _isIndex(key, length) &&
|
|
8875
|
+
(isArray_1(object) || isArguments_1(object));
|
|
8876
|
+
}
|
|
8877
|
+
|
|
8878
|
+
var _hasPath = hasPath;
|
|
8879
|
+
|
|
8880
|
+
/**
|
|
8881
|
+
* Checks if `path` is a direct or inherited property of `object`.
|
|
8882
|
+
*
|
|
8883
|
+
* @static
|
|
8884
|
+
* @memberOf _
|
|
8885
|
+
* @since 4.0.0
|
|
8886
|
+
* @category Object
|
|
8887
|
+
* @param {Object} object The object to query.
|
|
8888
|
+
* @param {Array|string} path The path to check.
|
|
8889
|
+
* @returns {boolean} Returns `true` if `path` exists, else `false`.
|
|
8890
|
+
* @example
|
|
8891
|
+
*
|
|
8892
|
+
* var object = _.create({ 'a': _.create({ 'b': 2 }) });
|
|
8893
|
+
*
|
|
8894
|
+
* _.hasIn(object, 'a');
|
|
8895
|
+
* // => true
|
|
8896
|
+
*
|
|
8897
|
+
* _.hasIn(object, 'a.b');
|
|
8898
|
+
* // => true
|
|
8899
|
+
*
|
|
8900
|
+
* _.hasIn(object, ['a', 'b']);
|
|
8901
|
+
* // => true
|
|
8902
|
+
*
|
|
8903
|
+
* _.hasIn(object, 'b');
|
|
8904
|
+
* // => false
|
|
8905
|
+
*/
|
|
8906
|
+
function hasIn(object, path) {
|
|
8907
|
+
return object != null && _hasPath(object, path, _baseHasIn);
|
|
8908
|
+
}
|
|
8909
|
+
|
|
8910
|
+
var hasIn_1 = hasIn;
|
|
8911
|
+
|
|
8912
|
+
/** Used to compose bitmasks for value comparisons. */
|
|
8913
|
+
var COMPARE_PARTIAL_FLAG = 1,
|
|
8914
|
+
COMPARE_UNORDERED_FLAG = 2;
|
|
8915
|
+
|
|
8916
|
+
/**
|
|
8917
|
+
* The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
|
|
8918
|
+
*
|
|
8919
|
+
* @private
|
|
8920
|
+
* @param {string} path The path of the property to get.
|
|
8921
|
+
* @param {*} srcValue The value to match.
|
|
8922
|
+
* @returns {Function} Returns the new spec function.
|
|
8923
|
+
*/
|
|
8924
|
+
function baseMatchesProperty(path, srcValue) {
|
|
8925
|
+
if (_isKey(path) && _isStrictComparable(srcValue)) {
|
|
8926
|
+
return _matchesStrictComparable(_toKey(path), srcValue);
|
|
8927
|
+
}
|
|
8928
|
+
return function(object) {
|
|
8929
|
+
var objValue = get_1(object, path);
|
|
8930
|
+
return (objValue === undefined && objValue === srcValue)
|
|
8931
|
+
? hasIn_1(object, path)
|
|
8932
|
+
: _baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
|
|
8933
|
+
};
|
|
8934
|
+
}
|
|
8935
|
+
|
|
8936
|
+
var _baseMatchesProperty = baseMatchesProperty;
|
|
8937
|
+
|
|
8938
|
+
/**
|
|
8939
|
+
* This method returns the first argument it receives.
|
|
8940
|
+
*
|
|
8941
|
+
* @static
|
|
8942
|
+
* @since 0.1.0
|
|
8943
|
+
* @memberOf _
|
|
8944
|
+
* @category Util
|
|
8945
|
+
* @param {*} value Any value.
|
|
8946
|
+
* @returns {*} Returns `value`.
|
|
8947
|
+
* @example
|
|
8948
|
+
*
|
|
8949
|
+
* var object = { 'a': 1 };
|
|
8950
|
+
*
|
|
8951
|
+
* console.log(_.identity(object) === object);
|
|
8952
|
+
* // => true
|
|
8953
|
+
*/
|
|
8954
|
+
function identity(value) {
|
|
8955
|
+
return value;
|
|
8956
|
+
}
|
|
8957
|
+
|
|
8958
|
+
var identity_1 = identity;
|
|
8959
|
+
|
|
8960
|
+
/**
|
|
8961
|
+
* The base implementation of `_.property` without support for deep paths.
|
|
8962
|
+
*
|
|
8963
|
+
* @private
|
|
8964
|
+
* @param {string} key The key of the property to get.
|
|
8965
|
+
* @returns {Function} Returns the new accessor function.
|
|
8966
|
+
*/
|
|
8967
|
+
function baseProperty(key) {
|
|
8968
|
+
return function(object) {
|
|
8969
|
+
return object == null ? undefined : object[key];
|
|
8970
|
+
};
|
|
8971
|
+
}
|
|
8972
|
+
|
|
8973
|
+
var _baseProperty = baseProperty;
|
|
8974
|
+
|
|
8975
|
+
/**
|
|
8976
|
+
* A specialized version of `baseProperty` which supports deep paths.
|
|
8977
|
+
*
|
|
8978
|
+
* @private
|
|
8979
|
+
* @param {Array|string} path The path of the property to get.
|
|
8980
|
+
* @returns {Function} Returns the new accessor function.
|
|
8981
|
+
*/
|
|
8982
|
+
function basePropertyDeep(path) {
|
|
8983
|
+
return function(object) {
|
|
8984
|
+
return _baseGet(object, path);
|
|
8985
|
+
};
|
|
8986
|
+
}
|
|
8987
|
+
|
|
8988
|
+
var _basePropertyDeep = basePropertyDeep;
|
|
8989
|
+
|
|
8990
|
+
/**
|
|
8991
|
+
* Creates a function that returns the value at `path` of a given object.
|
|
8992
|
+
*
|
|
8993
|
+
* @static
|
|
8994
|
+
* @memberOf _
|
|
8995
|
+
* @since 2.4.0
|
|
8996
|
+
* @category Util
|
|
8997
|
+
* @param {Array|string} path The path of the property to get.
|
|
8998
|
+
* @returns {Function} Returns the new accessor function.
|
|
8999
|
+
* @example
|
|
9000
|
+
*
|
|
9001
|
+
* var objects = [
|
|
9002
|
+
* { 'a': { 'b': 2 } },
|
|
9003
|
+
* { 'a': { 'b': 1 } }
|
|
9004
|
+
* ];
|
|
9005
|
+
*
|
|
9006
|
+
* _.map(objects, _.property('a.b'));
|
|
9007
|
+
* // => [2, 1]
|
|
9008
|
+
*
|
|
9009
|
+
* _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
|
|
9010
|
+
* // => [1, 2]
|
|
9011
|
+
*/
|
|
9012
|
+
function property(path) {
|
|
9013
|
+
return _isKey(path) ? _baseProperty(_toKey(path)) : _basePropertyDeep(path);
|
|
9014
|
+
}
|
|
9015
|
+
|
|
9016
|
+
var property_1 = property;
|
|
9017
|
+
|
|
9018
|
+
/**
|
|
9019
|
+
* The base implementation of `_.iteratee`.
|
|
9020
|
+
*
|
|
9021
|
+
* @private
|
|
9022
|
+
* @param {*} [value=_.identity] The value to convert to an iteratee.
|
|
9023
|
+
* @returns {Function} Returns the iteratee.
|
|
9024
|
+
*/
|
|
9025
|
+
function baseIteratee(value) {
|
|
9026
|
+
// Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
|
|
9027
|
+
// See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
|
|
9028
|
+
if (typeof value == 'function') {
|
|
9029
|
+
return value;
|
|
9030
|
+
}
|
|
9031
|
+
if (value == null) {
|
|
9032
|
+
return identity_1;
|
|
9033
|
+
}
|
|
9034
|
+
if (typeof value == 'object') {
|
|
9035
|
+
return isArray_1(value)
|
|
9036
|
+
? _baseMatchesProperty(value[0], value[1])
|
|
9037
|
+
: _baseMatches(value);
|
|
9038
|
+
}
|
|
9039
|
+
return property_1(value);
|
|
9040
|
+
}
|
|
9041
|
+
|
|
9042
|
+
var _baseIteratee = baseIteratee;
|
|
9043
|
+
|
|
9044
|
+
/**
|
|
9045
|
+
* Creates a base function for methods like `_.forIn` and `_.forOwn`.
|
|
9046
|
+
*
|
|
9047
|
+
* @private
|
|
9048
|
+
* @param {boolean} [fromRight] Specify iterating from right to left.
|
|
9049
|
+
* @returns {Function} Returns the new base function.
|
|
9050
|
+
*/
|
|
9051
|
+
function createBaseFor(fromRight) {
|
|
9052
|
+
return function(object, iteratee, keysFunc) {
|
|
9053
|
+
var index = -1,
|
|
9054
|
+
iterable = Object(object),
|
|
9055
|
+
props = keysFunc(object),
|
|
9056
|
+
length = props.length;
|
|
9057
|
+
|
|
9058
|
+
while (length--) {
|
|
9059
|
+
var key = props[fromRight ? length : ++index];
|
|
9060
|
+
if (iteratee(iterable[key], key, iterable) === false) {
|
|
9061
|
+
break;
|
|
9062
|
+
}
|
|
9063
|
+
}
|
|
9064
|
+
return object;
|
|
9065
|
+
};
|
|
9066
|
+
}
|
|
9067
|
+
|
|
9068
|
+
var _createBaseFor = createBaseFor;
|
|
9069
|
+
|
|
9070
|
+
/**
|
|
9071
|
+
* The base implementation of `baseForOwn` which iterates over `object`
|
|
9072
|
+
* properties returned by `keysFunc` and invokes `iteratee` for each property.
|
|
9073
|
+
* Iteratee functions may exit iteration early by explicitly returning `false`.
|
|
9074
|
+
*
|
|
9075
|
+
* @private
|
|
9076
|
+
* @param {Object} object The object to iterate over.
|
|
9077
|
+
* @param {Function} iteratee The function invoked per iteration.
|
|
9078
|
+
* @param {Function} keysFunc The function to get the keys of `object`.
|
|
9079
|
+
* @returns {Object} Returns `object`.
|
|
9080
|
+
*/
|
|
9081
|
+
var baseFor = _createBaseFor();
|
|
9082
|
+
|
|
9083
|
+
var _baseFor = baseFor;
|
|
9084
|
+
|
|
9085
|
+
/**
|
|
9086
|
+
* The base implementation of `_.forOwn` without support for iteratee shorthands.
|
|
9087
|
+
*
|
|
9088
|
+
* @private
|
|
9089
|
+
* @param {Object} object The object to iterate over.
|
|
9090
|
+
* @param {Function} iteratee The function invoked per iteration.
|
|
9091
|
+
* @returns {Object} Returns `object`.
|
|
9092
|
+
*/
|
|
9093
|
+
function baseForOwn(object, iteratee) {
|
|
9094
|
+
return object && _baseFor(object, iteratee, keys_1);
|
|
9095
|
+
}
|
|
9096
|
+
|
|
9097
|
+
var _baseForOwn = baseForOwn;
|
|
9098
|
+
|
|
9099
|
+
/**
|
|
9100
|
+
* Creates a `baseEach` or `baseEachRight` function.
|
|
9101
|
+
*
|
|
9102
|
+
* @private
|
|
9103
|
+
* @param {Function} eachFunc The function to iterate over a collection.
|
|
9104
|
+
* @param {boolean} [fromRight] Specify iterating from right to left.
|
|
9105
|
+
* @returns {Function} Returns the new base function.
|
|
9106
|
+
*/
|
|
9107
|
+
function createBaseEach(eachFunc, fromRight) {
|
|
9108
|
+
return function(collection, iteratee) {
|
|
9109
|
+
if (collection == null) {
|
|
9110
|
+
return collection;
|
|
9111
|
+
}
|
|
9112
|
+
if (!isArrayLike_1(collection)) {
|
|
9113
|
+
return eachFunc(collection, iteratee);
|
|
9114
|
+
}
|
|
9115
|
+
var length = collection.length,
|
|
9116
|
+
index = fromRight ? length : -1,
|
|
9117
|
+
iterable = Object(collection);
|
|
9118
|
+
|
|
9119
|
+
while ((fromRight ? index-- : ++index < length)) {
|
|
9120
|
+
if (iteratee(iterable[index], index, iterable) === false) {
|
|
9121
|
+
break;
|
|
9122
|
+
}
|
|
9123
|
+
}
|
|
9124
|
+
return collection;
|
|
9125
|
+
};
|
|
9126
|
+
}
|
|
9127
|
+
|
|
9128
|
+
var _createBaseEach = createBaseEach;
|
|
9129
|
+
|
|
9130
|
+
/**
|
|
9131
|
+
* The base implementation of `_.forEach` without support for iteratee shorthands.
|
|
9132
|
+
*
|
|
9133
|
+
* @private
|
|
9134
|
+
* @param {Array|Object} collection The collection to iterate over.
|
|
9135
|
+
* @param {Function} iteratee The function invoked per iteration.
|
|
9136
|
+
* @returns {Array|Object} Returns `collection`.
|
|
9137
|
+
*/
|
|
9138
|
+
var baseEach = _createBaseEach(_baseForOwn);
|
|
9139
|
+
|
|
9140
|
+
var _baseEach = baseEach;
|
|
9141
|
+
|
|
9142
|
+
/**
|
|
9143
|
+
* The base implementation of `_.map` without support for iteratee shorthands.
|
|
9144
|
+
*
|
|
9145
|
+
* @private
|
|
9146
|
+
* @param {Array|Object} collection The collection to iterate over.
|
|
9147
|
+
* @param {Function} iteratee The function invoked per iteration.
|
|
9148
|
+
* @returns {Array} Returns the new mapped array.
|
|
9149
|
+
*/
|
|
9150
|
+
function baseMap(collection, iteratee) {
|
|
9151
|
+
var index = -1,
|
|
9152
|
+
result = isArrayLike_1(collection) ? Array(collection.length) : [];
|
|
9153
|
+
|
|
9154
|
+
_baseEach(collection, function(value, key, collection) {
|
|
9155
|
+
result[++index] = iteratee(value, key, collection);
|
|
9156
|
+
});
|
|
9157
|
+
return result;
|
|
9158
|
+
}
|
|
9159
|
+
|
|
9160
|
+
var _baseMap = baseMap;
|
|
9161
|
+
|
|
9162
|
+
/**
|
|
9163
|
+
* The base implementation of `_.sortBy` which uses `comparer` to define the
|
|
9164
|
+
* sort order of `array` and replaces criteria objects with their corresponding
|
|
9165
|
+
* values.
|
|
9166
|
+
*
|
|
9167
|
+
* @private
|
|
9168
|
+
* @param {Array} array The array to sort.
|
|
9169
|
+
* @param {Function} comparer The function to define sort order.
|
|
9170
|
+
* @returns {Array} Returns `array`.
|
|
9171
|
+
*/
|
|
9172
|
+
function baseSortBy(array, comparer) {
|
|
9173
|
+
var length = array.length;
|
|
9174
|
+
|
|
9175
|
+
array.sort(comparer);
|
|
9176
|
+
while (length--) {
|
|
9177
|
+
array[length] = array[length].value;
|
|
9178
|
+
}
|
|
9179
|
+
return array;
|
|
9180
|
+
}
|
|
9181
|
+
|
|
9182
|
+
var _baseSortBy = baseSortBy;
|
|
9183
|
+
|
|
9184
|
+
/**
|
|
9185
|
+
* Compares values to sort them in ascending order.
|
|
9186
|
+
*
|
|
9187
|
+
* @private
|
|
9188
|
+
* @param {*} value The value to compare.
|
|
9189
|
+
* @param {*} other The other value to compare.
|
|
9190
|
+
* @returns {number} Returns the sort order indicator for `value`.
|
|
9191
|
+
*/
|
|
9192
|
+
function compareAscending(value, other) {
|
|
9193
|
+
if (value !== other) {
|
|
9194
|
+
var valIsDefined = value !== undefined,
|
|
9195
|
+
valIsNull = value === null,
|
|
9196
|
+
valIsReflexive = value === value,
|
|
9197
|
+
valIsSymbol = isSymbol_1(value);
|
|
9198
|
+
|
|
9199
|
+
var othIsDefined = other !== undefined,
|
|
9200
|
+
othIsNull = other === null,
|
|
9201
|
+
othIsReflexive = other === other,
|
|
9202
|
+
othIsSymbol = isSymbol_1(other);
|
|
9203
|
+
|
|
9204
|
+
if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
|
|
9205
|
+
(valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
|
|
9206
|
+
(valIsNull && othIsDefined && othIsReflexive) ||
|
|
9207
|
+
(!valIsDefined && othIsReflexive) ||
|
|
9208
|
+
!valIsReflexive) {
|
|
9209
|
+
return 1;
|
|
9210
|
+
}
|
|
9211
|
+
if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
|
|
9212
|
+
(othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
|
|
9213
|
+
(othIsNull && valIsDefined && valIsReflexive) ||
|
|
9214
|
+
(!othIsDefined && valIsReflexive) ||
|
|
9215
|
+
!othIsReflexive) {
|
|
9216
|
+
return -1;
|
|
9217
|
+
}
|
|
9218
|
+
}
|
|
9219
|
+
return 0;
|
|
9220
|
+
}
|
|
9221
|
+
|
|
9222
|
+
var _compareAscending = compareAscending;
|
|
9223
|
+
|
|
9224
|
+
/**
|
|
9225
|
+
* Used by `_.orderBy` to compare multiple properties of a value to another
|
|
9226
|
+
* and stable sort them.
|
|
9227
|
+
*
|
|
9228
|
+
* If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
|
|
9229
|
+
* specify an order of "desc" for descending or "asc" for ascending sort order
|
|
9230
|
+
* of corresponding values.
|
|
9231
|
+
*
|
|
9232
|
+
* @private
|
|
9233
|
+
* @param {Object} object The object to compare.
|
|
9234
|
+
* @param {Object} other The other object to compare.
|
|
9235
|
+
* @param {boolean[]|string[]} orders The order to sort by for each property.
|
|
9236
|
+
* @returns {number} Returns the sort order indicator for `object`.
|
|
9237
|
+
*/
|
|
9238
|
+
function compareMultiple(object, other, orders) {
|
|
9239
|
+
var index = -1,
|
|
9240
|
+
objCriteria = object.criteria,
|
|
9241
|
+
othCriteria = other.criteria,
|
|
9242
|
+
length = objCriteria.length,
|
|
9243
|
+
ordersLength = orders.length;
|
|
9244
|
+
|
|
9245
|
+
while (++index < length) {
|
|
9246
|
+
var result = _compareAscending(objCriteria[index], othCriteria[index]);
|
|
9247
|
+
if (result) {
|
|
9248
|
+
if (index >= ordersLength) {
|
|
9249
|
+
return result;
|
|
9250
|
+
}
|
|
9251
|
+
var order = orders[index];
|
|
9252
|
+
return result * (order == 'desc' ? -1 : 1);
|
|
9253
|
+
}
|
|
9254
|
+
}
|
|
9255
|
+
// Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
|
|
9256
|
+
// that causes it, under certain circumstances, to provide the same value for
|
|
9257
|
+
// `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
|
|
9258
|
+
// for more details.
|
|
9259
|
+
//
|
|
9260
|
+
// This also ensures a stable sort in V8 and other engines.
|
|
9261
|
+
// See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
|
|
9262
|
+
return object.index - other.index;
|
|
9263
|
+
}
|
|
9264
|
+
|
|
9265
|
+
var _compareMultiple = compareMultiple;
|
|
9266
|
+
|
|
9267
|
+
/**
|
|
9268
|
+
* The base implementation of `_.orderBy` without param guards.
|
|
9269
|
+
*
|
|
9270
|
+
* @private
|
|
9271
|
+
* @param {Array|Object} collection The collection to iterate over.
|
|
9272
|
+
* @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
|
|
9273
|
+
* @param {string[]} orders The sort orders of `iteratees`.
|
|
9274
|
+
* @returns {Array} Returns the new sorted array.
|
|
9275
|
+
*/
|
|
9276
|
+
function baseOrderBy(collection, iteratees, orders) {
|
|
9277
|
+
if (iteratees.length) {
|
|
9278
|
+
iteratees = _arrayMap(iteratees, function(iteratee) {
|
|
9279
|
+
if (isArray_1(iteratee)) {
|
|
9280
|
+
return function(value) {
|
|
9281
|
+
return _baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
|
|
9282
|
+
}
|
|
9283
|
+
}
|
|
9284
|
+
return iteratee;
|
|
9285
|
+
});
|
|
9286
|
+
} else {
|
|
9287
|
+
iteratees = [identity_1];
|
|
9288
|
+
}
|
|
9289
|
+
|
|
9290
|
+
var index = -1;
|
|
9291
|
+
iteratees = _arrayMap(iteratees, _baseUnary(_baseIteratee));
|
|
9292
|
+
|
|
9293
|
+
var result = _baseMap(collection, function(value, key, collection) {
|
|
9294
|
+
var criteria = _arrayMap(iteratees, function(iteratee) {
|
|
9295
|
+
return iteratee(value);
|
|
9296
|
+
});
|
|
9297
|
+
return { 'criteria': criteria, 'index': ++index, 'value': value };
|
|
9298
|
+
});
|
|
9299
|
+
|
|
9300
|
+
return _baseSortBy(result, function(object, other) {
|
|
9301
|
+
return _compareMultiple(object, other, orders);
|
|
9302
|
+
});
|
|
9303
|
+
}
|
|
9304
|
+
|
|
9305
|
+
var _baseOrderBy = baseOrderBy;
|
|
9306
|
+
|
|
9307
|
+
/**
|
|
9308
|
+
* A faster alternative to `Function#apply`, this function invokes `func`
|
|
9309
|
+
* with the `this` binding of `thisArg` and the arguments of `args`.
|
|
9310
|
+
*
|
|
9311
|
+
* @private
|
|
9312
|
+
* @param {Function} func The function to invoke.
|
|
9313
|
+
* @param {*} thisArg The `this` binding of `func`.
|
|
9314
|
+
* @param {Array} args The arguments to invoke `func` with.
|
|
9315
|
+
* @returns {*} Returns the result of `func`.
|
|
9316
|
+
*/
|
|
9317
|
+
function apply(func, thisArg, args) {
|
|
9318
|
+
switch (args.length) {
|
|
9319
|
+
case 0: return func.call(thisArg);
|
|
9320
|
+
case 1: return func.call(thisArg, args[0]);
|
|
9321
|
+
case 2: return func.call(thisArg, args[0], args[1]);
|
|
9322
|
+
case 3: return func.call(thisArg, args[0], args[1], args[2]);
|
|
9323
|
+
}
|
|
9324
|
+
return func.apply(thisArg, args);
|
|
9325
|
+
}
|
|
9326
|
+
|
|
9327
|
+
var _apply = apply;
|
|
9328
|
+
|
|
9329
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
9330
|
+
var nativeMax = Math.max;
|
|
9331
|
+
|
|
9332
|
+
/**
|
|
9333
|
+
* A specialized version of `baseRest` which transforms the rest array.
|
|
9334
|
+
*
|
|
9335
|
+
* @private
|
|
9336
|
+
* @param {Function} func The function to apply a rest parameter to.
|
|
9337
|
+
* @param {number} [start=func.length-1] The start position of the rest parameter.
|
|
9338
|
+
* @param {Function} transform The rest array transform.
|
|
9339
|
+
* @returns {Function} Returns the new function.
|
|
9340
|
+
*/
|
|
9341
|
+
function overRest(func, start, transform) {
|
|
9342
|
+
start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
|
|
9343
|
+
return function() {
|
|
9344
|
+
var args = arguments,
|
|
9345
|
+
index = -1,
|
|
9346
|
+
length = nativeMax(args.length - start, 0),
|
|
9347
|
+
array = Array(length);
|
|
9348
|
+
|
|
9349
|
+
while (++index < length) {
|
|
9350
|
+
array[index] = args[start + index];
|
|
9351
|
+
}
|
|
9352
|
+
index = -1;
|
|
9353
|
+
var otherArgs = Array(start + 1);
|
|
9354
|
+
while (++index < start) {
|
|
9355
|
+
otherArgs[index] = args[index];
|
|
9356
|
+
}
|
|
9357
|
+
otherArgs[start] = transform(array);
|
|
9358
|
+
return _apply(func, this, otherArgs);
|
|
9359
|
+
};
|
|
9360
|
+
}
|
|
9361
|
+
|
|
9362
|
+
var _overRest = overRest;
|
|
9363
|
+
|
|
9364
|
+
/**
|
|
9365
|
+
* Creates a function that returns `value`.
|
|
9366
|
+
*
|
|
9367
|
+
* @static
|
|
9368
|
+
* @memberOf _
|
|
9369
|
+
* @since 2.4.0
|
|
9370
|
+
* @category Util
|
|
9371
|
+
* @param {*} value The value to return from the new function.
|
|
9372
|
+
* @returns {Function} Returns the new constant function.
|
|
9373
|
+
* @example
|
|
9374
|
+
*
|
|
9375
|
+
* var objects = _.times(2, _.constant({ 'a': 1 }));
|
|
9376
|
+
*
|
|
9377
|
+
* console.log(objects);
|
|
9378
|
+
* // => [{ 'a': 1 }, { 'a': 1 }]
|
|
9379
|
+
*
|
|
9380
|
+
* console.log(objects[0] === objects[1]);
|
|
9381
|
+
* // => true
|
|
9382
|
+
*/
|
|
9383
|
+
function constant(value) {
|
|
9384
|
+
return function() {
|
|
9385
|
+
return value;
|
|
9386
|
+
};
|
|
9387
|
+
}
|
|
9388
|
+
|
|
9389
|
+
var constant_1 = constant;
|
|
9390
|
+
|
|
9391
|
+
var defineProperty = (function() {
|
|
9392
|
+
try {
|
|
9393
|
+
var func = _getNative(Object, 'defineProperty');
|
|
9394
|
+
func({}, '', {});
|
|
9395
|
+
return func;
|
|
9396
|
+
} catch (e) {}
|
|
9397
|
+
}());
|
|
9398
|
+
|
|
9399
|
+
var _defineProperty = defineProperty;
|
|
9400
|
+
|
|
9401
|
+
/**
|
|
9402
|
+
* The base implementation of `setToString` without support for hot loop shorting.
|
|
9403
|
+
*
|
|
9404
|
+
* @private
|
|
9405
|
+
* @param {Function} func The function to modify.
|
|
9406
|
+
* @param {Function} string The `toString` result.
|
|
9407
|
+
* @returns {Function} Returns `func`.
|
|
9408
|
+
*/
|
|
9409
|
+
var baseSetToString = !_defineProperty ? identity_1 : function(func, string) {
|
|
9410
|
+
return _defineProperty(func, 'toString', {
|
|
9411
|
+
'configurable': true,
|
|
9412
|
+
'enumerable': false,
|
|
9413
|
+
'value': constant_1(string),
|
|
9414
|
+
'writable': true
|
|
9415
|
+
});
|
|
9416
|
+
};
|
|
9417
|
+
|
|
9418
|
+
var _baseSetToString = baseSetToString;
|
|
9419
|
+
|
|
9420
|
+
/** Used to detect hot functions by number of calls within a span of milliseconds. */
|
|
9421
|
+
var HOT_COUNT = 800,
|
|
9422
|
+
HOT_SPAN = 16;
|
|
9423
|
+
|
|
9424
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
9425
|
+
var nativeNow = Date.now;
|
|
9426
|
+
|
|
9427
|
+
/**
|
|
9428
|
+
* Creates a function that'll short out and invoke `identity` instead
|
|
9429
|
+
* of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
|
|
9430
|
+
* milliseconds.
|
|
9431
|
+
*
|
|
9432
|
+
* @private
|
|
9433
|
+
* @param {Function} func The function to restrict.
|
|
9434
|
+
* @returns {Function} Returns the new shortable function.
|
|
9435
|
+
*/
|
|
9436
|
+
function shortOut(func) {
|
|
9437
|
+
var count = 0,
|
|
9438
|
+
lastCalled = 0;
|
|
9439
|
+
|
|
9440
|
+
return function() {
|
|
9441
|
+
var stamp = nativeNow(),
|
|
9442
|
+
remaining = HOT_SPAN - (stamp - lastCalled);
|
|
9443
|
+
|
|
9444
|
+
lastCalled = stamp;
|
|
9445
|
+
if (remaining > 0) {
|
|
9446
|
+
if (++count >= HOT_COUNT) {
|
|
9447
|
+
return arguments[0];
|
|
9448
|
+
}
|
|
9449
|
+
} else {
|
|
9450
|
+
count = 0;
|
|
9451
|
+
}
|
|
9452
|
+
return func.apply(undefined, arguments);
|
|
9453
|
+
};
|
|
9454
|
+
}
|
|
9455
|
+
|
|
9456
|
+
var _shortOut = shortOut;
|
|
9457
|
+
|
|
9458
|
+
/**
|
|
9459
|
+
* Sets the `toString` method of `func` to return `string`.
|
|
9460
|
+
*
|
|
9461
|
+
* @private
|
|
9462
|
+
* @param {Function} func The function to modify.
|
|
9463
|
+
* @param {Function} string The `toString` result.
|
|
9464
|
+
* @returns {Function} Returns `func`.
|
|
9465
|
+
*/
|
|
9466
|
+
var setToString = _shortOut(_baseSetToString);
|
|
9467
|
+
|
|
9468
|
+
var _setToString = setToString;
|
|
9469
|
+
|
|
9470
|
+
/**
|
|
9471
|
+
* The base implementation of `_.rest` which doesn't validate or coerce arguments.
|
|
9472
|
+
*
|
|
9473
|
+
* @private
|
|
9474
|
+
* @param {Function} func The function to apply a rest parameter to.
|
|
9475
|
+
* @param {number} [start=func.length-1] The start position of the rest parameter.
|
|
9476
|
+
* @returns {Function} Returns the new function.
|
|
9477
|
+
*/
|
|
9478
|
+
function baseRest(func, start) {
|
|
9479
|
+
return _setToString(_overRest(func, start, identity_1), func + '');
|
|
9480
|
+
}
|
|
9481
|
+
|
|
9482
|
+
var _baseRest = baseRest;
|
|
9483
|
+
|
|
9484
|
+
/**
|
|
9485
|
+
* Checks if the given arguments are from an iteratee call.
|
|
9486
|
+
*
|
|
9487
|
+
* @private
|
|
9488
|
+
* @param {*} value The potential iteratee value argument.
|
|
9489
|
+
* @param {*} index The potential iteratee index or key argument.
|
|
9490
|
+
* @param {*} object The potential iteratee object argument.
|
|
9491
|
+
* @returns {boolean} Returns `true` if the arguments are from an iteratee call,
|
|
9492
|
+
* else `false`.
|
|
9493
|
+
*/
|
|
9494
|
+
function isIterateeCall(value, index, object) {
|
|
9495
|
+
if (!isObject_1(object)) {
|
|
9496
|
+
return false;
|
|
9497
|
+
}
|
|
9498
|
+
var type = typeof index;
|
|
9499
|
+
if (type == 'number'
|
|
9500
|
+
? (isArrayLike_1(object) && _isIndex(index, object.length))
|
|
9501
|
+
: (type == 'string' && index in object)
|
|
9502
|
+
) {
|
|
9503
|
+
return eq_1(object[index], value);
|
|
9504
|
+
}
|
|
9505
|
+
return false;
|
|
9506
|
+
}
|
|
9507
|
+
|
|
9508
|
+
var _isIterateeCall = isIterateeCall;
|
|
9509
|
+
|
|
9510
|
+
/**
|
|
9511
|
+
* Creates an array of elements, sorted in ascending order by the results of
|
|
9512
|
+
* running each element in a collection thru each iteratee. This method
|
|
9513
|
+
* performs a stable sort, that is, it preserves the original sort order of
|
|
9514
|
+
* equal elements. The iteratees are invoked with one argument: (value).
|
|
9515
|
+
*
|
|
9516
|
+
* @static
|
|
9517
|
+
* @memberOf _
|
|
9518
|
+
* @since 0.1.0
|
|
9519
|
+
* @category Collection
|
|
9520
|
+
* @param {Array|Object} collection The collection to iterate over.
|
|
9521
|
+
* @param {...(Function|Function[])} [iteratees=[_.identity]]
|
|
9522
|
+
* The iteratees to sort by.
|
|
9523
|
+
* @returns {Array} Returns the new sorted array.
|
|
9524
|
+
* @example
|
|
9525
|
+
*
|
|
9526
|
+
* var users = [
|
|
9527
|
+
* { 'user': 'fred', 'age': 48 },
|
|
9528
|
+
* { 'user': 'barney', 'age': 36 },
|
|
9529
|
+
* { 'user': 'fred', 'age': 30 },
|
|
9530
|
+
* { 'user': 'barney', 'age': 34 }
|
|
9531
|
+
* ];
|
|
9532
|
+
*
|
|
9533
|
+
* _.sortBy(users, [function(o) { return o.user; }]);
|
|
9534
|
+
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
|
|
9535
|
+
*
|
|
9536
|
+
* _.sortBy(users, ['user', 'age']);
|
|
9537
|
+
* // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
|
|
9538
|
+
*/
|
|
9539
|
+
var sortBy = _baseRest(function(collection, iteratees) {
|
|
9540
|
+
if (collection == null) {
|
|
9541
|
+
return [];
|
|
9542
|
+
}
|
|
9543
|
+
var length = iteratees.length;
|
|
9544
|
+
if (length > 1 && _isIterateeCall(collection, iteratees[0], iteratees[1])) {
|
|
9545
|
+
iteratees = [];
|
|
9546
|
+
} else if (length > 2 && _isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
|
|
9547
|
+
iteratees = [iteratees[0]];
|
|
9548
|
+
}
|
|
9549
|
+
return _baseOrderBy(collection, _baseFlatten(iteratees, 1), []);
|
|
9550
|
+
});
|
|
9551
|
+
|
|
9552
|
+
var sortBy_1 = sortBy;
|
|
9553
|
+
|
|
9554
|
+
/**
|
|
9555
|
+
* Configuration for custom action validation rules.
|
|
9556
|
+
* Defines allowed positions, metadata IDs, data model IDs, and fields for each target
|
|
9557
|
+
* type.
|
|
9558
|
+
*
|
|
9559
|
+
*/
|
|
9560
|
+
const customActionValidationConfig = {
|
|
9561
|
+
[CustomActionTarget.LIVEBOARD]: {
|
|
9562
|
+
positions: [exports.CustomActionsPosition.PRIMARY, exports.CustomActionsPosition.MENU],
|
|
9563
|
+
allowedMetadataIds: ['liveboardIds'],
|
|
9564
|
+
allowedDataModelIds: [],
|
|
9565
|
+
allowedFields: ['name', 'id', 'position', 'target', 'metadataIds', 'orgIds', 'groupIds'],
|
|
9566
|
+
},
|
|
9567
|
+
[CustomActionTarget.VIZ]: {
|
|
9568
|
+
positions: [exports.CustomActionsPosition.MENU, exports.CustomActionsPosition.PRIMARY, exports.CustomActionsPosition.CONTEXTMENU],
|
|
9569
|
+
allowedMetadataIds: ['liveboardIds', 'vizIds', 'answerIds'],
|
|
9570
|
+
allowedDataModelIds: ['modelIds', 'modelColumnNames'],
|
|
9571
|
+
allowedFields: ['name', 'id', 'position', 'target', 'metadataIds', 'orgIds', 'groupIds', 'dataModelIds'],
|
|
9572
|
+
},
|
|
9573
|
+
[CustomActionTarget.ANSWER]: {
|
|
9574
|
+
positions: [exports.CustomActionsPosition.MENU, exports.CustomActionsPosition.PRIMARY, exports.CustomActionsPosition.CONTEXTMENU],
|
|
9575
|
+
allowedMetadataIds: ['answerIds'],
|
|
9576
|
+
allowedDataModelIds: ['modelIds', 'modelColumnNames'],
|
|
9577
|
+
allowedFields: ['name', 'id', 'position', 'target', 'metadataIds', 'orgIds', 'groupIds', 'dataModelIds'],
|
|
9578
|
+
},
|
|
9579
|
+
[CustomActionTarget.SPOTTER]: {
|
|
9580
|
+
positions: [exports.CustomActionsPosition.MENU, exports.CustomActionsPosition.CONTEXTMENU],
|
|
9581
|
+
allowedMetadataIds: [],
|
|
9582
|
+
allowedDataModelIds: ['modelIds'],
|
|
9583
|
+
allowedFields: ['name', 'id', 'position', 'target', 'orgIds', 'groupIds', 'dataModelIds'],
|
|
9584
|
+
},
|
|
9585
|
+
};
|
|
9586
|
+
/**
|
|
9587
|
+
* Validates a single custom action based on its target type
|
|
9588
|
+
* @param action - The custom action to validate
|
|
9589
|
+
* @param primaryActionsPerTarget - Map to track primary actions per target
|
|
9590
|
+
* @returns CustomActionValidation with isValid flag and reason string
|
|
9591
|
+
*
|
|
9592
|
+
* @hidden
|
|
9593
|
+
*/
|
|
9594
|
+
const validateCustomAction = (action, primaryActionsPerTarget) => {
|
|
9595
|
+
const { id: actionId, target: targetType, position, metadataIds, dataModelIds } = action;
|
|
9596
|
+
// Check if target type is supported
|
|
9597
|
+
if (!customActionValidationConfig[targetType]) {
|
|
9598
|
+
const errorMessage = CUSTOM_ACTIONS_ERROR_MESSAGE.UNSUPPORTED_TARGET(actionId, targetType);
|
|
9599
|
+
return { isValid: false, errors: [errorMessage] };
|
|
9600
|
+
}
|
|
9601
|
+
const config = customActionValidationConfig[targetType];
|
|
9602
|
+
const errors = [];
|
|
9603
|
+
// Validate position
|
|
9604
|
+
if (!arrayIncludesString(config.positions, position)) {
|
|
9605
|
+
const supportedPositions = config.positions.join(', ');
|
|
9606
|
+
errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.INVALID_POSITION(position, targetType, supportedPositions));
|
|
9607
|
+
}
|
|
9608
|
+
// Validate metadata IDs
|
|
9609
|
+
if (metadataIds) {
|
|
9610
|
+
const invalidMetadataIds = Object.keys(metadataIds).filter((key) => !arrayIncludesString(config.allowedMetadataIds, key));
|
|
9611
|
+
if (invalidMetadataIds.length > 0) {
|
|
9612
|
+
const supportedMetadataIds = config.allowedMetadataIds.length > 0 ? config.allowedMetadataIds.join(', ') : 'none';
|
|
9613
|
+
errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.INVALID_METADATA_IDS(targetType, invalidMetadataIds, supportedMetadataIds));
|
|
9614
|
+
}
|
|
8147
9615
|
}
|
|
8148
|
-
|
|
8149
|
-
|
|
8150
|
-
|
|
9616
|
+
// Validate data model IDs
|
|
9617
|
+
if (dataModelIds) {
|
|
9618
|
+
const invalidDataModelIds = Object.keys(dataModelIds).filter((key) => !arrayIncludesString(config.allowedDataModelIds, key));
|
|
9619
|
+
if (invalidDataModelIds.length > 0) {
|
|
9620
|
+
const supportedDataModelIds = config.allowedDataModelIds.length > 0 ? config.allowedDataModelIds.join(', ') : 'none';
|
|
9621
|
+
errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.INVALID_DATA_MODEL_IDS(targetType, invalidDataModelIds, supportedDataModelIds));
|
|
8151
9622
|
}
|
|
8152
|
-
this.answer = this.executeQuery(getAnswer, {}).then((data) => data === null || data === void 0 ? void 0 : data.answer);
|
|
8153
|
-
return this.answer;
|
|
8154
|
-
}
|
|
8155
|
-
async getTML() {
|
|
8156
|
-
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
8157
|
-
const edoc = object[0].edoc;
|
|
8158
|
-
const YAML = await Promise.resolve().then(function () { return index; });
|
|
8159
|
-
const parsedDoc = YAML.parse(edoc);
|
|
8160
|
-
return {
|
|
8161
|
-
answer: {
|
|
8162
|
-
...parsedDoc.answer,
|
|
8163
|
-
...this.tmlOverride,
|
|
8164
|
-
},
|
|
8165
|
-
};
|
|
8166
|
-
}
|
|
8167
|
-
async addDisplayedVizToLiveboard(liveboardId) {
|
|
8168
|
-
const { displayMode, visualizations } = await this.getAnswer();
|
|
8169
|
-
const viz = getDisplayedViz(visualizations, displayMode);
|
|
8170
|
-
return this.executeQuery(addVizToLiveboard, {
|
|
8171
|
-
liveboardId,
|
|
8172
|
-
vizId: viz.id,
|
|
8173
|
-
});
|
|
8174
9623
|
}
|
|
8175
|
-
|
|
8176
|
-
|
|
9624
|
+
// Validate allowed fields
|
|
9625
|
+
const actionKeys = Object.keys(action);
|
|
9626
|
+
const invalidFields = actionKeys.filter((key) => !arrayIncludesString(config.allowedFields, key));
|
|
9627
|
+
if (invalidFields.length > 0) {
|
|
9628
|
+
const supportedFields = config.allowedFields.join(', ');
|
|
9629
|
+
errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.INVALID_FIELDS(targetType, invalidFields, supportedFields));
|
|
8177
9630
|
}
|
|
8178
|
-
|
|
9631
|
+
return {
|
|
9632
|
+
isValid: errors.length === 0,
|
|
9633
|
+
errors,
|
|
9634
|
+
};
|
|
9635
|
+
};
|
|
8179
9636
|
/**
|
|
9637
|
+
* Validates basic action structure and required fields
|
|
9638
|
+
* @param action - The action to validate
|
|
9639
|
+
* @returns Object containing validation result and missing fields
|
|
8180
9640
|
*
|
|
8181
|
-
* @
|
|
8182
|
-
* @param colNames
|
|
9641
|
+
* @hidden
|
|
8183
9642
|
*/
|
|
8184
|
-
|
|
8185
|
-
|
|
8186
|
-
|
|
8187
|
-
|
|
8188
|
-
|
|
8189
|
-
|
|
8190
|
-
|
|
8191
|
-
|
|
8192
|
-
}));
|
|
8193
|
-
}
|
|
9643
|
+
const validateActionStructure = (action) => {
|
|
9644
|
+
if (!action || typeof action !== 'object') {
|
|
9645
|
+
return { isValid: false, missingFields: [] };
|
|
9646
|
+
}
|
|
9647
|
+
// Check for all missing required fields
|
|
9648
|
+
const missingFields = ['id', 'name', 'target', 'position'].filter(field => !action[field]);
|
|
9649
|
+
return { isValid: missingFields.length === 0, missingFields };
|
|
9650
|
+
};
|
|
8194
9651
|
/**
|
|
9652
|
+
* Checks for duplicate IDs among actions
|
|
9653
|
+
* @param actions - Array of actions to check
|
|
9654
|
+
* @returns Object containing filtered actions and duplicate errors
|
|
8195
9655
|
*
|
|
8196
|
-
* @
|
|
9656
|
+
* @hidden
|
|
8197
9657
|
*/
|
|
8198
|
-
|
|
8199
|
-
const
|
|
8200
|
-
|
|
8201
|
-
|
|
8202
|
-
|
|
8203
|
-
|
|
8204
|
-
|
|
8205
|
-
|
|
8206
|
-
|
|
8207
|
-
|
|
8208
|
-
let dataValue;
|
|
8209
|
-
if (dataType === 'DATE') {
|
|
8210
|
-
if (Number.isFinite(colVal.value)) {
|
|
8211
|
-
dataValue = [{
|
|
8212
|
-
epochRange: {
|
|
8213
|
-
startEpoch: colVal.value,
|
|
8214
|
-
},
|
|
8215
|
-
}];
|
|
8216
|
-
// Case for custom calendar.
|
|
8217
|
-
}
|
|
8218
|
-
else if ((_a = colVal.value) === null || _a === void 0 ? void 0 : _a.v) {
|
|
8219
|
-
dataValue = [{
|
|
8220
|
-
epochRange: {
|
|
8221
|
-
startEpoch: colVal.value.v.s,
|
|
8222
|
-
endEpoch: colVal.value.v.e,
|
|
8223
|
-
},
|
|
8224
|
-
}];
|
|
8225
|
-
}
|
|
9658
|
+
const filterDuplicateIds = (actions) => {
|
|
9659
|
+
const idMap = actions.reduce((map, action) => {
|
|
9660
|
+
const list = map.get(action.id) || [];
|
|
9661
|
+
list.push(action);
|
|
9662
|
+
map.set(action.id, list);
|
|
9663
|
+
return map;
|
|
9664
|
+
}, new Map());
|
|
9665
|
+
const { actions: actionsWithUniqueIds, errors } = Array.from(idMap.entries()).reduce((acc, [id, actionsWithSameId]) => {
|
|
9666
|
+
if (actionsWithSameId.length === 1) {
|
|
9667
|
+
acc.actions.push(actionsWithSameId[0]);
|
|
8226
9668
|
}
|
|
8227
9669
|
else {
|
|
8228
|
-
|
|
9670
|
+
// Keep the first action and add error for duplicates
|
|
9671
|
+
acc.actions.push(actionsWithSameId[0]);
|
|
9672
|
+
const duplicateNames = actionsWithSameId.slice(1).map(action => action.name);
|
|
9673
|
+
acc.errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.DUPLICATE_IDS(id, duplicateNames, actionsWithSameId[0].name));
|
|
8229
9674
|
}
|
|
8230
|
-
|
|
8231
|
-
|
|
8232
|
-
|
|
8233
|
-
|
|
8234
|
-
}
|
|
8235
|
-
selectedPoints.forEach((p) => {
|
|
8236
|
-
p.selectedAttributes.forEach(addPointFromColVal);
|
|
8237
|
-
});
|
|
8238
|
-
return underlyingDataPoint;
|
|
8239
|
-
}
|
|
9675
|
+
return acc;
|
|
9676
|
+
}, { actions: [], errors: [] });
|
|
9677
|
+
return { actions: actionsWithUniqueIds, errors };
|
|
9678
|
+
};
|
|
8240
9679
|
/**
|
|
8241
|
-
*
|
|
8242
|
-
* @param
|
|
8243
|
-
* @
|
|
9680
|
+
* Validates and processes custom actions
|
|
9681
|
+
* @param customActions - Array of custom actions to validate
|
|
9682
|
+
* @returns Object containing valid actions and any validation errors
|
|
8244
9683
|
*/
|
|
8245
|
-
|
|
8246
|
-
|
|
8247
|
-
|
|
8248
|
-
|
|
8249
|
-
|
|
8250
|
-
|
|
8251
|
-
|
|
8252
|
-
|
|
8253
|
-
|
|
8254
|
-
|
|
9684
|
+
const getCustomActions = (customActions) => {
|
|
9685
|
+
const errors = [];
|
|
9686
|
+
if (!customActions || !Array.isArray(customActions)) {
|
|
9687
|
+
return { actions: [], errors: [] };
|
|
9688
|
+
}
|
|
9689
|
+
// Step 1: Handle invalid actions first (null, undefined, missing required
|
|
9690
|
+
// fields)
|
|
9691
|
+
const validActions = customActions.filter(action => {
|
|
9692
|
+
const validation = validateActionStructure(action);
|
|
9693
|
+
if (!validation.isValid) {
|
|
9694
|
+
if (!action || typeof action !== 'object') {
|
|
9695
|
+
errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.INVALID_ACTION_OBJECT);
|
|
9696
|
+
}
|
|
9697
|
+
else {
|
|
9698
|
+
errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.MISSING_REQUIRED_FIELDS(action.id, validation.missingFields));
|
|
9699
|
+
}
|
|
9700
|
+
return false;
|
|
9701
|
+
}
|
|
9702
|
+
return true;
|
|
9703
|
+
});
|
|
9704
|
+
// Step 2: Check for duplicate IDs among valid actions
|
|
9705
|
+
const { actions: actionsWithUniqueIds, errors: duplicateErrors } = filterDuplicateIds(validActions);
|
|
9706
|
+
// Add duplicate errors to the errors array
|
|
9707
|
+
duplicateErrors.forEach(error => errors.push(error));
|
|
9708
|
+
// Step 3: Validate actions with unique IDs
|
|
9709
|
+
const finalValidActions = [];
|
|
9710
|
+
actionsWithUniqueIds.forEach((action) => {
|
|
9711
|
+
const { isValid, errors: validationErrors } = validateCustomAction(action);
|
|
9712
|
+
validationErrors.forEach(error => errors.push(error));
|
|
9713
|
+
if (isValid) {
|
|
9714
|
+
finalValidActions.push(action);
|
|
9715
|
+
}
|
|
9716
|
+
});
|
|
9717
|
+
const sortedActions = sortBy_1(finalValidActions, (a) => a.name.toLocaleLowerCase());
|
|
9718
|
+
return {
|
|
9719
|
+
actions: sortedActions,
|
|
9720
|
+
errors: errors,
|
|
9721
|
+
};
|
|
9722
|
+
};
|
|
8255
9723
|
|
|
8256
9724
|
/**
|
|
8257
9725
|
* Copyright (c) 2023
|
|
@@ -15779,6 +17247,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15779
17247
|
handleExitPresentMode();
|
|
15780
17248
|
}
|
|
15781
17249
|
}
|
|
17250
|
+
/**
|
|
17251
|
+
* Clears the cached preauth and session info.
|
|
17252
|
+
*/
|
|
17253
|
+
function processClearInfoCache() {
|
|
17254
|
+
resetCachedPreauthInfo();
|
|
17255
|
+
resetCachedSessionInfo();
|
|
17256
|
+
}
|
|
15782
17257
|
/**
|
|
15783
17258
|
*
|
|
15784
17259
|
* @param e
|
|
@@ -15885,11 +17360,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15885
17360
|
return processAuthLogout(e, containerEl);
|
|
15886
17361
|
case exports.EmbedEvent.ExitPresentMode:
|
|
15887
17362
|
return processExitPresentMode();
|
|
17363
|
+
case exports.EmbedEvent.CLEAR_INFO_CACHE:
|
|
17364
|
+
return processClearInfoCache();
|
|
15888
17365
|
}
|
|
15889
17366
|
return e;
|
|
15890
17367
|
}
|
|
15891
17368
|
|
|
15892
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.41.0
|
|
17369
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.41.0";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^11.2.0","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"32 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
|
|
15893
17370
|
|
|
15894
17371
|
/**
|
|
15895
17372
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -16200,10 +17677,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16200
17677
|
};
|
|
16201
17678
|
this.showPreRenderByDefault = false;
|
|
16202
17679
|
/**
|
|
16203
|
-
|
|
16204
|
-
|
|
16205
|
-
|
|
16206
|
-
|
|
17680
|
+
* @hidden
|
|
17681
|
+
* Internal state to track if the embed container is loaded.
|
|
17682
|
+
* This is used to trigger events after the embed container is loaded.
|
|
17683
|
+
*/
|
|
16207
17684
|
this.isEmbedContainerLoaded = false;
|
|
16208
17685
|
/**
|
|
16209
17686
|
* @hidden
|
|
@@ -16262,10 +17739,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16262
17739
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
|
|
16263
17740
|
...viewConfig,
|
|
16264
17741
|
});
|
|
16265
|
-
const embedConfig = getEmbedConfig();
|
|
16266
|
-
this.embedConfig = embedConfig;
|
|
16267
17742
|
this.hostEventClient = new HostEventClient(this.iFrame);
|
|
16268
17743
|
this.isReadyForRenderPromise = getInitPromise().then(async () => {
|
|
17744
|
+
const embedConfig = getEmbedConfig();
|
|
17745
|
+
this.embedConfig = embedConfig;
|
|
16269
17746
|
if (!embedConfig.authTriggerContainer && !embedConfig.useEventForSAMLPopup) {
|
|
16270
17747
|
this.embedConfig.authTriggerContainer = domSelector;
|
|
16271
17748
|
}
|
|
@@ -16414,6 +17891,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16414
17891
|
async getDefaultAppInitData() {
|
|
16415
17892
|
var _a, _b;
|
|
16416
17893
|
const authToken = await this.getAuthTokenForCookielessInit();
|
|
17894
|
+
const customActionsResult = getCustomActions([
|
|
17895
|
+
...(this.viewConfig.customActions || []),
|
|
17896
|
+
...(this.embedConfig.customActions || [])
|
|
17897
|
+
]);
|
|
17898
|
+
if (customActionsResult.errors.length > 0) {
|
|
17899
|
+
this.handleError({
|
|
17900
|
+
type: 'CUSTOM_ACTION_VALIDATION',
|
|
17901
|
+
message: customActionsResult.errors,
|
|
17902
|
+
});
|
|
17903
|
+
}
|
|
16417
17904
|
return {
|
|
16418
17905
|
customisations: getCustomisations(this.embedConfig, this.viewConfig),
|
|
16419
17906
|
authToken,
|
|
@@ -16431,6 +17918,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16431
17918
|
: [],
|
|
16432
17919
|
customVariablesForThirdPartyTools: this.embedConfig.customVariablesForThirdPartyTools || {},
|
|
16433
17920
|
hiddenListColumns: this.viewConfig.hiddenListColumns || [],
|
|
17921
|
+
customActions: customActionsResult.actions,
|
|
16434
17922
|
};
|
|
16435
17923
|
}
|
|
16436
17924
|
async getAppInitData() {
|
|
@@ -16450,11 +17938,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16450
17938
|
.join('/');
|
|
16451
17939
|
return `${basePath}#`;
|
|
16452
17940
|
}
|
|
16453
|
-
getUpdateEmbedParamsObject() {
|
|
16454
|
-
let queryParams = this.getEmbedParamsObject();
|
|
16455
|
-
queryParams = { ...this.viewConfig, ...queryParams };
|
|
16456
|
-
return queryParams;
|
|
16457
|
-
}
|
|
16458
17941
|
/**
|
|
16459
17942
|
* Common query params set for all the embed modes.
|
|
16460
17943
|
* @param queryParams
|
|
@@ -16604,13 +18087,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16604
18087
|
return path;
|
|
16605
18088
|
}
|
|
16606
18089
|
getEmbedParams() {
|
|
16607
|
-
const queryParams = this.
|
|
18090
|
+
const queryParams = this.getBaseQueryParams();
|
|
16608
18091
|
return getQueryParamString(queryParams);
|
|
16609
18092
|
}
|
|
16610
|
-
getEmbedParamsObject() {
|
|
16611
|
-
const params = this.getBaseQueryParams();
|
|
16612
|
-
return params;
|
|
16613
|
-
}
|
|
16614
18093
|
getRootIframeSrc() {
|
|
16615
18094
|
const query = this.getEmbedParams();
|
|
16616
18095
|
return this.getEmbedBasePath(query);
|
|
@@ -17171,12 +18650,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17171
18650
|
return this.preRender(true);
|
|
17172
18651
|
}
|
|
17173
18652
|
this.validatePreRenderViewConfig(this.viewConfig);
|
|
17174
|
-
logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
|
|
17175
|
-
this.executeAfterEmbedContainerLoaded(() => {
|
|
17176
|
-
this.trigger(exports.HostEvent.UpdateEmbedParams, this.getUpdateEmbedParamsObject());
|
|
17177
|
-
});
|
|
17178
18653
|
}
|
|
17179
|
-
this.beforePrerenderVisible();
|
|
17180
18654
|
if (this.el) {
|
|
17181
18655
|
this.syncPreRenderStyle();
|
|
17182
18656
|
if (!this.viewConfig.doNotTrackPreRenderSize) {
|
|
@@ -17193,6 +18667,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17193
18667
|
this.resizeObserver.observe(this.el);
|
|
17194
18668
|
}
|
|
17195
18669
|
}
|
|
18670
|
+
this.beforePrerenderVisible();
|
|
17196
18671
|
removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events']);
|
|
17197
18672
|
this.subscribeToEvents();
|
|
17198
18673
|
// Setup fullscreen change handler for prerendered components
|
|
@@ -17381,9 +18856,15 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17381
18856
|
this.embedComponentType = 'SearchBarEmbed';
|
|
17382
18857
|
this.viewConfig = viewConfig;
|
|
17383
18858
|
}
|
|
17384
|
-
|
|
18859
|
+
/**
|
|
18860
|
+
* Construct the URL of the embedded ThoughtSpot search to be
|
|
18861
|
+
* loaded in the iframe
|
|
18862
|
+
* @param dataSources A list of data source GUIDs
|
|
18863
|
+
*/
|
|
18864
|
+
getIFrameSrc() {
|
|
17385
18865
|
var _a;
|
|
17386
18866
|
const { searchOptions, dataSource, dataSources, useLastSelectedSources = false, excludeSearchTokenStringFromURL, } = this.viewConfig;
|
|
18867
|
+
const path = 'search-bar-embed';
|
|
17387
18868
|
const queryParams = this.getBaseQueryParams();
|
|
17388
18869
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
17389
18870
|
if (dataSources && dataSources.length) {
|
|
@@ -17405,16 +18886,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17405
18886
|
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
17406
18887
|
}
|
|
17407
18888
|
queryParams[Param.searchEmbed] = true;
|
|
17408
|
-
return queryParams;
|
|
17409
|
-
}
|
|
17410
|
-
/**
|
|
17411
|
-
* Construct the URL of the embedded ThoughtSpot search to be
|
|
17412
|
-
* loaded in the iframe
|
|
17413
|
-
* @param dataSources A list of data source GUIDs
|
|
17414
|
-
*/
|
|
17415
|
-
getIFrameSrc() {
|
|
17416
|
-
const queryParams = this.getEmbedParamsObject();
|
|
17417
|
-
const path = 'search-bar-embed';
|
|
17418
18889
|
let query = '';
|
|
17419
18890
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
17420
18891
|
if (queryParamsString) {
|
|
@@ -17465,7 +18936,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17465
18936
|
viewConfig.embedComponentType = 'SageEmbed';
|
|
17466
18937
|
super(domSelector, viewConfig);
|
|
17467
18938
|
}
|
|
17468
|
-
|
|
18939
|
+
/**
|
|
18940
|
+
* Constructs a map of parameters to be passed on to the
|
|
18941
|
+
* embedded Eureka or Sage search page.
|
|
18942
|
+
* @returns {string} query string
|
|
18943
|
+
*/
|
|
18944
|
+
getEmbedParams() {
|
|
17469
18945
|
const { disableWorksheetChange, hideWorksheetSelector, showObjectSuggestions, dataPanelV2, hideSampleQuestions, isProductTour, hideSageAnswerHeader, hideAutocompleteSuggestions, } = this.viewConfig;
|
|
17470
18946
|
const params = this.getBaseQueryParams();
|
|
17471
18947
|
params[Param.DataPanelV2Enabled] = !!dataPanelV2;
|
|
@@ -17480,15 +18956,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17480
18956
|
params[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
17481
18957
|
params[Param.IsProductTour] = !!isProductTour;
|
|
17482
18958
|
params[Param.HideSageAnswerHeader] = !!hideSageAnswerHeader;
|
|
17483
|
-
return params;
|
|
17484
|
-
}
|
|
17485
|
-
/**
|
|
17486
|
-
* Constructs a map of parameters to be passed on to the
|
|
17487
|
-
* embedded Eureka or Sage search page.
|
|
17488
|
-
* @returns {string} query string
|
|
17489
|
-
*/
|
|
17490
|
-
getEmbedParams() {
|
|
17491
|
-
const params = this.getEmbedParamsObject();
|
|
17492
18959
|
return getQueryParamString(params, true);
|
|
17493
18960
|
}
|
|
17494
18961
|
/**
|
|
@@ -17598,9 +19065,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17598
19065
|
const defaultAppInitData = await super.getAppInitData();
|
|
17599
19066
|
return { ...defaultAppInitData, ...this.getSearchInitData() };
|
|
17600
19067
|
}
|
|
17601
|
-
|
|
19068
|
+
getEmbedParams() {
|
|
17602
19069
|
var _a;
|
|
17603
|
-
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = false, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
|
|
19070
|
+
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = false, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
|
|
19071
|
+
/* eslint-disable-next-line max-len */
|
|
19072
|
+
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
|
|
17604
19073
|
const queryParams = this.getBaseQueryParams();
|
|
17605
19074
|
queryParams[Param.HideActions] = [
|
|
17606
19075
|
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
@@ -17633,6 +19102,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17633
19102
|
queryParams[Param.HideSearchBar] = true;
|
|
17634
19103
|
}
|
|
17635
19104
|
if (isOnBeforeGetVizDataInterceptEnabled) {
|
|
19105
|
+
/* eslint-disable-next-line max-len */
|
|
17636
19106
|
queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
17637
19107
|
}
|
|
17638
19108
|
if (!focusSearchBarOnRender) {
|
|
@@ -17645,22 +19115,20 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17645
19115
|
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
17646
19116
|
}
|
|
17647
19117
|
queryParams[Param.searchEmbed] = true;
|
|
19118
|
+
/* eslint-disable-next-line max-len */
|
|
17648
19119
|
queryParams[Param.CollapseSearchBarInitially] = collapseSearchBarInitially || collapseSearchBar;
|
|
17649
19120
|
queryParams[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
17650
19121
|
if (dataPanelCustomGroupsAccordionInitialState
|
|
17651
19122
|
=== DataPanelCustomColumnGroupsAccordionState$1.COLLAPSE_ALL
|
|
17652
19123
|
|| dataPanelCustomGroupsAccordionInitialState
|
|
17653
19124
|
=== DataPanelCustomColumnGroupsAccordionState$1.EXPAND_FIRST) {
|
|
19125
|
+
/* eslint-disable-next-line max-len */
|
|
17654
19126
|
queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
|
|
17655
19127
|
}
|
|
17656
19128
|
else {
|
|
19129
|
+
/* eslint-disable-next-line max-len */
|
|
17657
19130
|
queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL;
|
|
17658
19131
|
}
|
|
17659
|
-
return queryParams;
|
|
17660
|
-
}
|
|
17661
|
-
getEmbedParams() {
|
|
17662
|
-
const { runtimeParameters, runtimeFilters, excludeRuntimeParametersfromURL, excludeRuntimeFiltersfromURL, } = this.viewConfig;
|
|
17663
|
-
const queryParams = this.getEmbedParamsObject();
|
|
17664
19132
|
let query = '';
|
|
17665
19133
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
17666
19134
|
if (queryParamsString) {
|
|
@@ -17801,6 +19269,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17801
19269
|
* It serves as the foundational version of the home page.
|
|
17802
19270
|
*/
|
|
17803
19271
|
HomePage["Modular"] = "v2";
|
|
19272
|
+
/**
|
|
19273
|
+
* ModularWithStylingChanges (v3) introduces Modular Home Experience
|
|
19274
|
+
* with styling changes.
|
|
19275
|
+
*/
|
|
19276
|
+
HomePage["ModularWithStylingChanges"] = "v3";
|
|
17804
19277
|
})(HomePage || (HomePage = {}));
|
|
17805
19278
|
/**
|
|
17806
19279
|
* Define the version of the list page
|
|
@@ -17888,7 +19361,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17888
19361
|
* embedded Liveboard or visualization.
|
|
17889
19362
|
*/
|
|
17890
19363
|
getEmbedParams() {
|
|
17891
|
-
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
|
|
19364
|
+
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
|
|
17892
19365
|
let params = {};
|
|
17893
19366
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
17894
19367
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -17905,6 +19378,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17905
19378
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
17906
19379
|
params[Param.IsUnifiedSearchExperienceEnabled] = isUnifiedSearchExperienceEnabled;
|
|
17907
19380
|
params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
|
|
19381
|
+
params[Param.LiveboardXLSXCSVDownload] = !!liveboardXLSXCSVDownload;
|
|
17908
19382
|
params = this.getBaseQueryParams(params);
|
|
17909
19383
|
if (hideObjectSearch) {
|
|
17910
19384
|
params[Param.HideObjectSearch] = !!hideObjectSearch;
|
|
@@ -17972,6 +19446,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17972
19446
|
// To use v3 navigation, we must manually set the discoveryExperience
|
|
17973
19447
|
// settings.
|
|
17974
19448
|
params[Param.NavigationVersion] = 'v2';
|
|
19449
|
+
// Set homePageVersion to v2 by default to reset the LD flag value
|
|
19450
|
+
// for the homepageVersion.
|
|
19451
|
+
params[Param.HomepageVersion] = 'v2';
|
|
19452
|
+
// Set listpageVersion to v2 by default to reset the LD flag value
|
|
19453
|
+
// for the listpageVersion.
|
|
19454
|
+
params[Param.ListPageVersion] = ListPage.List;
|
|
17975
19455
|
if (discoveryExperience) {
|
|
17976
19456
|
// primaryNavbarVersion v3 will enabled the new left navigation
|
|
17977
19457
|
if (discoveryExperience.primaryNavbarVersion === PrimaryNavbarVersion.Sliding) {
|
|
@@ -17984,6 +19464,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17984
19464
|
if (discoveryExperience.homePage === HomePage.Modular) {
|
|
17985
19465
|
params[Param.ModularHomeExperienceEnabled] = true;
|
|
17986
19466
|
}
|
|
19467
|
+
// ModularWithStylingChanges (v3) introduces the styling changes
|
|
19468
|
+
// to the Modular Homepage.
|
|
19469
|
+
// v3 will be the base version of homePageVersion.
|
|
19470
|
+
if (discoveryExperience.homePage === HomePage.ModularWithStylingChanges) {
|
|
19471
|
+
params[Param.HomepageVersion] = HomePage.ModularWithStylingChanges;
|
|
19472
|
+
}
|
|
17987
19473
|
// listPageVersion v3 will enable the new list page
|
|
17988
19474
|
if (discoveryExperience.listPageVersion === ListPage.ListWithUXChanges) {
|
|
17989
19475
|
params[Param.ListPageVersion] = discoveryExperience.listPageVersion;
|
|
@@ -18287,14 +19773,9 @@ query GetEurekaVizSnapshots(
|
|
|
18287
19773
|
* embedded Liveboard or visualization.
|
|
18288
19774
|
*/
|
|
18289
19775
|
getEmbedParams() {
|
|
18290
|
-
const params = this.getEmbedParamsObject();
|
|
18291
|
-
const queryParams = getQueryParamString(params, true);
|
|
18292
|
-
return queryParams;
|
|
18293
|
-
}
|
|
18294
|
-
getEmbedParamsObject() {
|
|
18295
19776
|
let params = {};
|
|
18296
19777
|
params = this.getBaseQueryParams(params);
|
|
18297
|
-
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 = false, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
|
|
19778
|
+
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 = false, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
|
|
18298
19779
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
18299
19780
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
18300
19781
|
if (fullHeight === true) {
|
|
@@ -18361,27 +19842,9 @@ query GetEurekaVizSnapshots(
|
|
|
18361
19842
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
18362
19843
|
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
18363
19844
|
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
18364
|
-
|
|
18365
|
-
|
|
18366
|
-
|
|
18367
|
-
if (isForceRedirect) {
|
|
18368
|
-
params[Param.IsForceRedirect] = isForceRedirect;
|
|
18369
|
-
}
|
|
18370
|
-
if (dataSourceId !== undefined) {
|
|
18371
|
-
params[Param.DataSourceId] = dataSourceId;
|
|
18372
|
-
}
|
|
18373
|
-
if (isLiveboardStylingAndGroupingEnabled !== undefined) {
|
|
18374
|
-
params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
|
|
18375
|
-
}
|
|
18376
|
-
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
18377
|
-
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
18378
|
-
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
18379
|
-
params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
|
|
18380
|
-
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
18381
|
-
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
18382
|
-
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
18383
|
-
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
18384
|
-
return params;
|
|
19845
|
+
params[Param.LiveboardXLSXCSVDownload] = !!liveboardXLSXCSVDownload;
|
|
19846
|
+
const queryParams = getQueryParamString(params, true);
|
|
19847
|
+
return queryParams;
|
|
18385
19848
|
}
|
|
18386
19849
|
getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
|
|
18387
19850
|
let suffix = `/embed/viz/${liveboardId}`;
|
|
@@ -18939,17 +20402,13 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18939
20402
|
super(container, viewConfig);
|
|
18940
20403
|
this.viewConfig = viewConfig;
|
|
18941
20404
|
}
|
|
18942
|
-
|
|
20405
|
+
getIframeSrc() {
|
|
18943
20406
|
var _a;
|
|
20407
|
+
const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
|
|
20408
|
+
const path = 'conv-assist-answer';
|
|
18944
20409
|
const queryParams = this.getBaseQueryParams();
|
|
18945
20410
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
18946
20411
|
queryParams[Param.isSpotterAgentEmbed] = true;
|
|
18947
|
-
return queryParams;
|
|
18948
|
-
}
|
|
18949
|
-
getIframeSrc() {
|
|
18950
|
-
const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
|
|
18951
|
-
const path = 'conv-assist-answer';
|
|
18952
|
-
const queryParams = this.getEmbedParamsObject();
|
|
18953
20412
|
let query = '';
|
|
18954
20413
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
18955
20414
|
if (queryParamsString) {
|
|
@@ -19105,8 +20564,9 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
19105
20564
|
super(container, viewConfig);
|
|
19106
20565
|
this.viewConfig = viewConfig;
|
|
19107
20566
|
}
|
|
19108
|
-
|
|
20567
|
+
getIframeSrc() {
|
|
19109
20568
|
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
20569
|
+
const path = 'insights/conv-assist';
|
|
19110
20570
|
if (!worksheetId) {
|
|
19111
20571
|
this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
|
|
19112
20572
|
}
|
|
@@ -19127,12 +20587,6 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
19127
20587
|
if (!isUndefined_1(hideSampleQuestions)) {
|
|
19128
20588
|
queryParams[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
19129
20589
|
}
|
|
19130
|
-
return queryParams;
|
|
19131
|
-
}
|
|
19132
|
-
getIframeSrc() {
|
|
19133
|
-
const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
19134
|
-
const path = 'insights/conv-assist';
|
|
19135
|
-
const queryParams = this.getEmbedParamsObject();
|
|
19136
20590
|
let query = '';
|
|
19137
20591
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
19138
20592
|
if (queryParamsString) {
|